6.6.2 - Alpha3 - 控件文字图标根据主题色亮度值自动切换颜色

This commit is contained in:
SuperMonster003
2025-03-08 23:16:49 +08:00
parent ce4f990046
commit b1c17f1222
35 changed files with 853 additions and 436 deletions

View File

@@ -1,15 +1,16 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:theme="@style/AppTheme.AppBarOverlay"
android:fitsSystemWindows="true">
<org.autojs.autojs.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
@@ -17,9 +18,8 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay">
app:popupTheme="@style/AppTheme.PopupOverlay" />
</org.autojs.autojs.theme.widget.ThemeColorToolbar>
</com.google.android.material.appbar.AppBarLayout>
<TextView
@@ -30,5 +30,6 @@
android:scrollbars="vertical"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"
tools:text="@string/text_error"/>
tools:text="@string/text_error" />
</LinearLayout>

View File

@@ -1,46 +1,46 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:fitsSystemWindows="true">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:fitsSystemWindows="true">
<org.autojs.autojs.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ToolBarStyle"
app:popupTheme="@style/AppTheme.PopupOverlay" />
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ToolBarStyle"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="4dp"
android:paddingEnd="2dp">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="4dp"
android:paddingEnd="2dp">
<org.autojs.autojs.core.console.ConsoleView
android:id="@+id/console"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@+id/console"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<org.autojs.autojs.theme.widget.ThemeColorFloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@drawable/ic_clear_white_48dp"
app:backgroundTint="?attr/colorPrimary"
android:tint="@color/toolbar_text" />
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@drawable/ic_clear_white_48dp"
app:backgroundTint="?attr/colorPrimary"
android:tint="@color/toolbar_text" />
</FrameLayout>
</LinearLayout>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.drawerlayout.widget.DrawerLayout 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/drawer_layout"
@@ -37,10 +36,7 @@
android:layout_height="match_parent"
app:tabGravity="fill"
app:tabMaxWidth="0dp"
app:tabIndicatorColor="@color/tab_indicator"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/tab_selected_text"
app:tabTextColor="@color/tab_text" />
app:tabMode="fixed" />
</com.google.android.material.appbar.AppBarLayout>
@@ -57,7 +53,6 @@
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:src="@drawable/ic_add_white_48dp"
android:tint="@color/toolbar_text"
app:backgroundTint="?attr/colorPrimary"
app:layout_anchor="@id/viewpager"
app:layout_anchorGravity="bottom|end"
@@ -84,7 +79,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="false"
android:fitsSystemWindows="true"
tools:layout="@layout/fragment_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -3,7 +3,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout

View File

@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_gravity="center|bottom"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_gravity="center|bottom"
android:gravity="center"
android:fitsSystemWindows="true"
android:orientation="horizontal">
<ImageView
android:id="@+id/logo"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="center"
android:src="@drawable/autojs6_material" />
android:id="@+id/logo"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="center"
android:src="@drawable/autojs6_material" />
<ImageView
android:layout_width="100dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:layout_marginStart="2dp"
android:src="@drawable/autojs6" />
android:layout_width="100dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:layout_marginStart="2dp"
android:src="@drawable/autojs6" />
</LinearLayout>

View File

@@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:background="?android:windowBackground"
android:clickable="true"
android:fitsSystemWindows="false"
android:fitsSystemWindows="true"
android:importantForAccessibility="no"
android:orientation="vertical"
android:focusable="true">

View File

@@ -1,42 +1,42 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<io.codetail.widget.RevealFrameLayout
android:id="@+id/appBarContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:id="@+id/appBarContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/MtAppTheme.AppBarOverlay"
android:clipToPadding="true"
android:fitsSystemWindows="true">
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/MtAppTheme.AppBarOverlay"
android:clipToPadding="true"
android:fitsSystemWindows="true">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="center_vertical"
android:theme="@style/ToolBarStyle"
app:contentInsetStartWithNavigation="@dimen/toolbar_content_inset_start_with_navigation"
app:popupTheme="@style/MtAppTheme.PopupOverlay"
tools:title="@string/text_sample_string" />
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="center_vertical"
android:theme="@style/ToolBarStyle"
app:contentInsetStartWithNavigation="@dimen/toolbar_content_inset_start_with_navigation"
app:popupTheme="@style/MtAppTheme.PopupOverlay"
tools:title="@string/text_sample_string" />
</com.google.android.material.appbar.AppBarLayout>
</io.codetail.widget.RevealFrameLayout>
<view
android:id="@+id/color_setting_recycler_view"
class="org.autojs.autojs.theme.app.ColorSelectActivity$Companion$ColorSettingRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@+id/color_setting_recycler_view"
class="org.autojs.autojs.theme.app.ColorSettingRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -6,14 +6,12 @@
android:id="@+id/action_log"
android:icon="@drawable/ic_ali_log"
android:title="@string/text_log"
android:iconTint="@color/toolbar_text"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_white_36dp"
android:title="@string/text_search"
android:iconTint="@color/toolbar_text"
android:imeOptions="actionSearch"
android:inputType="text"
app:actionViewClass="androidx.appcompat.widget.SearchView"

View File

@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="day_night">#DEBFBFBF</color>
<color name="day_night_full">#BFBFBF</color>
<color name="day_night">@color/dusk</color>
<color name="day_night_full">@color/dusk_full</color>
<color name="day_night_alpha_70">#B3BFBFBF</color>
<color name="day_night_alpha_30">#4DBFBFBF</color>
<color name="day_night_alpha_20">#33BFBFBF</color>
<color name="night_day">#DE252525</color>
<color name="night_day_full">#252525</color>
<color name="window_background">#212121</color>
<color name="night_day">@color/dawn</color>
<color name="night_day_full">@color/dawn_full</color>
<color name="window_background">@color/day_full</color>
<color name="window_background_selected">#3B3B3B</color>
<color name="text_color_primary">@color/day_night</color>
<color name="text_color_primary_full">@color/day_night_full</color>
@@ -33,7 +33,7 @@
<color name="dialog_button_failure">@color/dialog_button_error</color>
<color name="item_background">#333333</color>
<color name="item_background_dark">#252525</color>
<color name="item_background_dark">@color/dawn_full</color>
<color name="divider">#191919</color>
<color name="divider_functions_keyboard">#303030</color>
@@ -62,7 +62,7 @@
<color name="project_toolbar_button">#A9AAAB</color>
<color name="project_toolbar_title">#A9AAAB</color>
<color name="layout_window_bubble_bg">#DE212121</color>
<color name="layout_window_bubble_bg">@color/day</color>
<color name="layout_hierarchy_window_node_bounds">#FF6659</color>
<color name="layout_node_info_view_decoration_line">#1BF5F5F5</color>
<color name="layout_hierarchy_window_background">#CC102027</color>

View File

@@ -7,6 +7,7 @@
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:navigationBarColor">@color/window_background</item>
</style>
</resources>

View File

@@ -1,10 +0,0 @@
<resources>
<style name="AppTheme.FullScreen" parent="AppTheme">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

View File

@@ -1,13 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="day_night">#DE212121</color>
<color name="day_night_full">#212121</color>
<color name="day">#DE212121</color>
<color name="day_full">#212121</color>
<color name="night">#DEFBFBFB</color>
<color name="night_full">#FBFBFB</color>
<color name="dawn">#DE252525</color>
<color name="dawn_full">#252525</color>
<color name="dusk">#DEBFBFBF</color>
<color name="dusk_full">#BFBFBF</color>
<color name="day_night">@color/day</color>
<color name="day_night_full">@color/day_full</color>
<color name="day_night_alpha_70">#B3212121</color>
<color name="day_night_alpha_30">#4D212121</color>
<color name="day_night_alpha_20">#33212121</color>
<color name="night_day">#DEFBFBFB</color>
<color name="night_day_full">#FBFBFB</color>
<color name="night_day">@color/night</color>
<color name="night_day_full">@color/night_full</color>
<color name="window_background">#FFFFFF</color>
<color name="window_background_selected">#E5E5E5</color>
<color name="text_color_primary">@color/day_night</color>
@@ -112,10 +120,18 @@
<color name="market_button_unselected">#939393</color>
<color name="tab_indicator">#A0FFFFFF</color>
<color name="tab_indicator_light">#A0FFFFFF</color>
<color name="tab_indicator_dark">#80202020</color>
<color name="tab_text">#A0FFFFFF</color>
<color name="tab_text_light">#A0FFFFFF</color>
<color name="tab_text_dark">#A0202020</color>
<color name="tab_selected_text">#FFFFFF</color>
<color name="tab_selected_text_light">#FFFFFF</color>
<color name="tab_selected_text_dark">#111214</color>
<color name="toolbar_text">@color/night_day</color>
<color name="fab_tint_light">@color/night</color>
<color name="fab_tint_dark">@color/day</color>
<color name="toolbar_disabled">#6EE0E0E0</color>
<color name="prefTextColorPrimary">#282C2F</color>
@@ -135,7 +151,7 @@
<color name="color_selector_item_text">#DE111214</color>
<color name="floating_action_menu_label_bg">#CCE0E0E0</color>
<color name="navigation_bar_background">@color/window_background</color>
<color name="navigation_bar_background_before_android_o">#212121</color>
<color name="navigation_bar_background_before_android_o">@color/day_full</color>
<color name="swipe_refresh_background">#F8F8F8</color>
<color name="circular_menu_icon_red">#ef5350</color>
<color name="circular_menu_icon_white">#ffffff</color>

View File

@@ -18,6 +18,11 @@
<item name="actionOverflowMenuStyle">@style/OverflowMenu</item>
</style>
<style name="ToolBarStyleRaw" parent="ThemeOverlay.AppCompat.DayNight.ActionBar">
<item name="searchViewStyle">@style/SearchViewActionBar</item>
<item name="titleMarginStart">0dp</item>
</style>
<style name="ToolBarStyle" parent="ThemeOverlay.AppCompat.DayNight.ActionBar">
<item name="searchViewStyle">@style/SearchViewActionBar</item>
<item name="android:textColorPrimary">@color/toolbar_text</item>
@@ -48,12 +53,15 @@
<style name="AppTheme.FullScreen" parent="AppTheme">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="AppTheme.Splash" parent="@android:style/Theme.NoTitleBar.Fullscreen">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:navigationBarColor">@color/window_background</item>
</style>
<style name="AppTheme.Settings" parent="AppTheme">
@@ -91,7 +99,7 @@
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar">
<item name="android:textColorPrimary">#212121</item>
<item name="android:textColorPrimary">@color/day_full</item>
<item name="android:textColorSecondary">@color/colorAccent</item>
</style>
@@ -105,7 +113,7 @@
<style name="MtAppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" />
<style name="MtAppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight.ActionBar">
<item name="android:textColorPrimary">#212121</item>
<item name="android:textColorPrimary">@color/day_full</item>
</style>
<style name="ConsoleTheme" parent="Theme.AppCompat.Light.DarkActionBar">
@@ -138,6 +146,16 @@
<item name="android:tint">@color/day_night</item>
</style>
<style name="PopupMenuThemeLight" parent="AppTheme.PopupOverlay">
<item name="android:textColor">@color/day</item>
<item name="android:tint">@color/day</item>
</style>
<style name="PopupMenuThemeDark" parent="AppTheme.PopupOverlay">
<item name="android:textColor">@color/dusk</item>
<item name="android:tint">@color/dusk</item>
</style>
<style name="SearchViewActionBar" parent="@style/Widget.AppCompat.SearchView.ActionBar" />
<style name="Material3DarkTheme" parent="@style/Theme.Material3.Dark" />