mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-27 00:07:39 +00:00
Added initial load of styles and attributes
Required for creating basic screens
This commit is contained in:
parent
cba0d04000
commit
a5830599c4
5
app/src/main/res/color/color_menu_tint.xml
Normal file
5
app/src/main/res/color/color_menu_tint.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="?colorSecondary" android:state_checked="true" />
|
||||||
|
<item android:color="?colorOnSurfaceVariant" />
|
||||||
|
</selector>
|
12
app/src/main/res/drawable/bg_accent.xml
Normal file
12
app/src/main/res/drawable/bg_accent.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners android:radius="2.5dp" />
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:angle="135"
|
||||||
|
android:endColor="?colorSecondary"
|
||||||
|
android:startColor="?colorPrimary" />
|
||||||
|
|
||||||
|
</shape>
|
14
app/src/main/res/drawable/bg_circle.xml
Normal file
14
app/src/main/res/drawable/bg_circle.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:left="-300dp"
|
||||||
|
android:right="-300dp"
|
||||||
|
android:top="-300dp">
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
<gradient
|
||||||
|
android:endColor="?colorSecondary"
|
||||||
|
android:startColor="?colorPrimary" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
21
app/src/main/res/drawable/bg_divider_top.xml
Normal file
21
app/src/main/res/drawable/bg_divider_top.xml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="?colorSurface" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item
|
||||||
|
android:bottom="-2dp"
|
||||||
|
android:left="-2dp"
|
||||||
|
android:right="-2dp"
|
||||||
|
android:top="0dp">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<stroke
|
||||||
|
android:width="2px"
|
||||||
|
android:color="#1F000000" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</layer-list>
|
253
app/src/main/res/layout/test.xml
Normal file
253
app/src/main/res/layout/test.xml
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout 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">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
style="?styleAppbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:background="@drawable/bg_circle"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/home_toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/home_toolbar"
|
||||||
|
style="?styleToolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
app:contentInsetStartWithNavigation="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
tools:paddingTop="24dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="?l1">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="?styleToolbarTitle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="?colorOnPrimary"
|
||||||
|
tools:text="Home" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="5dp"
|
||||||
|
android:layout_gravity="center|bottom"
|
||||||
|
android:background="@drawable/bg_accent" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="?l1"
|
||||||
|
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/home_magisk_wrapper"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/icon1"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@tools:sample/avatars" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/title1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="?l1"
|
||||||
|
android:text="Magisk"
|
||||||
|
android:textAppearance="?appearanceTextTitleNormal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/icon1"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/status1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="is up to date"
|
||||||
|
android:textAppearance="?appearanceTextCaptionVariant"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/title1"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/title1"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/title1" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="?l1"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/status1">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
style="?styleButtonDefault"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/update"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
style="?styleButtonText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/install" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/home_manager_wrapper"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="?l1"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/icon1"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@tools:sample/avatars" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/title1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="?l1"
|
||||||
|
android:text="Manager"
|
||||||
|
android:textAppearance="?appearanceTextTitleNormal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/icon1"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/status1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="has update available!"
|
||||||
|
android:textAppearance="?appearanceTextCaptionVariant"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/title1"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/title1"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/title1" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="?l1"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/status1">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
style="?styleButtonDefault"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/update" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
style="?styleButtonText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/install"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
style="?styleCardNormal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="?l1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="?l1">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif-black"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textAppearance="?appearanceTextCaptionNormal"
|
||||||
|
android:textSize="10sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Support us" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="todo..." />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:background="@drawable/bg_divider_top"
|
||||||
|
android:paddingBottom="48dp"
|
||||||
|
app:itemIconSize="20dp"
|
||||||
|
app:itemIconTint="@color/color_menu_tint"
|
||||||
|
app:itemTextAppearanceActive="@style/AppearanceFoundation.Tiny"
|
||||||
|
app:itemTextAppearanceInactive="@style/AppearanceFoundation.Tiny"
|
||||||
|
app:itemTextColor="@color/color_menu_tint"
|
||||||
|
app:labelVisibilityMode="labeled"
|
||||||
|
app:menu="@menu/menu_bottom_nav" />
|
||||||
|
|
||||||
|
<!--<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:layout_anchor="@+id/home_bottom_bar" />-->
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
29
app/src/main/res/menu/menu_bottom_nav.xml
Normal file
29
app/src/main/res/menu/menu_bottom_nav.xml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/magiskFragment"
|
||||||
|
android:icon="@drawable/ic_magisk_outline"
|
||||||
|
android:title="Home"
|
||||||
|
tools:showAsAction="always" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/magiskFragment"
|
||||||
|
android:icon="@drawable/ic_cloud_download"
|
||||||
|
android:title="@string/modules"
|
||||||
|
tools:showAsAction="always" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/magiskFragment"
|
||||||
|
android:icon="@drawable/ic_bug_report"
|
||||||
|
android:title="@string/log"
|
||||||
|
tools:showAsAction="always" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/settingsFragment"
|
||||||
|
android:icon="@drawable/ic_settings"
|
||||||
|
android:title="@string/settings"
|
||||||
|
tools:showAsAction="always" />
|
||||||
|
|
||||||
|
</menu>
|
8
app/src/main/res/menu/menu_invisible.xml
Normal file
8
app/src/main/res/menu/menu_invisible.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<item
|
||||||
|
android:enabled="false"
|
||||||
|
android:title=""
|
||||||
|
app:showAsAction="always" />
|
||||||
|
</menu>
|
9
app/src/main/res/values-v19/styles_md2.xml
Normal file
9
app/src/main/res/values-v19/styles_md2.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="Foundation.Compat">
|
||||||
|
<item name="android:windowTranslucentNavigation">true</item>
|
||||||
|
<item name="android:windowTranslucentStatus">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
@ -1,7 +1,75 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!--region Deprecated-->
|
||||||
<attr name="cardStyle" format="reference" />
|
<attr name="cardStyle" format="reference" />
|
||||||
<attr name="colorAccentFallback" format="reference" />
|
<attr name="colorAccentFallback" format="reference" />
|
||||||
<attr name="imageColorTint" format="reference" />
|
<attr name="imageColorTint" format="reference" />
|
||||||
<attr name="colorControl" format="reference" />
|
<attr name="colorControl" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Widgets-->
|
||||||
|
|
||||||
|
<!--region Appbar-->
|
||||||
|
<attr name="styleAppbar" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
<!--region Toolbar-->
|
||||||
|
<attr name="styleToolbar" format="reference" />
|
||||||
|
<attr name="styleToolbarTitle" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
<!--region Card-->
|
||||||
|
<attr name="styleCardNormal" format="reference" />
|
||||||
|
<attr name="styleCardOnPrimary" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
<!--region Button-->
|
||||||
|
<attr name="styleButtonDefault" format="reference" />
|
||||||
|
<attr name="styleButtonFlat" format="reference" />
|
||||||
|
<attr name="styleButtonText" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Texts-->
|
||||||
|
|
||||||
|
<!--region Display-->
|
||||||
|
<attr name="appearanceTextDisplayNormal" format="reference" />
|
||||||
|
<attr name="appearanceTextDisplayVariant" format="reference" />
|
||||||
|
<attr name="appearanceTextDisplayOnPrimary" format="reference" />
|
||||||
|
<attr name="appearanceTextDisplayOnPrimaryVariant" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
<!--region Title-->
|
||||||
|
<attr name="appearanceTextTitleNormal" format="reference" />
|
||||||
|
<attr name="appearanceTextTitleVariant" format="reference" />
|
||||||
|
<attr name="appearanceTextTitleOnPrimary" format="reference" />
|
||||||
|
<attr name="appearanceTextTitleOnPrimaryVariant" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
<!--region Body-->
|
||||||
|
<attr name="appearanceTextBodyNormal" format="reference" />
|
||||||
|
<attr name="appearanceTextBodyVariant" format="reference" />
|
||||||
|
<attr name="appearanceTextBodyOnPrimary" format="reference" />
|
||||||
|
<attr name="appearanceTextBodyOnPrimaryVariant" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
<!--region Caption-->
|
||||||
|
<attr name="appearanceTextCaptionNormal" format="reference" />
|
||||||
|
<attr name="appearanceTextCaptionVariant" format="reference" />
|
||||||
|
<attr name="appearanceTextCaptionOnPrimary" format="reference" />
|
||||||
|
<attr name="appearanceTextCaptionOnPrimaryVariant" format="reference" />
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Colors-->
|
||||||
|
<attr name="colorOnPrimaryVariant" format="color" />
|
||||||
|
<attr name="colorOnSurfaceVariant" format="color" />
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Dimens-->
|
||||||
|
<attr name="l_125" format="dimension" />
|
||||||
|
<attr name="l_25" format="dimension" />
|
||||||
|
<attr name="l_50" format="dimension" />
|
||||||
|
<attr name="l1" format="dimension" />
|
||||||
|
<attr name="l2" format="dimension" />
|
||||||
|
<attr name="l3" format="dimension" />
|
||||||
|
<attr name="l4" format="dimension" />
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
89
app/src/main/res/values/styles_md2.xml
Normal file
89
app/src/main/res/values/styles_md2.xml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="Foundation" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||||
|
<item name="android:windowBackground">?colorSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!--This should be overridden in v19 for transparency, etc-->
|
||||||
|
<style name="Foundation.Compat" />
|
||||||
|
|
||||||
|
<!--region Do not remove-->
|
||||||
|
<style name="WidgetFoundation" />
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation" />
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<style name="Foundation.Dimen" parent="Foundation.Compat">
|
||||||
|
<item name="l_125">2dp</item>
|
||||||
|
<item name="l_25">4dp</item>
|
||||||
|
<item name="l_50">8dp</item>
|
||||||
|
<item name="l1">16dp</item>
|
||||||
|
<item name="l2">32dp</item>
|
||||||
|
<item name="l3">48dp</item>
|
||||||
|
<item name="l4">64dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Foundation.Base" parent="Foundation.Dimen">
|
||||||
|
<item name="actionBarSize">60dp</item>
|
||||||
|
|
||||||
|
<item name="styleAppbar">@style/WidgetFoundation.Appbar</item>
|
||||||
|
|
||||||
|
<item name="styleToolbar">@style/WidgetFoundation.Toolbar</item>
|
||||||
|
<item name="styleToolbarTitle">@style/WidgetFoundation.Toolbar.Title</item>
|
||||||
|
|
||||||
|
<item name="styleCardNormal">@style/WidgetFoundation.Card</item>
|
||||||
|
<item name="styleCardOnPrimary">@style/WidgetFoundation.Card.OnPrimary</item>
|
||||||
|
|
||||||
|
<item name="styleButtonDefault">@style/WidgetFoundation.Button</item>
|
||||||
|
<item name="styleButtonFlat">@style/WidgetFoundation.Button.Flat</item>
|
||||||
|
<item name="styleButtonText">@style/WidgetFoundation.Button.Text</item>
|
||||||
|
|
||||||
|
<!--///-->
|
||||||
|
|
||||||
|
<item name="appearanceTextDisplayNormal">@style/AppearanceFoundation.Display</>
|
||||||
|
<item name="appearanceTextDisplayVariant">@style/AppearanceFoundation.Display.Variant</>
|
||||||
|
<item name="appearanceTextDisplayOnPrimary">@style/AppearanceFoundation.Display.OnPrimary</>
|
||||||
|
<item name="appearanceTextDisplayOnPrimaryVariant">
|
||||||
|
@style/AppearanceFoundation.Display.OnPrimary.Variant
|
||||||
|
</>
|
||||||
|
|
||||||
|
<item name="appearanceTextTitleNormal">@style/AppearanceFoundation.Title</>
|
||||||
|
<item name="appearanceTextTitleVariant">@style/AppearanceFoundation.Title.Variant</>
|
||||||
|
<item name="appearanceTextTitleOnPrimary">@style/AppearanceFoundation.Title.OnPrimary</>
|
||||||
|
<item name="appearanceTextTitleOnPrimaryVariant">
|
||||||
|
@style/AppearanceFoundation.Title.OnPrimary.Variant
|
||||||
|
</>
|
||||||
|
|
||||||
|
<item name="appearanceTextBodyNormal">@style/AppearanceFoundation.Body</>
|
||||||
|
<item name="appearanceTextBodyVariant">@style/AppearanceFoundation.Body.Variant</>
|
||||||
|
<item name="appearanceTextBodyOnPrimary">@style/AppearanceFoundation.Body.OnPrimary</>
|
||||||
|
<item name="appearanceTextBodyOnPrimaryVariant">
|
||||||
|
@style/AppearanceFoundation.Body.OnPrimary.Variant
|
||||||
|
</>
|
||||||
|
|
||||||
|
<item name="appearanceTextCaptionNormal">@style/AppearanceFoundation.Caption</>
|
||||||
|
<item name="appearanceTextCaptionVariant">@style/AppearanceFoundation.Caption.Variant</>
|
||||||
|
<item name="appearanceTextCaptionOnPrimary">@style/AppearanceFoundation.Caption.OnPrimary</>
|
||||||
|
<item name="appearanceTextCaptionOnPrimaryVariant">
|
||||||
|
@style/AppearanceFoundation.Caption.OnPrimary.Variant
|
||||||
|
</>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Foundation.Default" parent="Foundation.Base">
|
||||||
|
<item name="colorPrimary">#2196F3</item>
|
||||||
|
<item name="colorPrimaryVariant">#802196F3</item>
|
||||||
|
<item name="colorSecondary">#00C853</item>
|
||||||
|
<item name="colorSecondaryVariant">#8000C853</item>
|
||||||
|
<item name="colorSurface">#F2F2F2</item>
|
||||||
|
<item name="colorOnPrimary">#F2F2F2</item>
|
||||||
|
<item name="colorOnPrimaryVariant">#80F2F2F2</item>
|
||||||
|
<item name="colorOnSecondary">#F2F2F2</item>
|
||||||
|
<item name="colorOnBackground">#F2F2F2</item>
|
||||||
|
<item name="colorError">#CC0047</item>
|
||||||
|
<item name="colorOnError">#F2F2F2</item>
|
||||||
|
<item name="colorOnSurface">#444444</item>
|
||||||
|
<item name="colorOnSurfaceVariant">#80444444</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
101
app/src/main/res/values/styles_md2_appearance.xml
Normal file
101
app/src/main/res/values/styles_md2_appearance.xml
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!--region Display-->
|
||||||
|
<style name="AppearanceFoundation.Display" parent="TextAppearance.AppCompat.Display1">
|
||||||
|
<item name="android:includeFontPadding">false</item>
|
||||||
|
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Display.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnSurfaceVariant</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Display.OnPrimary">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Display.OnPrimary.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimaryVariant</item>
|
||||||
|
</style>
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Title-->
|
||||||
|
<style name="AppearanceFoundation.Title" parent="TextAppearance.AppCompat.Title">
|
||||||
|
<item name="android:includeFontPadding">false</item>
|
||||||
|
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Title.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnSurfaceVariant</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Title.OnPrimary">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Title.OnPrimary.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimaryVariant</item>
|
||||||
|
</style>
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Body-->
|
||||||
|
<style name="AppearanceFoundation.Body" parent="TextAppearance.AppCompat.Body1">
|
||||||
|
<item name="android:includeFontPadding">false</item>
|
||||||
|
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Body.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnSurfaceVariant</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Body.OnPrimary">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Body.OnPrimary.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimaryVariant</item>
|
||||||
|
</style>
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Caption-->
|
||||||
|
<style name="AppearanceFoundation.Caption" parent="TextAppearance.AppCompat.Caption">
|
||||||
|
<item name="android:includeFontPadding">false</item>
|
||||||
|
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Caption.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnSurfaceVariant</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Caption.OnPrimary">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Caption.OnPrimary.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimaryVariant</item>
|
||||||
|
</style>
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
<!--region Tiny-->
|
||||||
|
<style name="AppearanceFoundation.Tiny" parent="TextAppearance.AppCompat.Caption">
|
||||||
|
<item name="android:includeFontPadding">false</item>
|
||||||
|
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||||
|
<item name="android:textSize">11sp</item>
|
||||||
|
<item name="android:fontFamily">sans-serif-medium</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Tiny.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnSurfaceVariant</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Tiny.OnPrimary">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppearanceFoundation.Tiny.OnPrimary.Variant">
|
||||||
|
<item name="android:textColor">?attr/colorOnPrimaryVariant</item>
|
||||||
|
</style>
|
||||||
|
<!--endregion-->
|
||||||
|
|
||||||
|
</resources>
|
61
app/src/main/res/values/styles_md2_impl.xml
Normal file
61
app/src/main/res/values/styles_md2_impl.xml
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
These widgets are implementation of corresponding attribute. Never and I mean fucking never! use
|
||||||
|
these directly.
|
||||||
|
|
||||||
|
Although it is possible, it wouldn't automatically change the style when theme changes to "night"
|
||||||
|
variant. Make sure to use style referenced by attribute defined it attrs.xml.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Appbar" parent="Widget.MaterialComponents.AppBarLayout.Surface">
|
||||||
|
<item name="elevation">0dp</item>
|
||||||
|
<item name="android:background">?attr/colorSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Toolbar" parent="Widget.MaterialComponents.Toolbar.Surface">
|
||||||
|
<item name="contentInsetStart">0dp</item>
|
||||||
|
<item name="contentInsetLeft">0dp</item>
|
||||||
|
<item name="contentInsetRight">0dp</item>
|
||||||
|
<item name="contentInsetEnd">0dp</item>
|
||||||
|
<item name="contentInsetStartWithNavigation">0dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Toolbar.Title" parent="Widget.MaterialComponents.TextView">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">?attr/actionBarSize</item>
|
||||||
|
<item name="android:textAppearance">?appearanceTextTitleNormal</item>
|
||||||
|
<item name="android:gravity">start</item>
|
||||||
|
<item name="android:layout_gravity">center</item>
|
||||||
|
<item name="android:lines">1</item>
|
||||||
|
<item name="android:padding">?l1</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Card" parent="Widget.MaterialComponents.CardView">
|
||||||
|
<item name="cardBackgroundColor">?attr/colorSurface</item>
|
||||||
|
<item name="cardCornerRadius">?l_50</item>
|
||||||
|
<item name="cardElevation">4dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Card.OnPrimary" parent="Widget.MaterialComponents.CardView">
|
||||||
|
<item name="cardCornerRadius">?l_50</item>
|
||||||
|
<item name="cardElevation">0dp</item>
|
||||||
|
<item name="strokeColor">?attr/colorOnPrimaryVariant</item>
|
||||||
|
<item name="strokeWidth">1dp</item>
|
||||||
|
<item name="cardBackgroundColor">?attr/colorPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Button" parent="Widget.MaterialComponents.Button">
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Button.Flat" parent="Widget.MaterialComponents.Button.UnelevatedButton">
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Button.Text" parent="Widget.MaterialComponents.Button.TextButton">
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user