LayoutLib: properly configure ApplicationInfo with targetSdkVersion.
Change-Id: I1bfef890206552843d1a7a8d0564741f2a37494f
This commit is contained in:
@@ -80,6 +80,7 @@ public final class BridgeContext extends Activity {
|
|||||||
private final Object mProjectKey;
|
private final Object mProjectKey;
|
||||||
private final DisplayMetrics mMetrics;
|
private final DisplayMetrics mMetrics;
|
||||||
private final RenderResources mRenderResources;
|
private final RenderResources mRenderResources;
|
||||||
|
private final ApplicationInfo mApplicationInfo;
|
||||||
|
|
||||||
private final Map<Object, Map<String, String>> mDefaultPropMaps =
|
private final Map<Object, Map<String, String>> mDefaultPropMaps =
|
||||||
new IdentityHashMap<Object, Map<String,String>>();
|
new IdentityHashMap<Object, Map<String,String>>();
|
||||||
@@ -112,10 +113,12 @@ public final class BridgeContext extends Activity {
|
|||||||
* value is the resource value.
|
* value is the resource value.
|
||||||
* @param styleInheritanceMap
|
* @param styleInheritanceMap
|
||||||
* @param projectCallback
|
* @param projectCallback
|
||||||
|
* @param targetSdkVersion the targetSdkVersion of the application.
|
||||||
*/
|
*/
|
||||||
public BridgeContext(Object projectKey, DisplayMetrics metrics,
|
public BridgeContext(Object projectKey, DisplayMetrics metrics,
|
||||||
RenderResources renderResources,
|
RenderResources renderResources,
|
||||||
IProjectCallback projectCallback) {
|
IProjectCallback projectCallback,
|
||||||
|
int targetSdkVersion) {
|
||||||
mProjectKey = projectKey;
|
mProjectKey = projectKey;
|
||||||
mMetrics = metrics;
|
mMetrics = metrics;
|
||||||
mProjectCallback = projectCallback;
|
mProjectCallback = projectCallback;
|
||||||
@@ -124,6 +127,9 @@ public final class BridgeContext extends Activity {
|
|||||||
|
|
||||||
mFragments.mCurState = Fragment.CREATED;
|
mFragments.mCurState = Fragment.CREATED;
|
||||||
mFragments.mActivity = this;
|
mFragments.mActivity = this;
|
||||||
|
|
||||||
|
mApplicationInfo = new ApplicationInfo();
|
||||||
|
mApplicationInfo.targetSdkVersion = targetSdkVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -836,7 +842,7 @@ public final class BridgeContext extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApplicationInfo getApplicationInfo() {
|
public ApplicationInfo getApplicationInfo() {
|
||||||
return new ApplicationInfo();
|
return mApplicationInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
|
|||||||
|
|
||||||
// build the context
|
// build the context
|
||||||
mContext = new BridgeContext(mParams.getProjectKey(), metrics, resources,
|
mContext = new BridgeContext(mParams.getProjectKey(), metrics, resources,
|
||||||
mParams.getProjectCallback());
|
mParams.getProjectCallback(), mParams.getTargetSdkVersion());
|
||||||
|
|
||||||
|
|
||||||
setUp();
|
setUp();
|
||||||
|
|||||||
Reference in New Issue
Block a user