summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-03-02 02:20:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-03-02 02:20:13 +0000
commit83f06749ec7d4c11003a055d35968a82562a2c55 (patch)
tree288fd78fc1f31978d5548411fea8c019f840a347 /java/com/android/dialer
parent8ddc801874663e67e662ec7ea2f185579ce22b89 (diff)
parent6c81c662a38ed448722fe5251375fef4d4e1a59a (diff)
downloadandroid_packages_apps_Dialer-83f06749ec7d4c11003a055d35968a82562a2c55.tar.gz
android_packages_apps_Dialer-83f06749ec7d4c11003a055d35968a82562a2c55.tar.bz2
android_packages_apps_Dialer-83f06749ec7d4c11003a055d35968a82562a2c55.zip
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.
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r--java/com/android/dialer/app/list/PhoneFavoriteTileView.java5
-rw-r--r--java/com/android/dialer/main/impl/MainSearchController.java5
-rw-r--r--java/com/android/dialer/main/impl/res/layout/main_activity.xml2
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java3
-rw-r--r--java/com/android/dialer/widget/DialerFloatingActionButton.java79
-rw-r--r--java/com/android/dialer/widget/EmptyContentView.java9
-rw-r--r--java/com/android/dialer/widget/res/layout-land/empty_content_view.xml2
-rw-r--r--java/com/android/dialer/widget/res/values/colors.xml16
8 files changed, 117 insertions, 4 deletions
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