增加了一个白色猫猫头图标喵 #79
This commit is contained in:
12 files changed
+71
-56
No files matched your search
@@ -34,6 +34,17 @@
|
|||||||
android:theme="@style/Base.AppTheme"
|
android:theme="@style/Base.AppTheme"
|
||||||
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute">
|
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute">
|
||||||
<!-- 图标0 -->
|
<!-- 图标0 -->
|
||||||
|
<activity-alias
|
||||||
|
android:name=".Launcherw"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:icon="@mipmap/launcherw"
|
||||||
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".Launcher0"
|
android:name=".Launcher0"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
@@ -54,7 +65,6 @@
|
|||||||
android:targetActivity=".ui.main.MainActivity">
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
@@ -67,7 +77,6 @@
|
|||||||
android:targetActivity=".ui.main.MainActivity">
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
@@ -80,7 +89,6 @@
|
|||||||
android:targetActivity=".ui.main.MainActivity">
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
@@ -93,7 +101,6 @@
|
|||||||
android:targetActivity=".ui.main.MainActivity">
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
@@ -106,7 +113,6 @@
|
|||||||
android:targetActivity=".ui.main.MainActivity">
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
@@ -119,7 +125,6 @@
|
|||||||
android:targetActivity=".ui.main.MainActivity">
|
android:targetActivity=".ui.main.MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import splitties.init.appCtx
|
|||||||
object LauncherIconHelp {
|
object LauncherIconHelp {
|
||||||
private val packageManager: PackageManager = appCtx.packageManager
|
private val packageManager: PackageManager = appCtx.packageManager
|
||||||
private val componentNames = arrayListOf(
|
private val componentNames = arrayListOf(
|
||||||
|
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcherw"),
|
||||||
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcher0"),
|
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcher0"),
|
||||||
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcher1"),
|
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcher1"),
|
||||||
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcher2"),
|
ComponentName(appCtx.packageName, "${appCtx.packageName}.Launcher2"),
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import android.widget.ImageView
|
|||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.PreferenceViewHolder
|
import androidx.preference.PreferenceViewHolder
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import io.legato.kazusa.R
|
import io.legato.kazusa.R
|
||||||
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
import io.legato.kazusa.base.BaseBottomSheetDialogFragment
|
||||||
import io.legato.kazusa.base.adapter.ItemViewHolder
|
import io.legato.kazusa.base.adapter.ItemViewHolder
|
||||||
import io.legato.kazusa.base.adapter.RecyclerAdapter
|
import io.legato.kazusa.base.adapter.RecyclerAdapter
|
||||||
import io.legato.kazusa.databinding.DialogRecyclerViewBinding
|
import io.legato.kazusa.databinding.DialogRecyclerViewBinding
|
||||||
import io.legato.kazusa.databinding.ItemIconPreferenceBinding
|
import io.legato.kazusa.databinding.ItemIconPreferenceBinding
|
||||||
//import io.legado.app.lib.theme.primaryColor
|
|
||||||
import io.legato.kazusa.utils.getCompatDrawable
|
import io.legato.kazusa.utils.getCompatDrawable
|
||||||
|
import io.legato.kazusa.utils.themeColor
|
||||||
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
import io.legato.kazusa.utils.viewbindingdelegate.viewBinding
|
||||||
|
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference
|
|||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.setTitle(R.string.change_icon)
|
binding.toolBar.setTitle(R.string.change_icon)
|
||||||
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
binding.recyclerView.layoutManager = GridLayoutManager(requireContext(), 3)
|
||||||
val adapter = Adapter(requireContext())
|
val adapter = Adapter(requireContext())
|
||||||
binding.recyclerView.adapter = adapter
|
binding.recyclerView.adapter = adapter
|
||||||
arguments?.let {
|
arguments?.let {
|
||||||
@@ -164,23 +164,21 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference
|
|||||||
) {
|
) {
|
||||||
binding.run {
|
binding.run {
|
||||||
val index = findIndexOfValue(item.toString())
|
val index = findIndexOfValue(item.toString())
|
||||||
dialogEntries?.let {
|
|
||||||
label.text = it[index]
|
|
||||||
}
|
|
||||||
dialogIconNames?.let {
|
dialogIconNames?.let {
|
||||||
val resId = context.resources
|
val resId = context.resources.getIdentifier(it[index].toString(), "mipmap", context.packageName)
|
||||||
.getIdentifier(it[index].toString(), "mipmap", context.packageName)
|
val d = context.getCompatDrawable(resId)
|
||||||
val d = try {
|
d?.let { icon.setImageDrawable(it) }
|
||||||
context.getCompatDrawable(resId)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
d?.let {
|
|
||||||
icon.setImageDrawable(d)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
label.isChecked = item.toString() == dialogValue
|
|
||||||
root.setOnClickListener {
|
val isSelected = item.toString() == dialogValue
|
||||||
|
|
||||||
|
if (isSelected) {
|
||||||
|
card.setCardBackgroundColor(context.themeColor(com.google.android.material.R.attr.colorSecondaryContainer))
|
||||||
|
} else {
|
||||||
|
card.setCardBackgroundColor(context.themeColor(com.google.android.material.R.attr.colorSurfaceContainer))
|
||||||
|
}
|
||||||
|
|
||||||
|
card.setOnClickListener {
|
||||||
onChanged?.invoke(item.toString())
|
onChanged?.invoke(item.toString())
|
||||||
this@IconDialog.dismissAllowingStateLoss()
|
this@IconDialog.dismissAllowingStateLoss()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginHorizontal="8dp"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none"
|
||||||
tools:ignore="SpeakableTextPresentCheck" />
|
tools:ignore="SpeakableTextPresentCheck" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<ImageView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/icon"
|
android:id="@+id/card"
|
||||||
android:layout_width="48dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="0dp"
|
||||||
android:adjustViewBounds="true"
|
app:cardCornerRadius="16dp"
|
||||||
android:contentDescription="ICON"
|
app:layout_constraintDimensionRatio="1:1"
|
||||||
tools:ignore="HardcodedText" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:cardBackgroundColor="?attr/colorSurfaceContainerHighest"
|
||||||
|
app:strokeWidth="0dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:layout_marginHorizontal="10dp">
|
||||||
|
|
||||||
<CheckedTextView
|
<ImageView
|
||||||
android:id="@+id/label"
|
android:id="@+id/icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="match_parent"
|
||||||
android:paddingStart="8dp"
|
android:layout_margin="20dp"
|
||||||
android:layout_alignParentEnd="true"
|
android:scaleType="centerCrop"
|
||||||
android:layout_toRightOf="@+id/icon"
|
android:contentDescription="ICON"
|
||||||
android:checkMark="?android:attr/listChoiceIndicatorSingle"
|
tools:ignore="HardcodedText" />
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textColor="?android:attr/textColorAlertDialogListItem"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background_w" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@drawable/ic_launcher4" />
|
||||||
|
</adaptive-icon>
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
<string-array name="icon_names">
|
<string-array name="icon_names">
|
||||||
<item>iconMain</item>
|
<item>iconMain</item>
|
||||||
|
<item>iconWhite</item>
|
||||||
<item>icon0</item>
|
<item>icon0</item>
|
||||||
<item>icon1</item>
|
<item>icon1</item>
|
||||||
<item>icon2</item>
|
<item>icon2</item>
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
<string-array name="icon_names">
|
<string-array name="icon_names">
|
||||||
<item>iconMain</item>
|
<item>iconMain</item>
|
||||||
|
<item>iconWhite</item>
|
||||||
<item>icon0</item>
|
<item>icon0</item>
|
||||||
<item>icon1</item>
|
<item>icon1</item>
|
||||||
<item>icon2</item>
|
<item>icon2</item>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
<string-array name="icons">
|
<string-array name="icons">
|
||||||
<item>ic_launcher</item>
|
<item>ic_launcher</item>
|
||||||
|
<item>launcherw</item>
|
||||||
<item>launcher0</item>
|
<item>launcher0</item>
|
||||||
<item>launcher1</item>
|
<item>launcher1</item>
|
||||||
<item>launcher2</item>
|
<item>launcher2</item>
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
|
|
||||||
<string-array name="icon_names" tools:ignore="Typos">
|
<string-array name="icon_names" tools:ignore="Typos">
|
||||||
<item>iconMain</item>
|
<item>iconMain</item>
|
||||||
|
<item>iconWhite</item>
|
||||||
<item>icon0</item>
|
<item>icon0</item>
|
||||||
<item>icon1</item>
|
<item>icon1</item>
|
||||||
<item>icon2</item>
|
<item>icon2</item>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#2E2D3D</color>
|
||||||
|
<color name="ic_launcher_background_w">#F2F1F6</color>
|
||||||
|
|
||||||
<!-- GR Theme-->
|
<!-- GR Theme-->
|
||||||
<color name="gr_theme_primary">#4C662B</color>
|
<color name="gr_theme_primary">#4C662B</color>
|
||||||
<color name="gr_theme_onPrimary">#FFFFFF</color>
|
<color name="gr_theme_onPrimary">#FFFFFF</color>
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="ic_launcher_background">#2E2D3D</color>
|
|
||||||
</resources>
|
|
||||||
Reference in new issue
Block a user