Merge "Fix QS Issues" into nyc-dev
This commit is contained in:
@@ -28,9 +28,7 @@
|
||||
android:layout_marginTop="@dimen/status_bar_header_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false" />
|
||||
android:paddingBottom="8dp" />
|
||||
|
||||
<include layout="@layout/quick_status_bar_expanded_header" />
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<style name="BrightnessDialogContainer" parent="@style/BaseBrightnessDialogContainer">
|
||||
<item name="android:layout_width">480dp</item>
|
||||
<item name="android:layout_width">@dimen/standard_notification_panel_width</item>
|
||||
</style>
|
||||
|
||||
<style name="UserDetailView">
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
||||
if (mPageIndicator == null) return;
|
||||
mPageIndicator.setLocation(position);
|
||||
if (mPageListener != null) {
|
||||
mPageListener.onPageChanged(position);
|
||||
mPageListener.onPageChanged(position == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
||||
int positionOffsetPixels) {
|
||||
if (mPageIndicator == null) return;
|
||||
mPageIndicator.setLocation(position + positionOffset);
|
||||
if (mPageListener != null) {
|
||||
mPageListener.onPageChanged(position == 0 && positionOffsetPixels == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -209,6 +212,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
|
||||
};
|
||||
|
||||
public interface PageListener {
|
||||
void onPageChanged(int page);
|
||||
void onPageChanged(boolean isFirst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +69,13 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageChanged(int page) {
|
||||
mOnFirstPage = page == 0;
|
||||
if (!mOnFirstPage) {
|
||||
public void onPageChanged(boolean isFirst) {
|
||||
if (mOnFirstPage == isFirst) return;
|
||||
if (!isFirst) {
|
||||
setPosition(1);
|
||||
clearAnimationState();
|
||||
}
|
||||
mOnFirstPage = isFirst;
|
||||
}
|
||||
|
||||
private void updateAnimators() {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class TouchAnimator {
|
||||
}
|
||||
if (mListener != null) {
|
||||
if (mLastT == 0 || mLastT == 1) {
|
||||
if (t != 0) {
|
||||
if (t != mLastT) {
|
||||
mListener.onAnimationStarted();
|
||||
}
|
||||
} else if (t == 1) {
|
||||
|
||||
@@ -80,13 +80,13 @@ public class BrightnessMirrorController {
|
||||
|
||||
// Original is slightly larger than the mirror, so make sure to use the center for the
|
||||
// positioning.
|
||||
int originalX = mInt2Cache[0] + original.getWidth()/2;
|
||||
int originalY = mInt2Cache[1];
|
||||
int originalX = mInt2Cache[0] + original.getWidth() / 2;
|
||||
int originalY = mInt2Cache[1] + original.getHeight() / 2;
|
||||
mBrightnessMirror.setTranslationX(0);
|
||||
mBrightnessMirror.setTranslationY(0);
|
||||
mBrightnessMirror.getLocationInWindow(mInt2Cache);
|
||||
int mirrorX = mInt2Cache[0] + mBrightnessMirror.getWidth()/2;
|
||||
int mirrorY = mInt2Cache[1];
|
||||
int mirrorX = mInt2Cache[0] + mBrightnessMirror.getWidth() / 2;
|
||||
int mirrorY = mInt2Cache[1] + mBrightnessMirror.getHeight() / 2;
|
||||
mBrightnessMirror.setTranslationX(originalX - mirrorX);
|
||||
mBrightnessMirror.setTranslationY(originalY - mirrorY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user