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