UI: Port more to Material 3
This also activates Material 3 (with fixed colors) for older Android versions. We don't want to maintain multiple designs, so the most reasonable approach is to use a single design for all, but focus on the best UX for more recent versions (as those are used by more people).
This commit is contained in:
parent
7af2623d26
commit
9f043e2566
26 changed files with 711 additions and 24 deletions
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.microg.gms.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
import androidx.core.content.res.TypedArrayUtils
|
||||
import androidx.preference.PreferenceViewHolder
|
||||
import androidx.preference.TwoStatePreference
|
||||
import org.microg.gms.base.core.R
|
||||
|
||||
// TODO
|
||||
class SwitchBarPreference : TwoStatePreference {
|
||||
private val frameId: Int
|
||||
private val backgroundOn: Drawable?
|
||||
private val backgroundOff: Drawable?
|
||||
private val backgroundDisabled: Drawable?
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
val a = context.obtainStyledAttributes(attrs, R.styleable.SwitchBarPreference, defStyleAttr, defStyleRes)
|
||||
frameId = a.getResourceId(R.styleable.SwitchBarPreference_switchBarFrameId, 0)
|
||||
backgroundOn = a.getDrawable(R.styleable.SwitchBarPreference_switchBarFrameBackgroundOn)
|
||||
backgroundOff = a.getDrawable(R.styleable.SwitchBarPreference_switchBarFrameBackgroundOff)
|
||||
backgroundDisabled = a.getDrawable(R.styleable.SwitchBarPreference_switchBarFrameBackgroundDisabled)
|
||||
}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : this(context, attrs, defStyleAttr, R.style.Preference_SwitchBar)
|
||||
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, R.attr.switchBarPreferenceStyle)
|
||||
constructor(context: Context) : this(context, null)
|
||||
|
||||
override fun onBindViewHolder(holder: PreferenceViewHolder) {
|
||||
super.onBindViewHolder(holder)
|
||||
holder.isDividerAllowedBelow = false
|
||||
holder.isDividerAllowedAbove = false
|
||||
val switch = holder.findViewById(R.id.switch_widget) as SwitchCompat
|
||||
switch.setOnCheckedChangeListener(null)
|
||||
switch.isChecked = isChecked
|
||||
switch.setOnCheckedChangeListener { view, isChecked ->
|
||||
if (!callChangeListener(isChecked)) {
|
||||
view.isChecked = !isChecked
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
this.isChecked = isChecked
|
||||
}
|
||||
val frame = if (frameId == 0) null else holder.findViewById(frameId)
|
||||
val backgroundView = frame ?: holder.itemView
|
||||
val (backgroundDrawable, backgroundColorAttribute) = when {
|
||||
!isEnabled -> Pair(backgroundDisabled, androidx.appcompat.R.attr.colorControlHighlight)
|
||||
isChecked -> Pair(backgroundOn, androidx.appcompat.R.attr.colorControlActivated)
|
||||
else -> Pair(backgroundOff, androidx.appcompat.R.attr.colorButtonNormal)
|
||||
}
|
||||
if (backgroundDrawable != null) {
|
||||
backgroundView.setBackgroundDrawable(backgroundDrawable)
|
||||
} else {
|
||||
backgroundView.setBackgroundColorAttribute(backgroundColorAttribute)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<RelativeLayout 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="wrap_content"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingRight="?attr/listPreferredItemPaddingRight"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@android:id/icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:antialias="true"
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@android:mipmap/sym_def_app_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:singleLine="false"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="20sp"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
52
play-services-base/core/src/main/res/values/themes.xml
Normal file
52
play-services-base/core/src/main/res/values/themes.xml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ SPDX-FileCopyrightText: 2020, microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="Theme.AppCompat.Light.Dialog.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AppCompat.Light.Dialog.Alert.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AppCompat.DayNight.Dialog.Alert.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Translucent" parent="Theme.AppCompat.DayNight.Dialog.Alert.NoActionBar">
|
||||
<item name="background">@android:color/transparent</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="PreferenceTheme">
|
||||
<attr format="reference" name="switchBarPreferenceStyle"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="SwitchBarPreference">
|
||||
<attr format="reference" name="switchBarFrameId" />
|
||||
<attr format="reference" name="switchBarFrameBackgroundOn" />
|
||||
<attr format="reference" name="switchBarFrameBackgroundOff" />
|
||||
<attr format="reference" name="switchBarFrameBackgroundDisabled" />
|
||||
</declare-styleable>
|
||||
|
||||
<style name="Preference.SwitchBar">
|
||||
<item name="layout">@layout/preference_switch_bar</item>
|
||||
<item name="switchBarFrameBackgroundOn">?attr/colorControlActivated</item>
|
||||
<item name="switchBarFrameBackgroundOff">?attr/colorButtonNormal</item>
|
||||
<item name="switchBarFrameBackgroundDisabled">?attr/colorControlHighlight</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -10,8 +10,14 @@ import androidx.navigation.fragment.NavHostFragment;
|
|||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
<<<<<<< HEAD:play-services-core/src/main/java/org/microg/gms/ui/SettingsActivity.java
|
||||
import com.google.android.material.color.DynamicColors;
|
||||
import com.mgoogle.android.gms.R;
|
||||
=======
|
||||
import com.google.android.gms.R;
|
||||
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
||||
import org.microg.gms.ui.settings.SettingsProvider;
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3):play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -26,11 +32,21 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.settings_root_activity);
|
||||
<<<<<<< HEAD:play-services-core/src/main/java/org/microg/gms/ui/SettingsActivity.java
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
DynamicColors.applyToActivityIfAvailable(this);
|
||||
=======
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
CollapsingToolbarLayout toolbarLayout = findViewById(R.id.collapsing_toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
for (SettingsProvider settingsProvider : getAllSettingsProviders(this)) {
|
||||
settingsProvider.extendNavigation(getNavController());
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3):play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java
|
||||
}
|
||||
appBarConfiguration = new AppBarConfiguration.Builder(getNavController().getGraph()).build();
|
||||
NavigationUI.setupActionBarWithNavController(this, getNavController(), appBarConfiguration);
|
||||
NavigationUI.setupWithNavController(toolbarLayout, toolbar, getNavController(), appBarConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class SafetyNetFragment : PreferenceFragmentCompat() {
|
|||
val newStatus = newValue as Boolean
|
||||
SafetyNetPreferences.setEnabled(requireContext(), newStatus)
|
||||
DroidGuardPreferences.setEnabled(requireContext(), newStatus)
|
||||
droidguardUnsupported.isVisible = switchBarPreference.isChecked && !DroidGuardPreferences.isAvailable(requireContext())
|
||||
droidguardUnsupported.isVisible = newStatus && !DroidGuardPreferences.isAvailable(requireContext())
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:color="?attr/colorOnSecondaryContainer" android:alpha="?android:attr/disabledAlpha" />
|
||||
<item android:color="?attr/colorOnSecondaryContainer" />
|
||||
</selector>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSecondaryContainer"/>
|
||||
<corners android:radius="28dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSurfaceContainer"/>
|
||||
<corners android:radius="28dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="?attr/colorSecondaryContainer"/>
|
||||
<corners android:radius="28dp"/>
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="?attr/colorSurfaceContainer"/>
|
||||
<corners android:radius="28dp"/>
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Derived from https://github.com/androidx/androidx/blob/8cb282cc/preference/preference/res/layout/preference_widget_switch_compat.xml -->
|
||||
<com.google.android.material.materialswitch.MaterialSwitch xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/switchWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:focusable="false" />
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/transparent"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingRight="?attr/listPreferredItemPaddingRight"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frame"
|
||||
android:minHeight="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingHorizontal="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginRight="24dp"
|
||||
android:layout_marginVertical="24dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?attr/textAppearanceListItem"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/material_switch_bar_text_color"
|
||||
tools:text="Enabled"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"/>
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
tools:checked="true" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -1,19 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2020, microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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">
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<<<<<<< HEAD
|
||||
<fragment
|
||||
android:id="@+id/navhost"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
=======
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_toolbar"
|
||||
style="?attr/collapsingToolbarLayoutLargeStyle"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
android:layout_height="?attr/collapsingToolbarLayoutLargeSize">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_collapseMode="pin" />
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3)
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:navGraph="@navigation/nav_settings" />
|
||||
</LinearLayout>
|
||||
android:fillViewport="true"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/navhost"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:navGraph="@navigation/nav_settings" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
|||
59
play-services-core/src/main/res/values-night-v8/themes.xml
Normal file
59
play-services-core/src/main/res/values-night-v8/themes.xml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<style name="Theme.Base.DayNight" parent="Theme.Base.Dark" />
|
||||
<style name="Theme.Base.DayNight.NoActionBar" parent="Theme.Base.Dark.NoActionBar" />
|
||||
|
||||
<style name="Theme.App" parent="Theme.Base.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/gm3_ref_palette_primary80</item>
|
||||
<item name="colorOnPrimary">@color/gm3_ref_palette_primary20</item>
|
||||
<item name="colorPrimaryContainer">@color/gm3_ref_palette_primary30</item>
|
||||
<item name="colorOnPrimaryContainer">@color/gm3_ref_palette_primary90</item>
|
||||
<item name="colorPrimaryInverse">@color/gm3_ref_palette_primary40</item>
|
||||
<item name="colorPrimaryFixed">@color/gm3_ref_palette_primary90</item>
|
||||
<item name="colorPrimaryFixedDim">@color/gm3_ref_palette_primary80</item>
|
||||
<item name="colorOnPrimaryFixed">@color/gm3_ref_palette_primary10</item>
|
||||
<item name="colorOnPrimaryFixedVariant">@color/gm3_ref_palette_primary30</item>
|
||||
<item name="colorSecondary">@color/gm3_ref_palette_secondary80</item>
|
||||
<item name="colorOnSecondary">@color/gm3_ref_palette_secondary20</item>
|
||||
<item name="colorSecondaryContainer">@color/gm3_ref_palette_secondary30</item>
|
||||
<item name="colorOnSecondaryContainer">@color/gm3_ref_palette_secondary90</item>
|
||||
<item name="colorSecondaryFixed">@color/gm3_ref_palette_secondary90</item>
|
||||
<item name="colorSecondaryFixedDim">@color/gm3_ref_palette_secondary80</item>
|
||||
<item name="colorOnSecondaryFixed">@color/gm3_ref_palette_secondary10</item>
|
||||
<item name="colorOnSecondaryFixedVariant">@color/gm3_ref_palette_secondary30</item>
|
||||
<item name="colorTertiary">@color/gm3_ref_palette_tertiary80</item>
|
||||
<item name="colorOnTertiary">@color/gm3_ref_palette_tertiary20</item>
|
||||
<item name="colorTertiaryContainer">@color/gm3_ref_palette_tertiary30</item>
|
||||
<item name="colorOnTertiaryContainer">@color/gm3_ref_palette_tertiary90</item>
|
||||
<item name="colorTertiaryFixed">@color/gm3_ref_palette_tertiary90</item>
|
||||
<item name="colorTertiaryFixedDim">@color/gm3_ref_palette_tertiary80</item>
|
||||
<item name="colorOnTertiaryFixed">@color/gm3_ref_palette_tertiary10</item>
|
||||
<item name="colorOnTertiaryFixedVariant">@color/gm3_ref_palette_tertiary30</item>
|
||||
|
||||
<item name="colorError">@color/gm3_ref_palette_error80</item>
|
||||
<item name="colorOnError">@color/gm3_ref_palette_error20</item>
|
||||
<item name="colorErrorContainer">@color/gm3_ref_palette_error30</item>
|
||||
<item name="colorOnErrorContainer">@color/gm3_ref_palette_error90</item>
|
||||
<item name="colorOutline">@color/gm3_ref_palette_neutral_variant60</item>
|
||||
<item name="colorOutlineVariant">@color/gm3_ref_palette_neutral_variant30</item>
|
||||
<item name="android:colorBackground">@color/gm3_ref_palette_neutral6</item>
|
||||
<item name="colorOnBackground">@color/gm3_ref_palette_neutral90</item>
|
||||
<item name="colorSurface">@color/gm3_ref_palette_neutral6</item>
|
||||
<item name="colorOnSurface">@color/gm3_ref_palette_neutral90</item>
|
||||
<item name="colorSurfaceVariant">@color/gm3_ref_palette_neutral_variant30</item>
|
||||
<item name="colorOnSurfaceVariant">@color/gm3_ref_palette_neutral_variant80</item>
|
||||
<item name="colorSurfaceInverse">@color/gm3_ref_palette_neutral90</item>
|
||||
<item name="colorOnSurfaceInverse">@color/gm3_ref_palette_neutral20</item>
|
||||
<item name="colorSurfaceBright">#ff37393b</item>
|
||||
<item name="colorSurfaceDim">@color/gm3_ref_palette_neutral6</item>
|
||||
<item name="colorSurfaceContainer">#ff1e1f20</item>
|
||||
<item name="colorSurfaceContainerLow">#ff1b1b1b</item>
|
||||
<item name="colorSurfaceContainerLowest">#ff0e0e0e</item>
|
||||
<item name="colorSurfaceContainerHigh">#ff282a2c</item>
|
||||
<item name="colorSurfaceContainerHighest">#ff333537</item>
|
||||
</style>
|
||||
</resources>
|
||||
11
play-services-core/src/main/res/values-v23/themes.xml
Normal file
11
play-services-core/src/main/res/values-v23/themes.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.Base.Light">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
</style>
|
||||
<style name="Theme.Base.Dark">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
3
play-services-core/src/main/res/values-v27/themes.xml
Normal file
3
play-services-core/src/main/res/values-v27/themes.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
</resources>
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<resources>
|
||||
<<<<<<< HEAD
|
||||
<style name="AppTheme" parent="Theme.Material3.DynamicColors.DayNight"/>
|
||||
<style name="Theme.Material3.DynamicColors.DayNight" parent="Theme.Material3.DynamicColors.Light"/>
|
||||
<style name="Theme.Material3.DynamicColors.Light" parent="Theme.Material3.Light">
|
||||
|
|
@ -9,5 +10,9 @@
|
|||
<item name="colorTertiary">@android:color/system_accent3_600</item>
|
||||
<item name="colorOnTertiary">@android:color/system_accent3_0</item>
|
||||
<item name="colorOnBackground">@android:color/system_neutral1_900</item>
|
||||
=======
|
||||
<style name="Theme.App" parent="Theme.Base.DayNight.NoActionBar">
|
||||
<item name="isMaterial3DynamicColorApplied">true</item>
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3)
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -16,9 +16,63 @@
|
|||
|
||||
<resources>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<color name="login_blue_theme_primary">#ff9a82db</color>
|
||||
<color name="login_blue_theme_primary_dark">#ff9a82db</color>
|
||||
<color name="login_blue_theme_accent">#ff9a82db</color>
|
||||
<color name="m3_theme_primary_dark">#ff9a82db</color>
|
||||
|
||||
=======
|
||||
<color name="dialog_border_color">#88CCCCCC</color>
|
||||
<color name="material_error">#fff44336</color>
|
||||
|
||||
<color name="gm3_ref_palette_error10">#ff410e0b</color>
|
||||
<color name="gm3_ref_palette_error100">#ffffffff</color>
|
||||
<color name="gm3_ref_palette_error20">#ff601410</color>
|
||||
<color name="gm3_ref_palette_error30">#ff8c1d18</color>
|
||||
<color name="gm3_ref_palette_error40">#ffb3261e</color>
|
||||
<color name="gm3_ref_palette_error60">#ffe46962</color>
|
||||
<color name="gm3_ref_palette_error80">#fff2b8b5</color>
|
||||
<color name="gm3_ref_palette_error90">#fff9dedc</color>
|
||||
<color name="gm3_ref_palette_grey30">#ff474747</color>
|
||||
<color name="gm3_ref_palette_grey50">#ff757575</color>
|
||||
<color name="gm3_ref_palette_neutral10">#ff1f1f1f</color>
|
||||
<color name="gm3_ref_palette_neutral100">#ffffffff</color>
|
||||
<color name="gm3_ref_palette_neutral20">#ff303030</color>
|
||||
<color name="gm3_ref_palette_neutral6">#ff131314</color>
|
||||
<color name="gm3_ref_palette_neutral90">#ffe3e3e3</color>
|
||||
<color name="gm3_ref_palette_neutral95">#fff2f2f2</color>
|
||||
<color name="gm3_ref_palette_neutral_variant20">#ff2d312f</color>
|
||||
<color name="gm3_ref_palette_neutral_variant30">#ff444746</color>
|
||||
<color name="gm3_ref_palette_neutral_variant40">#ff5c5f5e</color>
|
||||
<color name="gm3_ref_palette_neutral_variant50">#ff747775</color>
|
||||
<color name="gm3_ref_palette_neutral_variant60">#ff8e918f</color>
|
||||
<color name="gm3_ref_palette_neutral_variant70">#ffa9acaa</color>
|
||||
<color name="gm3_ref_palette_neutral_variant80">#ffc4c7c5</color>
|
||||
<color name="gm3_ref_palette_neutral_variant90">#ffe1e3e1</color>
|
||||
<color name="gm3_ref_palette_primary10">#ff041e49</color>
|
||||
<color name="gm3_ref_palette_primary100">#ffffffff</color>
|
||||
<color name="gm3_ref_palette_primary20">#ff062e6f</color>
|
||||
<color name="gm3_ref_palette_primary30">#ff0842a0</color>
|
||||
<color name="gm3_ref_palette_primary40">#ff0b57d0</color>
|
||||
<color name="gm3_ref_palette_primary70">#ff7cacf8</color>
|
||||
<color name="gm3_ref_palette_primary80">#ffa8c7fa</color>
|
||||
<color name="gm3_ref_palette_primary90">#ffd3e3fd</color>
|
||||
<color name="gm3_ref_palette_secondary10">#ff001d35</color>
|
||||
<color name="gm3_ref_palette_secondary100">#ffffffff</color>
|
||||
<color name="gm3_ref_palette_secondary20">#ff003355</color>
|
||||
<color name="gm3_ref_palette_secondary30">#ff004a77</color>
|
||||
<color name="gm3_ref_palette_secondary40">#ff00639b</color>
|
||||
<color name="gm3_ref_palette_secondary70">#ff5ab3f0</color>
|
||||
<color name="gm3_ref_palette_secondary80">#ff7fcfff</color>
|
||||
<color name="gm3_ref_palette_secondary90">#ffc2e7ff</color>
|
||||
<color name="gm3_ref_palette_tertiary10">#ff072711</color>
|
||||
<color name="gm3_ref_palette_tertiary100">#ffffffff</color>
|
||||
<color name="gm3_ref_palette_tertiary20">#ff0a3818</color>
|
||||
<color name="gm3_ref_palette_tertiary30">#ff0f5223</color>
|
||||
<color name="gm3_ref_palette_tertiary40">#ff146c2e</color>
|
||||
<color name="gm3_ref_palette_tertiary80">#ff6dd58c</color>
|
||||
<color name="gm3_ref_palette_tertiary90">#ffc4eed0</color>
|
||||
<color name="gm3_ref_palette_white">#ffffffff</color>
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3)
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,34 +1,122 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (C) 2013-2017 microG Project Team
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
~ SPDX-FileCopyrightText: 2015 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<style name="AppTheme" parent="Theme.Material3.DayNight"/>
|
||||
|
||||
<style name="Theme.Material3.DayNight" parent="Theme.Material3.Light">
|
||||
<item name="colorPrimaryDark">@color/m3_theme_primary_dark</item>
|
||||
</style>
|
||||
|
||||
=======
|
||||
<!-- Base application theme -->
|
||||
<style name="Theme.Base" parent="Theme.Material3.DynamicColors.DayNight">
|
||||
<item name="preferenceTheme">@style/Theme.Base.PreferenceThemeOverlay</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Base.DayNight" parent="Theme.Base.Light" />
|
||||
|
||||
<style name="Theme.Base.DayNight.NoActionBar" parent="Theme.Base.Light.NoActionBar" />
|
||||
|
||||
<style name="Theme.Base.Dark" />
|
||||
|
||||
<style name="Theme.Base.Dark.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Base.Light" />
|
||||
|
||||
<style name="Theme.Base.Light.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<!-- Preference theme -->
|
||||
<style name="Theme.Base.PreferenceThemeOverlay" parent="@style/PreferenceThemeOverlay">
|
||||
<item name="switchPreferenceCompatStyle">@style/Theme.Base.Preference.SwitchPreferenceCompat</item>
|
||||
<item name="switchBarPreferenceStyle">@style/Theme.Base.Preference.SwitchBarPreference</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Base.Preference.SwitchPreferenceCompat" parent="@style/Preference.SwitchPreferenceCompat.Material">
|
||||
<item name="widgetLayout">@layout/preference_material_switch</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Base.Preference.SwitchBarPreference" parent="@style/Preference.SwitchBar">
|
||||
<item name="layout">@layout/preference_material_switch_bar</item>
|
||||
<item name="switchBarFrameId">@id/frame</item>
|
||||
<item name="switchBarFrameBackgroundOn">@drawable/material_switch_bar_background</item>
|
||||
<item name="switchBarFrameBackgroundOff">@drawable/material_switch_bar_background</item>
|
||||
<item name="switchBarFrameBackgroundDisabled">@drawable/material_switch_bar_background_disabled</item>
|
||||
</style>
|
||||
|
||||
<!-- Application theme (< API23) -->
|
||||
<style name="Theme.App" parent="Theme.Base.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/gm3_ref_palette_primary40</item>
|
||||
<item name="colorOnPrimary">@color/gm3_ref_palette_primary100</item>
|
||||
<item name="colorPrimaryContainer">@color/gm3_ref_palette_primary90</item>
|
||||
<item name="colorOnPrimaryContainer">@color/gm3_ref_palette_primary10</item>
|
||||
<item name="colorPrimaryInverse">@color/gm3_ref_palette_primary80</item>
|
||||
<item name="colorPrimaryFixed">@color/gm3_ref_palette_primary90</item>
|
||||
<item name="colorPrimaryFixedDim">@color/gm3_ref_palette_primary80</item>
|
||||
<item name="colorOnPrimaryFixed">@color/gm3_ref_palette_primary10</item>
|
||||
<item name="colorOnPrimaryFixedVariant">@color/gm3_ref_palette_primary30</item>
|
||||
<item name="colorSecondary">@color/gm3_ref_palette_secondary40</item>
|
||||
<item name="colorOnSecondary">@color/gm3_ref_palette_secondary100</item>
|
||||
<item name="colorSecondaryContainer">@color/gm3_ref_palette_secondary90</item>
|
||||
<item name="colorOnSecondaryContainer">@color/gm3_ref_palette_secondary10</item>
|
||||
<item name="colorSecondaryFixed">@color/gm3_ref_palette_secondary90</item>
|
||||
<item name="colorSecondaryFixedDim">@color/gm3_ref_palette_secondary80</item>
|
||||
<item name="colorOnSecondaryFixed">@color/gm3_ref_palette_secondary10</item>
|
||||
<item name="colorOnSecondaryFixedVariant">@color/gm3_ref_palette_secondary30</item>
|
||||
<item name="colorTertiary">@color/gm3_ref_palette_tertiary40</item>
|
||||
<item name="colorOnTertiary">@color/gm3_ref_palette_tertiary100</item>
|
||||
<item name="colorTertiaryContainer">@color/gm3_ref_palette_tertiary90</item>
|
||||
<item name="colorOnTertiaryContainer">@color/gm3_ref_palette_tertiary10</item>
|
||||
<item name="colorTertiaryFixed">@color/gm3_ref_palette_tertiary90</item>
|
||||
<item name="colorTertiaryFixedDim">@color/gm3_ref_palette_tertiary80</item>
|
||||
<item name="colorOnTertiaryFixed">@color/gm3_ref_palette_tertiary10</item>
|
||||
<item name="colorOnTertiaryFixedVariant">@color/gm3_ref_palette_tertiary30</item>
|
||||
|
||||
<item name="colorError">@color/gm3_ref_palette_error40</item>
|
||||
<item name="colorOnError">@color/gm3_ref_palette_error100</item>
|
||||
<item name="colorErrorContainer">@color/gm3_ref_palette_error90</item>
|
||||
<item name="colorOnErrorContainer">@color/gm3_ref_palette_error10</item>
|
||||
<item name="colorOutline">@color/gm3_ref_palette_neutral_variant50</item>
|
||||
<item name="colorOutlineVariant">@color/gm3_ref_palette_neutral_variant80</item>
|
||||
<item name="android:colorBackground">@color/gm3_ref_palette_neutral100</item>
|
||||
<item name="colorOnBackground">@color/gm3_ref_palette_neutral10</item>
|
||||
<item name="colorSurface">@color/gm3_ref_palette_neutral100</item>
|
||||
<item name="colorOnSurface">@color/gm3_ref_palette_neutral10</item>
|
||||
<item name="colorSurfaceVariant">@color/gm3_ref_palette_neutral_variant90</item>
|
||||
<item name="colorOnSurfaceVariant">@color/gm3_ref_palette_neutral_variant30</item>
|
||||
<item name="colorSurfaceInverse">@color/gm3_ref_palette_neutral20</item>
|
||||
<item name="colorOnSurfaceInverse">@color/gm3_ref_palette_neutral90</item>
|
||||
<item name="colorSurfaceBright">@color/gm3_ref_palette_neutral100</item>
|
||||
<item name="colorSurfaceDim">#ffd3dbe5</item>
|
||||
<item name="colorSurfaceContainer">#fff0f4f9</item>
|
||||
<item name="colorSurfaceContainerLow">#fff8fafd</item>
|
||||
<item name="colorSurfaceContainerLowest">@color/gm3_ref_palette_primary100</item>
|
||||
<item name="colorSurfaceContainerHigh">#ffe9eef6</item>
|
||||
<item name="colorSurfaceContainerHighest">#ffdde3ea</item>
|
||||
</style>
|
||||
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3)
|
||||
<style name="Theme.LoginBlue" parent="Theme.LoginBlue.Base" />
|
||||
<style name="Theme.LoginBlue.Base" parent="Theme.Material3.DayNight">
|
||||
<item name="colorPrimary">@color/login_blue_theme_primary</item>
|
||||
<item name="colorPrimaryDark">@color/login_blue_theme_primary_dark</item>
|
||||
<item name="colorPrimaryDark">@color/login_blue_theme_primary_dark
|
||||
</item>
|
||||
<item name="colorAccent">@color/login_blue_theme_accent</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
</style>
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3)
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
android:targetPackage="com.android.settings" />
|
||||
</Preference>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<Preference
|
||||
android:icon="@drawable/ic_add_account"
|
||||
android:summary="@string/pref_add_account_summary"
|
||||
|
|
@ -40,6 +41,24 @@
|
|||
android:action="android.intent.action.VIEW"
|
||||
android:data="https://myaccount.google.com/u/0/yourdata/youtube"/>
|
||||
</Preference>
|
||||
=======
|
||||
<PreferenceCategory android:title="@string/account_manager_title">
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="auth_manager_trust_google"
|
||||
android:summary="@string/pref_auth_trust_google_summary"
|
||||
android:title="@string/pref_auth_trust_google_title"/>
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="auth_manager_visible"
|
||||
android:summary="@string/pref_auth_visible_summary"
|
||||
android:title="@string/pref_auth_visible_title"/>
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="auth_include_android_id"
|
||||
android:summary="@string/pref_auth_include_android_id_summary"
|
||||
android:title="@string/pref_auth_include_android_id_title"/>
|
||||
>>>>>>> 566215bd (UI: Port more to Material 3)
|
||||
</PreferenceCategory>
|
||||
|
||||
<Preference
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue