Migrating to Material Design 3
This commit is contained in:
Generated
-17
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="$USER_HOME$/.android/avd/Pixel_5_API_30.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-01-01T13:05:44.701970Z" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+3
@@ -4,10 +4,13 @@
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="../../../../layout/custom_preview.xml" value="0.18177083333333333" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/drawable/ic_baseline_menu_24.xml" value="0.265625" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/layout-sw600dp/activity_main.xml" value="0.187109375" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/layout-sw600dp/img_item_layout.xml" value="0.1" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/layout/activity_login.xml" value="0.11197916666666667" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/layout/activity_main.xml" value="0.12142857142857143" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/layout/fav_tag_item_layout.xml" value="0.12708333333333333" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/layout/spinner_item_layout.xml" value="0.13020833333333334" />
|
||||
<entry key="..\:/Users/Alie/Documents/GitHub/YandView/app/src/main/res/xml/root_preferences.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/drawable-anydpi-v26/ic_launcher_foreground.xml" value="0.3333333333333333" />
|
||||
<entry key="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.3333333333333333" />
|
||||
|
||||
@@ -33,6 +33,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.google.android.material:material:1.5.0")
|
||||
implementation 'jp.wasabeef:recyclerview-animators:4.0.2'
|
||||
implementation('com.google.android.material:material:1.4.0')
|
||||
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.LspView.NoActionBar">
|
||||
android:theme="@style/Theme.Material3.DynamicColors.DayNight">
|
||||
<activity
|
||||
android:name=".activity.favtag.FavTagActivity"
|
||||
android:exported="false" />
|
||||
@@ -30,8 +30,7 @@
|
||||
<activity android:name=".activity.login.LoginActivity" />
|
||||
<activity
|
||||
android:name=".activity.pic.PicActivity"
|
||||
android:configChanges="uiMode"
|
||||
android:theme="@style/Theme.LspView.NoActionBar.Pic" />
|
||||
android:configChanges="uiMode"/>
|
||||
<activity
|
||||
android:name=".activity.main.MainActivity"
|
||||
android:exported="true">
|
||||
|
||||
@@ -37,6 +37,7 @@ import retrofit2.Response
|
||||
import java.lang.NumberFormatException
|
||||
import java.util.*
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.google.android.material.color.DynamicColors
|
||||
import com.lsp.view.activity.model.MainActivityModelImpl
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
@@ -66,11 +67,6 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
|
||||
val toolbar = findViewById<Toolbar>(R.id.toolbar)
|
||||
setSupportActionBar(toolbar)
|
||||
|
||||
adapter = PostAdapter(this, ArrayList<Post>())
|
||||
|
||||
//到达底部,加载更多数据
|
||||
|
||||
@@ -76,21 +76,9 @@ class PicActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
supportActionBar?.hide()
|
||||
super.onCreate(savedInstanceState)
|
||||
//看不懂的硬编码 导航栏全透明
|
||||
window.requestFeature(Window.FEATURE_NO_TITLE)
|
||||
val window = window
|
||||
window.clearFlags(
|
||||
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
|
||||
or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
)
|
||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
window.navigationBarColor = Color.TRANSPARENT
|
||||
|
||||
|
||||
setContentView(R.layout.activity_pic)
|
||||
val serviceIntent = Intent(this, DownloadService::class.java)
|
||||
|
||||
@@ -13,10 +13,6 @@ class SettingsActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.settings_activity)
|
||||
|
||||
//ToolBar
|
||||
val toolbar = findViewById<Toolbar>(R.id.toolbar)
|
||||
setSupportActionBar(toolbar)
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
<vector android:height="24dp" android:tint="?attr/colorPrimary"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
|
||||
|
||||
@@ -30,24 +30,6 @@
|
||||
android:src="@drawable/search"
|
||||
android:contentDescription="Search" />
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
app:layout_scrollFlags="scroll|enterAlways|snap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@color/white"
|
||||
android:id="@+id/toolbar"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewElevatedStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
@@ -102,7 +103,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
app:tint="@android:color/white"
|
||||
android:backgroundTint="?android:colorAccent"
|
||||
android:backgroundTint="?attr/colorPrimary"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="Download"
|
||||
android:id="@+id/fbtn"/>
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_margin="3dp"
|
||||
android:layout_margin="5dp"
|
||||
style="?attr/materialCardViewElevatedStyle"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:id="@+id/picImgae"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -5,17 +5,6 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
app:layout_scrollFlags="scroll|enterAlways|snap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@color/white"
|
||||
android:id="@+id/toolbar"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.LspView.NoActionBar" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/dark_main</item>
|
||||
<item name="colorPrimaryVariant">@color/dark_primary</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/primary</item>
|
||||
<item name="colorSecondaryVariant">@color/primary</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorAccent">@color/dark_accent</item>
|
||||
<item name="android:navigationBarColor" >?attr/colorPrimaryVariant</item>
|
||||
<item name="actionBarTheme">@style/MyBarStyle</item>
|
||||
|
||||
</style>
|
||||
<style name="Theme.LspView.NoActionBar.Pic" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/dark_main</item>
|
||||
<item name="colorPrimaryVariant">@color/dark_primary</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/primary</item>
|
||||
<item name="colorSecondaryVariant">@color/primary</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorAccent">@color/dark_accent</item>
|
||||
<item name="android:navigationBarColor" >?attr/colorPrimaryVariant</item>
|
||||
<item name="actionBarTheme">@style/MyBarStyle</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="MyBarStyle" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar">
|
||||
<item name="android:textColorPrimary">@color/white</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.LspView.NoActionBar.Pic" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryVariant">@color/Dark</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/primary</item>
|
||||
<item name="colorSecondaryVariant">@color/primary</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="actionBarTheme">@style/MyBarStyle</item>
|
||||
<item name="android:navigationBarColor" >@android:color/transparent</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:enforceNavigationBarContrast">false</item>
|
||||
<item name="android:enforceStatusBarContrast">false</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,30 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.LspView.NoActionBar" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryVariant">@color/Dark</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/primary</item>
|
||||
<item name="colorSecondaryVariant">@color/primary</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">@color/primary</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="actionBarTheme">@style/MyBarStyle</item>
|
||||
<item name="android:navigationBarColor" >?attr/colorPrimaryVariant</item>
|
||||
|
||||
</style>
|
||||
<style name="Theme.LspView.NoActionBar.Pic" parent="Theme.LspView.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="actionBarTheme">@style/MyBarStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="MyBarStyle" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar">
|
||||
<item name="android:textColorPrimary">@color/white</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user