Skip to content

New Release v10.1.3

Latest

Choose a tag to compare

@TutorialsAndroid TutorialsAndroid released this 25 May 07:46
· 1 commit to master since this release

Customizing checkbox colors

From v10.1.3, FilePicker supports checkbox color customization through DialogProperties.

This is useful when the default checkbox colors do not match your app theme, or when the unchecked checkbox blends into a white/light background.

import android.graphics.Color;

DialogProperties properties = new DialogProperties();

properties.selection_mode = DialogConfigs.MULTI_MODE;
properties.selection_type = DialogConfigs.DIR_SELECT;

// Checked checkbox fill color
properties.checkbox_checked_color = Color.parseColor("#6750A4");

// Unchecked checkbox outer/background color
properties.checkbox_unchecked_color = Color.parseColor("#6750A4");

// Tick/checkmark color shown when checked
properties.checkbox_checkmark_color = Color.WHITE;

// Inner color shown when unchecked
properties.checkbox_unchecked_inner_color = Color.parseColor("#F3E8FF");

FilePickerDialog dialog = new FilePickerDialog(MainActivity.this, properties);
dialog.setTitle("Select Directory");
dialog.show();

Notes

  • checkbox_checked_color controls the selected checkbox fill color.
  • checkbox_unchecked_color controls the unchecked checkbox outer/background color.
  • checkbox_checkmark_color controls the tick/checkmark color.
  • checkbox_unchecked_inner_color controls the inner unchecked color.
  • If checkbox_checked_color is not set, FilePicker uses the existing R.color.colorAccent fallback.
  • This works for file selection, directory selection, and file + directory selection.