Enhanced uri picker activity (image buttons)

This commit is contained in:
Guillaume Beraudo 2011-10-11 14:28:42 +02:00
parent 3f9b721a48
commit df8093eb93
5 changed files with 8 additions and 2 deletions

View file

@ -44,7 +44,9 @@
</intent-filter>
</activity>
<activity android:name="org.linphone.UriPickerActivity" android:theme="@android:style/Theme.NoTitleBar">
<activity android:name="org.linphone.UriPickerActivity"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -26,10 +26,11 @@
<LinearLayout android:gravity="bottom"
android:layout_height="wrap_content" android:layout_width="fill_parent">
<Button android:id="@+id/AddCallButton" android:text="@string/AddCallButtonText"
android:gravity="bottom|center_horizontal"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:layout_weight="1" android:background="@drawable/clavier_bg" />
<Button android:id="@+id/AddCallCancelButton" android:text="@string/CancelButtonText"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_weight="1" android:background="@drawable/clavier_bg" />
</LinearLayout>

View file

@ -115,11 +115,14 @@ public class UriPickerActivity extends TabActivity implements ContactPicked {
mAddress = (AddressText) findViewById(R.id.SipUri);
addButton = (Button) findViewById(R.id.AddCallButton);
// addButton.setCompoundDrawablePadding(100);
addButton.setOnClickListener(this);
String type = getIntent().getStringExtra(EXTRA_PICKER_TYPE);
if (EXTRA_PICKER_TYPE_ADD.equals(type)) {
addButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.picker_plus, 0, 0);
addButton.setText(getString(R.string.AddCallButtonText));
} else if (EXTRA_PICKER_TYPE_TRANSFER.equals(type)) {
addButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.picker_transfer, 0, 0);
addButton.setText(getString(R.string.TransferCallButtonText));
} else {
throw new RuntimeException("unknown type");