fix: floaty not working
This commit is contained in:
@@ -26,13 +26,8 @@ module.exports = function(runtime, global){
|
||||
get: function(name) {
|
||||
var value = window[name];
|
||||
if(typeof(value) == 'undefined'){
|
||||
value = viewCache[name];
|
||||
if(!value){
|
||||
value = window.findView(name);
|
||||
if(value){
|
||||
value = ui.__decorate__(value);
|
||||
viewCache[name] = value;
|
||||
}
|
||||
}
|
||||
if(!value){
|
||||
value = undefined;
|
||||
|
||||
@@ -42,6 +42,10 @@ module.exports = function (runtime, global) {
|
||||
return ui.findByStringId(ui.view, id);
|
||||
}
|
||||
|
||||
ui.findView = function(id) {
|
||||
return ui.findById(id);
|
||||
}
|
||||
|
||||
ui.isUiThread = function () {
|
||||
let Looper = android.os.Looper;
|
||||
return Looper.myLooper() == Looper.getMainLooper();
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.stardust.autojs.core.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.widget.DefaultItemAnimator;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.stardust.autojs.R;
|
||||
import com.stardust.autojs.core.ui.inflater.DynamicLayoutInflater;
|
||||
|
||||
@@ -12,13 +12,9 @@ import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.stardust.R;
|
||||
import com.stardust.autojs.runtime.exception.ScriptInterruptedException;
|
||||
import com.stardust.enhancedfloaty.util.FloatingWindowPermissionUtil;
|
||||
import com.stardust.lang.ThreadCompat;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Set;
|
||||
|
||||
import ezy.assist.compat.RomUtil;
|
||||
import ezy.assist.compat.SettingsCompat;
|
||||
@@ -42,12 +38,13 @@ public class FloatingPermission {
|
||||
}
|
||||
}
|
||||
|
||||
public static void ensurePermissionGranted(Context context) {
|
||||
public static boolean ensurePermissionGranted(Context context) {
|
||||
if (!canDrawOverlays(context)) {
|
||||
Toast.makeText(context, R.string.text_no_floating_window_permission, Toast.LENGTH_SHORT).show();
|
||||
manageDrawOverlays(context);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void waitForPermissionGranted(Context context) throws InterruptedException {
|
||||
|
||||
Reference in New Issue
Block a user