Java Code Examples for com.afollestad.materialdialogs.MaterialDialog#setItems()

The following examples show how to use com.afollestad.materialdialogs.MaterialDialog#setItems() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FolderChooserDialogCreate.java    From Slide with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence s) {
    if (canGoUp && i == 0) {
        parentFolder = parentFolder.getParentFile();
        if (parentFolder.getAbsolutePath().equals("/storage/emulated"))
            parentFolder = parentFolder.getParentFile();
        canGoUp = parentFolder.getParent() != null;
    } else {
        parentFolder = parentContents[canGoUp ? i - 1 : i];
        canGoUp = true;
        if (parentFolder.getAbsolutePath().equals("/storage/emulated"))
            parentFolder = Environment.getExternalStorageDirectory();
    }
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    getArguments().putString("current_path", parentFolder.getAbsolutePath());
    dialog.setItems(getContentsArray());
}
 
Example 2
Source File: BlacklistPreferenceDialog.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
private void refreshBlacklistData() {
    paths = BlacklistStore.getInstance(getContext()).getPaths();

    MaterialDialog dialog = (MaterialDialog) getDialog();
    if (dialog != null) {
        String[] pathArray = new String[paths.size()];
        pathArray = paths.toArray(pathArray);
        dialog.setItems((CharSequence[]) pathArray);
    }
}
 
Example 3
Source File: BlacklistPreferenceDialog.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private void refreshBlacklistData() {
    paths = BlacklistStore.getInstance(getContext()).getPaths();

    MaterialDialog dialog = (MaterialDialog) getDialog();
    if (dialog != null) {
        String[] pathArray = new String[paths.size()];
        pathArray = paths.toArray(pathArray);
        dialog.setItems((CharSequence[]) pathArray);
    }
}
 
Example 4
Source File: BlacklistPreferenceDialog.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
private void refreshBlacklistData() {
    paths = BlacklistStore.getInstance(getContext()).getPaths();

    MaterialDialog dialog = (MaterialDialog) getDialog();
    if (dialog != null) {
        String[] pathArray = new String[paths.size()];
        pathArray = paths.toArray(pathArray);
        dialog.setItems((CharSequence[]) pathArray);
    }
}
 
Example 5
Source File: FileChooserDialog.java    From APlayer with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onSelection
    (MaterialDialog materialDialog, View view, int i, CharSequence s) {
  if (canGoUp && i == 0) {
    parentFolder = parentFolder.getParentFile();
    if (parentFolder.getAbsolutePath().equals("/storage/emulated")) {
      parentFolder = parentFolder.getParentFile();
    }
    canGoUp = parentFolder.getParent() != null;
  } else {
    parentFolder = parentContents[canGoUp ? i - 1 : i];
    canGoUp = true;
    if (parentFolder.getAbsolutePath().equals("/storage/emulated")) {
      parentFolder = Environment.getExternalStorageDirectory();
    }
  }
  if (parentFolder.isFile()) {
    callback.onFileSelection(this, parentFolder);
    dismiss();
  } else {
    parentContents = listFiles(getBuilder().mimeType, getBuilder().extensions);
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    getArguments().putString("current_path", parentFolder.getAbsolutePath());
    dialog.setItems(getContentsArray());
  }
}
 
Example 6
Source File: FolderChooserDialog.java    From APlayer with GNU General Public License v3.0 5 votes vote down vote up
private void reload() {
  parentContents = listFiles();
  MaterialDialog dialog = (MaterialDialog) getDialog();
  dialog.setTitle(parentFolder.getAbsolutePath());
  getArguments().putString("current_path", parentFolder.getAbsolutePath());
  dialog.setItems(getContentsArray());
}
 
Example 7
Source File: BlacklistPreferenceDialog.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
private void refreshBlacklistData() {
    paths = BlacklistStore.getInstance(getContext()).getPaths();

    MaterialDialog dialog = (MaterialDialog) getDialog();
    if (dialog != null) {
        String[] pathArray = new String[paths.size()];
        pathArray = paths.toArray(pathArray);
        dialog.setItems((CharSequence[]) pathArray);
    }
}
 
Example 8
Source File: ScanMediaFolderChooserDialog.java    From Music-Player with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}
 
Example 9
Source File: BlacklistFolderChooserDialog.java    From Music-Player with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}
 
Example 10
Source File: BlacklistFolderChooserDialog.java    From RetroMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}
 
Example 11
Source File: ScanMediaFolderChooserDialog.java    From VinylMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}
 
Example 12
Source File: BlacklistFolderChooserDialog.java    From VinylMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}
 
Example 13
Source File: ScanMediaFolderChooserDialog.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}
 
Example 14
Source File: BlacklistFolderChooserDialog.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
private void reload() {
    parentContents = listFiles();
    MaterialDialog dialog = (MaterialDialog) getDialog();
    dialog.setTitle(parentFolder.getAbsolutePath());
    dialog.setItems((CharSequence[]) getContentsArray());
}