コード例 #1
0
 @Override
 public boolean changeBackgroundColour() {
   if (ScreenSettings.isNightMode()) {
     setBackgroundColor(Color.BLACK);
     setTextColor(Color.WHITE);
   } else {
     setBackgroundColor(Color.WHITE);
     setTextColor(Color.BLACK);
   }
   // should not return false but it is used to see if text needs refreshing, which it doesn't
   return false;
 }
コード例 #2
0
ファイル: BibleView.java プロジェクト: vinod1988/and-bible
  /** may need updating depending on environmental brightness */
  @Override
  public boolean changeBackgroundColour() {
    // if night mode then set scrollbar colour
    int newBackgroundColour = ScreenSettings.isNightMode() ? Color.BLACK : Color.WHITE;
    boolean changed = mCurrentBackgroundColour != newBackgroundColour;

    if (changed) {
      setBackgroundColor(newBackgroundColour);
      mCurrentBackgroundColour = newBackgroundColour;
    }
    return changed;
  }