新增:监听其他APP通知信息
parent
e8ea004bc4
commit
5703c7d637
File diff suppressed because it is too large
Load Diff
@ -1,169 +1,179 @@
|
|||||||
package com.idormy.sms.forwarder.utils;
|
package com.idormy.sms.forwarder.utils;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@SuppressWarnings({"SynchronizeOnNonFinalField", "unused"})
|
@SuppressWarnings({"SynchronizeOnNonFinalField", "unused"})
|
||||||
public class SettingUtil {
|
public class SettingUtil {
|
||||||
static Boolean hasInit = false;
|
static Boolean hasInit = false;
|
||||||
private static final String TAG = "SettingUtil";
|
private static final String TAG = "SettingUtil";
|
||||||
private static SharedPreferences sp_setting = null;
|
private static SharedPreferences sp_setting = null;
|
||||||
@SuppressLint("StaticFieldLeak")
|
@SuppressLint("StaticFieldLeak")
|
||||||
private static Context context = null;
|
private static Context context = null;
|
||||||
|
|
||||||
public static void init(Context context1) {
|
public static void init(Context context1) {
|
||||||
synchronized (hasInit) {
|
synchronized (hasInit) {
|
||||||
if (hasInit) return;
|
if (hasInit) return;
|
||||||
hasInit = true;
|
hasInit = true;
|
||||||
context = context1;
|
context = context1;
|
||||||
Log.d(TAG, "init ");
|
Log.d(TAG, "init ");
|
||||||
sp_setting = PreferenceManager.getDefaultSharedPreferences(context1);
|
sp_setting = PreferenceManager.getDefaultSharedPreferences(context1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void switchAddExtra(Boolean switchAddExtra) {
|
public static void switchAddExtra(Boolean switchAddExtra) {
|
||||||
Log.d(TAG, "switchAddExtra :" + switchAddExtra);
|
Log.d(TAG, "switchAddExtra :" + switchAddExtra);
|
||||||
sp_setting.edit()
|
sp_setting.edit()
|
||||||
.putBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, switchAddExtra)
|
.putBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, switchAddExtra)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchAddExtra() {
|
public static boolean getSwitchAddExtra() {
|
||||||
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, false);
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void switchAddDeviceName(Boolean switchAddDeviceName) {
|
public static void switchAddDeviceName(Boolean switchAddDeviceName) {
|
||||||
Log.d(TAG, "switchAddDeviceName :" + switchAddDeviceName);
|
Log.d(TAG, "switchAddDeviceName :" + switchAddDeviceName);
|
||||||
sp_setting.edit()
|
sp_setting.edit()
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_NAME, switchAddDeviceName)
|
.putBoolean(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_NAME, switchAddDeviceName)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchAddDeviceName() {
|
public static boolean getSwitchAddDeviceName() {
|
||||||
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_NAME, false);
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_NAME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void switchEnablePhone(Boolean enable) {
|
public static void switchEnablePhone(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit()
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_PHONE, enable)
|
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_PHONE, enable)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnablePhone() {
|
public static boolean getSwitchEnablePhone() {
|
||||||
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_PHONE, true);
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_PHONE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void switchSmsTemplate(Boolean switchSmsTemplate) {
|
public static void switchEnableAppNotify(Boolean enable) {
|
||||||
Log.d(TAG, "switchSmsTemplate :" + switchSmsTemplate);
|
sp_setting.edit()
|
||||||
sp_setting.edit()
|
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_APP_NOTIFY, enable)
|
||||||
.putBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, switchSmsTemplate)
|
.apply();
|
||||||
.apply();
|
}
|
||||||
}
|
|
||||||
|
public static boolean getSwitchEnableAppNotify() {
|
||||||
public static boolean getSwitchSmsTemplate() {
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_APP_NOTIFY, true);
|
||||||
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, false);
|
}
|
||||||
}
|
|
||||||
|
public static void switchSmsTemplate(Boolean switchSmsTemplate) {
|
||||||
public static String getAddExtraDeviceMark() {
|
Log.d(TAG, "switchSmsTemplate :" + switchSmsTemplate);
|
||||||
String res = sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, "");
|
sp_setting.edit()
|
||||||
if (res == null || res.equals("")) {
|
.putBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, switchSmsTemplate)
|
||||||
res = android.os.Build.MODEL;
|
.apply();
|
||||||
}
|
}
|
||||||
return res;
|
|
||||||
}
|
public static boolean getSwitchSmsTemplate() {
|
||||||
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, false);
|
||||||
public static void setAddExtraDeviceMark(String addExtraDeviceMark) {
|
}
|
||||||
Log.d(TAG, "addExtraDeviceMark :" + addExtraDeviceMark);
|
|
||||||
sp_setting.edit()
|
public static String getAddExtraDeviceMark() {
|
||||||
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, addExtraDeviceMark)
|
String res = sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, "");
|
||||||
.apply();
|
if (res == null || res.equals("")) {
|
||||||
}
|
res = android.os.Build.MODEL;
|
||||||
|
}
|
||||||
public static String getSmsTemplate() {
|
return res;
|
||||||
return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}");
|
}
|
||||||
}
|
|
||||||
|
public static void setAddExtraDeviceMark(String addExtraDeviceMark) {
|
||||||
public static void setSmsTemplate(String textSmsTemplate) {
|
Log.d(TAG, "addExtraDeviceMark :" + addExtraDeviceMark);
|
||||||
Log.d(TAG, "textSmsTemplate :" + textSmsTemplate);
|
sp_setting.edit()
|
||||||
sp_setting.edit()
|
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, addExtraDeviceMark)
|
||||||
.putString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, textSmsTemplate)
|
.apply();
|
||||||
.apply();
|
}
|
||||||
}
|
|
||||||
|
public static String getSmsTemplate() {
|
||||||
public static String getAddExtraSim1() {
|
return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}");
|
||||||
String res = sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, "");
|
}
|
||||||
if (res == null || res.equals("")) {
|
|
||||||
res = SimUtil.getSimInfo(1);
|
public static void setSmsTemplate(String textSmsTemplate) {
|
||||||
}
|
Log.d(TAG, "textSmsTemplate :" + textSmsTemplate);
|
||||||
return res;
|
sp_setting.edit()
|
||||||
}
|
.putString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, textSmsTemplate)
|
||||||
|
.apply();
|
||||||
public static void setAddExtraSim1(String sim1) {
|
}
|
||||||
Log.d(TAG, "sim1 :" + sim1);
|
|
||||||
sp_setting.edit()
|
public static String getAddExtraSim1() {
|
||||||
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, sim1)
|
String res = sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, "");
|
||||||
.apply();
|
if (res == null || res.equals("")) {
|
||||||
}
|
res = SimUtil.getSimInfo(1);
|
||||||
|
}
|
||||||
public static String getAddExtraSim2() {
|
return res;
|
||||||
String res = sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM2, "");
|
}
|
||||||
if (res == null || res.equals("")) {
|
|
||||||
res = SimUtil.getSimInfo(2);
|
public static void setAddExtraSim1(String sim1) {
|
||||||
}
|
Log.d(TAG, "sim1 :" + sim1);
|
||||||
return res;
|
sp_setting.edit()
|
||||||
}
|
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, sim1)
|
||||||
|
.apply();
|
||||||
public static void setAddExtraSim2(String sim2) {
|
}
|
||||||
Log.d(TAG, "sim2 :" + sim2);
|
|
||||||
sp_setting.edit()
|
public static String getAddExtraSim2() {
|
||||||
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM2, sim2)
|
String res = sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM2, "");
|
||||||
.apply();
|
if (res == null || res.equals("")) {
|
||||||
}
|
res = SimUtil.getSimInfo(2);
|
||||||
|
}
|
||||||
public static int getBatteryLevelAlarm() {
|
return res;
|
||||||
return sp_setting.getInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM, 0);
|
}
|
||||||
}
|
|
||||||
|
public static void setAddExtraSim2(String sim2) {
|
||||||
public static void setBatteryLevelAlarm(int battery_level) {
|
Log.d(TAG, "sim2 :" + sim2);
|
||||||
Log.d(TAG, "battery_level :" + battery_level);
|
sp_setting.edit()
|
||||||
sp_setting.edit()
|
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM2, sim2)
|
||||||
.putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM, battery_level)
|
.apply();
|
||||||
.apply();
|
}
|
||||||
}
|
|
||||||
|
public static int getBatteryLevelAlarm() {
|
||||||
public static boolean saveMsgHistory() {
|
return sp_setting.getInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM, 0);
|
||||||
return !sp_setting.getBoolean("option_save_history_on", false);
|
}
|
||||||
}
|
|
||||||
|
public static void setBatteryLevelAlarm(int battery_level) {
|
||||||
//接口请求失败重试
|
Log.d(TAG, "battery_level :" + battery_level);
|
||||||
private static String getRetryDelayTimeKey(int index) {
|
sp_setting.edit()
|
||||||
switch (index) {
|
.putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM, battery_level)
|
||||||
case 1:
|
.apply();
|
||||||
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME1;
|
}
|
||||||
case 2:
|
|
||||||
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME2;
|
public static boolean saveMsgHistory() {
|
||||||
case 3:
|
return !sp_setting.getBoolean("option_save_history_on", false);
|
||||||
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME3;
|
}
|
||||||
case 4:
|
|
||||||
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME4;
|
//接口请求失败重试
|
||||||
case 5:
|
private static String getRetryDelayTimeKey(int index) {
|
||||||
default:
|
switch (index) {
|
||||||
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME5;
|
case 1:
|
||||||
}
|
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME1;
|
||||||
}
|
case 2:
|
||||||
|
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME2;
|
||||||
public static int getRetryDelayTime(int index) {
|
case 3:
|
||||||
String key = getRetryDelayTimeKey(index);
|
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME3;
|
||||||
return sp_setting.getInt(key, (int) Math.pow(2, (index - 1)));
|
case 4:
|
||||||
}
|
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME4;
|
||||||
|
case 5:
|
||||||
public static void setRetryDelayTime(int index, int retry_delay_time) {
|
default:
|
||||||
String key = getRetryDelayTimeKey(index);
|
return Define.SP_MSG_KEY_STRING_RETRY_DELAY_TIME5;
|
||||||
Log.d(TAG, "retry_delay_time_" + index + " :" + retry_delay_time);
|
}
|
||||||
sp_setting.edit().putInt(key, retry_delay_time).apply();
|
}
|
||||||
}
|
|
||||||
|
public static int getRetryDelayTime(int index) {
|
||||||
}
|
String key = getRetryDelayTimeKey(index);
|
||||||
|
return sp_setting.getInt(key, (int) Math.pow(2, (index - 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setRetryDelayTime(int index, int retry_delay_time) {
|
||||||
|
String key = getRetryDelayTimeKey(index);
|
||||||
|
Log.d(TAG, "retry_delay_time_" + index + " :" + retry_delay_time);
|
||||||
|
sp_setting.edit().putInt(key, retry_delay_time).apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M4,8h4L8,4L4,4v4zM10,20h4v-4h-4v4zM4,20h4v-4L4,16v4zM4,14h4v-4L4,10v4zM10,14h4v-4h-4v4zM16,4v4h4L20,4h-4zM10,8h4L14,4h-4v4zM16,14h4v-4h-4v4zM16,20h4v-4h-4v4z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<stroke android:width="1dip" android:color="@color/gray_text_light" />
|
||||||
|
|
||||||
|
<corners android:radius="30dip" />
|
||||||
|
|
||||||
|
</shape>
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<stroke android:width="1dip" android:color="@color/colorPrimary" />
|
||||||
|
|
||||||
|
<corners android:radius="30dip" />
|
||||||
|
|
||||||
|
</shape>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true" android:drawable="@drawable/bg_select_pressed"/>
|
||||||
|
<item android:state_selected="true" android:drawable="@drawable/bg_select_pressed"/>
|
||||||
|
<item android:state_checked="true" android:drawable="@drawable/bg_select_pressed"/>
|
||||||
|
<item android:drawable="@drawable/bg_select_default" />
|
||||||
|
</selector>
|
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M3,5L1,5v16c0,1.1 0.9,2 2,2h16v-2L3,21L3,5zM14,15h2L16,5h-4v2h2v8zM21,1L7,1c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L23,3c0,-1.1 -0.9,-2 -2,-2zM21,17L7,17L7,3h14v14z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M3,5L1,5v16c0,1.1 0.9,2 2,2h16v-2L3,21L3,5zM21,1L7,1c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L23,3c0,-1.1 -0.9,-2 -2,-2zM21,17L7,17L7,3h14v14zM17,13h-4v-2h2c1.1,0 2,-0.89 2,-2L17,7c0,-1.11 -0.9,-2 -2,-2h-4v2h4v2h-2c-1.1,0 -2,0.89 -2,2v4h6v-2z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="@color/colorPrimary" android:state_selected="true" />
|
||||||
|
<item android:color="@color/colorPrimary" android:state_checked="true" />
|
||||||
|
<item android:color="@color/gray_text_light" />
|
||||||
|
</selector>
|
@ -1,72 +1,106 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.idormy.sms.forwarder.RefreshListView
|
<LinearLayout
|
||||||
android:id="@+id/list_view_log"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_margin="5dp"
|
android:layout_marginTop="5dip"
|
||||||
android:layout_weight="1" />
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<RadioGroup
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/radioGroupTypeCheck"
|
||||||
android:layout_height="wrap_content"
|
style="@style/rg_style"
|
||||||
android:orientation="vertical">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<RadioButton
|
||||||
android:id="@+id/help_tip"
|
android:id="@+id/btnTypeSms"
|
||||||
android:layout_width="match_parent"
|
style="@style/select_style"
|
||||||
android:layout_height="wrap_content"
|
android:tag="sms"
|
||||||
android:gravity="center"
|
android:text="@string/sms"
|
||||||
android:text="@string/log_tips"
|
android:checked="true" />
|
||||||
android:textColor="@color/colorPrimary" />
|
|
||||||
|
<RadioButton
|
||||||
<LinearLayout
|
android:id="@+id/btnTypeCall"
|
||||||
android:layout_width="match_parent"
|
style="@style/select_style"
|
||||||
android:layout_height="wrap_content"
|
android:tag="call"
|
||||||
android:orientation="horizontal">
|
android:text="@string/call" />
|
||||||
|
|
||||||
<Button
|
<RadioButton
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/btnTypeApp"
|
||||||
android:layout_height="35dp"
|
style="@style/select_style"
|
||||||
android:layout_marginStart="10dp"
|
android:tag="app"
|
||||||
android:layout_marginTop="5dp"
|
android:text="@string/app" />
|
||||||
android:layout_marginBottom="10dp"
|
</RadioGroup>
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/colorPrimary"
|
</LinearLayout>
|
||||||
android:onClick="cleanLog"
|
|
||||||
android:text="@string/bt_refresh_log"
|
<com.idormy.sms.forwarder.RefreshListView
|
||||||
tools:ignore="ButtonStyle,NestedWeights" />
|
android:id="@+id/list_view_log"
|
||||||
|
android:layout_width="match_parent"
|
||||||
<Button
|
android:layout_height="0dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_margin="5dp"
|
||||||
android:layout_height="35dp"
|
android:layout_weight="1" />
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
<LinearLayout
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/colorPrimary"
|
android:orientation="vertical">
|
||||||
android:onClick="toRuleSetting"
|
|
||||||
android:text="@string/rule_setting"
|
<TextView
|
||||||
tools:ignore="ButtonStyle,NestedWeights" />
|
android:id="@+id/help_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
<Button
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:gravity="center"
|
||||||
android:layout_height="35dp"
|
android:text="@string/log_tips"
|
||||||
android:layout_marginLeft="10dp"
|
android:textColor="@color/colorPrimary" />
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginRight="10dp"
|
<LinearLayout
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/colorPrimary"
|
android:orientation="horizontal">
|
||||||
android:onClick="toSendSetting"
|
|
||||||
android:text="@string/sender_setting"
|
<Button
|
||||||
tools:ignore="ButtonStyle" />
|
android:layout_width="match_parent"
|
||||||
</LinearLayout>
|
android:layout_height="35dp"
|
||||||
</LinearLayout>
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="cleanLog"
|
||||||
|
android:text="@string/bt_refresh_log"
|
||||||
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toRuleSetting"
|
||||||
|
android:text="@string/rule_setting"
|
||||||
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toSendSetting"
|
||||||
|
android:text="@string/sender_setting"
|
||||||
|
tools:ignore="ButtonStyle" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,37 +1,71 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ListView
|
<LinearLayout
|
||||||
android:id="@+id/list_view_rule"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_margin="5dp"
|
android:layout_marginTop="5dip"
|
||||||
android:layout_weight="1" />
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<RadioGroup
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/radioGroupTypeCheck"
|
||||||
android:layout_height="wrap_content"
|
style="@style/rg_style"
|
||||||
android:orientation="vertical">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<RadioButton
|
||||||
android:id="@+id/help_tip"
|
android:id="@+id/btnTypeSms"
|
||||||
android:layout_width="match_parent"
|
style="@style/select_style"
|
||||||
android:layout_height="wrap_content"
|
android:tag="sms"
|
||||||
android:gravity="center"
|
android:text="@string/sms"
|
||||||
android:text="@string/rule_tips"
|
android:checked="true" />
|
||||||
android:textColor="@color/colorPrimary" />
|
|
||||||
|
<RadioButton
|
||||||
<Button
|
android:id="@+id/btnTypeCall"
|
||||||
android:layout_width="match_parent"
|
style="@style/select_style"
|
||||||
android:layout_height="35dp"
|
android:tag="call"
|
||||||
android:layout_margin="10dp"
|
android:text="@string/call" />
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:onClick="addRule"
|
<RadioButton
|
||||||
android:padding="0dp"
|
android:id="@+id/btnTypeApp"
|
||||||
android:text="@string/new_forwarding_rule" />
|
style="@style/select_style"
|
||||||
</LinearLayout>
|
android:tag="app"
|
||||||
|
android:text="@string/app" />
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/list_view_rule"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/help_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/rule_tips"
|
||||||
|
android:textColor="@color/colorPrimary" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="addRule"
|
||||||
|
android:padding="0dp"
|
||||||
|
android:text="@string/new_forwarding_rule" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue