summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/AndroidManifest.xml2
-rw-r--r--app/src/main/java/app/olauncher/MainActivity.kt8
-rw-r--r--app/src/main/java/app/olauncher/data/Constants.kt3
-rw-r--r--app/src/main/java/app/olauncher/data/Prefs.kt5
-rw-r--r--app/src/main/java/app/olauncher/helper/Utils.kt13
-rw-r--r--app/src/main/java/app/olauncher/ui/SettingsFragment.kt50
-rw-r--r--app/src/main/res/drawable/rounded_rectangle_dark.xml2
-rw-r--r--app/src/main/res/drawable/text_colors_default.xml8
-rw-r--r--app/src/main/res/drawable/text_colors_light.xml8
-rw-r--r--app/src/main/res/layout/activity_main.xml6
-rw-r--r--app/src/main/res/layout/adapter_app_drawer.xml8
-rw-r--r--app/src/main/res/layout/fragment_app_drawer.xml4
-rw-r--r--app/src/main/res/layout/fragment_settings.xml102
-rw-r--r--app/src/main/res/values-v29/themes.xml22
-rw-r--r--app/src/main/res/values/attrs.xml11
-rw-r--r--app/src/main/res/values/colors.xml31
-rw-r--r--app/src/main/res/values/strings.xml1
-rw-r--r--app/src/main/res/values/styles.xml49
18 files changed, 250 insertions, 83 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1d73728..3a7b2d6 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -16,7 +16,7 @@
android:label="@string/app_name"
android:roundIcon="@drawable/olauncher_logo_rounded"
android:supportsRtl="true"
- android:theme="@style/AppTheme">
+ android:theme="@style/BlackTheme">
<activity
android:name=".MainActivity"
diff --git a/app/src/main/java/app/olauncher/MainActivity.kt b/app/src/main/java/app/olauncher/MainActivity.kt
index 1a1c947..c590550 100644
--- a/app/src/main/java/app/olauncher/MainActivity.kt
+++ b/app/src/main/java/app/olauncher/MainActivity.kt
@@ -31,11 +31,15 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ val prefs = Prefs(this)
+ when (prefs.themeColor) {
+ Constants.THEME_COLOR_BLACK -> setTheme(R.style.BlackTheme)
+ else -> setTheme(R.style.WhiteTheme)
+ }
+
setContentView(R.layout.activity_main)
navController = Navigation.findNavController(this, R.id.nav_host_fragment)
-
val viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
- val prefs = Prefs(this)
if (prefs.firstOpen) {
viewModel.firstOpen(true)
prefs.firstOpen = false
diff --git a/app/src/main/java/app/olauncher/data/Constants.kt b/app/src/main/java/app/olauncher/data/Constants.kt
index 76232e8..b6036aa 100644
--- a/app/src/main/java/app/olauncher/data/Constants.kt
+++ b/app/src/main/java/app/olauncher/data/Constants.kt
@@ -1,6 +1,9 @@
package app.olauncher.data
object Constants {
+ const val THEME_COLOR_BLACK = 0
+ const val THEME_COLOR_WHITE = 1
+
const val FLAG_LAUNCH_APP = 100
const val FLAG_HIDDEN_APPS = 101
diff --git a/app/src/main/java/app/olauncher/data/Prefs.kt b/app/src/main/java/app/olauncher/data/Prefs.kt
index 2bd77b4..8e6289f 100644
--- a/app/src/main/java/app/olauncher/data/Prefs.kt
+++ b/app/src/main/java/app/olauncher/data/Prefs.kt
@@ -25,6 +25,7 @@ class Prefs(context: Context) {
private val HIDDEN_APPS = "HIDDEN_APPS"
private val HIDDEN_APPS_UPDATED = "HIDDEN_APPS_UPDATED"
private val SHOW_HINT_COUNTER = "SHOW_HINT_COUNTER"
+ private val THEME_COLOR = "THEME_COLOR"
private val APP_NAME_1 = "APP_NAME_1"
private val APP_NAME_2 = "APP_NAME_2"
@@ -116,6 +117,10 @@ class Prefs(context: Context) {
get() = prefs.getBoolean(SWIPE_RIGHT_ENABLED, true)
set(value) = prefs.edit().putBoolean(SWIPE_RIGHT_ENABLED, value).apply()
+ var themeColor: Int
+ get() = prefs.getInt(THEME_COLOR, Constants.THEME_COLOR_WHITE)
+ set(value) = prefs.edit().putInt(THEME_COLOR, value).apply()
+
var screenTimeout: Int
get() = prefs.getInt(SCREEN_TIMEOUT, 30000) // Default: 30 seconds
set(value) = prefs.edit().putInt(SCREEN_TIMEOUT, value).apply()
diff --git a/app/src/main/java/app/olauncher/helper/Utils.kt b/app/src/main/java/app/olauncher/helper/Utils.kt
index 9f2672f..e237d20 100644
--- a/app/src/main/java/app/olauncher/helper/Utils.kt
+++ b/app/src/main/java/app/olauncher/helper/Utils.kt
@@ -12,9 +12,12 @@ import android.os.UserManager
import android.provider.AlarmClock
import android.provider.MediaStore
import android.util.Log
+import android.util.TypedValue
import android.view.Gravity
import android.view.WindowManager
import android.widget.Toast
+import androidx.annotation.AttrRes
+import androidx.annotation.ColorInt
import app.olauncher.BuildConfig
import app.olauncher.data.AppModel
import app.olauncher.data.Constants
@@ -365,3 +368,13 @@ fun openCalendar(context: Context) {
}
}
+
+@ColorInt
+fun Context.getColorFromAttr(
+ @AttrRes attrColor: Int,
+ typedValue: TypedValue = TypedValue(),
+ resolveRefs: Boolean = true
+): Int {
+ theme.resolveAttribute(attrColor, typedValue, resolveRefs)
+ return typedValue.data
+} \ No newline at end of file
diff --git a/app/src/main/java/app/olauncher/ui/SettingsFragment.kt b/app/src/main/java/app/olauncher/ui/SettingsFragment.kt
index 3f84fb1..4761927 100644
--- a/app/src/main/java/app/olauncher/ui/SettingsFragment.kt
+++ b/app/src/main/java/app/olauncher/ui/SettingsFragment.kt
@@ -12,7 +12,6 @@ import android.view.*
import android.widget.Toast
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
-import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.findNavController
import app.olauncher.BuildConfig
@@ -61,6 +60,7 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
populateKeyboardText()
populateLockSettings()
populateWallpaperText()
+ populateThemeColorText()
populateAlignment()
populateStatusBar()
populateDateTime()
@@ -73,6 +73,7 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
override fun onClick(view: View) {
appsNumSelectLayout.visibility = View.GONE
alignmentSelectLayout.visibility = View.GONE
+ themeColorSelectLayout.visibility = View.GONE
when (view.id) {
R.id.olauncherHiddenApps -> showHiddenApps()
R.id.appInfo -> openAppInfo(requireContext(), android.os.Process.myUserHandle(), BuildConfig.APPLICATION_ID)
@@ -92,6 +93,9 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
R.id.alignmentRight -> viewModel.updateHomeAlignment(Gravity.END)
R.id.statusBar -> toggleStatusBar()
R.id.dateTime -> toggleDateTime()
+ R.id.themeColor -> themeColorSelectLayout.visibility = View.VISIBLE
+ R.id.themeBlack -> updateTheme(Constants.THEME_COLOR_BLACK)
+ R.id.themeWhite -> updateTheme(Constants.THEME_COLOR_WHITE)
R.id.maxApps0 -> updateHomeAppsNum(0)
R.id.maxApps1 -> updateHomeAppsNum(1)
@@ -149,6 +153,9 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
dateTime.setOnClickListener(this)
swipeLeftApp.setOnClickListener(this)
swipeRightApp.setOnClickListener(this)
+ themeColor.setOnClickListener(this)
+ themeBlack.setOnClickListener(this)
+ themeWhite.setOnClickListener(this)
about.setOnClickListener(this)
share.setOnClickListener(this)
@@ -174,16 +181,16 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
}
private fun initObservers() {
- viewModel.isOlauncherDefault.observe(viewLifecycleOwner, Observer<Boolean> {
+ viewModel.isOlauncherDefault.observe(viewLifecycleOwner, {
if (it) {
setLauncher.text = getString(R.string.change_default_launcher)
prefs.toShowHintCounter = prefs.toShowHintCounter + 1
}
})
- viewModel.homeAppAlignment.observe(viewLifecycleOwner, Observer<Int> {
+ viewModel.homeAppAlignment.observe(viewLifecycleOwner, {
populateAlignment()
})
- viewModel.updateSwipeApps.observe(viewLifecycleOwner, Observer<Any> {
+ viewModel.updateSwipeApps.observe(viewLifecycleOwner, {
populateSwipeApps()
})
}
@@ -191,13 +198,13 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
private fun changeTabLayout(position: Int) {
if (position == APPEARANCE) {
gesturesLayout.visibility = View.GONE
- gesturesTab.setTextColor(requireContext().getColor(R.color.colorPrimaryTrans80))
- appearanceTab.setTextColor(requireContext().getColor(R.color.colorPrimary))
+ gesturesTab.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColorTrans80))
+ appearanceTab.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColor))
appearanceLayout.visibility = View.VISIBLE
} else if (position == GESTURES) {
appearanceLayout.visibility = View.GONE
- appearanceTab.setTextColor(requireContext().getColor(R.color.colorPrimaryTrans80))
- gesturesTab.setTextColor(requireContext().getColor(R.color.colorPrimary))
+ appearanceTab.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColorTrans80))
+ gesturesTab.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColor))
gesturesLayout.visibility = View.VISIBLE
}
}
@@ -205,10 +212,10 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
private fun toggleSwipeLeft() {
prefs.swipeLeftEnabled = !prefs.swipeLeftEnabled
if (prefs.swipeLeftEnabled) {
- swipeLeftApp.setTextColor(requireContext().getColor(R.color.colorPrimary))
+ swipeLeftApp.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColor))
showToastShort(requireContext(), "Swipe left app enabled")
} else {
- swipeLeftApp.setTextColor(requireContext().getColor(R.color.colorPrimaryTrans50))
+ swipeLeftApp.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColorTrans50))
showToastShort(requireContext(), "Swipe left app disabled")
}
}
@@ -216,10 +223,10 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
private fun toggleSwipeRight() {
prefs.swipeRightEnabled = !prefs.swipeRightEnabled
if (prefs.swipeRightEnabled) {
- swipeRightApp.setTextColor(requireContext().getColor(R.color.colorPrimary))
+ swipeRightApp.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColor))
showToastShort(requireContext(), "Swipe right app enabled")
} else {
- swipeRightApp.setTextColor(requireContext().getColor(R.color.colorPrimaryTrans50))
+ swipeRightApp.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColorTrans50))
showToastShort(requireContext(), "Swipe right app disabled")
}
}
@@ -344,6 +351,21 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
private fun toggleKeyboardText() {
prefs.autoShowKeyboard = !prefs.autoShowKeyboard
populateKeyboardText()
+ requireActivity().recreate()
+ }
+
+ private fun updateTheme(themeColor: Int) {
+ if (prefs.themeColor == themeColor) return
+ prefs.themeColor = themeColor
+ populateThemeColorText()
+ requireActivity().recreate()
+ }
+
+ private fun populateThemeColorText() {
+ when (prefs.themeColor) {
+ Constants.THEME_COLOR_BLACK -> themeColor.text = getString(R.string.black)
+ else -> themeColor.text = getString(R.string.white)
+ }
}
private fun populateKeyboardText() {
@@ -417,9 +439,9 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe
swipeLeftApp.text = prefs.appNameSwipeLeft
swipeRightApp.text = prefs.appNameSwipeRight
if (!prefs.swipeLeftEnabled)
- swipeLeftApp.setTextColor(requireContext().getColor(R.color.colorPrimaryTrans50))
+ swipeLeftApp.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColorTrans50))
if (!prefs.swipeRightEnabled)
- swipeRightApp.setTextColor(requireContext().getColor(R.color.colorPrimaryTrans50))
+ swipeRightApp.setTextColor(requireContext().getColorFromAttr(R.attr.primaryColorTrans50))
}
private fun showAppListIfEnabled(flag: Int) {
diff --git a/app/src/main/res/drawable/rounded_rectangle_dark.xml b/app/src/main/res/drawable/rounded_rectangle_dark.xml
index 7fb77f9..8f46cbc 100644
--- a/app/src/main/res/drawable/rounded_rectangle_dark.xml
+++ b/app/src/main/res/drawable/rounded_rectangle_dark.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <solid android:color="@color/colorPrimaryInverseTrans90" />
+ <solid android:color="?attr/primaryColorInverseTrans90" />
<corners android:radius="16dp" />
</shape>
diff --git a/app/src/main/res/drawable/text_colors_default.xml b/app/src/main/res/drawable/text_colors_default.xml
index ed2ee6f..9060691 100644
--- a/app/src/main/res/drawable/text_colors_default.xml
+++ b/app/src/main/res/drawable/text_colors_default.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@color/colorPrimaryTrans80" android:state_pressed="true" />
- <item android:color="@color/colorPrimaryTrans80" android:state_selected="true" />
- <item android:color="@color/colorPrimaryTrans80" android:state_focused="true" />
- <item android:color="@color/colorPrimary" />
+ <item android:color="?attr/primaryColorTrans80" android:state_pressed="true" />
+ <item android:color="?attr/primaryColorTrans80" android:state_selected="true" />
+ <item android:color="?attr/primaryColorTrans80" android:state_focused="true" />
+ <item android:color="?attr/primaryColor" />
</selector> \ No newline at end of file
diff --git a/app/src/main/res/drawable/text_colors_light.xml b/app/src/main/res/drawable/text_colors_light.xml
index 14066b2..1fe70a8 100644
--- a/app/src/main/res/drawable/text_colors_light.xml
+++ b/app/src/main/res/drawable/text_colors_light.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@color/colorPrimary" android:state_pressed="true" />
- <item android:color="@color/colorPrimary" android:state_selected="true" />
- <item android:color="@color/colorPrimary" android:state_focused="true" />
- <item android:color="@color/colorPrimaryTrans80" />
+ <item android:color="?attr/primaryColor" android:state_pressed="true" />
+ <item android:color="?attr/primaryColor" android:state_selected="true" />
+ <item android:color="?attr/primaryColor" android:state_focused="true" />
+ <item android:color="?attr/primaryColorTrans80" />
</selector> \ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 00698d9..16f8b9d 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -3,10 +3,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainActivityLayout"
- android:animateLayoutChanges="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/colorPrimaryInverseTrans10">
+ android:animateLayoutChanges="true"
+ android:background="?attr/primaryShadeColor">
<fragment
android:id="@+id/nav_host_fragment"
@@ -22,7 +22,7 @@
android:id="@+id/messageLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/colorPrimaryInverseTrans25"
+ android:background="?attr/primaryShadeDarkColor"
android:clickable="true"
android:clipToPadding="false"
android:focusable="true"
diff --git a/app/src/main/res/layout/adapter_app_drawer.xml b/app/src/main/res/layout/adapter_app_drawer.xml
index a5df6b5..f43736c 100644
--- a/app/src/main/res/layout/adapter_app_drawer.xml
+++ b/app/src/main/res/layout/adapter_app_drawer.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
@@ -22,14 +23,14 @@
android:layout_marginStart="10dp"
android:layout_marginTop="1dp"
android:gravity="center"
- android:src="@drawable/olauncher_logo_rounded" />
+ android:src="@drawable/ic_outline_info_24" />
<FrameLayout
android:id="@+id/appHideLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
- android:background="@color/colorPrimaryInverseTrans50"
+ android:background="?attr/primaryColorInverseTrans90"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="@dimen/app_padding_vertical"
@@ -53,7 +54,8 @@
android:layout_gravity="end|center_vertical"
android:contentDescription="@string/app"
android:padding="@dimen/app_padding_vertical"
- android:src="@drawable/ic_outline_info_24" />
+ android:src="@drawable/ic_outline_info_24"
+ app:tint="?attr/primaryColor" />
</FrameLayout>
diff --git a/app/src/main/res/layout/fragment_app_drawer.xml b/app/src/main/res/layout/fragment_app_drawer.xml
index e06b5b6..15bbf11 100644
--- a/app/src/main/res/layout/fragment_app_drawer.xml
+++ b/app/src/main/res/layout/fragment_app_drawer.xml
@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
- android:background="@color/colorPrimaryInverseTrans25">
+ android:background="?attr/primaryShadeDarkColor">
<LinearLayout
android:layout_width="match_parent"
@@ -53,7 +53,7 @@
android:ellipsize="end"
android:maxLines="1"
android:text="@string/app_drawer_tips"
- android:textColor="@color/colorPrimaryTrans90"
+ android:textColor="?attr/primaryColor"
android:textSize="16sp"
android:visibility="gone" />
diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml
index 9b3af56..ed74cf5 100644
--- a/app/src/main/res/layout/fragment_settings.xml
+++ b/app/src/main/res/layout/fragment_settings.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
- android:background="@color/colorPrimaryInverseTrans25"
+ android:background="?attr/primaryShadeDarkColor"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
@@ -31,7 +32,8 @@
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
android:padding="8dp"
- android:src="@drawable/ic_outline_info_24" />
+ android:src="@drawable/ic_outline_info_24"
+ app:tint="?attr/primaryColor" />
</FrameLayout>
<TextView
@@ -57,7 +59,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="@string/appearance"
- android:textColor="@color/colorPrimary"
+ android:textColor="?attr/primaryColor"
android:textSize="26sp" />
<TextView
@@ -68,7 +70,7 @@
android:layout_marginStart="24dp"
android:maxLines="1"
android:text="@string/gestures"
- android:textColor="@color/colorPrimaryTrans80"
+ android:textColor="?attr/primaryColorTrans80"
android:textSize="26sp" />
</LinearLayout>
@@ -101,7 +103,7 @@
android:layout_marginStart="24dp"
android:paddingVertical="8dp"
android:text="@string/apps_on_home_screen"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/homeAppsNum"
@@ -119,7 +121,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
- android:background="@color/colorPrimaryInverseTrans90"
+ android:background="?attr/primaryColorInverseTrans90"
android:elevation="8dp"
android:orientation="horizontal"
android:outlineAmbientShadowColor="@color/colorPrimaryDark"
@@ -234,7 +236,7 @@
android:layout_marginStart="24dp"
android:paddingVertical="8dp"
android:text="@string/auto_show_keyboard"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/autoShowKeyboard"
@@ -288,7 +290,7 @@
android:layout_marginStart="24dp"
android:paddingVertical="8dp"
android:text="@string/status_bar"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/statusBar"
@@ -315,7 +317,7 @@
android:layout_marginStart="24dp"
android:paddingVertical="8dp"
android:text="@string/show_date_time"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/dateTime"
@@ -342,7 +344,7 @@
android:layout_marginStart="24dp"
android:paddingVertical="8dp"
android:text="@string/home_layout_alignment"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/alignment"
@@ -361,7 +363,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
- android:background="@color/colorPrimaryInverseTrans90"
+ android:background="?attr/primaryColorInverseTrans90"
android:elevation="8dp"
android:orientation="horizontal"
android:outlineAmbientShadowColor="@color/colorPrimaryDark"
@@ -416,6 +418,78 @@
</FrameLayout>
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:animateLayoutChanges="true">
+
+ <TextView
+ style="@style/TextMedium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="24dp"
+ android:paddingVertical="8dp"
+ android:text="@string/theme_color"
+ android:textColor="?attr/primaryColor" />
+
+ <TextView
+ android:id="@+id/themeColor"
+ style="@style/TextSmallBold"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end|bottom"
+ android:layout_marginEnd="16dp"
+ android:padding="8dp"
+ android:text="@string/white"
+ android:textAllCaps="true" />
+
+ <!-- theme color select layout-->
+ <LinearLayout
+ android:id="@+id/themeColorSelectLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:animateLayoutChanges="true"
+ android:background="?attr/primaryColorInverseTrans90"
+ android:elevation="8dp"
+ android:orientation="horizontal"
+ android:outlineAmbientShadowColor="@color/colorPrimaryDark"
+ android:outlineSpotShadowColor="@color/colorPrimaryDark"
+ android:paddingHorizontal="24dp"
+ android:paddingVertical="2dp"
+ android:visibility="gone"
+ tools:ignore="UnusedAttribute">
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1" />
+
+ <TextView
+ android:id="@+id/themeWhite"
+ style="@style/TextSmallBold"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="24dp"
+ android:gravity="center"
+ android:paddingVertical="8dp"
+ android:text="@string/white"
+ android:textAllCaps="true" />
+
+ <TextView
+ android:id="@+id/themeBlack"
+ style="@style/TextSmallBold"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:paddingVertical="8dp"
+ android:text="@string/black"
+ android:textAllCaps="true" />
+
+ </LinearLayout>
+
+ </FrameLayout>
+
</LinearLayout>
<LinearLayout
@@ -441,7 +515,7 @@
android:lines="1"
android:paddingVertical="8dp"
android:text="@string/swipe_right_app"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/swipeRightApp"
@@ -471,7 +545,7 @@
android:lines="1"
android:paddingVertical="8dp"
android:text="@string/swipe_left_app"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/swipeLeftApp"
@@ -505,7 +579,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/double_tap_to_lock_screen"
- android:textColor="@color/colorPrimary" />
+ android:textColor="?attr/primaryColor" />
<TextView
android:id="@+id/experimental"
diff --git a/app/src/main/res/values-v29/themes.xml b/app/src/main/res/values-v29/themes.xml
deleted file mode 100644
index d01ab39..0000000
--- a/app/src/main/res/values-v29/themes.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<resources>
-
- <style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
- <item name="colorPrimary">@android:color/white</item>
- <item name="colorPrimaryDark">@android:color/white</item>
- <item name="colorAccent">@android:color/white</item>
-
- <item name="android:windowShowWallpaper">true</item>
- <item name="android:windowBackground">@android:color/transparent</item>
- <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
-
- <item name="android:statusBarColor">@android:color/transparent</item>
- <item name="android:navigationBarColor">@android:color/transparent</item>
-
-<!-- <item name="android:enforceStatusBarContrast">false</item>-->
- <item name="android:enforceNavigationBarContrast">false</item>
-
- <!-- <item name="android:windowTranslucentStatus">false</item>-->
- <item name="android:windowTranslucentNavigation">true</item>
-
- </style>
-</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..07909b3
--- /dev/null
+++ b/app/src/main/res/values/attrs.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <attr name="primaryColor" format="color" />
+ <attr name="primaryInverseColor" format="color" />
+ <attr name="primaryTextShadowColor" format="color" />
+ <attr name="primaryColorTrans50" format="color" />
+ <attr name="primaryColorTrans80" format="color" />
+ <attr name="primaryColorInverseTrans90" format="color" />
+ <attr name="primaryShadeColor" format="color" />
+ <attr name="primaryShadeDarkColor" format="color" />
+</resources>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 62fa230..e1fccdf 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -4,11 +4,28 @@
<color name="colorPrimaryDark">#9E9E9E</color>
<color name="colorAccent">#FFEB3B</color>
- <color name="colorPrimaryTrans50">#80FFFFFF</color>
- <color name="colorPrimaryTrans80">#CCFFFFFF</color>
- <color name="colorPrimaryTrans90">#E6FFFFFF</color>
- <color name="colorPrimaryInverseTrans10">#1A000000</color>
- <color name="colorPrimaryInverseTrans25">#40000000</color>
- <color name="colorPrimaryInverseTrans50">#80000000</color>
- <color name="colorPrimaryInverseTrans90">#E6000000</color>
+ <!--White-->
+ <color name="white">#FFFFFF</color>
+ <color name="whiteTrans90">#E6FFFFFF</color>
+ <color name="whiteTrans80">#CCFFFFFF</color>
+ <color name="whiteTrans50">#80FFFFFF</color>
+ <color name="whiteInverse">#000000</color>
+ <color name="whiteInverseTrans10">#1A000000</color>
+ <color name="whiteInverseTrans25">#40000000</color>
+ <color name="whiteInverseTrans50">#80000000</color>
+ <color name="whiteInverseTrans80">#CC000000</color>
+ <color name="whiteInverseTrans90">#E6000000</color>
+
+ <!--Black-->
+ <color name="black">#000000</color>
+ <color name="blackTrans90">#E6000000</color>
+ <color name="blackTrans80">#CC000000</color>
+ <color name="blackTrans50">#80000000</color>
+ <color name="blackInverse">#FFFFFF</color>
+ <color name="blackInverseTrans10">#1AFFFFFF</color>
+ <color name="blackInverseTrans25">#40FFFFFF</color>
+ <color name="blackInverseTrans50">#80FFFFFF</color>
+ <color name="blackInverseTrans80">#CCFFFFFF</color>
+ <color name="blackInverseTrans90">#E6FFFFFF</color>
+
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 787ff85..0d29aeb 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -53,4 +53,5 @@
<string name="show_date_time">Show date time</string>
<string name="appearance">Appearance</string>
<string name="gestures">Gestures</string>
+ <string name="theme_color">Theme color</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 59f2e03..6c3e778 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -15,19 +15,56 @@
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowLightStatusBar">false</item>
- <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:colorBackgroundCacheHint">@null</item>
+
+ <item name="android:statusBarColor">@android:color/transparent</item>
+ <item name="android:navigationBarColor">@android:color/transparent</item>
+ <!-- <item name="android:enforceStatusBarContrast">false</item>-->
+ <item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
+ <!-- <item name="android:windowTranslucentStatus">false</item>-->
+ <!-- <item name="android:windowTranslucentNavigation">true</item>-->
+
+ </style>
+
+ <style name="WhiteTheme" parent="AppTheme">
+ <item name="colorPrimary">@color/white</item>
+ <item name="colorPrimaryDark">@android:color/darker_gray</item>
+ <item name="colorAccent">@color/white</item>
+
+ <item name="primaryColor">@color/white</item>
+ <item name="primaryInverseColor">@color/whiteInverse</item>
+ <item name="primaryTextShadowColor">@color/whiteInverseTrans50</item>
+ <item name="primaryColorTrans50">@color/whiteTrans50</item>
+ <item name="primaryColorTrans80">@color/whiteTrans80</item>
+ <item name="primaryColorInverseTrans90">@color/whiteInverseTrans90</item>
+ <item name="primaryShadeColor">@color/whiteInverseTrans10</item>
+ <item name="primaryShadeDarkColor">@color/whiteInverseTrans25</item>
+ </style>
+
+ <style name="BlackTheme" parent="AppTheme">
+ <item name="colorPrimary">@color/black</item>
+ <item name="colorPrimaryDark">@android:color/darker_gray</item>
+ <item name="colorAccent">@color/black</item>
+
+ <item name="primaryColor">@color/black</item>
+ <item name="primaryInverseColor">@color/blackInverse</item>
+ <item name="primaryTextShadowColor">@color/blackInverseTrans50</item>
+ <item name="primaryColorTrans50">@color/blackTrans50</item>
+ <item name="primaryColorTrans80">@color/blackTrans80</item>
+ <item name="primaryColorInverseTrans90">@color/blackInverseTrans90</item>
+ <item name="primaryShadeColor">@color/blackInverseTrans10</item>
+ <item name="primaryShadeDarkColor">@color/blackInverseTrans25</item>
</style>
<style name="AppSearchText" parent="Widget.AppCompat.SearchView">
<item name="android:maxLength">20</item>
<item name="android:textSize">@dimen/text_large</item>
- <item name="android:textColor">@color/colorPrimary</item>
- <item name="android:editTextColor">@color/colorPrimary</item>
- <item name="android:textColorHint">@color/colorPrimary</item>
+ <item name="android:textColor">?attr/primaryColor</item>
+ <item name="android:editTextColor">?attr/primaryColor</item>
+ <item name="android:textColorHint">?attr/primaryColor</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:inputType">textNoSuggestions</item>
<item name="android:cursorVisible">false</item>
@@ -35,8 +72,8 @@
<style name="TextDefault" parent="@android:style/TextAppearance.Large">
<item name="android:textColor">@drawable/text_colors_default</item>
- <item name="android:textColorHint">@color/colorPrimaryTrans80</item>
- <item name="android:shadowColor">@color/colorPrimaryInverseTrans50</item>
+ <item name="android:textColorHint">?attr/primaryColorTrans80</item>
+ <item name="android:shadowColor">?attr/primaryTextShadowColor</item>
<item name="android:shadowDx">1</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">1</item>