The numbers are centered in the field.
The active background is used when non empty.
Added top and bottom margin.
The font used appear a bit small compare to the
design, need to come up with a textAppearance resource
to control it (future CL)
Tested on cdma and gsm phones.
Bug:
2104523
android:layout_height="fill_parent"
android:orientation="vertical"
>
+
<!-- Text field above the keypad where the digits are displayed -->
+ <!-- TODO: Use a textAppearance to control the display of the number -->
<EditText android:id="@+id/digits"
android:layout_width="fill_parent"
android:layout_height="66dip"
+ android:layout_marginBottom="6dip"
+ android:layout_marginTop="1dip"
+ android:gravity="center"
android:maxLines="1"
android:scrollHorizontally="true"
android:textSize="28sp"
>
<!-- Text field above the keypad where the digits are displayed -->
+ <!-- TODO: Use a textAppearance to control the display of the number -->
<EditText android:id="@+id/digits"
android:layout_width="fill_parent"
android:layout_height="66dip"
+ android:layout_marginBottom="6dip"
+ android:layout_marginTop="1dip"
+ android:gravity="center"
android:maxLines="1"
android:scrollHorizontally="true"
android:textSize="28sp"
mDigits.getText().clear();
}
+ final boolean notEmpty = mDigits.length() != 0;
+ if (notEmpty) {
+ mDigits.setBackgroundDrawable(mDigitsBackground);
+ } else {
+ mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
+ }
+
updateDialAndDeleteButtonStateEnabledAttr();
}
// Set the content view
setContentView(getContentViewResource());
- // Load up the resources for the text field and delete button
+ // Load up the resources for the text field.
Resources r = getResources();
mDigitsBackground = r.getDrawable(R.drawable.btn_dial_textfield_active);
- //mDigitsBackground.setDither(true);
mDigitsEmptyBackground = r.getDrawable(R.drawable.btn_dial_textfield);
mDigits = (EditText) findViewById(R.id.digits);