Skip to content

Commit

Permalink
Added: Add Theme.MaterialComponents.DayNight.TermuxPrimaryActivity th…
Browse files Browse the repository at this point in the history
…eme can be used by activities for day and night mode
  • Loading branch information
agnostic-apollo committed Sep 23, 2021
1 parent 4f66786 commit 0bf4b1e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 16 deletions.
2 changes: 1 addition & 1 deletion termux-shared/src/main/res/layout/dialog_show_message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dark_red"
android:background="@color/red_400"
android:paddingStart="24dp"
android:paddingTop="16dp"
android:paddingEnd="24dp"
Expand Down
19 changes: 19 additions & 0 deletions termux-shared/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MaterialComponents.DayNight.TermuxPrimaryActivity" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/red_400</item>
<item name="colorPrimaryVariant">@color/red_800</item>
<item name="colorOnPrimary">@color/black</item>

<!-- Secondary brand color. -->
<item name="colorSecondary">@color/grey_900</item>
<item name="colorSecondaryVariant">@color/black</item>
<item name="colorOnSecondary">@color/white</item>

<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>

<!-- Text color. -->
<item name="android:textColorLink">@color/grey_200</item>
</style>
</resources>
14 changes: 13 additions & 1 deletion termux-shared/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@
<resources>
<color name="background_markdown_code_inline">#1F000000</color>
<color name="background_markdown_code_block">#0F000000</color>
<color name="dark_red">#FF0000</color>

<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>

<color name="red_400">#FF0000</color>
<color name="red_800">#C4001D</color>

<color name="grey_200">#EEEEEE</color>
<color name="grey_800">#424242</color>
<color name="grey_900">#212121</color>

<color name="red_error">#DC143C</color>
<color name="red_error_link">#FC143C</color>
</resources>
14 changes: 0 additions & 14 deletions termux-shared/src/main/res/values/styles.xml

This file was deleted.

42 changes: 42 additions & 0 deletions termux-shared/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MaterialComponents.DayNight.TermuxPrimaryActivity" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/red_400</item>
<item name="colorPrimaryVariant">@color/red_800</item>
<item name="colorOnPrimary">@color/white</item>

<!-- Secondary brand color. -->
<item name="colorSecondary">@color/grey_900</item>
<item name="colorSecondaryVariant">@color/black</item>
<item name="colorOnSecondary">@color/white</item>

<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>

<!-- Text color. -->
<item name="android:textColorPrimary">@color/black</item>
<item name="android:textColorLink">@color/grey_800</item>
<item name="android:textColorSecondary">@color/white</item>
</style>

<style name="Theme.AppCompat.TermuxReportActivity" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimaryDark">#FF0000</item>
</style>

<style name="Theme.AppCompat.TermuxTextIOActivity" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimaryDark">#FF0000</item>
</style>

<style name="Toolbar.Title" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">14sp</item>
</style>

<style name="ViewDivider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_marginTop">@dimen/activity_vertical_margin</item>
<item name="android:layout_marginBottom">@dimen/activity_vertical_margin</item>
<item name="android:background">?android:attr/listDivider</item>
</style>
</resources>

0 comments on commit 0bf4b1e

Please sign in to comment.