change app icon
@ -42,7 +42,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@ -7,8 +7,8 @@ android {
|
||||
applicationId "com.stardust.scriptdroid"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 23
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode 10
|
||||
versionName "0.17.02050预览版"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/script_droid"
|
||||
android:icon="@drawable/ic_android_eat_js"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
@ -134,7 +134,7 @@ public abstract class ScriptFileOperation {
|
||||
ScriptFile scriptFile = scriptFileList.get(position);
|
||||
new Shortcut(context).name(scriptFile.name)
|
||||
.targetClass(ShortcutActivity.class)
|
||||
.icon(R.drawable.script_droid)
|
||||
.icon(R.drawable.ic_robot_green)
|
||||
.extras(new Intent().putExtra("path", scriptFile.path))
|
||||
.send();
|
||||
Snackbar.make(recyclerView, R.string.text_already_create, Snackbar.LENGTH_SHORT).show();
|
||||
|
||||
@ -4,10 +4,10 @@ import android.content.SharedPreferences;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/2/3.
|
||||
@ -71,9 +71,7 @@ public class StateObserver {
|
||||
listener.initState(initialState);
|
||||
synchronized (mKeyStateListenersMap) {
|
||||
List<OnStateChangedListener> listeners = getListenerListOrCreateIfNotExists(key);
|
||||
synchronized (listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
listeners.add(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,25 +82,18 @@ public class StateObserver {
|
||||
if (listeners == null) {
|
||||
return;
|
||||
}
|
||||
synchronized (listeners) {
|
||||
listeners.remove(stateChangedListener);
|
||||
}
|
||||
listeners.remove(stateChangedListener);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void setState(String key, T state) {
|
||||
synchronized (mKeyStateListenersMap) {
|
||||
List<OnStateChangedListener> listeners = mKeyStateListenersMap.get(key);
|
||||
if (listeners == null)
|
||||
if (listeners == null || listeners.isEmpty())
|
||||
return;
|
||||
synchronized (listeners) {
|
||||
if (listeners.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (listeners.get(0) instanceof OnBooleanStateChangedListener) {
|
||||
mSharedPreferences.edit().putBoolean(key, (Boolean) state).apply();
|
||||
notifyBooleanStateChanged(listeners, (Boolean) state);
|
||||
}
|
||||
if (listeners.get(0) instanceof OnBooleanStateChangedListener) {
|
||||
mSharedPreferences.edit().putBoolean(key, (Boolean) state).apply();
|
||||
notifyBooleanStateChanged(listeners, (Boolean) state);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -124,7 +115,7 @@ public class StateObserver {
|
||||
private List<OnStateChangedListener> getListenerListOrCreateIfNotExists(String key) {
|
||||
List<OnStateChangedListener> listeners = mKeyStateListenersMap.get(key);
|
||||
if (listeners == null) {
|
||||
listeners = new ArrayList<>();
|
||||
listeners = new CopyOnWriteArrayList<>();
|
||||
mKeyStateListenersMap.put(key, listeners);
|
||||
}
|
||||
return listeners;
|
||||
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 119 B |
BIN
app/src/main/res/drawable/ic_android_eat_js.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 604 B |
|
Before Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@ -47,7 +47,7 @@
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/script_droid"/>
|
||||
android:src="@drawable/ic_android_eat_js"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 10 KiB |
@ -1,6 +1,6 @@
|
||||
<resources>
|
||||
<string name="app_name">免Root脚本机器人</string>
|
||||
<string name="version">Version 1.17.0202</string>
|
||||
<string name="version">Version 0.17.0205</string>
|
||||
<string name="action_settings">设置</string>
|
||||
<string name="action_disable_service">关闭服务</string>
|
||||
<string name="text_accessibility_service_description">使脚本自动操作(点击、长按、滑动等)所需,若关闭则只能执行不涉及自动操作的脚本。</string>
|
||||
|
||||