content: package dev.abhishekti7.filepickerexample;
  
  import androidx.annotation.NonNull;
  import androidx.annotation.Nullable;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.core.app.ActivityCompat;
  import androidx.core.content.ContextCompat;
  
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.os.Bundle;
  import android.os.Environment;
  import android.util.Log;
  import android.view.View;
  import android.widget.Toast;
  
  import java.util.ArrayList;
  
  import abhishekti7.unicorn.filepicker.UnicornFilePicker;
  import abhishekti7.unicorn.filepicker.utils.Constants;
  import dev.abhishekti7.filepickerexample.databinding.ActivityMainBinding;
  
  public class MainActivity extends AppCompatActivity {
      private static final String TAG = "MainActivity";
  
      private ActivityMainBinding mainBinding;
      private final int REQUEST_CODE_PERMISSIONS = 101;
      private final String[] REQUIRED_PERMISSIONS = new String[]{
              "android.permission.WRITE_EXTERNAL_STORAGE",
              "android.permission.READ_EXTERNAL_STORAGE",
      };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          mainBinding = ActivityMainBinding.inflate(getLayoutInflater());
          View view = mainBinding.getRoot();
          setContentView(view);
  
          if (allPermissionsGranted()) {
              Toast.makeText(MainActivity.this, "Permissions granted by the user.", Toast.LENGTH_SHORT).show();
          } else {
              ActivityCompat.requestPermissions(this, REQUIRED_PERMISSIONS, REQUEST_CODE_PERMISSIONS);
          }
  
  
          mainBinding.btnFilesDark.setOnClickListener((v)->{
              UnicornFilePicker.from(MainActivity.this)
                      .addConfigBuilder()
                      .selectMultipleFiles(true)
                      .showOnlyDirectory(true)
                      .setRootDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
                      .showHiddenFiles(false)
                      .setFilters(new String[]{"pdf", "png", "jpg", "jpeg"})
                      .addItemDivider(true)
                      .theme(R.style.UnicornFilePicker_Dracula)
                      .build()
                      .forResult(Constants.REQ_UNICORN_FILE);
          });
  
          mainBinding.btnFilesLight.setOnClickListener((v)->{
              UnicornFilePicker.from(MainActivity.this)
                      .addConfigBuilder()
                      .selectMultipleFiles(true)
                      .setRootDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
                      .showHiddenFiles(false)
                      .setFilters(new String[]{"pdf", "png", "jpg", "jpeg"})
                      .addItemDivider(true)
                      .theme(R.style.UnicornFilePicker_Default)
                      .build()
                      .forResult(Constants.REQ_UNICORN_FILE);
          });
  
          mainBinding.btnFilesCustom.setOnClickListener((v)->{
              UnicornFilePicker.from(MainActivity.this)
                      .addConfigBuilder()
                      .selectMultipleFiles(true)
                      .setRootDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
                      .showHiddenFiles(false)
                      .setFilters(new String[]{"pdf", "png", "jpg", "jpeg"})
                      .addItemDivider(true)
                      .theme(R.style.Theme_CustomUnicorn)
                      .build()
                      .forResult(Constants.REQ_UNICORN_FILE);
          });
      }
  
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          if(requestCode == Constants.REQ_UNICORN_FILE && resultCode == RESULT_OK){
              if(data!=null){
                  ArrayList<String> files = data.getStringArrayListExtra("filePaths");
                  for(String file : files){
                      Log.e(TAG, file);
                  }
              }
          }
      }
  
      private boolean allPermissionsGranted() {
          for (String permission : REQUIRED_PERMISSIONS) {
              if (ContextCompat.checkSelfPermission(MainActivity.this, permission) != PackageManager.PERMISSION_GRANTED) {
                  return false;
              }
          }
          return true;
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
          if (requestCode == REQUEST_CODE_PERMISSIONS) {
              if (allPermissionsGranted()) {
                  Toast.makeText(MainActivity.this, "Permissions granted by the user.", Toast.LENGTH_SHORT).show();
              } else {
                  Toast.makeText(MainActivity.this, "Permissions not granted by the user.", Toast.LENGTH_SHORT).show();
              }
          }
      }
  }