diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-03-02 02:20:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-03-02 02:20:13 +0000 |
commit | 83f06749ec7d4c11003a055d35968a82562a2c55 (patch) | |
tree | 288fd78fc1f31978d5548411fea8c019f840a347 | |
parent | 8ddc801874663e67e662ec7ea2f185579ce22b89 (diff) | |
parent | 6c81c662a38ed448722fe5251375fef4d4e1a59a (diff) |
Merge changes Ic19643f4,I4cb7c234,If4e1f7c1,I38facbaa
* changes:
Use voicemail image for empty voicemail tab and update color
Implemented DialerFloatingActionButton
Instead of just cancelling loaders, reset them as well.
Update RTT icon on ringing screen.
10 files changed, 143 insertions, 5 deletions
diff --git a/assets/quantum/res/drawable/quantum_ic_rtt_vd_theme_24.xml b/assets/quantum/res/drawable/quantum_ic_rtt_vd_theme_24.xml new file mode 100644 index 000000000..90e1f8458 --- /dev/null +++ b/assets/quantum/res/drawable/quantum_ic_rtt_vd_theme_24.xml @@ -0,0 +1,25 @@ +<!-- + ~ 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 + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M9.03,3l-1.11,7.07h2.62l0.7,-4.5h2.58L11.8,18.43L9.47,18.43L9.06,21h7.27l0.4,-2.57h-2.35l2,-12.86h2.58l-0.71,4.5h2.65L22,3L9.03,3zM8,5L4,5l-0.31,2h4L8,5zM7.39,9h-4l-0.31,2h4l0.31,-2zM8.31,17h-6L2,19h6l0.31,-2zM8.93,13h-6l-0.31,2h6.01l0.3,-2z"/> +</vector>
\ No newline at end of file diff --git a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java index 3739588ea..30b8464ed 100644 --- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java +++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java @@ -199,9 +199,12 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { */ private void sendViewNotification(Context context, Uri contactUri) { if (loader != null) { - loader.cancelLoad(); + // Cancels the current load if it's running and clears up any memory if it's using any. + loader.reset(); } loader = new ContactLoader(context, contactUri, true /* postViewNotification */); + // Immediately release anything we're holding in memory + loader.registerListener(0, (loader1, contact) -> loader.reset()); loader.startLoading(); } } diff --git a/java/com/android/dialer/main/impl/MainSearchController.java b/java/com/android/dialer/main/impl/MainSearchController.java index a6bdec5eb..993ed3d8c 100644 --- a/java/com/android/dialer/main/impl/MainSearchController.java +++ b/java/com/android/dialer/main/impl/MainSearchController.java @@ -136,6 +136,11 @@ public class MainSearchController implements SearchBarListener { } searchFragment.setQuery("", CallInitiationType.Type.DIALPAD); + // Split the transactions so that the dialpad fragment isn't popped off the stack when we exit + // search. We do this so that the dialpad actually animates down instead of just disappearing. + transaction.commit(); + transaction = mainActivity.getFragmentManager().beginTransaction(); + // Show Dialpad if (getDialpadFragment() == null) { DialpadFragment dialpadFragment = new DialpadFragment(); diff --git a/java/com/android/dialer/main/impl/res/layout/main_activity.xml b/java/com/android/dialer/main/impl/res/layout/main_activity.xml index b69625e63..0883acebc 100644 --- a/java/com/android/dialer/main/impl/res/layout/main_activity.xml +++ b/java/com/android/dialer/main/impl/res/layout/main_activity.xml @@ -37,7 +37,7 @@ android:layout_height="match_parent" android:layout_above="@+id/bottom_nav_bar"/> - <android.support.design.widget.FloatingActionButton + <com.android.dialer.widget.DialerFloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java b/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java index 6d71dade9..3a5e72b6b 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java @@ -210,7 +210,8 @@ public final class NewVoicemailFragment extends Fragment implements LoaderCallba showView(emptyContentView); emptyContentView.setDescription((R.string.empty_voicemail_tab_text)); - emptyContentView.setImage(R.drawable.quantum_ic_schedule_vd_theme_24); + emptyContentView.setImage(R.drawable.quantum_ic_voicemail_vd_theme_24); + emptyContentView.setImageTint(R.color.empty_voicemail_icon_tint_color, null); } private void showView(View view) { diff --git a/java/com/android/dialer/widget/DialerFloatingActionButton.java b/java/com/android/dialer/widget/DialerFloatingActionButton.java new file mode 100644 index 000000000..17ad90736 --- /dev/null +++ b/java/com/android/dialer/widget/DialerFloatingActionButton.java @@ -0,0 +1,79 @@ +/* + * 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 + */ + +package com.android.dialer.widget; + +import android.content.Context; +import android.support.annotation.Nullable; +import android.support.design.widget.FloatingActionButton; +import android.util.AttributeSet; +import com.android.dialer.common.Assert; + +/** + * Since {@link FloatingActionButton} is possibly the worst widget supported by the framework, we + * need this class to work around several of it's bugs. + * + * <p>Current fixes: + * + * <ul> + * <li>Being able to trigger click events twice. + * <li>Banning setVisibility since 9 times out of 10, it just causes bad state. + * </ul> + * + * Planned fixes: + * + * <ul> + * <li>Animating on first show/hide + * <li>Being able to call show/hide rapidly and being in the proper state + * <li>Having a proper 48x48 touch target in mini mode + * </ul> + */ +public class DialerFloatingActionButton extends FloatingActionButton { + + public DialerFloatingActionButton(Context context, AttributeSet attributeSet) { + super(context, attributeSet); + } + + @Override + public void show() { + super.show(); + setClickable(true); + } + + @Override + public void show(@Nullable OnVisibilityChangedListener onVisibilityChangedListener) { + super.show(onVisibilityChangedListener); + setClickable(true); + } + + @Override + public void hide() { + super.hide(); + setClickable(false); + } + + @Override + public void hide(@Nullable OnVisibilityChangedListener onVisibilityChangedListener) { + super.hide(onVisibilityChangedListener); + setClickable(false); + } + + @Override + public void setVisibility(int i) { + throw Assert.createUnsupportedOperationFailException( + "Do not call setVisibility, call show/hide instead"); + } +} diff --git a/java/com/android/dialer/widget/EmptyContentView.java b/java/com/android/dialer/widget/EmptyContentView.java index 5c2e4d501..b99657a10 100644 --- a/java/com/android/dialer/widget/EmptyContentView.java +++ b/java/com/android/dialer/widget/EmptyContentView.java @@ -17,6 +17,10 @@ package com.android.dialer.widget; import android.content.Context; +import android.content.res.ColorStateList; +import android.content.res.Resources.Theme; +import android.support.annotation.ColorRes; +import android.support.annotation.Nullable; import android.support.annotation.StringRes; import android.util.AttributeSet; import android.view.LayoutInflater; @@ -86,6 +90,11 @@ public class EmptyContentView extends LinearLayout implements View.OnClickListen } } + public void setImageTint(@ColorRes int color, @Nullable Theme theme) { + imageView.setImageTintList( + (ColorStateList.valueOf(getContext().getResources().getColor(color, theme)))); + } + public void setActionLabel(@StringRes int resourceId) { actionLabel = resourceId; if (resourceId == NO_LABEL) { diff --git a/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml b/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml index 00344bf44..3a7574f53 100644 --- a/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml +++ b/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml @@ -18,7 +18,7 @@ <ImageView android:id="@+id/empty_list_view_image" android:layout_width="match_parent" - android:layout_height="0dp" + android:layout_height="108dp" android:layout_weight="1" android:maxHeight="126dp" android:gravity="center_horizontal"/> diff --git a/java/com/android/dialer/widget/res/values/colors.xml b/java/com/android/dialer/widget/res/values/colors.xml index c974609ef..12a5cb999 100644 --- a/java/com/android/dialer/widget/res/values/colors.xml +++ b/java/com/android/dialer/widget/res/values/colors.xml @@ -1,4 +1,20 @@ <?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 + --> <resources> <color name="empty_list_text_color">#b2b2b2</color> + <color name="empty_voicemail_icon_tint_color">#E1E1E1</color> </resources>
\ No newline at end of file diff --git a/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java b/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java index b5dbc0c20..2eeecc341 100644 --- a/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java +++ b/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java @@ -336,7 +336,7 @@ public class FlingUpDownMethod extends AnswerMethod implements OnProgressChanged if (getParent().isVideoCall() || getParent().isVideoUpgradeRequest()) { contactPuckIcon.setImageResource(R.drawable.quantum_ic_videocam_white_24); } else if (getParent().isRttCall()) { - contactPuckIcon.setImageResource(R.drawable.quantum_ic_call_white_24); + contactPuckIcon.setImageResource(R.drawable.quantum_ic_rtt_vd_theme_24); } else { contactPuckIcon.setImageResource(R.drawable.quantum_ic_call_white_24); } |