@@ -7,9 +7,9 @@ android {
|
||||
buildToolsVersion "25.0.2"
|
||||
defaultConfig {
|
||||
applicationId "com.stardust.scriptdroid"
|
||||
minSdkVersion 19
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 23
|
||||
versionCode 142
|
||||
versionCode 143
|
||||
versionName "2.0.13 Beta2"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
@@ -118,7 +118,7 @@ dependencies {
|
||||
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
|
||||
compile 'com.ashokvarma.android:bottom-navigation-bar:2.0.1'
|
||||
// Tasker Plugin
|
||||
compile group: 'com.twofortyfouram', name: 'android-plugin-client-sdk-for-locale', version: '[4.0.2, 5.0['
|
||||
compile 'com.twofortyfouram:android-plugin-client-sdk-for-locale:[4.0.2, 5.0['
|
||||
compile 'com.android.volley:volley:1.0.0'
|
||||
compile 'com.flurry.android:analytics:7.0.0@aar'
|
||||
compile 'com.pushtorefresh.storio:sqlite:1.12.3'
|
||||
@@ -134,4 +134,5 @@ dependencies {
|
||||
compile project(':automator')
|
||||
compile project(':common')
|
||||
compile project(':autojs')
|
||||
compile files('libs/GDTUnionSDK.4.9.545.min.jar')
|
||||
}
|
||||
BIN
app/libs/GDTUnionSDK.4.9.545.min.jar
Normal file
BIN
app/libs/GDTUnionSDK.4.9.545.min.jar
Normal file
Binary file not shown.
@@ -9,10 +9,11 @@
|
||||
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.READ_LOGS"/>
|
||||
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||
|
||||
<!-- Ad SDK Permissions -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||
|
||||
|
||||
<application
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
@@ -23,6 +24,18 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="android:label, android:icon, android:allowBackup">
|
||||
|
||||
<activity
|
||||
android:name=".ui.splash.SplashActivity_"
|
||||
android:hardwareAccelerated="true"
|
||||
android:label="@string/_app_name"
|
||||
android:theme="@style/AppTheme.Splash">
|
||||
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.main.MainActivity_"
|
||||
android:hardwareAccelerated="true"
|
||||
@@ -30,10 +43,6 @@
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppTheme.FullScreen">
|
||||
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
@@ -231,6 +240,15 @@
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- 声明广告SDK所需要的组件 -->
|
||||
<service
|
||||
android:name="com.qq.e.comm.DownloadService"
|
||||
android:exported="false"/>
|
||||
<activity
|
||||
android:name="com.qq.e.ads.ADActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
10
app/src/main/java/com/stardust/scriptdroid/Constants.java
Normal file
10
app/src/main/java/com/stardust/scriptdroid/Constants.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.stardust.scriptdroid;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/7/7.
|
||||
*/
|
||||
|
||||
public final class Constants {
|
||||
public static final String APP_ID = "1105513627";
|
||||
public static final String SPLASH_POS_ID = "3050728349211259";
|
||||
}
|
||||
@@ -11,6 +11,8 @@ import com.stardust.scriptdroid.autojs.AutoJs;
|
||||
import org.mozilla.javascript.tools.debugger.Dim;
|
||||
import org.mozilla.javascript.tools.debugger.GuiCallback;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/1/31.
|
||||
*/
|
||||
@@ -19,6 +21,8 @@ public class Pref {
|
||||
private static final SharedPreferences DISPOSABLE_BOOLEAN = App.getApp().getSharedPreferences("DISPOSABLE_BOOLEAN", Context.MODE_PRIVATE);
|
||||
private static final String KEY_SERVER_ADDRESS = "Still love you...17.5.14";
|
||||
private static final String KEY_SHOULD_SHOW_ANNUNCIATION = "Sing about all the things you forgot, things you are not";
|
||||
private static final String KEY_FIRST_SHOW_AD = "En, Today is 17.7.7, but, I'm still love you so....";
|
||||
private static final String KEY_LAST_SHOW_AD_MILLIS = "But... it seems that...you will not come back any more...";
|
||||
private static SharedPreferences.OnSharedPreferenceChangeListener onSharedPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
@@ -129,4 +133,26 @@ public class Pref {
|
||||
public static boolean shouldShowAnnunciation() {
|
||||
return getDisposableBoolean(KEY_SHOULD_SHOW_ANNUNCIATION, true);
|
||||
}
|
||||
|
||||
public static boolean shouldShowAd() {
|
||||
String adShowingMode = def().getString(getString(R.string.key_ad_showing_mode), "Default");
|
||||
switch (adShowingMode) {
|
||||
case "Default":
|
||||
return true;
|
||||
case "OncePerDay":
|
||||
long lastShowMillis = def().getLong(KEY_LAST_SHOW_AD_MILLIS, 0);
|
||||
if (System.currentTimeMillis() - lastShowMillis < TimeUnit.DAYS.toMillis(1)) {
|
||||
return false;
|
||||
}
|
||||
def().edit().putLong(KEY_LAST_SHOW_AD_MILLIS, System.currentTimeMillis()).apply();
|
||||
return true;
|
||||
case "Off":
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isFirstShowingAd() {
|
||||
return getDisposableBoolean(KEY_FIRST_SHOW_AD, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.stardust.scriptdroid.external.floatingwindow;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.stardust.scriptdroid.App;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.HoverMenuService;
|
||||
import com.stardust.util.IntentUtil;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/3/10.
|
||||
*/
|
||||
|
||||
public class FloatingWindowManger {
|
||||
|
||||
private static final String KEY_FLOATING_WINDOW_PERMISSION = "May we go back..I...miss..you..Eating..17.5.9";
|
||||
private static final String TAG = "FloatingWindowManger";
|
||||
|
||||
public static void showHoverMenu() {
|
||||
if (!HoverMenuService.isServiceRunning()) {
|
||||
if (!hasFloatingWindowPermission(App.getApp())) {
|
||||
Toast.makeText(App.getApp(), R.string.text_no_floating_window_permission, Toast.LENGTH_SHORT).show();
|
||||
goToFloatingWindowPermissionSetting();
|
||||
} else {
|
||||
HoverMenuService.startService(App.getApp());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void goToFloatingWindowPermissionSetting() {
|
||||
IntentUtil.goToAppDetailSettings(App.getApp());
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
private static void goToOverlayPermissionSettings(Context context, String packageName) {
|
||||
try {
|
||||
App.getApp().startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
|
||||
Uri.parse("package:" + context))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
} catch (Exception e) {
|
||||
IntentUtil.goToAppDetailSettings(App.getApp());
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkPermission() {
|
||||
final OverlayPermissionChecker checker = new OverlayPermissionChecker(App.getApp());
|
||||
checker.setCallback(new OverlayPermissionChecker.Callback() {
|
||||
@Override
|
||||
public void onCheckResult(boolean granted) {
|
||||
checker.setCallback(null);
|
||||
Log.d(TAG, "onCheckResult:" + granted);
|
||||
setHasFloatingWindowPermission(App.getApp(), granted);
|
||||
}
|
||||
});
|
||||
checker.check(1500);
|
||||
}
|
||||
|
||||
public static boolean hasFloatingWindowPermission(Context context) {
|
||||
return hasOverlayPermission();
|
||||
}
|
||||
|
||||
private static void setHasFloatingWindowPermission(Context context, boolean has) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(KEY_FLOATING_WINDOW_PERMISSION, has).apply();
|
||||
}
|
||||
|
||||
private static boolean hasOverlayPermission() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return Settings.canDrawOverlays(App.getApp());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isHoverMenuShowing() {
|
||||
return HoverMenuService.isServiceRunning();
|
||||
}
|
||||
|
||||
|
||||
public static void hideHoverMenu() {
|
||||
if (HoverMenuService.isServiceRunning())
|
||||
App.getApp().stopService(new Intent(App.getApp(), HoverMenuService.class));
|
||||
}
|
||||
}
|
||||
48
app/src/main/java/com/stardust/scriptdroid/external/floatingwindow/HoverMenuManger.java
vendored
Normal file
48
app/src/main/java/com/stardust/scriptdroid/external/floatingwindow/HoverMenuManger.java
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.stardust.scriptdroid.external.floatingwindow;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.stardust.scriptdroid.App;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.HoverMenuService;
|
||||
import com.stardust.util.IntentUtil;
|
||||
|
||||
import ezy.assist.compat.SettingsCompat;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/3/10.
|
||||
*/
|
||||
|
||||
public class HoverMenuManger {
|
||||
|
||||
private static final String KEY_FLOATING_WINDOW_PERMISSION = "May we go back..I...miss..you..Eating..17.5.9";
|
||||
private static final String TAG = "HoverMenuManger";
|
||||
|
||||
public static void showHoverMenu() {
|
||||
if (!HoverMenuService.isServiceRunning()) {
|
||||
if (!SettingsCompat.canDrawOverlays(App.getApp())) {
|
||||
Toast.makeText(App.getApp(), R.string.text_no_floating_window_permission, Toast.LENGTH_SHORT).show();
|
||||
SettingsCompat.manageDrawOverlays(App.getApp());
|
||||
} else {
|
||||
HoverMenuService.startService(App.getApp());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isHoverMenuShowing() {
|
||||
return HoverMenuService.isServiceRunning();
|
||||
}
|
||||
|
||||
|
||||
public static void hideHoverMenu() {
|
||||
App.getApp().stopService(new Intent(App.getApp(), HoverMenuService.class));
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
package com.stardust.scriptdroid.external.floatingwindow;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Handler;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.stardust.enhancedfloaty.FloatyService;
|
||||
import com.stardust.enhancedfloaty.FloatyWindow;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/5/9.
|
||||
*/
|
||||
|
||||
public class OverlayPermissionChecker {
|
||||
|
||||
public interface Callback {
|
||||
void onCheckResult(boolean granted);
|
||||
}
|
||||
|
||||
private OnePixelWindow mOnePixelWindow = new OnePixelWindow();
|
||||
private Callback mCallback;
|
||||
private Context mContext;
|
||||
private Handler mHandler;
|
||||
private Boolean mCheckResult = null;
|
||||
|
||||
public OverlayPermissionChecker(Context context) {
|
||||
mContext = context;
|
||||
mHandler = new Handler(context.getMainLooper());
|
||||
}
|
||||
|
||||
public void check() {
|
||||
mCheckResult = null;
|
||||
try {
|
||||
FloatyService.addWindow(mOnePixelWindow);
|
||||
mContext.startService(new Intent(mContext, FloatyService.class));
|
||||
} catch (WindowManager.BadTokenException e) {
|
||||
onCheckResult(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void check(int timeOut) {
|
||||
check();
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mCheckResult == null) {
|
||||
onCheckResult(false);
|
||||
}
|
||||
}
|
||||
}, timeOut);
|
||||
}
|
||||
|
||||
public void setCallback(Callback callback) {
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
private void onCheckResult(boolean b) {
|
||||
mCheckResult = b;
|
||||
if (mCallback != null) {
|
||||
mCallback.onCheckResult(b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class OnePixelWindow implements FloatyWindow {
|
||||
|
||||
private View mOnePixelView;
|
||||
private WindowManager mWindowManager;
|
||||
|
||||
@Override
|
||||
public void onCreate(FloatyService floatyService, WindowManager windowManager) {
|
||||
mWindowManager = windowManager;
|
||||
mOnePixelView = new View(floatyService) {
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
notifyWindowVisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onWindowVisibilityChanged(int visibility) {
|
||||
super.onWindowVisibilityChanged(visibility);
|
||||
}
|
||||
};
|
||||
mOnePixelView.setWillNotDraw(false);
|
||||
mOnePixelView.setBackgroundColor(Color.RED);
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams(10, 10,
|
||||
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
|
||||
PixelFormat.TRANSLUCENT);
|
||||
params.gravity = Gravity.TOP | Gravity.START;
|
||||
windowManager.addView(mOnePixelView, params);
|
||||
}
|
||||
|
||||
private void notifyWindowVisible() {
|
||||
onCheckResult(true);
|
||||
//close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDestroy(FloatyService floatyService) {
|
||||
close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
mWindowManager.removeView(mOnePixelView);
|
||||
FloatyService.removeWindow(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import com.stardust.hover.SimpleHoverMenuTransitionListener;
|
||||
import com.stardust.hover.WindowHoverMenu;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.FloatingWindowManger;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.layout_inspector.NodeInfo;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.view.FloatingLayoutBoundsView;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.view.FloatingLayoutHierarchyView;
|
||||
@@ -29,6 +28,7 @@ import com.stardust.util.MessageIntent;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import ezy.assist.compat.SettingsCompat;
|
||||
import io.mattcarroll.hover.HoverMenu;
|
||||
import io.mattcarroll.hover.defaulthovermenu.window.WindowViewController;
|
||||
|
||||
@@ -129,7 +129,7 @@ public class HoverMenuService extends Service {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, R.string.text_no_floating_window_permission, Toast.LENGTH_SHORT).show();
|
||||
FloatingWindowManger.goToFloatingWindowPermissionSetting();
|
||||
SettingsCompat.manageDrawOverlays(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.HoverMenuService;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.layout_inspector.LayoutInspector;
|
||||
import com.stardust.scriptdroid.tool.AccessibilityServiceTool;
|
||||
import com.stardust.scriptdroid.ui.main.MainActivity_;
|
||||
import com.stardust.util.ClipboardUtil;
|
||||
import com.stardust.util.MessageEvent;
|
||||
@@ -87,6 +88,12 @@ public class MainMenuNavigatorContent implements NavigatorContent {
|
||||
HoverMenuService.postIntent(new Intent(HoverMenuService.ACTION_COLLAPSE_MENU));
|
||||
}
|
||||
|
||||
@OnClick(R.id.open_accessibility_settings)
|
||||
void openAccessibilitySettings() {
|
||||
AccessibilityServiceTool.enableAccessibilityService();
|
||||
HoverMenuService.postIntent(new Intent(HoverMenuService.ACTION_COLLAPSE_MENU));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView() {
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.workground.WrapContentLinearLayoutManager;
|
||||
|
||||
import com.stardust.scriptdroid.R;
|
||||
@@ -14,6 +15,7 @@ import com.stardust.scriptdroid.external.floatingwindow.menu.HoverMenuService;
|
||||
import com.stardust.scriptdroid.script.ScriptFile;
|
||||
import com.stardust.scriptdroid.script.Scripts;
|
||||
import com.stardust.scriptdroid.script.StorageScriptProvider;
|
||||
import com.stardust.scriptdroid.ui.common.ScriptLoopDialog;
|
||||
import com.stardust.scriptdroid.ui.edit.EditActivity;
|
||||
import com.stardust.scriptdroid.ui.main.script_list.ScriptAndFolderListRecyclerView;
|
||||
import com.stardust.scriptdroid.ui.main.script_list.ScriptListWithProgressBarView;
|
||||
@@ -88,18 +90,33 @@ public class ScriptListNavigatorContent implements NavigatorContent {
|
||||
|
||||
private class FileViewHolder extends DirectoryViewHolder {
|
||||
|
||||
FileViewHolder(View itemView) {
|
||||
FileViewHolder(final View itemView) {
|
||||
super(itemView);
|
||||
itemView.findViewById(R.id.edit).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = mFloatingScriptFileListView.getChildViewHolder((View) v.getParent()).getAdapterPosition();
|
||||
ScriptFile file = mFloatingScriptFileListView.getAdapter().getScriptFileAt(position);
|
||||
EditActivity.editFile(v.getContext(), file);
|
||||
EditActivity.editFile(v.getContext(), getScriptFile());
|
||||
HoverMenuService.postIntent(new Intent(HoverMenuService.ACTION_COLLAPSE_MENU));
|
||||
}
|
||||
});
|
||||
itemView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
new ScriptLoopDialog(v.getContext(), getScriptFile())
|
||||
.windowType(WindowManager.LayoutParams.TYPE_PHONE)
|
||||
.show();
|
||||
HoverMenuService.postIntent(new Intent(HoverMenuService.ACTION_COLLAPSE_MENU));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ScriptFile getScriptFile() {
|
||||
return mFloatingScriptFileListView.getAdapter().getScriptFileAt(getAdapterPosition());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -111,4 +111,12 @@ public class Scripts {
|
||||
return AutoJs.getInstance().getScriptEngineService().execute(source, BROADCAST_SENDER_SCRIPT_EXECUTION_LISTENER,
|
||||
new ExecutionConfig().requirePath(StorageScriptProvider.DEFAULT_DIRECTORY_PATH));
|
||||
}
|
||||
|
||||
public static ScriptExecution runRepeatedly(ScriptFile scriptFile, int loopTimes, long delay, long interval) {
|
||||
ScriptSource source = new FileScriptSource(scriptFile);
|
||||
String directoryPath = scriptFile.getParent();
|
||||
return AutoJs.getInstance().getScriptEngineService().execute(source, new ExecutionConfig()
|
||||
.requirePath(directoryPath, StorageScriptProvider.DEFAULT_DIRECTORY_PATH)
|
||||
.loop(delay, loopTimes, interval));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class SublimePluginClient {
|
||||
private void tryClose() {
|
||||
try {
|
||||
close();
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,11 @@ import com.google.gson.JsonObject;
|
||||
import com.stardust.autojs.execution.ScriptExecution;
|
||||
import com.stardust.autojs.script.StringScriptSource;
|
||||
import com.stardust.pio.PFile;
|
||||
import com.stardust.scriptdroid.App;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||
import com.stardust.scriptdroid.script.Scripts;
|
||||
import com.stardust.scriptdroid.script.StorageScriptProvider;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/5/11.
|
||||
@@ -39,6 +42,15 @@ public class SublimeResponseHandler implements Handler {
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.handler("save", new Handler() {
|
||||
@Override
|
||||
public boolean handle(JsonObject data) {
|
||||
String script = data.get("script").getAsString();
|
||||
String name = getName(data);
|
||||
saveScript(name, script);
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.handler("rerun", new Handler() {
|
||||
|
||||
@Override
|
||||
@@ -91,4 +103,18 @@ public class SublimeResponseHandler implements Handler {
|
||||
}
|
||||
return element.getAsString();
|
||||
}
|
||||
|
||||
private void saveScript(String name, String script) {
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
name = "untitled";
|
||||
}
|
||||
name = PFile.getNameWithoutExtension(name);
|
||||
if (!name.endsWith(".js")) {
|
||||
name = "<remote>" + name + ".js";
|
||||
} else {
|
||||
name = "<remote>" + name;
|
||||
}
|
||||
PFile.write(StorageScriptProvider.DEFAULT_DIRECTORY_PATH + name, script);
|
||||
App.getApp().getUiHandler().toast(R.string.text_script_save_successfully);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.stardust.scriptdroid.ui.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.TextInputEditText;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.DialogAction;
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.stardust.scriptdroid.App;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.script.ScriptFile;
|
||||
import com.stardust.scriptdroid.script.Scripts;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/7/8.
|
||||
*/
|
||||
|
||||
public class ScriptLoopDialog {
|
||||
|
||||
private ScriptFile mScriptFile;
|
||||
private MaterialDialog mDialog;
|
||||
|
||||
@BindView(R.id.loop_times)
|
||||
TextInputEditText mLoopTimes;
|
||||
|
||||
@BindView(R.id.loop_interval)
|
||||
TextInputEditText mLoopInterval;
|
||||
|
||||
@BindView(R.id.loop_delay)
|
||||
TextInputEditText mLoopDelay;
|
||||
|
||||
|
||||
public ScriptLoopDialog(Context context, ScriptFile file) {
|
||||
mScriptFile = file;
|
||||
View view = View.inflate(context, R.layout.dialog_script_loop, null);
|
||||
mDialog = new MaterialDialog.Builder(context)
|
||||
.title(R.string.text_run_repeatedly)
|
||||
.customView(view, true)
|
||||
.positiveText(R.string.ok)
|
||||
.onPositive(new MaterialDialog.SingleButtonCallback() {
|
||||
@Override
|
||||
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
|
||||
startScriptRunningLoop();
|
||||
}
|
||||
})
|
||||
.build();
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
|
||||
private void startScriptRunningLoop() {
|
||||
try {
|
||||
int loopTimes = Integer.parseInt(mLoopTimes.getText().toString());
|
||||
float loopInterval = Float.parseFloat(mLoopInterval.getText().toString());
|
||||
float loopDelay = Float.parseFloat(mLoopDelay.getText().toString());
|
||||
Scripts.runRepeatedly(mScriptFile, loopTimes, (long) (1000L * loopDelay), (long) (loopInterval * 1000L));
|
||||
} catch (NumberFormatException e) {
|
||||
App.getApp().getUiHandler().toast(R.string.text_number_format_error);
|
||||
}
|
||||
}
|
||||
|
||||
public ScriptLoopDialog windowType(int windowType) {
|
||||
Window window = mDialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setType(windowType);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void show() {
|
||||
mDialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@ import com.stardust.scriptdroid.BuildConfig;
|
||||
import com.stardust.scriptdroid.Pref;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.FloatingWindowManger;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.HoverMenuManger;
|
||||
import com.stardust.scriptdroid.script.ScriptFile;
|
||||
import com.stardust.scriptdroid.script.StorageScriptProvider;
|
||||
import com.stardust.scriptdroid.script.sample.Sample;
|
||||
@@ -46,7 +46,6 @@ import com.stardust.scriptdroid.ui.BaseActivity;
|
||||
import com.stardust.scriptdroid.ui.main.sample_list.SampleScriptListFragment;
|
||||
import com.stardust.scriptdroid.ui.main.script_list.MyScriptListFragment;
|
||||
import com.stardust.scriptdroid.ui.main.script_list.ScriptFileChooserDialogBuilder;
|
||||
import com.stardust.scriptdroid.ui.main.task.TaskManagerFragment;
|
||||
import com.stardust.scriptdroid.ui.settings.SettingsActivity_;
|
||||
import com.stardust.scriptdroid.ui.update.VersionGuard;
|
||||
import com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder;
|
||||
@@ -275,7 +274,7 @@ public class MainActivity extends BaseActivity implements OnActivityResultDelega
|
||||
|
||||
@Click(R.id.exit)
|
||||
public void exitCompletely() {
|
||||
FloatingWindowManger.hideHoverMenu();
|
||||
HoverMenuManger.hideHoverMenu();
|
||||
stopService(new Intent(this, FloatyService.class));
|
||||
AutoJs.getInstance().getScriptEngineService().stopAll();
|
||||
finish();
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.stardust.scriptdroid.App;
|
||||
import com.stardust.scriptdroid.Pref;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.autojs.AutoJs;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.FloatingWindowManger;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.HoverMenuManger;
|
||||
import com.stardust.scriptdroid.external.floatingwindow.menu.HoverMenuService;
|
||||
import com.stardust.view.accessibility.AccessibilityService;
|
||||
import com.stardust.scriptdroid.sublime.SublimePluginClient;
|
||||
@@ -50,7 +50,7 @@ public class SideMenuFragment extends android.support.v4.app.Fragment {
|
||||
activity.getSupportFragmentManager().beginTransaction().replace(viewId, fragment).commit();
|
||||
}
|
||||
|
||||
@ViewById(R.id.sw_auto_operate_service)
|
||||
@ViewById(R.id.sw_accessibility_service)
|
||||
SwitchCompat mAccessibilityServiceSwitch;
|
||||
@ViewById(R.id.sw_floating_window)
|
||||
SwitchCompat mFloatingWindowSwitch;
|
||||
@@ -89,7 +89,7 @@ public class SideMenuFragment extends android.support.v4.app.Fragment {
|
||||
});
|
||||
}
|
||||
}, 450);
|
||||
mFloatingWindowSwitch.setChecked(FloatingWindowManger.isHoverMenuShowing());
|
||||
mFloatingWindowSwitch.setChecked(HoverMenuManger.isHoverMenuShowing());
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class SideMenuFragment extends android.support.v4.app.Fragment {
|
||||
mAccessibilityServiceSwitch.toggle();
|
||||
}
|
||||
|
||||
@CheckedChange(R.id.sw_auto_operate_service)
|
||||
@CheckedChange(R.id.sw_accessibility_service)
|
||||
void setAutoOperateServiceEnable(CompoundButton button, boolean enable) {
|
||||
boolean isAccessibilityServiceEnabled = AccessibilityService.isEnabled(App.getApp());
|
||||
if (enable && !isAccessibilityServiceEnabled) {
|
||||
@@ -122,10 +122,10 @@ public class SideMenuFragment extends android.support.v4.app.Fragment {
|
||||
|
||||
@CheckedChange(R.id.sw_floating_window)
|
||||
void setFloatingWindowEnable(CompoundButton button, boolean enable) {
|
||||
if (enable && !FloatingWindowManger.isHoverMenuShowing()) {
|
||||
FloatingWindowManger.showHoverMenu();
|
||||
} else if (!enable && FloatingWindowManger.isHoverMenuShowing()) {
|
||||
FloatingWindowManger.hideHoverMenu();
|
||||
if (enable && !HoverMenuManger.isHoverMenuShowing()) {
|
||||
HoverMenuManger.showHoverMenu();
|
||||
} else if (!enable && HoverMenuManger.isHoverMenuShowing()) {
|
||||
HoverMenuManger.hideHoverMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.stardust.pio.PFile;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.script.Scripts;
|
||||
import com.stardust.scriptdroid.script.StorageScriptProvider;
|
||||
import com.stardust.scriptdroid.ui.common.ScriptLoopDialog;
|
||||
import com.stardust.scriptdroid.ui.edit.EditActivity;
|
||||
import com.stardust.theme.dialog.ThemeColorMaterialDialogBuilder;
|
||||
import com.stardust.util.UnderuseExecutors;
|
||||
@@ -106,6 +107,7 @@ public class MyScriptListFragment extends Fragment {
|
||||
|
||||
private void initDialogs() {
|
||||
mScriptFileOperationDialog = new OperationDialogBuilder(getContext())
|
||||
.item(R.id.loop, R.drawable.ic_loop_white_24dp, R.string.text_run_repeatedly)
|
||||
.item(R.id.rename, R.drawable.ic_ali_rename, R.string.text_rename)
|
||||
.item(R.id.open_by_other_apps, R.drawable.ic_ali_open, R.string.text_open_by_other_apps)
|
||||
.item(R.id.create_shortcut, R.drawable.ic_ali_shortcut, R.string.text_send_shortcut)
|
||||
@@ -228,6 +230,14 @@ public class MyScriptListFragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
@Optional
|
||||
@OnClick(R.id.loop)
|
||||
void runScriptRepeatedly() {
|
||||
dismissDialogs();
|
||||
new ScriptLoopDialog(getActivity(), mSelectedScriptFile)
|
||||
.show();
|
||||
}
|
||||
|
||||
@Optional
|
||||
@OnClick(R.id.rename)
|
||||
void renameScriptFile() {
|
||||
|
||||
@@ -15,6 +15,8 @@ import com.stardust.scriptdroid.tool.UpdateChecker;
|
||||
import com.stardust.scriptdroid.ui.BaseActivity;
|
||||
import com.stardust.scriptdroid.ui.error.IssueReporterActivity;
|
||||
import com.stardust.scriptdroid.ui.main.MainActivity;
|
||||
import com.stardust.scriptdroid.ui.splash.SplashActivity;
|
||||
import com.stardust.scriptdroid.ui.splash.SplashActivity_;
|
||||
import com.stardust.scriptdroid.ui.update.UpdateCheckDialog;
|
||||
import com.stardust.util.IntentUtil;
|
||||
import com.stardust.util.MapEntries;
|
||||
@@ -114,6 +116,15 @@ public class SettingsActivity extends BaseActivity {
|
||||
Toast.makeText(getActivity(), R.string.text_already_reset, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
})
|
||||
.entry(getString(R.string.show_ad), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SplashActivity_.intent(getActivity())
|
||||
.extra(SplashActivity.NOT_START_MAIN_ACTIVITY, true)
|
||||
.extra(SplashActivity.FORCE_SHOW_AD, true)
|
||||
.start();
|
||||
}
|
||||
})
|
||||
.entry(getString(R.string.text_check_update), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.stardust.scriptdroid.ui.splash;
|
||||
|
||||
import android.Manifest;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.qq.e.ads.splash.SplashAD;
|
||||
import com.qq.e.ads.splash.SplashADListener;
|
||||
import com.stardust.scriptdroid.Constants;
|
||||
import com.stardust.scriptdroid.Pref;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.ui.BaseActivity;
|
||||
import com.stardust.scriptdroid.ui.main.MainActivity_;
|
||||
|
||||
import org.androidannotations.annotations.AfterViews;
|
||||
import org.androidannotations.annotations.EActivity;
|
||||
import org.androidannotations.annotations.ViewById;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/7/7.
|
||||
*/
|
||||
@EActivity(R.layout.activity_splash)
|
||||
public class SplashActivity extends BaseActivity {
|
||||
|
||||
public static final String NOT_START_MAIN_ACTIVITY = "Eating...I...really...love...you...";
|
||||
public static final String FORCE_SHOW_AD = "I will be better but can you take just a glance at me...";
|
||||
|
||||
private static final String LOG_TAG = SplashActivity.class.getSimpleName();
|
||||
|
||||
@ViewById(R.id.logo)
|
||||
ImageView mLogo;
|
||||
|
||||
@ViewById(R.id.skip_view)
|
||||
TextView mSkipView;
|
||||
|
||||
@ViewById(R.id.ad_container)
|
||||
View mAdContainer;
|
||||
|
||||
@ViewById(R.id.ad)
|
||||
FrameLayout mAd;
|
||||
|
||||
private SplashAD mSplashAD;
|
||||
private boolean mCanEnterNextActivity = false;
|
||||
private boolean mNotStartMainActivity;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mNotStartMainActivity = getIntent().getBooleanExtra(NOT_START_MAIN_ACTIVITY, false);
|
||||
boolean forceShowAd = getIntent().getBooleanExtra(FORCE_SHOW_AD, false);
|
||||
if (!forceShowAd && !Pref.shouldShowAd()) {
|
||||
enterNextActivity();
|
||||
return;
|
||||
}
|
||||
checkPermission(Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
}
|
||||
|
||||
@AfterViews
|
||||
void setUpViews() {
|
||||
fetchSplashAD();
|
||||
}
|
||||
|
||||
void enterNextActivity() {
|
||||
if (!mNotStartMainActivity)
|
||||
MainActivity_.intent(this).start();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
enterNextActivityIfNeeded();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mCanEnterNextActivity = false;
|
||||
}
|
||||
|
||||
private void enterNextActivityIfNeeded() {
|
||||
if (mCanEnterNextActivity) {
|
||||
enterNextActivity();
|
||||
return;
|
||||
}
|
||||
mCanEnterNextActivity = true;
|
||||
}
|
||||
|
||||
private void fetchSplashAD() {
|
||||
mSplashAD = new SplashAD(this, mAd, mSkipView, Constants.APP_ID, Constants.SPLASH_POS_ID, new SplashADListener() {
|
||||
@Override
|
||||
public void onADDismissed() {
|
||||
Log.v(LOG_TAG, "onADDismissed");
|
||||
enterNextActivityIfNeeded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNoAD(int errno) {
|
||||
Log.e(LOG_TAG, "onNoAD: " + errno);
|
||||
enterNextActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onADPresent() {
|
||||
Log.v(LOG_TAG, "onADPresent");
|
||||
mSkipView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onADClicked() {
|
||||
Log.v(LOG_TAG, "onADClicked");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onADTick(long l) {
|
||||
mSkipView.setText(String.format(Locale.getDefault(), getString(R.string.format_skip), Math.round(l / 1000f)));
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/ic_loop_white_24dp.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_loop_white_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 387 B |
BIN
app/src/main/res/drawable-mdpi/ic_loop_white_24dp.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_loop_white_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 261 B |
BIN
app/src/main/res/drawable-xhdpi/ic_loop_white_24dp.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_loop_white_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 494 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_loop_white_24dp.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_loop_white_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 734 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_loop_white_24dp.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_loop_white_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 933 B |
BIN
app/src/main/res/drawable/autojs.png
Normal file
BIN
app/src/main/res/drawable/autojs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
35
app/src/main/res/drawable/skip_circle_bg.xml
Normal file
35
app/src/main/res/drawable/skip_circle_bg.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#80000000"/>
|
||||
|
||||
<padding
|
||||
android:bottom="3dp"
|
||||
android:left="12dp"
|
||||
android:right="12dp"
|
||||
android:top="3dp"/>
|
||||
|
||||
<corners android:radius="16dp"/>
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#40000000"/>
|
||||
|
||||
<padding
|
||||
android:bottom="3dp"
|
||||
android:left="12dp"
|
||||
android:right="12dp"
|
||||
android:top="3dp"/>
|
||||
|
||||
<corners android:radius="16dp"/>
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
67
app/src/main/res/layout/activity_splash.xml
Normal file
67
app/src/main/res/layout/activity_splash.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ad_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/ad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/skip_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/skip_circle_bg"
|
||||
android:gravity="center"
|
||||
android:textColor="#ddffffff"
|
||||
android:textSize="14sp"
|
||||
android:visibility="invisible"
|
||||
tools:text="跳过 4"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="128dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_android_eat_js">
|
||||
|
||||
</ImageView>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="-4dp"
|
||||
android:src="@drawable/autojs">
|
||||
|
||||
</ImageView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rename"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_ali_rename"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/text_rename"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_ali_delete"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/text_delete"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -1,112 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rename"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_ali_rename"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/text_rename"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/open_by_other_apps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_ali_open"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/text_open_by_other_apps"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/create_shortcut"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_ali_shortcut"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/text_send_shortcut"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_ali_delete"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/text_delete"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:textSize="16sp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
73
app/src/main/res/layout/dialog_script_loop.xml
Normal file
73
app/src/main/res/layout/dialog_script_loop.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/loop_times"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_loop_times"
|
||||
android:inputType="number"
|
||||
android:text="0"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:text="@string/hint_loop_times"
|
||||
android:textColor="#77000000"
|
||||
android:textSize="12sp"/>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/loop_interval"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_loop_interval"
|
||||
android:inputType="numberDecimal"
|
||||
android:text="1.0"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/loop_delay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_loop_delay"
|
||||
android:inputType="numberDecimal"
|
||||
android:text="0.0"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:text="@string/hint_loop_delay"
|
||||
android:textColor="#77000000"
|
||||
android:textSize="12sp"/>
|
||||
</LinearLayout>
|
||||
@@ -1,95 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/AppTheme">
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/layout_hierarchy"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_layout_hierarchy"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
<TextView
|
||||
android:id="@+id/layout_hierarchy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_layout_hierarchy"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/layout_bounds"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_layout_bounds"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
<TextView
|
||||
android:id="@+id/layout_bounds"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_layout_bounds"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stop_all_running_scripts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_close_all_running_scripts"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
<TextView
|
||||
android:id="@+id/stop_all_running_scripts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_close_all_running_scripts"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/open_launcher"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_open_launcher"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
<TextView
|
||||
android:id="@+id/open_launcher"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_open_launcher"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/current_package"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
<TextView
|
||||
android:id="@+id/open_accessibility_settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_accessibility_settings"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/current_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/current_package"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/current_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -1,151 +1,158 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:background="@color/colorPrimary">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_script_record"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sw_root_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/sw_recorded_by_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textOn="@string/text_on"
|
||||
android:textOff="@string/text_off"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/sw_recorded_by_root"
|
||||
android:text="@string/text_record_with_root"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sw_record_toast_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/sw_record_toast"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textOn="@string/text_on"
|
||||
android:textOff="@string/text_off"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/sw_record_toast"
|
||||
android:text="@string/text_record_msg"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
<ScrollView 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:background="@color/colorPrimary">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/start_or_pause"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_start_or_pause"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:src="@drawable/ic_play_arrow_white_48dp"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_start_or_pause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_start_record"
|
||||
android:padding="16dp"
|
||||
android:text="@string/text_script_record"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sw_root_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/sw_recorded_by_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textOff="@string/text_off"
|
||||
android:textOn="@string/text_on"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/sw_recorded_by_root"
|
||||
android:text="@string/text_record_with_root"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sw_record_toast_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/sw_record_toast"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textOff="@string/text_off"
|
||||
android:textOn="@string/text_on"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/sw_record_toast"
|
||||
android:text="@string/text_record_msg"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/start_or_pause"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_start_or_pause"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:src="@drawable/ic_play_arrow_white_48dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_start_or_pause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_start_record"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stop_record"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="16dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:src="@drawable/ic_stop_white_36pt"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_stop_record"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stop_record"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="16dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:src="@drawable/ic_stop_white_36pt"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_stop_record"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#c4c4c4"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -1,91 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:textSize="16sp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/console"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_console_green"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_console"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/syntax_and_api"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_js"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_syntax_and_api"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/floating_window"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_assist_service"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_robot_head_green"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_assist_service"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_floating_window"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_floating_window"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.stardust.scriptdroid.ui.edit.sidemenu.FunctionListRecyclerView
|
||||
android:id="@+id/function_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,174 +1,181 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/console"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_console_green"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/console"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_log"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_console_green"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_log"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/syntax_and_api"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_speech_bubble"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_syntax_and_api"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/auto_operate_service"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_service"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_service_green"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_service"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_auto_operate_service"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_accessibility_service"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/floating_window"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_assist_service"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_robot_64"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_assist_service"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_floating_window"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_floating_window"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/debug"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_debug"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_debug"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_debug"
|
||||
android:gravity="center"
|
||||
android:text="@string/debug"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_debug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stop_all_running_scripts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_close_green_48dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_close_all_running_scripts"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/syntax_and_api"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_speech_bubble"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_syntax_and_api"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/auto_operate_service"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_service"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_service_green"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_service"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_auto_operate_service"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_auto_operate_service"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/floating_window"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_assist_service"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_robot_64"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_assist_service"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_floating_window"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_floating_window"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/debug"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:id="@+id/icon_debug"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_debug"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon_debug"
|
||||
android:gravity="center"
|
||||
android:text="@string/debug"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorSwitch
|
||||
android:id="@+id/sw_debug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stop_all_running_scripts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorImageViewCompat
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_close_green_48dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_close_all_running_scripts"
|
||||
android:textColor="@android:color/primary_text_light"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -8,4 +8,6 @@
|
||||
<dimen name="level_beam_view_padding_right">-4dp</dimen>
|
||||
<dimen name="script_and_folder_list_divider_left_margin">56dp</dimen>
|
||||
<dimen name="script_and_folder_list_divider_right_margin">0dp</dimen>
|
||||
<dimen name="floating_icon_size">56dp</dimen>
|
||||
<dimen name="floating_icon_margin">0dp</dimen>
|
||||
</resources>
|
||||
|
||||
8
app/src/main/res/values/ids.xml
Normal file
8
app/src/main/res/values/ids.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="rename" type="id"/>
|
||||
<item name="open_by_other_apps" type="id"/>
|
||||
<item name="create_shortcut" type="id"/>
|
||||
<item name="delete" type="id"/>
|
||||
<item name="loop" type="id"/>
|
||||
</resources>
|
||||
@@ -190,6 +190,22 @@
|
||||
<string name="text_show_layout_bounds">在布局范围中查看</string>
|
||||
<string name="text_more">更多</string>
|
||||
<string name="text_share">分享</string>
|
||||
<string name="format_skip">跳过 %d</string>
|
||||
<string name="text_can_close_ad_in_settings">广告可以在设置中关闭</string>
|
||||
<string name="key_ad_showing_mode">key_ad_showing_mode</string>
|
||||
<string name="text_ad">广告</string>
|
||||
<string name="show_ad">欣赏广告</string>
|
||||
<string name="text_ad_showing_settings">广告显示设置</string>
|
||||
<string name="text_default">Default</string>
|
||||
<string name="text_script_save_successfully">保存成功,请刷新目录</string>
|
||||
<string name="text_run_repeatedly">循环运行</string>
|
||||
<string name="text_loop_interval">循环间隔(秒)</string>
|
||||
<string name="text_loop_delay">延迟执行(秒)</string>
|
||||
<string name="text_loop_times">循环次数</string>
|
||||
<string name="hint_loop_times">0为无限循环</string>
|
||||
<string name="hint_loop_delay">延迟多少秒后开始循环</string>
|
||||
<string name="text_number_format_error">格式错误</string>
|
||||
<string name="text_accessibility_settings">打开无障碍服务</string>
|
||||
|
||||
<string-array name="record_control_keys">
|
||||
<item>无</item>
|
||||
@@ -205,4 +221,16 @@
|
||||
<item>KEY_CAMERA</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="ad_showing_mode_keys">
|
||||
<item>默认</item>
|
||||
<item>每天显示一次</item>
|
||||
<item>不显示</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="ad_showing_mode_values">
|
||||
<item>Default</item>
|
||||
<item>OncePerDay</item>
|
||||
<item>Off</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -14,12 +14,10 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Splash" parent="AppTheme">
|
||||
<style name="AppTheme.Splash" parent="@android:style/Theme.Light.NoTitleBar.Fullscreen">
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
<item name="windowActionBar">false</item>
|
||||
|
||||
<item name="android:windowBackground">@drawable/background_splash</item>
|
||||
</style>
|
||||
|
||||
<style name="MainToolbarTheme" parent="AppTheme">
|
||||
|
||||
@@ -66,6 +66,17 @@
|
||||
<Preference android:title="@string/text_reset_background"/>
|
||||
</com.stardust.theme.preference.ThemeColorPreferenceCategory>
|
||||
|
||||
<com.stardust.theme.preference.ThemeColorPreferenceCategory android:title="@string/text_ad">
|
||||
<Preference android:title="@string/show_ad"/>
|
||||
<com.afollestad.materialdialogs.prefs.MaterialListPreference
|
||||
android:defaultValue="@string/text_default"
|
||||
android:entries="@array/ad_showing_mode_keys"
|
||||
android:entryValues="@array/ad_showing_mode_values"
|
||||
android:key="@string/key_ad_showing_mode"
|
||||
android:title="@string/text_ad_showing_settings"
|
||||
/>
|
||||
</com.stardust.theme.preference.ThemeColorPreferenceCategory>
|
||||
|
||||
<com.stardust.theme.preference.ThemeColorPreferenceCategory android:title="@string/text_about">
|
||||
|
||||
<Preference android:title="@string/text_check_update"/>
|
||||
|
||||
@@ -5,7 +5,7 @@ android {
|
||||
buildToolsVersion "25.0.2"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
@@ -9,6 +9,9 @@ public class ExecutionConfig implements Serializable {
|
||||
|
||||
private String[] mRequirePath = new String[0];
|
||||
private static final ExecutionConfig DEFAULT = new ExecutionConfig();
|
||||
public long delay = 0;
|
||||
public long interval = 0;
|
||||
public int loopTimes = 1;
|
||||
|
||||
public static ExecutionConfig getDefault() {
|
||||
return DEFAULT;
|
||||
@@ -29,4 +32,11 @@ public class ExecutionConfig implements Serializable {
|
||||
public String[] getRequirePath() {
|
||||
return mRequirePath;
|
||||
}
|
||||
|
||||
public ExecutionConfig loop(long delay, int loopTimes, long interval) {
|
||||
this.delay = delay;
|
||||
this.loopTimes = loopTimes;
|
||||
this.interval = interval;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.util.Log;
|
||||
import com.stardust.autojs.ScriptEngineService;
|
||||
import com.stardust.autojs.engine.RhinoJavaScriptEngine;
|
||||
import com.stardust.autojs.engine.ScriptEngine;
|
||||
import com.stardust.autojs.runtime.ScriptInterruptedException;
|
||||
import com.stardust.autojs.runtime.ScriptRuntime;
|
||||
import com.stardust.autojs.script.ScriptSource;
|
||||
|
||||
@@ -61,11 +62,34 @@ public class RunnableScriptExecution extends ScriptExecution.AbstractScriptExecu
|
||||
private Object doExecution(ScriptEngine engine) {
|
||||
engine.setTag("script", getSource());
|
||||
getListener().onStart(this);
|
||||
Object result = engine.execute(getSource());
|
||||
Object result = null;
|
||||
long delay = getConfig().delay;
|
||||
int times = getConfig().loopTimes;
|
||||
if (times == 0) {
|
||||
times = Integer.MAX_VALUE;
|
||||
}
|
||||
long interval = getConfig().interval;
|
||||
sleep(delay);
|
||||
ScriptSource source = getSource();
|
||||
for (int i = 0; i < times; i++) {
|
||||
result = engine.execute(source);
|
||||
sleep(interval);
|
||||
}
|
||||
getListener().onSuccess(this, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void sleep(long i) {
|
||||
if (i <= 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(i);
|
||||
} catch (InterruptedException e) {
|
||||
throw new ScriptInterruptedException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptEngine getEngine() {
|
||||
return mScriptEngine;
|
||||
|
||||
@@ -11,8 +11,6 @@ import com.stardust.autojs.runtime.api.AbstractConsole;
|
||||
import com.stardust.autojs.runtime.api.Console;
|
||||
import com.stardust.enhancedfloaty.FloatyService;
|
||||
import com.stardust.enhancedfloaty.ResizableExpandableFloatyWindow;
|
||||
import com.stardust.util.FloatingWindowUtils;
|
||||
import com.stardust.util.IntentUtil;
|
||||
import com.stardust.util.UiHandler;
|
||||
import com.stardust.autojs.R;
|
||||
|
||||
@@ -21,6 +19,8 @@ import java.util.List;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import ezy.assist.compat.SettingsCompat;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/5/2.
|
||||
*/
|
||||
@@ -123,8 +123,8 @@ public class StardustConsole extends AbstractConsole {
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
if (!FloatingWindowUtils.hasOverlayPermission(mUiHandler.getContext())) {
|
||||
IntentUtil.goToAppDetailSettings(mUiHandler.getContext());
|
||||
if (!SettingsCompat.canDrawOverlays(mUiHandler.getContext())) {
|
||||
SettingsCompat.manageDrawOverlays(mUiHandler.getContext());
|
||||
mUiHandler.toast(R.string.text_no_floating_window_permission);
|
||||
}
|
||||
startFloatyService();
|
||||
|
||||
@@ -5,7 +5,7 @@ android {
|
||||
buildToolsVersion "25.0.2"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
@@ -31,7 +31,6 @@ dependencies {
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||
compile project(path: ':common')
|
||||
|
||||
@@ -59,10 +59,13 @@ public class AccessibilityService extends android.accessibilityservice.Accessibi
|
||||
@Override
|
||||
public void onAccessibilityEvent(final AccessibilityEvent event) {
|
||||
Log.v(TAG, "onAccessibilityEvent: " + event);
|
||||
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
|
||||
|| event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
|
||||
|| event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT) {
|
||||
mRootInActiveWindow = super.getRootInActiveWindow();
|
||||
try {
|
||||
AccessibilityNodeInfo root = super.getRootInActiveWindow();
|
||||
Log.v(TAG, "getRootInActiveWindow: " + root);
|
||||
if (root != null)
|
||||
mRootInActiveWindow = root;
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
if (!containsAllEventTypes && !eventTypes.contains(event.getEventType()))
|
||||
return;
|
||||
|
||||
@@ -5,7 +5,7 @@ android {
|
||||
buildToolsVersion "25.0.2"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
@@ -27,4 +27,5 @@ dependencies {
|
||||
})
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:support-annotations:25.3.1'
|
||||
compile 'com.github.czy1121:settingscompat:1.1.4'
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.stardust.util;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.widget.Toast;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/3/10.
|
||||
*/
|
||||
|
||||
public class FloatingWindowUtils {
|
||||
|
||||
public static boolean checkFloatingWindowPermission(Context context, int messageResId) {
|
||||
if (!hasOverlayPermission(context)) {
|
||||
Toast.makeText(context, messageResId, Toast.LENGTH_SHORT).show();
|
||||
IntentUtil.goToAppDetailSettings(context, context.getPackageName());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static boolean isFloatingWindowPermitted(Context context) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
return pm.checkPermission(Manifest.permission.SYSTEM_ALERT_WINDOW, context.getPackageName())
|
||||
== PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
public static boolean hasOverlayPermission(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return Settings.canDrawOverlays(context);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.stardust.auojs.inrt"
|
||||
minSdkVersion 19
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 23
|
||||
versionCode 1
|
||||
versionName "0.0.1"
|
||||
|
||||
Reference in New Issue
Block a user