mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
设置转发规则界面优化(联动)
This commit is contained in:
parent
e1c80d1022
commit
741f436b70
@ -9,6 +9,7 @@ import android.view.View;
|
|||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -60,7 +61,6 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
@ -78,7 +78,35 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
final View view1 = View.inflate(RuleActivity.this, R.layout.activity_alter_dialog_setview_rule, null);
|
final View view1 = View.inflate(RuleActivity.this, R.layout.activity_alter_dialog_setview_rule, null);
|
||||||
|
|
||||||
final RadioGroup radioGroupRuleFiled = (RadioGroup) view1.findViewById(R.id.radioGroupRuleFiled);
|
final RadioGroup radioGroupRuleFiled = (RadioGroup) view1.findViewById(R.id.radioGroupRuleFiled);
|
||||||
if (ruleModel != null) radioGroupRuleFiled.check(ruleModel.getRuleFiledCheckId());
|
final LinearLayout matchTypeLayout = (LinearLayout) view1.findViewById(R.id.matchTypeLayout);
|
||||||
|
final LinearLayout matchValueLayout = (LinearLayout) view1.findViewById(R.id.matchValueLayout);
|
||||||
|
if (ruleModel != null) {
|
||||||
|
int id = ruleModel.getRuleFiledCheckId();
|
||||||
|
radioGroupRuleFiled.check(id);
|
||||||
|
if (id != 0) {
|
||||||
|
matchTypeLayout.setVisibility(View.GONE);
|
||||||
|
matchValueLayout.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
matchTypeLayout.setVisibility(View.VISIBLE);
|
||||||
|
matchValueLayout.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radioGroupRuleFiled.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||||
|
//Toast.makeText(RuleActivity.this, "Checked:" + checkedId, Toast.LENGTH_LONG).show();
|
||||||
|
switch (checkedId) {
|
||||||
|
case R.id.btnTranspondAll:
|
||||||
|
matchTypeLayout.setVisibility(View.GONE);
|
||||||
|
matchValueLayout.setVisibility(View.GONE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
matchTypeLayout.setVisibility(View.VISIBLE);
|
||||||
|
matchValueLayout.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
final RadioGroup radioGroupRuleCheck = (RadioGroup) view1.findViewById(R.id.radioGroupRuleCheck);
|
final RadioGroup radioGroupRuleCheck = (RadioGroup) view1.findViewById(R.id.radioGroupRuleCheck);
|
||||||
if (ruleModel != null) radioGroupRuleCheck.check(ruleModel.getRuleCheckCheckId());
|
if (ruleModel != null) radioGroupRuleCheck.check(ruleModel.getRuleCheckCheckId());
|
||||||
@ -95,7 +123,7 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
btSetRuleSender.setOnClickListener(new View.OnClickListener() {
|
btSetRuleSender.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Toast.makeText(RuleActivity.this, "selectSender", Toast.LENGTH_LONG).show();
|
//Toast.makeText(RuleActivity.this, "selectSender", Toast.LENGTH_LONG).show();
|
||||||
selectSender(ruleSenderTv);
|
selectSender(ruleSenderTv);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -18,7 +18,7 @@ public class RuleModel {
|
|||||||
public static final Map<String, String> CHECK_MAP = new HashMap<String, String>();
|
public static final Map<String, String> CHECK_MAP = new HashMap<String, String>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
FILED_MAP.put("transpond_all", "转发全部");
|
FILED_MAP.put("transpond_all", "全部");
|
||||||
FILED_MAP.put("phone_num", "手机号");
|
FILED_MAP.put("phone_num", "手机号");
|
||||||
FILED_MAP.put("msg_content", "内容");
|
FILED_MAP.put("msg_content", "内容");
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:text="设置匹配的字段:选择全部转发后不再匹配下方的模式值直接使用发送方发送" />
|
android:text="设置匹配的字段" />
|
||||||
|
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/radioGroupRuleFiled"
|
android:id="@+id/radioGroupRuleFiled"
|
||||||
@ -27,7 +27,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:text="转发全部" />
|
android:text="全部" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/btnPhone"
|
android:id="@+id/btnPhone"
|
||||||
@ -44,9 +44,12 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/matchTypeLayout"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical">
|
android:layout_marginLeft="10dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -54,7 +57,6 @@
|
|||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:text="设置匹配的模式" />
|
android:text="设置匹配的模式" />
|
||||||
|
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/radioGroupRuleCheck"
|
android:id="@+id/radioGroupRuleCheck"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -96,9 +98,12 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/matchValueLayout"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical">
|
android:layout_marginLeft="10dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -106,7 +111,6 @@
|
|||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:text="设置匹配的值" />
|
android:text="设置匹配的值" />
|
||||||
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextRuleValue"
|
android:id="@+id/editTextRuleValue"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -120,23 +124,37 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ruleSenderTv"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:text="" />
|
android:text="设置发送方" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btSetRuleSender"
|
android:id="@+id/btSetRuleSender"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="选择发送方">
|
android:minWidth="0dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:text="选择" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ruleSenderTv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:text="" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</Button>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
@ -161,8 +179,6 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/del" />
|
android:text="@string/del" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user