Skip to content

Commit

Permalink
Merge pull request #12 from frogobox/develop/add-dark-theme
Browse files Browse the repository at this point in the history
DEVELOP :: Enable Dark Mode
  • Loading branch information
amirisback authored Jun 15, 2023
2 parents d77ce7c + b376f7e commit 441ac8a
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/ThemeSdk.HideStatusBarUI">
<activity
android:name=".ui.main.MainActivity"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
override fun onFinish() {
containerFailedView.failedView.gone()
if (ConfigApp.Flag.IS_USING_AD_BANNER) {
adsView.adsPhoneTabSpecialSmartBanner.visible()
showAdBanner(adsView.adsPhoneTabSpecialSmartBanner)
} else {
adsView.adsPhoneTabSpecialSmartBanner.gone()
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/ads_banner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*
-->

<com.google.android.gms.ads.AdView
xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.gms.ads.AdView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/ads_phone_tab_special_smart_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:visibility="gone"
ads:adSize="@string/ads_size_smart_banner"
ads:adUnitId="@string/admob_banner"/>
ads:adUnitId="@string/admob_banner" />
2 changes: 1 addition & 1 deletion app/src/main/res/layout/view_failed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Internal Server Error"
android:textColor="@color/frogoColorBlack"
android:textColor="@color/tv_text_color"
android:textSize="@dimen/frogo_dimen_font_16sp" />

</LinearLayout>
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
* Created by Muhammad Faisal Amir
* Source Code
* =========================================
* Name : Muhammad Faisal Amir
* E-mail : faisalamircs@gmail.com
* Github : github.com/amirisback
* =========================================
* Copyright (C) FrogoBox Inc.
* All rights reserved
*
-->

<resources>

<color name="tv_text_color">@color/frogoColorWhite</color>

</resources>
49 changes: 49 additions & 0 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
* Created by Muhammad Faisal Amir
* Source Code
* =========================================
* Name : Muhammad Faisal Amir
* E-mail : faisalamircs@gmail.com
* Github : github.com/amirisback
* =========================================
* Copyright (C) FrogoBox Inc.
* All rights reserved
*
-->

<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="ThemeSdk" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>

<style name="ThemeSdk.HideStatusBarUI" parent="Theme.MaterialComponents.DayNight.NoActionBar">

<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>

<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges
</item>
</style>

</resources>
19 changes: 15 additions & 4 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>

<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>

<color name="tv_text_color">@color/frogoColorBlack</color>

</resources>
49 changes: 49 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
* Created by Muhammad Faisal Amir
* Source Code
* =========================================
* Name : Muhammad Faisal Amir
* E-mail : faisalamircs@gmail.com
* Github : github.com/amirisback
* =========================================
* Copyright (C) FrogoBox Inc.
* All rights reserved
*
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<style name="ThemeSdk" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>

<style name="ThemeSdk.HideStatusBarUI" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>

<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges
</item>
</style>

</resources>

0 comments on commit 441ac8a

Please sign in to comment.