summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-04-24 22:59:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-24 22:59:58 +0000
commite33cf96b4be14f64935b91e6a21ec1c8ab676acf (patch)
tree0bb7ba343cac53d6727aa9b1ea52ed3c37a11d62
parent2384e1aa8bbc17fe334984888e7ce449a714a82d (diff)
parent4cbc973e15f98618638e12ea36651d15191e3301 (diff)
Merge "Remove floating action bar constants and configurations method."
-rw-r--r--res/values/dimens.xml6
-rw-r--r--src/com/android/dialer/DialtactsActivity.java31
2 files changed, 2 insertions, 35 deletions
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 469677892..2fe7677e5 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -65,14 +65,8 @@
<!-- Match call_button_height to Phone's dimens/in_call_end_button_height -->
<dimen name="call_button_height">74dp</dimen>
- <!-- Height of the floating action button -->
- <dimen name="floating_action_button_height">60dp</dimen>
- <!-- Width of the floating action button -->
- <dimen name="floating_action_button_width">60dp</dimen>
<!-- Bottom margin of the floating action button -->
<dimen name="floating_action_button_margin_bottom">10dp</dimen>
- <!-- Z translation of the floating action button -->
- <dimen name="floating_action_button_translation_z">5dp</dimen>
<!-- Dimensions for speed dial tiles -->
<dimen name="contact_tile_divider_width">1dp</dimen>
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 5dabb930d..3603696bf 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -65,6 +65,7 @@ import com.android.contacts.common.activity.TransactionSafeActivity;
import com.android.contacts.common.dialog.ClearFrequentsDialog;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
+import com.android.contacts.common.util.ViewUtil;
import com.android.dialer.calllog.CallLogActivity;
import com.android.dialer.database.DialerDatabaseHelper;
import com.android.dialer.dialpad.DialpadFragment;
@@ -329,7 +330,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mFragmentsFrame = findViewById(R.id.dialtacts_frame);
mFloatingActionButton = findViewById(R.id.floating_action_button);
- setupFloatingActionButton(mFloatingActionButton);
+ ViewUtil.setupFloatingActionButton(mFloatingActionButton, getResources());
mDialButton = findViewById(R.id.dial_button);
mDialButton.setOnClickListener(this);
@@ -888,34 +889,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
return resolveInfo != null && resolveInfo.size() > 0;
}
- private void setupFloatingActionButton(View view) {
- // Once layout is complete and the floating action button has been assigned a width
- // and height, assign the outline.
- view.addOnLayoutChangeListener(new OnLayoutChangeListener() {
- @Override
- public void onLayoutChange(View v,
- int left,
- int top,
- int right,
- int bottom,
- int oldLeft,
- int oldTop,
- int oldRight,
- int oldBottom) {
- final Outline outline = new Outline();
- final int minDimension = Math.min(right - left, bottom - top);
- if (minDimension <= 0) {
- return;
- }
- outline.setRoundRect(0, 0, right - left, bottom - top, minDimension / 2);
- v.setOutline(outline);
- v.setClipToOutline(true);
- }
- });
- view.setTranslationZ(getResources().getDimensionPixelSize(
- R.dimen.floating_action_button_translation_z));
- }
-
@Override
public void showCallHistory() {
// Use explicit CallLogActivity intent instead of ACTION_VIEW +