fix: cannot set w and h on root element of ui;
fix: ui.post
This commit is contained in:
@@ -51,7 +51,7 @@ public class SplashActivity extends BaseActivity {
|
|||||||
mNotStartMainActivity = getIntent().getBooleanExtra(NOT_START_MAIN_ACTIVITY, false);
|
mNotStartMainActivity = getIntent().getBooleanExtra(NOT_START_MAIN_ACTIVITY, false);
|
||||||
boolean forceShowAd = getIntent().getBooleanExtra(FORCE_SHOW_AD, false);
|
boolean forceShowAd = getIntent().getBooleanExtra(FORCE_SHOW_AD, false);
|
||||||
setContentView(R.layout.activity_splash);
|
setContentView(R.layout.activity_splash);
|
||||||
mFullScreenAdView = (FullScreenAdView) findViewById(R.id.full_screen_view);
|
mFullScreenAdView = findViewById(R.id.full_screen_view);
|
||||||
if (!forceShowAd && !Pref.shouldShowAd()) {
|
if (!forceShowAd && !Pref.shouldShowAd()) {
|
||||||
mFullScreenAdView.setVisibility(View.INVISIBLE);
|
mFullScreenAdView.setVisibility(View.INVISIBLE);
|
||||||
mHandler.postDelayed(this::enterNextActivity, 1500);
|
mHandler.postDelayed(this::enterNextActivity, 1500);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module.exports = function (runtime, global) {
|
|||||||
xml = xml.toXMLString();
|
xml = xml.toXMLString();
|
||||||
}
|
}
|
||||||
runtime.ui.layoutInflater.setContext(activity);
|
runtime.ui.layoutInflater.setContext(activity);
|
||||||
var view = runtime.ui.layoutInflater.inflate(xml);
|
var view = runtime.ui.layoutInflater.inflate(xml, activity.window.decorView, false);
|
||||||
ui.setContentView(view);
|
ui.setContentView(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ module.exports = function (runtime, global) {
|
|||||||
|
|
||||||
ui.post = function (action, delay) {
|
ui.post = function (action, delay) {
|
||||||
delay = delay || 0;
|
delay = delay || 0;
|
||||||
runtime.getUiHandler().postDelay(wrapUiAction(action), delay);
|
runtime.getUiHandler().postDelayed(wrapUiAction(action), delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.statusBarColor = function (color) {
|
ui.statusBarColor = function (color) {
|
||||||
|
|||||||
@@ -146,20 +146,24 @@ public class DynamicLayoutInflater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public View inflate(String xml, @Nullable ViewGroup parent) {
|
public View inflate(String xml, @Nullable ViewGroup parent) {
|
||||||
|
return inflate(xml, parent, parent != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public View inflate(String xml, @Nullable ViewGroup parent, boolean attachToParent) {
|
||||||
View view = mLayoutInflaterDelegate.beforeInflation(xml, parent);
|
View view = mLayoutInflaterDelegate.beforeInflation(xml, parent);
|
||||||
if (view != null)
|
if (view != null)
|
||||||
return view;
|
return view;
|
||||||
xml = convertXml(xml);
|
xml = convertXml(xml);
|
||||||
return mLayoutInflaterDelegate.afterInflation(doInflation(xml, parent), xml, parent);
|
return mLayoutInflaterDelegate.afterInflation(doInflation(xml, parent, attachToParent), xml, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected View doInflation(String xml, @Nullable ViewGroup parent) {
|
protected View doInflation(String xml, @Nullable ViewGroup parent, boolean attachToParent) {
|
||||||
try {
|
try {
|
||||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||||
dbf.setNamespaceAware(true);
|
dbf.setNamespaceAware(true);
|
||||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||||
Document document = db.parse(new ByteArrayInputStream(xml.getBytes()));
|
Document document = db.parse(new ByteArrayInputStream(xml.getBytes()));
|
||||||
return inflate(document.getDocumentElement(), parent, true);
|
return inflate(document.getDocumentElement(), parent, attachToParent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new InflateException(e);
|
throw new InflateException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
|
|
||||||
public class AccessibilityService extends android.accessibilityservice.AccessibilityService {
|
public class AccessibilityService extends android.accessibilityservice.AccessibilityService {
|
||||||
|
|
||||||
|
|
||||||
private static final String TAG = "AccessibilityService";
|
private static final String TAG = "AccessibilityService";
|
||||||
|
|
||||||
private static final SortedMap<Integer, AccessibilityDelegate> mDelegates = new TreeMap<>();
|
private static final SortedMap<Integer, AccessibilityDelegate> mDelegates = new TreeMap<>();
|
||||||
@@ -55,7 +54,7 @@ public class AccessibilityService extends android.accessibilityservice.Accessibi
|
|||||||
@Override
|
@Override
|
||||||
public void onAccessibilityEvent(final AccessibilityEvent event) {
|
public void onAccessibilityEvent(final AccessibilityEvent event) {
|
||||||
instance = this;
|
instance = this;
|
||||||
Log.v(TAG, "onAccessibilityEvent: " + event);
|
//Log.v(TAG, "onAccessibilityEvent: " + event);
|
||||||
if (!containsAllEventTypes && !eventTypes.contains(event.getEventType()))
|
if (!containsAllEventTypes && !eventTypes.contains(event.getEventType()))
|
||||||
return;
|
return;
|
||||||
int type = event.getEventType();
|
int type = event.getEventType();
|
||||||
|
|||||||
Reference in New Issue
Block a user