version:1.6.8
fix:修复拨号界面不显示微信通话问题 update:增加合规
This commit is contained in:
@@ -287,6 +287,11 @@
|
||||
android:name=".activity.service.ServiceActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/activity_styles" />
|
||||
<activity
|
||||
android:name=".activity.privacy.PrivacyActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppWhiteThemeFitsSystem" />
|
||||
|
||||
<!-- Intent received used to install shortcuts from other applications -->
|
||||
<receiver
|
||||
|
||||
@@ -2,12 +2,10 @@ package com.xxpatx.os.activity.callwechat;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
import com.google.android.accessibility.selecttospeak.SelectToSpeakService;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.Contact;
|
||||
@@ -64,7 +62,7 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
||||
if (contact != null) {
|
||||
mContact = contact;
|
||||
mViewDataBinding.setContact(contact);
|
||||
mViewDataBinding.setTag(!TextUtils.isEmpty(contact.getTag()));
|
||||
// mViewDataBinding.setTag(!TextUtils.isEmpty(contact.getTag()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,11 +110,11 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
||||
}
|
||||
|
||||
public void callWechatVideo(View view) {
|
||||
if (TextUtils.isEmpty(mContact.getTag())) {
|
||||
Toaster.show("没有设置标签,无法拨打微信视频");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mContact.getTag())) {
|
||||
// Toaster.show("没有设置标签,无法拨打微信视频");
|
||||
// finish();
|
||||
// return;
|
||||
// }
|
||||
if (checkSettings()) {
|
||||
// 1. 获取 MediaProjectionManager 实例
|
||||
// MediaProjectionManager projectionManager = (MediaProjectionManager)
|
||||
@@ -143,11 +141,11 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
||||
}
|
||||
|
||||
public void callWechatVoice(View view) {
|
||||
if (TextUtils.isEmpty(mContact.getTag())) {
|
||||
Toaster.show("没有设置标签,无法拨打微信语音");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mContact.getTag())) {
|
||||
// Toaster.show("没有设置标签,无法拨打微信语音");
|
||||
// finish();
|
||||
// return;
|
||||
// }
|
||||
if (checkSettings()) {
|
||||
// MediaProjectionManager projectionManager = (MediaProjectionManager)
|
||||
// getSystemService(Context.MEDIA_PROJECTION_SERVICE);
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.xxpatx.os.activity.privacy;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.databinding.ActivityPrivacyBinding;
|
||||
|
||||
public class PrivacyActivity extends BaseMvvmActivity<PrivacyViewModel, ActivityPrivacyBinding> {
|
||||
private static final String TAG = "PrivacyActivity";
|
||||
|
||||
|
||||
@Override
|
||||
public boolean setNightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setfitWindow() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_privacy;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
WebSettings settings = mViewDataBinding.webView.getSettings();
|
||||
// settings.setUseWideViewPort(true);
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setAllowFileAccess(true);
|
||||
settings.setAllowContentAccess(true);
|
||||
settings.setAllowFileAccessFromFileURLs(true);
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
|
||||
mViewDataBinding.webView.setWebViewClient(new WebViewClient());
|
||||
mViewDataBinding.webView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
if (newProgress == 100) {
|
||||
mViewDataBinding.progressBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
mViewDataBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.progressBar.setMax(100);
|
||||
mViewDataBinding.progressBar.setProgress(newProgress);
|
||||
}
|
||||
}
|
||||
});
|
||||
Intent intent = getIntent();
|
||||
int contentType = intent.getIntExtra("ContentType", 1);
|
||||
switch (contentType) {
|
||||
default:
|
||||
case 1:
|
||||
mViewDataBinding.tvTitle.setText("用户协议");
|
||||
mViewDataBinding.webView.loadUrl("https://www.uiuios.com/agreement.html?section=1-1&status=1&projectId=10");
|
||||
break;
|
||||
case 2:
|
||||
mViewDataBinding.tvTitle.setText("隐私政策");
|
||||
mViewDataBinding.webView.loadUrl("https://www.uiuios.com/agreement.html?section=1-2&status=1&projectId=10");
|
||||
break;
|
||||
case 3:
|
||||
mViewDataBinding.tvTitle.setText("SDK共享清单");
|
||||
mViewDataBinding.webView.loadUrl("https://www.uiuios.com/agreement.html?section=1-3&status=1&projectId=10");
|
||||
break;
|
||||
case 4:
|
||||
mViewDataBinding.tvTitle.setText("微信一键视频、语音通话功能用户须知");
|
||||
mViewDataBinding.webView.loadUrl("https://www.uiuios.com/agreement.html?section=3-6&status=1&projectId=10");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
public void exit(View view) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xxpatx.os.activity.privacy;
|
||||
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.base.mvvm.BaseViewModel;
|
||||
import com.xxpatx.os.databinding.ActivityPrivacyBinding;
|
||||
|
||||
public class PrivacyViewModel extends BaseViewModel<ActivityPrivacyBinding, ActivityEvent> {
|
||||
|
||||
@Override
|
||||
public ActivityPrivacyBinding getVDBinding() {
|
||||
return binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import com.xxpatx.os.bean.AppInfo;
|
||||
import com.xxpatx.os.bean.SystemSettings;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
import com.xxpatx.os.databinding.ActivitySettingBinding;
|
||||
import com.xxpatx.os.fragment.dialog.PrivacyPolicyFragment;
|
||||
import com.xxpatx.os.service.main.MainService;
|
||||
import com.xxpatx.os.utils.AccessibilityUtils;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
@@ -277,21 +278,86 @@ public class SettingActivity extends BaseMvvmActivity<SettingViewModel, Activity
|
||||
}
|
||||
|
||||
public void autoAccept(View view) {
|
||||
if (AccessibilityUtils.isAccessibilitySettingsOn(SettingActivity.this)) {
|
||||
boolean autoAccept = mMMKV.decodeBool(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, false);
|
||||
Log.e(TAG, "autoAccept: autoAccept = " + autoAccept);
|
||||
mViewDataBinding.setAutoAccept(!autoAccept);
|
||||
mMMKV.encode(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, !autoAccept);
|
||||
Intent intent = new Intent(SelectToSpeakService.SETTING_AUTOMATIC_ANSWER_ACTION);
|
||||
intent.putExtra("auto_answer", !autoAccept);
|
||||
sendBroadcast(intent);
|
||||
boolean autoAccept = mMMKV.decodeBool(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, false);
|
||||
Log.e(TAG, "autoAccept: autoAccept = " + autoAccept);
|
||||
if (autoAccept) {
|
||||
mViewDataBinding.setAutoAccept(false);
|
||||
mMMKV.encode(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, false);
|
||||
} else {
|
||||
boolean floatWindowEnable = Settings.Global.getInt(getContentResolver(), CommonConfig.HOVER_HOME, CommonConfig.HOVER_HOME_STATUS) == 1;
|
||||
if (floatWindowEnable) {
|
||||
Toaster.showLong("因为系统限制,请先关闭悬浮窗功能,开启自动接听后再打开悬浮窗");
|
||||
} else {
|
||||
AccessibilityUtils.openAccessibilitySettings(SettingActivity.this);
|
||||
}
|
||||
new PrivacyPolicyFragment(new PrivacyPolicyFragment.DialogFragmentCallback() {
|
||||
@Override
|
||||
public void onPositive() {
|
||||
if (AccessibilityUtils.isAccessibilitySettingsOn(SettingActivity.this)) {
|
||||
Intent intent = new Intent(SelectToSpeakService.SETTING_AUTOMATIC_ANSWER_ACTION);
|
||||
intent.putExtra("auto_answer", true);
|
||||
sendBroadcast(intent);
|
||||
mViewDataBinding.setAutoAccept(true);
|
||||
mMMKV.encode(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, true);
|
||||
} else {
|
||||
boolean floatWindowEnable = Settings.Global.getInt(getContentResolver(), CommonConfig.HOVER_HOME, CommonConfig.HOVER_HOME_STATUS) == 1;
|
||||
if (floatWindowEnable) {
|
||||
Toaster.showLong("因为系统限制,请先关闭悬浮窗功能,开启自动接听后再打开悬浮窗");
|
||||
} else {
|
||||
AccessibilityUtils.openAccessibilitySettings(SettingActivity.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNegative() {
|
||||
Toaster.show("请先阅读并同意用户须知");
|
||||
mViewDataBinding.setAutoAccept(false);
|
||||
mMMKV.encode(CommonConfig.WECHAT_CALL_AUTO_ACCEPT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
setStatus();
|
||||
}
|
||||
}).show(getSupportFragmentManager(), PrivacyPolicyFragment.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
public void autoCall(View view) {
|
||||
boolean autoAccept = mMMKV.decodeBool(CommonConfig.WECHAT_AUTO_CALL_KEY, false);
|
||||
Log.e(TAG, "autoAccept: autoAccept = " + autoAccept);
|
||||
if (autoAccept) {
|
||||
mViewDataBinding.setAutoCall(false);
|
||||
mMMKV.encode(CommonConfig.WECHAT_AUTO_CALL_KEY, false);
|
||||
} else {
|
||||
new PrivacyPolicyFragment(new PrivacyPolicyFragment.DialogFragmentCallback() {
|
||||
@Override
|
||||
public void onPositive() {
|
||||
if (AccessibilityUtils.isAccessibilitySettingsOn(SettingActivity.this)) {
|
||||
Intent intent = new Intent(SelectToSpeakService.SETTING_AUTOMATIC_ANSWER_ACTION);
|
||||
intent.putExtra("auto_answer", true);
|
||||
sendBroadcast(intent);
|
||||
mViewDataBinding.setAutoCall(true);
|
||||
mMMKV.encode(CommonConfig.WECHAT_AUTO_CALL_KEY, true);
|
||||
} else {
|
||||
boolean floatWindowEnable = Settings.Global.getInt(getContentResolver(), CommonConfig.HOVER_HOME, CommonConfig.HOVER_HOME_STATUS) == 1;
|
||||
if (floatWindowEnable) {
|
||||
Toaster.showLong("因为系统限制,请先关闭悬浮窗功能,开启自动接听后再打开悬浮窗");
|
||||
} else {
|
||||
AccessibilityUtils.openAccessibilitySettings(SettingActivity.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNegative() {
|
||||
Toaster.show("请先阅读并同意用户须知");
|
||||
mViewDataBinding.setAutoCall(false);
|
||||
mMMKV.encode(CommonConfig.WECHAT_AUTO_CALL_KEY, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
setStatus();
|
||||
}
|
||||
}).show(getSupportFragmentManager(), PrivacyPolicyFragment.class.getSimpleName());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,10 @@ import com.xxpatx.os.utils.AppUsedTimeUtils;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
import com.xxpatx.os.utils.WiFiUtils;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class BaseApplication extends Application {
|
||||
private static final String TAG = "BaseApplication";
|
||||
|
||||
@@ -51,9 +55,16 @@ public class BaseApplication extends Application {
|
||||
Toaster.init(this);
|
||||
SpeechManager.init(this);
|
||||
|
||||
CrashReport.initCrashReport(getApplicationContext(), "09fec11058", false);
|
||||
CrashReport.setDeviceModel(getApplicationContext(), Build.MODEL);
|
||||
CrashReport.setDeviceId(this, Utils.getSerial());
|
||||
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(this);
|
||||
strategy.setDeviceID(Utils.getSerial());
|
||||
//后台不会显示
|
||||
strategy.setDeviceModel(Utils.getSerial());
|
||||
strategy.setAppChannel(Build.MODEL);
|
||||
CrashReport.initCrashReport(getApplicationContext(), "09fec11058", true, strategy);
|
||||
|
||||
// CrashReport.setDeviceId(this, Utils.getSerial());
|
||||
// CrashReport.setDeviceModel(getApplicationContext(), Build.MODEL);
|
||||
|
||||
xcrash.XCrash.init(this);
|
||||
|
||||
aliyunPushInit();
|
||||
@@ -87,6 +98,7 @@ public class BaseApplication extends Application {
|
||||
ContactCacheUtils.init(this);
|
||||
DesktopIconManager.init(this);
|
||||
ContactManager.init(this);
|
||||
hookWebView();
|
||||
}
|
||||
|
||||
private void aliyunPushInit() {
|
||||
@@ -162,5 +174,43 @@ public class BaseApplication extends Application {
|
||||
});
|
||||
}
|
||||
|
||||
public void hookWebView() {
|
||||
// if (!ApkUtils.isAvailable(mContext, chromium_pkg)) {
|
||||
// return;
|
||||
// }
|
||||
int sdkInt = Build.VERSION.SDK_INT;
|
||||
try {
|
||||
Class<?> factoryClass = Class.forName("android.webkit.WebViewFactory");
|
||||
Field field = factoryClass.getDeclaredField("sProviderInstance");
|
||||
field.setAccessible(true);
|
||||
Object sProviderInstance = field.get(null);
|
||||
if (sProviderInstance != null) {
|
||||
Log.d(TAG, "sProviderInstance isn't null");
|
||||
return;
|
||||
}
|
||||
Method getProviderClassMethod;
|
||||
if (sdkInt > 22) { // above 22
|
||||
getProviderClassMethod = factoryClass.getDeclaredMethod("getProviderClass");
|
||||
} else if (sdkInt == 22) { // method name is a little different
|
||||
getProviderClassMethod = factoryClass.getDeclaredMethod("getFactoryClass");
|
||||
} else { // no security check below 22
|
||||
Log.i(TAG, "Don't need to Hook WebView");
|
||||
return;
|
||||
}
|
||||
getProviderClassMethod.setAccessible(true);
|
||||
Class<?> providerClass = (Class<?>) getProviderClassMethod.invoke(factoryClass);
|
||||
Class<?> delegateClass = Class.forName("android.webkit.WebViewDelegate");
|
||||
Constructor<?> declaredConstructor = delegateClass.getDeclaredConstructor();
|
||||
declaredConstructor.setAccessible(true);
|
||||
sProviderInstance = providerClass
|
||||
.getDeclaredMethod("create", delegateClass)
|
||||
.invoke(providerClass, declaredConstructor.newInstance());
|
||||
Log.d("sProviderInstance", sProviderInstance.toString());
|
||||
field.set("sProviderInstance", sProviderInstance);
|
||||
Log.d(TAG, "Hook done!");
|
||||
} catch (Throwable e) {
|
||||
Log.e(TAG, "hook WebView Failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -108,6 +108,11 @@ public class CommonConfig {
|
||||
public static final String VOICE_BROADCAST = "voice_broadcast_key";
|
||||
/*微信语音自动接听*/
|
||||
public static final String WECHAT_CALL_AUTO_ACCEPT = "wechat_call_auto_accept";
|
||||
/*微信语音自动免提*/
|
||||
public static final String WECHAT_AUTO_HNADS_FREE = "wechat_auto_hands_free";
|
||||
/*是否为微信自动拨打电话*/
|
||||
public static final String WECHAT_AUTO_CALL_KEY = "wechat_auto_call_video";
|
||||
|
||||
/*app启动播报*/
|
||||
public static final String VOICE_SPEAKER_KEY = "voice_speaker";
|
||||
/*电话白名单*/
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.xxpatx.os.fragment.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.privacy.PrivacyActivity;
|
||||
import com.xxpatx.os.databinding.FragmentPrivacyPolicyBinding;
|
||||
|
||||
public class PrivacyPolicyFragment extends DialogFragment {
|
||||
private static final String TAG = "PrivacyPolicyFragment";
|
||||
|
||||
private FragmentPrivacyPolicyBinding mBinding;
|
||||
private View rootView;
|
||||
private Context mContext;
|
||||
|
||||
public interface DialogFragmentCallback {
|
||||
void onPositive();
|
||||
|
||||
void onNegative();
|
||||
|
||||
void onDismiss();
|
||||
}
|
||||
|
||||
private DialogFragmentCallback mDismissCallback;
|
||||
|
||||
public PrivacyPolicyFragment(DialogFragmentCallback dialogFragmentCallback) {
|
||||
this.mDismissCallback = dialogFragmentCallback;
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
Log.e(TAG, "onCreateView: ");
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_privacy_policy, container, false);
|
||||
mBinding.setClick(new BtnClick());
|
||||
rootView = mBinding.getRoot();
|
||||
mContext = rootView.getContext();
|
||||
initView();
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
return super.onCreateDialog(savedInstanceState);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mBinding.tvConfirm.setEnabled(false);
|
||||
mBinding.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
mBinding.tvConfirm.setEnabled(true);
|
||||
} else {
|
||||
mBinding.tvConfirm.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
SpannableString spannableString = new SpannableString(mContext.getResources().getString(R.string.user_notice));
|
||||
spannableString.setSpan(new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
// String url = "https://www.uiuios.com/agreement.html?section=1-1&status=1";
|
||||
// CustomTabsIntent intent = new CustomTabsIntent.Builder().build();
|
||||
// try {
|
||||
// intent.launchUrl(mContext, Uri.parse(url));
|
||||
// } catch (Exception e) {
|
||||
// Log.e(TAG, "onClick: " + e.getMessage());
|
||||
// }
|
||||
|
||||
Intent intent = new Intent(mContext, PrivacyActivity.class);
|
||||
intent.putExtra("ContentType", 4);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
}, 0, spannableString.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
spannableString.setSpan(new ForegroundColorSpan(Color.BLUE), 0, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
mBinding.tvUserNotice.setText(spannableString);
|
||||
mBinding.tvUserNotice.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (getDialog() != null) {
|
||||
Window window = getDialog().getWindow();
|
||||
if (window == null) return;
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(params);
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
getDialog().setCancelable(true);
|
||||
getDialog().setCanceledOnTouchOutside(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(FragmentManager manager, String tag) {
|
||||
DialogFragment fragment = (DialogFragment) manager.findFragmentByTag(tag);
|
||||
if (fragment != null && fragment.isAdded()
|
||||
&& fragment.getDialog() != null && fragment.getDialog().isShowing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
FragmentTransaction ft = manager.beginTransaction();
|
||||
ft.add(this, tag);
|
||||
ft.commitAllowingStateLoss();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "show: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
if (mDismissCallback != null) {
|
||||
mDismissCallback.onDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
|
||||
public void onPositiveClick(View view) {
|
||||
if (mBinding.checkBox.isChecked()) {
|
||||
if (mDismissCallback != null) {
|
||||
mDismissCallback.onPositive();
|
||||
}
|
||||
dismiss();
|
||||
} else {
|
||||
if (mDismissCallback != null) {
|
||||
mDismissCallback.onNegative();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onRead(View view) {
|
||||
mBinding.checkBox.setChecked(!mBinding.checkBox.isChecked());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -313,12 +313,16 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
if (baseResponse.code == 200) {
|
||||
ClockSetting clockSetting = baseResponse.data;
|
||||
String time = clockSetting.getClock();
|
||||
List<Integer> integers = new ArrayList<>();
|
||||
List<String> timeLsit = new ArrayList<>(Arrays.asList(time.split(",")));
|
||||
for (String s : timeLsit) {
|
||||
integers.add(Integer.parseInt(s));
|
||||
if (!TextUtils.isEmpty(time)) {
|
||||
List<Integer> integers = new ArrayList<>();
|
||||
List<String> timeLsit = new ArrayList<>(Arrays.asList(time.split(",")));
|
||||
for (String s : timeLsit) {
|
||||
integers.add(Integer.parseInt(s));
|
||||
}
|
||||
mMMKV.encode(CommonConfig.TIME_HOUR_LIST_KEY, GsonUtils.toJSONString(integers));
|
||||
} else {
|
||||
mMMKV.encode(CommonConfig.TIME_HOUR_LIST_KEY, "");
|
||||
}
|
||||
mMMKV.encode(CommonConfig.TIME_HOUR_LIST_KEY, GsonUtils.toJSONString(integers));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/icon_back_black.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_back_black.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
9
app/src/main/res/drawable/ic_negative.xml
Normal file
9
app/src/main/res/drawable/ic_negative.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="#CDE0FF"
|
||||
android:pathData="M512,512m-448,0a448,448 0,1 0,896 0,448 448,0 1,0 -896,0Z" />
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_positive.xml
Normal file
10
app/src/main/res/drawable/ic_positive.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
|
||||
<path
|
||||
android:fillColor="#0362ff"
|
||||
android:pathData="M511.6,63.6c-246.9,0 -448,201.2 -448,448 0,247.3 201.2,448 448,448s448,-200.7 448,-448c0,-246.9 -200.7,-448 -448,-448zM771.5,382.1L474.6,699.3c-7,7.3 -16.5,12.1 -27.4,12.1 -10.5,0 -20.5,-4.7 -27.4,-12.1L252,520c-7,-7.3 -11.5,-17.8 -11.5,-29.4 0,-23.1 17.5,-41.4 38.9,-41.4 10.5,0 20.5,4.7 27.4,12.1l140.7,149.9 270,-287.8c7,-7.3 16.5,-12.1 27.4,-12.1 21.5,0 38.9,18.3 38.9,41.4 -0.8,11.6 -5.3,22.1 -12.3,29.4zM771.5,382.1" />
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/policy_checkbox_bg.xml
Normal file
5
app/src/main/res/drawable/policy_checkbox_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="true" android:state_checked="false" android:drawable="@drawable/ic_negative" />
|
||||
<item android:state_enabled="true" android:state_checked="true" android:drawable="@drawable/ic_positive" />
|
||||
</selector>
|
||||
25
app/src/main/res/drawable/privacy_policy_card_bg.xml
Normal file
25
app/src/main/res/drawable/privacy_policy_card_bg.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 填充的颜色:这里设置背景透明 -->
|
||||
<solid android:color="#FFFFFF" />
|
||||
<!-- 边框的颜色 :不能和窗口背景色一样 -->
|
||||
|
||||
<!-- 设置按钮的四个角为弧形 -->
|
||||
<!-- android:radius 弧形的半径 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="12dp" />
|
||||
|
||||
|
||||
<!-- padding:Button里面的文字与Button边界的间隔 -->
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="10dp"-->
|
||||
<!-- android:left="10dp"-->
|
||||
<!-- android:right="10dp"-->
|
||||
<!-- android:top="10dp" />-->
|
||||
|
||||
</shape>
|
||||
23
app/src/main/res/drawable/privacy_policy_negative_bg.xml
Normal file
23
app/src/main/res/drawable/privacy_policy_negative_bg.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 填充的颜色:这里设置背景透明 -->
|
||||
<solid android:color="#CDE0FF" />
|
||||
<!-- 边框的颜色 :不能和窗口背景色一样 -->
|
||||
|
||||
<!-- 设置按钮的四个角为弧形 -->
|
||||
<!-- android:radius 弧形的半径 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="12dp" />
|
||||
|
||||
|
||||
<!-- padding:Button里面的文字与Button边界的间隔 -->
|
||||
<padding
|
||||
android:bottom="8dp"
|
||||
android:top="8dp" />
|
||||
|
||||
</shape>
|
||||
23
app/src/main/res/drawable/privacy_policy_positive_bg.xml
Normal file
23
app/src/main/res/drawable/privacy_policy_positive_bg.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<!-- 填充的颜色:这里设置背景透明 -->
|
||||
<solid android:color="#0362FF" />
|
||||
<!-- 边框的颜色 :不能和窗口背景色一样 -->
|
||||
|
||||
<!-- 设置按钮的四个角为弧形 -->
|
||||
<!-- android:radius 弧形的半径 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="12dp"
|
||||
android:bottomRightRadius="12dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="12dp" />
|
||||
|
||||
|
||||
<!-- padding:Button里面的文字与Button边界的间隔 -->
|
||||
<padding
|
||||
android:bottom="8dp"
|
||||
android:top="8dp" />
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 没有焦点时的背景颜色 -->
|
||||
<item android:drawable="@drawable/privacy_policy_positive_bg" android:state_enabled="true" />
|
||||
<!-- <!– 非触摸模式下获得焦点并单击时的背景颜色 –>-->
|
||||
<!-- <item android:drawable="@drawable/privacy_policy_positive_bg" android:state_focused="true" android:state_pressed="true" />-->
|
||||
<!-- <!– 触摸模式下单击时的背景颜色 –>-->
|
||||
<!-- <item android:drawable="@drawable/privacy_policy_positive_bg" android:state_focused="false" android:state_pressed="true" />-->
|
||||
<!-- <!– 选中时的背景颜色 –>-->
|
||||
<!-- <item android:drawable="@drawable/privacy_policy_positive_bg" android:state_selected="true" />-->
|
||||
<!-- <!– 获得焦点时的背景 颜色 –>-->
|
||||
<!-- <item android:drawable="@drawable/privacy_policy_positive_bg" android:state_focused="true" />-->
|
||||
|
||||
<item android:drawable="@drawable/privacy_policy_negative_bg" android:state_enabled="false" />
|
||||
</selector>
|
||||
26
app/src/main/res/drawable/progress_background.xml
Normal file
26
app/src/main/res/drawable/progress_background.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:centerColor="#E3E3E3"
|
||||
android:endColor="#E6E6E6"
|
||||
android:startColor="#C8C8C8" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<gradient
|
||||
android:centerColor="#2196F3"
|
||||
android:endColor="#2196F3"
|
||||
android:startColor="#2099FA" />
|
||||
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
72
app/src/main/res/layout/activity_privacy.xml
Normal file
72
app/src/main/res/layout/activity_privacy.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.privacy.PrivacyActivity">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xxpatx.os.activity.privacy.PrivacyActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::exit}"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_back_black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:maxLines="1"
|
||||
android:text="隐私协议"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:progressDrawable="@drawable/progress_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/cl_bar" />
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -22,6 +22,10 @@
|
||||
name="auto_accept"
|
||||
type="Boolean" />
|
||||
|
||||
<variable
|
||||
name="auto_call"
|
||||
type="Boolean" />
|
||||
|
||||
<variable
|
||||
name="dial_tone"
|
||||
type="Boolean" />
|
||||
@@ -102,7 +106,7 @@
|
||||
android:onClick="@{click::openFloat}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -110,14 +114,15 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{float_window_enable?"已开启":"未开启"}'
|
||||
@@ -143,7 +148,7 @@
|
||||
android:onClick="@{click::voiceBroadcast}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -151,13 +156,14 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{voice_broadcast?"已开启":"未开启"}'
|
||||
@@ -182,7 +188,7 @@
|
||||
android:onClick="@{click::autoAccept}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -190,14 +196,15 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{auto_accept?"已开启":"未开启"}'
|
||||
@@ -216,13 +223,55 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:onClick="@{click::autoCall}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
android:text="微信自动拨打视频"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{auto_call?"已开启":"未开启"}'
|
||||
android:textColor="@{auto_call?@color/setting_enable_color:@color/setting_disable_color}"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="未开启" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/lightGray"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:onClick="@{click::setDialTone}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -230,14 +279,15 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{dial_tone?"已开启":"未开启"}'
|
||||
@@ -262,7 +312,7 @@
|
||||
android:onClick="@{click::setStatusBar}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -270,14 +320,15 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{status_bar?"已开启":"未开启"}'
|
||||
@@ -302,7 +353,7 @@
|
||||
android:onClick="@{click::setHourlyTimeSignal}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -310,14 +361,15 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView7"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{hourly_time?"已开启":"未开启"}'
|
||||
@@ -342,7 +394,7 @@
|
||||
android:onClick="@{click::appSpeak}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:maxLines="1"
|
||||
@@ -350,13 +402,14 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView8"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxLines="1"
|
||||
android:text='@{voiceSpeaker?"已开启":"未开启"}'
|
||||
|
||||
@@ -209,15 +209,13 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="310dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/icon_wechat_call_voice"
|
||||
android:onClick="@{click::callWechatVoice}"
|
||||
android:visibility="@{tag==true?View.VISIBLE:View.GONE}">
|
||||
android:onClick="@{click::callWechatVoice}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -236,13 +234,12 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="310dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/icon_wechat_call_video"
|
||||
android:onClick="@{click::callWechatVideo}"
|
||||
android:visibility="@{tag==true?View.VISIBLE:View.GONE}">
|
||||
android:onClick="@{click::callWechatVideo}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -261,7 +258,7 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="310dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
@@ -285,7 +282,7 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="310dp"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
|
||||
137
app/src/main/res/layout/fragment_privacy_policy.xml
Normal file
137
app/src/main/res/layout/fragment_privacy_policy.xml
Normal file
@@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".fragment.dialog.PrivacyPolicyFragment">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.xxpatx.os.fragment.dialog.PrivacyPolicyFragment.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/privacy_policy_card_bg"
|
||||
android:maxHeight="500dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="功能开启提醒"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout7"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/wechat_auto_call_hint"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="17sp" />
|
||||
</ScrollView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{click::onRead}">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:button="@drawable/policy_checkbox_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_notice"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@string/user_notice"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/checkBox"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/privacy_policy_positive_selector"
|
||||
android:enabled="false"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:onClick="@{click::onPositiveClick}"
|
||||
android:singleLine="true"
|
||||
android:text="我已知晓并需要启动此功能"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="17sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -16,6 +16,9 @@
|
||||
<string name="title_activity_settings">Settings</string>
|
||||
<string name="clear_app_size">已清理%d个应用</string>
|
||||
|
||||
<string name="wechat_auto_call_hint">您当前要开启微信自动拨打视频、语音、自动接听等功能,此功能需要开启系统的无障碍服务才能实现。用户在开启前需要明确知晓其风险,请详细查看协议内容,用户同意后方可使用此功能。</string>
|
||||
<string name="user_notice">《微信一键视频、语音通话功能用户须知》</string>
|
||||
|
||||
<!-- Preference Titles -->
|
||||
<string name="messages_header">Messages</string>
|
||||
<string name="sync_header">Sync</string>
|
||||
|
||||
@@ -26,6 +26,15 @@
|
||||
<item name="android:windowBackground">@color/gray</item>
|
||||
</style>
|
||||
|
||||
<style name="AppWhiteThemeFitsSystem" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/gray</item>
|
||||
<item name="colorPrimaryDark">@color/gray</item>
|
||||
<item name="colorAccent">@color/gray</item>
|
||||
<item name="android:windowBackground">@color/gray</item>
|
||||
<item name="android:fitsSystemWindows">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppBlackTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/black</item>
|
||||
|
||||
Reference in New Issue
Block a user