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 java.io.File
/**
* 替换规则管理
*/
class ReplaceRuleActivity :
VMBaseActivity<ReplaceRuleViewModel>(R.layout.activity_replace_rule, false),
VMBaseActivity<ReplaceRuleViewModel>(R.layout.activity_replace_rule),
SearchView.OnQueryTextListener,
PopupMenu.OnMenuItemClickListener,
FileChooserDialog.CallBack,

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

@ -12,7 +12,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentLayout="@layout/view_search"
app:fitStatusBar="false"
app:title="@string/replace_purify" />
<androidx.recyclerview.widget.RecyclerView

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

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

Loading…
Cancel
Save