SetupWizard: Add generic sim missing asset

Change-Id: I2dcae095c96a020a54792a939b053ae78005d056
This commit is contained in:
cretin45 2015-02-06 14:05:26 -08:00 committed by Ed Carrigan
parent b168a71af0
commit 7970c9b351
9 changed files with 22 additions and 14 deletions

BIN
res/drawable-hdpi/sim.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
res/drawable-mdpi/sim.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/drawable-xhdpi/sim.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
res/drawable-xxhdpi/sim.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
res/drawable-xxxhdpi/sim.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -49,10 +49,8 @@
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_gravity="right"
android:gravity="right"
android:scaleType="fitEnd"
android:src="@drawable/sim_back"/>
android:src="@drawable/sim"/>
</LinearLayout>
</FrameLayout>

View File

@ -45,13 +45,11 @@
<ImageView
android:id="@+id/sim_slot_image"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:layout_gravity="right"
android:gravity="right"
android:scaleType="fitEnd"
android:src="@drawable/sim_back"/>
android:src="@drawable/sim"/>
</LinearLayout>
</FrameLayout>

View File

@ -16,6 +16,8 @@
-->
<resources>
<integer name="local_picker_items">3</integer>
<bool name="sim_back">false</bool>
<bool name="branded_device">false</bool>
<!-- The type of sim image to display.
0=default sim image, 1=sim on side, 2=sim on back-->
<integer name="sim_image_type">0</integer>
</resources>

View File

@ -29,6 +29,10 @@ public class SimCardMissingPage extends SetupPage {
public static final String TAG = "SimCardMissingPage";
private static final int SIM_DEFAULT = 0;
private static final int SIM_SIDE = 1;
private static final int SIM_BACK = 2;
public SimCardMissingPage(Context context, SetupDataCallbacks callbacks) {
super(context, callbacks);
}
@ -66,13 +70,19 @@ public class SimCardMissingPage extends SetupPage {
@Override
protected void initializePage() {
final boolean simOnBack = getResources().getBoolean(
R.bool.sim_back);
final int simLocation = getResources().getInteger(
R.integer.sim_image_type);
ImageView simLogo = ((ImageView)mRootView.findViewById(R.id.sim_slot_image));
if (simOnBack) {
simLogo.setImageResource(R.drawable.sim_back);
} else {
simLogo.setImageResource(R.drawable.sim_side);
switch (simLocation) {
case SIM_SIDE:
simLogo.setImageResource(R.drawable.sim_side);
break;
case SIM_BACK:
simLogo.setImageResource(R.drawable.sim_back);
break;
default:
simLogo.setImageResource(R.drawable.sim);
simLogo.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
}
}