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:
@@ -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" />
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user