am 2032a120: Merge "Making runway lights appear for correct pages (issue 7232481)" into jb-mr1-dev

* commit '2032a12036cf684f8ac6c24406685a7f97d52649':
  Making runway lights appear for correct pages (issue 7232481)
This commit is contained in:
Adam Cohen
2012-09-30 14:54:44 -07:00
committed by Android Git Automerger
2 changed files with 16 additions and 5 deletions

View File

@@ -54,7 +54,7 @@
<Space <Space
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"/> android:layout_weight="1.6"/>
<com.android.internal.policy.impl.keyguard.KeyguardGlowStripView <com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
android:id="@+id/right_strip" android:id="@+id/right_strip"
android:layout_width="0dip" android:layout_width="0dip"

View File

@@ -18,15 +18,16 @@ package com.android.internal.policy.impl.keyguard;
import android.content.Context; import android.content.Context;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.android.internal.R; import com.android.internal.R;
import com.android.internal.policy.impl.keyguard.PagedView.PageSwitchListener;
public class KeyguardWidgetRegion extends LinearLayout { public class KeyguardWidgetRegion extends LinearLayout implements PageSwitchListener {
KeyguardGlowStripView mLeftStrip; KeyguardGlowStripView mLeftStrip;
KeyguardGlowStripView mRightStrip; KeyguardGlowStripView mRightStrip;
KeyguardWidgetPager mPager; KeyguardWidgetPager mPager;
private int mPage = 0;
public KeyguardWidgetRegion(Context context) { public KeyguardWidgetRegion(Context context) {
this(context, null, 0); this(context, null, 0);
@@ -46,6 +47,7 @@ public class KeyguardWidgetRegion extends LinearLayout {
mLeftStrip = (KeyguardGlowStripView) findViewById(R.id.left_strip); mLeftStrip = (KeyguardGlowStripView) findViewById(R.id.left_strip);
mRightStrip = (KeyguardGlowStripView) findViewById(R.id.right_strip); mRightStrip = (KeyguardGlowStripView) findViewById(R.id.right_strip);
mPager = (KeyguardWidgetPager) findViewById(R.id.app_widget_container); mPager = (KeyguardWidgetPager) findViewById(R.id.app_widget_container);
mPager.setPageSwitchListener(this);
setSoundEffectsEnabled(false); setSoundEffectsEnabled(false);
setOnClickListener(new OnClickListener() { setOnClickListener(new OnClickListener() {
@@ -57,7 +59,16 @@ public class KeyguardWidgetRegion extends LinearLayout {
} }
public void showPagingFeedback() { public void showPagingFeedback() {
mLeftStrip.makeEmGo(); if (mPage < mPager.getPageCount() - 1) {
mRightStrip.makeEmGo(); mLeftStrip.makeEmGo();
}
if (mPage > 0) {
mRightStrip.makeEmGo();
}
}
@Override
public void onPageSwitch(View newPage, int newPageIndex) {
mPage = newPageIndex;
} }
} }