Theme - TonnyL/Charles GitHub Wiki

Theme

Built-in Themes

There are two built-in themes:

  • R.style.Charles (light mode)
  • R.style.CharlesDark (dark mode)

Use either theme invoking theme(@StyleRes themeId: Int) while launching Charles:

Charles.from(this@MainActivity)
        ...
        .theme(R.style.Charles) // or R.style.CharlesDark
        ...
        .forResult(REQUEST_CODE_CHOOSE)

Custom Theme

Derive a custom theme from the two built-in themes or even their parent theme. You can customize looks of Charles.

These are attributes (defined in attrs.xml) you can modify:

  • colorPrimary: branding color for the app bar
  • colorPrimaryDark: darker variant for the status bar
  • toolbar: toolbar style
  • toolbar.titleColor: selected category's title color on the toolbar
  • categories.dropdown.titleColor: category title's color in the category dropdown list
  • categories.dropdown.icon.tint: category icon's tint color in the category dropdown list
  • media.emptyView: drawable of the empty view for media
  • media.emptyView.textColor: text color of the empty view
  • media.checkView.iconColor: check mark's color of selected media
  • media.checkView.backgroundColor: check view's background color of selected media
  • media.checkView.borderColor: check view's border color of media
  • media.selected.backgroundColor: selected media's background color
  • media.titleColor: title color of media
  • media.descColor: description text color of media
  • page.backgroundColor: background color of the Activity or Fragment page
  • bottomToolbar.backgroundColor: background color or drawable of the bottom toolbar
  • bottomToolbar.progress.textColor: progress rate button text's color on the bottom toolbar
  • bottomToolbar.apply.textColor: apply button text's color on the bottom toolbar
  • listPopupWindowStyle: style of the category list's dropdown