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