diff options
Diffstat (limited to 'java/com/android/incallui')
8 files changed, 38 insertions, 63 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index b9e6744ea..dd1fc4f37 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -469,6 +469,8 @@ public class CallCardPresenter .setSessionModificationState(primary.getVideoTech().getSessionModificationState()) .setDisconnectCause(primary.getDisconnectCause()) .setConnectionLabel(getConnectionLabel()) + .setPrimaryColor( + InCallPresenter.getInstance().getThemeColorManager().getPrimaryColor()) .setSimSuggestionReason(getSimSuggestionReason()) .setConnectionIcon(getCallStateIcon()) .setGatewayNumber(getGatewayNumber()) 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 3a68bd4f6..b5f1e4bb3 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 @@ -118,9 +118,9 @@ android:layout_marginStart="24dp" android:layout_marginEnd="24dp"/> - <!-- TODO(a bug): textColorPrimary or textColorPrimaryInverse? --> <TextView android:id="@+id/incall_important_call_badge" + style="@style/Dialer.TextAppearance.SubHeader" android:layout_width="wrap_content" android:layout_height="32dp" android:layout_marginTop="4dp" @@ -129,7 +129,6 @@ android:gravity="center" android:maxLines="1" android:text="@string/call_incoming_important" - style="@style/Dialer.TextAppearance.SubHeader" android:textColor="?android:attr/colorBackground"/> <FrameLayout @@ -138,9 +137,7 @@ android:layout_height="wrap_content"/> <include - layout="@layout/device_number_row" - android:layout_width="match_parent" - android:layout_height="wrap_content"/> + layout="@layout/device_number_row"/> <FrameLayout android:id="@+id/incall_data_container" diff --git a/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml b/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml index 0bcba95f2..c0924468c 100644 --- a/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml +++ b/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml @@ -17,5 +17,5 @@ <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/ripple_material_light"> - <item android:drawable="@android:color/white"/> + <item android:drawable="?android:attr/colorBackgroundFloating"/> </ripple> diff --git a/java/com/android/incallui/calllocation/impl/res/values/styles.xml b/java/com/android/incallui/calllocation/impl/res/values/styles.xml deleted file mode 100644 index 45e9c98d4..000000000 --- a/java/com/android/incallui/calllocation/impl/res/values/styles.xml +++ /dev/null @@ -1,47 +0,0 @@ -<!-- - ~ 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 - --> -<resources> - - <style name="LocationAddressTitleTextStyle"> - <item name="android:textSize">14sp</item> - <item name="android:textColor">#dd000000</item> - <item name="android:fontFamily">sans-serif-medium</item> - </style> - - <style name="LocationAddressTextStyle"> - <item name="android:textSize">16sp</item> - <item name="android:textColor">#dd000000</item> - <item name="android:fontFamily">sans-serif</item> - </style> - - <style name="LocationLatLongTextStyle"> - <item name="android:textSize">14sp</item> - <item name="android:textColor">#88000000</item> - <item name="android:fontFamily">sans-serif</item> - </style> - - <style name="LocationLoadingTextStyle"> - <item name="android:textSize">14sp</item> - <item name="android:textColor">#dd000000</item> - <item name="android:fontFamily">sans-serif</item> - </style> - - <style name="LocationErrorTextStyle"> - <item name="android:textSize">14sp</item> - <item name="android:textColor">#dd000000</item> - <item name="android:fontFamily">sans-serif</item> - </style> -</resources> diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java index 82a103a61..d242c3a14 100644 --- a/java/com/android/incallui/contactgrid/TopRow.java +++ b/java/com/android/incallui/contactgrid/TopRow.java @@ -21,8 +21,12 @@ import android.graphics.drawable.Drawable; import android.support.annotation.Nullable; import android.telephony.PhoneNumberUtils; import android.text.BidiFormatter; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.Spanned; import android.text.TextDirectionHeuristics; import android.text.TextUtils; +import android.text.style.ForegroundColorSpan; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.incallui.call.state.DialerCallState; @@ -141,8 +145,7 @@ public class TopRow { } else if (state.isWifi() && !TextUtils.isEmpty(state.connectionLabel())) { return state.connectionLabel(); } else if (isAccount(state)) { - return context.getString( - R.string.contact_grid_incoming_via_template, state.connectionLabel()); + return getColoredConnectionLabel(context, state); } else if (state.isWorkCall()) { return context.getString(R.string.contact_grid_incoming_work_call); } else { @@ -150,6 +153,22 @@ public class TopRow { } } + private static Spannable getColoredConnectionLabel(Context context, PrimaryCallState state) { + Assert.isNotNull(state.connectionLabel()); + String label = + context.getString(R.string.contact_grid_incoming_via_template, state.connectionLabel()); + Spannable spannable = new SpannableString(label); + + int start = label.indexOf(state.connectionLabel()); + int end = start + state.connectionLabel().length(); + spannable.setSpan( + new ForegroundColorSpan(state.primaryColor()), + start, + end, + Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + return spannable; + } + private static CharSequence getLabelForIncomingVideo( Context context, @SessionModificationState int sessionModificationState, boolean isWifi) { if (sessionModificationState == SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) { diff --git a/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml b/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml index 4f8bbad5a..f4792d8ed 100644 --- a/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml +++ b/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml @@ -19,21 +19,19 @@ android:id="@+id/contactgrid_location_divider" android:layout_width="match_parent" android:layout_height="1dp" - android:layout_gravity="bottom" - android:background="#D8D8D8" + android:background="@color/dialer_divider_line_color" android:visibility="gone"/> <TextView android:id="@+id/contactgrid_device_number_text" + style="@style/Dialer.TextAppearance.Primary2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:padding="16dp" - android:background="@android:color/white" - android:elevation="2dp" + android:background="?android:attr/colorBackgroundFloating" + android:elevation="4dp" android:gravity="start" android:orientation="vertical" - android:textColor="#DD000000" - android:textSize="16sp" android:visibility="gone"/> </merge>
\ No newline at end of file diff --git a/java/com/android/incallui/contactgrid/res/values/strings.xml b/java/com/android/incallui/contactgrid/res/values/strings.xml index 7c0f5a679..9ee10c327 100644 --- a/java/com/android/incallui/contactgrid/res/values/strings.xml +++ b/java/com/android/incallui/contactgrid/res/values/strings.xml @@ -89,7 +89,7 @@ <string name="contact_grid_incoming_work_call">Work call from</string> <!-- Displayed in the answer call screen for incoming calls via a phone account. --> - <string name="contact_grid_incoming_via_template">Incoming via <xliff:g id="provider_name">%s</xliff:g></string> + <string name="contact_grid_incoming_via_template">Call via <xliff:g id="provider_name">%s</xliff:g> from</string> <!-- Displayed in the answer call screen for incoming spam calls. --> <string name="contact_grid_incoming_suspected_spam">Suspected spam caller</string> diff --git a/java/com/android/incallui/incall/protocol/PrimaryCallState.java b/java/com/android/incallui/incall/protocol/PrimaryCallState.java index 423f86875..e07caf1b6 100644 --- a/java/com/android/incallui/incall/protocol/PrimaryCallState.java +++ b/java/com/android/incallui/incall/protocol/PrimaryCallState.java @@ -17,6 +17,7 @@ package com.android.incallui.incall.protocol; import android.graphics.drawable.Drawable; +import android.support.annotation.ColorInt; import android.support.annotation.IntDef; import android.support.annotation.Nullable; import android.telecom.DisconnectCause; @@ -59,6 +60,8 @@ public abstract class PrimaryCallState { @Nullable public abstract String connectionLabel(); + public abstract @ColorInt int primaryColor(); + @Nullable public abstract SuggestionProvider.Reason simSuggestionReason(); @@ -127,7 +130,8 @@ public abstract class PrimaryCallState { .setIsBusinessNumber(false) .setSupportsCallOnHold(true) .setSwapToSecondaryButtonState(ButtonState.NOT_SUPPORT) - .setIsAssistedDialed(false); + .setIsAssistedDialed(false) + .setPrimaryColor(0); } /** Builder class for primary call state info. */ @@ -148,6 +152,8 @@ public abstract class PrimaryCallState { public abstract Builder setConnectionIcon(Drawable connectionIcon); + public abstract Builder setPrimaryColor(@ColorInt int color); + public abstract Builder setGatewayNumber(String gatewayNumber); public abstract Builder setCallSubject(String callSubject); |