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

Commit 6106c833 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Add loading spinner" into gb-ub-photos-arches

parents 5388677d 00914f56
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -141,11 +141,21 @@
                  android:visibility="gone" />

            </com.android.gallery3d.filtershow.CenteredLinearLayout>

            <ProgressBar
                android:id="@+id/loading"
                style="@android:style/Widget.Holo.ProgressBar.Large"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:indeterminate="true"
                android:indeterminateOnly="true" />

        </FrameLayout>

        <com.android.gallery3d.filtershow.CenteredLinearLayout
              xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d"
              android:id="@+id/mainPanel"
              android:id="@+id/filtersPanel"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
@@ -380,7 +390,6 @@

        <com.android.gallery3d.filtershow.CenteredLinearLayout
              xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d"
              android:id="@+id/mainPanel"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
+15 −0
Original line number Diff line number Diff line
@@ -393,6 +393,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
    }

    private void startLoadBitmap(Uri uri) {
        final View filters = findViewById(R.id.filtersPanel);
        final View loading = findViewById(R.id.loading);
        loading.setVisibility(View.VISIBLE);
        filters.setVisibility(View.INVISIBLE);
        View tinyPlanetView = findViewById(R.id.tinyplanetButton);
        if (tinyPlanetView != null) {
            tinyPlanetView.setVisibility(View.GONE);
@@ -413,9 +417,20 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
        @Override
        protected Boolean doInBackground(Uri... params) {
            mImageLoader.loadBitmap(params[0], mBitmapSize);
            publishProgress();
            return mImageLoader.queryLightCycle360();
        }

        @Override
        protected void onProgressUpdate(Void... values) {
            super.onProgressUpdate(values);
            if (isCancelled()) return;
            final View filters = findViewById(R.id.filtersPanel);
            final View loading = findViewById(R.id.loading);
            loading.setVisibility(View.GONE);
            filters.setVisibility(View.VISIBLE);
        }

        @Override
        protected void onPostExecute(Boolean result) {
            if (isCancelled()) {