am b318ff54: Make DatePicker rendering not fail (style search fix). [DO NOT MERGE]
* commit 'b318ff54fcd17e7aadd1b0251c34cba348898704': Make DatePicker rendering not fail (style search fix). [DO NOT MERGE]
This commit is contained in:
@@ -66,7 +66,9 @@ import android.net.Uri;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.os.Parcel;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
|
import android.os.RemoteException;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
@@ -679,44 +681,48 @@ public final class BridgeContext extends Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (defStyleRes != 0) {
|
} else if (defStyleRes != 0) {
|
||||||
boolean isFrameworkRes = true;
|
StyleResourceValue item = mDynamicIdToStyleMap.get(defStyleRes);
|
||||||
Pair<ResourceType, String> value = Bridge.resolveResourceId(defStyleRes);
|
if (item != null) {
|
||||||
if (value == null) {
|
defStyleValues = item;
|
||||||
value = mLayoutlibCallback.resolveResourceId(defStyleRes);
|
} else {
|
||||||
isFrameworkRes = false;
|
boolean isFrameworkRes = true;
|
||||||
}
|
Pair<ResourceType, String> value = Bridge.resolveResourceId(defStyleRes);
|
||||||
|
if (value == null) {
|
||||||
|
value = mLayoutlibCallback.resolveResourceId(defStyleRes);
|
||||||
|
isFrameworkRes = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
if ((value.getFirst() == ResourceType.STYLE)) {
|
if ((value.getFirst() == ResourceType.STYLE)) {
|
||||||
// look for the style in all resources:
|
// look for the style in all resources:
|
||||||
StyleResourceValue item = mRenderResources.getStyle(value.getSecond(),
|
item = mRenderResources.getStyle(value.getSecond(), isFrameworkRes);
|
||||||
isFrameworkRes);
|
if (item != null) {
|
||||||
if (item != null) {
|
if (defaultPropMap != null) {
|
||||||
if (defaultPropMap != null) {
|
defaultPropMap.put("style", item.getName());
|
||||||
defaultPropMap.put("style", item.getName());
|
}
|
||||||
|
|
||||||
|
defStyleValues = item;
|
||||||
|
} else {
|
||||||
|
Bridge.getLog().error(null,
|
||||||
|
String.format(
|
||||||
|
"Style with id 0x%x (resolved to '%s') does not exist.",
|
||||||
|
defStyleRes, value.getSecond()),
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
defStyleValues = item;
|
|
||||||
} else {
|
} else {
|
||||||
Bridge.getLog().error(null,
|
Bridge.getLog().error(null,
|
||||||
String.format(
|
String.format(
|
||||||
"Style with id 0x%x (resolved to '%s') does not exist.",
|
"Resource id 0x%x is not of type STYLE (instead %s)",
|
||||||
defStyleRes, value.getSecond()),
|
defStyleRes, value.getFirst().toString()),
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Bridge.getLog().error(null,
|
Bridge.getLog().error(null,
|
||||||
String.format(
|
String.format(
|
||||||
"Resource id 0x%x is not of type STYLE (instead %s)",
|
"Failed to find style with id 0x%x in current theme",
|
||||||
defStyleRes, value.getFirst().toString()),
|
defStyleRes),
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Bridge.getLog().error(null,
|
|
||||||
String.format(
|
|
||||||
"Failed to find style with id 0x%x in current theme",
|
|
||||||
defStyleRes),
|
|
||||||
null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user