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
721b01f0
Commit
721b01f0
authored
Feb 02, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow venue from event page
parent
2b269e05
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
8 deletions
+82
-8
app/src/main/java/app/insti/Constants.java
app/src/main/java/app/insti/Constants.java
+1
-0
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+39
-2
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+8
-1
app/src/main/java/com/mrane/zoomview/CampusMapView.java
app/src/main/java/com/mrane/zoomview/CampusMapView.java
+34
-5
No files found.
app/src/main/java/app/insti/Constants.java
View file @
721b01f0
...
...
@@ -63,4 +63,5 @@ public class Constants {
public
static
final
double
MAP_Xn
=
19.134417
,
MAP_Yn
=
72.901229
,
MAP_Zn
=
1757
,
MAP_Zyn
=
501
;
public
static
final
double
[]
MAP_WEIGHTS_X
=
{-
11.392001766454612
,
-
36.31634553309953
,
73.91269388324432
,
-
24.14021153064087
,
3.4508817531539115
,
-
0.1462262375477863
,
5.532505074667804
,
-
1.542391995870977
,
36.14211738142935
};
public
static
final
double
[]
MAP_WEIGHTS_Y
=
{
0.09738953520399705
,
-
4.519868444089616
,
62.38493718381985
,
16.664561869057696
,
-
2.168377988768651
,
0.0919143297622087
,
0.32304266159540823
,
0.21688067854428716
,
-
12.81393255320748
};
public
static
final
String
MAP_INITIAL_MARKER
=
"initial_marker"
;
}
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
721b01f0
...
...
@@ -11,6 +11,7 @@ import android.graphics.Point;
import
android.graphics.Rect
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.widget.NestedScrollView
;
...
...
@@ -19,6 +20,10 @@ import android.support.v7.widget.RecyclerView;
import
android.support.v7.widget.Toolbar
;
import
android.text.Spannable
;
import
android.text.SpannableString
;
import
android.text.Spanned
;
import
android.text.TextPaint
;
import
android.text.method.LinkMovementMethod
;
import
android.text.style.ClickableSpan
;
import
android.text.style.ForegroundColorSpan
;
import
android.text.style.RelativeSizeSpan
;
import
android.util.Log
;
...
...
@@ -189,9 +194,41 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
bodyRecyclerView
.
setAdapter
(
bodyAdapter
);
bodyRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
// Make the venues clickable
if
(!
eventVenueName
.
toString
().
equals
(
""
))
{
// Get the whole string
SpannableString
ss
=
new
SpannableString
(
eventVenueName
.
toString
().
substring
(
2
));
if
(!
eventVenueName
.
toString
().
equals
(
""
))
eventVenue
.
setText
(
eventVenueName
.
toString
().
substring
(
2
));
// Make each venue clickable
int
i
=
0
;
for
(
final
Venue
venue
:
event
.
getEventVenues
())
{
int
length
=
venue
.
getVenueShortName
().
length
();
ClickableSpan
cs
=
new
ClickableSpan
()
{
@Override
public
void
onClick
(
@NonNull
View
widget
)
{
MapFragment
mapFragment
=
new
MapFragment
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
Constants
.
MAP_INITIAL_MARKER
,
venue
.
getVenueName
());
mapFragment
.
setArguments
(
bundle
);
((
MainActivity
)
getActivity
()).
updateFragment
(
mapFragment
);
}
@Override
public
void
updateDrawState
(
TextPaint
ds
)
{
super
.
updateDrawState
(
ds
);
if
(
getActivity
()
==
null
||
!
isAdded
())
return
;
ds
.
setColor
(
getResources
().
getColor
(
R
.
color
.
primaryTextColor
));
ds
.
setUnderlineText
(
false
);
}
};
ss
.
setSpan
(
cs
,
i
,
i
+
length
,
Spanned
.
SPAN_INCLUSIVE_EXCLUSIVE
);
i
+=
length
+
2
;
}
// Setup the text view
eventVenue
.
setText
(
ss
);
eventVenue
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
}
interestedButton
.
setOnClickListener
(
getUESOnClickListener
(
1
));
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
721b01f0
...
...
@@ -278,7 +278,9 @@ public class MapFragment extends Fragment implements TextWatcher,
Locations
mLocations
=
new
Locations
(
venues
);
data
=
mLocations
.
data
;
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
setupMap
();
if
(
getArguments
()
!=
null
)
{
setupMap
(
getArguments
().
getString
(
Constants
.
MAP_INITIAL_MARKER
));
}
// Setup locate button
FloatingActionButton
fab
=
getView
().
findViewById
(
R
.
id
.
locate_fab
);
...
...
@@ -308,6 +310,10 @@ public class MapFragment extends Fragment implements TextWatcher,
}
private
void
setupMap
()
{
setupMap
(
null
);
}
private
void
setupMap
(
String
initalMarkerName
)
{
if
(
getView
()
==
null
)
{
return
;
}
...
...
@@ -340,6 +346,7 @@ public class MapFragment extends Fragment implements TextWatcher,
campusMapView
.
setImageAsset
(
"map.jpg"
);
campusMapView
.
setSettingsManager
(
settingsManager
);
campusMapView
.
setData
(
data
);
campusMapView
.
setInitialMarkerName
(
initalMarkerName
);
addMarkerIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
add_marker_icon
);
...
...
app/src/main/java/com/mrane/zoomview/CampusMapView.java
View file @
721b01f0
...
...
@@ -74,6 +74,7 @@ public class CampusMapView extends SubsamplingScaleImageView {
private
float
density
;
private
boolean
isFirstLoad
=
true
;
private
SettingsManager
settingsManager
;
private
String
initialMarkerName
=
null
;
public
CampusMapView
(
Context
context
)
{
this
(
context
,
null
);
...
...
@@ -100,6 +101,14 @@ public class CampusMapView extends SubsamplingScaleImageView {
RATIO_SHOW_PIN_TEXT
=
ratio
;
}
public
String
getInitialMarkerName
()
{
return
initialMarkerName
;
}
public
void
setInitialMarkerName
(
String
initialMarkerName
)
{
this
.
initialMarkerName
=
initialMarkerName
;
}
private
void
initialise
()
{
displayMetrics
=
getResources
().
getDisplayMetrics
();
density
=
displayMetrics
.
density
;
...
...
@@ -119,11 +128,31 @@ public class CampusMapView extends SubsamplingScaleImageView {
if
(
isFirstLoad
)
{
Runnable
runnable
=
new
Runnable
()
{
public
void
run
()
{
AnimationBuilder
anim
;
anim
=
animateScaleAndCenter
(
getTargetMinScale
(),
MapFragment
.
MAP_CENTER
);
anim
.
withDuration
(
MapFragment
.
DURATION_INIT_MAP_ANIM
)
.
start
();
// Center marker on start
Marker
centerMarker
=
null
;
// Iterate all markers
if
(
getInitialMarkerName
()
!=
null
)
{
for
(
Marker
m
:
markerList
)
{
if
(
m
.
getName
().
equals
(
getInitialMarkerName
()))
{
centerMarker
=
m
;
break
;
}
}
}
// If a marker is to be centered
if
(
centerMarker
!=
null
)
{
setAndShowResultMarker
(
centerMarker
);
}
else
{
AnimationBuilder
anim
;
anim
=
animateScaleAndCenter
(
getTargetMinScale
(),
MapFragment
.
MAP_CENTER
);
anim
.
withDuration
(
MapFragment
.
DURATION_INIT_MAP_ANIM
)
.
start
();
}
// Don't do this again
isFirstLoad
=
false
;
}
};
...
...
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