--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<!-- Background resource for dial button for the various 12 key dialers. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Disabled views -->
+ <item android:state_focused="true" android:state_enabled="false"
+ android:drawable="@drawable/btn_dial_action_middle_disable_focused" />
+ <item android:state_enabled="false"
+ android:drawable="@drawable/btn_dial_action_middle_disable" />
+
+ <!-- Enabled views -->
+ <item android:state_pressed="true" android:state_enabled="true"
+ android:drawable="@drawable/btn_dial_action_middle_pressed" />
+ <item android:state_focused="true" android:state_enabled="true"
+ android:drawable="@drawable/btn_dial_action_middle_selected" />
+ <item android:state_enabled="true"
+ android:drawable="@drawable/btn_dial_action_middle_normal" />
+</selector>
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.
<!-- Keypad section -->
<include layout="@layout/dialpad" />
- <!-- Onscreen "Dial" button, used on some platforms -->
- <Button android:id="@+id/dialButton"
- android:text="@string/dial_button_label"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:layout_width="wrap_content"
- android:layout_height="60dip"
- android:gravity="center"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="20dip"
- android:paddingLeft="100dip"
- android:paddingRight="100dip"
- android:enabled="false"
- android:visibility="gone"
- />
+ <!-- Horizontal row of buttons (Voicemail + DialButton + Backspace.) -->
+ <LinearLayout android:id="@+id/voicemailAndDialAndBackspace"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="7dip"
+ android:orientation="horizontal">
+
+ <!-- Onscreen "Dial" button, used on all platforms by
+ default. Its usage can be disabled using resources (see
+ config.xml.) -->
+ <ImageButton android:id="@+id/dialButton"
+ android:layout_width="116dip"
+ android:layout_height="50dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_action"
+ android:src="@drawable/ic_dial_action_call" />
+ </LinearLayout>
<!-- "Dialpad chooser" UI, shown only when the user brings up the
Dialer while a call is already in progress.
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.
</LinearLayout>
- <!-- Onscreen "Dial" button, used on some platforms -->
- <Button android:id="@+id/dialButton"
- android:text="@string/dial_button_label"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:layout_width="wrap_content"
- android:layout_height="60dip"
- android:gravity="center"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="20dip"
- android:paddingLeft="100dip"
- android:paddingRight="100dip"
- android:enabled="false"
- android:visibility="gone"
- />
+ <!-- Horizontal row of buttons (Voicemail + DialButton + Backspace.) -->
+ <LinearLayout android:id="@+id/voicemailAndDialAndBackspace"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="7dip"
+ android:orientation="horizontal">
+
+ <!-- Onscreen "Dial" button, used on all platforms by
+ default. Its usage can be disabled using resources (see
+ config.xml.) -->
+ <ImageButton android:id="@+id/dialButton"
+ android:layout_width="116dip"
+ android:layout_height="50dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_action"
+ android:src="@drawable/ic_dial_action_call" />
+ </LinearLayout>
<!-- "Dialpad chooser" UI, shown only when the user brings up the
Dialer while a call is already in progress.
<string name="config_export_extensions_to_consider" translatable="false"></string>
<!-- If true, show an onscreen "Dial" button in the dialer.
- (In practice this is used only on platforms with no hard SEND/END
+ In practice this is used on all platforms even the ones with hard SEND/END
keys, but for maximum flexibility it's controlled by a flag here
- (which can be overridden on a per-product basis.)) -->
- <bool name="config_show_onscreen_dial_button">false</bool>
+ (which can be overridden on a per-product basis.) -->
+ <bool name="config_show_onscreen_dial_button">true</bool>
</resources>
private View mDigitsAndBackspace;
private View mDialpad;
private View mDialButton;
+ private View mVoicemailDialAndBackspaceRow;
private ListView mDialpadChooser;
private DialpadChooserAdapter mDialpadChooserAdapter;
//Member variables for dialpad options
mDigits.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
- // Update the enabledness of the "Dial" button
- if (mDialButton != null) {
- mDialButton.setEnabled(mDigits.length() != 0);
- }
+ updateDialButtonStateEnabledAttr();
}
@Override
setupKeypad();
}
+ mVoicemailDialAndBackspaceRow = findViewById(R.id.voicemailAndDialAndBackspace);
+
// Check whether we should show the onscreen "Dial" button.
+ mDialButton = mVoicemailDialAndBackspaceRow.findViewById(R.id.dialButton);
+
if (r.getBoolean(R.bool.config_show_onscreen_dial_button)) {
- mDialButton = findViewById(R.id.dialButton);
- mDialButton.setVisibility(View.VISIBLE); // It's GONE by default
mDialButton.setOnClickListener(this);
+ } else {
+ mDialButton.setVisibility(View.GONE); // It's VISIBLE by default
+ mDialButton = null;
}
view = findViewById(R.id.backspace);
// be visible if the phone is idle!
showDialpadChooser(false);
}
+
+ updateDialButtonStateEnabledAttr();
}
@Override
// Log.i(TAG, "Showing dialpad chooser!");
mDigitsAndBackspace.setVisibility(View.GONE);
if (mDialpad != null) mDialpad.setVisibility(View.GONE);
- if (mDialButton != null) mDialButton.setVisibility(View.GONE);
+ mVoicemailDialAndBackspaceRow.setVisibility(View.GONE);
mDialpadChooser.setVisibility(View.VISIBLE);
// Instantiate the DialpadChooserAdapter and hook it up to the
// Log.i(TAG, "Displaying normal Dialer UI.");
mDigitsAndBackspace.setVisibility(View.VISIBLE);
if (mDialpad != null) mDialpad.setVisibility(View.VISIBLE);
- if (mDialButton != null) mDialButton.setVisibility(View.VISIBLE);
+ mVoicemailDialAndBackspaceRow.setVisibility(View.VISIBLE);
mDialpadChooser.setVisibility(View.GONE);
}
}
}
/**
+ * Update the enabledness of the "Dial" button if applicable.
+ */
+ private void updateDialButtonStateEnabledAttr() {
+ if (mDialButton != null) {
+ mDialButton.setEnabled(mDigits.length() != 0);
+ }
+ }
+
+ /**
* This function return true if Wait menu item can be shown
* otherwise returns false. Assumes the passed string is non-empty
* and the 0th index check is not required.