New design for instant apps in app details header
Bug: 35098444 Test: make RunSettingsRoboTests In the previous design for instant apps, some metadata about the app such as developer title, maturity rating, etc. was going to be shown in the app header. In the latest design, we instead are just showing a little label that says "Instant app". The two CL's for this topic work together to change this: frameworks/base : adds code to work around the problem that robolectric doesn't know about the new isInstantApp method of the ApplicationInfo class, so we need to avoid calling it during tests. pacakges/apps/Settings: removes the code that previously displayed the instant app metadata, and instead just insert the "Instant app" label. Change-Id: I2cbc70bf4827c401e862c58ea4ca7f8f9ba1cf58
This commit is contained in:
@@ -37,7 +37,6 @@ import android.widget.TextView;
|
||||
import com.android.settings.AppHeader;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.applications.instantapps.InstantAppDetails;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.applications.ApplicationsState;
|
||||
|
||||
@@ -81,7 +80,7 @@ public class AppHeaderController {
|
||||
@ActionType
|
||||
private int mRightAction;
|
||||
|
||||
private InstantAppDetails mInstantAppDetails;
|
||||
private boolean mIsInstantApp;
|
||||
|
||||
public AppHeaderController(Context context, Fragment fragment, View appHeader) {
|
||||
mContext = context;
|
||||
@@ -154,8 +153,8 @@ public class AppHeaderController {
|
||||
return this;
|
||||
}
|
||||
|
||||
public AppHeaderController setInstantAppDetails(InstantAppDetails instantAppDetails) {
|
||||
mInstantAppDetails = instantAppDetails;
|
||||
public AppHeaderController setIsInstantApp(boolean isInstantApp) {
|
||||
this.mIsInstantApp = isInstantApp;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -220,26 +219,9 @@ public class AppHeaderController {
|
||||
bindAppHeaderButtons();
|
||||
}
|
||||
|
||||
if (mInstantAppDetails != null) {
|
||||
setText(R.id.instant_app_developer_title, mInstantAppDetails.developerTitle);
|
||||
View maturity = mAppHeader.findViewById(R.id.instant_app_maturity);
|
||||
|
||||
if (maturity != null) {
|
||||
String maturityText = mInstantAppDetails.maturityRatingString;
|
||||
Drawable maturityIcon = mInstantAppDetails.maturityRatingIcon;
|
||||
if (!TextUtils.isEmpty(maturityText) || maturityIcon != null) {
|
||||
maturity.setVisibility(View.VISIBLE);
|
||||
}
|
||||
setText(R.id.instant_app_maturity_text, maturityText);
|
||||
if (maturityIcon != null) {
|
||||
ImageView maturityIconView = (ImageView) mAppHeader.findViewById(
|
||||
R.id.instant_app_maturity_icon);
|
||||
if (maturityIconView != null) {
|
||||
maturityIconView.setImageDrawable(maturityIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
setText(R.id.instant_app_monetization, mInstantAppDetails.monetizationNotice);
|
||||
if (mIsInstantApp) {
|
||||
setText(R.id.install_type,
|
||||
mAppHeader.getResources().getString(R.string.install_type_instant));
|
||||
}
|
||||
|
||||
return mAppHeader;
|
||||
|
Reference in New Issue
Block a user