Merge "Move volume dialog expander"

This commit is contained in:
TreeHugger Robot
2017-02-18 00:05:34 +00:00
committed by Android (Google) Code Review
4 changed files with 35 additions and 19 deletions

View File

@@ -20,6 +20,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/volume_dialog_margin_bottom"
android:background="@drawable/volume_dialog_background"
android:paddingTop="@dimen/volume_dialog_padding_top"
android:translationZ="4dp" >
<LinearLayout
@@ -29,16 +30,11 @@
android:orientation="vertical" >
<LinearLayout
android:id="@+id/volume_dialog_rows"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/volume_button_size"
android:paddingTop="@dimen/volume_dialog_collapsed_padding_top"
android:orientation="vertical" >
<View android:id="@+id/spacer"
android:layout_width="match_parent"
android:layout_height="@dimen/volume_dialog_expanded_spacer"
android:visibility="gone"/>
android:id="@+id/volume_dialog_rows"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/volume_button_size"
android:orientation="vertical" >
<!-- volume rows added and removed here! :-) -->
</LinearLayout>
@@ -48,7 +44,21 @@
<include layout="@layout/tuner_zen_mode_panel" />
</LinearLayout>
<com.android.keyguard.AlphaOptimizedImageButton
<LinearLayout
android:id="@+id/volume_dialog_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/volume_expander_margin_end" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Volume.Header" />
<com.android.keyguard.AlphaOptimizedImageButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/volume_expand_button"
@@ -60,9 +70,7 @@
android:src="@drawable/ic_volume_collapse_animation"
android:background="@drawable/ripple_drawable"
tools:ignore="RtlHardcoded"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginTop="@dimen/volume_expander_margin_top"
android:layout_marginEnd="@dimen/volume_expander_margin_end"/>
/>
</LinearLayout>
</RelativeLayout>

View File

@@ -600,8 +600,7 @@
<!-- Volume dialog root view bottom margin, at rest -->
<dimen name="volume_dialog_margin_bottom">4dp</dimen>
<dimen name="volume_dialog_collapsed_padding_top">8dp</dimen>
<dimen name="volume_dialog_expanded_spacer">14dp</dimen>
<dimen name="volume_dialog_padding_top">8dp</dimen>
<dimen name="volume_dialog_padding_end">40dp</dimen>
<dimen name="volume_row_padding_bottom">9.4dp</dimen>

View File

@@ -622,7 +622,6 @@ public class VolumeDialog implements TunerService.Tunable {
if (!mShowing) {
trimObsoleteH();
}
Util.setVisOrGone(mDialogRowsView.findViewById(R.id.spacer), mExpanded);
// apply changes to all rows
for (final VolumeRow row : mRows) {
final boolean isActive = row == activeRow;

View File

@@ -140,7 +140,17 @@ public class VolumeDialogMotion {
final float v = (Float) mChevronPositionAnimator.getAnimatedValue();
final int posY = chevronPosY();
mChevron.setTranslationY(posY + v + -mDialogView.getTranslationY());
}})
}
})
.withEndAction(new Runnable() {
@Override
public void run() {
if (mChevronPositionAnimator == null) return;
// reposition chevron
final int posY = chevronPosY();
mChevron.setTranslationY(posY + -mDialogView.getTranslationY());
}
})
.start();
mContentsPositionAnimator = ValueAnimator.ofFloat(-chevronDistance(), 0)