Exemple #1
0
 private void updateDeveloperPreference() {
   if (ChanPreferences.getDeveloper()) {
     ((PreferenceGroup) findPreference("group_about")).addPreference(developerPreference);
   } else {
     ((PreferenceGroup) findPreference("group_about")).removePreference(developerPreference);
   }
 }
Exemple #2
0
  @Override
  public void onResume() {
    super.onResume();

    final Preference watchPreference = findPreference("watch_settings");
    if (watchPreference != null) {
      watchPreference.setSummary(
          ChanPreferences.getWatchEnabled()
              ? R.string.watch_summary_enabled
              : R.string.watch_summary_disabled);
    }

    final Preference passPreference = findPreference("pass_settings");
    if (passPreference != null) {
      passPreference.setSummary(
          ChanPreferences.getPassEnabled()
              ? R.string.pass_summary_enabled
              : R.string.pass_summary_disabled);
    }
  }
Exemple #3
0
 public void reloadPostViewColors(Context context) {
   this.context = context;
   TypedArray ta =
       context.obtainStyledAttributes(null, R.styleable.PostView, R.attr.post_style, 0);
   quoteColor = ta.getColor(R.styleable.PostView_quote_color, 0);
   highlightQuoteColor = ta.getColor(R.styleable.PostView_highlight_quote_color, 0);
   linkColor = ta.getColor(R.styleable.PostView_link_color, 0);
   spoilerColor = ta.getColor(R.styleable.PostView_spoiler_color, 0);
   inlineQuoteColor = ta.getColor(R.styleable.PostView_inline_quote_color, 0);
   codeTagSize = ta.getDimensionPixelSize(R.styleable.PostView_code_tag_size, 0);
   fontSize = ChanPreferences.getFontSize();
   ta.recycle();
 }
Exemple #4
0
  public Theme getTheme() {
    String themeName = ChanPreferences.getTheme();

    Theme theme = null;
    switch (themeName) {
      case "light":
        theme = Theme.LIGHT;
        break;
      case "dark":
        theme = Theme.DARK;
        break;
      case "black":
        theme = Theme.BLACK;
        break;
    }

    return theme;
  }