Projects >> android_packages_apps_Trebuchet >>d8d3f65a0bbc2846691eda40f62db1402f08d796

Chunk
Conflicting content
    // Dimens
    private int mContentWidth;
    private int mAppIconSize;
<<<<<<< HEAD
    private int mMaxWidgetSpan, mMinWidgetSpan;
=======
    private int mMaxAppCellCountX, mMaxAppCellCountY;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
    private int mWidgetCountX, mWidgetCountY;
    private int mWidgetWidthGap, mWidgetHeightGap;
    private final int mWidgetPreviewIconPaddedDimension;
Solution content
    private int mWidgetCountX, mWidgetCountY;
    // Dimens
    private int mContentWidth;
    private int mAppIconSize;
    private int mMaxWidgetSpan, mMinWidgetSpan;
    private int mMaxAppCellCountX, mMaxAppCellCountY;
    private int mWidgetWidthGap, mWidgetHeightGap;
    private final int mWidgetPreviewIconPaddedDimension;
File
AppsCustomizePagedView.java
Developer's decision
Concatenation
Kind of conflict
Attribute
Chunk
Conflicting content
        int page = getPageForComponent(mSaveInstanceStateItemIndex);
        invalidatePageData(Math.max(0, page), hostIsTransitioning);

<<<<<<< HEAD
        int[] offset = new int[2];
        int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
        mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
        pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 + offset[0];
        pos[1] += (getMeasuredHeight() - mWidgetSpacingLayout.getMeasuredHeight()) / 2 + offset[1];
        mLauncher.showFirstRunAllAppsCling(pos);
=======
        // Show All Apps cling if we are finished transitioning, otherwise, we will try again when
        // the transition completes in AppsCustomizeTabHost (otherwise the wrong offsets will be
        // returned while animating)
        if (!hostIsTransitioning) {
            post(new Runnable() {
                @Override
                public void run() {
                    showAllAppsCling();
                }
            });
        }
    }
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6

    void showAllAppsCling() {
        if (!mHasShownAllAppsCling && isDataReady() && testDataReady()) {
Solution content
        int page = getPageForComponent(mSaveInstanceStateItemIndex);
        invalidatePageData(Math.max(0, page), hostIsTransitioning);


        int[] offset = new int[2];
        int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
        mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
        pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 + offset[0];
        pos[1] += (getMeasuredHeight() - mWidgetSpacingLayout.getMeasuredHeight()) / 2 + offset[1];
        mLauncher.showFirstRunAllAppsCling(pos);

        // Show All Apps cling if we are finished transitioning, otherwise, we will try again when
        // the transition completes in AppsCustomizeTabHost (otherwise the wrong offsets will be
        // returned while animating)
        if (!hostIsTransitioning) {
            post(new Runnable() {
                @Override
                public void run() {
                    showAllAppsCling();
                }
            });
        }
    }

    void showAllAppsCling() {
        if (!mHasShownAllAppsCling && isDataReady() && testDataReady()) {
File
AppsCustomizePagedView.java
Developer's decision
Concatenation
Kind of conflict
Array access
Attribute
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
    protected void snapToPage(int whichPage, int delta, int duration) {
        super.snapToPage(whichPage, delta, duration);
<<<<<<< HEAD
        if (mJoinWidgetsApps) {
            updateCurrentTab(whichPage);
=======
        updateCurrentTab(whichPage);

        // Update the thread priorities given the direction lookahead
        Iterator iter = mRunningTasks.iterator();
        while (iter.hasNext()) {
            AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
            int pageIndex = task.page + mNumAppsPages;
            if ((mNextPage > mCurrentPage && pageIndex >= mCurrentPage) ||
                (mNextPage < mCurrentPage && pageIndex <= mCurrentPage)) {
                task.setThreadPriority(getThreadPriorityForPage(pageIndex));
            } else {
                task.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
            }
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
        }
    }
Solution content
    protected void snapToPage(int whichPage, int delta, int duration) {
        super.snapToPage(whichPage, delta, duration);

        if (mJoinWidgetsApps) {
            updateCurrentTab(whichPage);
        }

        // Update the thread priorities given the direction lookahead
        Iterator iter = mRunningTasks.iterator();
        while (iter.hasNext()) {
            AppsCustomizeAsyncTask task = (AppsCustomizeAsyncTask) iter.next();
            int pageIndex = task.page + mNumAppsPages;
            if ((mNextPage > mCurrentPage && pageIndex >= mCurrentPage) ||
                (mNextPage < mCurrentPage && pageIndex <= mCurrentPage)) {
                task.setThreadPriority(getThreadPriorityForPage(pageIndex));
            } else {
                task.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
            }
        }
    }
File
AppsCustomizePagedView.java
Developer's decision
Manual
Kind of conflict
Attribute
Cast expression
Comment
If statement
Method invocation
Variable
While statement
Chunk
Conflicting content
     * page much higher priority)
     */
    private int getThreadPriorityForPage(int page) {
<<<<<<< HEAD
        int pageDiff = Math.abs(page - mCurrentPage);
        if (pageDiff <= 0) {
            return Process.THREAD_PRIORITY_FOREGROUND;
        } else if (pageDiff <= 1) {
            return Process.THREAD_PRIORITY_MORE_FAVORABLE;
        } else {
            return Process.THREAD_PRIORITY_DEFAULT;
=======
        // TODO-APPS_CUSTOMIZE: detect number of cores and set thread priorities accordingly below
        int pageDiff = getWidgetPageLoadPriority(page);
        if (pageDiff <= 0) {
            return Process.THREAD_PRIORITY_LESS_FAVORABLE;
        } else if (pageDiff <= 1) {
            return Process.THREAD_PRIORITY_LOWEST;
        } else {
            return Process.THREAD_PRIORITY_LOWEST;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
        }
    }
    private int getSleepForPage(int page) {
Solution content
     * page much higher priority)
     */
    private int getThreadPriorityForPage(int page) {
        int pageDiff = Math.abs(page - mCurrentPage);
        if (pageDiff <= 0) {
            return Process.THREAD_PRIORITY_FOREGROUND;
        } else if (pageDiff <= 1) {
            return Process.THREAD_PRIORITY_MORE_FAVORABLE;
        } else {
            return Process.THREAD_PRIORITY_DEFAULT;
        }
    }
    private int getSleepForPage(int page) {
File
AppsCustomizePagedView.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Return statement
Variable
Chunk
Conflicting content
        }
        return preview;
    }
<<<<<<< HEAD
    public void syncWidgetPages() {
        // Ensure that we have the right number of pages
        Context context = getContext();
        int numPages = (int) Math.ceil(mWidgets.size() /
                (float) (mWidgetCountX * mWidgetCountY));
        for (int j = 0; j < numPages; ++j) {
            PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
                    mWidgetCountY);
            setupPage(layout);
            addView(layout, new PagedViewGridLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                    LayoutParams.MATCH_PARENT));
        }
    }
    public void syncWidgetPageItems(int page, boolean immediate) {
=======

    public void syncWidgetPageItems(final int page, final boolean immediate) {
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
        int numItemsPerPage = mWidgetCountX * mWidgetCountY;

        // Calculate the dimensions of each cell we are giving to each widget
Solution content
        }
        return preview;
    }

    public void syncWidgetPages() {
        // Ensure that we have the right number of pages
        Context context = getContext();
        int numPages = (int) Math.ceil(mWidgets.size() /
                (float) (mWidgetCountX * mWidgetCountY));
        for (int j = 0; j < numPages; ++j) {
            PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
                    mWidgetCountY);
            setupPage(layout);
            addView(layout, new PagedViewGridLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                    LayoutParams.MATCH_PARENT));
        }
    }

    public void syncWidgetPageItems(final int page, final boolean immediate) {
        int numItemsPerPage = mWidgetCountX * mWidgetCountY;

        // Calculate the dimensions of each cell we are giving to each widget
File
AppsCustomizePagedView.java
Developer's decision
Combination
Kind of conflict
Method declaration
Method signature
Chunk
Conflicting content
                    v.setTranslationX(translationX);
            if (v != null) {
                float scrollProgress = getScrollProgress(screenScroll, v, i);

<<<<<<< HEAD
                int pageWidth = v.getMeasuredWidth();
                int pageHeight = v.getMeasuredHeight();

                boolean overScrollLeft = i == 0 && scrollProgress < 0;
                boolean overScrollRight = i == getChildCount() - 1 && scrollProgress > 0;
                if (overScrollLeft || overScrollRight) {
                    // Overscroll rotation
                    v.setPivotX((overScrollLeft ? TRANSITION_PIVOT : 1 - TRANSITION_PIVOT) * pageWidth);
                    v.setRotationY(-TRANSITION_MAX_ROTATION * scrollProgress);

                    // On the first/last page, we don't want the page to have any lateral motion
                    v.setTranslationX(scrollProgress * pageWidth);
                } else {
                    // Not in overscroll mode, reset and do normal transition
                    v.setPivotY(pageHeight / 2.0f);
                    v.setPivotX(pageWidth / 2.0f);
                    v.setRotationY(0f);


                    float interpolatedProgress =
                            mZInterpolator.getInterpolation(Math.abs(Math.min(scrollProgress, 0)));
                    float scale = (1 - interpolatedProgress) +
                            interpolatedProgress * TRANSITION_SCALE_FACTOR;
                    float translationX = Math.min(0, scrollProgress) * v.getMeasuredWidth();

                    float alpha = scrollProgress < 0 ? mAlphaInterpolator.getInterpolation(
                            1 - Math.abs(scrollProgress)) : 1.0f;

                    v.setAlpha(alpha);
                    v.setScaleX(scale);
                    v.setScaleY(scale);
=======
                float interpolatedProgress =
                        mZInterpolator.getInterpolation(Math.abs(Math.min(scrollProgress, 0)));
                float scale = (1 - interpolatedProgress) +
                        interpolatedProgress * TRANSITION_SCALE_FACTOR;
                float translationX = Math.min(0, scrollProgress) * v.getMeasuredWidth();

                float alpha;

                if (!LauncherApplication.isScreenLarge() || scrollProgress < 0) {
                    alpha = scrollProgress < 0 ? mAlphaInterpolator.getInterpolation(
                        1 - Math.abs(scrollProgress)) : 1.0f;
                } else {
                    // On large screens we need to fade the page as it nears its leftmost position
                    alpha = mLeftScreenAlphaInterpolator.getInterpolation(1 - scrollProgress);
                }

                v.setCameraDistance(mDensity * CAMERA_DISTANCE);
                int pageWidth = v.getMeasuredWidth();
                int pageHeight = v.getMeasuredHeight();

                if (PERFORM_OVERSCROLL_ROTATION) {
                    if (i == 0 && scrollProgress < 0) {
                        // Overscroll to the left
                        v.setPivotX(TRANSITION_PIVOT * pageWidth);
                        v.setRotationY(-TRANSITION_MAX_ROTATION * scrollProgress);
                        scale = 1.0f;
                        alpha = 1.0f;
                        // On the first page, we don't want the page to have any lateral motion
                        translationX = 0;
                    } else if (i == getChildCount() - 1 && scrollProgress > 0) {
                        // Overscroll to the right
                        v.setPivotX((1 - TRANSITION_PIVOT) * pageWidth);
                        v.setRotationY(-TRANSITION_MAX_ROTATION * scrollProgress);
                        scale = 1.0f;
                        alpha = 1.0f;
                        // On the last page, we don't want the page to have any lateral motion.
                        translationX = 0;
                    } else {
                        v.setPivotY(pageHeight / 2.0f);
                        v.setPivotX(pageWidth / 2.0f);
                        v.setRotationY(0f);
                    }
                }

                v.setTranslationX(translationX);
                v.setScaleX(scale);
                v.setScaleY(scale);
                v.setAlpha(alpha);

                // If the view has 0 alpha, we set it to be invisible so as to prevent
                // it from accepting touches
                if (alpha < ViewConfiguration.ALPHA_THRESHOLD) {
                    v.setVisibility(INVISIBLE);
                } else if (v.getVisibility() != VISIBLE) {
                    v.setVisibility(VISIBLE);
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
                }
            }
        }
Solution content
            if (v != null) {
                float scrollProgress = getScrollProgress(screenScroll, v, i);

                int pageWidth = v.getMeasuredWidth();
                int pageHeight = v.getMeasuredHeight();

                boolean overScrollLeft = i == 0 && scrollProgress < 0;
                boolean overScrollRight = i == getChildCount() - 1 && scrollProgress > 0;
                if (overScrollLeft || overScrollRight) {
                    // Overscroll rotation
                    v.setPivotX((overScrollLeft ? TRANSITION_PIVOT : 1 - TRANSITION_PIVOT) * pageWidth);
                    v.setRotationY(-TRANSITION_MAX_ROTATION * scrollProgress);

                    // On the first/last page, we don't want the page to have any lateral motion
                    v.setTranslationX(scrollProgress * pageWidth);
                } else {
                    // Not in overscroll mode, reset and do normal transition
                    v.setPivotY(pageHeight / 2.0f);
                    v.setPivotX(pageWidth / 2.0f);
                    v.setRotationY(0f);

                    float interpolatedProgress =
                            mZInterpolator.getInterpolation(Math.abs(Math.min(scrollProgress, 0)));
                    float scale = (1 - interpolatedProgress) +
                            interpolatedProgress * TRANSITION_SCALE_FACTOR;
                    float translationX = Math.min(0, scrollProgress) * v.getMeasuredWidth();

                    float alpha;

                    if (!LauncherApplication.isScreenLarge() || scrollProgress < 0) {
                        alpha = scrollProgress < 0 ? mAlphaInterpolator.getInterpolation(
                                1 - Math.abs(scrollProgress)) : 1.0f;
                    } else {
                        // On large screens we need to fade the page as it nears its leftmost position
                        alpha = mLeftScreenAlphaInterpolator.getInterpolation(1 - scrollProgress);
                    }


                    v.setTranslationX(translationX);
                    v.setAlpha(alpha);
                    v.setScaleX(scale);
                    v.setScaleY(scale);

                    // If the view has 0 alpha, we set it to be invisible so as to prevent
                    // it from accepting touches
                    if (alpha < ViewConfiguration.ALPHA_THRESHOLD) {
                        v.setVisibility(INVISIBLE);
                    } else if (v.getVisibility() != VISIBLE) {
                        v.setVisibility(VISIBLE);
                    }
                }
            }
        }
File
AppsCustomizePagedView.java
Developer's decision
Combination
Kind of conflict
Attribute
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
        if (!mAppsCustomizePane.isContentType(type) || mJoinWidgetsApps) {

<<<<<<< HEAD
            // Animate the changing of the tab content by fading pages in and out
            final Resources res = getResources();
            final int duration = res.getInteger(R.integer.config_tabTransitionDuration);

            // We post a runnable here because there is a delay while the first page is loading and
            // the feedback from having changed the tab almost feels better than having it stick
            post(new Runnable() {
                @Override
                public void run() {
                    if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
                            mAppsCustomizePane.getMeasuredHeight() <= 0) {
=======
                // Take the visible pages and re-parent them temporarily to mAnimatorBuffer
                // and then cross fade to the new pages
                int[] visiblePageRange = new int[2];
                mAppsCustomizePane.getVisiblePages(visiblePageRange);
                if (visiblePageRange[0] == -1 && visiblePageRange[1] == -1) {
                    // If we can't get the visible page ranges, then just skip the animation
                    reloadCurrentPage();
                    return;
                }
                ArrayList visiblePages = new ArrayList();
                for (int i = visiblePageRange[0]; i <= visiblePageRange[1]; i++) {
                    visiblePages.add(mAppsCustomizePane.getPageAt(i));
                }

                // We want the pages to be rendered in exactly the same way as they were when
                // their parent was mAppsCustomizePane -- so set the scroll on mAnimationBuffer
                // to be exactly the same as mAppsCustomizePane, and below, set the left/top
                // parameters to be correct for each of the pages
                mAnimationBuffer.scrollTo(mAppsCustomizePane.getScrollX(), 0);

                // mAppsCustomizePane renders its children in reverse order, so
                // add the pages to mAnimationBuffer in reverse order to match that behavior
                for (int i = visiblePages.size() - 1; i >= 0; i--) {
                    View child = visiblePages.get(i);
                    if (child instanceof PagedViewCellLayout) {
                        ((PagedViewCellLayout) child).resetChildrenOnKeyListeners();
                    } else if (child instanceof PagedViewGridLayout) {
                        ((PagedViewGridLayout) child).resetChildrenOnKeyListeners();
                    }
                    PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(false);
                    mAppsCustomizePane.removeView(child);
                    PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(true);
                    mAnimationBuffer.setAlpha(1f);
                    mAnimationBuffer.setVisibility(View.VISIBLE);
                    LayoutParams p = new FrameLayout.LayoutParams(child.getWidth(),
                            child.getHeight());
                    p.setMargins((int) child.getLeft(), (int) child.getTop(), 0, 0);
                    mAnimationBuffer.addView(child, p);
                }

                // Toggle the new content
                onTabChangedStart();
                onTabChangedEnd(type);

                // Animate the transition
                ObjectAnimator outAnim = ObjectAnimator.ofFloat(mAnimationBuffer, "alpha", 0f);
                outAnim.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        mAnimationBuffer.setVisibility(View.GONE);
                        mAnimationBuffer.removeAllViews();
                    }
                    @Override
                    public void onAnimationCancel(Animator animation) {
                        mAnimationBuffer.setVisibility(View.GONE);
                        mAnimationBuffer.removeAllViews();
                    }
                });
                ObjectAnimator inAnim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 1f);
                inAnim.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
                        reloadCurrentPage();
                        return;
                    }
Solution content
        if (!mAppsCustomizePane.isContentType(type) || mJoinWidgetsApps) {
            // Animate the changing of the tab content by fading pages in and out
            final Resources res = getResources();
            final int duration = res.getInteger(R.integer.config_tabTransitionDuration);

            // We post a runnable here because there is a delay while the first page is loading and
            // the feedback from having changed the tab almost feels better than having it stick
            post(new Runnable() {
                @Override
                public void run() {
                    if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
                            mAppsCustomizePane.getMeasuredHeight() <= 0) {
                        reloadCurrentPage();
                        return;
                    }

                    // Take the visible pages and re-parent them temporarily to mAnimatorBuffer
                    // and then cross fade to the new pages
                    int[] visiblePageRange = new int[2];
                    mAppsCustomizePane.getVisiblePages(visiblePageRange);
                    if (visiblePageRange[0] == -1 && visiblePageRange[1] == -1) {
                        // If we can't get the visible page ranges, then just skip the animation
                        reloadCurrentPage();
                        return;
                    }
File
AppsCustomizeTabHost.java
Developer's decision
Combination
Kind of conflict
Comment
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
import android.app.Dialog;
import android.app.SearchManager;
import android.app.StatusBarManager;
<<<<<<< HEAD
import android.app.UiModeManager;
=======
import android.appwidget.AppWidgetHostView;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ActivityNotFoundException;
Solution content
import android.app.Dialog;
import android.app.SearchManager;
import android.app.StatusBarManager;
import android.app.UiModeManager;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ActivityNotFoundException;
File
Launcher.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
    protected float mLastMotionXRemainder;
    protected float mLastMotionY;
    protected float mTotalMotionX;
<<<<<<< HEAD
    private int mLastScreenScroll = -1;
=======
    private int mLastScreenCenter = -1;
    private int[] mChildOffsets;
    private int[] mChildRelativeOffsets;
    private int[] mChildOffsetsWithLayoutScale;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6

    protected final static int TOUCH_STATE_REST = 0;
    protected final static int TOUCH_STATE_SCROLLING = 1;
Solution content
    protected float mLastMotionXRemainder;
    protected float mLastMotionY;
    protected float mTotalMotionX;
    private int mLastScreenScroll = -1;
    private int[] mChildOffsets;
    private int[] mChildRelativeOffsets;
    private int[] mChildOffsetsWithLayoutScale;

    protected final static int TOUCH_STATE_REST = 0;
    protected final static int TOUCH_STATE_SCROLLING = 1;
File
PagedView.java
Developer's decision
Combination
Kind of conflict
Attribute
Chunk
Conflicting content
        }
    }

<<<<<<< HEAD
    protected void screenScrolled(int screenScroll) {
        updateScrollingIndicator();
=======
    protected int getRelativeChildOffset(int index) {
        if (mChildRelativeOffsets != null && mChildRelativeOffsets[index] != -1) {
            return mChildRelativeOffsets[index];
        } else {
            final int padding = mPaddingLeft + mPaddingRight;
            final int offset = mPaddingLeft +
                    (getMeasuredWidth() - padding - getChildWidth(index)) / 2;
            if (mChildRelativeOffsets != null) {
                mChildRelativeOffsets[index] = offset;
            }
            return offset;
        }
    }

    protected int getScaledRelativeChildOffset(int index) {
        final int padding = mPaddingLeft + mPaddingRight;
        final int offset = mPaddingLeft + (getMeasuredWidth() - padding -
                getScaledMeasuredWidth(getPageAt(index))) / 2;
        return offset;
    }

    protected int getScaledMeasuredWidth(View child) {
        // This functions are called enough times that it actually makes a difference in the
        // profiler -- so just inline the max() here
        final int measuredWidth = child.getMeasuredWidth();
        final int minWidth = mMinimumWidth;
        final int maxWidth = (minWidth > measuredWidth) ? minWidth : measuredWidth;
        return (int) (maxWidth * mLayoutScale + 0.5f);
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
    }

    protected void getVisiblePages(int[] range) {
Solution content
        }
    }

    protected int getRelativeChildOffset(int index) {
        if (mChildRelativeOffsets != null && mChildRelativeOffsets[index] != -1) {
            return mChildRelativeOffsets[index];
        } else {
            final int padding = mPaddingLeft + mPaddingRight;
            final int offset = mPaddingLeft +
                    (getMeasuredWidth() - padding - getChildWidth(index)) / 2;
            if (mChildRelativeOffsets != null) {
                mChildRelativeOffsets[index] = offset;
            }
            return offset;
        }
    }
    protected int getScaledRelativeChildOffset(int index) {
        final int padding = mPaddingLeft + mPaddingRight;
        final int offset = mPaddingLeft + (getMeasuredWidth() - padding -
                getScaledMeasuredWidth(getPageAt(index))) / 2;
        return offset;
    }

    protected int getScaledMeasuredWidth(View child) {
        // This functions are called enough times that it actually makes a difference in the
        // profiler -- so just inline the max() here
        final int measuredWidth = child.getMeasuredWidth();
        final int minWidth = mMinimumWidth;
        final int maxWidth = (minWidth > measuredWidth) ? minWidth : measuredWidth;
        return (int) (maxWidth * mLayoutScale + 0.5f);
    }

    protected void getVisiblePages(int[] range) {
File
PagedView.java
Developer's decision
Version 2
Kind of conflict
Attribute
Cast expression
Comment
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
    @Override
    protected void dispatchDraw(Canvas canvas) {
<<<<<<< HEAD
        if (mScrollX != mLastScreenScroll) {
            screenScrolled(mScrollX);
            updateAdjacentPagesAlpha();
            mLastScreenScroll = mScrollX;
=======
        int halfScreenSize = getMeasuredWidth() / 2;
        // mOverScrollX is equal to mScrollX when we're within the normal scroll range. Otherwise
        // it is equal to the scaled overscroll position.
        int screenCenter = mOverScrollX + halfScreenSize;

        if (screenCenter != mLastScreenCenter || mForceScreenScrolled) {
            screenScrolled(screenCenter);
            mLastScreenCenter = screenCenter;
            mForceScreenScrolled = false;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
        }

        // Find out which screens are visible; as an optimization we only call draw on them
Solution content
    @Override
    protected void dispatchDraw(Canvas canvas) {
        if (mOverScrollX != mLastScreenScroll || mForceScreenScrolled) {
            screenScrolled(mOverScrollX);
            mLastScreenScroll = mOverScrollX;
            mForceScreenScrolled = false;
        }

        // Find out which screens are visible; as an optimization we only call draw on them
File
PagedView.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
                mQSBSearchBarFadeOutAnim.start();
            }
        } else {
<<<<<<< HEAD
            if (mShowQSBSearchBar) {
                mQSBSearchBar.setVisibility(View.GONE);
                mQSBSearchBar.setAlpha(0f);
            }
=======
            mQSBSearchBar.setVisibility(View.INVISIBLE);
            mQSBSearchBar.setAlpha(0f);
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
        }
        mIsSearchBarHidden = true;
    }
Solution content
                mQSBSearchBarFadeOutAnim.start();
            }
        } else {
            if (mShowQSBSearchBar) {
                mQSBSearchBar.setVisibility(View.INVISIBLE);
                mQSBSearchBar.setAlpha(0f);
            }
        }
        mIsSearchBarHidden = true;
    }
File
SearchDropTargetBar.java
Developer's decision
Combination
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
        return Math.min(r / threshold, 1.0f);
    }

<<<<<<< HEAD
    private void screenScrolledLargeUI(int screenScroll) {
        int currentScreen = (int) Math.floor((double) (screenScroll / (float) getMeasuredWidth()));
        for (int i = currentScreen; i <= Math.min(getChildCount(), currentScreen + 1); i++) {
=======
    private void screenScrolledLargeUI(int screenCenter) {
        if (isSwitchingState()) return;
        boolean isInOverscroll = false;
        for (int i = 0; i < getChildCount(); i++) {
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
            CellLayout cl = (CellLayout) getChildAt(i);
            if (cl != null) {
                float scrollProgress = getScrollProgress(screenScroll, cl, i);
Solution content
        return Math.min(r / threshold, 1.0f);
    }

    private void screenScrolledLargeUI(int screenScroll) {
        if (isSwitchingState()) return;
        boolean isInOverscroll = false;
        int currentScreen = (int) Math.floor((double) (screenScroll / (float) getMeasuredWidth()));
        for (int i = currentScreen; i <= Math.min(getChildCount(), currentScreen + 1); i++) {
            CellLayout cl = (CellLayout) getChildAt(i);
            if (cl != null) {
                float scrollProgress = getScrollProgress(screenScroll, cl, i);
File
Workspace.java
Developer's decision
Combination
Kind of conflict
Cast expression
For statement
If statement
Method signature
Variable
Chunk
Conflicting content
        invalidate();
    }

<<<<<<< HEAD
    private void screenScrolledStandardUI(int screenScroll) {
        if (mScrollX < 0 || mScrollX > mMaxScrollX) {
            int index = mScrollX < 0 ? 0 : getChildCount() - 1;
=======
    private void screenScrolledStandardUI(int screenCenter) {
        if (mOverScrollX < 0 || mOverScrollX > mMaxScrollX) {
            int index = mOverScrollX < 0 ? 0 : getChildCount() - 1;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
            CellLayout cl = (CellLayout) getChildAt(index);
            float scrollProgress = getScrollProgress(screenScroll, cl, index);
            cl.setOverScrollAmount(Math.abs(scrollProgress), index == 0);
Solution content
        invalidate();
    }

    private void screenScrolledStandardUI(int screenScroll) {
        if (mOverScrollX < 0 || mOverScrollX > mMaxScrollX) {
            int index = mOverScrollX < 0 ? 0 : getChildCount() - 1;
            CellLayout cl = (CellLayout) getChildAt(index);
            float scrollProgress = getScrollProgress(screenScroll, cl, index);
            cl.setOverScrollAmount(Math.abs(scrollProgress), index == 0);
File
Workspace.java
Developer's decision
Combination
Kind of conflict
If statement
Method invocation
Method signature
Variable
Chunk
Conflicting content
    }

    @Override
<<<<<<< HEAD
    protected void screenScrolled(int screenScroll) {
        super.screenScrolled(screenScroll);
        if (LauncherApplication.isScreenLarge()) {
            screenScrolledLargeUI(screenScroll);
        } else {
            screenScrolledStandardUI(screenScroll);
=======
    protected void screenScrolled(int screenCenter) {
        if (LauncherApplication.isScreenLarge()) {
            // We don't call super.screenScrolled() here because we handle the adjacent pages alpha
            // ourselves (for efficiency), and there are no scrolling indicators to update.
            screenScrolledLargeUI(screenCenter);
        } else {
            super.screenScrolled(screenCenter);
            screenScrolledStandardUI(screenCenter);
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
        }
    }
Solution content
    }

    @Override
    protected void screenScrolled(int screenScroll) {
        if (LauncherApplication.isScreenLarge()) {
            // We don't call super.screenScrolled() here because we handle the adjacent pages alpha
            // ourselves (for efficiency), and there are no scrolling indicators to update.
            screenScrolledLargeUI(screenScroll);
        } else {
            super.screenScrolled(screenScroll);
            screenScrolledStandardUI(screenScroll);
        }
    }
File
Workspace.java
Developer's decision
Combination
Kind of conflict
Comment
If statement
Method invocation
Method signature
Chunk
Conflicting content
                }
=======
            finalScaleFactor = mSpringLoadedShrinkFactor - (stateIsSmall ? 0.1f : 0);
            if (oldStateIsNormal && stateIsSmall) {
                zoomIn = false;
<<<<<<< HEAD
                if (animated) {
                    hideScrollingIndicator(false, sScrollIndicatorFadeOutShortDuration);
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
                setLayoutScale(finalScaleFactor);
                updateChildrenLayersEnabled();
            } else {
Solution content
            finalScaleFactor = mSpringLoadedShrinkFactor - (stateIsSmall ? 0.1f : 0);
            if (oldStateIsNormal && stateIsSmall) {
                zoomIn = false;
                if (animated) {
                    hideScrollingIndicator(false, sScrollIndicatorFadeOutShortDuration);
                }
                setLayoutScale(finalScaleFactor);
                updateChildrenLayersEnabled();
            } else {
File
Workspace.java
Developer's decision
Version 1
Kind of conflict
If statement
Chunk
Conflicting content
        float reducedFade = 0.5f + 0.5f * (1 - fade);
        mLauncher.getDragLayer().getLocationInDragLayer(this, loc);
    }

<<<<<<< HEAD
    void showDockDivider(boolean immediately) {
        final ViewGroup parent = (ViewGroup) getParent();
        final View qsbDivider = (ImageView) (parent.findViewById(R.id.qsb_divider));
        final View dockDivider = (ImageView) (parent.findViewById(R.id.dock_divider));
        if (qsbDivider != null && dockDivider != null) {
            if (mShowSearchBar) {
                qsbDivider.setVisibility(View.VISIBLE);
            }
            dockDivider.setVisibility(View.VISIBLE);
            if (mDividerAnimator != null) {
                mDividerAnimator.cancel();
                mDividerAnimator = null;
            }
            if (immediately) {
                if (mShowSearchBar) {
                    qsbDivider.setAlpha(1f);
                }
                dockDivider.setAlpha(1f);
            } else {
                mDividerAnimator = new AnimatorSet();
                if (mShowSearchBar) {
                    mDividerAnimator.playTogether(ObjectAnimator.ofFloat(qsbDivider, "alpha", 1f),
                            ObjectAnimator.ofFloat(dockDivider, "alpha", 1f));
                } else {
                    mDividerAnimator.play(ObjectAnimator.ofFloat(dockDivider, "alpha", 1f));
                }
                mDividerAnimator.setDuration(sScrollIndicatorFadeInDuration);
                mDividerAnimator.start();
            }
        }
    }
=======
    void setFadeForOverScroll(float fade) {
        if (!isScrollingIndicatorEnabled()) return;
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6

        mOverscrollFade = fade;
Solution content
        mLauncher.getDragLayer().getLocationInDragLayer(this, loc);
    }

    void setFadeForOverScroll(float fade) {
        if (!isScrollingIndicatorEnabled()) return;

        mOverscrollFade = fade;
        float reducedFade = 0.5f + 0.5f * (1 - fade);
File
Workspace.java
Developer's decision
Version 2
Kind of conflict
If statement
Method declaration
Method signature
Chunk
Conflicting content
        mOverscrollFade = fade;
        float reducedFade = 0.5f + 0.5f * (1 - fade);
        final ViewGroup parent = (ViewGroup) getParent();
<<<<<<< HEAD
        final View qsbDivider = (ImageView) (parent.findViewById(R.id.qsb_divider));
        final View dockDivider = (ImageView) (parent.findViewById(R.id.dock_divider));
        if (qsbDivider != null && dockDivider != null) {
            if (mDividerAnimator != null) {
                mDividerAnimator.cancel();
                mDividerAnimator = null;
            }
            if (immediately) {
                if (mShowSearchBar) {
                    qsbDivider.setVisibility(View.GONE);
                    qsbDivider.setAlpha(0f);
                }
                dockDivider.setVisibility(View.GONE);
                dockDivider.setAlpha(0f);
            } else {
                mDividerAnimator = new AnimatorSet();
                if (mShowSearchBar) {
                    mDividerAnimator.playTogether(ObjectAnimator.ofFloat(qsbDivider, "alpha", 0f),
                            ObjectAnimator.ofFloat(dockDivider, "alpha", 0f));
                } else {
                    mDividerAnimator.play(ObjectAnimator.ofFloat(dockDivider, "alpha", 0f));
                }
                mDividerAnimator.addListener(new AnimatorListenerAdapter() {
                    private boolean cancelled = false;
                    @Override
                    public void onAnimationCancel(android.animation.Animator animation) {
                        cancelled = true;
                    }
                    @Override
                    public void onAnimationEnd(android.animation.Animator animation) {
                        if (!cancelled) {
                            if (mShowSearchBar) {
                                qsbDivider.setVisibility(View.GONE);
                            }
                            dockDivider.setVisibility(View.GONE);
                        }
                    }
                });
                mDividerAnimator.setDuration(sScrollIndicatorFadeOutDuration);
                mDividerAnimator.start();
            }
        }
=======
        final ImageView qsbDivider = (ImageView) (parent.findViewById(R.id.qsb_divider));
        final ImageView dockDivider = (ImageView) (parent.findViewById(R.id.dock_divider));
        final ImageView scrollIndicator = getScrollingIndicator();

        cancelScrollingIndicatorAnimations();
        if (qsbDivider != null) qsbDivider.setAlpha(reducedFade);
        if (dockDivider != null) dockDivider.setAlpha(reducedFade);
        scrollIndicator.setAlpha(1 - fade);
>>>>>>> 81304325161a14e9f9908def807114b33b13dce6
    }
}
Solution content
        mOverscrollFade = fade;
        float reducedFade = 0.5f + 0.5f * (1 - fade);
        final ViewGroup parent = (ViewGroup) getParent();

        final ImageView qsbDivider = (ImageView) (parent.findViewById(R.id.qsb_divider));
        final ImageView dockDivider = (ImageView) (parent.findViewById(R.id.dock_divider));
        final ImageView scrollIndicator = getScrollingIndicator();

        cancelScrollingIndicatorAnimations();
        if (qsbDivider != null && mShowSearchBar) qsbDivider.setAlpha(reducedFade);
        if (dockDivider != null) dockDivider.setAlpha(reducedFade);
        scrollIndicator.setAlpha(1 - fade);
    }
}
File
Workspace.java
Developer's decision
Manual
Kind of conflict
Cast expression
If statement
Method invocation
Variable