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

Commit a085f59b authored by John Hoford's avatar John Hoford Committed by Android (Google) Code Review
Browse files

Merge "removed spinner stuck on screen behind image" into gb-ub-photos-carlsbad

parents e30a1cc2 f7f24e80
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
    private boolean mIsBound = false;
    private Menu mMenu;
    private DialogInterface mCurrentDialog = null;
    private boolean mLoadingVisible = true;

    public ProcessingService getProcessingService() {
        return mBoundService;
@@ -546,10 +547,9 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
    }

    private void startLoadBitmap(Uri uri) {
        final View loading = findViewById(R.id.loading);
        final View imageShow = findViewById(R.id.imageShow);
        imageShow.setVisibility(View.INVISIBLE);
        loading.setVisibility(View.VISIBLE);
        startLoadingIndicator();
        mShowingTinyPlanet = false;
        mLoadBitmapTask = new LoadBitmapTask();
        mLoadBitmapTask.execute(uri);
@@ -755,9 +755,20 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
        }
    }

    public boolean isLoadingVisible() {
        return mLoadingVisible;
    }

    public void startLoadingIndicator() {
        final View loading = findViewById(R.id.loading);
        mLoadingVisible = true;
        loading.setVisibility(View.VISIBLE);
    }

    public void stopLoadingIndicator() {
        final View loading = findViewById(R.id.loading);
        loading.setVisibility(View.GONE);
        mLoadingVisible = false;
    }

    private class LoadBitmapTask extends AsyncTask<Uri, Boolean, Boolean> {
@@ -1224,7 +1235,11 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
    public void onConfigurationChanged(Configuration newConfig)
    {
        super.onConfigurationChanged(newConfig);

        setDefaultValues();
        if (mMasterImage == null) {
            return;
        }
        loadXML();
        fillCategories();
        loadMainPanel();
@@ -1249,7 +1264,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
        mMasterImage.setHistoryManager(historyManager);
        mMasterImage.setStateAdapter(imageStateAdapter);
        mMasterImage.setActivity(this);
        mMasterImage.setFirstLoad(true);

        if (Runtime.getRuntime().maxMemory() > LIMIT_SUPPORTS_HIGHRES) {
            mMasterImage.setSupportsHighRes(true);
+1 −2
Original line number Diff line number Diff line
@@ -243,11 +243,10 @@ public class ImageShow extends View implements OnGestureListener,

        MasterImage img = MasterImage.getImage();
        // Hide the loading indicator as needed
        if (img.isFirstLoad() && getFilteredImage() != null) {
        if (mActivity.isLoadingVisible() && getFilteredImage() != null) {
            if ((img.getLoadedPreset() == null)
                    || (img.getLoadedPreset() != null
                    && img.getLoadedPreset().equals(img.getCurrentPreset()))) {
                img.setFirstLoad(false);
                mActivity.stopLoadingIndicator();
            } else if (img.getLoadedPreset() != null) {
                return;
+1 −13
Original line number Diff line number Diff line
@@ -117,8 +117,6 @@ public class MasterImage implements RenderingRequestCaller {
    private List<ExifTag> mEXIF;
    private BitmapCache mBitmapCache = new BitmapCache();

    private boolean mFirstLoad;

    private MasterImage() {
    }

@@ -134,14 +132,6 @@ public class MasterImage implements RenderingRequestCaller {
        return sMasterImage;
    }

    public void setFirstLoad(boolean firstLoad) {
        mFirstLoad = firstLoad;
    }

    public boolean isFirstLoad() {
        return mFirstLoad;
    }

    public Bitmap getOriginalBitmapSmall() {
        return mOriginalBitmapSmall;
    }
@@ -559,9 +549,7 @@ public class MasterImage implements RenderingRequestCaller {
        if (mPreset == null) {
            return;
        }
        if (mPreset.nbFilters() == 0) {
            MasterImage.getImage().setFirstLoad(false);
        }

        mPreviewPreset.enqueuePreset(mPreset);
        mPreviewBuffer.invalidate();
        invalidatePartialPreview();