diff --git a/app/src/main/java/com/monke/monkeybook/model/analyzeRule/RulePattern.java b/app/src/main/java/com/monke/monkeybook/model/analyzeRule/RulePattern.java index 504c5a3..0cd0f7a 100644 --- a/app/src/main/java/com/monke/monkeybook/model/analyzeRule/RulePattern.java +++ b/app/src/main/java/com/monke/monkeybook/model/analyzeRule/RulePattern.java @@ -33,19 +33,22 @@ final class RulePattern { private RulePattern(@NonNull String rawRule, @Nullable VariableStore variableStore, @Nullable RuleMode ruleMode) { elementsRule = new Rule(); + final boolean regexTrait; if (ruleMode == null) { Rule rule = RootRule.fromStringRule(rawRule); elementsRule.setMode(rule.getMode()); rawRule = rule.getRule(); + regexTrait = true; } else { + regexTrait = false; elementsRule.setMode(ruleMode); } - initRulePattern(rawRule, variableStore, elementsRule.getMode()); + initRulePattern(rawRule, variableStore, elementsRule.getMode(), regexTrait); } - private void initRulePattern(String rawRule, VariableStore variableStore, RuleMode ruleMode) { + private void initRulePattern(String rawRule, VariableStore variableStore, RuleMode ruleMode, boolean regexTrait) { //分离get规则 rawRule = VariablesPattern.fromGetterRule(rawRule, variableStore).rule; @@ -56,7 +59,7 @@ private void initRulePattern(String rawRule, VariableStore variableStore, RuleMo rawRule = ensureRedirectRule(rawRule); //分离正则表达式 - rawRule = ensureRegexRule(rawRule, ruleMode == RuleMode.CSS || ruleMode == RuleMode.XPath); + rawRule = ensureRegexRule(rawRule, regexTrait || ruleMode == RuleMode.CSS || ruleMode == RuleMode.XPath); //分离js int start = ensureJavaScripts(rawRule); diff --git a/app/src/main/res/layout/item_bookshelf_list.xml b/app/src/main/res/layout/item_bookshelf_list.xml index c8f56b1..42cf653 100644 --- a/app/src/main/res/layout/item_bookshelf_list.xml +++ b/app/src/main/res/layout/item_bookshelf_list.xml @@ -59,9 +59,10 @@ android:id="@+id/tv_name" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingTop="2dp" android:layout_marginEnd="16dp" + android:includeFontPadding="false" android:ellipsize="end" - android:paddingTop="2dp" android:singleLine="true" android:text="@string/tv_book_name" android:textColor="@color/colorTextDefault"