Skip to content

Commit

Permalink
[Android] Night mode was modularized
Browse files Browse the repository at this point in the history
The only reason we used BravePreferenceFragment is to have a close button in the
settings. This will be re-done in the context of this issue brave/brave-browser#10375

Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/b8f8625d98d573809cf06674f733ae31e6276eec

Android: Modularize c.b.night_mode

Moves c.b.night_mode files to a new moduarlized target chrome/browser/
ui/android/night_mode. This helps modularize other packages that
depend on static utils such as NightModeUtils.

Bug: 1171512
  • Loading branch information
samartnik authored and mkarolin committed Mar 30, 2021
1 parent 76145a9 commit 2d992f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import androidx.preference.PreferenceViewHolder;

import org.chromium.chrome.R;
import org.chromium.chrome.browser.night_mode.R;

public class BraveRadioButtonGroupThemePreference extends RadioButtonGroupThemePreference {
public BraveRadioButtonGroupThemePreference(Context context, AttributeSet attrs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
package org.chromium.chrome.browser.settings.themes;

import android.content.Context;
import androidx.preference.PreferenceViewHolder;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RadioGroup;

import org.chromium.chrome.R;
import org.chromium.components.browser_ui.widget.RadioButtonWithDescription;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.preferences.BravePref;
import org.chromium.components.user_prefs.UserPrefs;
import androidx.preference.PreferenceViewHolder;

import org.chromium.chrome.browser.BraveRelaunchUtils;
import org.chromium.chrome.browser.night_mode.R;
import org.chromium.chrome.browser.night_mode.settings.RadioButtonGroupThemePreference;
import org.chromium.chrome.browser.ntp_background_images.NTPBackgroundImagesBridge;
import org.chromium.chrome.browser.BraveRelaunchUtils;
import org.chromium.chrome.browser.preferences.BravePref;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.components.browser_ui.widget.RadioButtonWithDescription;
import org.chromium.components.user_prefs.UserPrefs;

public class BraveRadioButtonGroupCustomHomepageThemePreference extends RadioButtonGroupThemePreference {

Expand Down Expand Up @@ -50,7 +51,8 @@ public void onBindViewHolder(PreferenceViewHolder holder) {
braveDefaultView.setChecked(true);
}
}
braveDefaultView.setPrimaryText(getContext().getResources().getString(R.string.brave_default));
braveDefaultView.setPrimaryText(
getContext().getResources().getString(org.chromium.chrome.R.string.brave_default));
}

@Override
Expand Down

This file was deleted.

0 comments on commit 2d992f0

Please sign in to comment.