Skip to content
Snippets Groups Projects
Commit 11bac2fa authored by Jan Kozák's avatar Jan Kozák
Browse files

Progress bar visibility fixed.

parent 18e5fed3
No related branches found
No related tags found
No related merge requests found
......@@ -97,38 +97,45 @@ public class GalleryFragment extends Fragment {
public static final String OVERLAY_RECTANGLE_BOUNDS_H = "activity_search_overlay_boundaries_height";
private static final String SVG_SUFFIX = ".svg";
/**
*
*/
private void init() {
private void init(boolean restart) {
Bundle bundle = getArguments();
int selectedPage = 0;
String shownImage = null;
if (bundle != null) {
Log.d(DEBUG_TAG, "init - Initing from bundle");
selectedPage = bundle.getInt(SHOWN_PAGE); // if no found, returns 0 -> shows first page
shownImage = bundle.getString(SELECTED_IMAGE); // if no found returns null
if (!restart) {
if (bundle != null) {
Log.d(DEBUG_TAG, "init - Initing from bundle");
selectedPage = bundle.getInt(SHOWN_PAGE); // if no found, returns 0 -> shows first page
shownImage = bundle.getString(SELECTED_IMAGE); // if no found returns null
int id = bundle.getInt(IMAGES_LIST_ID);
listImageInfos = AppStorage.getStringList(id);
int id = bundle.getInt(IMAGES_LIST_ID);
listImageInfos = AppStorage.getStringList(id);
int wdth = bundle.getInt(OVERLAY_RECTANGLE_BOUNDS_W);
int hght = bundle.getInt(OVERLAY_RECTANGLE_BOUNDS_H);
int wdth = bundle.getInt(OVERLAY_RECTANGLE_BOUNDS_W);
int hght = bundle.getInt(OVERLAY_RECTANGLE_BOUNDS_H);
overlayBoundaries = new Rect(0, 0, wdth, hght);
}
overlayBoundaries = new Rect(0, 0, wdth, hght);
}
if (selectedPage == 1 && shownImage != null) {
flipper.setDisplayedChild(selectedPage);
showFullSizeImage(shownImage);
if (selectedPage == 1 && shownImage != null) {
flipper.setDisplayedChild(selectedPage);
showFullSizeImage(shownImage);
}
}
boolean isXml = searchFile.getName().toLowerCase().endsWith(SVG_SUFFIX);
resultsGrid.setVisibility(View.GONE);
progressBarResultsGrid.setVisibility(View.VISIBLE);
progressBarResultsGrid.setIndeterminate(true);
new LoadImageBitmapTask(isXml).execute(searchFile);
}
/**
*
*/
private void init() {
init(false);
}
@Override
......@@ -305,7 +312,9 @@ public class GalleryFragment extends Fragment {
}
public void restartQuery() {
init();
progressBarResultsGrid.animate().alpha(1.0f).setDuration(CROSSFADE_DURATION).setListener(null);
flipper.setDisplayedChild(0);
init(true);
}
private class DetailedImageSaver extends AsyncTask<File, Integer, Boolean> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment