mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-02 17:07:41 +08:00
1、设置中允许关闭页面帮助/表单填写提示
2、onStart时加载数据,避免返回界面时数据滞后
This commit is contained in:
parent
e80927de96
commit
2212d51931
@ -92,6 +92,7 @@ Android手机监听短信并根据指定规则转发到其他手机、钉钉机
|
||||
+ [v1.2.3](app/release/SmsForwarder_release_20210302_1.2.3.apk) 【预发布】转发日志列表/详情增加卡槽标识(SIM1 或 SIM2)
|
||||
+ [v1.3.0](app/release/SmsForwarder_release_20210303_1.3.0.apk) 支持双卡手机,增加卡槽标识/运营商/手机号(如果能获取的话)
|
||||
+ [v1.4.0](app/release/SmsForwarder_release_20210304_1.4.0.apk) 支持多重匹配规则
|
||||
+ [v1.4.1](app/release/SmsForwarder_release_20210304_1.4.1.apk) 设置中允许关闭页面帮助/表单填写提示
|
||||
|
||||
|
||||
## LICENSE
|
||||
|
@ -14,8 +14,8 @@ android {
|
||||
applicationId "com.idormy.sms.forwarder"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 28
|
||||
versionCode 11
|
||||
versionName "1.4.0"
|
||||
versionCode 12
|
||||
versionName "1.4.1"
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
signingConfigs {
|
||||
|
BIN
app/release/SmsForwarder_release_20210304_1.4.1.apk
Normal file
BIN
app/release/SmsForwarder_release_20210304_1.4.1.apk
Normal file
Binary file not shown.
@ -10,9 +10,9 @@
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 11,
|
||||
"versionName": "1.4.0",
|
||||
"outputFile": "SmsForwarder_release_20210304_1.4.0.apk"
|
||||
"versionCode": 12,
|
||||
"versionName": "1.4.1",
|
||||
"outputFile": "SmsForwarder_release_20210304_1.4.1.apk"
|
||||
}
|
||||
]
|
||||
}
|
@ -18,6 +18,7 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@ -66,6 +67,17 @@ public class MainActivity extends AppCompatActivity implements ReFlashListView.I
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
LogUtil.init(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
Log.d(TAG, "onStart");
|
||||
|
||||
//是否关闭页面提示
|
||||
TextView help_tip = findViewById(R.id.help_tip);
|
||||
help_tip.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 先拿到数据并放在适配器上
|
||||
initTLogs(); //初始化数据
|
||||
showList(logVos);
|
||||
@ -103,10 +115,8 @@ public class MainActivity extends AppCompatActivity implements ReFlashListView.I
|
||||
|
||||
//添加AlertDialog.Builder对象的setNegativeButton()方法
|
||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -3,12 +3,14 @@ package com.idormy.sms.forwarder;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.idormy.sms.forwarder.utils.Define;
|
||||
import com.idormy.sms.forwarder.utils.SendHistory;
|
||||
import com.idormy.sms.forwarder.utils.SettingUtil;
|
||||
import com.smailnet.emailkit.EmailKit;
|
||||
@ -22,6 +24,8 @@ public class MyApplication extends Application {
|
||||
private static final String TAG = "MyApplication";
|
||||
//SIM卡信息
|
||||
public static Map<String, Map> SimInfo = new HashMap();
|
||||
//是否关闭页面提示
|
||||
public static boolean showHelpTip = true;
|
||||
|
||||
/**
|
||||
* <meta-data
|
||||
@ -86,5 +90,8 @@ public class MyApplication extends Application {
|
||||
SettingUtil.init(this);
|
||||
|
||||
EmailKit.initialize(this);
|
||||
|
||||
SharedPreferences sp = MyApplication.this.getSharedPreferences(Define.SP_CONFIG, Context.MODE_PRIVATE);
|
||||
showHelpTip = sp.getBoolean(Define.SP_CONFIG_SWITCH_HELP_TIP, true);
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,16 @@ public class RuleActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_rule);
|
||||
RuleUtil.init(RuleActivity.this);
|
||||
SenderUtil.init(RuleActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
Log.d(TAG, "onStart");
|
||||
|
||||
//是否关闭页面提示
|
||||
TextView help_tip = findViewById(R.id.help_tip);
|
||||
help_tip.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 先拿到数据并放在适配器上
|
||||
initRules(); //初始化数据
|
||||
@ -281,7 +291,7 @@ public class RuleActivity extends AppCompatActivity {
|
||||
}
|
||||
editTextRuleValue.setEnabled(true);
|
||||
matchTypeLayout.setVisibility(View.GONE);
|
||||
tv_mu_rule_tips.setVisibility(View.VISIBLE);
|
||||
tv_mu_rule_tips.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
||||
break;
|
||||
default:
|
||||
for (int i = 0; i < radioGroupRuleCheck.getChildCount(); i++) {
|
||||
|
@ -11,6 +11,7 @@ import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@ -69,6 +70,16 @@ public class SenderActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_sender);
|
||||
SenderUtil.init(SenderActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
Log.d(TAG, "onStart");
|
||||
|
||||
//是否关闭页面提示
|
||||
TextView help_tip = findViewById(R.id.help_tip);
|
||||
help_tip.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
|
||||
|
||||
// 先拿到数据并放在适配器上
|
||||
initSenders(); //初始化数据
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.idormy.sms.forwarder;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@ -20,6 +22,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.idormy.sms.forwarder.BroadCastReceiver.RebootBroadcastReceiver;
|
||||
import com.idormy.sms.forwarder.utils.CacheUtil;
|
||||
import com.idormy.sms.forwarder.utils.Define;
|
||||
import com.idormy.sms.forwarder.utils.aUtil;
|
||||
import com.xuexiang.xupdate.easy.EasyUpdate;
|
||||
import com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker;
|
||||
@ -30,17 +33,24 @@ import java.util.Map;
|
||||
|
||||
public class SettingActivity extends AppCompatActivity {
|
||||
private String TAG = "SettingActivity";
|
||||
private Context context;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.d(TAG, "oncreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
context = SettingActivity.this;
|
||||
|
||||
setContentView(R.layout.activity_setting);
|
||||
Log.d(TAG, "onCreate: " + RebootBroadcastReceiver.class.getName());
|
||||
|
||||
Switch check_with_reboot = (Switch) findViewById(R.id.switch_with_reboot);
|
||||
checkWithReboot(check_with_reboot);
|
||||
|
||||
Switch switch_help_tip = (Switch) findViewById(R.id.switch_help_tip);
|
||||
SwitchHelpTip(switch_help_tip);
|
||||
|
||||
final TextView version_now = (TextView) findViewById(R.id.version_now);
|
||||
Button check_version_now = (Button) findViewById(R.id.check_version_now);
|
||||
try {
|
||||
@ -124,7 +134,6 @@ public class SettingActivity extends AppCompatActivity {
|
||||
int state = pm.getComponentEnabledSetting(cm);
|
||||
if (state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
&& state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER) {
|
||||
|
||||
withrebootSwitch.setChecked(true);
|
||||
} else {
|
||||
withrebootSwitch.setChecked(false);
|
||||
@ -140,6 +149,21 @@ public class SettingActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
//页面帮助提示
|
||||
private void SwitchHelpTip(Switch switchHelpTip) {
|
||||
switchHelpTip.setChecked(MyApplication.showHelpTip);
|
||||
|
||||
switchHelpTip.setOnCheckedChangeListener(new Switch.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void checkNewVersion() {
|
||||
try {
|
||||
String updateUrl = "https://xupdate.bms.ink/update/checkVersion?appKey=com.idormy.sms.forwarder&versionCode=";
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.idormy.sms.forwarder.utils;
|
||||
|
||||
public class Define {
|
||||
public static String SP_MSG = "tsms_msg";
|
||||
public static String SP_MSG_SET_KEY = "tsms_msg_set_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_HOST_KEY = "tsms_msg_send_util_email_host_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_PORT_KEY = "tsms_msg_send_util_email_port_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_FROMADD_KEY = "tsms_msg_send_util_email_fromadd_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_PSW_KEY = "tsms_msg_send_util_email_psw_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_TOADD_KEY = "tsms_msg_send_util_email_toadd_key";
|
||||
public static String SP_CONFIG = "forwarder_config";
|
||||
public static String SP_CONFIG_SWITCH_HELP_TIP = "forwarder_config_switch_help_tip";
|
||||
public static String SP_MSG = "forwarder_msg";
|
||||
public static String SP_MSG_SET_KEY = "forwarder_msg_set_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_HOST_KEY = "forwarder_msg_send_util_email_host_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_PORT_KEY = "forwarder_msg_send_util_email_port_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_FROMADD_KEY = "forwarder_msg_send_util_email_fromadd_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_PSW_KEY = "forwarder_msg_send_util_email_psw_key";
|
||||
public static String SP_MSG_SEND_UTIL_EMAIL_TOADD_KEY = "forwarder_msg_send_util_email_toadd_key";
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/help_tip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
@ -17,6 +17,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/help_tip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
@ -17,6 +17,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/help_tip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
@ -72,6 +72,32 @@
|
||||
|
||||
</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="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:text="页面帮助提示" />
|
||||
|
||||
<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" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/about_web"
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
x
Reference in New Issue
Block a user