mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
daily: ui adjustment
This commit is contained in:
parent
b860c9ee5b
commit
7908190ab6
@ -59,14 +59,16 @@ public class FloatyWindowManger {
|
||||
return sCircularMenu != null && sCircularMenu.get() != null;
|
||||
}
|
||||
|
||||
public static void showCircularMenu() {
|
||||
public static boolean showCircularMenu() {
|
||||
if (!SettingsCompat.canDrawOverlays(App.getApp())) {
|
||||
Toast.makeText(App.getApp(), R.string.text_no_floating_window_permission, Toast.LENGTH_SHORT).show();
|
||||
manageDrawOverlays(App.getApp());
|
||||
return false;
|
||||
} else {
|
||||
App.getApp().startService(new Intent(App.getApp(), FloatyService.class));
|
||||
CircularMenu menu = new CircularMenu(App.getApp());
|
||||
sCircularMenu = new WeakReference<>(menu);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -203,7 +203,7 @@ public class DrawerFragment extends android.support.v4.app.Fragment {
|
||||
Pref.setFloatingMenuShown(checked);
|
||||
}
|
||||
if (checked && !isFloatingWindowShowing) {
|
||||
FloatyWindowManger.showCircularMenu();
|
||||
setChecked(mFloatingWindowItem, FloatyWindowManger.showCircularMenu());
|
||||
enableAccessibilityServiceByRootIfNeeded();
|
||||
} else if (!checked && isFloatingWindowShowing) {
|
||||
FloatyWindowManger.hideCircularMenu();
|
||||
|
||||
@ -77,10 +77,10 @@ public class DrawerMenuItemViewHolder extends BindableViewHolder<DrawerMenuItem>
|
||||
} else {
|
||||
mSwitchCompat.setPrefKey(itemView.getResources().getString(prefKey));
|
||||
}
|
||||
mSwitchCompat.setOnCheckedChangeListener((buttonView, isChecked) -> mDrawerMenuItem.setChecked(isChecked));
|
||||
}
|
||||
|
||||
private void onClick() {
|
||||
mDrawerMenuItem.setChecked(mSwitchCompat.isChecked());
|
||||
if (mAntiShake && (System.currentTimeMillis() - mLastClickMillis < CLICK_TIMEOUT)) {
|
||||
Toast.makeText(itemView.getContext(), R.string.text_click_too_frequently, Toast.LENGTH_SHORT).show();
|
||||
mSwitchCompat.setChecked(!mSwitchCompat.isChecked(), false);
|
||||
|
||||
@ -338,5 +338,5 @@
|
||||
<string name="nodebb_error_change_password_error_match">两次输入的密码不一致</string>
|
||||
<string name="text_logout">退出登录</string>
|
||||
<string name="nodebb_error_forbidden">操作失败,请稍后重试</string>
|
||||
<string name="description_stable_mode">稳定模式通过省略布局细节使脚本抓取布局时更稳定,但同时获取到的屏幕上的控件可能会减少。</string>
|
||||
<string name="description_stable_mode">稳定模式通过省略布局细节使脚本抓取布局时更稳定,但同时获取到的屏幕上的控件可能会减少。\n\n重新启动无障碍服务才能生效。</string>
|
||||
</resources>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user