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

Commit c487bd34 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Making page indicator an abstract class and implementing some common methods.

Change-Id: I06613428c54f1f086090580db8242cf81f7fb128
parent 40902b3c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -259,9 +259,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc

            OnClickListener listener = getPageIndicatorClickListener();
            if (listener != null) {
                mPageIndicator.getView().setOnClickListener(listener);
                mPageIndicator.setOnClickListener(listener);
            }
            mPageIndicator.getView().setContentDescription(getPageIndicatorDescription());
            mPageIndicator.setContentDescription(getPageIndicatorDescription());
        }
    }

@@ -467,7 +467,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
    private void updatePageIndicator() {
        // Update the page indicator (when we aren't reordering)
        if (mPageIndicator != null) {
            mPageIndicator.getView().setContentDescription(getPageIndicatorDescription());
            mPageIndicator.setContentDescription(getPageIndicatorDescription());
            if (!isReordering(false)) {
                mPageIndicator.setActiveMarker(getNextPage());
            }
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ public class PinchAnimationManager {
        animateShowHideView(INDEX_HOTSEAT, mLauncher.getHotseat(), show);
        if (mWorkspace.getPageIndicator() != null) {
            // There aren't page indicators in landscape mode on phones, hence the null check.
            animateShowHideView(INDEX_PAGE_INDICATOR, mWorkspace.getPageIndicator().getView(), show);
            animateShowHideView(INDEX_PAGE_INDICATOR, mWorkspace.getPageIndicator(), show);
        }
    }

+3 −5
Original line number Diff line number Diff line
@@ -1339,9 +1339,7 @@ public class Workspace extends PagedView
        // different effects based on device performance. On at least one relatively high-end
        // device I've tried, translating the launcher causes things to get quite laggy.
        setTranslationAndAlpha(mLauncher.getSearchDropTargetBar(), transX, alpha);
        if (getPageIndicator() != null) {
            setTranslationAndAlpha(getPageIndicator().getView(), transX, alpha);
        }
        setTranslationAndAlpha(getPageIndicator(), transX, alpha);
        setTranslationAndAlpha(getChildAt(getCurrentPage()), transX, alpha);
        setTranslationAndAlpha(mLauncher.getHotseat(), transX, alpha);

@@ -1554,7 +1552,7 @@ public class Workspace extends PagedView
        }

        if (getPageIndicator() != null) {
            getPageIndicator().getView().setTranslationX(translationX);
            getPageIndicator().setTranslationX(translationX);
        }

        if (mCustomContentCallbacks != null) {
@@ -1603,7 +1601,7 @@ public class Workspace extends PagedView
            // attach to window
            OnClickListener listener = getPageIndicatorClickListener();
            if (listener != null) {
                getPageIndicator().getView().setOnClickListener(listener);
                getPageIndicator().setOnClickListener(listener);
            }

            showPageIndicatorAtCurrentScroll();
+1 −2
Original line number Diff line number Diff line
@@ -357,8 +357,7 @@ public class WorkspaceStateTransitionAnimation {

        final ViewGroup overviewPanel = mLauncher.getOverviewPanel();
        final View hotseat = mLauncher.getHotseat();
        final View pageIndicator = mWorkspace.getPageIndicator() == null ? null
                : mWorkspace.getPageIndicator().getView();
        final View pageIndicator = mWorkspace.getPageIndicator();
        if (animated) {
            LauncherViewPropertyAnimator scale = new LauncherViewPropertyAnimator(mWorkspace);
            scale.scaleX(mNewScale)
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ public class FolderPagedView extends PagedView {
        setEnableOverscroll(getPageCount() > 1);

        // Update footer
        mPageIndicator.getView().setVisibility(getPageCount() > 1 ? View.VISIBLE : View.GONE);
        mPageIndicator.setVisibility(getPageCount() > 1 ? View.VISIBLE : View.GONE);
        // Set the gravity as LEFT or RIGHT instead of START, as START depends on the actual text.
        mFolder.mFolderName.setGravity(getPageCount() > 1 ?
                (mIsRtl ? Gravity.RIGHT : Gravity.LEFT) : Gravity.CENTER_HORIZONTAL);
Loading