Search in sources :

Example 1 with HiddenAdapter

use of com.amaze.filemanager.adapters.HiddenAdapter in project AmazeFileManager by TeamAmaze.

the class GeneralDialogCreation method showHiddenDialog.

public static void showHiddenDialog(DataUtils dataUtils, SharedPreferences sharedPrefs, final MainFragment m, AppTheme appTheme) {
    int accentColor = m.getMainActivity().getColorPreference().getColor(ColorUsage.ACCENT);
    final MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity());
    a.positiveText(R.string.cancel);
    a.positiveColor(accentColor);
    a.title(R.string.hiddenfiles);
    a.theme(appTheme.getMaterialDialogTheme());
    a.autoDismiss(true);
    HiddenAdapter adapter = new HiddenAdapter(m.getActivity(), m, sharedPrefs, FileUtils.toHybridFileConcurrentRadixTree(dataUtils.getHiddenFiles()), null, false);
    a.adapter(adapter, null);
    a.dividerColor(Color.GRAY);
    MaterialDialog x = a.build();
    adapter.updateDialog(x);
    x.show();
}
Also used : MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) HiddenAdapter(com.amaze.filemanager.adapters.HiddenAdapter)

Example 2 with HiddenAdapter

use of com.amaze.filemanager.adapters.HiddenAdapter in project AmazeFileManager by TeamAmaze.

the class GeneralDialogCreation method showHistoryDialog.

public static void showHistoryDialog(final DataUtils dataUtils, SharedPreferences sharedPrefs, final MainFragment m, AppTheme appTheme) {
    int accentColor = m.getMainActivity().getColorPreference().getColor(ColorUsage.ACCENT);
    final MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity());
    a.positiveText(R.string.cancel);
    a.positiveColor(accentColor);
    a.negativeText(R.string.clear);
    a.negativeColor(accentColor);
    a.title(R.string.history);
    a.onNegative((dialog, which) -> dataUtils.clearHistory());
    a.theme(appTheme.getMaterialDialogTheme());
    a.autoDismiss(true);
    HiddenAdapter adapter = new HiddenAdapter(m.getActivity(), m, sharedPrefs, toHybridFileArrayList(dataUtils.getHistory()), null, true);
    a.adapter(adapter, null);
    MaterialDialog x = a.build();
    adapter.updateDialog(x);
    x.show();
}
Also used : MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) HiddenAdapter(com.amaze.filemanager.adapters.HiddenAdapter)

Aggregations

MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)2 HiddenAdapter (com.amaze.filemanager.adapters.HiddenAdapter)2