Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d1fb6c5 authored by Adam Cohen's avatar Adam Cohen
Browse files

Making runway lights appear for correct pages (issue 7232481)

Change-Id: I66a48cc8f14cb9ebfbf032287591565f38cb3606
parent 933a7546
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
        <Space
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight="1"/>
            android:layout_weight="1.6"/>
        <com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
            android:id="@+id/right_strip"
            android:layout_width="0dip"
+15 −4
Original line number Diff line number Diff line
@@ -18,15 +18,16 @@ package com.android.internal.policy.impl.keyguard;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

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 mRightStrip;
    KeyguardWidgetPager mPager;
    private int mPage = 0;

    public KeyguardWidgetRegion(Context context) {
        this(context, null, 0);
@@ -46,6 +47,7 @@ public class KeyguardWidgetRegion extends LinearLayout {
        mLeftStrip = (KeyguardGlowStripView) findViewById(R.id.left_strip);
        mRightStrip = (KeyguardGlowStripView) findViewById(R.id.right_strip);
        mPager = (KeyguardWidgetPager) findViewById(R.id.app_widget_container);
        mPager.setPageSwitchListener(this);

        setSoundEffectsEnabled(false);
        setOnClickListener(new OnClickListener() {
@@ -57,7 +59,16 @@ public class KeyguardWidgetRegion extends LinearLayout {
    }

    public void showPagingFeedback() {
        if (mPage < mPager.getPageCount() - 1) {
            mLeftStrip.makeEmGo();
        }
        if (mPage > 0) {
            mRightStrip.makeEmGo();
        }
    }

    @Override
    public void onPageSwitch(View newPage, int newPageIndex) {
        mPage = newPageIndex;
    }
}