From 36798b60c5e8f823b4027d49cca18fdc4704afa1 Mon Sep 17 00:00:00 2001 From: Jeff Davidson Date: Mon, 5 Nov 2018 15:15:39 -0800 Subject: Add support for illustrations to SimAppDialog. Previously these were provided in build-time resource overlays by overriding the entire install_carrier_app_activity.xml layout. This is no longer feasible with the move to runtime overlays as the layout cannot be precisely mimicked due to depending on styles and other parameters from the base APK (and is generally a bit more brittle). Instead, pull in the needed container from the current overlay, add a stub image and content description and hide the container by default so the base APK can be compiled, and provide a boolean that can be overridden along with the image and content description that is used to toggle the image display at runtime. Bug: 118823052 Test: atest GtsSimAppDialogTestCases (with and without overlay) Change-Id: Ic706df3091ce6c9f5d64ee22da6fa61b9b7b1e3c --- .../src/com/android/simappdialog/InstallCarrierAppActivity.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/SimAppDialog/src') diff --git a/packages/SimAppDialog/src/com/android/simappdialog/InstallCarrierAppActivity.java b/packages/SimAppDialog/src/com/android/simappdialog/InstallCarrierAppActivity.java index 9e9b80d39ed7..8e8d9f741a81 100644 --- a/packages/SimAppDialog/src/com/android/simappdialog/InstallCarrierAppActivity.java +++ b/packages/SimAppDialog/src/com/android/simappdialog/InstallCarrierAppActivity.java @@ -65,6 +65,11 @@ public class InstallCarrierAppActivity extends Activity implements View.OnClickL Button downloadButton = findViewById(R.id.download_button); downloadButton.setOnClickListener(this); + // Show/hide illo depending on whether one was provided in a resource overlay + boolean showIllo = getResources().getBoolean(R.bool.show_sim_app_dialog_illo); + View illoContainer = findViewById(R.id.illo_container); + illoContainer.setVisibility(showIllo ? View.VISIBLE : View.GONE); + // Include carrier name in description text if its present in the intent Intent intent = getIntent(); if (intent != null) { -- cgit v1.2.3-59-g8ed1b