优化:页面帮助关闭时减少弹窗提示

优化:短信转发总开关去掉“发送短信”权限判断
This commit is contained in:
pppscn 2022-02-06 10:46:13 +08:00
parent df685d524f
commit 27b07f1e44
5 changed files with 35 additions and 15 deletions

View File

@ -148,7 +148,7 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
// 接收短信
.permission(Permission.RECEIVE_SMS)
// 发送短信
.permission(Permission.SEND_SMS)
//.permission(Permission.SEND_SMS)
// 读取短信
.permission(Permission.READ_SMS)
// 读取电话状态
@ -171,22 +171,26 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
@Override
public void onGranted(List<String> permissions, boolean all) {
if (all) {
ToastUtils.show(R.string.toast_granted_all);
} else {
ToastUtils.show(R.string.toast_granted_part);
if (MyApplication.showHelpTip) {
if (all) {
ToastUtils.show(R.string.toast_granted_all);
} else {
ToastUtils.show(R.string.toast_granted_part);
}
}
SettingUtil.switchEnableSms(true);
}
@Override
public void onDenied(List<String> permissions, boolean never) {
if (never) {
ToastUtils.show(R.string.toast_denied_never);
// 如果是被永久拒绝就跳转到应用权限系统设置页面
XXPermissions.startPermissionActivity(MainActivity.this, permissions);
} else {
ToastUtils.show(R.string.toast_denied);
if (MyApplication.showHelpTip) {
if (never) {
ToastUtils.show(R.string.toast_denied_never);
// 如果是被永久拒绝就跳转到应用权限系统设置页面
XXPermissions.startPermissionActivity(MainActivity.this, permissions);
} else {
ToastUtils.show(R.string.toast_denied);
}
}
SettingUtil.switchEnableSms(false);
}

View File

@ -145,7 +145,7 @@ public class SettingActivity extends AppCompatActivity {
// 接收短信
.permission(Permission.RECEIVE_SMS)
// 发送短信
.permission(Permission.SEND_SMS)
//.permission(Permission.SEND_SMS)
// 读取短信
.permission(Permission.READ_SMS)
.request(new OnPermissionCallback() {

View File

@ -1030,12 +1030,26 @@
android:orientation="horizontal"
android:padding="15dp">
<TextView
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:text="@string/show_tips"
android:textStyle="bold" />
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_tips"
android:textStyle="bold"
tools:ignore="RelativeOverlap" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_tips2"
android:textSize="9sp"
tools:ignore="SmallSp" />
</LinearLayout>
<Switch
android:id="@+id/switch_help_tip"

View File

@ -26,6 +26,7 @@
<string name="check_for_updates">Check for updates</string>
<string name="auto_startup">Auto startup</string>
<string name="show_tips">Show tips</string>
<string name="show_tips2">Suggest old bird close prompt, the page is more refreshing, reduce pop-up prompt</string>
<string name="open_source">Repo URL</string>
<string name="synchronize_mirror">Repo Mirror</string>
<string name="qq_group">QQ Group</string>

View File

@ -26,6 +26,7 @@
<string name="check_for_updates">检查新版本</string>
<string name="auto_startup">开机启动</string>
<string name="show_tips">帮助提示</string>
<string name="show_tips2">建议老鸟关闭提示,页面更清爽,减少弹窗提示</string>
<string name="open_source">开源仓库</string>
<string name="synchronize_mirror">同步镜像</string>
<string name="qq_group">互帮互助QQ群</string>