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();
}
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();
}
Aggregations