Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c7d976a authored by Danesh M's avatar Danesh M
Browse files

Dialpad Layout Fixes

This allows the layout of the dialer to be scaled better.

Also makes landscape mode actually functional

Patchset 2/3/4 : Cleanup

Change-Id: I1d564f90b4c1fb4805c4d152981eeb6f035c5d54
parent 9216cdd0
Loading
Loading
Loading
Loading
+144 −123
Original line number Diff line number Diff line
@@ -13,126 +13,147 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- Dialpad in the Contact app.
 -->

<com.android.phone.ButtonGridLayout xmlns:android="http://schemas.android.com/apk/res/android"
<TableLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/dialpad"
    android:paddingLeft="7dp"
    android:paddingRight="7dp"
    android:paddingTop="6dp"
    android:paddingBottom="6dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_weight="1"
>
        <ImageButton android:id="@+id/one"
	android:layout_width="match_parent"
	android:layout_height="0dp"
	android:layout_weight="5"
	android:gravity="center_vertical">
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/one"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_1_no_vm"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_one"
        />

        <ImageButton android:id="@+id/two"
			android:contentDescription="@string/description_image_button_one" />
		<ImageButton
			android:id="@+id/two"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_2"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_two"
        />

        <ImageButton android:id="@+id/three"
			android:contentDescription="@string/description_image_button_two" />
		<ImageButton
			android:id="@+id/three"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_3"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_three"
        />

        <ImageButton android:id="@+id/four"
			android:contentDescription="@string/description_image_button_three" />
	</TableRow>
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/four"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_4"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_four"
        />

        <ImageButton android:id="@+id/five"
			android:contentDescription="@string/description_image_button_four" />
		<ImageButton
			android:id="@+id/five"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_5"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_five"
        />

        <ImageButton android:id="@+id/six"
			android:contentDescription="@string/description_image_button_five" />
		<ImageButton
			android:id="@+id/six"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_6"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_six"
        />

        <ImageButton android:id="@+id/seven"
			android:contentDescription="@string/description_image_button_six" />
	</TableRow>
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/seven"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_7"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_seven"
        />

        <ImageButton android:id="@+id/eight"
			android:contentDescription="@string/description_image_button_seven" />
		<ImageButton
			android:id="@+id/eight"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_8"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_eight"
        />

        <ImageButton android:id="@+id/nine"
			android:contentDescription="@string/description_image_button_eight" />
		<ImageButton
			android:id="@+id/nine"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_9"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_nine"
        />

        <ImageButton android:id="@+id/star"
			android:contentDescription="@string/description_image_button_nine" />
	</TableRow>
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/star"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_star"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_star"
        />

        <ImageButton android:id="@+id/zero"
			android:contentDescription="@string/description_image_button_star" />
		<ImageButton
			android:id="@+id/zero"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_0"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_zero"
        />

        <ImageButton android:id="@+id/pound"
			android:contentDescription="@string/description_image_button_zero" />
		<ImageButton
			android:id="@+id/pound"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="50dp"
			android:src="@drawable/dial_num_pound"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
            android:contentDescription="@string/description_image_button_pound"
        />
</com.android.phone.ButtonGridLayout>
			android:contentDescription="@string/description_image_button_pound" />
	</TableRow>
</TableLayout>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="6dip"
    android:layout_weight="1"
    android:layout_weight="0.5"
    android:orientation="horizontal">

    <!-- Onscreen "Voicemail" button.
+159 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<TableLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/dialpad"
	android:layout_width="0dp"
	android:layout_height="match_parent"
	android:gravity="center"
	android:layout_weight="1">
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/one"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_1_no_vm"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_one" />
		<ImageButton
			android:id="@+id/two"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_2"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_two" />
		<ImageButton
			android:id="@+id/three"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_3"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_three" />
	</TableRow>
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/four"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_4"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_four" />
		<ImageButton
			android:id="@+id/five"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_5"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_five" />
		<ImageButton
			android:id="@+id/six"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_6"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_six" />
	</TableRow>
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/seven"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_7"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_seven" />
		<ImageButton
			android:id="@+id/eight"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_8"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_eight" />
		<ImageButton
			android:id="@+id/nine"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_9"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_nine" />
	</TableRow>
	<TableRow
		android:layout_weight="1"
		android:gravity="center">
		<ImageButton
			android:id="@+id/star"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_star"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_star" />
		<ImageButton
			android:id="@+id/zero"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_0"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_zero" />
		<ImageButton
			android:id="@+id/pound"
			android:layout_weight="1"
			android:layout_marginRight="3dp"
			android:layout_width="88dp"
			android:layout_height="58dp"
			android:src="@drawable/dial_num_pound"
			android:background="@drawable/btn_dial"
			android:soundEffectsEnabled="false"
			android:contentDescription="@string/description_image_button_pound" />
	</TableRow>
</TableLayout>
 No newline at end of file
+41 −38
Original line number Diff line number Diff line
@@ -13,24 +13,30 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/top"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
    <include
        layout="@layout/dialpad" />
    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical"
>

    <!-- Text field above the keypad where the digits are displayed.
         It's type is set to PHONE (to put the keyboard in the right
         config) in the java code.
    -->
        android:layout_weight="1">
        <!-- Text field above the keypad where the digits are displayed. It's type
            is set to PHONE (to put the keyboard in the right config) in the java code. -->
        <!-- TODO: Use a textAppearance to control the display of the number -->
    <EditText android:id="@+id/digits"
        <EditText
            android:id="@+id/digits"
            android:layout_width="match_parent"
        android:layout_height="66dip"
        android:layout_marginBottom="50dip"
        android:layout_marginTop="1dip"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:layout_marginBottom="1dp"
            android:layout_marginTop="1dp"
            android:gravity="center"
            android:maxLines="1"
            android:scrollHorizontally="true"
@@ -38,20 +44,17 @@
            android:freezesText="true"
            android:background="@drawable/btn_dial_textfield"
            android:textColor="@color/dialer_button_text"
        android:hint="@string/dialerKeyboardHintText"
     />

            android:hint="@string/dialerKeyboardHintText" />
        <!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
    <include layout="@layout/voicemail_dial_delete" />

    <!-- "Dialpad chooser" UI, shown only when the user brings up the
         Dialer while a call is already in progress.
         When this UI is visible, the other Dialer elements
         (the textfield and button) are hidden. -->
    <ListView android:id="@+id/dialpadChooser"
        <include
            layout="@layout/voicemail_dial_delete" />
        <!-- "Dialpad chooser" UI, shown only when the user brings up the Dialer 
            while a call is already in progress. When this UI is visible, the other Dialer 
            elements (the textfield and button) are hidden. -->
        <ListView
            android:id="@+id/dialpadChooser"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
        android:footerDividersEnabled="true"
    />

            android:footerDividersEnabled="true" />
    </LinearLayout>
</LinearLayout>
 No newline at end of file
+58 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/voicemailAndDialAndDelete"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:orientation="vertical">
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="wrap_content">
		<!-- Onscreen "Voicemail" button. The width is 75 (from the mocks) + 12
			of padding from the 9patch, total is 87. -->
		<ImageButton
			android:id="@+id/voicemailButton"
			android:layout_width="0dp"
			android:layout_weight="1"
			android:layout_height="wrap_content"
			android:state_enabled="false"
			android:background="@drawable/btn_dial_voicemail"
			android:contentDescription="@string/description_voicemail_button"
			android:src="@drawable/ic_dial_action_voice_mail" />
		<!-- Onscreen "Dial" button, used on all platforms by default. Its usage
			can be disabled using resources (see config.xml.) -->
		<!-- Onscreen "Backspace/Delete" button The width is 75 (from the mocks)
			+ 12 of padding from the 9patch, total is 87. -->
		<ImageButton
			android:id="@+id/deleteButton"
			android:layout_width="0dp"
			android:layout_weight="1"
			android:layout_height="wrap_content"
			android:state_enabled="false"
			android:background="@drawable/btn_dial_delete"
			android:contentDescription="@string/description_delete_button"
			android:src="@drawable/ic_dial_action_delete" />
	</LinearLayout>
	<ImageButton
		android:id="@+id/dialButton"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:state_enabled="false"
		android:background="@drawable/btn_dial_action"
		android:contentDescription="@string/description_dial_button"
		android:src="@drawable/ic_dial_action_call" />
</LinearLayout>
 No newline at end of file
Loading