diff options
author | Rakesh Iyer <rni@google.com> | 2017-04-26 13:58:21 -0700 |
---|---|---|
committer | Rakesh Iyer <rni@google.com> | 2017-04-26 14:05:08 -0700 |
commit | 676781bf09b69966f83ba99c1b7ee0c7d6ae00e4 (patch) | |
tree | 231d04b80295d3d8a42061c99333d8ce613533d6 | |
parent | 2c445ca12f977e523500ee97d20ccc43e665281e (diff) | |
download | Dialer-676781bf09b69966f83ba99c1b7ee0c7d6ae00e4.tar.gz |
Remove dead code from dialer.
Remove a bunch of unused code that was related to rotary and
other non-existent things.
Test: Fired up dialer, made a call, received a call.
Change-Id: I10bb11cf386341b497dba1e054fbe40d11068c5b
-rw-r--r-- | res/drawable/ic_rotary_dialpad.xml | 23 | ||||
-rw-r--r-- | res/layout/ongoing_call.xml | 6 | ||||
-rw-r--r-- | res/layout/rotary_in_call_dialpad.xml | 117 | ||||
-rw-r--r-- | res/values/attrs.xml | 63 | ||||
-rw-r--r-- | res/values/bools.xml | 18 | ||||
-rw-r--r-- | res/values/dimens.xml | 2 | ||||
-rw-r--r-- | res/values/integers.xml | 18 | ||||
-rw-r--r-- | res/values/legal.xml | 19 | ||||
-rw-r--r-- | src/com/android/car/dialer/DialerFragment.java | 51 | ||||
-rw-r--r-- | src/com/android/car/dialer/OngoingCallFragment.java | 230 |
10 files changed, 58 insertions, 489 deletions
diff --git a/res/drawable/ic_rotary_dialpad.xml b/res/drawable/ic_rotary_dialpad.xml deleted file mode 100644 index d37c0fbc..00000000 --- a/res/drawable/ic_rotary_dialpad.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2015 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. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:state_activated="true" - android:drawable="@drawable/ic_123_activated" /> - <item - android:state_activated="false" - android:drawable="@drawable/ic_123_normal" /> -</selector>
\ No newline at end of file diff --git a/res/layout/ongoing_call.xml b/res/layout/ongoing_call.xml index 722d64ca..3faeca5a 100644 --- a/res/layout/ongoing_call.xml +++ b/res/layout/ongoing_call.xml @@ -208,12 +208,6 @@ android:src="@drawable/ic_dialpad" android:tint="@color/car_tint" android:background="@drawable/ongoing_call_action_background" /> - <include - android:id="@+id/rotary_dialpad" - android:layout_width="@dimen/ongoing_call_rotary_dialpad_width" - android:layout_height="match_parent" - android:visibility="gone" - layout="@layout/rotary_in_call_dialpad" /> </LinearLayout> </FrameLayout> </FrameLayout> diff --git a/res/layout/rotary_in_call_dialpad.xml b/res/layout/rotary_in_call_dialpad.xml deleted file mode 100644 index cc7236ae..00000000 --- a/res/layout/rotary_in_call_dialpad.xml +++ /dev/null @@ -1,117 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2015 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:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center_vertical"> - - <TextView - android:id="@+id/one" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/one" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/two" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/two" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/three" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/three" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/four" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/four" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/five" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/five" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/six" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/six" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/seven" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/seven" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/eight" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/eight" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/nine" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/nine" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/zero" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/zero" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/pound" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/pound" - style="@style/InCallDialpad" /> - - <TextView - android:id="@+id/star" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/star" - style="@style/InCallDialpad" /> -</LinearLayout>
\ No newline at end of file diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 1fb22c07..4c0636bc 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -14,69 +14,6 @@ limitations under the License. --> <resources> - <declare-styleable name="ImageButtonWithAlphaFade"> - <!-- Fade duration in ms --> - <attr name="fadeDuration" format="integer" /> - <attr name="alphaNormal" format="float" /> - <attr name="alphaSelected" format="float" /> - <attr name="fadeColor" format="integer" /> - </declare-styleable> - - <declare-styleable name="BrowseItemView"> - <attr name="detailAnimation" format="reference" /> - </declare-styleable> - - <declare-styleable name="PlayingState"> - <attr name="state_paused" format="boolean"/> - <attr name="state_playing_to_pause" format="boolean"/> - <attr name="state_playing_to_stop" format="boolean"/> - <attr name="state_buffering_to_pause" format="boolean"/> - <attr name="state_buffering_to_stop" format="boolean"/> - <attr name="state_stopped" format="boolean"/> - <attr name="state_disabled" format="boolean"/> - </declare-styleable> - - <!-- IME stuff --> - <!-- Modified KeyboardView --> - <declare-styleable name="KeyboardView"> - <attr name="keyBackground" format="reference"/> - <attr name="keyTextSize" format="dimension"/> - <attr name="keyTextColorPrimary" format="color"/> - <attr name="keyTextColorSecondary" format="color"/> - <attr name="labelTextSize" format="dimension"/> - <attr name="fontFamily" format="string" /> - <attr name="textStyle" format="enum"> - <enum name="normal" value="0" /> - <enum name="bold" value="1" /> - <enum name="italic" value="2" /> - <enum name="bold_italic" value="3" /> - </attr> - </declare-styleable> - - <declare-styleable name="RotaryKeyboardLayout"> - <attr name="selectedKeyTextColor" format="color" /> - <attr name="selectedKeyTextSize" format="dimension" /> - <attr name="selectedCircleColor" format="dimension" /> - <attr name="selectedCircleRadius" format="dimension" /> - <attr name="clickedCircleRadius" format="dimension" /> - <attr name="movedCircleRadius" format="dimension" /> - <attr name="ringKeySpacing" format="dimension" /> - <attr name="ringKeyTextColor" format="color" /> - <attr name="ringKeyTextSize" format="dimension" /> - <attr name="selectedKeyMargin" format="dimension" /> - <attr name="selectedKeygroupTextSize" format="dimension" /> - <attr name="keyGroupTextSize" format="dimension" /> - <attr name="keyGroupCircleRadius" format="dimension" /> - <attr name="keyGroupCircleColor" format="color" /> - <attr name="keyGroupSpacing" format="dimension" /> - </declare-styleable> - - <declare-styleable name="PageIndicator"> - <attr name="dotPadding" format="dimension" /> - <attr name="inactiveDotSrc" format="reference" /> - <attr name="activeDotSrc" format="reference" /> - </declare-styleable> - <!-- The configurable text for a dialpad button. --> <declare-styleable name="DialpadButton"> <!-- The dialpad number, such as "1". --> diff --git a/res/values/bools.xml b/res/values/bools.xml deleted file mode 100644 index faff177c..00000000 --- a/res/values/bools.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Copyright (C) 2015 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. ---> -<resources> - <bool name="has_touch">true</bool> -</resources>
\ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml index f306f89a..6311442e 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -14,8 +14,6 @@ limitations under the License. --> <resources> - <dimen name="ongoing_call_rotary_dialpad_width">520dp</dimen> - <!-- Dialer --> <dimen name="dial_container_vertical_margin">48dp</dimen> <dimen name="dial_number_call_button_width">80dp</dimen> diff --git a/res/values/integers.xml b/res/values/integers.xml deleted file mode 100644 index b6c1c48a..00000000 --- a/res/values/integers.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Copyright (C) 2015 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. ---> -<resources> - <!-- Media --> - </resources>
\ No newline at end of file diff --git a/res/values/legal.xml b/res/values/legal.xml deleted file mode 100644 index c4a14cd3..00000000 --- a/res/values/legal.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Copyright (C) 2015 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. ---> -<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <!-- Legal Text. MUST review with PMs and Legal. --> - <!-- Legal Text. MUST review with PMs and Legal. --> - </resources>
\ No newline at end of file diff --git a/src/com/android/car/dialer/DialerFragment.java b/src/com/android/car/dialer/DialerFragment.java index e84f1891..bf3197a5 100644 --- a/src/com/android/car/dialer/DialerFragment.java +++ b/src/com/android/car/dialer/DialerFragment.java @@ -132,38 +132,33 @@ public class DialerFragment extends Fragment { }); mNumberView = (TextView) view.findViewById(R.id.number); - final boolean hasTouch = getResources().getBoolean(R.bool.has_touch); if (Log.isLoggable(TAG, Log.VERBOSE)) { - Log.v(TAG, "hasTouch: " + hasTouch + ", mShowInput: " + mShowInput); + Log.v(TAG, "mShowInput: " + mShowInput); } - if (hasTouch) { - // Only show the delete and call buttons in touch mode. - // Buttons are in rotary input itself. - View callButton = view.findViewById(R.id.call); - FabDrawable answerCallDrawable = new FabDrawable(mContext); - answerCallDrawable.setFabAndStrokeColor(getResources().getColor(R.color.phone_call)); - callButton.setBackground(answerCallDrawable); - callButton.setVisibility(View.VISIBLE); - callButton.setOnClickListener((unusedView) -> { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Call button clicked, placing a call: " + mNumber.toString()); - } - - if (!TextUtils.isEmpty(mNumber.toString())) { - mUiCallManager.safePlaceCall(mNumber.toString(), false); - } - }); - View deleteButton = view.findViewById(R.id.delete); - deleteButton.setVisibility(View.VISIBLE); - deleteButton.setOnClickListener((unusedView) -> { - if (mNumber.length() != 0) { - mNumber.deleteCharAt(mNumber.length() - 1); - mNumberView.setText(getFormattedNumber(mNumber.toString())); - } - }); - } + View callButton = view.findViewById(R.id.call); + FabDrawable answerCallDrawable = new FabDrawable(mContext); + answerCallDrawable.setFabAndStrokeColor(getResources().getColor(R.color.phone_call)); + callButton.setBackground(answerCallDrawable); + callButton.setVisibility(View.VISIBLE); + callButton.setOnClickListener((unusedView) -> { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "Call button clicked, placing a call: " + mNumber.toString()); + } + + if (!TextUtils.isEmpty(mNumber.toString())) { + mUiCallManager.safePlaceCall(mNumber.toString(), false); + } + }); + View deleteButton = view.findViewById(R.id.delete); + deleteButton.setVisibility(View.VISIBLE); + deleteButton.setOnClickListener((unusedView) -> { + if (mNumber.length() != 0) { + mNumber.deleteCharAt(mNumber.length() - 1); + mNumberView.setText(getFormattedNumber(mNumber.toString())); + } + }); setupKeypad(view); diff --git a/src/com/android/car/dialer/OngoingCallFragment.java b/src/com/android/car/dialer/OngoingCallFragment.java index a083b802..7e88f7be 100644 --- a/src/com/android/car/dialer/OngoingCallFragment.java +++ b/src/com/android/car/dialer/OngoingCallFragment.java @@ -95,7 +95,6 @@ public class OngoingCallFragment extends Fragment { private View mDialpadContainer; private View mSecondaryCallContainer; private View mSecondaryCallControls; - private LinearLayout mRotaryDialpad; private List<View> mDialpadViews; private String mLoadedNumber; private CharSequence mCallInfoLabel; @@ -147,43 +146,32 @@ public class OngoingCallFragment extends Fragment { mSmallContactPhotoView = (ImageView) view.findViewById(R.id.small_contact_photo); mSecondaryCallContainer = view.findViewById(R.id.secondary_call_container); mSecondaryCallControls = view.findViewById(R.id.secondary_call_controls); - mRotaryDialpad = (LinearLayout) view.findViewById(R.id.rotary_dialpad); mSwapButton = (ImageButton) view.findViewById(R.id.swap); mMergeButton = (ImageButton) view.findViewById(R.id.merge); mAnswerCallButton = (ImageButton) view.findViewById(R.id.answer_call_button); mRejectCallButton = (ImageButton) view.findViewById(R.id.reject_call_button); - boolean hasTouch = getResources().getBoolean(R.bool.has_touch); - View dialPadContainer = hasTouch ? mDialpadContainer : mRotaryDialpad; mDialpadViews = Arrays.asList( - dialPadContainer.findViewById(R.id.one), - dialPadContainer.findViewById(R.id.two), - dialPadContainer.findViewById(R.id.three), - dialPadContainer.findViewById(R.id.four), - dialPadContainer.findViewById(R.id.five), - dialPadContainer.findViewById(R.id.six), - dialPadContainer.findViewById(R.id.seven), - dialPadContainer.findViewById(R.id.eight), - dialPadContainer.findViewById(R.id.nine), - dialPadContainer.findViewById(R.id.zero), - dialPadContainer.findViewById(R.id.pound), - dialPadContainer.findViewById(R.id.star) + mDialpadContainer.findViewById(R.id.one), + mDialpadContainer.findViewById(R.id.two), + mDialpadContainer.findViewById(R.id.three), + mDialpadContainer.findViewById(R.id.four), + mDialpadContainer.findViewById(R.id.five), + mDialpadContainer.findViewById(R.id.six), + mDialpadContainer.findViewById(R.id.seven), + mDialpadContainer.findViewById(R.id.eight), + mDialpadContainer.findViewById(R.id.nine), + mDialpadContainer.findViewById(R.id.zero), + mDialpadContainer.findViewById(R.id.pound), + mDialpadContainer.findViewById(R.id.star) ); - if (hasTouch) { - // In touch screen, we need to adjust the InCall card for the narrow screen to show the - // full dial pad. - for (View dialpadView : mDialpadViews) { - dialpadView.setOnTouchListener(mDialpadTouchListener); - dialpadView.setOnKeyListener(mDialpadKeyListener); - } - } else { - for (View dialpadView : mDialpadViews) { - dialpadView.setOnKeyListener(mDialpadKeyListener); - } - mToggleDialpadButton.setImageResource(R.drawable.ic_rotary_dialpad); + + // In touch screen, we need to adjust the InCall card for the narrow screen to show the + // full dial pad. + for (View dialpadView : mDialpadViews) { + dialpadView.setOnTouchListener(mDialpadTouchListener); + dialpadView.setOnKeyListener(mDialpadKeyListener); } - setDialPadFocusability(!hasTouch); - setInCallControllerFocusability(!hasTouch); mAnswerCallButton.setOnClickListener((unusedView) -> { UiCall call = mUiCallManager.getCallWithState(Call.STATE_RINGING); @@ -274,7 +262,6 @@ public class OngoingCallFragment extends Fragment { mUiCallManager.addListener(mCallListener); updateCalls(); - updateRotaryFocus(); return view; } @@ -425,13 +412,8 @@ public class OngoingCallFragment extends Fragment { // If it is a voicemail call, open the dialpad (with no animation). if (primaryNumber != null && primaryNumber.equals( TelecomUtils.getVoicemailNumber(context))) { - if (getResources().getBoolean(R.bool.has_touch)) { - openDialpad(false /*animate*/); - mToggleDialpadButton.setVisibility(View.GONE); - } else { - mToggleDialpadButton.setVisibility(View.VISIBLE); - mToggleDialpadButton.requestFocus(); - } + openDialpad(false /*animate*/); + mToggleDialpadButton.setVisibility(View.GONE); } else { mToggleDialpadButton.setVisibility(View.VISIBLE); } @@ -498,79 +480,23 @@ public class OngoingCallFragment extends Fragment { return; } mToggleDialpadButton.setActivated(true); - if (getResources().getBoolean(R.bool.has_touch)) { - // This array of of size 2 because getLocationOnScreen returns (x,y) coordinates. - int[] location = new int[2]; - mToggleDialpadButton.getLocationOnScreen(location); + // This array of of size 2 because getLocationOnScreen returns (x,y) coordinates. + int[] location = new int[2]; + mToggleDialpadButton.getLocationOnScreen(location); - // The dialpad should be aligned with the right edge of mToggleDialpadButton. - int startingMargin = location[1] + mToggleDialpadButton.getWidth(); + // The dialpad should be aligned with the right edge of mToggleDialpadButton. + int startingMargin = location[1] + mToggleDialpadButton.getWidth(); - ViewGroup.MarginLayoutParams layoutParams = - (ViewGroup.MarginLayoutParams) mDialpadContainer.getLayoutParams(); + ViewGroup.MarginLayoutParams layoutParams = + (ViewGroup.MarginLayoutParams) mDialpadContainer.getLayoutParams(); - if (layoutParams.getMarginStart() != startingMargin) { - layoutParams.setMarginStart(startingMargin); - mDialpadContainer.setLayoutParams(layoutParams); - } - - Animation anim = new DialpadAnimation(getContext(), false /* reverse */, animate); - mDialpadContainer.startAnimation(anim); - } else { - final int toggleButtonImageOffset = getResources().getDimensionPixelSize( - R.dimen.in_call_toggle_button_image_offset); - final int muteButtonLeftMargin = - ((LinearLayout.LayoutParams) mMuteButton.getLayoutParams()).leftMargin; - - mEndCallButton.animate() - .alpha(0) - .setStartDelay(0) - .setDuration(384) - .setInterpolator(mAccelerateDecelerateInterpolator) - .withEndAction(() -> { - mEndCallButton.setVisibility(View.INVISIBLE); - mEndCallButton.setFocusable(false); - }).start(); - mMuteButton.animate() - .alpha(0) - .setStartDelay(0) - .setDuration(240) - .setInterpolator(mAccelerateDecelerateInterpolator) - .withEndAction(() -> { - mMuteButton.setVisibility(View.INVISIBLE); - mMuteButton.setFocusable(false); - }).start(); - mToggleDialpadButton.animate() - .setStartDelay(0) - .translationX(-(mEndCallButton.getWidth() + muteButtonLeftMargin - + mMuteButton.getWidth() + toggleButtonImageOffset)) - .setDuration(480) - .setInterpolator(mAccelerateDecelerateInterpolator) - .start(); - - mRotaryDialpad.setTranslationX( - -(mEndCallButton.getWidth() + muteButtonLeftMargin + toggleButtonImageOffset)); - mRotaryDialpad.animate() - .translationX(-(mEndCallButton.getWidth() + muteButtonLeftMargin - + mMuteButton.getWidth() + toggleButtonImageOffset)) - .setDuration(320) - .setInterpolator(mAccelerateDecelerateInterpolator) - .setStartDelay(240) - .withStartAction(() -> { - mRotaryDialpad.setVisibility(View.VISIBLE); - int delay = 0; - for (View dialpadView : mDialpadViews) { - dialpadView.setAlpha(0); - dialpadView.animate() - .alpha(1) - .setDuration(160) - .setStartDelay(delay) - .setInterpolator(mAccelerateInterpolator) - .start(); - delay += 10; - } - }).start(); + if (layoutParams.getMarginStart() != startingMargin) { + layoutParams.setMarginStart(startingMargin); + mDialpadContainer.setLayoutParams(layoutParams); } + + Animation anim = new DialpadAnimation(getContext(), false /* reverse */, animate); + mDialpadContainer.startAnimation(anim); } private void closeDialpad() { @@ -578,92 +504,8 @@ public class OngoingCallFragment extends Fragment { return; } mToggleDialpadButton.setActivated(false); - if (getResources().getBoolean(R.bool.has_touch)) { - Animation anim = new DialpadAnimation(getContext(), true /* reverse */); - mDialpadContainer.startAnimation(anim); - } else { - final int toggleButtonImageOffset = getResources().getDimensionPixelSize( - R.dimen.in_call_toggle_button_image_offset); - final int muteButtonLeftMargin = - ((LinearLayout.LayoutParams) mMuteButton.getLayoutParams()).leftMargin; - - mRotaryDialpad.animate() - .setStartDelay(0) - .translationX(-(mEndCallButton.getWidth() - + muteButtonLeftMargin + toggleButtonImageOffset)) - .setDuration(320) - .setInterpolator(mAccelerateDecelerateInterpolator) - .withStartAction(() -> { - int delay = 0; - for (int i = mDialpadViews.size() - 1; i >= 0; i--) { - View dialpadView = mDialpadViews.get(i); - dialpadView.animate() - .alpha(0) - .setDuration(160) - .setStartDelay(delay) - .setInterpolator(mAccelerateInterpolator) - .start(); - delay += 10; - } - }).withEndAction(() -> { - mRotaryDialpad.setVisibility(View.GONE); - mRotaryDialpad.setTranslationX(0); - }).start(); - mToggleDialpadButton.animate() - .translationX(0) - .setDuration(480) - .setStartDelay(80) - .setInterpolator(mAccelerateDecelerateInterpolator) - .start(); - mMuteButton.animate() - .alpha(1) - .setDuration(176) - .setInterpolator(mAccelerateDecelerateInterpolator) - .setStartDelay(384) - .withStartAction(() -> { - mMuteButton.setVisibility(View.VISIBLE); - mMuteButton.setFocusable(true); - }).start(); - mEndCallButton.animate() - .alpha(1) - .setDuration(320) - .setInterpolator(mAccelerateDecelerateInterpolator) - .setStartDelay(240) - .withStartAction(() -> { - mEndCallButton.setVisibility(View.VISIBLE); - mEndCallButton.setFocusable(true); - }).start(); - } - } - - private void updateRotaryFocus() { - boolean hasTouch = getResources().getBoolean(R.bool.has_touch); - if (mPrimaryCall != null && !hasTouch) { - if (mPrimaryCall.getState() == Call.STATE_RINGING) { - mRingingCallControls.requestFocus(); - } else { - mActiveCallControls.requestFocus(); - } - } - } - - private void setInCallControllerFocusability(boolean focusable) { - mSwapButton.setFocusable(focusable); - mMergeButton.setFocusable(focusable); - - mAnswerCallButton.setFocusable(focusable); - mRejectCallButton.setFocusable(focusable); - - mEndCallButton.setFocusable(focusable); - mUnholdCallButton.setFocusable(focusable); - mMuteButton.setFocusable(focusable); - mToggleDialpadButton.setFocusable(focusable); - } - - private void setDialPadFocusability(boolean focusable) { - for (View dialPadView : mDialpadViews) { - dialPadView.setFocusable(focusable); - } + Animation anim = new DialpadAnimation(getContext(), true /* reverse */); + mDialpadContainer.startAnimation(anim); } private final View.OnTouchListener mDialpadTouchListener = new View.OnTouchListener() { @@ -817,8 +659,6 @@ public class OngoingCallFragment extends Fragment { Log.d(TAG, "onStateChanged"); } updateCalls(); - // this will reset the focus if any state of any call changes on pure rotary devices. - updateRotaryFocus(); } @Override |