daily: ui adjustment
This commit is contained in:
@@ -85,8 +85,6 @@ dependencies {
|
||||
})
|
||||
// Common Markdown
|
||||
compile 'com.github.atlassian:commonmark-java:commonmark-parent-0.9.0'
|
||||
// AlipayZeroSdk
|
||||
compile 'moe.feng:AlipayZeroSdk:1.1'
|
||||
// Android issue reporter (a github issue reporter)
|
||||
compile('com.heinrichreimersoftware:android-issue-reporter:1.3.1', {
|
||||
exclude group: 'com.afollestad.material-dialogs'
|
||||
|
||||
@@ -149,7 +149,7 @@ public class CircularMenu implements Recorder.OnStateChangedListener, LayoutInsp
|
||||
void startRecord() {
|
||||
mWindow.collapse();
|
||||
if (!RootShell.isRootAvailable()) {
|
||||
new NotAskAgainDialog.Builder(mContext, "root")
|
||||
new NotAskAgainDialog.Builder(mContext, "CircularMenu.root")
|
||||
.title(R.string.text_device_not_rooted)
|
||||
.content(R.string.prompt_device_not_rooted)
|
||||
.neutralText(R.string.text_device_rooted)
|
||||
|
||||
@@ -128,7 +128,7 @@ public class MainActivity extends BaseActivity implements OnActivityResultDelega
|
||||
if (AccessibilityServiceTool.isAccessibilityServiceEnabled(this)) {
|
||||
return;
|
||||
}
|
||||
new NotAskAgainDialog.Builder(this, "Eating...love you...miss you...17.4.12")
|
||||
new NotAskAgainDialog.Builder(this, "MainActivity.accessibility")
|
||||
.title(R.string.text_need_to_enable_accessibility_service)
|
||||
.content(R.string.explain_accessibility_permission)
|
||||
.positiveText(R.string.text_go_to_setting)
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.network.GlideApp;
|
||||
import com.stardust.scriptdroid.network.UserService;
|
||||
import com.stardust.scriptdroid.pluginclient.DevPluginClient;
|
||||
import com.stardust.scriptdroid.ui.common.NotAskAgainDialog;
|
||||
import com.stardust.scriptdroid.ui.floating.CircularMenu;
|
||||
import com.stardust.scriptdroid.ui.floating.FloatyWindowManger;
|
||||
import com.stardust.scriptdroid.network.NodeBB;
|
||||
@@ -90,6 +91,15 @@ public class DrawerFragment extends android.support.v4.app.Fragment {
|
||||
|
||||
private DrawerMenuItem mConnectionItem = new DrawerMenuItem(R.drawable.ic_debug, R.string.debug, 0, this::connectOrDisconnectToRemote);
|
||||
private DrawerMenuItem mAccessibilityServiceItem = new DrawerMenuItem(R.drawable.ic_service_green, R.string.text_accessibility_service, 0, this::enableOrDisableAccessibilityService);
|
||||
private DrawerMenuItem mStableModeItem = new DrawerMenuItem(R.drawable.ic_stable, R.string.text_stable_mode, R.string.key_stable_mode, null) {
|
||||
@Override
|
||||
public void setChecked(boolean checked) {
|
||||
super.setChecked(checked);
|
||||
if (checked)
|
||||
showStableModePromptIfNeeded();
|
||||
}
|
||||
};
|
||||
|
||||
private DrawerMenuItem mNotificationPermissionItem = new DrawerMenuItem(R.drawable.ic_ali_notification, R.string.text_notification_permission, 0, this::goToNotificationServiceSettings);
|
||||
private DrawerMenuItem mFloatingWindowItem = new DrawerMenuItem(R.drawable.ic_robot_64, R.string.text_floating_window, 0, this::showOrDismissFloatingWindow);
|
||||
private DrawerMenuItem mCheckForUpdatesItem = new DrawerMenuItem(R.drawable.ic_check_for_updates, R.string.text_check_for_updates, this::checkForUpdates);
|
||||
@@ -131,7 +141,7 @@ public class DrawerFragment extends android.support.v4.app.Fragment {
|
||||
mDrawerMenuAdapter = new DrawerMenuAdapter(new ArrayList<>(Arrays.asList(
|
||||
new DrawerMenuGroup(R.string.text_service),
|
||||
mAccessibilityServiceItem,
|
||||
new DrawerMenuItem(R.drawable.ic_stable, R.string.text_stable_mode, R.string.key_stable_mode, null),
|
||||
mStableModeItem,
|
||||
mNotificationPermissionItem,
|
||||
|
||||
new DrawerMenuGroup(R.string.text_script_record),
|
||||
@@ -378,6 +388,16 @@ public class DrawerFragment extends android.support.v4.app.Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void showStableModePromptIfNeeded() {
|
||||
new NotAskAgainDialog.Builder(getContext(), "DrawerFragment.stable_mode")
|
||||
.title(R.string.text_stable_mode)
|
||||
.content(R.string.description_stable_mode)
|
||||
.positiveText(R.string.ok)
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.stardust.scriptdroid.ui.main.drawer;
|
||||
|
||||
import android.content.pm.PackageManager;
|
||||
import android.view.View;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -70,12 +71,13 @@ public class DrawerMenuItemViewHolder extends BindableViewHolder<DrawerMenuItem>
|
||||
}
|
||||
mSwitchCompat.setVisibility(VISIBLE);
|
||||
int prefKey = item.getPrefKey();
|
||||
if(prefKey == 0){
|
||||
if (prefKey == 0) {
|
||||
mSwitchCompat.setChecked(item.isChecked());
|
||||
mSwitchCompat.setPrefKey(null);
|
||||
}else {
|
||||
} else {
|
||||
mSwitchCompat.setPrefKey(itemView.getResources().getString(prefKey));
|
||||
}
|
||||
mSwitchCompat.setOnCheckedChangeListener((buttonView, isChecked) -> mDrawerMenuItem.setChecked(isChecked));
|
||||
}
|
||||
|
||||
private void onClick() {
|
||||
|
||||
@@ -24,8 +24,6 @@ import org.androidannotations.annotations.Click;
|
||||
import org.androidannotations.annotations.EActivity;
|
||||
import org.androidannotations.annotations.ViewById;
|
||||
|
||||
import moe.feng.alipay.zerosdk.AlipayZeroSdk;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/2/2.
|
||||
*/
|
||||
@@ -70,26 +68,6 @@ public class AboutActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
|
||||
@Click(R.id.donate)
|
||||
void showDonateMeDialog() {
|
||||
new ThemeColorMaterialDialogBuilder(this)
|
||||
.title(R.string.text_donate)
|
||||
.items("支付宝")
|
||||
.itemsCallback(new MaterialDialog.ListCallback() {
|
||||
@Override
|
||||
public void onSelection(MaterialDialog dialog, View itemView, int position, CharSequence text) {
|
||||
if (position == 0) {
|
||||
if (AlipayZeroSdk.hasInstalledAlipayClient(AboutActivity.this)) {
|
||||
AlipayZeroSdk.startAlipayClient(AboutActivity.this, "aex04370fwjf8angrv1te9e");
|
||||
} else {
|
||||
Toast.makeText(AboutActivity.this, "未安装支付宝", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
@Click(R.id.share)
|
||||
void share() {
|
||||
IntentUtil.shareText(this, getString(R.string.share_app));
|
||||
|
||||
@@ -109,29 +109,4 @@
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/donate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_money_black"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/donate_developer"
|
||||
android:textColor="@android:color/secondary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/divider"/>
|
||||
</LinearLayout>
|
||||
@@ -338,4 +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>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user