Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RoomView
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
LOISIL Paul
RoomView
Commits
4a37a4dc
Commit
4a37a4dc
authored
2 years ago
by
FurWaz
Browse files
Options
Downloads
Patches
Plain Diff
Added image preloading to avoid lag
parent
b741ba72
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/app/src/main/java/com/furwaz/roomview/BuildingView.java
+18
-0
18 additions, 0 deletions
...s/app/src/main/java/com/furwaz/roomview/BuildingView.java
Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java
+13
-0
13 additions, 0 deletions
Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java
with
31 additions
and
0 deletions
Sources/app/src/main/java/com/furwaz/roomview/BuildingView.java
+
18
−
0
View file @
4a37a4dc
...
...
@@ -7,10 +7,16 @@ import android.os.Bundle;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
Common.BuildingManager
;
import
Popups.DirectionsPopup
;
import
Popups.GotoPopup
;
import
Structures.BuildingInfo
;
import
Structures.PhotoInfo
;
import
Structures.RoomInfo
;
import
Structures.ZoneInfo
;
public
class
BuildingView
extends
AppCompatActivity
{
BuildingInfo
building
=
null
;
...
...
@@ -41,6 +47,18 @@ public class BuildingView extends AppCompatActivity {
tile_directions
.
setOnClickListener
(
view
->
{
showDirectionsPopup
();
});
// pre-load all the building's photos (to make the app faster)
ExecutorService
executor
=
Executors
.
newSingleThreadExecutor
();
executor
.
execute
(()
->
{
for
(
RoomInfo
room:
building
.
getRooms
())
{
for
(
ZoneInfo
zone
:
room
.
getZones
())
{
for
(
PhotoInfo
photo
:
zone
.
getPhotos
())
{
photo
.
getBitmap
();
}
}
}
});
}
protected
void
showGotoPopup
()
{
...
...
This diff is collapsed.
Click to expand it.
Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java
+
13
−
0
View file @
4a37a4dc
...
...
@@ -16,6 +16,9 @@ import android.widget.LinearLayout;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
Common.BuildingManager
;
import
Common.Coord
;
import
Popups.PhotoInfoPopup
;
...
...
@@ -100,6 +103,16 @@ public class ZoneView extends AppCompatActivity {
zone
=
null
;
}
// pre-load all the zones's photos (to make the app faster)
ExecutorService
executor
=
Executors
.
newSingleThreadExecutor
();
executor
.
execute
(()
->
{
for
(
ZoneInfo
zone
:
room
.
getZones
())
{
for
(
PhotoInfo
photo
:
zone
.
getPhotos
())
{
photo
.
getBitmap
();
}
}
});
// set the left-right buttons
ImageButton
btn_l
=
findViewById
(
R
.
id
.
btn_turn_l
);
ImageButton
btn_r
=
findViewById
(
R
.
id
.
btn_turn_r
);
...
...
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