pull/418/head
gedoor 4 years ago
parent 49195110d6
commit 215e49cdbc
  1. 6
      app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt
  2. 6
      app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditDialog.kt
  3. 1
      app/src/main/res/layout/activity_replace_rule.xml
  4. 2
      app/src/main/res/layout/dialog_replace_edit.xml
  5. 7
      app/src/main/res/values/styles.xml

@ -42,9 +42,11 @@ import org.jetbrains.anko.startActivity
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
import java.io.File import java.io.File
/**
* 替换规则管理
*/
class ReplaceRuleActivity : class ReplaceRuleActivity :
VMBaseActivity<ReplaceRuleViewModel>(R.layout.activity_replace_rule, false), VMBaseActivity<ReplaceRuleViewModel>(R.layout.activity_replace_rule),
SearchView.OnQueryTextListener, SearchView.OnQueryTextListener,
PopupMenu.OnMenuItemClickListener, PopupMenu.OnMenuItemClickListener,
FileChooserDialog.CallBack, FileChooserDialog.CallBack,

@ -23,6 +23,9 @@ import io.legado.app.utils.toast
import kotlinx.android.synthetic.main.dialog_replace_edit.* import kotlinx.android.synthetic.main.dialog_replace_edit.*
import org.jetbrains.anko.sdk27.listeners.onFocusChange import org.jetbrains.anko.sdk27.listeners.onFocusChange
/**
* 编辑替换规则
*/
class ReplaceEditDialog : BaseDialogFragment(), class ReplaceEditDialog : BaseDialogFragment(),
Toolbar.OnMenuItemClickListener, Toolbar.OnMenuItemClickListener,
KeyboardToolPop.CallBack { KeyboardToolPop.CallBack {
@ -92,8 +95,7 @@ class ReplaceEditDialog : BaseDialogFragment(),
val rule = getReplaceRule() val rule = getReplaceRule()
if (!rule.isValid()){ if (!rule.isValid()){
toast(R.string.replace_rule_invalid) toast(R.string.replace_rule_invalid)
} } else{
else{
viewModel.save(rule) { viewModel.save(rule) {
callBack?.onReplaceRuleSave() callBack?.onReplaceRuleSave()
dismiss() dismiss()

@ -12,7 +12,6 @@
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:contentLayout="@layout/view_search"
app:fitStatusBar="false"
app:title="@string/replace_purify" /> app:title="@string/replace_purify" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView

@ -17,7 +17,7 @@
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/ll_content" android:id="@+id/ll_content"

@ -52,8 +52,7 @@
<style name="Spinner" parent="android:Theme.Holo.Light" /> <style name="Spinner" parent="android:Theme.Holo.Light" />
//**************************************************************System //**********System Style******************//
Style******************************************************************************//
<style name="Style.NavigationView" parent="android:Widget"> <style name="Style.NavigationView" parent="android:Widget">
<item name="android:listPreferredItemHeightSmall">44dp</item> <item name="android:listPreferredItemHeightSmall">44dp</item>
@ -85,8 +84,7 @@
<item name="android:textSize">20sp</item> <item name="android:textSize">20sp</item>
</style> </style>
//**************************************************************Widget //*******************Widget Style**********************************//
Style******************************************************************************//
<style name="Style.Shadow.Top" parent="android:Widget"> <style name="Style.Shadow.Top" parent="android:Widget">
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
@ -130,4 +128,5 @@
<style name="Style.Text.Second.Normal.Wrap"> <style name="Style.Text.Second.Normal.Wrap">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
</style> </style>
</resources> </resources>

Loading…
Cancel
Save