feat: 优化代码

pull/103/head
kunfei 5 years ago
parent 987e9c6bb9
commit ee4f7e638e
  1. 16
      app/src/main/AndroidManifest.xml
  2. 4
      app/src/main/java/io/legado/app/help/LauncherIconHelp.kt
  3. 3
      app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt
  4. 147
      app/src/main/res/drawable-v24/ic_launcher_3.xml
  5. 168
      app/src/main/res/drawable/ic_launcher_3.xml
  6. 5
      app/src/main/res/mipmap-anydpi-v26/launcher3.xml
  7. 2
      app/src/main/res/values/arrays.xml

@ -50,7 +50,7 @@
android:resource="@xml/shortcuts" android:resource="@xml/shortcuts"
android:launchMode="singleTask" /> android:launchMode="singleTask" />
</activity> </activity>
<!--图标1--> <!--图标2-->
<activity <activity
android:name=".ui.welcome.Launcher2" android:name=".ui.welcome.Launcher2"
android:icon="@mipmap/launcher2" android:icon="@mipmap/launcher2"
@ -64,6 +64,20 @@
android:resource="@xml/shortcuts" android:resource="@xml/shortcuts"
android:launchMode="singleTask" /> android:launchMode="singleTask" />
</activity> </activity>
<!--图标3-->
<activity
android:name=".ui.welcome.Launcher3"
android:icon="@mipmap/launcher3"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts"
android:launchMode="singleTask" />
</activity>
<!--主界面--> <!--主界面-->
<activity <activity
android:name=".ui.main.MainActivity" android:name=".ui.main.MainActivity"

@ -7,6 +7,7 @@ import io.legado.app.App
import io.legado.app.R import io.legado.app.R
import io.legado.app.ui.welcome.Launcher1 import io.legado.app.ui.welcome.Launcher1
import io.legado.app.ui.welcome.Launcher2 import io.legado.app.ui.welcome.Launcher2
import io.legado.app.ui.welcome.Launcher3
import io.legado.app.ui.welcome.WelcomeActivity import io.legado.app.ui.welcome.WelcomeActivity
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
@ -18,7 +19,8 @@ object LauncherIconHelp {
private val packageManager: PackageManager = App.INSTANCE.packageManager private val packageManager: PackageManager = App.INSTANCE.packageManager
private val componentNames = arrayListOf( private val componentNames = arrayListOf(
ComponentName(App.INSTANCE, Launcher1::class.java.name), ComponentName(App.INSTANCE, Launcher1::class.java.name),
ComponentName(App.INSTANCE, Launcher2::class.java.name) ComponentName(App.INSTANCE, Launcher2::class.java.name),
ComponentName(App.INSTANCE, Launcher3::class.java.name)
) )
fun changeIcon(icon: String?) { fun changeIcon(icon: String?) {

@ -49,4 +49,5 @@ open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) {
} }
class Launcher1 : WelcomeActivity() class Launcher1 : WelcomeActivity()
class Launcher2 : WelcomeActivity() class Launcher2 : WelcomeActivity()
class Launcher3 : WelcomeActivity()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/md_grey_100" />
<foreground android:drawable="@drawable/ic_launcher_3" />
</adaptive-icon>

@ -136,12 +136,14 @@
<item>iconMain</item> <item>iconMain</item>
<item>icon1</item> <item>icon1</item>
<item>icon2</item> <item>icon2</item>
<item>icon3</item>
</string-array> </string-array>
<string-array name="icons"> <string-array name="icons">
<item>ic_launcher</item> <item>ic_launcher</item>
<item>launcher1</item> <item>launcher1</item>
<item>launcher2</item> <item>launcher2</item>
<item>launcher3</item>
</string-array> </string-array>
<string-array name="chinese_mode"> <string-array name="chinese_mode">

Loading…
Cancel
Save