mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
优化:界面布局&用户体验优化
This commit is contained in:
parent
ea3fc586af
commit
d01ab9838d
@ -132,7 +132,7 @@ dependencies {
|
|||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.5.2'
|
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.5.2'
|
||||||
implementation 'com.google.android.material:material:1.3.0'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
//noinspection GradleDynamicVersion
|
//noinspection GradleDynamicVersion
|
||||||
testImplementation 'junit:junit:4.+'
|
testImplementation 'junit:junit:4.+'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
|
@ -1,18 +1,10 @@
|
|||||||
package com.idormy.sms.forwarder;
|
package com.idormy.sms.forwarder;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.Switch;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@ -21,37 +13,23 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import com.idormy.sms.forwarder.receiver.RebootBroadcastReceiver;
|
import com.idormy.sms.forwarder.receiver.RebootBroadcastReceiver;
|
||||||
import com.idormy.sms.forwarder.utils.CacheUtil;
|
import com.idormy.sms.forwarder.utils.CacheUtil;
|
||||||
import com.idormy.sms.forwarder.utils.CommonUtil;
|
import com.idormy.sms.forwarder.utils.CommonUtil;
|
||||||
import com.idormy.sms.forwarder.utils.Define;
|
|
||||||
import com.xuexiang.xupdate.easy.EasyUpdate;
|
import com.xuexiang.xupdate.easy.EasyUpdate;
|
||||||
import com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker;
|
import com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
|
||||||
public class AboutActivity extends AppCompatActivity {
|
public class AboutActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
@SuppressWarnings("FieldCanBeLocal")
|
||||||
private final String TAG = "AboutActivity";
|
private final String TAG = "AboutActivity";
|
||||||
private Context context;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Log.d(TAG, "onCreate");
|
Log.d(TAG, "onCreate");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
context = AboutActivity.this;
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
Log.d(TAG, "onCreate: " + RebootBroadcastReceiver.class.getName());
|
Log.d(TAG, "onCreate: " + RebootBroadcastReceiver.class.getName());
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch check_with_reboot = findViewById(R.id.switch_with_reboot);
|
|
||||||
checkWithReboot(check_with_reboot);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_help_tip = findViewById(R.id.switch_help_tip);
|
|
||||||
SwitchHelpTip(switch_help_tip);
|
|
||||||
|
|
||||||
final TextView version_now = findViewById(R.id.version_now);
|
final TextView version_now = findViewById(R.id.version_now);
|
||||||
Button check_version_now = findViewById(R.id.check_version_now);
|
Button check_version_now = findViewById(R.id.check_version_now);
|
||||||
try {
|
try {
|
||||||
@ -118,37 +96,6 @@ public class AboutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查重启广播接受器状态并设置
|
|
||||||
private void checkWithReboot(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch withrebootSwitch) {
|
|
||||||
//获取组件
|
|
||||||
final ComponentName cm = new ComponentName(this.getPackageName(), RebootBroadcastReceiver.class.getName());
|
|
||||||
|
|
||||||
final PackageManager pm = getPackageManager();
|
|
||||||
int state = pm.getComponentEnabledSetting(cm);
|
|
||||||
withrebootSwitch.setChecked(state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
|
||||||
&& state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER);
|
|
||||||
withrebootSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
||||||
int newState = isChecked ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
|
||||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
|
||||||
pm.setComponentEnabledSetting(cm, newState, PackageManager.DONT_KILL_APP);
|
|
||||||
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
|
||||||
|
|
||||||
if (isChecked) startToAutoStartSetting(this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//页面帮助提示
|
|
||||||
private void SwitchHelpTip(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switchHelpTip) {
|
|
||||||
switchHelpTip.setChecked(MyApplication.showHelpTip);
|
|
||||||
|
|
||||||
switchHelpTip.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
||||||
MyApplication.showHelpTip = isChecked;
|
|
||||||
SharedPreferences sp = context.getSharedPreferences(Define.SP_CONFIG, Context.MODE_PRIVATE);
|
|
||||||
sp.edit().putBoolean(Define.SP_CONFIG_SWITCH_HELP_TIP, isChecked).apply();
|
|
||||||
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//发起添加群流程
|
//发起添加群流程
|
||||||
public void joinQQGroup(String key) {
|
public void joinQQGroup(String key) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
@ -163,178 +110,4 @@ public class AboutActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Intent跳转到[自启动]页面全网最全适配机型解决方案
|
|
||||||
private static final HashMap<String, List<String>> hashMap = new HashMap<>() {
|
|
||||||
{
|
|
||||||
put("Xiaomi", Arrays.asList(
|
|
||||||
"com.miui.securitycenter/com.miui.permcenter.autostart.AutoStartManagementActivity",//MIUI10_9.8.1(9.0)
|
|
||||||
"com.miui.securitycenter"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("samsung", Arrays.asList(
|
|
||||||
"com.samsung.android.sm_cn/com.samsung.android.sm.ui.ram.AutoRunActivity",
|
|
||||||
"com.samsung.android.sm_cn/com.samsung.android.sm.ui.appmanagement.AppManagementActivity",
|
|
||||||
"com.samsung.android.sm_cn/com.samsung.android.sm.ui.cstyleboard.SmartManagerDashBoardActivity",
|
|
||||||
"com.samsung.android.sm_cn/.ui.ram.RamActivity",
|
|
||||||
"com.samsung.android.sm_cn/.app.dashboard.SmartManagerDashBoardActivity",
|
|
||||||
|
|
||||||
"com.samsung.android.sm/com.samsung.android.sm.ui.ram.AutoRunActivity",
|
|
||||||
"com.samsung.android.sm/com.samsung.android.sm.ui.appmanagement.AppManagementActivity",
|
|
||||||
"com.samsung.android.sm/com.samsung.android.sm.ui.cstyleboard.SmartManagerDashBoardActivity",
|
|
||||||
"com.samsung.android.sm/.ui.ram.RamActivity",
|
|
||||||
"com.samsung.android.sm/.app.dashboard.SmartManagerDashBoardActivity",
|
|
||||||
|
|
||||||
"com.samsung.android.lool/com.samsung.android.sm.ui.battery.BatteryActivity",
|
|
||||||
"com.samsung.android.sm_cn",
|
|
||||||
"com.samsung.android.sm"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("HUAWEI", Arrays.asList(
|
|
||||||
"com.huawei.systemmanager/.startupmgr.ui.StartupNormalAppListActivity",//EMUI9.1.0(方舟,9.0)
|
|
||||||
"com.huawei.systemmanager/.appcontrol.activity.StartupAppControlActivity",
|
|
||||||
"com.huawei.systemmanager/.optimize.process.ProtectActivity",
|
|
||||||
"com.huawei.systemmanager/.optimize.bootstart.BootStartActivity",
|
|
||||||
"com.huawei.systemmanager"//最后一行可以写包名, 这样如果签名的类路径在某些新版本的ROM中没找到 就直接跳转到对应的安全中心/手机管家 首页.
|
|
||||||
));
|
|
||||||
|
|
||||||
put("vivo", Arrays.asList(
|
|
||||||
"com.iqoo.secure/.ui.phoneoptimize.BgStartUpManager",
|
|
||||||
"com.iqoo.secure/.safeguard.PurviewTabActivity",
|
|
||||||
"com.vivo.permissionmanager/.activity.BgStartUpManagerActivity",
|
|
||||||
//"com.iqoo.secure/.ui.phoneoptimize.AddWhiteListActivity", //这是白名单, 不是自启动
|
|
||||||
"com.iqoo.secure",
|
|
||||||
"com.vivo.permissionmanager"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("Meizu", Arrays.asList(
|
|
||||||
"com.meizu.safe/.permission.SmartBGActivity",//Flyme7.3.0(7.1.2)
|
|
||||||
"com.meizu.safe/.permission.PermissionMainActivity",//网上的
|
|
||||||
"com.meizu.safe"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("OPPO", Arrays.asList(
|
|
||||||
"com.coloros.safecenter/.startupapp.StartupAppListActivity",
|
|
||||||
"com.coloros.safecenter/.permission.startup.StartupAppListActivity",
|
|
||||||
"com.oppo.safe/.permission.startup.StartupAppListActivity",
|
|
||||||
"com.coloros.oppoguardelf/com.coloros.powermanager.fuelgaue.PowerUsageModelActivity",
|
|
||||||
"com.coloros.safecenter/com.coloros.privacypermissionsentry.PermissionTopActivity",
|
|
||||||
"com.coloros.safecenter",
|
|
||||||
"com.oppo.safe",
|
|
||||||
"com.coloros.oppoguardelf"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("oneplus", Arrays.asList(
|
|
||||||
"com.oneplus.security/.chainlaunch.view.ChainLaunchAppListActivity",
|
|
||||||
"com.oneplus.security"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("letv", Arrays.asList(
|
|
||||||
"com.letv.android.letvsafe/.AutobootManageActivity",
|
|
||||||
"com.letv.android.letvsafe/.BackgroundAppManageActivity",//应用保护
|
|
||||||
"com.letv.android.letvsafe"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("zte", Arrays.asList(
|
|
||||||
"com.zte.heartyservice/.autorun.AppAutoRunManager",
|
|
||||||
"com.zte.heartyservice"
|
|
||||||
));
|
|
||||||
|
|
||||||
//金立
|
|
||||||
put("F", Arrays.asList(
|
|
||||||
"com.gionee.softmanager/.MainActivity",
|
|
||||||
"com.gionee.softmanager"
|
|
||||||
));
|
|
||||||
|
|
||||||
//以下为未确定(厂商名也不确定)
|
|
||||||
put("smartisanos", Arrays.asList(
|
|
||||||
"com.smartisanos.security/.invokeHistory.InvokeHistoryActivity",
|
|
||||||
"com.smartisanos.security"
|
|
||||||
));
|
|
||||||
|
|
||||||
//360
|
|
||||||
put("360", Arrays.asList(
|
|
||||||
"com.yulong.android.coolsafe/.ui.activity.autorun.AutoRunListActivity",
|
|
||||||
"com.yulong.android.coolsafe"
|
|
||||||
));
|
|
||||||
|
|
||||||
//360
|
|
||||||
put("ulong", Arrays.asList(
|
|
||||||
"com.yulong.android.coolsafe/.ui.activity.autorun.AutoRunListActivity",
|
|
||||||
"com.yulong.android.coolsafe"
|
|
||||||
));
|
|
||||||
|
|
||||||
//酷派
|
|
||||||
put("coolpad"/*厂商名称不确定是否正确*/, Arrays.asList(
|
|
||||||
"com.yulong.android.security/com.yulong.android.seccenter.tabbarmain",
|
|
||||||
"com.yulong.android.security"
|
|
||||||
));
|
|
||||||
|
|
||||||
//联想
|
|
||||||
put("lenovo"/*厂商名称不确定是否正确*/, Arrays.asList(
|
|
||||||
"com.lenovo.security/.purebackground.PureBackgroundActivity",
|
|
||||||
"com.lenovo.security"
|
|
||||||
));
|
|
||||||
|
|
||||||
put("htc"/*厂商名称不确定是否正确*/, Arrays.asList(
|
|
||||||
"com.htc.pitroad/.landingpage.activity.LandingPageActivity",
|
|
||||||
"com.htc.pitroad"
|
|
||||||
));
|
|
||||||
|
|
||||||
//华硕
|
|
||||||
put("asus"/*厂商名称不确定是否正确*/, Arrays.asList(
|
|
||||||
"com.asus.mobilemanager/.MainActivity",
|
|
||||||
"com.asus.mobilemanager"
|
|
||||||
));
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void startToAutoStartSetting(Context context) {
|
|
||||||
Log.e("Util", "******************当前手机型号为:" + Build.MANUFACTURER);
|
|
||||||
|
|
||||||
Set<Map.Entry<String, List<String>>> entries = hashMap.entrySet();
|
|
||||||
boolean has = false;
|
|
||||||
for (Map.Entry<String, List<String>> entry : entries) {
|
|
||||||
String manufacturer = entry.getKey();
|
|
||||||
List<String> actCompatList = entry.getValue();
|
|
||||||
if (Build.MANUFACTURER.equalsIgnoreCase(manufacturer)) {
|
|
||||||
for (String act : actCompatList) {
|
|
||||||
try {
|
|
||||||
Intent intent;
|
|
||||||
if (act.contains("/")) {
|
|
||||||
intent = new Intent();
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
ComponentName componentName = ComponentName.unflattenFromString(act);
|
|
||||||
intent.setComponent(componentName);
|
|
||||||
} else {
|
|
||||||
//找不到? 网上的做法都是跳转到设置... 这基本上是没意义的 基本上自启动这个功能是第三方厂商自己写的安全管家类app
|
|
||||||
//所以我是直接跳转到对应的安全管家/安全中心
|
|
||||||
intent = context.getPackageManager().getLaunchIntentForPackage(act);
|
|
||||||
}
|
|
||||||
context.startActivity(intent);
|
|
||||||
has = true;
|
|
||||||
break;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!has) {
|
|
||||||
Toast.makeText(context, "兼容方案", Toast.LENGTH_SHORT).show();
|
|
||||||
try {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
|
|
||||||
intent.setData(Uri.fromParts("package", context.getPackageName(), null));
|
|
||||||
context.startActivity(intent);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
Intent intent = new Intent(Settings.ACTION_SETTINGS);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ import android.view.View;
|
|||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@ -74,10 +73,6 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
//检查权限是否获取
|
|
||||||
PackageManager pm = getPackageManager();
|
|
||||||
CommonUtil.CheckPermission(pm, this);
|
|
||||||
|
|
||||||
//获取SIM信息
|
//获取SIM信息
|
||||||
PhoneUtils.init(this);
|
PhoneUtils.init(this);
|
||||||
|
|
||||||
@ -85,10 +80,6 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
SmsUtil.init(this);
|
SmsUtil.init(this);
|
||||||
NetUtil.init(this);
|
NetUtil.init(this);
|
||||||
|
|
||||||
HttpUtil.init(this);
|
|
||||||
SmsHubApiTask.init(this);
|
|
||||||
HttpServer.init(this);
|
|
||||||
|
|
||||||
//前台服务
|
//前台服务
|
||||||
try {
|
try {
|
||||||
serviceIntent = new Intent(MainActivity.this, FrontService.class);
|
serviceIntent = new Intent(MainActivity.this, FrontService.class);
|
||||||
@ -106,26 +97,29 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "BatteryService:", e);
|
Log.e(TAG, "BatteryService:", e);
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
SmsHubApiTask.updateTimer();
|
|
||||||
HttpServer.update();
|
HttpUtil.init(this);
|
||||||
} catch (Exception e) {
|
//启用HttpServer
|
||||||
Log.e(TAG, "SmsHubApiTask:", e);
|
if (SettingUtil.getSwitchEnableHttpServer()) {
|
||||||
|
HttpServer.init(this);
|
||||||
|
try {
|
||||||
|
HttpServer.update();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "启用HttpServer:", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*final StepView stepView = findViewById(R.id.step_view);
|
//启用SmsHubApiTask
|
||||||
stepView.setOnStepClickListener(new StepView.OnStepClickListener() {
|
if (SettingUtil.getSwitchEnableSmsHubApi()) {
|
||||||
@Override
|
SmsHubApiTask.init(this);
|
||||||
public void onStepClick(int step) {
|
try {
|
||||||
Toast.makeText(MainActivity.this, "Step " + step, Toast.LENGTH_SHORT).show();
|
SmsHubApiTask.updateTimer();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "SmsHubApiTask:", e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
List<String> steps = new ArrayList<>();
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
steps.add("Step " + (i + 1));
|
|
||||||
}
|
}
|
||||||
//steps.set(steps.size() - 1, steps.get(steps.size() - 1) + " last one");
|
|
||||||
stepView.setSteps(steps);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -141,19 +135,28 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//是否关闭页面提示
|
//检查权限是否获取
|
||||||
|
PackageManager pm = getPackageManager();
|
||||||
|
CommonUtil.CheckPermission(pm, this);
|
||||||
|
|
||||||
|
//是否关闭页面提示 & 计算浮动按钮位置
|
||||||
TextView help_tip = findViewById(R.id.help_tip);
|
TextView help_tip = findViewById(R.id.help_tip);
|
||||||
FloatingActionButton btnCleanLog = findViewById(R.id.btnCleanLog);
|
FloatingActionButton btnFloat = findViewById(R.id.btnCleanLog);
|
||||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) btnCleanLog.getLayoutParams();
|
RefreshListView viewList = findViewById(R.id.list_view_log);
|
||||||
if (MyApplication.showHelpTip) {
|
CommonUtil.calcMarginBottom(this, help_tip, btnFloat, viewList, null);
|
||||||
layoutParams.bottomMargin = CommonUtil.dp2px(this, 120);//距离底部120dp
|
|
||||||
btnCleanLog.setLayoutParams(layoutParams);
|
//清空日志
|
||||||
help_tip.setVisibility(View.VISIBLE);
|
btnFloat.setOnClickListener(v -> {
|
||||||
} else {
|
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||||
layoutParams.bottomMargin = CommonUtil.dp2px(this, 80);
|
builder.setTitle(R.string.clear_logs_tips)
|
||||||
btnCleanLog.setLayoutParams(layoutParams);
|
.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||||
help_tip.setVisibility(View.GONE);
|
// TODO Auto-generated method stub
|
||||||
}
|
LogUtil.delLog(null, null);
|
||||||
|
initTLogs();
|
||||||
|
adapter.add(logVos);
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
|
});
|
||||||
|
|
||||||
// 先拿到数据并放在适配器上
|
// 先拿到数据并放在适配器上
|
||||||
initTLogs(); //初始化数据
|
initTLogs(); //初始化数据
|
||||||
@ -362,54 +365,6 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void toAppList() {
|
|
||||||
Intent intent = new Intent(this, AppListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toClone() {
|
|
||||||
Intent intent = new Intent(this, CloneActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toSetting() {
|
|
||||||
Intent intent = new Intent(this, SettingActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toAbout() {
|
|
||||||
Intent intent = new Intent(this, AboutActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toHelp() {
|
|
||||||
Uri uri = Uri.parse("https://gitee.com/pp/SmsForwarder/wikis/pages");
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toRuleSetting(View view) {
|
|
||||||
Intent intent = new Intent(this, RuleActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toSendSetting(View view) {
|
|
||||||
Intent intent = new Intent(this, SenderActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cleanLog(View view) {
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
|
||||||
builder.setTitle(R.string.clear_logs_tips)
|
|
||||||
.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
LogUtil.delLog(null, null);
|
|
||||||
initTLogs();
|
|
||||||
adapter.add(logVos);
|
|
||||||
});
|
|
||||||
builder.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
//按返回键不退出回到桌面
|
//按返回键不退出回到桌面
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
@ -427,29 +382,34 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
}
|
}
|
||||||
|
|
||||||
//menu点击事件
|
//menu点击事件
|
||||||
|
@SuppressWarnings("CommentedOutCode")
|
||||||
@SuppressLint("NonConstantResourceId")
|
@SuppressLint("NonConstantResourceId")
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle item selection
|
Intent intent;
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
//case R.id.to_setting:
|
||||||
|
// intent = new Intent(this, SettingActivity.class);
|
||||||
|
// break;
|
||||||
case R.id.to_app_list:
|
case R.id.to_app_list:
|
||||||
toAppList();
|
intent = new Intent(this, AppListActivity.class);
|
||||||
return true;
|
break;
|
||||||
case R.id.to_clone:
|
case R.id.to_clone:
|
||||||
toClone();
|
intent = new Intent(this, CloneActivity.class);
|
||||||
return true;
|
break;
|
||||||
case R.id.to_setting:
|
|
||||||
toSetting();
|
|
||||||
return true;
|
|
||||||
case R.id.to_about:
|
case R.id.to_about:
|
||||||
toAbout();
|
intent = new Intent(this, AboutActivity.class);
|
||||||
return true;
|
break;
|
||||||
case R.id.to_help:
|
case R.id.to_help:
|
||||||
toHelp();
|
Uri uri = Uri.parse("https://gitee.com/pp/SmsForwarder/wikis/pages");
|
||||||
return true;
|
intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startActivity(intent);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置menu图标显示
|
//设置menu图标显示
|
||||||
@ -476,8 +436,8 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
public void dialog() {
|
public void dialog() {
|
||||||
dialog = new Dialog(this, R.style.dialog);
|
dialog = new Dialog(this, R.style.dialog);
|
||||||
inflate = LayoutInflater.from(MainActivity.this).inflate(R.layout.diaolog_privacy_policy, null);
|
inflate = LayoutInflater.from(MainActivity.this).inflate(R.layout.diaolog_privacy_policy, null);
|
||||||
TextView succsebtn = (TextView) inflate.findViewById(R.id.succsebtn);
|
TextView succsebtn = inflate.findViewById(R.id.succsebtn);
|
||||||
TextView canclebtn = (TextView) inflate.findViewById(R.id.caclebtn);
|
TextView canclebtn = inflate.findViewById(R.id.caclebtn);
|
||||||
|
|
||||||
succsebtn.setOnClickListener(v -> {
|
succsebtn.setOnClickListener(v -> {
|
||||||
/* uminit为1时代表已经同意隐私协议,sp记录当前状态*/
|
/* uminit为1时代表已经同意隐私协议,sp记录当前状态*/
|
||||||
@ -496,7 +456,6 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
|
|
||||||
//杀掉以前进程
|
//杀掉以前进程
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -506,7 +465,6 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
|
|||||||
UMConfigure.submitPolicyGrantResult(getApplicationContext(), false);
|
UMConfigure.submitPolicyGrantResult(getApplicationContext(), false);
|
||||||
//不同意隐私协议,退出app
|
//不同意隐私协议,退出app
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.setContentView(inflate);
|
dialog.setContentView(inflate);
|
||||||
|
@ -74,10 +74,6 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
super.onStart();
|
super.onStart();
|
||||||
Log.d(TAG, "onStart");
|
Log.d(TAG, "onStart");
|
||||||
|
|
||||||
//是否关闭页面提示
|
|
||||||
TextView help_tip = findViewById(R.id.help_tip);
|
|
||||||
help_tip.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
|
||||||
|
|
||||||
// 先拿到数据并放在适配器上
|
// 先拿到数据并放在适配器上
|
||||||
initRules(); //初始化数据
|
initRules(); //初始化数据
|
||||||
adapter = new RuleAdapter(RuleActivity.this, R.layout.item_rule, ruleModels);
|
adapter = new RuleAdapter(RuleActivity.this, R.layout.item_rule, ruleModels);
|
||||||
@ -100,7 +96,6 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
builder.setTitle(R.string.delete_rule_title);
|
builder.setTitle(R.string.delete_rule_title);
|
||||||
builder.setMessage(R.string.delete_rule_tips);
|
builder.setMessage(R.string.delete_rule_tips);
|
||||||
|
|
||||||
//添加AlertDialog.Builder对象的setPositiveButton()方法
|
|
||||||
builder.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
builder.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||||
RuleUtil.delRule(ruleModels.get(position).getId());
|
RuleUtil.delRule(ruleModels.get(position).getId());
|
||||||
initRules();
|
initRules();
|
||||||
@ -108,18 +103,11 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
Toast.makeText(getBaseContext(), R.string.delete_rule_toast, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getBaseContext(), R.string.delete_rule_toast, Toast.LENGTH_SHORT).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
//添加AlertDialog.Builder对象的setNegativeButton()方法
|
|
||||||
builder.setNeutralButton(R.string.clone, (dialog, which) -> {
|
builder.setNeutralButton(R.string.clone, (dialog, which) -> {
|
||||||
RuleModel ruleModel = ruleModels.get(position);
|
RuleModel ruleModel = ruleModels.get(position);
|
||||||
//TODO:直接复制
|
|
||||||
//RuleUtil.addRule(ruleModel);
|
|
||||||
//initRules();
|
|
||||||
//adapter.add(ruleModels);
|
|
||||||
//TODO:只复制到编辑对话框
|
|
||||||
setRule(ruleModel, true);
|
setRule(ruleModel, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
//添加AlertDialog.Builder对象的setNegativeButton()方法
|
|
||||||
builder.setNegativeButton(R.string.cancel, (dialog, which) -> {
|
builder.setNegativeButton(R.string.cancel, (dialog, which) -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -131,9 +119,6 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
//切换日志类别
|
//切换日志类别
|
||||||
int typeCheckId = getTypeCheckId(currentType);
|
int typeCheckId = getTypeCheckId(currentType);
|
||||||
final RadioGroup radioGroupTypeCheck = findViewById(R.id.radioGroupTypeCheck);
|
final RadioGroup radioGroupTypeCheck = findViewById(R.id.radioGroupTypeCheck);
|
||||||
final FloatingActionButton addSmsRule = findViewById(R.id.addSmsRule);
|
|
||||||
final FloatingActionButton addCallRule = findViewById(R.id.addCallRule);
|
|
||||||
final FloatingActionButton addAppRule = findViewById(R.id.addAppRule);
|
|
||||||
radioGroupTypeCheck.check(typeCheckId);
|
radioGroupTypeCheck.check(typeCheckId);
|
||||||
radioGroupTypeCheck.setOnCheckedChangeListener((group, checkedId) -> {
|
radioGroupTypeCheck.setOnCheckedChangeListener((group, checkedId) -> {
|
||||||
RadioButton rb = findViewById(checkedId);
|
RadioButton rb = findViewById(checkedId);
|
||||||
@ -141,15 +126,19 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
initRules(); //初始化数据
|
initRules(); //初始化数据
|
||||||
adapter = new RuleAdapter(RuleActivity.this, R.layout.item_rule, ruleModels);
|
adapter = new RuleAdapter(RuleActivity.this, R.layout.item_rule, ruleModels);
|
||||||
listView.setAdapter(adapter);
|
listView.setAdapter(adapter);
|
||||||
|
|
||||||
addSmsRule.setVisibility("sms".equals(currentType) ? View.VISIBLE : View.GONE);
|
|
||||||
addCallRule.setVisibility("call".equals(currentType) ? View.VISIBLE : View.GONE);
|
|
||||||
addAppRule.setVisibility("app".equals(currentType) ? View.VISIBLE : View.GONE);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//是否关闭页面提示
|
||||||
|
TextView help_tip = findViewById(R.id.help_tip);
|
||||||
|
FloatingActionButton btnFloat = findViewById(R.id.btnFloat);
|
||||||
|
CommonUtil.calcMarginBottom(this, help_tip, btnFloat, listView, null);
|
||||||
|
//添加规则
|
||||||
|
btnFloat.setOnClickListener(v -> setRule(null, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getTypeCheckId(String currentType) {
|
private int getTypeCheckId(String curType) {
|
||||||
switch (currentType) {
|
switch (curType) {
|
||||||
case "call":
|
case "call":
|
||||||
return R.id.btnTypeCall;
|
return R.id.btnTypeCall;
|
||||||
case "app":
|
case "app":
|
||||||
@ -159,8 +148,8 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDialogView(String currentType) {
|
private int getDialogView(String curType) {
|
||||||
switch (currentType) {
|
switch (curType) {
|
||||||
case "call":
|
case "call":
|
||||||
return R.layout.alert_dialog_setview_rule_call;
|
return R.layout.alert_dialog_setview_rule_call;
|
||||||
case "app":
|
case "app":
|
||||||
@ -170,8 +159,8 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getDialogTitle(String currentType) {
|
private int getDialogTitle(String curType) {
|
||||||
switch (currentType) {
|
switch (curType) {
|
||||||
case "call":
|
case "call":
|
||||||
return R.string.setrule_call;
|
return R.string.setrule_call;
|
||||||
case "app":
|
case "app":
|
||||||
@ -186,15 +175,6 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
ruleModels = RuleUtil.getRule(null, null, currentType);
|
ruleModels = RuleUtil.getRule(null, null, currentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRule(View view) {
|
|
||||||
currentType = (String) view.getTag();
|
|
||||||
int typeCheckId = getTypeCheckId(currentType);
|
|
||||||
final RadioGroup radioGroupTypeCheck = findViewById(R.id.radioGroupTypeCheck);
|
|
||||||
radioGroupTypeCheck.check(typeCheckId);
|
|
||||||
|
|
||||||
setRule(null, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setRule(final RuleModel ruleModel, final boolean isClone) {
|
private void setRule(final RuleModel ruleModel, final boolean isClone) {
|
||||||
final AlertDialog.Builder alertDialog71 = new AlertDialog.Builder(RuleActivity.this);
|
final AlertDialog.Builder alertDialog71 = new AlertDialog.Builder(RuleActivity.this);
|
||||||
final View view1 = View.inflate(RuleActivity.this, getDialogView(currentType), null);
|
final View view1 = View.inflate(RuleActivity.this, getDialogView(currentType), null);
|
||||||
|
@ -39,6 +39,7 @@ import androidx.appcompat.app.AlertDialog;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.idormy.sms.forwarder.adapter.SenderAdapter;
|
import com.idormy.sms.forwarder.adapter.SenderAdapter;
|
||||||
import com.idormy.sms.forwarder.model.SenderModel;
|
import com.idormy.sms.forwarder.model.SenderModel;
|
||||||
import com.idormy.sms.forwarder.model.vo.BarkSettingVo;
|
import com.idormy.sms.forwarder.model.vo.BarkSettingVo;
|
||||||
@ -109,10 +110,6 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
super.onStart();
|
super.onStart();
|
||||||
Log.d(TAG, "onStart");
|
Log.d(TAG, "onStart");
|
||||||
|
|
||||||
//是否关闭页面提示
|
|
||||||
TextView help_tip = findViewById(R.id.help_tip);
|
|
||||||
help_tip.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
|
||||||
|
|
||||||
// 先拿到数据并放在适配器上
|
// 先拿到数据并放在适配器上
|
||||||
initSenders(); //初始化数据
|
initSenders(); //初始化数据
|
||||||
adapter = new SenderAdapter(SenderActivity.this, R.layout.item_sender, senderModels);
|
adapter = new SenderAdapter(SenderActivity.this, R.layout.item_sender, senderModels);
|
||||||
@ -244,6 +241,74 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
builder.create().show();
|
builder.create().show();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//是否关闭页面提示
|
||||||
|
TextView help_tip = findViewById(R.id.help_tip);
|
||||||
|
FloatingActionButton btnFloat = findViewById(R.id.btnAddSender);
|
||||||
|
CommonUtil.calcMarginBottom(this, help_tip, btnFloat, listView, null);
|
||||||
|
//添加发送通道
|
||||||
|
btnFloat.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
@SuppressLint("InflateParams") View dialog_menu = LayoutInflater.from(SenderActivity.this).inflate(R.layout.alert_dialog_menu, null);
|
||||||
|
// 设置style 控制默认dialog带来的边距问题
|
||||||
|
final Dialog dialog = new Dialog(this, R.style.dialog_menu);
|
||||||
|
dialog.setContentView(dialog_menu);
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
GridView gridview = dialog.findViewById(R.id.MemuGridView);
|
||||||
|
final List<HashMap<String, Object>> item = getMenuData();
|
||||||
|
SimpleAdapter simpleAdapter = new SimpleAdapter(this, item, R.layout.item_menu, new String[]{"ItemImageView", "ItemTextView"}, new int[]{R.id.ItemImageView, R.id.ItemTextView});
|
||||||
|
gridview.setAdapter(simpleAdapter);
|
||||||
|
|
||||||
|
// 添加点击事件
|
||||||
|
gridview.setOnItemClickListener((arg0, arg1, position, arg3) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case TYPE_DINGDING:
|
||||||
|
setDingDing(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_EMAIL:
|
||||||
|
setEmail(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_BARK:
|
||||||
|
setBark(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_WEB_NOTIFY:
|
||||||
|
setWebNotify(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_QYWX_GROUP_ROBOT:
|
||||||
|
setQYWXGroupRobot(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_QYWX_APP:
|
||||||
|
setQYWXApp(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_SERVER_CHAN:
|
||||||
|
setServerChan(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_TELEGRAM:
|
||||||
|
setTelegram(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_SMS:
|
||||||
|
setSms(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_FEISHU:
|
||||||
|
setFeiShu(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_PUSHPLUS:
|
||||||
|
setPushPlus(null, false);
|
||||||
|
break;
|
||||||
|
case TYPE_GOTIFY:
|
||||||
|
setGotify(null, false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Toast.makeText(SenderActivity.this, R.string.not_supported, Toast.LENGTH_LONG).show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -314,67 +379,6 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加发送通道
|
|
||||||
public void addSender(View view) {
|
|
||||||
@SuppressLint("InflateParams") View dialog_menu = LayoutInflater.from(SenderActivity.this).inflate(R.layout.alert_dialog_menu, null);
|
|
||||||
// 设置style 控制默认dialog带来的边距问题
|
|
||||||
final Dialog dialog = new Dialog(this, R.style.dialog_menu);
|
|
||||||
dialog.setContentView(dialog_menu);
|
|
||||||
dialog.show();
|
|
||||||
|
|
||||||
GridView gridview = dialog.findViewById(R.id.MemuGridView);
|
|
||||||
final List<HashMap<String, Object>> item = getMenuData();
|
|
||||||
SimpleAdapter simpleAdapter = new SimpleAdapter(this, item, R.layout.item_menu, new String[]{"ItemImageView", "ItemTextView"}, new int[]{R.id.ItemImageView, R.id.ItemTextView});
|
|
||||||
gridview.setAdapter(simpleAdapter);
|
|
||||||
|
|
||||||
// 添加点击事件
|
|
||||||
gridview.setOnItemClickListener((arg0, arg1, position, arg3) -> {
|
|
||||||
dialog.dismiss();
|
|
||||||
|
|
||||||
switch (position) {
|
|
||||||
case TYPE_DINGDING:
|
|
||||||
setDingDing(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_EMAIL:
|
|
||||||
setEmail(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_BARK:
|
|
||||||
setBark(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_WEB_NOTIFY:
|
|
||||||
setWebNotify(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_QYWX_GROUP_ROBOT:
|
|
||||||
setQYWXGroupRobot(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_QYWX_APP:
|
|
||||||
setQYWXApp(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_SERVER_CHAN:
|
|
||||||
setServerChan(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_TELEGRAM:
|
|
||||||
setTelegram(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_SMS:
|
|
||||||
setSms(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_FEISHU:
|
|
||||||
setFeiShu(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_PUSHPLUS:
|
|
||||||
setPushPlus(null, false);
|
|
||||||
break;
|
|
||||||
case TYPE_GOTIFY:
|
|
||||||
setGotify(null, false);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Toast.makeText(SenderActivity.this, R.string.not_supported, Toast.LENGTH_LONG).show();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//钉钉机器人
|
//钉钉机器人
|
||||||
@SuppressLint({"SimpleDateFormat", "SetTextI18n"})
|
@SuppressLint({"SimpleDateFormat", "SetTextI18n"})
|
||||||
private void setDingDing(final SenderModel senderModel, final boolean isClone) {
|
private void setDingDing(final SenderModel senderModel, final boolean isClone) {
|
||||||
@ -433,8 +437,8 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
buttonDingdingOk.setOnClickListener(view -> {
|
buttonDingdingOk.setOnClickListener(view -> {
|
||||||
String senderName = editTextDingdingName.getText().toString().trim();
|
String senderName = editTextDingdingName.getText().toString().trim();
|
||||||
int senderStatus = switchDingdingEnable.isChecked() ? STATUS_ON : STATUS_OFF;
|
int senderStatus = switchDingdingEnable.isChecked() ? STATUS_ON : STATUS_OFF;
|
||||||
String token = editTextDingdingToken.getText().toString().trim();
|
String token = editTextDingdingToken.getText().trim();
|
||||||
String secret = editTextDingdingSecret.getText().toString().trim();
|
String secret = editTextDingdingSecret.getText().trim();
|
||||||
String atMobiles = editTextDingdingAtMobiles.getText().toString().trim();
|
String atMobiles = editTextDingdingAtMobiles.getText().toString().trim();
|
||||||
Boolean atAll = switchDingdingAtAll.isChecked();
|
Boolean atAll = switchDingdingAtAll.isChecked();
|
||||||
|
|
||||||
@ -479,13 +483,13 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonDingdingTest.setOnClickListener(view -> {
|
buttonDingdingTest.setOnClickListener(view -> {
|
||||||
String token = editTextDingdingToken.getText().toString().trim();
|
String token = editTextDingdingToken.getText().trim();
|
||||||
if (CommonUtil.checkUrl(token, true)) {
|
if (CommonUtil.checkUrl(token, true)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_token, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_token, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String secret = editTextDingdingSecret.getText().toString().trim();
|
String secret = editTextDingdingSecret.getText().trim();
|
||||||
String atMobiles = editTextDingdingAtMobiles.getText().toString().trim();
|
String atMobiles = editTextDingdingAtMobiles.getText().toString().trim();
|
||||||
Boolean atAll = switchDingdingAtAll.isChecked();
|
Boolean atAll = switchDingdingAtAll.isChecked();
|
||||||
try {
|
try {
|
||||||
@ -563,7 +567,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
String port = editTextEmailPort.getText().toString().trim();
|
String port = editTextEmailPort.getText().toString().trim();
|
||||||
boolean ssl = switchEmailSSl.isChecked();
|
boolean ssl = switchEmailSSl.isChecked();
|
||||||
String fromEmail = editTextEmailFromAdd.getText().toString().trim();
|
String fromEmail = editTextEmailFromAdd.getText().toString().trim();
|
||||||
String pwd = editTextEmailPsw.getText().toString().trim();
|
String pwd = editTextEmailPsw.getText().trim();
|
||||||
String toEmail = editTextEmailToAdd.getText().toString().trim();
|
String toEmail = editTextEmailToAdd.getText().toString().trim();
|
||||||
|
|
||||||
String title = editTextEmailTitle.getText().toString().trim();
|
String title = editTextEmailTitle.getText().toString().trim();
|
||||||
@ -613,7 +617,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
String port = editTextEmailPort.getText().toString().trim();
|
String port = editTextEmailPort.getText().toString().trim();
|
||||||
boolean ssl = switchEmailSSl.isChecked();
|
boolean ssl = switchEmailSSl.isChecked();
|
||||||
String fromEmail = editTextEmailFromAdd.getText().toString().trim();
|
String fromEmail = editTextEmailFromAdd.getText().toString().trim();
|
||||||
String pwd = editTextEmailPsw.getText().toString().trim();
|
String pwd = editTextEmailPsw.getText().trim();
|
||||||
String toEmail = editTextEmailToAdd.getText().toString().trim();
|
String toEmail = editTextEmailToAdd.getText().toString().trim();
|
||||||
|
|
||||||
String title = editTextEmailTitle.getText().toString().trim();
|
String title = editTextEmailTitle.getText().toString().trim();
|
||||||
@ -710,7 +714,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String barkServer = editTextBarkServer.getText().toString().trim();
|
String barkServer = editTextBarkServer.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(barkServer, false)) {
|
if (!CommonUtil.checkUrl(barkServer, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_bark_server, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_bark_server, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -749,7 +753,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonBarkTest.setOnClickListener(view -> {
|
buttonBarkTest.setOnClickListener(view -> {
|
||||||
String barkServer = editTextBarkServer.getText().toString().trim();
|
String barkServer = editTextBarkServer.getText().trim();
|
||||||
String barkIcon = editTextBarkIcon.getText().toString().trim();
|
String barkIcon = editTextBarkIcon.getText().toString().trim();
|
||||||
if (CommonUtil.checkUrl(barkServer, false)) {
|
if (CommonUtil.checkUrl(barkServer, false)) {
|
||||||
try {
|
try {
|
||||||
@ -816,7 +820,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String webServer = editTextWebNotifyWebServer.getText().toString().trim();
|
String webServer = editTextWebNotifyWebServer.getText().toString().trim();
|
||||||
String secret = editTextWebNotifySecret.getText().toString().trim();
|
String secret = editTextWebNotifySecret.getText().trim();
|
||||||
String method = radioGroupWebNotifyMethod.getCheckedRadioButtonId() == R.id.radioWebNotifyMethodGet ? "GET" : "POST";
|
String method = radioGroupWebNotifyMethod.getCheckedRadioButtonId() == R.id.radioWebNotifyMethodGet ? "GET" : "POST";
|
||||||
String webParams = editTextWebNotifyWebParams.getText().toString().trim();
|
String webParams = editTextWebNotifyWebParams.getText().toString().trim();
|
||||||
|
|
||||||
@ -856,7 +860,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
buttonWebNotifyTest.setOnClickListener(view -> {
|
buttonWebNotifyTest.setOnClickListener(view -> {
|
||||||
String webServer = editTextWebNotifyWebServer.getText().toString().trim();
|
String webServer = editTextWebNotifyWebServer.getText().toString().trim();
|
||||||
String secret = editTextWebNotifySecret.getText().toString().trim();
|
String secret = editTextWebNotifySecret.getText().trim();
|
||||||
String method = radioGroupWebNotifyMethod.getCheckedRadioButtonId() == R.id.radioWebNotifyMethodGet ? "GET" : "POST";
|
String method = radioGroupWebNotifyMethod.getCheckedRadioButtonId() == R.id.radioWebNotifyMethodGet ? "GET" : "POST";
|
||||||
String webParams = editTextWebNotifyWebParams.getText().toString().trim();
|
String webParams = editTextWebNotifyWebParams.getText().toString().trim();
|
||||||
|
|
||||||
@ -919,7 +923,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String webHook = editTextQYWXGroupRobotWebHook.getText().toString().trim();
|
String webHook = editTextQYWXGroupRobotWebHook.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(webHook, false)) {
|
if (!CommonUtil.checkUrl(webHook, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -957,7 +961,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonQyWxGroupRobotTest.setOnClickListener(view -> {
|
buttonQyWxGroupRobotTest.setOnClickListener(view -> {
|
||||||
String webHook = editTextQYWXGroupRobotWebHook.getText().toString().trim();
|
String webHook = editTextQYWXGroupRobotWebHook.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(webHook, false)) {
|
if (!CommonUtil.checkUrl(webHook, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1046,7 +1050,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
QYWXAppSettingVo QYWXAppSettingVoNew = new QYWXAppSettingVo(
|
QYWXAppSettingVo QYWXAppSettingVoNew = new QYWXAppSettingVo(
|
||||||
editTextQYWXAppCorpID.getText().toString().trim(),
|
editTextQYWXAppCorpID.getText().toString().trim(),
|
||||||
editTextQYWXAppAgentID.getText().toString().trim(),
|
editTextQYWXAppAgentID.getText().toString().trim(),
|
||||||
editTextQYWXAppSecret.getText().toString().trim(),
|
editTextQYWXAppSecret.getText().trim(),
|
||||||
editTextQYWXAppToUser.getText().toString().trim(),
|
editTextQYWXAppToUser.getText().toString().trim(),
|
||||||
switchQYWXAppAtAll.isChecked());
|
switchQYWXAppAtAll.isChecked());
|
||||||
if (!QYWXAppSettingVoNew.checkParms()) {
|
if (!QYWXAppSettingVoNew.checkParms()) {
|
||||||
@ -1088,7 +1092,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
QYWXAppSettingVo QYWXAppSettingVoNew = new QYWXAppSettingVo(
|
QYWXAppSettingVo QYWXAppSettingVoNew = new QYWXAppSettingVo(
|
||||||
editTextQYWXAppCorpID.getText().toString().trim(),
|
editTextQYWXAppCorpID.getText().toString().trim(),
|
||||||
editTextQYWXAppAgentID.getText().toString().trim(),
|
editTextQYWXAppAgentID.getText().toString().trim(),
|
||||||
editTextQYWXAppSecret.getText().toString().trim(),
|
editTextQYWXAppSecret.getText().trim(),
|
||||||
editTextQYWXAppToUser.getText().toString().trim(),
|
editTextQYWXAppToUser.getText().toString().trim(),
|
||||||
switchQYWXAppAtAll.isChecked());
|
switchQYWXAppAtAll.isChecked());
|
||||||
if (!QYWXAppSettingVoNew.checkParms()) {
|
if (!QYWXAppSettingVoNew.checkParms()) {
|
||||||
@ -1152,7 +1156,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String serverChanServer = editTextServerChanSendKey.getText().toString().trim();
|
String serverChanServer = editTextServerChanSendKey.getText().trim();
|
||||||
if (TextUtils.isEmpty(serverChanServer)) {
|
if (TextUtils.isEmpty(serverChanServer)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_sendkey, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_sendkey, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1190,7 +1194,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonServerChanTest.setOnClickListener(view -> {
|
buttonServerChanTest.setOnClickListener(view -> {
|
||||||
String serverChanServer = editTextServerChanSendKey.getText().toString().trim();
|
String serverChanServer = editTextServerChanSendKey.getText().trim();
|
||||||
if (TextUtils.isEmpty(serverChanServer)) {
|
if (TextUtils.isEmpty(serverChanServer)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_sendkey, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_sendkey, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1303,7 +1307,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String apiToken = editTextTelegramApiToken.getText().toString().trim();
|
String apiToken = editTextTelegramApiToken.getText().trim();
|
||||||
String chatId = editTextTelegramChatId.getText().toString().trim();
|
String chatId = editTextTelegramChatId.getText().toString().trim();
|
||||||
if (apiToken.isEmpty() || chatId.isEmpty()) {
|
if (apiToken.isEmpty() || chatId.isEmpty()) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_apiToken_or_chatId, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_apiToken_or_chatId, Toast.LENGTH_LONG).show();
|
||||||
@ -1320,7 +1324,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
boolean proxyAuthenticator = switchProxyAuthenticator.isChecked();
|
boolean proxyAuthenticator = switchProxyAuthenticator.isChecked();
|
||||||
String proxyUsername = editTextProxyUsername.getText().toString().trim();
|
String proxyUsername = editTextProxyUsername.getText().toString().trim();
|
||||||
String proxyPassword = editTextProxyPassword.getText().toString().trim();
|
String proxyPassword = editTextProxyPassword.getText().trim();
|
||||||
if (proxyAuthenticator && TextUtils.isEmpty(proxyUsername) && TextUtils.isEmpty(proxyPassword)) {
|
if (proxyAuthenticator && TextUtils.isEmpty(proxyUsername) && TextUtils.isEmpty(proxyPassword)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_username_or_password, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_username_or_password, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1360,7 +1364,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonTelegramTest.setOnClickListener(view -> {
|
buttonTelegramTest.setOnClickListener(view -> {
|
||||||
String apiToken = editTextTelegramApiToken.getText().toString().trim();
|
String apiToken = editTextTelegramApiToken.getText().trim();
|
||||||
String chatId = editTextTelegramChatId.getText().toString().trim();
|
String chatId = editTextTelegramChatId.getText().toString().trim();
|
||||||
if (apiToken.isEmpty() || chatId.isEmpty()) {
|
if (apiToken.isEmpty() || chatId.isEmpty()) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_apiToken_or_chatId, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_apiToken_or_chatId, Toast.LENGTH_LONG).show();
|
||||||
@ -1377,7 +1381,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
boolean proxyAuthenticator = switchProxyAuthenticator.isChecked();
|
boolean proxyAuthenticator = switchProxyAuthenticator.isChecked();
|
||||||
String proxyUsername = editTextProxyUsername.getText().toString().trim();
|
String proxyUsername = editTextProxyUsername.getText().toString().trim();
|
||||||
String proxyPassword = editTextProxyPassword.getText().toString().trim();
|
String proxyPassword = editTextProxyPassword.getText().trim();
|
||||||
if (proxyAuthenticator && TextUtils.isEmpty(proxyUsername) && TextUtils.isEmpty(proxyPassword)) {
|
if (proxyAuthenticator && TextUtils.isEmpty(proxyUsername) && TextUtils.isEmpty(proxyPassword)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_username_or_password, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_username_or_password, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1555,7 +1559,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String webHook = editTextFeishuWebhook.getText().toString().trim();
|
String webHook = editTextFeishuWebhook.getText().toString().trim();
|
||||||
String secret = editTextFeishuSecret.getText().toString().trim();
|
String secret = editTextFeishuSecret.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(webHook, false)) {
|
if (!CommonUtil.checkUrl(webHook, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1594,7 +1598,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
buttonFeishuTest.setOnClickListener(view -> {
|
buttonFeishuTest.setOnClickListener(view -> {
|
||||||
String webHook = editTextFeishuWebhook.getText().toString().trim();
|
String webHook = editTextFeishuWebhook.getText().toString().trim();
|
||||||
String secret = editTextFeishuSecret.getText().toString().trim();
|
String secret = editTextFeishuSecret.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(webHook, false)) {
|
if (!CommonUtil.checkUrl(webHook, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_webhook, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1666,7 +1670,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PushPlusSettingVo pushPlusSettingVoNew = new PushPlusSettingVo(
|
PushPlusSettingVo pushPlusSettingVoNew = new PushPlusSettingVo(
|
||||||
editTextPushPlusToken.getText().toString().trim(),
|
editTextPushPlusToken.getText().trim(),
|
||||||
editTextPushPlusTopic.getText().toString().trim(),
|
editTextPushPlusTopic.getText().toString().trim(),
|
||||||
editTextPushPlusTemplate.getText().toString().trim(),
|
editTextPushPlusTemplate.getText().toString().trim(),
|
||||||
editTextPushPlusChannel.getText().toString().trim(),
|
editTextPushPlusChannel.getText().toString().trim(),
|
||||||
@ -1712,7 +1716,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
buttonPushPlusTest.setOnClickListener(view -> {
|
buttonPushPlusTest.setOnClickListener(view -> {
|
||||||
PushPlusSettingVo pushPlusSettingVoNew = new PushPlusSettingVo(
|
PushPlusSettingVo pushPlusSettingVoNew = new PushPlusSettingVo(
|
||||||
editTextPushPlusToken.getText().toString().trim(),
|
editTextPushPlusToken.getText().trim(),
|
||||||
editTextPushPlusTopic.getText().toString().trim(),
|
editTextPushPlusTopic.getText().toString().trim(),
|
||||||
editTextPushPlusTemplate.getText().toString().trim(),
|
editTextPushPlusTemplate.getText().toString().trim(),
|
||||||
editTextPushPlusChannel.getText().toString().trim(),
|
editTextPushPlusChannel.getText().toString().trim(),
|
||||||
@ -1784,7 +1788,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String webServer = editTextGotifyWebServer.getText().toString().trim();
|
String webServer = editTextGotifyWebServer.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(webServer, false)) {
|
if (!CommonUtil.checkUrl(webServer, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_webserver, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_webserver, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
@ -1828,7 +1832,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonGotifyTest.setOnClickListener(view -> {
|
buttonGotifyTest.setOnClickListener(view -> {
|
||||||
String webServer = editTextGotifyWebServer.getText().toString().trim();
|
String webServer = editTextGotifyWebServer.getText().trim();
|
||||||
if (!CommonUtil.checkUrl(webServer, false)) {
|
if (!CommonUtil.checkUrl(webServer, false)) {
|
||||||
Toast.makeText(SenderActivity.this, R.string.invalid_webserver, Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, R.string.invalid_webserver, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
|
@ -2,19 +2,25 @@ package com.idormy.sms.forwarder;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ScrollView;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@ -23,103 +29,99 @@ import androidx.annotation.RequiresApi;
|
|||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.idormy.sms.forwarder.receiver.RebootBroadcastReceiver;
|
||||||
|
import com.idormy.sms.forwarder.sender.HttpServer;
|
||||||
import com.idormy.sms.forwarder.sender.SmsHubApiTask;
|
import com.idormy.sms.forwarder.sender.SmsHubApiTask;
|
||||||
import com.idormy.sms.forwarder.utils.*;
|
import com.idormy.sms.forwarder.utils.CommonUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.DbHelper;
|
||||||
|
import com.idormy.sms.forwarder.utils.Define;
|
||||||
|
import com.idormy.sms.forwarder.utils.HttpUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.KeepAliveUtils;
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtil;
|
||||||
|
import com.idormy.sms.forwarder.view.ClearEditText;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class SettingActivity extends AppCompatActivity {
|
public class SettingActivity extends AppCompatActivity {
|
||||||
private final String TAG = "SettingActivity";
|
private final String TAG = "SettingActivity";
|
||||||
private TextView textView;
|
private Context context;
|
||||||
|
private boolean isIgnoreBatteryOptimization;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Log.d(TAG, "onCreate");
|
Log.d(TAG, "onCreate");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
context = SettingActivity.this;
|
||||||
setContentView(R.layout.activity_setting);
|
setContentView(R.layout.activity_setting);
|
||||||
|
|
||||||
EditText et_add_extra_device_mark = findViewById(R.id.et_add_extra_device_mark);
|
|
||||||
editAddExtraDeviceMark(et_add_extra_device_mark);
|
|
||||||
|
|
||||||
EditText et_add_extra_sim1 = findViewById(R.id.et_add_extra_sim1);
|
|
||||||
editAddExtraSim1(et_add_extra_sim1);
|
|
||||||
|
|
||||||
EditText et_add_extra_sim2 = findViewById(R.id.et_add_extra_sim2);
|
|
||||||
editAddExtraSim2(et_add_extra_sim2);
|
|
||||||
|
|
||||||
EditText et_battery_level_alarm_min = findViewById(R.id.et_battery_level_alarm_min);
|
|
||||||
editBatteryLevelAlarmMin(et_battery_level_alarm_min);
|
|
||||||
EditText et_battery_level_alarm_max = findViewById(R.id.et_battery_level_alarm_max);
|
|
||||||
editBatteryLevelAlarmMax(et_battery_level_alarm_max);
|
|
||||||
|
|
||||||
EditText et_retry_delay_time1 = findViewById(R.id.et_retry_delay_time1);
|
|
||||||
editRetryDelayTime(et_retry_delay_time1, 1);
|
|
||||||
EditText et_retry_delay_time2 = findViewById(R.id.et_retry_delay_time2);
|
|
||||||
editRetryDelayTime(et_retry_delay_time2, 2);
|
|
||||||
EditText et_retry_delay_time3 = findViewById(R.id.et_retry_delay_time3);
|
|
||||||
editRetryDelayTime(et_retry_delay_time3, 3);
|
|
||||||
EditText et_retry_delay_time4 = findViewById(R.id.et_retry_delay_time4);
|
|
||||||
editRetryDelayTime(et_retry_delay_time4, 4);
|
|
||||||
EditText et_retry_delay_time5 = findViewById(R.id.et_retry_delay_time5);
|
|
||||||
editRetryDelayTime(et_retry_delay_time5, 5);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_sms_template = findViewById(R.id.switch_sms_template);
|
|
||||||
switchSmsTemplate(switch_sms_template);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_sms = findViewById(R.id.switch_enable_sms);
|
|
||||||
switchEnableSms(switch_enable_sms);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_phone = findViewById(R.id.switch_enable_phone);
|
|
||||||
switchEnablePhone(switch_enable_phone);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_app_notify = findViewById(R.id.switch_enable_app_notify);
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_cancel_app_notify = findViewById(R.id.switch_cancel_app_notify);
|
|
||||||
switchEnableAppNotify(switch_enable_app_notify, switch_cancel_app_notify);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_exclude_from_recents = findViewById(R.id.switch_exclude_from_recents);
|
|
||||||
switchExcludeFromRecents(switch_exclude_from_recents);
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_battery_receiver = findViewById(R.id.switch_battery_receiver);
|
|
||||||
switchBatteryReceiver(switch_battery_receiver);
|
|
||||||
|
|
||||||
EditText textSmsTemplate = findViewById(R.id.text_sms_template);
|
|
||||||
editSmsTemplate(textSmsTemplate);
|
|
||||||
|
|
||||||
editSmsHubConfig(findViewById(R.id.switch_enable_sms_hub),findViewById(R.id.editText_text_sms_hub_url));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
@SuppressLint("NewApi")
|
||||||
private void editSmsHubConfig(Switch switch_enable_send_sms, EditText editText_text_send_sms) {
|
@Override
|
||||||
switch_enable_send_sms.setChecked(SettingUtil.getSwitchEnableSmsHubApi());
|
protected void onStart() {
|
||||||
switch_enable_send_sms.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
super.onStart();
|
||||||
if (isChecked && editText_text_send_sms.getText() != null && editText_text_send_sms.getText().length() < 1) {
|
Log.d(TAG, "onStart");
|
||||||
HttpUtil.Toast(TAG, "url为空无法启用");
|
|
||||||
switch_enable_send_sms.setChecked(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SettingUtil.switchEnableSmsHubApi(isChecked);
|
|
||||||
Log.d(TAG, "switchEnableSendApi:" + isChecked);
|
|
||||||
SmsHubApiTask.updateTimer();
|
|
||||||
});
|
|
||||||
editText_text_send_sms.setText(SettingUtil.getSmsHubApiUrl());
|
|
||||||
editText_text_send_sms.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
//是否关闭页面提示
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
TextView help_tip = findViewById(R.id.help_tip);
|
||||||
}
|
ScrollView scrollView = findViewById(R.id.scrollView);
|
||||||
|
CommonUtil.calcMarginBottom(this, help_tip, null, null, scrollView);
|
||||||
|
|
||||||
@Override
|
//转发短信广播
|
||||||
public void afterTextChanged(Editable s) {
|
switchEnableSms(findViewById(R.id.switch_enable_sms));
|
||||||
SettingUtil.smsHubApiUrl(editText_text_send_sms.getText().toString().trim());
|
//转发通话记录
|
||||||
}
|
switchEnablePhone(findViewById(R.id.switch_enable_phone), findViewById(R.id.cbCallType1), findViewById(R.id.cbCallType2), findViewById(R.id.cbCallType3));
|
||||||
});
|
//转发应用通知 & 自动关闭通知
|
||||||
|
switchEnableAppNotify(findViewById(R.id.switch_enable_app_notify), findViewById(R.id.checkbox_cancel_app_notify));
|
||||||
|
|
||||||
|
//HttpServer
|
||||||
|
switchEnableHttpServer(findViewById(R.id.switch_enable_http_server));
|
||||||
|
//SmsHubApiTask
|
||||||
|
editSmsHubConfig(findViewById(R.id.switch_enable_sms_hub), findViewById(R.id.editText_text_sms_hub_url));
|
||||||
|
|
||||||
|
//监听电池状态变化
|
||||||
|
switchBatteryReceiver(findViewById(R.id.switch_battery_receiver));
|
||||||
|
//电量预警
|
||||||
|
editBatteryLevelAlarmMin(findViewById(R.id.et_battery_level_alarm_min));
|
||||||
|
editBatteryLevelAlarmMax(findViewById(R.id.et_battery_level_alarm_max));
|
||||||
|
|
||||||
|
//开机启动
|
||||||
|
checkWithReboot(findViewById(R.id.switch_with_reboot));
|
||||||
|
//电池优化设置
|
||||||
|
batterySetting(findViewById(R.id.switch_battery_setting));
|
||||||
|
//不在最近任务列表中显示
|
||||||
|
switchExcludeFromRecents(findViewById(R.id.switch_exclude_from_recents));
|
||||||
|
|
||||||
|
//是否开启失败重试
|
||||||
|
switchRetryDelay(findViewById(R.id.switch_retry_delay));
|
||||||
|
//接口请求失败重试时间间隔
|
||||||
|
editRetryDelayTime(findViewById(R.id.et_retry_delay_time1), 1);
|
||||||
|
editRetryDelayTime(findViewById(R.id.et_retry_delay_time2), 2);
|
||||||
|
editRetryDelayTime(findViewById(R.id.et_retry_delay_time3), 3);
|
||||||
|
editRetryDelayTime(findViewById(R.id.et_retry_delay_time4), 4);
|
||||||
|
editRetryDelayTime(findViewById(R.id.et_retry_delay_time5), 5);
|
||||||
|
|
||||||
|
//设备备注
|
||||||
|
editAddExtraDeviceMark(findViewById(R.id.et_add_extra_device_mark));
|
||||||
|
//SIM1备注
|
||||||
|
editAddExtraSim1(findViewById(R.id.et_add_extra_sim1));
|
||||||
|
//SIM2备注
|
||||||
|
editAddExtraSim2(findViewById(R.id.et_add_extra_sim2));
|
||||||
|
//启用自定义模版
|
||||||
|
switchSmsTemplate(findViewById(R.id.switch_sms_template));
|
||||||
|
//自定义模板
|
||||||
|
editSmsTemplate(findViewById(R.id.text_sms_template));
|
||||||
|
|
||||||
|
//帮助提示
|
||||||
|
SwitchHelpTip(findViewById(R.id.switch_help_tip));
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置转发短信
|
//设置转发短信
|
||||||
private void switchEnableSms(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_sms) {
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchEnableSms(Switch switch_enable_sms) {
|
||||||
switch_enable_sms.setChecked(SettingUtil.getSwitchEnableSms());
|
switch_enable_sms.setChecked(SettingUtil.getSwitchEnableSms());
|
||||||
|
|
||||||
switch_enable_sms.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
switch_enable_sms.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
@ -129,30 +131,54 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置转发来电
|
//转发通话记录
|
||||||
private void switchEnablePhone(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_phone) {
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchEnablePhone(Switch switch_enable_phone, CheckBox check_box_call_type_1, CheckBox check_box_call_type_2, CheckBox check_box_call_type_3) {
|
||||||
switch_enable_phone.setChecked(SettingUtil.getSwitchEnablePhone());
|
switch_enable_phone.setChecked(SettingUtil.getSwitchEnablePhone());
|
||||||
|
check_box_call_type_1.setChecked(SettingUtil.getSwitchCallType1());
|
||||||
|
check_box_call_type_2.setChecked(SettingUtil.getSwitchCallType2());
|
||||||
|
check_box_call_type_3.setChecked(SettingUtil.getSwitchCallType3());
|
||||||
|
|
||||||
switch_enable_phone.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
switch_enable_phone.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
if (isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
|
||||||
|
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchEnablePhone(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//TODO:校验使用来电转发必备的权限
|
//TODO:校验使用来电转发必备的权限
|
||||||
SettingUtil.switchEnablePhone(isChecked);
|
SettingUtil.switchEnablePhone(isChecked);
|
||||||
Log.d(TAG, "switchEnablePhone:" + isChecked);
|
Log.d(TAG, "switchEnablePhone:" + isChecked);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
//监听电池状态变化
|
check_box_call_type_1.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
private void switchBatteryReceiver(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_battery_receiver) {
|
SettingUtil.switchCallType1(isChecked);
|
||||||
switch_battery_receiver.setChecked(SettingUtil.getSwitchEnableBatteryReceiver());
|
if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
|
||||||
|
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchEnablePhone(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
switch_battery_receiver.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
check_box_call_type_2.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
//TODO:校验使用来电转发必备的权限
|
SettingUtil.switchCallType2(isChecked);
|
||||||
SettingUtil.switchEnableBatteryReceiver(isChecked);
|
if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
|
||||||
Log.d(TAG, "switchEnablePhone:" + isChecked);
|
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchEnablePhone(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
check_box_call_type_3.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
SettingUtil.switchCallType3(isChecked);
|
||||||
|
if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
|
||||||
|
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchEnablePhone(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置转发APP通知
|
//转发应用通知 & 自动关闭通知
|
||||||
private void switchEnableAppNotify(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_app_notify, @SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_cancel_app_notify) {
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchEnableAppNotify(Switch switch_enable_app_notify, CheckBox checkbox_cancel_app_notify) {
|
||||||
final LinearLayout layout_cancel_app_notify = findViewById(R.id.layout_cancel_app_notify);
|
final LinearLayout layout_cancel_app_notify = findViewById(R.id.layout_cancel_app_notify);
|
||||||
boolean isEnable = SettingUtil.getSwitchEnableAppNotify();
|
boolean isEnable = SettingUtil.getSwitchEnableAppNotify();
|
||||||
switch_enable_app_notify.setChecked(isEnable);
|
switch_enable_app_notify.setChecked(isEnable);
|
||||||
@ -175,16 +201,355 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
Log.d(TAG, "switchEnableAppNotify:" + isChecked);
|
Log.d(TAG, "switchEnableAppNotify:" + isChecked);
|
||||||
});
|
});
|
||||||
|
|
||||||
switch_cancel_app_notify.setChecked(SettingUtil.getSwitchCancelAppNotify());
|
checkbox_cancel_app_notify.setChecked(SettingUtil.getSwitchCancelAppNotify());
|
||||||
switch_cancel_app_notify.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
checkbox_cancel_app_notify.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
SettingUtil.switchCancelAppNotify(isChecked);
|
SettingUtil.switchCancelAppNotify(isChecked);
|
||||||
Log.d(TAG, "switchCancelAppNotify:" + isChecked);
|
Log.d(TAG, "switchCancelAppNotify:" + isChecked);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//请求通知使用权限
|
||||||
|
public void requestNotificationPermission(View view) {
|
||||||
|
if (!CommonUtil.isNotificationListenerServiceEnabled(this)) {
|
||||||
|
CommonUtil.openNotificationAccess(this);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, R.string.notification_listener_service_enabled, Toast.LENGTH_SHORT).show();
|
||||||
|
CommonUtil.toggleNotificationListenerService(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == CommonUtil.NOTIFICATION_REQUEST_CODE) {
|
||||||
|
if (CommonUtil.isNotificationListenerServiceEnabled(this)) {
|
||||||
|
Toast.makeText(this, R.string.notification_listener_service_enabled, Toast.LENGTH_SHORT).show();
|
||||||
|
CommonUtil.toggleNotificationListenerService(this);
|
||||||
|
SettingUtil.switchEnableAppNotify(true);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, R.string.notification_listener_service_disabled, Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchEnableAppNotify(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_app_notify = findViewById(R.id.switch_enable_app_notify);
|
||||||
|
switch_enable_app_notify.setChecked(SettingUtil.getSwitchEnableAppNotify());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//SmsHubApiTask
|
||||||
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void editSmsHubConfig(Switch switch_enable_send_sms, ClearEditText editText_text_send_sms) {
|
||||||
|
switch_enable_send_sms.setChecked(SettingUtil.getSwitchEnableSmsHubApi());
|
||||||
|
switch_enable_send_sms.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
String webServer = editText_text_send_sms.getText().trim();
|
||||||
|
if (isChecked && !CommonUtil.checkUrl(webServer, false)) {
|
||||||
|
HttpUtil.Toast(TAG, "url为空或不正确无法启用");
|
||||||
|
switch_enable_send_sms.setChecked(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SettingUtil.switchEnableSmsHubApi(isChecked);
|
||||||
|
Log.d(TAG, "switchEnableSendApi:" + isChecked);
|
||||||
|
SmsHubApiTask.updateTimer();
|
||||||
|
});
|
||||||
|
|
||||||
|
editText_text_send_sms.setText(SettingUtil.getSmsHubApiUrl());
|
||||||
|
editText_text_send_sms.setOnEditInputListener(content -> SettingUtil.smsHubApiUrl(content.trim()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//HttpServer
|
||||||
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchEnableHttpServer(Switch switch_enable_http_server) {
|
||||||
|
switch_enable_http_server.setChecked(SettingUtil.getSwitchEnableHttpServer());
|
||||||
|
|
||||||
|
switch_enable_http_server.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
SettingUtil.switchEnableHttpServer(isChecked);
|
||||||
|
Log.d(TAG, "switchEnableHttpServer:" + isChecked);
|
||||||
|
|
||||||
|
HttpUtil.init(this);
|
||||||
|
HttpServer.init(this);
|
||||||
|
HttpServer.update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//监听电池状态变化
|
||||||
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchBatteryReceiver(Switch switch_battery_receiver) {
|
||||||
|
switch_battery_receiver.setChecked(SettingUtil.getSwitchEnableBatteryReceiver());
|
||||||
|
|
||||||
|
switch_battery_receiver.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
//TODO:校验使用来电转发必备的权限
|
||||||
|
SettingUtil.switchEnableBatteryReceiver(isChecked);
|
||||||
|
Log.d(TAG, "switchEnablePhone:" + isChecked);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置低电量报警值下限
|
||||||
|
private void editBatteryLevelAlarmMin(final EditText et_battery_level_alarm) {
|
||||||
|
et_battery_level_alarm.setText(String.valueOf(SettingUtil.getBatteryLevelAlarmMin()));
|
||||||
|
|
||||||
|
et_battery_level_alarm.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
String batteryLevel = et_battery_level_alarm.getText().toString().trim();
|
||||||
|
if (!batteryLevel.isEmpty()) {
|
||||||
|
SettingUtil.setBatteryLevelAlarmMin(Integer.parseInt(batteryLevel));
|
||||||
|
} else {
|
||||||
|
SettingUtil.setBatteryLevelAlarmMin(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置低电量报警值上限
|
||||||
|
private void editBatteryLevelAlarmMax(final EditText et_battery_level_alarm) {
|
||||||
|
et_battery_level_alarm.setText(String.valueOf(SettingUtil.getBatteryLevelAlarmMax()));
|
||||||
|
|
||||||
|
et_battery_level_alarm.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
String batteryLevel = et_battery_level_alarm.getText().toString().trim();
|
||||||
|
if (!batteryLevel.isEmpty()) {
|
||||||
|
SettingUtil.setBatteryLevelAlarmMax(Integer.parseInt(batteryLevel));
|
||||||
|
} else {
|
||||||
|
SettingUtil.setBatteryLevelAlarmMax(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//开机启动
|
||||||
|
private void checkWithReboot(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch withrebootSwitch) {
|
||||||
|
//获取组件
|
||||||
|
final ComponentName cm = new ComponentName(this.getPackageName(), RebootBroadcastReceiver.class.getName());
|
||||||
|
|
||||||
|
final PackageManager pm = getPackageManager();
|
||||||
|
int state = pm.getComponentEnabledSetting(cm);
|
||||||
|
withrebootSwitch.setChecked(state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||||
|
&& state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER);
|
||||||
|
withrebootSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
int newState = isChecked ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||||
|
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
||||||
|
pm.setComponentEnabledSetting(cm, newState, PackageManager.DONT_KILL_APP);
|
||||||
|
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
||||||
|
|
||||||
|
if (isChecked) startToAutoStartSetting(this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//Intent跳转到[自启动]页面全网最全适配机型解决方案
|
||||||
|
private static final HashMap<String, List<String>> hashMap = new HashMap<>() {
|
||||||
|
{
|
||||||
|
put("Xiaomi", Arrays.asList(
|
||||||
|
"com.miui.securitycenter/com.miui.permcenter.autostart.AutoStartManagementActivity",//MIUI10_9.8.1(9.0)
|
||||||
|
"com.miui.securitycenter"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("samsung", Arrays.asList(
|
||||||
|
"com.samsung.android.sm_cn/com.samsung.android.sm.ui.ram.AutoRunActivity",
|
||||||
|
"com.samsung.android.sm_cn/com.samsung.android.sm.ui.appmanagement.AppManagementActivity",
|
||||||
|
"com.samsung.android.sm_cn/com.samsung.android.sm.ui.cstyleboard.SmartManagerDashBoardActivity",
|
||||||
|
"com.samsung.android.sm_cn/.ui.ram.RamActivity",
|
||||||
|
"com.samsung.android.sm_cn/.app.dashboard.SmartManagerDashBoardActivity",
|
||||||
|
|
||||||
|
"com.samsung.android.sm/com.samsung.android.sm.ui.ram.AutoRunActivity",
|
||||||
|
"com.samsung.android.sm/com.samsung.android.sm.ui.appmanagement.AppManagementActivity",
|
||||||
|
"com.samsung.android.sm/com.samsung.android.sm.ui.cstyleboard.SmartManagerDashBoardActivity",
|
||||||
|
"com.samsung.android.sm/.ui.ram.RamActivity",
|
||||||
|
"com.samsung.android.sm/.app.dashboard.SmartManagerDashBoardActivity",
|
||||||
|
|
||||||
|
"com.samsung.android.lool/com.samsung.android.sm.ui.battery.BatteryActivity",
|
||||||
|
"com.samsung.android.sm_cn",
|
||||||
|
"com.samsung.android.sm"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("HUAWEI", Arrays.asList(
|
||||||
|
"com.huawei.systemmanager/.startupmgr.ui.StartupNormalAppListActivity",//EMUI9.1.0(方舟,9.0)
|
||||||
|
"com.huawei.systemmanager/.appcontrol.activity.StartupAppControlActivity",
|
||||||
|
"com.huawei.systemmanager/.optimize.process.ProtectActivity",
|
||||||
|
"com.huawei.systemmanager/.optimize.bootstart.BootStartActivity",
|
||||||
|
"com.huawei.systemmanager"//最后一行可以写包名, 这样如果签名的类路径在某些新版本的ROM中没找到 就直接跳转到对应的安全中心/手机管家 首页.
|
||||||
|
));
|
||||||
|
|
||||||
|
put("vivo", Arrays.asList(
|
||||||
|
"com.iqoo.secure/.ui.phoneoptimize.BgStartUpManager",
|
||||||
|
"com.iqoo.secure/.safeguard.PurviewTabActivity",
|
||||||
|
"com.vivo.permissionmanager/.activity.BgStartUpManagerActivity",
|
||||||
|
//"com.iqoo.secure/.ui.phoneoptimize.AddWhiteListActivity", //这是白名单, 不是自启动
|
||||||
|
"com.iqoo.secure",
|
||||||
|
"com.vivo.permissionmanager"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("Meizu", Arrays.asList(
|
||||||
|
"com.meizu.safe/.permission.SmartBGActivity",//Flyme7.3.0(7.1.2)
|
||||||
|
"com.meizu.safe/.permission.PermissionMainActivity",//网上的
|
||||||
|
"com.meizu.safe"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("OPPO", Arrays.asList(
|
||||||
|
"com.coloros.safecenter/.startupapp.StartupAppListActivity",
|
||||||
|
"com.coloros.safecenter/.permission.startup.StartupAppListActivity",
|
||||||
|
"com.oppo.safe/.permission.startup.StartupAppListActivity",
|
||||||
|
"com.coloros.oppoguardelf/com.coloros.powermanager.fuelgaue.PowerUsageModelActivity",
|
||||||
|
"com.coloros.safecenter/com.coloros.privacypermissionsentry.PermissionTopActivity",
|
||||||
|
"com.coloros.safecenter",
|
||||||
|
"com.oppo.safe",
|
||||||
|
"com.coloros.oppoguardelf"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("oneplus", Arrays.asList(
|
||||||
|
"com.oneplus.security/.chainlaunch.view.ChainLaunchAppListActivity",
|
||||||
|
"com.oneplus.security"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("letv", Arrays.asList(
|
||||||
|
"com.letv.android.letvsafe/.AutobootManageActivity",
|
||||||
|
"com.letv.android.letvsafe/.BackgroundAppManageActivity",//应用保护
|
||||||
|
"com.letv.android.letvsafe"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("zte", Arrays.asList(
|
||||||
|
"com.zte.heartyservice/.autorun.AppAutoRunManager",
|
||||||
|
"com.zte.heartyservice"
|
||||||
|
));
|
||||||
|
|
||||||
|
//金立
|
||||||
|
put("F", Arrays.asList(
|
||||||
|
"com.gionee.softmanager/.MainActivity",
|
||||||
|
"com.gionee.softmanager"
|
||||||
|
));
|
||||||
|
|
||||||
|
//以下为未确定(厂商名也不确定)
|
||||||
|
put("smartisanos", Arrays.asList(
|
||||||
|
"com.smartisanos.security/.invokeHistory.InvokeHistoryActivity",
|
||||||
|
"com.smartisanos.security"
|
||||||
|
));
|
||||||
|
|
||||||
|
//360
|
||||||
|
put("360", Arrays.asList(
|
||||||
|
"com.yulong.android.coolsafe/.ui.activity.autorun.AutoRunListActivity",
|
||||||
|
"com.yulong.android.coolsafe"
|
||||||
|
));
|
||||||
|
|
||||||
|
//360
|
||||||
|
put("ulong", Arrays.asList(
|
||||||
|
"com.yulong.android.coolsafe/.ui.activity.autorun.AutoRunListActivity",
|
||||||
|
"com.yulong.android.coolsafe"
|
||||||
|
));
|
||||||
|
|
||||||
|
//酷派
|
||||||
|
put("coolpad"/*厂商名称不确定是否正确*/, Arrays.asList(
|
||||||
|
"com.yulong.android.security/com.yulong.android.seccenter.tabbarmain",
|
||||||
|
"com.yulong.android.security"
|
||||||
|
));
|
||||||
|
|
||||||
|
//联想
|
||||||
|
put("lenovo"/*厂商名称不确定是否正确*/, Arrays.asList(
|
||||||
|
"com.lenovo.security/.purebackground.PureBackgroundActivity",
|
||||||
|
"com.lenovo.security"
|
||||||
|
));
|
||||||
|
|
||||||
|
put("htc"/*厂商名称不确定是否正确*/, Arrays.asList(
|
||||||
|
"com.htc.pitroad/.landingpage.activity.LandingPageActivity",
|
||||||
|
"com.htc.pitroad"
|
||||||
|
));
|
||||||
|
|
||||||
|
//华硕
|
||||||
|
put("asus"/*厂商名称不确定是否正确*/, Arrays.asList(
|
||||||
|
"com.asus.mobilemanager/.MainActivity",
|
||||||
|
"com.asus.mobilemanager"
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//跳转自启动页面
|
||||||
|
public static void startToAutoStartSetting(Context context) {
|
||||||
|
Log.e("Util", "******************当前手机型号为:" + Build.MANUFACTURER);
|
||||||
|
|
||||||
|
Set<Map.Entry<String, List<String>>> entries = hashMap.entrySet();
|
||||||
|
boolean has = false;
|
||||||
|
for (Map.Entry<String, List<String>> entry : entries) {
|
||||||
|
String manufacturer = entry.getKey();
|
||||||
|
List<String> actCompatList = entry.getValue();
|
||||||
|
if (Build.MANUFACTURER.equalsIgnoreCase(manufacturer)) {
|
||||||
|
for (String act : actCompatList) {
|
||||||
|
try {
|
||||||
|
Intent intent;
|
||||||
|
if (act.contains("/")) {
|
||||||
|
intent = new Intent();
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
ComponentName componentName = ComponentName.unflattenFromString(act);
|
||||||
|
intent.setComponent(componentName);
|
||||||
|
} else {
|
||||||
|
//找不到? 网上的做法都是跳转到设置... 这基本上是没意义的 基本上自启动这个功能是第三方厂商自己写的安全管家类app
|
||||||
|
//所以我是直接跳转到对应的安全管家/安全中心
|
||||||
|
intent = context.getPackageManager().getLaunchIntentForPackage(act);
|
||||||
|
}
|
||||||
|
context.startActivity(intent);
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
Toast.makeText(context, "兼容方案", Toast.LENGTH_SHORT).show();
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||||
|
intent.setData(Uri.fromParts("package", context.getPackageName(), null));
|
||||||
|
context.startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Intent intent = new Intent(Settings.ACTION_SETTINGS);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//电池优化设置
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||||
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
public void batterySetting(Switch switch_battery_setting) {
|
||||||
|
isIgnoreBatteryOptimization = KeepAliveUtils.isIgnoreBatteryOptimization(this);
|
||||||
|
switch_battery_setting.setChecked(isIgnoreBatteryOptimization);
|
||||||
|
|
||||||
|
switch_battery_setting.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
if (isChecked && !isIgnoreBatteryOptimization) {
|
||||||
|
KeepAliveUtils.ignoreBatteryOptimization(this);
|
||||||
|
} else if (isChecked) {
|
||||||
|
Toast.makeText(this, R.string.isIgnored, Toast.LENGTH_SHORT).show();
|
||||||
|
switch_battery_setting.setChecked(isIgnoreBatteryOptimization);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, R.string.isIgnored2, Toast.LENGTH_SHORT).show();
|
||||||
|
switch_battery_setting.setChecked(isIgnoreBatteryOptimization);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//不在最近任务列表中显示
|
//不在最近任务列表中显示
|
||||||
@SuppressLint("ObsoleteSdkInt")
|
@SuppressLint("ObsoleteSdkInt,UseSwitchCompatOrMaterialCode")
|
||||||
private void switchExcludeFromRecents(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_exclude_from_recents) {
|
private void switchExcludeFromRecents(Switch switch_exclude_from_recents) {
|
||||||
switch_exclude_from_recents.setChecked(SettingUtil.getExcludeFromRecents());
|
switch_exclude_from_recents.setChecked(SettingUtil.getExcludeFromRecents());
|
||||||
|
|
||||||
switch_exclude_from_recents.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
switch_exclude_from_recents.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
@ -202,6 +567,61 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//是否开启失败重试
|
||||||
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchRetryDelay(Switch switch_retry_delay) {
|
||||||
|
switch_retry_delay.setChecked(SettingUtil.getSwitchRetryDelay());
|
||||||
|
|
||||||
|
switch_retry_delay.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
if (isChecked
|
||||||
|
&& SettingUtil.getRetryDelayTime(1) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(2) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(3) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(4) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(5) == 0) {
|
||||||
|
Toast.makeText(context, "所有间隔时间都为0,无法启用", Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchRetryDelay(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SettingUtil.switchRetryDelay(isChecked);
|
||||||
|
Log.d(TAG, "switchRetryDelay:" + isChecked);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//接口请求失败重试时间间隔
|
||||||
|
private void editRetryDelayTime(final EditText et_retry_delay_time, final int index) {
|
||||||
|
et_retry_delay_time.setText(String.valueOf(SettingUtil.getRetryDelayTime(index)));
|
||||||
|
|
||||||
|
et_retry_delay_time.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
String delayTime = et_retry_delay_time.getText().toString().trim();
|
||||||
|
if (!delayTime.isEmpty()) {
|
||||||
|
SettingUtil.setRetryDelayTime(index, Integer.parseInt(delayTime));
|
||||||
|
} else {
|
||||||
|
SettingUtil.setRetryDelayTime(index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SettingUtil.getRetryDelayTime(1) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(2) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(3) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(4) == 0
|
||||||
|
&& SettingUtil.getRetryDelayTime(5) == 0) {
|
||||||
|
Toast.makeText(context, "所有间隔时间都为0,自动禁用失败重试", Toast.LENGTH_SHORT).show();
|
||||||
|
SettingUtil.switchRetryDelay(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//设置设备名称
|
//设置设备名称
|
||||||
private void editAddExtraDeviceMark(final EditText et_add_extra_device_mark) {
|
private void editAddExtraDeviceMark(final EditText et_add_extra_device_mark) {
|
||||||
et_add_extra_device_mark.setText(SettingUtil.getAddExtraDeviceMark());
|
et_add_extra_device_mark.setText(SettingUtil.getAddExtraDeviceMark());
|
||||||
@ -262,83 +682,9 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置低电量报警值下限
|
|
||||||
private void editBatteryLevelAlarmMin(final EditText et_battery_level_alarm) {
|
|
||||||
et_battery_level_alarm.setText(String.valueOf(SettingUtil.getBatteryLevelAlarmMin()));
|
|
||||||
|
|
||||||
et_battery_level_alarm.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
String batteryLevel = et_battery_level_alarm.getText().toString().trim();
|
|
||||||
if (!batteryLevel.isEmpty()) {
|
|
||||||
SettingUtil.setBatteryLevelAlarmMin(Integer.parseInt(batteryLevel));
|
|
||||||
} else {
|
|
||||||
SettingUtil.setBatteryLevelAlarmMin(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置低电量报警值上限
|
|
||||||
private void editBatteryLevelAlarmMax(final EditText et_battery_level_alarm) {
|
|
||||||
et_battery_level_alarm.setText(String.valueOf(SettingUtil.getBatteryLevelAlarmMax()));
|
|
||||||
|
|
||||||
et_battery_level_alarm.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
String batteryLevel = et_battery_level_alarm.getText().toString().trim();
|
|
||||||
if (!batteryLevel.isEmpty()) {
|
|
||||||
SettingUtil.setBatteryLevelAlarmMax(Integer.parseInt(batteryLevel));
|
|
||||||
} else {
|
|
||||||
SettingUtil.setBatteryLevelAlarmMax(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//接口请求失败重试
|
|
||||||
private void editRetryDelayTime(final EditText et_retry_delay_time, final int index) {
|
|
||||||
et_retry_delay_time.setText(String.valueOf(SettingUtil.getRetryDelayTime(index)));
|
|
||||||
|
|
||||||
et_retry_delay_time.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
String delayTime = et_retry_delay_time.getText().toString().trim();
|
|
||||||
if (!delayTime.isEmpty()) {
|
|
||||||
SettingUtil.setRetryDelayTime(index, Integer.parseInt(delayTime));
|
|
||||||
} else {
|
|
||||||
SettingUtil.setRetryDelayTime(index, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置转发时启用自定义模版
|
//设置转发时启用自定义模版
|
||||||
private void switchSmsTemplate(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_sms_template) {
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
|
private void switchSmsTemplate(Switch switch_sms_template) {
|
||||||
boolean isOn = SettingUtil.getSwitchSmsTemplate();
|
boolean isOn = SettingUtil.getSwitchSmsTemplate();
|
||||||
switch_sms_template.setChecked(isOn);
|
switch_sms_template.setChecked(isOn);
|
||||||
|
|
||||||
@ -386,28 +732,38 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
textSmsTemplate.requestFocus();
|
textSmsTemplate.requestFocus();
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.bt_insert_sender:
|
case R.id.bt_insert_sender:
|
||||||
insertOrReplaceText2Cursor(textSmsTemplate, "{{来源号码}}");
|
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{来源号码}}");
|
||||||
return;
|
return;
|
||||||
case R.id.bt_insert_content:
|
case R.id.bt_insert_content:
|
||||||
insertOrReplaceText2Cursor(textSmsTemplate, "{{短信内容}}");
|
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{短信内容}}");
|
||||||
return;
|
return;
|
||||||
case R.id.bt_insert_extra:
|
case R.id.bt_insert_extra:
|
||||||
insertOrReplaceText2Cursor(textSmsTemplate, "{{卡槽信息}}");
|
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{卡槽信息}}");
|
||||||
return;
|
return;
|
||||||
case R.id.bt_insert_time:
|
case R.id.bt_insert_time:
|
||||||
insertOrReplaceText2Cursor(textSmsTemplate, "{{接收时间}}");
|
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{接收时间}}");
|
||||||
return;
|
return;
|
||||||
case R.id.bt_insert_device_name:
|
case R.id.bt_insert_device_name:
|
||||||
insertOrReplaceText2Cursor(textSmsTemplate, "{{设备名称}}");
|
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{设备名称}}");
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertOrReplaceText2Cursor(EditText editText, String str) {
|
//页面帮助提示
|
||||||
int start = Math.max(editText.getSelectionStart(), 0);
|
private void SwitchHelpTip(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switchHelpTip) {
|
||||||
int end = Math.max(editText.getSelectionEnd(), 0);
|
switchHelpTip.setChecked(MyApplication.showHelpTip);
|
||||||
editText.getText().replace(Math.min(start, end), Math.max(start, end), str, 0, str.length());
|
|
||||||
|
switchHelpTip.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
MyApplication.showHelpTip = isChecked;
|
||||||
|
SharedPreferences sp = context.getSharedPreferences(Define.SP_CONFIG, Context.MODE_PRIVATE);
|
||||||
|
sp.edit().putBoolean(Define.SP_CONFIG_SWITCH_HELP_TIP, isChecked).apply();
|
||||||
|
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
||||||
|
|
||||||
|
TextView help_tip = findViewById(R.id.help_tip);
|
||||||
|
ScrollView scrollView = findViewById(R.id.scrollView);
|
||||||
|
CommonUtil.calcMarginBottom(this, help_tip, null, null, scrollView);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//恢复初始化配置
|
//恢复初始化配置
|
||||||
@ -443,46 +799,4 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
builder.create().show();
|
builder.create().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
//电池优化设置
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
||||||
public void batterySetting(View view) {
|
|
||||||
if (KeepAliveUtils.isIgnoreBatteryOptimization(this)) {
|
|
||||||
Toast.makeText(this, R.string.isIgnored, Toast.LENGTH_SHORT).show();
|
|
||||||
} else {
|
|
||||||
KeepAliveUtils.ignoreBatteryOptimization(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求通知使用权限
|
|
||||||
*
|
|
||||||
* @param view 控件
|
|
||||||
*/
|
|
||||||
public void requestNotificationPermission(View view) {
|
|
||||||
if (!CommonUtil.isNotificationListenerServiceEnabled(this)) {
|
|
||||||
CommonUtil.openNotificationAccess(this);
|
|
||||||
} else {
|
|
||||||
Toast.makeText(this, R.string.notification_listener_service_enabled, Toast.LENGTH_SHORT).show();
|
|
||||||
CommonUtil.toggleNotificationListenerService(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
if (requestCode == CommonUtil.NOTIFICATION_REQUEST_CODE) {
|
|
||||||
if (CommonUtil.isNotificationListenerServiceEnabled(this)) {
|
|
||||||
Toast.makeText(this, R.string.notification_listener_service_enabled, Toast.LENGTH_SHORT).show();
|
|
||||||
CommonUtil.toggleNotificationListenerService(this);
|
|
||||||
SettingUtil.switchEnableAppNotify(true);
|
|
||||||
} else {
|
|
||||||
Toast.makeText(this, R.string.notification_listener_service_disabled, Toast.LENGTH_SHORT).show();
|
|
||||||
SettingUtil.switchEnableAppNotify(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_app_notify = findViewById(R.id.switch_enable_app_notify);
|
|
||||||
switch_enable_app_notify.setChecked(SettingUtil.getSwitchEnableAppNotify());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,7 @@ public class QYWXAppSettingVo implements Serializable {
|
|||||||
public boolean checkParms() {
|
public boolean checkParms() {
|
||||||
if (TextUtils.isEmpty(corpID)) return false;
|
if (TextUtils.isEmpty(corpID)) return false;
|
||||||
if (TextUtils.isEmpty(agentID)) return false;
|
if (TextUtils.isEmpty(agentID)) return false;
|
||||||
if (TextUtils.isEmpty(secret)) return false;
|
return !TextUtils.isEmpty(secret);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,12 @@ import com.idormy.sms.forwarder.model.PhoneBookEntity;
|
|||||||
import com.idormy.sms.forwarder.model.vo.SmsHubVo;
|
import com.idormy.sms.forwarder.model.vo.SmsHubVo;
|
||||||
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
||||||
import com.idormy.sms.forwarder.sender.SendUtil;
|
import com.idormy.sms.forwarder.sender.SendUtil;
|
||||||
import com.idormy.sms.forwarder.utils.*;
|
import com.idormy.sms.forwarder.utils.CommonUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.ContactHelper;
|
||||||
|
import com.idormy.sms.forwarder.utils.PhoneUtils;
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.SimUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.SmsHubActionHandler;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -72,8 +77,10 @@ public class PhoneStateReceiver extends BroadcastReceiver {
|
|||||||
CallInfo callInfo = PhoneUtils.getLastCallInfo(phoneNumber);
|
CallInfo callInfo = PhoneUtils.getLastCallInfo(phoneNumber);
|
||||||
if (callInfo == null) return;
|
if (callInfo == null) return;
|
||||||
|
|
||||||
if (callInfo.getType() != 3) {
|
if ((callInfo.getType() == 1 && !SettingUtil.getSwitchCallType1())
|
||||||
Log.d(TAG, "非未接来电不处理!");
|
|| (callInfo.getType() == 2 && !SettingUtil.getSwitchCallType2())
|
||||||
|
|| (callInfo.getType() == 3 && !SettingUtil.getSwitchCallType3())) {
|
||||||
|
Log.d(TAG, "未启用该类型的通话记录转发,不做处理!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,9 +18,6 @@ public class SimStateReceiver extends BroadcastReceiver {
|
|||||||
/**
|
/**
|
||||||
* 更换SIM卡,如果不杀后台并重启,则发送出的「卡槽信息」仍然是刚启动应用时读取的SIM卡
|
* 更换SIM卡,如果不杀后台并重启,则发送出的「卡槽信息」仍然是刚启动应用时读取的SIM卡
|
||||||
* 增加这个Receiver,接收SIM卡插拔状态广播,自动更新缓存
|
* 增加这个Receiver,接收SIM卡插拔状态广播,自动更新缓存
|
||||||
*
|
|
||||||
* @param context
|
|
||||||
* @param intent
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
@ -50,8 +50,10 @@ public class HttpServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized static boolean update() {
|
public synchronized static boolean update() {
|
||||||
if (!asRunning() && NetUtil.NETWORK_WIFI != NetUtil.getNetWorkStatus()) {
|
//非WiFi网络下不可启用
|
||||||
|
if (NetUtil.NETWORK_WIFI != NetUtil.getNetWorkStatus()) {
|
||||||
Toast.makeText(context, R.string.no_wifi_network, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.no_wifi_network, Toast.LENGTH_SHORT).show();
|
||||||
|
if (asRunning()) stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
long l = System.currentTimeMillis();
|
long l = System.currentTimeMillis();
|
||||||
@ -67,12 +69,11 @@ public class HttpServer {
|
|||||||
start();
|
start();
|
||||||
ts = System.currentTimeMillis();
|
ts = System.currentTimeMillis();
|
||||||
Toast.makeText(context, R.string.server_has_started, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.server_has_started, Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
stop();
|
stop();
|
||||||
Toast.makeText(context, R.string.server_has_stopped, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.server_has_stopped, Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,6 +43,7 @@ import java.text.ParseException;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class SendUtil {
|
public class SendUtil {
|
||||||
private static final String TAG = "SendUtil";
|
private static final String TAG = "SendUtil";
|
||||||
@ -93,7 +94,7 @@ public class SendUtil {
|
|||||||
*/
|
*/
|
||||||
public static void resendMsgByLog(Context context, Handler handler, LogVo logVo) {
|
public static void resendMsgByLog(Context context, Handler handler, LogVo logVo) {
|
||||||
Log.d(TAG, logVo.toString());
|
Log.d(TAG, logVo.toString());
|
||||||
@SuppressLint("SimpleDateFormat") SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
@SuppressLint("SimpleDateFormat") SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
try {
|
try {
|
||||||
date = sdf.parse(logVo.getTime());
|
date = sdf.parse(logVo.getTime());
|
||||||
|
@ -15,6 +15,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -32,7 +33,6 @@ import okhttp3.Request;
|
|||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
@SuppressWarnings("ALL")
|
|
||||||
public class SenderFeishuMsg extends SenderBaseMsg {
|
public class SenderFeishuMsg extends SenderBaseMsg {
|
||||||
|
|
||||||
static final String TAG = "SenderFeishuMsg";
|
static final String TAG = "SenderFeishuMsg";
|
||||||
@ -90,6 +90,7 @@ public class SenderFeishuMsg extends SenderBaseMsg {
|
|||||||
" }\n" +
|
" }\n" +
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
public static void sendMsg(final long logId, final Handler handError, String webhook, String secret, String from, Date date, String content) throws Exception {
|
public static void sendMsg(final long logId, final Handler handError, String webhook, String secret, String from, Date date, String content) throws Exception {
|
||||||
Log.i(TAG, "sendMsg webhook:" + webhook + " secret:" + secret + " content:" + content);
|
Log.i(TAG, "sendMsg webhook:" + webhook + " secret:" + secret + " content:" + content);
|
||||||
|
|
||||||
@ -130,7 +131,7 @@ public class SenderFeishuMsg extends SenderBaseMsg {
|
|||||||
Toast(handError, TAG, "开始请求接口...");
|
Toast(handError, TAG, "开始请求接口...");
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;charset=utf-8"), requestMsg);
|
@SuppressWarnings("deprecation") RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;charset=utf-8"), requestMsg);
|
||||||
|
|
||||||
final Request request = new Request.Builder()
|
final Request request = new Request.Builder()
|
||||||
.url(requestUrl)
|
.url(requestUrl)
|
||||||
@ -178,7 +179,7 @@ public class SenderFeishuMsg extends SenderBaseMsg {
|
|||||||
|
|
||||||
private static String buildMsg(String from, Date date, String content) {
|
private static String buildMsg(String from, Date date, String content) {
|
||||||
String msgTitle = jsonInnerStr("【" + SettingUtil.getAddExtraDeviceMark().trim() + "】来自" + from + "的通知");
|
String msgTitle = jsonInnerStr("【" + SettingUtil.getAddExtraDeviceMark().trim() + "】来自" + from + "的通知");
|
||||||
String msgTime = jsonInnerStr(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));
|
String msgTime = jsonInnerStr(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).format(date));
|
||||||
String msgFrom = jsonInnerStr(from);
|
String msgFrom = jsonInnerStr(from);
|
||||||
String msgContent = jsonInnerStr(content);
|
String msgContent = jsonInnerStr(content);
|
||||||
return MSG_TEMPLATE.replace("${MSG_TITLE}", msgTitle)
|
return MSG_TEMPLATE.replace("${MSG_TITLE}", msgTitle)
|
||||||
|
@ -23,7 +23,7 @@ import okhttp3.Request;
|
|||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
@SuppressWarnings({"ResultOfMethodCallIgnored", "rawtypes", "unchecked", "deprecation"})
|
@SuppressWarnings({"ResultOfMethodCallIgnored"})
|
||||||
public class SenderGotifyMsg extends SenderBaseMsg {
|
public class SenderGotifyMsg extends SenderBaseMsg {
|
||||||
|
|
||||||
static final String TAG = "SenderGotifyMsg";
|
static final String TAG = "SenderGotifyMsg";
|
||||||
@ -68,7 +68,7 @@ public class SenderGotifyMsg extends SenderBaseMsg {
|
|||||||
Toast(handError, TAG, "发送状态:" + responseStr);
|
Toast(handError, TAG, "发送状态:" + responseStr);
|
||||||
|
|
||||||
//TODO:粗略解析是否发送成功
|
//TODO:粗略解析是否发送成功
|
||||||
if ("200".equals(response.code())) {
|
if (response.code() == 200) {
|
||||||
LogUtil.updateLog(logId, 2, responseStr);
|
LogUtil.updateLog(logId, 2, responseStr);
|
||||||
} else {
|
} else {
|
||||||
LogUtil.updateLog(logId, 0, responseStr);
|
LogUtil.updateLog(logId, 0, responseStr);
|
||||||
|
@ -113,7 +113,7 @@ public class AnimationUtils {
|
|||||||
}
|
}
|
||||||
viewGroup.setVisibility(View.GONE);
|
viewGroup.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
Animation translateAnimation = null;
|
Animation translateAnimation;
|
||||||
translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
|
translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
|
||||||
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
|
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
|
||||||
start, Animation.RELATIVE_TO_SELF, end);
|
start, Animation.RELATIVE_TO_SELF, end);
|
||||||
@ -150,7 +150,7 @@ public class AnimationUtils {
|
|||||||
end = -1.0f;
|
end = -1.0f;
|
||||||
viewGroup.setVisibility(View.GONE);
|
viewGroup.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
Animation translateAnimation = null;
|
Animation translateAnimation;
|
||||||
translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, start,
|
translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, start,
|
||||||
Animation.RELATIVE_TO_SELF, end, Animation.RELATIVE_TO_SELF,
|
Animation.RELATIVE_TO_SELF, end, Animation.RELATIVE_TO_SELF,
|
||||||
0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
|
0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
|
||||||
@ -177,13 +177,7 @@ public class AnimationUtils {
|
|||||||
translateAnimation.start();
|
translateAnimation.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//通知滚动
|
||||||
* 礼物通知滚动
|
|
||||||
*
|
|
||||||
* @param viewGroup
|
|
||||||
* @param state
|
|
||||||
* @param duration
|
|
||||||
*/
|
|
||||||
public static void liveLotteryAnimation(final TextView viewGroup, AnimationState state, long duration) {
|
public static void liveLotteryAnimation(final TextView viewGroup, AnimationState state, long duration) {
|
||||||
|
|
||||||
float start = 0.0f;
|
float start = 0.0f;
|
||||||
@ -196,7 +190,7 @@ public class AnimationUtils {
|
|||||||
end = -1.0f;
|
end = -1.0f;
|
||||||
viewGroup.setVisibility(View.GONE);
|
viewGroup.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
Animation translateAnimation = null;
|
Animation translateAnimation;
|
||||||
translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, start,
|
translateAnimation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, start,
|
||||||
Animation.RELATIVE_TO_PARENT, end, Animation.RELATIVE_TO_SELF,
|
Animation.RELATIVE_TO_PARENT, end, Animation.RELATIVE_TO_SELF,
|
||||||
0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
|
0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
|
||||||
|
@ -9,11 +9,18 @@ import android.content.Intent;
|
|||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.ScrollView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
import com.idormy.sms.forwarder.MyApplication;
|
||||||
import com.idormy.sms.forwarder.service.NotifyService;
|
import com.idormy.sms.forwarder.service.NotifyService;
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
@ -136,10 +143,7 @@ public class CommonUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//屏幕像素转换
|
||||||
* @date 2020/12/28 9:52
|
|
||||||
* @description 屏幕像素转换
|
|
||||||
*/
|
|
||||||
public static int dp2px(Context context, float dipValue) {
|
public static int dp2px(Context context, float dipValue) {
|
||||||
final float scale = context.getResources().getDisplayMetrics().density;
|
final float scale = context.getResources().getDisplayMetrics().density;
|
||||||
return (int) (dipValue * scale + 0.5f);
|
return (int) (dipValue * scale + 0.5f);
|
||||||
@ -152,8 +156,7 @@ public class CommonUtil {
|
|||||||
String regex = "(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\'\\/\\\\&%\\+\\$#_=]*)?";
|
String regex = "(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\'\\/\\\\&%\\+\\$#_=]*)?";
|
||||||
Pattern pat = Pattern.compile(regex);
|
Pattern pat = Pattern.compile(regex);
|
||||||
Matcher mat = pat.matcher(urls.trim());
|
Matcher mat = pat.matcher(urls.trim());
|
||||||
boolean result = mat.matches();
|
return mat.matches();
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//焦点位置插入文本
|
//焦点位置插入文本
|
||||||
@ -162,4 +165,31 @@ public class CommonUtil {
|
|||||||
int end = Math.max(editText.getSelectionEnd(), 0);
|
int end = Math.max(editText.getSelectionEnd(), 0);
|
||||||
editText.getText().replace(Math.min(start, end), Math.max(start, end), str, 0, str.length());
|
editText.getText().replace(Math.min(start, end), Math.max(start, end), str, 0, str.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//计算浮动按钮位置
|
||||||
|
public static void calcMarginBottom(Context context, TextView help_tip, FloatingActionButton btnFloat, ListView viewList, ScrollView scrollView) {
|
||||||
|
|
||||||
|
if (help_tip != null) {
|
||||||
|
help_tip.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
int marginBottom = MyApplication.showHelpTip ? 85 : 65;
|
||||||
|
if (btnFloat != null) {
|
||||||
|
RelativeLayout.LayoutParams btnLayoutParams = (RelativeLayout.LayoutParams) btnFloat.getLayoutParams();
|
||||||
|
btnLayoutParams.bottomMargin = dp2px(context, marginBottom + 10);
|
||||||
|
btnFloat.setLayoutParams(btnLayoutParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewList != null) {
|
||||||
|
RelativeLayout.LayoutParams listLayoutParams = (RelativeLayout.LayoutParams) viewList.getLayoutParams();
|
||||||
|
listLayoutParams.bottomMargin = dp2px(context, marginBottom);
|
||||||
|
viewList.setLayoutParams(listLayoutParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scrollView != null) {
|
||||||
|
RelativeLayout.LayoutParams listLayoutParams = (RelativeLayout.LayoutParams) scrollView.getLayoutParams();
|
||||||
|
listLayoutParams.bottomMargin = dp2px(context, marginBottom);
|
||||||
|
scrollView.setLayoutParams(listLayoutParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ public class Define {
|
|||||||
public static final String SP_MSG_KEY_STRING_BATTERY_LEVEL_CURRENT = "tsms_msg_key_string_battery_level_current";
|
public static final String SP_MSG_KEY_STRING_BATTERY_LEVEL_CURRENT = "tsms_msg_key_string_battery_level_current";
|
||||||
public static final String SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM = "tsms_msg_key_string_battery_level_alarm";
|
public static final String SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM = "tsms_msg_key_string_battery_level_alarm";
|
||||||
public static final String SP_MSG_KEY_STRING_BATTERY_LEVEL_MAX = "tsms_msg_key_string_battery_level_max";
|
public static final String SP_MSG_KEY_STRING_BATTERY_LEVEL_MAX = "tsms_msg_key_string_battery_level_max";
|
||||||
|
public static final String SP_MSG_KEY_STRING_ENABLE_RETRY_DELAY = "tsms_msg_key_switch_retry_delay";
|
||||||
public static final String SP_MSG_KEY_STRING_RETRY_DELAY_TIME1 = "tsms_msg_key_string_retry_delay_time1";
|
public static final String SP_MSG_KEY_STRING_RETRY_DELAY_TIME1 = "tsms_msg_key_string_retry_delay_time1";
|
||||||
public static final String SP_MSG_KEY_STRING_RETRY_DELAY_TIME2 = "tsms_msg_key_string_retry_delay_time2";
|
public static final String SP_MSG_KEY_STRING_RETRY_DELAY_TIME2 = "tsms_msg_key_string_retry_delay_time2";
|
||||||
public static final String SP_MSG_KEY_STRING_RETRY_DELAY_TIME3 = "tsms_msg_key_string_retry_delay_time3";
|
public static final String SP_MSG_KEY_STRING_RETRY_DELAY_TIME3 = "tsms_msg_key_string_retry_delay_time3";
|
||||||
@ -29,6 +30,9 @@ public class Define {
|
|||||||
public static final String SP_MSG_KEY_STRING_ENABLE_SMSHUB_API = "tsms_msg_key_string_enable_smshub_api";
|
public static final String SP_MSG_KEY_STRING_ENABLE_SMSHUB_API = "tsms_msg_key_string_enable_smshub_api";
|
||||||
public static final String SP_MSG_KEY_STRING_SMSHUB_API_URL = "tsms_msg_key_string_smshub_api_url";
|
public static final String SP_MSG_KEY_STRING_SMSHUB_API_URL = "tsms_msg_key_string_smshub_api_url";
|
||||||
public static final String SP_MSG_KEY_STRING_ENABLE_HTTP_SERVER = "tsms_msg_key_string_enable_http_server";
|
public static final String SP_MSG_KEY_STRING_ENABLE_HTTP_SERVER = "tsms_msg_key_string_enable_http_server";
|
||||||
|
public static final String SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_1 = "tsms_msg_key_string_enable_call_type_1";
|
||||||
|
public static final String SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_2 = "tsms_msg_key_string_enable_call_type_2";
|
||||||
|
public static final String SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_3 = "tsms_msg_key_string_enable_call_type_3";
|
||||||
|
|
||||||
public static final String SP_MSG = "forwarder_msg";
|
public static final String SP_MSG = "forwarder_msg";
|
||||||
public static final String SP_MSG_SET_KEY = "forwarder_msg_set_key";
|
public static final String SP_MSG_SET_KEY = "forwarder_msg_set_key";
|
||||||
|
@ -21,16 +21,13 @@ public class SettingUtil {
|
|||||||
if (hasInit) return;
|
if (hasInit) return;
|
||||||
hasInit = true;
|
hasInit = true;
|
||||||
context = context1;
|
context = context1;
|
||||||
Log.d(TAG, "init ");
|
Log.d(TAG, "SettingUtil 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);
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, switchAddExtra).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, switchAddExtra)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchAddExtra() {
|
public static boolean getSwitchAddExtra() {
|
||||||
@ -38,10 +35,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchAddDeviceName(Boolean switchAddDeviceName) {
|
public static void switchAddDeviceName(Boolean switchAddDeviceName) {
|
||||||
Log.d(TAG, "switchAddDeviceName :" + switchAddDeviceName);
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_NAME, switchAddDeviceName).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_NAME, switchAddDeviceName)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchAddDeviceName() {
|
public static boolean getSwitchAddDeviceName() {
|
||||||
@ -49,9 +43,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchEnableSms(Boolean enable) {
|
public static void switchEnableSms(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_SMS, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_SMS, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnableSms() {
|
public static boolean getSwitchEnableSms() {
|
||||||
@ -59,9 +51,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_PHONE, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnablePhone() {
|
public static boolean getSwitchEnablePhone() {
|
||||||
@ -69,9 +59,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchEnableAppNotify(Boolean enable) {
|
public static void switchEnableAppNotify(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_APP_NOTIFY, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_APP_NOTIFY, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnableAppNotify() {
|
public static boolean getSwitchEnableAppNotify() {
|
||||||
@ -79,9 +67,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchCancelAppNotify(Boolean enable) {
|
public static void switchCancelAppNotify(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_CANCEL_APP_NOTIFY, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_CANCEL_APP_NOTIFY, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchCancelAppNotify() {
|
public static boolean getSwitchCancelAppNotify() {
|
||||||
@ -89,9 +75,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchEnableBatteryReceiver(Boolean enable) {
|
public static void switchEnableBatteryReceiver(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_BATTERY_RECEIVER, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_BATTERY_RECEIVER, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnableBatteryReceiver() {
|
public static boolean getSwitchEnableBatteryReceiver() {
|
||||||
@ -99,9 +83,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchExcludeFromRecents(Boolean enable) {
|
public static void switchExcludeFromRecents(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_EXCLUDE_FROM_RECENTS, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_EXCLUDE_FROM_RECENTS, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getExcludeFromRecents() {
|
public static boolean getExcludeFromRecents() {
|
||||||
@ -109,10 +91,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchSmsTemplate(Boolean switchSmsTemplate) {
|
public static void switchSmsTemplate(Boolean switchSmsTemplate) {
|
||||||
Log.d(TAG, "switchSmsTemplate :" + switchSmsTemplate);
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, switchSmsTemplate).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, switchSmsTemplate)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchSmsTemplate() {
|
public static boolean getSwitchSmsTemplate() {
|
||||||
@ -128,10 +107,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setAddExtraDeviceMark(String addExtraDeviceMark) {
|
public static void setAddExtraDeviceMark(String addExtraDeviceMark) {
|
||||||
Log.d(TAG, "addExtraDeviceMark :" + addExtraDeviceMark);
|
sp_setting.edit().putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, addExtraDeviceMark).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, addExtraDeviceMark)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getSmsTemplate() {
|
public static String getSmsTemplate() {
|
||||||
@ -139,10 +115,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setSmsTemplate(String textSmsTemplate) {
|
public static void setSmsTemplate(String textSmsTemplate) {
|
||||||
Log.d(TAG, "textSmsTemplate :" + textSmsTemplate);
|
sp_setting.edit().putString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, textSmsTemplate).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, textSmsTemplate)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getAddExtraSim1() {
|
public static String getAddExtraSim1() {
|
||||||
@ -154,10 +127,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setAddExtraSim1(String sim1) {
|
public static void setAddExtraSim1(String sim1) {
|
||||||
Log.d(TAG, "sim1 :" + sim1);
|
sp_setting.edit().putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, sim1).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, sim1)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getAddExtraSim2() {
|
public static String getAddExtraSim2() {
|
||||||
@ -169,10 +139,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setAddExtraSim2(String sim2) {
|
public static void setAddExtraSim2(String sim2) {
|
||||||
Log.d(TAG, "sim2 :" + sim2);
|
sp_setting.edit().putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM2, sim2).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM2, sim2)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBatteryLevelAlarmMin() {
|
public static int getBatteryLevelAlarmMin() {
|
||||||
@ -180,10 +147,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setBatteryLevelAlarmMin(int battery_level) {
|
public static void setBatteryLevelAlarmMin(int battery_level) {
|
||||||
Log.d(TAG, "battery_level :" + battery_level);
|
sp_setting.edit().putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM, battery_level).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_ALARM, battery_level)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBatteryLevelAlarmMax() {
|
public static int getBatteryLevelAlarmMax() {
|
||||||
@ -191,10 +155,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setBatteryLevelAlarmMax(int battery_level) {
|
public static void setBatteryLevelAlarmMax(int battery_level) {
|
||||||
Log.d(TAG, "battery_level :" + battery_level);
|
sp_setting.edit().putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_MAX, battery_level).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_MAX, battery_level)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBatteryLevelCurrent() {
|
public static int getBatteryLevelCurrent() {
|
||||||
@ -202,10 +163,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setBatteryLevelCurrent(int battery_level) {
|
public static void setBatteryLevelCurrent(int battery_level) {
|
||||||
Log.d(TAG, "battery_level :" + battery_level);
|
sp_setting.edit().putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_CURRENT, battery_level).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putInt(Define.SP_MSG_KEY_STRING_BATTERY_LEVEL_CURRENT, battery_level)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBatteryStatus() {
|
public static int getBatteryStatus() {
|
||||||
@ -213,10 +171,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setBatteryStatus(int battery_status) {
|
public static void setBatteryStatus(int battery_status) {
|
||||||
Log.d(TAG, "battery_status :" + battery_status);
|
sp_setting.edit().putInt(Define.SP_MSG_KEY_STRING_BATTERY_STATUS, battery_status).apply();
|
||||||
sp_setting.edit()
|
|
||||||
.putInt(Define.SP_MSG_KEY_STRING_BATTERY_STATUS, battery_status)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean saveMsgHistory() {
|
public static boolean saveMsgHistory() {
|
||||||
@ -260,9 +215,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchEnableSmsHubApi(Boolean enable) {
|
public static void switchEnableSmsHubApi(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_SMSHUB_API, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_SMSHUB_API, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnableSmsHubApi() {
|
public static boolean getSwitchEnableSmsHubApi() {
|
||||||
@ -270,9 +223,7 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void switchEnableHttpServer(Boolean enable) {
|
public static void switchEnableHttpServer(Boolean enable) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_HTTP_SERVER, enable).apply();
|
||||||
.putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_HTTP_SERVER, enable)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getSwitchEnableHttpServer() {
|
public static boolean getSwitchEnableHttpServer() {
|
||||||
@ -280,15 +231,45 @@ public class SettingUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void smsHubApiUrl(String url) {
|
public static void smsHubApiUrl(String url) {
|
||||||
sp_setting.edit()
|
sp_setting.edit().putString(Define.SP_MSG_KEY_STRING_SMSHUB_API_URL, url).apply();
|
||||||
.putString(Define.SP_MSG_KEY_STRING_SMSHUB_API_URL, url)
|
|
||||||
.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getSmsHubApiUrl() {
|
public static String getSmsHubApiUrl() {
|
||||||
return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMSHUB_API_URL, "http://xxx.com/send_api");
|
return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMSHUB_API_URL, "http://xxx.com/send_api");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void switchRetryDelay(Boolean switchSmsTemplate) {
|
||||||
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_RETRY_DELAY, switchSmsTemplate).apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getSwitchRetryDelay() {
|
||||||
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_RETRY_DELAY, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void switchCallType1(Boolean switchCallType) {
|
||||||
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_1, switchCallType).apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getSwitchCallType1() {
|
||||||
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void switchCallType2(Boolean switchCallType) {
|
||||||
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_2, switchCallType).apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getSwitchCallType2() {
|
||||||
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_2, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void switchCallType3(Boolean switchCallType) {
|
||||||
|
sp_setting.edit().putBoolean(Define.SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_3, switchCallType).apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getSwitchCallType3() {
|
||||||
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_STRING_ENABLE_CALL_TYPE_3, true);
|
||||||
|
}
|
||||||
|
|
||||||
//获取当前版本名称
|
//获取当前版本名称
|
||||||
public static String getVersionName() {
|
public static String getVersionName() {
|
||||||
// 获取PackageManager的实例
|
// 获取PackageManager的实例
|
||||||
|
@ -5,13 +5,14 @@ import android.annotation.SuppressLint;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class TimeUtil {
|
public class TimeUtil {
|
||||||
|
|
||||||
//友好时间显示
|
//友好时间显示
|
||||||
public static String friendlyTime(String utcTime) {
|
public static String friendlyTime(String utcTime) {
|
||||||
@SuppressLint("SimpleDateFormat") SimpleDateFormat utcFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
@SuppressLint("SimpleDateFormat") SimpleDateFormat utcFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||||
utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));//时区定义并进行时间获取
|
utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));//时区定义并进行时间获取
|
||||||
Date utcDate;
|
Date utcDate;
|
||||||
try {
|
try {
|
||||||
|
85
app/src/main/java/com/idormy/sms/forwarder/view/StepBar.java
Normal file
85
app/src/main/java/com/idormy/sms/forwarder/view/StepBar.java
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
package com.idormy.sms.forwarder.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.idormy.sms.forwarder.MainActivity;
|
||||||
|
import com.idormy.sms.forwarder.R;
|
||||||
|
import com.idormy.sms.forwarder.RuleActivity;
|
||||||
|
import com.idormy.sms.forwarder.SenderActivity;
|
||||||
|
import com.idormy.sms.forwarder.SettingActivity;
|
||||||
|
|
||||||
|
public class StepBar extends LinearLayout {
|
||||||
|
//控件
|
||||||
|
private final TextView txStep1;
|
||||||
|
private final TextView txStep2;
|
||||||
|
private final TextView txStep3;
|
||||||
|
private final TextView txStep4;
|
||||||
|
private final TextView tvStep1;
|
||||||
|
private final TextView tvStep2;
|
||||||
|
private final TextView tvStep3;
|
||||||
|
private final TextView tvStep4;
|
||||||
|
|
||||||
|
public StepBar(final Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
//初始化界面
|
||||||
|
View view = LayoutInflater.from(context).inflate(R.layout.step_bar, this);
|
||||||
|
//绑定
|
||||||
|
txStep1 = findViewById(R.id.txStep1);
|
||||||
|
txStep2 = findViewById(R.id.txStep2);
|
||||||
|
txStep3 = findViewById(R.id.txStep3);
|
||||||
|
txStep4 = findViewById(R.id.txStep4);
|
||||||
|
tvStep1 = findViewById(R.id.tvStep1);
|
||||||
|
tvStep2 = findViewById(R.id.tvStep2);
|
||||||
|
tvStep3 = findViewById(R.id.tvStep3);
|
||||||
|
tvStep4 = findViewById(R.id.tvStep4);
|
||||||
|
//初始化函数
|
||||||
|
init(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(final Context context) {
|
||||||
|
|
||||||
|
tvStep1.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SettingActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep1.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SettingActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
tvStep2.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SenderActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep2.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), SenderActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
tvStep3.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), RuleActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep3.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), RuleActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
tvStep4.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), MainActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
txStep4.setOnClickListener(v -> {
|
||||||
|
Intent intent = new Intent(v.getContext(), MainActivity.class);
|
||||||
|
v.getContext().startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,10 +0,0 @@
|
|||||||
<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="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
|
||||||
</vector>
|
|
@ -3,7 +3,7 @@
|
|||||||
<!-- 连框颜色值 -->
|
<!-- 连框颜色值 -->
|
||||||
<item>
|
<item>
|
||||||
<shape>
|
<shape>
|
||||||
<corners android:radius="0dp"></corners>
|
<corners android:radius="0dp" />
|
||||||
<solid android:color="#757575" />
|
<solid android:color="#757575" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
@ -14,7 +14,7 @@
|
|||||||
android:right="0dp"
|
android:right="0dp"
|
||||||
android:top="0dp">
|
android:top="0dp">
|
||||||
<shape>
|
<shape>
|
||||||
<corners android:radius="0dp"></corners>
|
<corners android:radius="0dp" />
|
||||||
<solid android:color="@color/white" />
|
<solid android:color="@color/white" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
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">
|
||||||
|
|
||||||
@ -46,59 +45,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="15dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:text="@string/auto_startup" />
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/switch_with_reboot"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textSize="18sp"
|
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/help_tip"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="15dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:text="@string/show_tips" />
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/switch_help_tip"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textSize="18sp"
|
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/btnTypeUser"
|
android:id="@+id/btnTypeUser"
|
||||||
style="@style/select_style"
|
style="@style/select_style"
|
||||||
|
android:checked="true"
|
||||||
android:tag="user"
|
android:tag="user"
|
||||||
android:text="@string/user_app"
|
android:text="@string/user_app" />
|
||||||
android:checked="true" />
|
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/btnTypeSys"
|
android:id="@+id/btnTypeSys"
|
||||||
@ -35,9 +35,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:background="#aadcdcdc" />
|
android:background="#aadcdcdc" />
|
||||||
|
|
||||||
@ -46,8 +46,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
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"
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
android:weightSum="1">
|
android:weightSum="1">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -47,13 +47,13 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/server_ip"
|
||||||
android:text="@string/server_ip" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<com.idormy.sms.forwarder.view.IPEditText
|
<com.idormy.sms.forwarder.view.IPEditText
|
||||||
android:id="@+id/textServerIp"
|
android:id="@+id/textServerIp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
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">
|
||||||
|
|
||||||
@ -15,11 +14,11 @@
|
|||||||
android:layout_marginBottom="90dp"
|
android:layout_marginBottom="90dp"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:contentDescription="@string/clean_log"
|
android:contentDescription="@string/clean_log"
|
||||||
android:onClick="cleanLog"
|
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_delete"
|
android:src="@drawable/ic_delete"
|
||||||
app:elevation="8dp"
|
app:borderWidth="0dp"
|
||||||
tools:ignore="UsingOnClickInXml" />
|
app:elevation="5dp"
|
||||||
|
app:fabSize="mini" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/radioGroup"
|
android:id="@+id/radioGroup"
|
||||||
@ -68,7 +67,7 @@
|
|||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_marginBottom="25dp" />
|
android:layout_marginBottom="85dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -81,254 +80,16 @@
|
|||||||
android:id="@+id/help_tip"
|
android:id="@+id/help_tip"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#10000000"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:padding="2dp"
|
||||||
android:text="@string/log_tips"
|
android:text="@string/log_tips"
|
||||||
android:textColor="@color/colorPrimary" />
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<View
|
<com.idormy.sms.forwarder.view.StepBar
|
||||||
android:id="@+id/radioGroupLine"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="wrap_content" />
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:background="#aadcdcdc" />
|
|
||||||
|
|
||||||
<!--<com.shuhart.stepview.StepView
|
|
||||||
android:id="@+id/step_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="5dp"
|
|
||||||
app:sv_selectedCircleColor="@color/colorPrimary"
|
|
||||||
app:sv_selectedTextColor="@color/colorPrimary"
|
|
||||||
app:sv_stepLineWidth="2dp"
|
|
||||||
app:sv_stepPadding="2dp"
|
|
||||||
app:sv_nextTextColor="@color/gray"
|
|
||||||
app:sv_nextStepLineColor="@color/gray"
|
|
||||||
app:sv_nextStepCircleEnabled="true"
|
|
||||||
app:sv_nextStepCircleColor="@color/gray"
|
|
||||||
app:sv_doneCircleColor="@color/colorPrimary"
|
|
||||||
app:sv_doneStepLineColor="@color/colorPrimary"
|
|
||||||
app:sv_doneCircleRadius="15dp"
|
|
||||||
app:sv_selectedCircleRadius="15dp"
|
|
||||||
app:sv_selectedStepNumberColor="@color/white"
|
|
||||||
app:sv_stepViewStyle="@style/StepView"
|
|
||||||
app:sv_doneStepMarkColor="@color/colorPrimaryDark"
|
|
||||||
app:sv_stepNumberTextSize="15sp"
|
|
||||||
app:sv_animationType="Line" />-->
|
|
||||||
|
|
||||||
<!--<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<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="cleanLog"
|
|
||||||
android:text="@string/bt_refresh_log"
|
|
||||||
tools:ignore="ButtonStyle,NestedWeights,UsingOnClickInXml" />
|
|
||||||
|
|
||||||
<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,UsingOnClickInXml" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="35dp"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:onClick="toSendSetting"
|
|
||||||
android:text="@string/sender_setting"
|
|
||||||
tools:ignore="ButtonStyle,UsingOnClickInXml" />
|
|
||||||
</LinearLayout>-->
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/step_circle_current"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/_1"
|
|
||||||
android:textColor="#fff"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/step_rectangle_current"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:src="@drawable/step_rectangle_current"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/step_rectangle_current"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/step_circle_current"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/_2"
|
|
||||||
android:textColor="#fff"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/step_rectangle_normal"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:src="@drawable/step_rectangle_normal"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/step_rectangle_normal"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/step_circle_normal"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/_3"
|
|
||||||
android:textColor="#fff"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/step_rectangle_normal"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:src="@drawable/step_rectangle_normal"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="4dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/step_rectangle_normal"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/step_circle_normal"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/_4"
|
|
||||||
android:textColor="#fff"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="15dp"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginBottom="10dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/step_1"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/step_2"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/step_3"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/step_4"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -5,7 +5,7 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/addSmsRule"
|
android:id="@+id/btnFloat"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
@ -13,60 +13,29 @@
|
|||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:onClick="addRule"
|
android:contentDescription="@string/setrule"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_add"
|
android:src="@drawable/ic_add"
|
||||||
android:tag="sms"
|
app:borderWidth="0dp"
|
||||||
app:elevation="8dp" />
|
app:elevation="5dp"
|
||||||
|
app:fabSize="mini" />
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/addCallRule"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:onClick="addRule"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/ic_add"
|
|
||||||
android:tag="call"
|
|
||||||
app:elevation="8dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/addAppRule"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:onClick="addRule"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/ic_add"
|
|
||||||
android:tag="app"
|
|
||||||
app:elevation="8dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/radioGroup"
|
android:id="@+id/radioGroup"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="5dip"
|
android:layout_marginTop="5dip"
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/radioGroupTypeCheck"
|
android:id="@+id/radioGroupTypeCheck"
|
||||||
android:layout_width="match_parent"
|
|
||||||
style="@style/rg_style"
|
style="@style/rg_style"
|
||||||
android:orientation="horizontal"
|
android:layout_width="match_parent"
|
||||||
android:gravity="center">
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/btnTypeSms"
|
android:id="@+id/btnTypeSms"
|
||||||
@ -92,9 +61,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/radioGroupLine"
|
android:id="@+id/radioGroupLine"
|
||||||
android:layout_below="@+id/radioGroup"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@+id/radioGroup"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
@ -102,23 +71,36 @@
|
|||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/list_view_rule"
|
android:id="@+id/list_view_rule"
|
||||||
android:layout_below="@+id/radioGroupLine"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@+id/radioGroupLine"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_marginBottom="25dp"
|
android:layout_marginBottom="85dp" />
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/help_tip"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:gravity="center"
|
android:orientation="vertical">
|
||||||
android:text="@string/rule_tips"
|
|
||||||
android:textColor="@color/colorPrimary" />
|
<TextView
|
||||||
|
android:id="@+id/help_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#10000000"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:text="@string/rule_tips"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<com.idormy.sms.forwarder.view.StepBar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -5,6 +5,7 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/btnAddSender"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
@ -12,29 +13,43 @@
|
|||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:onClick="addSender"
|
android:contentDescription="@string/new_sender"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_add"
|
android:src="@drawable/ic_add"
|
||||||
app:elevation="8dp" />
|
app:borderWidth="0dp"
|
||||||
|
app:elevation="5dp"
|
||||||
<TextView
|
app:fabSize="mini" />
|
||||||
android:id="@+id/help_tip"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/sender_tips"
|
|
||||||
android:textColor="@color/colorPrimary" />
|
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/list_view_sender"
|
android:id="@+id/list_view_sender"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_marginBottom="25dp"
|
android:layout_marginBottom="85dp" />
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_weight="1" />
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/help_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#10000000"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:text="@string/sender_tips"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<com.idormy.sms.forwarder.view.StepBar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
File diff suppressed because it is too large
Load Diff
@ -15,16 +15,16 @@
|
|||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
|
<GridView
|
||||||
android:id="@+id/MemuGridView"
|
android:id="@+id/MemuGridView"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:columnWidth="90dp"
|
android:columnWidth="90dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:horizontalSpacing="10dp"
|
android:horizontalSpacing="10dp"
|
||||||
android:numColumns="auto_fit"
|
android:numColumns="auto_fit"
|
||||||
android:stretchMode="columnWidth"
|
android:stretchMode="columnWidth"
|
||||||
android:verticalSpacing="10dp"></GridView>
|
android:verticalSpacing="10dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -39,9 +39,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -49,8 +49,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -82,8 +82,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -107,8 +107,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -122,9 +122,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -133,8 +133,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
@ -147,9 +147,9 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
android:text="@string/dingding_at_tips"
|
android:text="@string/dingding_at_tips"
|
||||||
android:textSize="10sp"
|
android:textSize="10sp"
|
||||||
android:maxLines="1"
|
|
||||||
tools:ignore="SmallSp" />
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
@ -39,20 +39,20 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/account"
|
android:text="@string/account"
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@color/colorBlueGreyDark"
|
android:textColor="@color/colorBlueGreyDark"
|
||||||
|
android:textSize="14sp"
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -132,19 +132,19 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/servers"
|
android:text="@string/servers"
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@color/colorBlueGreyDark"
|
android:textColor="@color/colorBlueGreyDark"
|
||||||
|
android:textSize="14sp"
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
@ -221,8 +221,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="3dp"
|
android:layout_marginStart="3dp"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789"
|
||||||
android:ems="5"
|
android:ems="5"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
|
android:maxLength="5"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor,TextFields" />
|
tools:ignore="LabelFor,TextFields" />
|
||||||
@ -243,19 +245,19 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/email_settings"
|
android:text="@string/email_settings"
|
||||||
android:textSize="14sp"
|
|
||||||
android:textColor="@color/colorBlueGreyDark"
|
android:textColor="@color/colorBlueGreyDark"
|
||||||
|
android:textSize="14sp"
|
||||||
tools:ignore="HardcodedText" />
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -283,8 +285,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="text"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="text"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor,TextFields" />
|
tools:ignore="LabelFor,TextFields" />
|
||||||
@ -295,8 +297,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -324,8 +326,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="text"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="text"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor,TextFields" />
|
tools:ignore="LabelFor,TextFields" />
|
||||||
|
@ -39,9 +39,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -49,8 +49,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -75,8 +75,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:ems="9"
|
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
|
android:ems="9"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -40,9 +40,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -127,8 +127,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -39,9 +39,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -185,8 +185,8 @@
|
|||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -239,8 +239,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -268,8 +268,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -286,8 +286,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -341,8 +341,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_sender_app"
|
android:text="@string/insert_sender_app"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_content_app"
|
android:id="@+id/bt_insert_content_app"
|
||||||
@ -354,8 +354,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_content_app"
|
android:text="@string/insert_content_app"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_time"
|
android:id="@+id/bt_insert_time"
|
||||||
@ -389,8 +389,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -418,8 +418,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -436,8 +436,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -448,8 +448,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -186,8 +186,8 @@
|
|||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -240,8 +240,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -269,8 +269,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -287,8 +287,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -307,8 +307,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_sender"
|
android:text="@string/insert_sender"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_content"
|
android:id="@+id/bt_insert_content"
|
||||||
@ -320,8 +320,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_content"
|
android:text="@string/insert_content"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_extra"
|
android:id="@+id/bt_insert_extra"
|
||||||
@ -333,8 +333,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_extra"
|
android:text="@string/insert_extra"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_sender_app"
|
android:id="@+id/bt_insert_sender_app"
|
||||||
@ -391,8 +391,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -420,8 +420,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -438,8 +438,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -450,8 +450,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -188,8 +188,8 @@
|
|||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -242,8 +242,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -266,14 +266,13 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layout_sms_template"
|
android:id="@+id/layout_sms_template"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -290,8 +289,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -322,8 +321,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_content"
|
android:text="@string/insert_content"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_extra"
|
android:id="@+id/bt_insert_extra"
|
||||||
@ -346,8 +345,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_sender_app"
|
android:text="@string/insert_sender_app"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_content_app"
|
android:id="@+id/bt_insert_content_app"
|
||||||
@ -359,8 +358,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/insert_content_app"
|
android:text="@string/insert_content_app"
|
||||||
tools:ignore="ButtonStyle,NestedWeights"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_insert_time"
|
android:id="@+id/bt_insert_time"
|
||||||
@ -394,8 +393,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -423,8 +422,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -441,8 +440,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
android:minLines="1"
|
android:minLines="1"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
@ -453,8 +452,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -39,9 +39,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -39,9 +39,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="end"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
|
android:gravity="end"
|
||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -62,8 +62,8 @@
|
|||||||
android:id="@+id/editTextTelegramApiToken"
|
android:id="@+id/editTextTelegramApiToken"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/line_bg_white_only_bottom_d8"
|
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
|
android:background="@drawable/line_bg_white_only_bottom_d8"
|
||||||
app:showEye="true"
|
app:showEye="true"
|
||||||
app:textColor="@color/tv_black_333333"
|
app:textColor="@color/tv_black_333333"
|
||||||
app:textColorHint="@color/tv_gray_999999"
|
app:textColorHint="@color/tv_gray_999999"
|
||||||
@ -74,8 +74,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -113,8 +113,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -237,7 +237,6 @@
|
|||||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layoutProxyAuthenticator"
|
android:id="@+id/layoutProxyAuthenticator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -1,33 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:background="#fff"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:background="#fff"
|
||||||
|
android:orientation="vertical"
|
||||||
tools:ignore="Overdraw">
|
tools:ignore="Overdraw">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:text="@string/privacy_policy"
|
android:text="@string/privacy_policy"
|
||||||
android:textColor="#000"
|
android:textColor="#000"
|
||||||
android:textSize="17sp" />
|
android:textSize="17sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textlike"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textColor="#000"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:text="@string/privacy_policy_text"
|
android:text="@string/privacy_policy_text"
|
||||||
|
android:textColor="#000"
|
||||||
android:textSize="17sp" />
|
android:textSize="17sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -42,17 +41,17 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:orientation="horizontal"
|
android:layout_height="50dp"
|
||||||
android:layout_height="50dp">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="#000"
|
|
||||||
android:id="@+id/succsebtn"
|
android:id="@+id/succsebtn"
|
||||||
android:gravity="center"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
android:text="@string/agree"
|
android:text="@string/agree"
|
||||||
|
android:textColor="#000"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
@ -61,14 +60,14 @@
|
|||||||
android:background="#5F6063" />
|
android:background="#5F6063" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="#000"
|
|
||||||
android:id="@+id/caclebtn"
|
android:id="@+id/caclebtn"
|
||||||
android:textSize="20sp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/disagree" />
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/disagree"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -12,9 +12,10 @@
|
|||||||
android:id="@+id/iv_edit_left_icon"
|
android:id="@+id/iv_edit_left_icon"
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_centerVertical="true"
|
android:contentDescription="@string/todo"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_login"
|
android:src="@drawable/icon_login"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
@ -25,23 +26,26 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="center|left"
|
android:gravity="center|start"
|
||||||
android:hint="请输入手机号"
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="text"
|
||||||
android:minHeight="45dp"
|
android:minHeight="45dp"
|
||||||
android:paddingRight="45dp"
|
android:paddingEnd="45dp"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp"
|
||||||
|
tools:ignore="LabelFor,RtlSymmetry" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="90dp"
|
android:layout_width="90dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:gravity="right">
|
android:layout_centerVertical="true"
|
||||||
|
android:gravity="end">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_edit_eye"
|
android:id="@+id/iv_edit_eye"
|
||||||
android:layout_width="45dp"
|
android:layout_width="45dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@string/todo"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/clear_icon_eye_close"
|
android:src="@drawable/clear_icon_eye_close"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
@ -50,6 +54,7 @@
|
|||||||
android:id="@+id/iv_edit_clean"
|
android:id="@+id/iv_edit_clean"
|
||||||
android:layout_width="45dp"
|
android:layout_width="45dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:contentDescription="@string/todo"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/clear_icon_close"
|
android:src="@drawable/clear_icon_close"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
@ -1,74 +1,74 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:tools="http://schemas.android.com/tools"
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit1"
|
android:id="@+id/edit1"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/point"
|
||||||
android:text="@string/point" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit2"
|
android:id="@+id/edit2"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/point"
|
||||||
android:text="@string/point" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit3"
|
android:id="@+id/edit3"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:text="@string/point"
|
||||||
android:text="@string/point" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/edit4"
|
android:id="@+id/edit4"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:digits="0123456789."
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:digits="0123456789."
|
|
||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor"
|
tools:ignore="LabelFor" />
|
||||||
android:autofillHints="" />
|
|
||||||
</merge>
|
</merge>
|
@ -1,14 +1,17 @@
|
|||||||
<?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"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ItemImageView"
|
android:id="@+id/ItemImageView"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center" />
|
android:layout_gravity="center"
|
||||||
|
android:contentDescription="@string/todo" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ItemTextView"
|
android:id="@+id/ItemTextView"
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
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"
|
||||||
tools:ignore="UseCompoundDrawables"
|
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp">
|
android:padding="5dp"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="34dp"
|
android:layout_width="34dp"
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
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"
|
||||||
tools:ignore="UseCompoundDrawables"
|
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp">
|
android:padding="5dp"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="34dp"
|
android:layout_width="34dp"
|
||||||
|
196
app/src/main/res/layout/step_bar.xml
Normal file
196
app/src/main/res/layout/step_bar.xml
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#ffffff"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#aadcdcdc" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_current"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_1"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_current"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/step_rectangle_current"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_current"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_current"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_2"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_normal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_3"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/step_rectangle_normal"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txStep4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/step_circle_normal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/_4"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="15dp"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:layout_marginBottom="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep1"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_1"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep2"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_2"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep3"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_3"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStep4"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/step_4"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -3,34 +3,34 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context="com.idormy.sms.forwarder.MainActivity">
|
tools:context="com.idormy.sms.forwarder.MainActivity">
|
||||||
<item
|
<!--<item
|
||||||
android:id="@+id/to_setting"
|
android:id="@+id/to_setting"
|
||||||
|
android:icon="@drawable/ic_settings"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
android:title="@string/setting"
|
android:title="@string/setting"
|
||||||
android:icon="@drawable/ic_settings"
|
app:showAsAction="never" />-->
|
||||||
app:showAsAction="never" />
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/to_app_list"
|
android:id="@+id/to_app_list"
|
||||||
|
android:icon="@drawable/ic_app"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
android:title="@string/app_list"
|
android:title="@string/app_list"
|
||||||
android:icon="@drawable/ic_app"
|
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/to_clone"
|
android:id="@+id/to_clone"
|
||||||
|
android:icon="@drawable/ic_clone"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
android:title="@string/clone"
|
android:title="@string/clone"
|
||||||
android:icon="@drawable/ic_clone"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
<item
|
|
||||||
android:id="@+id/to_about"
|
|
||||||
android:orderInCategory="100"
|
|
||||||
android:title="@string/about"
|
|
||||||
android:icon="@drawable/ic_forwarder"
|
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/to_help"
|
android:id="@+id/to_help"
|
||||||
|
android:icon="@drawable/ic_help"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
android:title="@string/help"
|
android:title="@string/help"
|
||||||
android:icon="@drawable/ic_help"
|
app:showAsAction="never" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/to_about"
|
||||||
|
android:icon="@drawable/ic_forwarder"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/about"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -5,13 +5,10 @@
|
|||||||
<color name="colorAccent">#63C2FA</color>
|
<color name="colorAccent">#63C2FA</color>
|
||||||
<color name="colorBlueGrey">#78909C</color>
|
<color name="colorBlueGrey">#78909C</color>
|
||||||
<color name="colorBlueGreyDark">#546E7A</color>
|
<color name="colorBlueGreyDark">#546E7A</color>
|
||||||
|
<color name="colorBackground">#DCDCDC</color>
|
||||||
<color name="gray_text_light">#979797</color>
|
<color name="gray_text_light">#979797</color>
|
||||||
|
|
||||||
<color name="teal_200">#FF03DAC5</color>
|
|
||||||
<color name="teal_700">#FF018786</color>
|
|
||||||
<color name="black">#FF000000</color>
|
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
<color name="gray">#CCCCCC</color>
|
|
||||||
|
|
||||||
<color name="tv_black_333333">#333333</color>
|
<color name="tv_black_333333">#333333</color>
|
||||||
<color name="tv_gray_999999">#999999</color>
|
<color name="tv_gray_999999">#999999</color>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<string name="rule_setting">Rule Setting</string>
|
<string name="rule_setting">Rule Setting</string>
|
||||||
<string name="sender_setting">Sender Setting</string>
|
<string name="sender_setting">Sender Setting</string>
|
||||||
<string name="app_list">App List</string>
|
<string name="app_list">App List</string>
|
||||||
|
<string name="setting_tips">Tips: For the first time, click the following steps to set it up.</string>
|
||||||
<string name="log_tips">Tips: Pull to refresh; Long press to delete one log entry.</string>
|
<string name="log_tips">Tips: Pull to refresh; Long press to delete one log entry.</string>
|
||||||
<string name="rule_tips">Tips: Tap "NEW SMS/Call Fw. RULE" to add a new rule; Long press a rule to delete; Tap an existing rule to edit.</string>
|
<string name="rule_tips">Tips: Tap "NEW SMS/Call Fw. RULE" to add a new rule; Long press a rule to delete; Tap an existing rule to edit.</string>
|
||||||
<string name="sender_tips">Tips: Tap "NEW SENDER" to add a new sender; Long press a sender to delete; Tap an existing sender to edit.</string>
|
<string name="sender_tips">Tips: Tap "NEW SENDER" to add a new sender; Long press a sender to delete; Tap an existing sender to edit.</string>
|
||||||
@ -39,7 +40,6 @@
|
|||||||
<string name="cache_purged">Cache purged</string>
|
<string name="cache_purged">Cache purged</string>
|
||||||
<string name="unknown_qq_version">No mobile QQ is installed or not supported by recent version!</string>
|
<string name="unknown_qq_version">No mobile QQ is installed or not supported by recent version!</string>
|
||||||
<!--MainActivity-->
|
<!--MainActivity-->
|
||||||
<string name="bt_refresh_log">Clear Logs</string>
|
|
||||||
<string name="delete_log_title">Delete confirmation</string>
|
<string name="delete_log_title">Delete confirmation</string>
|
||||||
<string name="delete_log_tips">Are you sure to delete this log entry?</string>
|
<string name="delete_log_tips">Are you sure to delete this log entry?</string>
|
||||||
<string name="delete_log_toast">The log entry is deleted.</string>
|
<string name="delete_log_toast">The log entry is deleted.</string>
|
||||||
@ -60,9 +60,6 @@
|
|||||||
<string name="add_sender_first">Please add a sender first.</string>
|
<string name="add_sender_first">Please add a sender first.</string>
|
||||||
<string name="select_sender">Select Sender</string>
|
<string name="select_sender">Select Sender</string>
|
||||||
<string name="rule_tester">Rule tester:</string>
|
<string name="rule_tester">Rule tester:</string>
|
||||||
<string name="new_sms_rule">New SMS Fw. Rule</string>
|
|
||||||
<string name="new_call_rule">New Call Fw. Rule</string>
|
|
||||||
<string name="new_app_rule">New App Fw. Rule</string>
|
|
||||||
<string name="test_sim_slot">Test SIM Slot</string>
|
<string name="test_sim_slot">Test SIM Slot</string>
|
||||||
<string name="test_phone_number">Test Phone Number</string>
|
<string name="test_phone_number">Test Phone Number</string>
|
||||||
<string name="test_msg_content">Test Msg Content</string>
|
<string name="test_msg_content">Test Msg Content</string>
|
||||||
@ -185,7 +182,6 @@
|
|||||||
<string name="forward_app_notify">Forward app Ntf.</string>
|
<string name="forward_app_notify">Forward app Ntf.</string>
|
||||||
<string name="forward_app_notify_tips">Main switch, requires permission to read notification.</string>
|
<string name="forward_app_notify_tips">Main switch, requires permission to read notification.</string>
|
||||||
<string name="cancel_app_notify">Auto close Ntf.</string>
|
<string name="cancel_app_notify">Auto close Ntf.</string>
|
||||||
<string name="cancel_app_notify_tips">Automatically close a single notification after forwarding, to avoid stacking of multiple notifications.</string>
|
|
||||||
<string name="enable_custom_templates">Global custom template</string>
|
<string name="enable_custom_templates">Global custom template</string>
|
||||||
<string name="enable_custom_templates_tips">Priority: custom template for forwarding rules > Global custom template > System default</string>
|
<string name="enable_custom_templates_tips">Priority: custom template for forwarding rules > Global custom template > System default</string>
|
||||||
<string name="enable_regex_replace">Enable regular replacement content</string>
|
<string name="enable_regex_replace">Enable regular replacement content</string>
|
||||||
@ -205,11 +201,12 @@
|
|||||||
<string name="init_setting">Restore initial Setting</string>
|
<string name="init_setting">Restore initial Setting</string>
|
||||||
<string name="init_setting_tips">Are you sure you want to restore the initial configuration? \n\n[Warning] This operation will reset settings, and delete senders, rules, and logs!</string>
|
<string name="init_setting_tips">Are you sure you want to restore the initial configuration? \n\n[Warning] This operation will reset settings, and delete senders, rules, and logs!</string>
|
||||||
<string name="battery_setting">Battery Optimization</string>
|
<string name="battery_setting">Battery Optimization</string>
|
||||||
<string name="request_permission">Request Ntf. Permission</string>
|
<string name="battery_setting_tips">Set it to manual management, including automatic startup, associated startup, and background running</string>
|
||||||
<string name="unknown_number">Unknown Number</string>
|
<string name="unknown_number">Unknown Number</string>
|
||||||
<string name="calling">Incoming telegram</string>
|
<string name="calling">Incoming telegram</string>
|
||||||
<string name="unsupport">Your phone does not support this setting</string>
|
<string name="unsupport">Your phone does not support this setting</string>
|
||||||
<string name="isIgnored">Set successfully!</string>
|
<string name="isIgnored">Set successfully!</string>
|
||||||
|
<string name="isIgnored2">Can not directly operate the system power saving optimization Settings</string>
|
||||||
<!--Other-->
|
<!--Other-->
|
||||||
<string name="version_now">v1.0</string>
|
<string name="version_now">v1.0</string>
|
||||||
<string name="linkweb">https://github.com/pppscn/SmsForwarder</string>
|
<string name="linkweb">https://github.com/pppscn/SmsForwarder</string>
|
||||||
@ -235,7 +232,7 @@
|
|||||||
<string name="server_has_started">The server is started successfully</string>
|
<string name="server_has_started">The server is started successfully</string>
|
||||||
<string name="server_has_stopped">The server has been stopped</string>
|
<string name="server_has_stopped">The server has been stopped</string>
|
||||||
<string name="sender_cannot_receive">This mobile phone is the SOURCE and cannot receive files.</string>
|
<string name="sender_cannot_receive">This mobile phone is the SOURCE and cannot receive files.</string>
|
||||||
<string name="no_wifi_network">One-tap cloning function does NOT work without Wi-Fi connection.</string>
|
<string name="no_wifi_network">Http Server does NOT work without Wi-Fi connection.</string>
|
||||||
<string name="invalid_server_ip">Please enter a valid server IP address</string>
|
<string name="invalid_server_ip">Please enter a valid server IP address</string>
|
||||||
<string name="download_success">Download Success</string>
|
<string name="download_success">Download Success</string>
|
||||||
<string name="on_wireless_network">A Wireless network connected.</string>
|
<string name="on_wireless_network">A Wireless network connected.</string>
|
||||||
@ -292,7 +289,6 @@
|
|||||||
<string name="title_template">Title Template</string>
|
<string name="title_template">Title Template</string>
|
||||||
<string name="priority">Priority(1 – 9)</string>
|
<string name="priority">Priority(1 – 9)</string>
|
||||||
<string name="_5">5</string>
|
<string name="_5">5</string>
|
||||||
<string name="enter_webserver_tips">Please enter the WebServer</string>
|
|
||||||
<string name="switch_rule_status">Enable this rule</string>
|
<string name="switch_rule_status">Enable this rule</string>
|
||||||
<string name="dingding">Dingtalk Bot</string>
|
<string name="dingding">Dingtalk Bot</string>
|
||||||
<string name="email">Email</string>
|
<string name="email">Email</string>
|
||||||
@ -306,7 +302,7 @@
|
|||||||
<string name="feishu">FeiShu Bot</string>
|
<string name="feishu">FeiShu Bot</string>
|
||||||
<string name="pushplus">PushPlus</string>
|
<string name="pushplus">PushPlus</string>
|
||||||
<string name="gotify">Gotify</string>
|
<string name="gotify">Gotify</string>
|
||||||
<string name="add">Add</string>
|
<string name="_1">1</string>
|
||||||
<string name="_2">2</string>
|
<string name="_2">2</string>
|
||||||
<string name="_3">3</string>
|
<string name="_3">3</string>
|
||||||
<string name="_4">4</string>
|
<string name="_4">4</string>
|
||||||
@ -315,4 +311,5 @@
|
|||||||
<string name="step_3">Rules</string>
|
<string name="step_3">Rules</string>
|
||||||
<string name="step_4">Logs</string>
|
<string name="step_4">Logs</string>
|
||||||
<string name="clean_log">Clean Log</string>
|
<string name="clean_log">Clean Log</string>
|
||||||
|
<string name="todo">TODO</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -5,13 +5,10 @@
|
|||||||
<color name="colorAccent">#63C2FA</color>
|
<color name="colorAccent">#63C2FA</color>
|
||||||
<color name="colorBlueGrey">#78909C</color>
|
<color name="colorBlueGrey">#78909C</color>
|
||||||
<color name="colorBlueGreyDark">#546E7A</color>
|
<color name="colorBlueGreyDark">#546E7A</color>
|
||||||
|
<color name="colorBackground">#DCDCDC</color>
|
||||||
<color name="gray_text_light">#979797</color>
|
<color name="gray_text_light">#979797</color>
|
||||||
|
|
||||||
<color name="teal_200">#FF03DAC5</color>
|
|
||||||
<color name="teal_700">#FF018786</color>
|
|
||||||
<color name="black">#FF000000</color>
|
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
<color name="gray">#CCCCCC</color>
|
|
||||||
|
|
||||||
<color name="tv_black_333333">#333333</color>
|
<color name="tv_black_333333">#333333</color>
|
||||||
<color name="tv_gray_999999">#999999</color>
|
<color name="tv_gray_999999">#999999</color>
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
<string name="rule_setting">转发规则</string>
|
<string name="rule_setting">转发规则</string>
|
||||||
<string name="sender_setting">发送通道</string>
|
<string name="sender_setting">发送通道</string>
|
||||||
<string name="app_list">应用列表</string>
|
<string name="app_list">应用列表</string>
|
||||||
<string name="log_tips">提示:置顶下拉刷新,长按删除单条,选项卡切换日志类型\n首次使用按以下步骤设置,该步骤点亮表示已设置!</string>
|
<string name="setting_tips">提示:首次使用请按照以下步骤顺序设置,该步骤点亮表示已设置!</string>
|
||||||
|
<string name="log_tips">提示:置顶下拉刷新,长按删除单条,选项卡切换日志类型</string>
|
||||||
<string name="rule_tips">提示:新建规则点击“添加”,长按删除/克隆,点击编辑已有</string>
|
<string name="rule_tips">提示:新建规则点击“添加”,长按删除/克隆,点击编辑已有</string>
|
||||||
<string name="sender_tips">提示:新建发送通道点击“添加”,长按删除/克隆,点击编辑已有</string>
|
<string name="sender_tips">提示:新建发送通道点击“添加”,长按删除/克隆,点击编辑已有</string>
|
||||||
<string name="app_tips">提示:点击复制APP的包名,长按则启动并跳转该APP</string>
|
<string name="app_tips">提示:点击复制APP的包名,长按则启动并跳转该APP</string>
|
||||||
@ -39,13 +40,12 @@
|
|||||||
<string name="cache_purged">缓存清理完成</string>
|
<string name="cache_purged">缓存清理完成</string>
|
||||||
<string name="unknown_qq_version">未安装手Q或安装的版本不支持!</string>
|
<string name="unknown_qq_version">未安装手Q或安装的版本不支持!</string>
|
||||||
<!--MainActivity-->
|
<!--MainActivity-->
|
||||||
<string name="bt_refresh_log">清空记录</string>
|
|
||||||
<string name="delete_log_title">日志删除确认</string>
|
<string name="delete_log_title">日志删除确认</string>
|
||||||
<string name="delete_log_tips">确定删除该条日志记录?</string>
|
<string name="delete_log_tips">确定删除该条日志记录?</string>
|
||||||
<string name="delete_log_toast">该条日志记录已经删除!</string>
|
<string name="delete_log_toast">该条日志记录已经删除!</string>
|
||||||
<string name="resend_toast">正在重发</string>
|
<string name="resend_toast">正在重发</string>
|
||||||
<string name="details">详情</string>
|
<string name="details">详情</string>
|
||||||
<string name="clear_logs_tips">确定要清空转发记录吗?</string>
|
<string name="clear_logs_tips">确定要清空所有转发记录吗?</string>
|
||||||
<string name="pull_tips">下拉可以刷新!</string>
|
<string name="pull_tips">下拉可以刷新!</string>
|
||||||
<string name="release_tips">松开可以刷新!</string>
|
<string name="release_tips">松开可以刷新!</string>
|
||||||
<string name="reflashing_tips">正在刷新…</string>
|
<string name="reflashing_tips">正在刷新…</string>
|
||||||
@ -60,9 +60,6 @@
|
|||||||
<string name="add_sender_first">请先去设置发送通道页面添加</string>
|
<string name="add_sender_first">请先去设置发送通道页面添加</string>
|
||||||
<string name="select_sender">选择发送通道</string>
|
<string name="select_sender">选择发送通道</string>
|
||||||
<string name="rule_tester">规则测试</string>
|
<string name="rule_tester">规则测试</string>
|
||||||
<string name="new_sms_rule">添加短信转发</string>
|
|
||||||
<string name="new_call_rule">添加来电转发</string>
|
|
||||||
<string name="new_app_rule">添加应用转发</string>
|
|
||||||
<string name="test_sim_slot">测试模拟的接收卡槽</string>
|
<string name="test_sim_slot">测试模拟的接收卡槽</string>
|
||||||
<string name="test_phone_number">测试模拟的来源号码</string>
|
<string name="test_phone_number">测试模拟的来源号码</string>
|
||||||
<string name="test_msg_content">测试模拟的短信内容</string>
|
<string name="test_msg_content">测试模拟的短信内容</string>
|
||||||
@ -176,16 +173,15 @@
|
|||||||
<string name="carrier_mobile">运营商_手机号</string>
|
<string name="carrier_mobile">运营商_手机号</string>
|
||||||
<string name="low_power_alarm_threshold">电量预警阈值(%)</string>
|
<string name="low_power_alarm_threshold">电量预警阈值(%)</string>
|
||||||
<string name="low_power_alarm_threshold_tips">取值范围:0–100,0禁用</string>
|
<string name="low_power_alarm_threshold_tips">取值范围:0–100,0禁用</string>
|
||||||
<string name="retry_interval">每次重试间隔(秒)</string>
|
<string name="retry_interval">失败重试间隔(秒)</string>
|
||||||
<string name="retry_interval_tips">接口请求失败后将重试5次</string>
|
<string name="retry_interval_tips">接口请求失败后将重试5次</string>
|
||||||
<string name="forward_sms">转发短信广播</string>
|
<string name="forward_sms">转发短信广播</string>
|
||||||
<string name="forward_sms_tips">总开关,请授予读取短信、通知类短信、发送短信等权限</string>
|
<string name="forward_sms_tips">总开关,请授予读取短信、通知类短信、发送短信等权限</string>
|
||||||
<string name="forward_missed_calls">转发通话记录</string>
|
<string name="forward_missed_calls">转发通话记录</string>
|
||||||
<string name="forward_missed_calls_tips">总开关,请授予读取通话记录、联系人等权限</string>
|
<string name="forward_missed_calls_tips">请先授予读取通话记录、联系人等权限,并选择转发类型,再开启</string>
|
||||||
<string name="forward_app_notify">转发应用通知</string>
|
<string name="forward_app_notify">转发应用通知</string>
|
||||||
<string name="forward_app_notify_tips">总开关,请先授予通知使用权</string>
|
<string name="forward_app_notify_tips">请先授予通知使用权,再开启;开启自动消除,以避免多条通知堆叠</string>
|
||||||
<string name="cancel_app_notify">自动关闭通知</string>
|
<string name="cancel_app_notify">自动消除通知</string>
|
||||||
<string name="cancel_app_notify_tips">单条通知处理完毕后,自动关闭,避免多条通知堆叠</string>
|
|
||||||
<string name="enable_custom_templates">启用自定义模版</string>
|
<string name="enable_custom_templates">启用自定义模版</string>
|
||||||
<string name="enable_custom_templates_tips">优先级:转发规则的自定义模板 > 全局自定义模版 > 默认</string>
|
<string name="enable_custom_templates_tips">优先级:转发规则的自定义模板 > 全局自定义模版 > 默认</string>
|
||||||
<string name="enable_regex_replace">启用正则替换内容</string>
|
<string name="enable_regex_replace">启用正则替换内容</string>
|
||||||
@ -204,12 +200,13 @@
|
|||||||
<string name="insert_device_name">设备名称</string>
|
<string name="insert_device_name">设备名称</string>
|
||||||
<string name="init_setting">恢复初始配置</string>
|
<string name="init_setting">恢复初始配置</string>
|
||||||
<string name="init_setting_tips">确定需要恢复初始配置吗?\n\n【警告】此操作将重置设置、删除发送通道、规则、日志!</string>
|
<string name="init_setting_tips">确定需要恢复初始配置吗?\n\n【警告】此操作将重置设置、删除发送通道、规则、日志!</string>
|
||||||
<string name="battery_setting">设置电池优化</string>
|
<string name="battery_setting">忽略电池优化设置</string>
|
||||||
<string name="request_permission">请求通知权限</string>
|
<string name="battery_setting_tips">请设置为手动管理:允许自启动、允许关联启动、允许后台运行</string>
|
||||||
<string name="unknown_number">未知号码</string>
|
<string name="unknown_number">未知号码</string>
|
||||||
<string name="calling">的来电未接</string>
|
<string name="calling">的来电未接</string>
|
||||||
<string name="unsupport">您的手机不支持此设置</string>
|
<string name="unsupport">您的手机不支持此设置</string>
|
||||||
<string name="isIgnored">已将省电优化设置为无限制(不优化)!</string>
|
<string name="isIgnored">已将省电优化设置为无限制(不优化)!</string>
|
||||||
|
<string name="isIgnored2">本界面无法直接操作系统的省电优化设置</string>
|
||||||
<!--Other-->
|
<!--Other-->
|
||||||
<string name="version_now">v1.0</string>
|
<string name="version_now">v1.0</string>
|
||||||
<string name="linkweb">https://github.com/pppscn/SmsForwarder</string>
|
<string name="linkweb">https://github.com/pppscn/SmsForwarder</string>
|
||||||
@ -234,7 +231,7 @@
|
|||||||
<string name="server_has_started">服务端已启动</string>
|
<string name="server_has_started">服务端已启动</string>
|
||||||
<string name="server_has_stopped">服务端已停止</string>
|
<string name="server_has_stopped">服务端已停止</string>
|
||||||
<string name="sender_cannot_receive">本手机是发送端,不可接收文件,请先停止服务端!</string>
|
<string name="sender_cannot_receive">本手机是发送端,不可接收文件,请先停止服务端!</string>
|
||||||
<string name="no_wifi_network">未接入Wifi网络,不可使用一键克隆功能!</string>
|
<string name="no_wifi_network">未接入Wifi网络,不可使用 HttpServer!</string>
|
||||||
<string name="invalid_server_ip">请输入服务端IP</string>
|
<string name="invalid_server_ip">请输入服务端IP</string>
|
||||||
<string name="download_success">下载成功</string>
|
<string name="download_success">下载成功</string>
|
||||||
<string name="on_wireless_network">当前处于无线网络</string>
|
<string name="on_wireless_network">当前处于无线网络</string>
|
||||||
@ -280,8 +277,8 @@
|
|||||||
<string name="proxy_authenticator">代理身份验证</string>
|
<string name="proxy_authenticator">代理身份验证</string>
|
||||||
<string name="username">用户</string>
|
<string name="username">用户</string>
|
||||||
<string name="password">密码</string>
|
<string name="password">密码</string>
|
||||||
<string name="send_sms_config_title">SmsHub client 模式</string>
|
<string name="send_sms_config_title">主动轮询远程 SmsHubApi</string>
|
||||||
<string name="send_sms_config_title2">执行接口返回的操作</string>
|
<string name="send_sms_config_title2">请先填写服务端地址,再启动服务,APP轮询执行接口返回的操作</string>
|
||||||
<string name="privacy_policy">隐私政策</string>
|
<string name="privacy_policy">隐私政策</string>
|
||||||
<string name="agree">同意</string>
|
<string name="agree">同意</string>
|
||||||
<string name="disagree">不同意</string>
|
<string name="disagree">不同意</string>
|
||||||
@ -289,9 +286,8 @@
|
|||||||
<string name="GotifyWebServer">WebServer</string>
|
<string name="GotifyWebServer">WebServer</string>
|
||||||
<string name="GotifyWebServerTips"><![CDATA[例:https://push.ppps.cn/message?token=<apptoken>]]></string>
|
<string name="GotifyWebServerTips"><![CDATA[例:https://push.ppps.cn/message?token=<apptoken>]]></string>
|
||||||
<string name="title_template">标题模板</string>
|
<string name="title_template">标题模板</string>
|
||||||
<string name="priority">优先级(1 - 9)</string>
|
<string name="priority">优先级(1 – 9)</string>
|
||||||
<string name="_5">5</string>
|
<string name="_5">5</string>
|
||||||
<string name="enter_webserver_tips">请输入WebServer</string>
|
|
||||||
<string name="switch_rule_status">启用该条转发规则</string>
|
<string name="switch_rule_status">启用该条转发规则</string>
|
||||||
<string name="dingding">钉钉机器人</string>
|
<string name="dingding">钉钉机器人</string>
|
||||||
<string name="email">电子邮箱</string>
|
<string name="email">电子邮箱</string>
|
||||||
@ -305,14 +301,14 @@
|
|||||||
<string name="feishu">飞书机器人</string>
|
<string name="feishu">飞书机器人</string>
|
||||||
<string name="pushplus">PushPlus</string>
|
<string name="pushplus">PushPlus</string>
|
||||||
<string name="gotify">Gotify</string>
|
<string name="gotify">Gotify</string>
|
||||||
<string name="add">添加</string>
|
|
||||||
<string name="_1">1</string>
|
<string name="_1">1</string>
|
||||||
<string name="_2">2</string>
|
<string name="_2">2</string>
|
||||||
<string name="_3">3</string>
|
<string name="_3">3</string>
|
||||||
<string name="_4">4</string>
|
<string name="_4">4</string>
|
||||||
<string name="step_1">选择功能</string>
|
<string name="step_1">通用设置</string>
|
||||||
<string name="step_2">发送通道</string>
|
<string name="step_2">发送通道</string>
|
||||||
<string name="step_3">转发规则</string>
|
<string name="step_3">转发规则</string>
|
||||||
<string name="step_4">转发日志</string>
|
<string name="step_4">转发日志</string>
|
||||||
<string name="clean_log">清理日志</string>
|
<string name="clean_log">清理日志</string>
|
||||||
|
<string name="todo">TODO</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -11,4 +11,4 @@
|
|||||||
<exclude
|
<exclude
|
||||||
domain="sharedpref"
|
domain="sharedpref"
|
||||||
path="forwarder_msg.xml" />
|
path="forwarder_msg.xml" />
|
||||||
</full-backup-content>
|
</full-backup-content>
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
@ -18,7 +17,6 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user