feat: 优化代码

pull/97/head
kunfei 5 years ago
parent 5af3ea4edd
commit 6e3c50bd52
  1. 14
      app/src/main/AndroidManifest.xml
  2. 16
      app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt
  3. 18
      app/src/main/res/layout/activity_replace_rule.xml

@ -27,9 +27,19 @@
android:theme="@style/AppTheme.Light" android:theme="@style/AppTheme.Light"
android:requestLegacyExternalStorage="false" android:requestLegacyExternalStorage="false"
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute"> tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute">
<activity android:name=".ui.welcome.WelcomeActivity">
<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.welcome.WelcomeActivity" android:name=".ui.welcome.Icon1Activity"
android:label="@string/app_name"> android:enabled="false">
<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" />

@ -13,7 +13,7 @@ import io.legado.app.utils.getPrefBoolean
import kotlinx.android.synthetic.main.activity_welcome.* import kotlinx.android.synthetic.main.activity_welcome.*
import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivity
class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) {
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
iv_bg.setColorFilter(accentColor) iv_bg.setColorFilter(accentColor)
@ -37,19 +37,15 @@ class WelcomeActivity : BaseActivity(R.layout.activity_welcome) {
finish() finish()
} }
override fun onAnimationEnd(animation: Animator) { override fun onAnimationEnd(animation: Animator) = Unit
} override fun onAnimationCancel(animation: Animator) = Unit
override fun onAnimationCancel(animation: Animator) {
}
override fun onAnimationRepeat(animation: Animator) { override fun onAnimationRepeat(animation: Animator) = Unit
}
}) })
welAnimator.start() welAnimator.start()
} }
} }
class Icon1Activity : WelcomeActivity()

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.replacerule.ReplaceRuleActivity"> tools:context=".ui.replacerule.ReplaceRuleActivity">
<io.legado.app.ui.widget.TitleBar <io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar" android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:contentLayout="@layout/view_search"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/replace_purify" /> app:title="@string/replace_purify" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintStart_toStartOf="parent" android:layout_weight="1" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title_bar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout> <io.legado.app.ui.widget.SelectActionBar
android:id="@+id/select_action_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

Loading…
Cancel
Save