mirror of
https://github.com/openlibrecommunity/olcng.git
synced 2026-07-03 14:05:17 +02:00
Refactor UI to use Material3 toolbar and theme
Introduces a base activity layout with MaterialToolbar and refactors all activities to use setContentViewWithToolbar for consistent toolbar/title handling. Updates color and theme resources to Material3, removes hardcoded color references from layouts, and improves RecyclerView indicator color logic. This modernizes the UI and centralizes toolbar management.
This commit is contained in:
@@ -49,14 +49,13 @@
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppThemeDayNight"
|
||||
android:theme="@style/AppThemeDayNight.NoActionBar"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
<activity
|
||||
android:name=".ui.MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppThemeDayNight.NoActionBar">
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -122,7 +121,7 @@
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="false"
|
||||
android:process=":RunSoLibV2RayDaemon"
|
||||
android:theme="@style/AppTheme.NoActionBar.Translucent" />
|
||||
android:theme="@style/AppThemeDayNight.NoActionBar.Translucent" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.UrlSchemeActivity"
|
||||
|
||||
@@ -13,9 +13,8 @@ class AboutActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.title_about)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_about))
|
||||
|
||||
binding.layoutSoureCcode.setOnClickListener {
|
||||
Utils.openUri(this, AppConfig.APP_URL)
|
||||
|
||||
@@ -84,9 +84,8 @@ class BackupActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.title_configuration_backup_restore)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_configuration_backup_restore))
|
||||
|
||||
binding.layoutBackup.setOnClickListener {
|
||||
AlertDialog.Builder(this)
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package com.v2ray.ang.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import androidx.annotation.RequiresApi
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import com.v2ray.ang.R
|
||||
import com.v2ray.ang.handler.SettingsManager
|
||||
import com.v2ray.ang.helper.CustomDividerItemDecoration
|
||||
import com.v2ray.ang.util.MyContextWrapper
|
||||
@@ -50,7 +55,7 @@ abstract class BaseActivity : AppCompatActivity() {
|
||||
* @param drawableResId The resource ID of the drawable to be used as the divider.
|
||||
* @param orientation The orientation of the divider (DividerItemDecoration.VERTICAL or DividerItemDecoration.HORIZONTAL).
|
||||
*/
|
||||
fun addCustomDividerToRecyclerView(recyclerView: RecyclerView, context: Context?, drawableResId: Int, orientation: Int = DividerItemDecoration.VERTICAL) {
|
||||
protected fun addCustomDividerToRecyclerView(recyclerView: RecyclerView, context: Context?, drawableResId: Int, orientation: Int = DividerItemDecoration.VERTICAL) {
|
||||
// Get the drawable from resources
|
||||
val drawable = ContextCompat.getDrawable(context!!, drawableResId)
|
||||
requireNotNull(drawable) { "Drawable resource not found" }
|
||||
@@ -61,4 +66,39 @@ abstract class BaseActivity : AppCompatActivity() {
|
||||
// Add the divider to the RecyclerView
|
||||
recyclerView.addItemDecoration(dividerItemDecoration)
|
||||
}
|
||||
|
||||
protected fun setupToolbar(toolbar: Toolbar?, showHomeAsUp: Boolean = true, title: CharSequence? = null) {
|
||||
val tb = toolbar ?: findViewById<Toolbar?>(R.id.toolbar)
|
||||
tb?.let {
|
||||
setSupportActionBar(it)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(showHomeAsUp)
|
||||
title?.let { t -> this.title = t }
|
||||
}
|
||||
}
|
||||
|
||||
protected fun setContentViewWithToolbar(layoutResId: Int, showHomeAsUp: Boolean = true, title: CharSequence? = null) {
|
||||
val base = LayoutInflater.from(this).inflate(R.layout.activity_base, null)
|
||||
val container = base.findViewById<FrameLayout>(R.id.content_container)
|
||||
LayoutInflater.from(this).inflate(layoutResId, container, true)
|
||||
super.setContentView(base)
|
||||
setupToolbar(base, showHomeAsUp, title)
|
||||
}
|
||||
|
||||
protected fun setContentViewWithToolbar(childView: View, showHomeAsUp: Boolean = true, title: CharSequence? = null) {
|
||||
val base = LayoutInflater.from(this).inflate(R.layout.activity_base, null)
|
||||
val container = base.findViewById<FrameLayout>(R.id.content_container)
|
||||
container.addView(childView, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
|
||||
super.setContentView(base)
|
||||
setupToolbar(base, showHomeAsUp, title)
|
||||
}
|
||||
|
||||
private fun setupToolbar(baseRoot: View, showHomeAsUp: Boolean, title: CharSequence?) {
|
||||
val toolbar = baseRoot.findViewById<MaterialToolbar>(R.id.toolbar)
|
||||
toolbar?.let {
|
||||
setSupportActionBar(it)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(showHomeAsUp)
|
||||
title?.let { t -> supportActionBar?.title = t }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,9 +24,8 @@ class CheckUpdateActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.update_check_for_update)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.update_check_for_update))
|
||||
|
||||
binding.layoutCheckUpdate.setOnClickListener {
|
||||
checkForUpdates(binding.checkPreRelease.isChecked)
|
||||
|
||||
@@ -30,9 +30,8 @@ class LogcatActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.title_logcat)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_logcat))
|
||||
|
||||
binding.recyclerView.setHasFixedSize(true)
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
@@ -115,8 +115,7 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = getString(R.string.title_server)
|
||||
setSupportActionBar(binding.toolbar)
|
||||
setupToolbar(binding.toolbar,false, getString(R.string.title_server))
|
||||
|
||||
binding.fab.setOnClickListener {
|
||||
if (mainViewModel.isRunning.value == true) {
|
||||
|
||||
@@ -46,12 +46,17 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
|
||||
}
|
||||
var isRunning = false
|
||||
private val doubleColumnDisplay = MmkvManager.decodeSettingsBool(AppConfig.PREF_DOUBLE_COLUMN_DISPLAY, false)
|
||||
private var data: List<ServersCache> = emptyList()
|
||||
private var data: MutableList<ServersCache> = mutableListOf()
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun setData(newData: List<ServersCache>?, position: Int = -1) {
|
||||
data = newData ?: emptyList()
|
||||
if (position >= 0) {
|
||||
fun setData(newData: MutableList<ServersCache>?, position: Int = -1) {
|
||||
if (android.os.Looper.myLooper() != android.os.Looper.getMainLooper()) {
|
||||
mActivity.runOnUiThread { setData(newData, position) }
|
||||
return
|
||||
}
|
||||
data = newData?.toMutableList() ?: mutableListOf()
|
||||
|
||||
if (position >= 0 && position in data.indices) {
|
||||
notifyItemChanged(position)
|
||||
} else {
|
||||
notifyDataSetChanged()
|
||||
@@ -84,7 +89,7 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
|
||||
|
||||
//layoutIndicator
|
||||
if (guid == MmkvManager.getSelectServer()) {
|
||||
holder.itemMainBinding.layoutIndicator.setBackgroundResource(R.color.colorAccent)
|
||||
holder.itemMainBinding.layoutIndicator.setBackgroundResource(R.color.colorIndicator)
|
||||
} else {
|
||||
holder.itemMainBinding.layoutIndicator.setBackgroundResource(0)
|
||||
}
|
||||
|
||||
@@ -37,9 +37,8 @@ class PerAppProxyActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.per_app_proxy_settings)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.per_app_proxy_settings))
|
||||
|
||||
addCustomDividerToRecyclerView(binding.recyclerView, this, R.drawable.custom_divider)
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ class RoutingEditActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = getString(R.string.routing_settings_rule_title)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.routing_settings_rule_title))
|
||||
|
||||
val rulesetItem = SettingsManager.getRoutingRuleset(position)
|
||||
if (rulesetItem != null) {
|
||||
|
||||
@@ -53,9 +53,8 @@ class RoutingSettingActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.routing_settings_title)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.routing_settings_title))
|
||||
|
||||
binding.recyclerView.setHasFixedSize(true)
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
@@ -143,19 +143,20 @@ class ServerActivity : BaseActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val config = MmkvManager.decodeServerConfig(editGuid)
|
||||
title = (config?.configType ?: createConfigType).toString()
|
||||
when (config?.configType ?: createConfigType) {
|
||||
EConfigType.VMESS -> setContentView(R.layout.activity_server_vmess)
|
||||
EConfigType.CUSTOM -> return
|
||||
EConfigType.SHADOWSOCKS -> setContentView(R.layout.activity_server_shadowsocks)
|
||||
EConfigType.SOCKS -> setContentView(R.layout.activity_server_socks)
|
||||
EConfigType.HTTP -> setContentView(R.layout.activity_server_socks)
|
||||
EConfigType.VLESS -> setContentView(R.layout.activity_server_vless)
|
||||
EConfigType.TROJAN -> setContentView(R.layout.activity_server_trojan)
|
||||
EConfigType.WIREGUARD -> setContentView(R.layout.activity_server_wireguard)
|
||||
EConfigType.HYSTERIA2 -> setContentView(R.layout.activity_server_hysteria2)
|
||||
EConfigType.POLICYGROUP -> return
|
||||
}
|
||||
|
||||
val layoutId = when (config?.configType ?: createConfigType) {
|
||||
EConfigType.VMESS -> R.layout.activity_server_vmess
|
||||
EConfigType.CUSTOM -> null
|
||||
EConfigType.SHADOWSOCKS -> R.layout.activity_server_shadowsocks
|
||||
EConfigType.SOCKS, EConfigType.HTTP -> R.layout.activity_server_socks
|
||||
EConfigType.VLESS -> R.layout.activity_server_vless
|
||||
EConfigType.TROJAN -> R.layout.activity_server_trojan
|
||||
EConfigType.WIREGUARD -> R.layout.activity_server_wireguard
|
||||
EConfigType.HYSTERIA2 -> R.layout.activity_server_hysteria2
|
||||
EConfigType.POLICYGROUP -> null
|
||||
} ?: return
|
||||
setContentViewWithToolbar(layoutId, showHomeAsUp = true, title = (config?.configType ?: createConfigType).toString())
|
||||
|
||||
sp_network?.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(
|
||||
parent: AdapterView<*>?,
|
||||
|
||||
@@ -31,8 +31,8 @@ class ServerCustomConfigActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = EConfigType.CUSTOM.toString()
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = EConfigType.CUSTOM.toString())
|
||||
|
||||
if (!Utils.getDarkModeStatus(this)) {
|
||||
binding.editor.colorScheme = EditorTheme.INTELLIJ_LIGHT
|
||||
|
||||
@@ -31,8 +31,8 @@ class ServerGroupActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = EConfigType.POLICYGROUP.toString()
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = EConfigType.POLICYGROUP.toString())
|
||||
|
||||
val config = MmkvManager.decodeServerConfig(editGuid)
|
||||
populateSubscriptionSpinner()
|
||||
|
||||
@@ -27,9 +27,8 @@ class SettingsActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_settings)
|
||||
|
||||
title = getString(R.string.title_settings)
|
||||
//setContentView(R.layout.activity_settings)
|
||||
setContentViewWithToolbar(R.layout.activity_settings, showHomeAsUp = true, title = getString(R.string.title_settings))
|
||||
|
||||
settingsViewModel.startListenPreferenceChange()
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ class SubEditActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = getString(R.string.title_sub_setting)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_sub_setting))
|
||||
|
||||
SettingsChangeManager.makeSetupGroupTab()
|
||||
val subItem = MmkvManager.decodeSubscription(editSubId)
|
||||
|
||||
@@ -29,9 +29,8 @@ class SubSettingActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
|
||||
title = getString(R.string.title_sub_setting)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_sub_setting))
|
||||
|
||||
binding.recyclerView.setHasFixedSize(true)
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
@@ -83,8 +83,8 @@ class UserAssetActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = getString(R.string.title_user_asset_setting)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_user_asset_setting))
|
||||
|
||||
binding.recyclerView.setHasFixedSize(true)
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
@@ -32,8 +32,8 @@ class UserAssetUrlActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(binding.root)
|
||||
title = getString(R.string.title_user_asset_add_url)
|
||||
//setContentView(binding.root)
|
||||
setContentViewWithToolbar(binding.root, showHomeAsUp = true, title = getString(R.string.title_user_asset_add_url))
|
||||
|
||||
val assetItem = MmkvManager.decodeAsset(editAssetId)
|
||||
val assetUrlQrcode = intent.getStringExtra(ASSET_URL_QRCODE)
|
||||
|
||||
@@ -258,8 +258,8 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
|
||||
if (subscriptionId != id) {
|
||||
subscriptionId = id
|
||||
MmkvManager.encodeSettings(AppConfig.CACHE_SUBSCRIPTION_ID, subscriptionId)
|
||||
reloadServerList()
|
||||
}
|
||||
reloadServerList()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:titleTextAppearance="@style/TextAppearance.AppCompat.Title" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -49,7 +49,6 @@
|
||||
android:maxLines="2"
|
||||
android:text="@string/per_app_proxy_settings_enable"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:theme="@style/BrandedSwitch" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -69,7 +68,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/switch_bypass_apps_mode"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:theme="@style/BrandedSwitch" />
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
android:paddingStart="@dimen/padding_spacing_dp16"
|
||||
android:text="@string/update_check_pre_release"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:theme="@style/BrandedSwitch" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
android:focusable="true"
|
||||
android:nextFocusLeft="@+id/layout_test"
|
||||
android:src="@drawable/ic_play_24dp"
|
||||
app:tint="@color/colorWhite"
|
||||
app:layout_anchorGravity="bottom|right|end" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -119,7 +120,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/nav_header"
|
||||
app:itemIconTint="@color/colorAccent"
|
||||
app:menu="@menu/menu_drawer">
|
||||
|
||||
</com.google.android.material.navigation.NavigationView>
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/routing_settings_locked"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:theme="@style/BrandedSwitch" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/server_lab_need_inbound"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Tooltip"
|
||||
android:textColor="@color/color_secondary" />
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Tooltip"
|
||||
android:textColor="@color/color_secondary" />
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -2,9 +2,51 @@
|
||||
<resources>
|
||||
<color name="color_fab_active">#f97910</color>
|
||||
<color name="color_fab_inactive">#646464</color>
|
||||
<color name="color_secondary">#BDBDBD</color>
|
||||
<color name="divider_color_light">#424242</color>
|
||||
|
||||
<color name="colorPrimary">#212121</color>
|
||||
<color name="colorAccent">#FFFFFF</color>
|
||||
<!-- Primary colors - main tone: gray -->
|
||||
<color name="md_theme_primary">#C0C0C0</color>
|
||||
<color name="md_theme_onPrimary">#303030</color>
|
||||
<color name="md_theme_primaryContainer">#474747</color>
|
||||
<color name="md_theme_onPrimaryContainer">#E0E0E0</color>
|
||||
|
||||
<!-- Secondary colors - accent color: orange -->
|
||||
<color name="md_theme_secondary">#FFB687</color>
|
||||
<color name="md_theme_onSecondary">#4E2600</color>
|
||||
<color name="md_theme_secondaryContainer">#6F3800</color>
|
||||
<color name="md_theme_onSecondaryContainer">#FFE8D6</color>
|
||||
|
||||
<!-- Tertiary colors - tertiary color: green -->
|
||||
<color name="md_theme_tertiary">#83D6B5</color>
|
||||
<color name="md_theme_onTertiary">#00382E</color>
|
||||
<color name="md_theme_tertiaryContainer">#005143</color>
|
||||
<color name="md_theme_onTertiaryContainer">#A0F2D0</color>
|
||||
|
||||
<!-- Error colors -->
|
||||
<color name="md_theme_error">#FFB4AB</color>
|
||||
<color name="md_theme_errorContainer">#93000A</color>
|
||||
<color name="md_theme_onError">#690005</color>
|
||||
<color name="md_theme_onErrorContainer">#FFDAD6</color>
|
||||
|
||||
<!-- Background colors -->
|
||||
<color name="md_theme_background">#1C1B1F</color>
|
||||
<color name="md_theme_onBackground">#E6E1E5</color>
|
||||
|
||||
<!-- Surface colors -->
|
||||
<color name="md_theme_surface">#1C1B1F</color>
|
||||
<color name="md_theme_onSurface">#E6E1E5</color>
|
||||
<color name="md_theme_surfaceVariant">#49454F</color>
|
||||
<color name="md_theme_onSurfaceVariant">#CAC4D0</color>
|
||||
<color name="md_theme_inverseSurface">#E6E1E5</color>
|
||||
<color name="md_theme_inverseOnSurface">#1C1B1F</color>
|
||||
|
||||
<!-- Outline colors -->
|
||||
<color name="md_theme_outline">#938F99</color>
|
||||
<color name="md_theme_outlineVariant">#49454F</color>
|
||||
|
||||
<!-- Other colors -->
|
||||
<color name="md_theme_inversePrimary">#000000</color>
|
||||
<color name="md_theme_shadow">#000000</color>
|
||||
<color name="md_theme_surfaceTint">#C0C0C0</color>
|
||||
<color name="md_theme_scrim">#000000</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,13 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeDayNight" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimary</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:statusBarColor">@color/colorPrimary</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="colorControlNormal">@color/colorAccent</item>
|
||||
<style name="AppThemeDayNight" parent="Theme.Material3.DayNight">
|
||||
<!-- Primary colors - main tone: gray -->
|
||||
<item name="colorPrimary">@color/md_theme_primary</item>
|
||||
<item name="colorOnPrimary">@color/md_theme_onPrimary</item>
|
||||
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer</item>
|
||||
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer</item>
|
||||
|
||||
<!-- Secondary colors - accent color: orange -->
|
||||
<item name="colorSecondary">@color/md_theme_secondary</item>
|
||||
<item name="colorOnSecondary">@color/md_theme_onSecondary</item>
|
||||
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer</item>
|
||||
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer</item>
|
||||
|
||||
<!-- Tertiary colors - tertiary color: green -->
|
||||
<item name="colorTertiary">@color/md_theme_tertiary</item>
|
||||
<item name="colorOnTertiary">@color/md_theme_onTertiary</item>
|
||||
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer</item>
|
||||
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer</item>
|
||||
|
||||
<!-- Error colors -->
|
||||
<item name="colorError">@color/md_theme_error</item>
|
||||
<item name="colorOnError">@color/md_theme_onError</item>
|
||||
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
|
||||
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
|
||||
|
||||
<!-- Surface colors -->
|
||||
<item name="colorSurface">@color/md_theme_surface</item>
|
||||
<item name="colorOnSurface">@color/md_theme_onSurface</item>
|
||||
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant</item>
|
||||
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface</item>
|
||||
|
||||
<!-- Background colors -->
|
||||
<item name="android:colorBackground">@color/md_theme_background</item>
|
||||
<item name="colorOnBackground">@color/md_theme_onBackground</item>
|
||||
|
||||
<!-- Outline colors -->
|
||||
<item name="colorOutline">@color/md_theme_outline</item>
|
||||
<item name="colorOutlineVariant">@color/md_theme_outlineVariant</item>
|
||||
|
||||
<!-- Other colors -->
|
||||
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary</item>
|
||||
|
||||
<!-- Status bar and navigation bar - system bars (dark mode) -->
|
||||
<item name="android:statusBarColor">@color/md_theme_surface</item>
|
||||
<item name="android:navigationBarColor">@color/md_theme_surface</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -3,12 +3,55 @@
|
||||
<color name="colorPing">#009966</color>
|
||||
<color name="colorPingRed">#FF0099</color>
|
||||
<color name="colorConfigType">#f97910</color>
|
||||
|
||||
<color name="colorWhite">#FFFFFF</color>
|
||||
<color name="color_fab_active">#f97910</color>
|
||||
<color name="color_fab_inactive">#9C9C9C</color>
|
||||
<color name="color_secondary">#727272</color>
|
||||
<color name="divider_color_light">#E0E0E0</color>
|
||||
<color name="colorIndicator">@color/md_theme_primary</color>
|
||||
|
||||
<color name="colorPrimary">#F5F5F5</color>
|
||||
<color name="colorAccent">#000000</color>
|
||||
<!-- Primary colors - main tone: black -->
|
||||
<color name="md_theme_primary">#000000</color>
|
||||
<color name="md_theme_onPrimary">#FFFFFF</color>
|
||||
<color name="md_theme_primaryContainer">#E0E0E0</color>
|
||||
<color name="md_theme_onPrimaryContainer">#000000</color>
|
||||
|
||||
<!-- Secondary colors - accent color: orange -->
|
||||
<color name="md_theme_secondary">#f97910</color>
|
||||
<color name="md_theme_onSecondary">#FFFFFF</color>
|
||||
<color name="md_theme_secondaryContainer">#FFE8D6</color>
|
||||
<color name="md_theme_onSecondaryContainer">#2B1700</color>
|
||||
|
||||
<!-- Tertiary colors - accent color: green -->
|
||||
<color name="md_theme_tertiary">#009966</color>
|
||||
<color name="md_theme_onTertiary">#FFFFFF</color>
|
||||
<color name="md_theme_tertiaryContainer">#A0F2D0</color>
|
||||
<color name="md_theme_onTertiaryContainer">#00201A</color>
|
||||
|
||||
<!-- Error colors -->
|
||||
<color name="md_theme_error">#BA1A1A</color>
|
||||
<color name="md_theme_errorContainer">#FFDAD6</color>
|
||||
<color name="md_theme_onError">#FFFFFF</color>
|
||||
<color name="md_theme_onErrorContainer">#410002</color>
|
||||
|
||||
<!-- Background colors -->
|
||||
<color name="md_theme_background">#FFFFFF</color>
|
||||
<color name="md_theme_onBackground">#1C1B1F</color>
|
||||
|
||||
<!-- Surface colors -->
|
||||
<color name="md_theme_surface">#FFFFFF</color>
|
||||
<color name="md_theme_onSurface">#1C1B1F</color>
|
||||
<color name="md_theme_surfaceVariant">#E7E0EC</color>
|
||||
<color name="md_theme_onSurfaceVariant">#49454F</color>
|
||||
<color name="md_theme_inverseSurface">#313033</color>
|
||||
<color name="md_theme_inverseOnSurface">#F4EFF4</color>
|
||||
|
||||
<!-- Outline colors -->
|
||||
<color name="md_theme_outline">#79747E</color>
|
||||
<color name="md_theme_outlineVariant">#CAC4D0</color>
|
||||
|
||||
<!-- Other colors -->
|
||||
<color name="md_theme_inversePrimary">#C0C0C0</color>
|
||||
<color name="md_theme_shadow">#000000</color>
|
||||
<color name="md_theme_surfaceTint">#000000</color>
|
||||
<color name="md_theme_scrim">#000000</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,35 +1,71 @@
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppThemeDayNight" parent="Theme.AppCompat.DayNight">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimary</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:statusBarColor">@color/colorPrimary</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="colorControlNormal">@color/colorAccent</item>
|
||||
<!-- MD3 Light Theme - base theme, uses DayNight for automatic switching -->
|
||||
<style name="AppThemeDayNight" parent="Theme.Material3.DayNight">
|
||||
<!-- Primary colors - main tone: black -->
|
||||
<item name="colorPrimary">@color/md_theme_primary</item>
|
||||
<item name="colorOnPrimary">@color/md_theme_onPrimary</item>
|
||||
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer</item>
|
||||
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer</item>
|
||||
|
||||
<!-- Secondary colors - accent color: orange -->
|
||||
<item name="colorSecondary">@color/md_theme_secondary</item>
|
||||
<item name="colorOnSecondary">@color/md_theme_onSecondary</item>
|
||||
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer</item>
|
||||
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer</item>
|
||||
|
||||
<!-- Tertiary colors - tertiary color: green -->
|
||||
<item name="colorTertiary">@color/md_theme_tertiary</item>
|
||||
<item name="colorOnTertiary">@color/md_theme_onTertiary</item>
|
||||
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer</item>
|
||||
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer</item>
|
||||
|
||||
<!-- Error colors -->
|
||||
<item name="colorError">@color/md_theme_error</item>
|
||||
<item name="colorOnError">@color/md_theme_onError</item>
|
||||
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
|
||||
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
|
||||
|
||||
<!-- Surface colors -->
|
||||
<item name="colorSurface">@color/md_theme_surface</item>
|
||||
<item name="colorOnSurface">@color/md_theme_onSurface</item>
|
||||
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant</item>
|
||||
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface</item>
|
||||
|
||||
<!-- Background colors -->
|
||||
<item name="android:colorBackground">@color/md_theme_background</item>
|
||||
<item name="colorOnBackground">@color/md_theme_onBackground</item>
|
||||
|
||||
<!-- Outline colors -->
|
||||
<item name="colorOutline">@color/md_theme_outline</item>
|
||||
<item name="colorOutlineVariant">@color/md_theme_outlineVariant</item>
|
||||
|
||||
<!-- Other colors -->
|
||||
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary</item>
|
||||
|
||||
<!-- Status bar and navigation bar - system bars -->
|
||||
<item name="android:statusBarColor">@color/md_theme_surface</item>
|
||||
<item name="android:navigationBarColor">@color/md_theme_surface</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
|
||||
</style>
|
||||
|
||||
<!-- Theme without ActionBar -->
|
||||
<style name="AppThemeDayNight.NoActionBar" parent="AppThemeDayNight">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar" />
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar.Translucent">
|
||||
<style name="AppThemeDayNight.NoActionBar.Translucent">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
</style>
|
||||
|
||||
<style name="BrandedSwitch" parent="AppTheme">
|
||||
<item name="colorAccent">@color/color_fab_active</item>
|
||||
<style name="BrandedSwitch" parent="AppThemeDayNight">
|
||||
<item name="colorPrimary">@color/color_fab_active</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user