mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
fix #282
This commit is contained in:
parent
7f6e9dd210
commit
78f6fbbd3c
@ -197,14 +197,6 @@
|
||||
android:name="android.accessibilityservice"
|
||||
android:resource="@xml/accessibility_service_config"/>
|
||||
</service>
|
||||
<service
|
||||
android:name="com.stardust.notification.NotificationListenerService"
|
||||
android:label="@string/_app_name"
|
||||
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.notification.NotificationListenerService"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name=".external.widget.ScriptWidget">
|
||||
<intent-filter>
|
||||
|
||||
@ -340,3 +340,9 @@ div.CodeMirror-dragcursors {
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
||||
|
||||
.CodeMirror-gutter-wrapper {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
@ -76,7 +76,9 @@ editor.on("keyup", function(editor, event)
|
||||
clearTimeout(id);
|
||||
}
|
||||
id = setTimeout(function(){
|
||||
editor.execCommand("autocomplete");
|
||||
editor.showHint({
|
||||
completeSingle: false
|
||||
})
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
@ -21,6 +21,15 @@
|
||||
android:taskAffinity="com.stardust.autojs.runtime.api.image.ScreenCaptureRequestActivity"
|
||||
android:theme="@style/AppTheme.Transparent"/>
|
||||
|
||||
<service
|
||||
android:name="com.stardust.notification.NotificationListenerService"
|
||||
android:label="@string/_app_name"
|
||||
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.notification.NotificationListenerService"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@ -18,15 +18,15 @@ public class ScreenMetrics {
|
||||
private static Display display;
|
||||
|
||||
public static void initIfNeeded(Activity activity) {
|
||||
if (!initialized) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
|
||||
deviceScreenHeight = metrics.heightPixels;
|
||||
deviceScreenWidth = metrics.widthPixels;
|
||||
deviceScreenDensity = metrics.densityDpi;
|
||||
display = activity.getWindowManager().getDefaultDisplay();
|
||||
initialized = true;
|
||||
}
|
||||
if(initialized)
|
||||
return;
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
|
||||
deviceScreenHeight = metrics.heightPixels;
|
||||
deviceScreenWidth = metrics.widthPixels;
|
||||
deviceScreenDensity = metrics.densityDpi;
|
||||
display = activity.getWindowManager().getDefaultDisplay();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
public static int getDeviceScreenHeight() {
|
||||
|
||||
@ -19,6 +19,7 @@ public class ViewUtil {
|
||||
return (V) view.findViewById(resId);
|
||||
}
|
||||
|
||||
// FIXME: 2018/1/23 not working in some devices (https://github.com/hyb1996/Auto.js/issues/268)
|
||||
public static int getStatusBarHeight(Context context) {
|
||||
int result = 0;
|
||||
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user