Merge "Animate volume dialog expansion/contraction." into nyc-dev

am: e86ac2f

* commit 'e86ac2f0da9ec71e9d990291053eec8f352af52d':
  Animate volume dialog expansion/contraction.

Change-Id: I7c08343c0400ca34031b5908adfee71f80adf5c9
This commit is contained in:
Julia Reynolds
2016-04-20 19:14:35 +00:00
committed by android-build-merger
3 changed files with 9 additions and 16 deletions

View File

@@ -29,15 +29,10 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingStart="8dp">
android:paddingStart="8dp"
android:animateLayoutChanges="true" >
<!-- volume rows added and removed here! :-) -->
<LinearLayout
android:id="@+id/volume_row_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/volume_button_size"
android:orientation="vertical"/>
<include layout="@layout/volume_zen_footer" />

View File

@@ -18,7 +18,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:id="@+id/volume_dialog_row" >
android:id="@+id/volume_dialog_row"
android:paddingEnd="@dimen/volume_button_size" >
<TextView
android:id="@+id/volume_row_header"

View File

@@ -100,7 +100,6 @@ public class VolumeDialog implements TunerService.Tunable {
private CustomDialog mDialog;
private ViewGroup mDialogView;
private ViewGroup mDialogContentView;
private ViewGroup mVolumeRowContainer;
private ImageButton mExpandButton;
private final List<VolumeRow> mRows = new ArrayList<>();
private final SpTexts mSpTexts;
@@ -207,8 +206,6 @@ public class VolumeDialog implements TunerService.Tunable {
}
});
mDialogContentView = (ViewGroup) mDialog.findViewById(R.id.volume_dialog_content);
mVolumeRowContainer =
(ViewGroup) mDialogContentView.findViewById(R.id.volume_row_container);
mExpanded = false;
mExpandButton = (ImageButton) mDialogView.findViewById(R.id.volume_expand_button);
mExpandButton.setOnClickListener(mClickExpand);
@@ -309,7 +306,7 @@ public class VolumeDialog implements TunerService.Tunable {
if (!mRows.isEmpty()) {
addSpacer(row);
}
mVolumeRowContainer.addView(row.view);
mDialogContentView.addView(row.view, mDialogContentView.getChildCount() - 2);
mRows.add(row);
}
@@ -321,7 +318,7 @@ public class VolumeDialog implements TunerService.Tunable {
if (i > 0) {
addSpacer(row);
}
mVolumeRowContainer.addView(row.view);
mDialogContentView.addView(row.view, mDialogContentView.getChildCount() - 2);
}
}
@@ -332,7 +329,7 @@ public class VolumeDialog implements TunerService.Tunable {
.getDimensionPixelSize(R.dimen.volume_slider_interspacing);
final LinearLayout.LayoutParams lp =
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, h);
mVolumeRowContainer.addView(v, lp);
mDialogContentView.addView(v, mDialogContentView.getChildCount() - 2, lp);
row.space = v;
}
@@ -613,8 +610,8 @@ public class VolumeDialog implements TunerService.Tunable {
if (row.ss == null || !row.ss.dynamic) continue;
if (!mDynamic.get(row.stream)) {
mRows.remove(i);
mVolumeRowContainer.removeView(row.view);
mVolumeRowContainer.removeView(row.space);
mDialogContentView.removeView(row.view);
mDialogContentView.removeView(row.space);
}
}
}