// Path: filepicker/src/main/java/com/nbsp/materialfilepicker/widget/EmptyRecyclerView.java
// public class EmptyRecyclerView extends RecyclerView {
//     @Nullable
//     View mEmptyView;
// 
//     public EmptyRecyclerView(Context context) { super(context); }
// 
//     public EmptyRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); }
// 
//     public EmptyRecyclerView(Context context, AttributeSet attrs, int defStyle) {
//         super(context, attrs, defStyle);
//     }
// 
//     void checkIfEmpty() {
//         if (mEmptyView != null) {
//             mEmptyView.setVisibility(getAdapter().getItemCount() > 0 ? GONE : VISIBLE);
//         }
//     }
// 
//     final @NonNull
//     AdapterDataObserver observer = new AdapterDataObserver() {
//         @Override public void onChanged() {
//             super.onChanged();
//             checkIfEmpty();
//         }
//     };
// 
//     @Override public void setAdapter(@Nullable Adapter adapter) {
//         final Adapter oldAdapter = getAdapter();
//         if (oldAdapter != null) {
//             oldAdapter.unregisterAdapterDataObserver(observer);
//         }
//         super.setAdapter(adapter);
//         if (adapter != null) {
//             adapter.registerAdapterDataObserver(observer);
//         }
//     }
// 
//     public void setEmptyView(@Nullable View mEmptyView) {
//         this.mEmptyView = mEmptyView;
//         checkIfEmpty();
//     }
// }


import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.nbsp.materialfilepicker.R;
import com.nbsp.materialfilepicker.filter.CompositeFilter;
import com.nbsp.materialfilepicker.utils.FileUtils;
import com.nbsp.materialfilepicker.widget.EmptyRecyclerView;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
package com.nbsp.materialfilepicker.ui;





/**
 * Created by Dimorinny on 24.10.15.
 */
public class DirectoryFragment extends Fragment {
    interface FileClickListener {
        void onFileClicked(File clickedFile);
    }

    private static final String ARG_FILE_PATH = "arg_file_path";
    private static final String ARG_FILTER = "arg_filter";

    private View mEmptyView;
    private String mPath;

    private CompositeFilter mFilter;

// Path: filepicker/src/main/java/com/nbsp/materialfilepicker/widget/EmptyRecyclerView.java
// public class EmptyRecyclerView extends RecyclerView {
//     @Nullable
//     View mEmptyView;
// 
//     public EmptyRecyclerView(Context context) { super(context); }
// 
//     public EmptyRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); }
// 
//     public EmptyRecyclerView(Context context, AttributeSet attrs, int defStyle) {
//         super(context, attrs, defStyle);
//     }
// 
//     void checkIfEmpty() {
//         if (mEmptyView != null) {
//             mEmptyView.setVisibility(getAdapter().getItemCount() > 0 ? GONE : VISIBLE);
//         }
//     }
// 
//     final @NonNull
//     AdapterDataObserver observer = new AdapterDataObserver() {
//         @Override public void onChanged() {
//             super.onChanged();
//             checkIfEmpty();
//         }
//     };
// 
//     @Override public void setAdapter(@Nullable Adapter adapter) {
//         final Adapter oldAdapter = getAdapter();
//         if (oldAdapter != null) {
//             oldAdapter.unregisterAdapterDataObserver(observer);
//         }
//         super.setAdapter(adapter);
//         if (adapter != null) {
//             adapter.registerAdapterDataObserver(observer);
//         }
//     }
// 
//     public void setEmptyView(@Nullable View mEmptyView) {
//         this.mEmptyView = mEmptyView;
//         checkIfEmpty();
//     }
// }


// Path: filepicker/src/main/java/com/nbsp/materialfilepicker/ui/DirectoryFragment.java
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.nbsp.materialfilepicker.R;
import com.nbsp.materialfilepicker.filter.CompositeFilter;
import com.nbsp.materialfilepicker.utils.FileUtils;
import com.nbsp.materialfilepicker.widget.EmptyRecyclerView;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;

package com.nbsp.materialfilepicker.ui;





/**
 * Created by Dimorinny on 24.10.15.
 */
public class DirectoryFragment extends Fragment {
    interface FileClickListener {
        void onFileClicked(File clickedFile);
    }

    private static final String ARG_FILE_PATH = "arg_file_path";
    private static final String ARG_FILTER = "arg_filter";

    private View mEmptyView;
    private String mPath;

    private CompositeFilter mFilter;

    private EmptyRecyclerView mDirectoryRecyclerView;