Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SketchToDb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Kozák
SketchToDb
Commits
11bac2fa
Commit
11bac2fa
authored
8 years ago
by
Jan Kozák
Browse files
Options
Downloads
Patches
Plain Diff
Progress bar visibility fixed.
parent
18e5fed3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/cz/cvut/felk/cyber/kozak/sketch2db/gallery/fragments/GalleryFragment.java
+28
-19
28 additions, 19 deletions
...er/kozak/sketch2db/gallery/fragments/GalleryFragment.java
with
28 additions
and
19 deletions
app/src/main/java/cz/cvut/felk/cyber/kozak/sketch2db/gallery/fragments/GalleryFragment.java
+
28
−
19
View file @
11bac2fa
...
...
@@ -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
>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment