diff options
author | Eric Erfanian <erfanian@google.com> | 2018-05-30 16:17:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-30 16:17:27 +0000 |
commit | 2c3d81eeac82472d06027bc65d661e16735c8608 (patch) | |
tree | 293aeb0012d8db8f3f4606a75a422cf4da328477 /java/com/android/incallui/answer/impl | |
parent | 4efd0ebf003e985e7cbe40d8ffd9f7ff227a9611 (diff) | |
parent | 152c3fd58f83a1882bcdc8bc55f46bbb8f3173c9 (diff) |
Merge changes Ica13ee39,I5e0fedc8,I8e7efad0,I0ecc1f91,Iee1e658a, ...
* changes:
Drop maps.impl from packages.mk
Check if ID column is null before retrieving data from the smart dial database.
Rename theme/private to theme/hidden.
Some improvements to the answer fragment layouts.
Better a11y for the bottom sheet.
Fix a few UI bugs.
Log IMS video call available state
Better a11y for contact badge in the new call log.
Use lookup key to determine the letter tile color
Use Dialer Light Theme for SpeakEasyFragment
Better a11y for new call log entries.
Use Maps SDK lite mode instead of static API for emergency call.
Updating locations where PrimaryInfo#setPhoto is used to also PrimaryInfo#setPhotoUri for new GlidePhotoManager implementation. As part of this addition, we also are cleaning the setPhoto(null) because this is not explicitly needed.
Converted ThemeUtil into a DaggerModule.
Delete AppCompatConstants
Remove photo support in PhoneNumberService
Began implementation of Dialer dark theme.
Diffstat (limited to 'java/com/android/incallui/answer/impl')
4 files changed, 119 insertions, 38 deletions
diff --git a/java/com/android/incallui/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java index d44a5daa2..18e0e9864 100644 --- a/java/com/android/incallui/answer/impl/AnswerFragment.java +++ b/java/com/android/incallui/answer/impl/AnswerFragment.java @@ -49,6 +49,8 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; import com.android.dialer.common.Assert; import com.android.dialer.common.FragmentUtils; import com.android.dialer.common.LogUtil; @@ -82,6 +84,8 @@ import com.android.incallui.incalluilock.InCallUiLock; import com.android.incallui.maps.MapsComponent; import com.android.incallui.sessiondata.AvatarPresenter; import com.android.incallui.sessiondata.MultimediaFragment; +import com.android.incallui.speakeasy.Annotations.SpeakEasyIcon; +import com.android.incallui.speakeasy.Annotations.SpeakEasyText; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.incallui.util.AccessibilityUtil; import com.android.incallui.video.protocol.VideoCallScreen; @@ -144,6 +148,9 @@ public class AnswerFragment extends Fragment private View importanceBadge; private SwipeButtonView secondaryButton; private SwipeButtonView answerAndReleaseButton; + private LinearLayout chipLayout; + private ImageView chipIcon; + private TextView chipText; private AffordanceHolderLayout affordanceHolderLayout; // Use these flags to prevent user from clicking accept/reject buttons multiple times. // We use separate flags because in some rare cases accepting a call may fail to join the room, @@ -195,17 +202,6 @@ public class AnswerFragment extends Fragment public void performAction(AnswerFragment fragment) { fragment.performAnswerAndRelease(); } - }, - - SPEAKEASY( - R.drawable.quantum_ic_rtt_vd_theme_24, - R.string.speakeasy_secondary_button_hint, - R.string.speakeasy_secondary_button_hint, - R.string.speakeasy_secondary_button_hint) { - @Override - public void performAction(AnswerFragment fragment) { - fragment.performSpeakEasy(); - } }; @DrawableRes public int icon; @@ -232,8 +228,7 @@ public class AnswerFragment extends Fragment } } - private void performSpeakEasy() { - restoreAnswerAndReleaseButtonAnimation(); + private void performSpeakEasy(View unused) { answerScreenDelegate.onSpeakEasyCall(); buttonAcceptClicked = true; } @@ -457,16 +452,6 @@ public class AnswerFragment extends Fragment if (allowAnswerAndRelease()) { answerAndReleaseButton.setVisibility(View.VISIBLE); answerScreenDelegate.onAnswerAndReleaseButtonEnabled(); - } else if (allowSpeakEasy()) { - Optional<Integer> alternativeIcon = SpeakEasyComponent.get(getContext()).speakEasyIcon(); - if (alternativeIcon.isPresent()) { - // TODO(erfanian): Replace enum hack when we have a dedicated button. - SecondaryBehavior.SPEAKEASY.icon = alternativeIcon.get(); - } - answerAndReleaseBehavior = SecondaryBehavior.SPEAKEASY; - answerAndReleaseBehavior.applyToView(answerAndReleaseButton); - answerAndReleaseButton.setVisibility(View.VISIBLE); - answerScreenDelegate.onAnswerAndReleaseButtonEnabled(); } else { answerAndReleaseButton.setVisibility(View.INVISIBLE); answerScreenDelegate.onAnswerAndReleaseButtonDisabled(); @@ -480,6 +465,27 @@ public class AnswerFragment extends Fragment }); } + /** Initialize chip buttons */ + private void initChips() { + if (!allowSpeakEasy()) { + chipLayout.setVisibility(View.GONE); + return; + } + chipLayout.setVisibility(View.VISIBLE); + chipLayout.setOnClickListener(this::performSpeakEasy); + + @SpeakEasyIcon + Optional<Integer> alternativeIcon = SpeakEasyComponent.get(getContext()).speakEasyIcon(); + @SpeakEasyText + Optional<Integer> alternativeText = SpeakEasyComponent.get(getContext()).speakEasyText(); + if (alternativeIcon.isPresent() && alternativeText.isPresent()) { + chipIcon.setImageDrawable(getContext().getDrawable(alternativeIcon.get())); + chipText.setText(alternativeText.get()); + // The button needs to override normal swipe up/down behavior. + chipLayout.bringToFront(); + } + } + @Override public boolean allowAnswerAndRelease() { return getArguments().getBoolean(ARG_ALLOW_ANSWER_AND_RELEASE); @@ -715,6 +721,9 @@ public class AnswerFragment extends Fragment View view = inflater.inflate(R.layout.fragment_incoming_call, container, false); secondaryButton = (SwipeButtonView) view.findViewById(R.id.incoming_secondary_button); answerAndReleaseButton = (SwipeButtonView) view.findViewById(R.id.incoming_secondary_button2); + chipLayout = view.findViewById(R.id.incall_data_container_chip_container); + chipIcon = view.findViewById(R.id.incall_data_container_chip_icon); + chipText = view.findViewById(R.id.incall_data_container_chip_text); affordanceHolderLayout = (AffordanceHolderLayout) view.findViewById(R.id.incoming_container); affordanceHolderLayout.setAffordanceCallback(affordanceCallback); @@ -755,6 +764,7 @@ public class AnswerFragment extends Fragment .newAnswerScreenDelegate(this); initSecondaryButton(); + initChips(); int flags = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; if (!isInMultiWindowMode diff --git a/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml b/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml index 600115e27..2b3391dde 100644 --- a/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml +++ b/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml @@ -99,7 +99,7 @@ android:focusable="false" android:outlineProvider="none" android:src="@drawable/quantum_ic_call_white_24" - android:tint="@color/incoming_answer_icon" + android:tint="@color/dialer_call_green" android:tintMode="src_atop" tools:outlineProvider="background"/> diff --git a/java/com/android/incallui/answer/impl/res/drawable/shape_chip_drawable.xml b/java/com/android/incallui/answer/impl/res/drawable/shape_chip_drawable.xml new file mode 100644 index 000000000..3740f3d1b --- /dev/null +++ b/java/com/android/incallui/answer/impl/res/drawable/shape_chip_drawable.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 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 + --> +<ripple xmlns:android="http://schemas.android.com/apk/res/android" + android:color="#DADCE0"> + <item android:id="@android:id/mask"> + <shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="@color/dialer_background_light"/> + <padding + android:bottom="9dp" + android:left="8dp" + android:right="8dp" + android:top="9dp"/> + <corners android:radius="40dp"/> + </shape> + </item> + <item> + <shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="@color/dialer_background_floating_light"/> + <stroke + android:width="1dp" + android:color="#DADCE0"/> + <padding + android:bottom="9dp" + android:left="8dp" + android:right="8dp" + android:top="9dp"/> + <corners android:radius="40dp"/> + </shape> + </item> +</ripple>
\ No newline at end of file diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml index 589a74325..944d290b1 100644 --- a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml +++ b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml @@ -53,6 +53,13 @@ android:layout_height="match_parent" android:fitsSystemWindows="true"> + <FrameLayout + android:id="@+id/answer_method_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"/> + <TextView android:id="@+id/videocall_video_off" android:layout_width="wrap_content" @@ -74,8 +81,8 @@ android:layout_marginTop="24dp" android:clipChildren="false" android:clipToPadding="false" - android:gravity="top|center_horizontal" android:focusable="true" + android:gravity="top|center_horizontal" android:orientation="vertical"> <include @@ -111,21 +118,22 @@ android:layout_marginStart="24dp" android:layout_marginEnd="24dp"/> + <!-- TODO(a bug): textColorPrimary or textColorPrimaryInverse? --> <TextView android:id="@+id/incall_important_call_badge" + android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginTop="4dp" android:layout_marginBottom="@dimen/answer_importance_margin_bottom" - android:gravity="center" + android:background="@drawable/urgent_call_background" android:elevation="@dimen/answer_data_elevation" + android:gravity="center" android:maxLines="1" android:text="@string/call_incoming_important" android:textAllCaps="true" - android:textSize="14sp" - android:textStyle="bold" android:textColor="?android:attr/colorBackground" - android:background="@drawable/urgent_call_background"/> + android:textSize="14sp"/> <FrameLayout android:id="@+id/incall_location_holder" @@ -143,7 +151,34 @@ android:layout_height="0dp" android:layout_weight="1" android:clipChildren="false" - android:clipToPadding="false"/> + android:clipToPadding="false"> + <LinearLayout + android:id="@+id/incall_data_container_chip_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:background="@drawable/shape_chip_drawable" + android:clickable="true" + android:orientation="horizontal" + android:visibility="gone"> + <ImageView + android:id="@+id/incall_data_container_chip_icon" + android:layout_width="20dp" + android:layout_height="20dp" + android:src="@drawable/quantum_ic_rtt_vd_theme_24" + android:tint="#1A73E8"/> + <TextView + android:id="@+id/incall_data_container_chip_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:fontFamily="sans-serif-medium" + android:text="@string/speakeasy_secondary_button_hint" + android:textColor="@color/dialer_primary_text_color" + android:textSize="14sp"/> + </LinearLayout> + </FrameLayout> <!-- Space holder for answer method. This is used to get better scaling to make room for incall_data_container on different screen size. --> @@ -152,14 +187,6 @@ android:layout_height="220dp"/> </LinearLayout> - - <FrameLayout - android:id="@+id/answer_method_container" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:clipChildren="false" - android:clipToPadding="false"/> - </FrameLayout> <com.android.incallui.answer.impl.affordance.SwipeButtonView |