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

Commit 2047df6f authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

Merge "Page content sometimes missing while scrolling." into lmp-dev

parents ead6ad8a e6ecba59
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ public final class PageContentRepository {
            Iterator<Map.Entry<Integer, RenderedPage>> iterator =
                    mRenderedPages.entrySet().iterator();
            while (iterator.hasNext()) {
                iterator.next().getValue().recycle();
                iterator.next();
                iterator.remove();
            }
        }
@@ -425,10 +425,6 @@ public final class PageContentRepository {
            return content.getBitmap().getByteCount();
        }

        public void recycle() {
            content.getBitmap().recycle();
        }

        public void erase() {
            content.getBitmap().eraseColor(Color.WHITE);
        }
@@ -738,7 +734,6 @@ public final class PageContentRepository {
                                + " with different size.");
                    }
                    mPageContentCache.removeRenderedPage(mPageIndex);
                    mRenderedPage.recycle();
                    mRenderedPage = null;
                }

@@ -762,7 +757,6 @@ public final class PageContentRepository {
                            Log.i(LOG_TAG, "Recycling bitmap for page: " + mPageIndex
                                   + " with different size.");
                        }
                        renderedPage.recycle();
                        continue;
                    }

+2 −7
Original line number Diff line number Diff line
@@ -46,16 +46,12 @@ public class PageContentView extends View

    private boolean mContentRequested;

    private boolean mNeedsLayout;

    public PageContentView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        mNeedsLayout = false;
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        requestPageContentIfNeeded();
    }

@@ -91,7 +87,6 @@ public class PageContentView extends View

        mEmptyState = emptyState;
        mContentRequested = false;
        mNeedsLayout = mNeedsLayout || mediaSizeChanged || marginsChanged;

        // If there is no provider we want immediately to switch to
        // the empty state, so pages with no content appear blank.
@@ -104,7 +99,7 @@ public class PageContentView extends View

    private void requestPageContentIfNeeded() {
        if (getWidth() > 0 && getHeight() > 0 && !mContentRequested
                && mProvider != null && !mNeedsLayout) {
                && mProvider != null) {
            mContentRequested = true;
            mProvider.getPageContent(new RenderSpec(getWidth(), getHeight(),
                    mMediaSize, mMinMargins), this);