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

am: e86ac2f

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

Change-Id: Icbca2a9a418f8461d5134c7e10eff7f0556554d8
This commit is contained in:
Julia Reynolds
2016-04-20 21:13:45 +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:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:paddingStart="8dp"> android:paddingStart="8dp"
android:animateLayoutChanges="true" >
<!-- volume rows added and removed here! :-) --> <!-- 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" /> <include layout="@layout/volume_zen_footer" />

View File

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

View File

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