mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-04 06:00:11 +00:00
规则展示优化
This commit is contained in:
parent
d2131a765f
commit
45b782716a
@ -30,7 +30,7 @@ public class RuleModel {
|
||||
public static final Map<String, String> SIM_SLOT_MAP = new HashMap<String, String>();
|
||||
|
||||
static {
|
||||
FILED_MAP.put("transpond_all", "转发全部");
|
||||
FILED_MAP.put("transpond_all", "全部转发");
|
||||
FILED_MAP.put("phone_num", "手机号");
|
||||
FILED_MAP.put("msg_content", "内容");
|
||||
FILED_MAP.put("multi_match", "多重匹配");
|
||||
@ -62,11 +62,10 @@ public class RuleModel {
|
||||
|
||||
public static String getRuleMatch(String filed, String check, String value, String simSlot) {
|
||||
String SimStr = SIM_SLOT_MAP.get(simSlot) + "卡 ";
|
||||
switch (filed) {
|
||||
case FILED_TRANSPOND_ALL:
|
||||
return SimStr + "全部转发到 ";
|
||||
default:
|
||||
return SimStr + "当 " + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + " 转发到 ";
|
||||
if (filed == null || filed.equals(FILED_TRANSPOND_ALL)) {
|
||||
return SimStr + "全部 转发到 ";
|
||||
} else {
|
||||
return SimStr + "当 " + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + " 转发到 ";
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,11 +193,10 @@ public class RuleModel {
|
||||
|
||||
public String getRuleMatch() {
|
||||
String SimStr = SIM_SLOT_MAP.get(simSlot) + "卡 ";
|
||||
switch (filed) {
|
||||
case FILED_TRANSPOND_ALL:
|
||||
return SimStr + "全部转发到 ";
|
||||
default:
|
||||
return SimStr + "当 " + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + " 转发到 ";
|
||||
if (filed == null || filed.equals(FILED_TRANSPOND_ALL)) {
|
||||
return SimStr + "全部 转发到 ";
|
||||
} else {
|
||||
return SimStr + "当 " + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + " 转发到 ";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,13 +165,14 @@ public class LogUtil {
|
||||
Integer senderType = cursor.getInt(
|
||||
cursor.getColumnIndexOrThrow(SenderTable.SenderEntry.COLUMN_NAME_TYPE));
|
||||
|
||||
String rule = RuleModel.getRuleMatch(ruleFiled, ruleCheck, ruleValue, ruleSimSlot) + senderName.trim();
|
||||
String rule = RuleModel.getRuleMatch(ruleFiled, ruleCheck, ruleValue, ruleSimSlot);
|
||||
if (senderName != null) rule += senderName.trim();
|
||||
|
||||
int senderImageId = SenderModel.getImageId(senderType);
|
||||
LogVo logVo = new LogVo(itemid, itemfrom, content, simInfo, time, rule, senderImageId);
|
||||
LogVos.add(logVo);
|
||||
} catch (Exception e) {
|
||||
Log.i(TAG, "getLog e:" + e.getMessage());
|
||||
Log.e(TAG, "getLog e:" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,12 +15,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp" />
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rule_sender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp" />
|
||||
android:layout_marginLeft="5dp" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user