am bc0b4313: am 2032a120: Merge "Making runway lights appear for correct pages (issue 7232481)" into jb-mr1-dev
* commit 'bc0b4313a98b8584a939a5087689117d9ffd1966':
Making runway lights appear for correct pages (issue 7232481)
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user