Commit 876af028 authored by Fahim's avatar Fahim
Browse files

3808-Q-Forcefully_enable_dark_mode

issue: e/backlog#3808
parent 823b224c
......@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/backspace_icon_size"
android:height="@dimen/backspace_icon_size"
android:tint="?attr/colorControlNormal"
android:tint="@color/accent_color"
android:tintMode="src_in"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
......
......@@ -7,6 +7,7 @@
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="@color/default_background"
android:foreground="?android:attr/selectableItemBackground"
android:focusable="true" >
<FrameLayout
......@@ -57,6 +58,7 @@
<Spinner
android:id="@+id/spinner"
style="@style/Widget.AppCompat.Spinner"
android:backgroundTint="@color/accent_color"
android:layout_marginEnd="6dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
......
......@@ -7,6 +7,7 @@
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="@color/default_background"
android:foreground="?android:attr/selectableItemBackground"
android:focusable="true" >
<FrameLayout
......
......@@ -7,6 +7,7 @@
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="@color/default_background"
android:foreground="?android:attr/selectableItemBackground"
android:focusable="true" >
<FrameLayout
......
......@@ -26,5 +26,6 @@
android:background="@drawable/toggle_circle"
android:button="@null"
android:gravity="center"
android:textColor="@color/color_default_view_on_accent"
android:textSize="@dimen/day_button_font_size" />
</FrameLayout>
\ No newline at end of file
......@@ -33,7 +33,7 @@
android:format24Hour="@string/lock_screen_24_hour_format"
android:includeFontPadding="false"
android:singleLine="true"
android:textColor="@color/color_default_primary_text" />
android:textColor="@color/color_default_view_on_accent" />
<LinearLayout
android:layout_width="wrap_content"
......@@ -50,7 +50,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:textAllCaps="true"
android:textColor="@color/color_default_primary_text" />
android:textColor="@color/color_default_view_on_accent" />
<ImageView
android:id="@+id/nextAlarmIcon"
......@@ -70,7 +70,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:textAllCaps="true"
android:textColor="@color/color_default_primary_text" />
android:textColor="@color/color_default_view_on_accent" />
</LinearLayout>
......
......@@ -48,8 +48,10 @@
android:layout_height="wrap_content"
android:contentDescription="@string/timer_delete"
android:background="@color/default_background"
android:foreground="?android:attr/selectableItemBackground"
android:padding="12dp"
android:scaleType="center"
android:tint="@color/accent_color"
app:srcCompat="@drawable/ic_backspace" />
</LinearLayout>
......@@ -17,7 +17,6 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_item"
android:background="@color/default_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
......@@ -43,7 +42,7 @@
android:layout_gravity="center"
android:baselineAligned="true"
android:gravity="center"
android:textColor="@color/color_default_primary_text" />
android:textColor="@color/color_default_view_on_accent" />
<LinearLayout
android:layout_width="wrap_content"
......@@ -66,7 +65,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:textAllCaps="true"
android:textColor="@color/color_default_primary_text"
android:textColor="@color/color_default_view_on_accent"
android:textSize="@dimen/city_widget_name_font_size" />
</FrameLayout>
......@@ -83,7 +82,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:textAllCaps="true"
android:textColor="@color/color_default_primary_text"
android:textColor="@color/color_default_view_on_accent"
android:textSize="@dimen/city_widget_name_font_size" />
</LinearLayout>
......@@ -105,7 +104,7 @@
android:layout_gravity="center"
android:baselineAligned="true"
android:gravity="center"
android:textColor="@color/color_default_primary_text" />
android:textColor="@color/color_default_view_on_accent" />
<LinearLayout
android:layout_width="wrap_content"
......@@ -128,7 +127,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:textAllCaps="true"
android:textColor="@color/color_default_primary_text"
android:textColor="@color/color_default_view_on_accent"
android:textSize="@dimen/city_widget_name_font_size" />
</FrameLayout>
......@@ -145,7 +144,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:textAllCaps="true"
android:textColor="@color/color_default_primary_text"
android:textColor="@color/color_default_view_on_accent"
android:textSize="@dimen/city_widget_name_font_size" />
</LinearLayout>
......
......@@ -34,6 +34,7 @@
<color name="color_default_primary_text">@lineageos.platform:color/color_default_primary_text</color>
<color name="color_default_secondary_text">@lineageos.platform:color/color_default_secondary_text</color>
<color name="color_default_divider">@lineageos.platform:color/color_default_divider</color>
<color name="color_default_view_on_accent">@lineageos.platform:color/color_default_view_on_accent</color>
<color name="gray1">@lineageos.platform:color/color_default_gray1</color>
<color name="gray2">@lineageos.platform:color/color_default_gray2</color>
</resources>
......@@ -159,6 +159,7 @@
<item name="android:headerBackground">@color/transparent</item>
<item name="android:numbersBackgroundColor">@color/transparent</item>
<item name="android:numbersSelectorColor">@color/accent_color</item>
<item name="android:colorControlNormal">@color/accent_color</item>
</style>
<style name="Settings.Preference" parent="PreferenceThemeOverlay.v14.Material">
......
......@@ -28,7 +28,8 @@
<style name="customOverFlow">
<item name="android:src">@drawable/ic_more_24</item>
<item name="tint">@color/accent_color</item>
<item name="android:paddingRight">5dp</item>
<item name="android:paddingRight">10dp</item>
<item name="android:foreground">?android:attr/selectableItemBackground</item>
</style>
<style name="Theme.DeskClock" parent="Theme.DeskClock.Base">
......@@ -58,6 +59,7 @@
<item name="android:textColorSecondary">@color/color_default_secondary_text</item>
<item name="android:actionOverflowButtonStyle">@style/customOverFlow</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
<item name="android:forceDarkAllowed">true</item>
</style>
<style name="Theme.DeskClock.Settings" parent="Theme.DeskClock.Settings.Base">
......@@ -88,6 +90,7 @@
<item name="toolbarNavigationButtonStyle">@style/Toolbar.Button.Navigation.Tinted</item>
<item name="android:actionOverflowButtonStyle">@style/customOverFlow</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
<item name="android:forceDarkAllowed">true</item>
</style>
<style name="Theme.DeskClock.RingtonePicker" parent="Theme.DeskClock.RingtonePicker.Base">
......@@ -114,6 +117,7 @@
<item name="toolbarNavigationButtonStyle">@style/Toolbar.Button.Navigation.Tinted</item>
<item name="android:actionOverflowButtonStyle">@style/customOverFlow</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
<item name="android:forceDarkAllowed">true</item>
</style>
<style name="Theme.DeskClock.CitySelection" parent="Theme.DeskClock.CitySelection.Base">
......@@ -140,6 +144,7 @@
<item name="toolbarNavigationButtonStyle">@style/Toolbar.Button.Navigation.Tinted</item>
<item name="android:actionOverflowButtonStyle">@style/customOverFlow</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
<item name="android:forceDarkAllowed">true</item>
</style>
<style name="ThemeOverlay.Control.Accent" parent="ThemeOverlay.AppCompat">
......@@ -178,5 +183,6 @@
<item name="toolbarNavigationButtonStyle">@style/Toolbar.Button.Navigation.Tinted</item>
<item name="android:actionOverflowButtonStyle">@style/customOverFlow</item>
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
<item name="android:forceDarkAllowed">true</item>
</style>
</resources>
......@@ -28,12 +28,16 @@ import com.android.deskclock.data.DataModel;
import com.android.deskclock.events.LogEventTracker;
import com.android.deskclock.uidata.UiDataModel;
import androidx.appcompat.app.AppCompatDelegate;
public class DeskClockApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
final Context applicationContext = getApplicationContext();
final SharedPreferences prefs = getDefaultSharedPreferences(applicationContext);
......
......@@ -101,6 +101,7 @@ public final class ExpandedAlarmViewHolder extends AlarmItemViewHolder {
final int weekday = weekdays.get(i);
dayButton.setText(UiDataModel.getUiDataModel().getShortWeekday(weekday));
dayButton.setContentDescription(UiDataModel.getUiDataModel().getLongWeekday(weekday));
dayButton.setTextColor(context.getApplicationContext().getResources().getColor(R.color.color_default_view_on_accent));
repeatDays.addView(dayButtonFrame);
dayButtons[i] = dayButton;
}
......@@ -221,11 +222,10 @@ public final class ExpandedAlarmViewHolder extends AlarmItemViewHolder {
final CompoundButton dayButton = dayButtons[i];
if (alarm.daysOfWeek.isBitOn(weekdays.get(i))) {
dayButton.setChecked(true);
dayButton.setTextColor(ThemeUtils.resolveColor(context,
android.R.attr.windowBackground));
dayButton.setTextColor(context.getApplicationContext().getResources().getColor(R.color.color_default_view_on_accent));
} else {
dayButton.setChecked(false);
dayButton.setTextColor(context.getApplicationContext().getResources().getColor(R.color.color_default_primary_text));
dayButton.setTextColor(context.getApplicationContext().getResources().getColor(R.color.color_default_view_on_accent));
}
}
if (alarm.daysOfWeek.isRepeating()) {
......
......@@ -81,7 +81,7 @@ public final class StopwatchCircleView extends View {
mMarkerStrokeSize = resources.getDimension(R.dimen.circletimer_marker_size);
mRadiusOffset = Utils.calculateRadiusOffset(mStrokeSize, dotDiameter, mMarkerStrokeSize);
mRemainderColor = context.getApplicationContext().getResources().getColor(R.color.gray1);
mRemainderColor = ThemeUtils.resolveColor(context, R.attr.colorAccent);
mCompletedColor = ThemeUtils.resolveColor(context, R.attr.colorAccent);
mPaint.setAntiAlias(true);
......@@ -108,6 +108,7 @@ public final class StopwatchCircleView extends View {
// Reset old painting state.
mPaint.setColor(mRemainderColor);
mPaint.setAlpha(100);
mPaint.setStrokeWidth(mStrokeSize);
final List<Lap> laps = getLaps();
......
......@@ -71,7 +71,7 @@ public final class TimerCircleView extends View {
mStrokeSize = resources.getDimension(R.dimen.circletimer_circle_size);
mRadiusOffset = Utils.calculateRadiusOffset(mStrokeSize, dotDiameter, 0);
mRemainderColor = context.getApplicationContext().getResources().getColor(R.color.gray1);
mRemainderColor = ThemeUtils.resolveColor(context, R.attr.colorAccent);
mCompletedColor = ThemeUtils.resolveColor(context, R.attr.colorAccent);
mPaint.setAntiAlias(true);
......@@ -102,6 +102,7 @@ public final class TimerCircleView extends View {
// Reset old painting state.
mPaint.setColor(mRemainderColor);
mPaint.setAlpha(100);
mPaint.setStrokeWidth(mStrokeSize);
// If the timer is reset, draw a simple white circle.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment