Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
b037731f
Commit
b037731f
authored
Jul 11, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load locations on map from network
parent
76269470
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
1783 deletions
+85
-1783
app/src/main/java/app/insti/api/RetrofitInterface.java
app/src/main/java/app/insti/api/RetrofitInterface.java
+4
-0
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+26
-5
app/src/main/java/com/mrane/data/Building.java
app/src/main/java/com/mrane/data/Building.java
+7
-0
app/src/main/java/com/mrane/data/Locations.java
app/src/main/java/com/mrane/data/Locations.java
+48
-1778
No files found.
app/src/main/java/app/insti/api/RetrofitInterface.java
View file @
b037731f
...
...
@@ -13,6 +13,7 @@ import app.insti.data.NewsArticle;
import
app.insti.data.PlacementBlogPost
;
import
app.insti.data.TrainingBlogPost
;
import
app.insti.data.User
;
import
app.insti.data.Venue
;
import
retrofit2.Call
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
...
...
@@ -34,6 +35,9 @@ public interface RetrofitInterface {
@GET
(
"events"
)
Call
<
NewsFeedResponse
>
getNewsFeed
(
@Header
(
"Cookie"
)
String
sessionId
);
@GET
(
"locations"
)
Call
<
List
<
Venue
>>
getAllVenues
();
@GET
(
"events"
)
Call
<
NewsFeedResponse
>
getEventsBetweenDates
(
@Header
(
"Cookie"
)
String
sessionId
,
@Query
(
"start"
)
String
start
,
@Query
(
"end"
)
String
end
);
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
b037731f
...
...
@@ -69,6 +69,12 @@ import java.util.Locale;
import
java.util.regex.Pattern
;
import
app.insti.R
;
import
app.insti.api.RetrofitInterface
;
import
app.insti.api.ServiceGenerator
;
import
app.insti.data.Venue
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
public
class
MapFragment
extends
Fragment
implements
TextWatcher
,
TextView
.
OnEditorActionListener
,
AdapterView
.
OnItemClickListener
,
View
.
OnFocusChangeListener
,
...
...
@@ -160,12 +166,31 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
public
void
onStart
()
{
super
.
onStart
();
setUpDrawer
();
/* Set title */
Toolbar
toolbar
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
toolbar
.
setTitle
(
"InstiMap"
);
RetrofitInterface
retrofitInterface
=
ServiceGenerator
.
createService
(
RetrofitInterface
.
class
);
retrofitInterface
.
getAllVenues
().
enqueue
(
new
Callback
<
List
<
Venue
>>()
{
@Override
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
if
(
response
.
isSuccessful
())
{
Locations
mLocations
=
new
Locations
(
response
.
body
());
data
=
mLocations
.
data
;
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
setUpDrawer
();
setupMap
();
}
}
@Override
public
void
onFailure
(
Call
<
List
<
Venue
>>
call
,
Throwable
t
)
{
}
});
}
private
void
setupMap
()
{
newSmallCard
=
(
LinearLayout
)
getActivity
().
findViewById
(
R
.
id
.
new_small_card
);
slidingLayout
=
(
SlidingUpPanelLayout
)
getActivity
().
findViewById
(
R
.
id
.
sliding_layout
);
placeNameTextView
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
place_name
);
...
...
@@ -177,9 +202,6 @@ public class MapFragment extends Fragment implements TextWatcher,
slidingLayout
.
post
(
setAnchor
());
Locations
mLocations
=
new
Locations
(
getContext
());
data
=
mLocations
.
data
;
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
initShowDefault
();
initImageUri
();
...
...
@@ -236,7 +258,6 @@ public class MapFragment extends Fragment implements TextWatcher,
addMarkerClick
(
v
);
}
});
}
private
void
setUpDrawer
()
{
...
...
app/src/main/java/com/mrane/data/Building.java
View file @
b037731f
...
...
@@ -9,4 +9,11 @@ public class Building extends Marker {
this
.
children
=
children
;
}
public
String
[]
getChildren
()
{
return
children
;
}
public
void
setChildren
(
String
[]
children
)
{
this
.
children
=
children
;
}
}
app/src/main/java/com/mrane/data/Locations.java
View file @
b037731f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment