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
6b94b5ed
Commit
6b94b5ed
authored
Feb 04, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce technical debt (3)
parent
1cfcc606
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
64 deletions
+36
-64
app/src/main/java/app/insti/api/model/User.java
app/src/main/java/app/insti/api/model/User.java
+1
-19
app/src/main/java/app/insti/fragment/BodyRecyclerViewFragment.java
...ain/java/app/insti/fragment/BodyRecyclerViewFragment.java
+1
-1
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+11
-15
app/src/main/java/app/insti/fragment/ExploreFragment.java
app/src/main/java/app/insti/fragment/ExploreFragment.java
+1
-1
app/src/main/java/app/insti/fragment/FeedFragment.java
app/src/main/java/app/insti/fragment/FeedFragment.java
+1
-1
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+19
-24
app/src/main/java/app/insti/fragment/SettingsFragment.java
app/src/main/java/app/insti/fragment/SettingsFragment.java
+1
-1
app/src/main/java/com/mrane/campusmap/ListFragment.java
app/src/main/java/com/mrane/campusmap/ListFragment.java
+1
-2
No files found.
app/src/main/java/app/insti/api/model/User.java
View file @
6b94b5ed
...
...
@@ -67,26 +67,8 @@ public class User implements CardInterface {
private
String
currentRole
;
public
User
(
@NonNull
String
userID
,
String
userName
,
String
userProfilePictureUrl
,
List
<
Event
>
userInterestedEvents
,
List
<
Event
>
userGoingEvents
,
String
userEmail
,
String
userRollNumber
,
String
userContactNumber
,
Boolean
showContactNumber
,
String
userAbout
,
List
<
Body
>
userFollowedBodies
,
List
<
String
>
userFollowedBodiesID
,
List
<
Role
>
userRoles
,
List
<
Role
>
userInstituteRoles
,
List
<
Role
>
userFormerRoles
,
String
userWebsiteURL
,
String
userLDAPId
,
String
hostel
,
String
currentRole
)
{
public
User
(
@NonNull
String
userID
)
{
this
.
userID
=
userID
;
this
.
userName
=
userName
;
this
.
userProfilePictureUrl
=
userProfilePictureUrl
;
this
.
userInterestedEvents
=
userInterestedEvents
;
this
.
userGoingEvents
=
userGoingEvents
;
this
.
userEmail
=
userEmail
;
this
.
userRollNumber
=
userRollNumber
;
this
.
userContactNumber
=
userContactNumber
;
this
.
showContactNumber
=
showContactNumber
;
this
.
userAbout
=
userAbout
;
this
.
userFollowedBodies
=
userFollowedBodies
;
this
.
userFollowedBodiesID
=
userFollowedBodiesID
;
this
.
userRoles
=
userRoles
;
this
.
userInstituteRoles
=
userInstituteRoles
;
this
.
userFormerRoles
=
userFormerRoles
;
this
.
userWebsiteURL
=
userWebsiteURL
;
this
.
userLDAPId
=
userLDAPId
;
this
.
hostel
=
hostel
;
this
.
currentRole
=
currentRole
;
}
public
static
User
fromString
(
String
json
)
{
...
...
app/src/main/java/app/insti/fragment/BodyRecyclerViewFragment.java
View file @
6b94b5ed
...
...
@@ -27,7 +27,7 @@ import app.insti.api.model.Body;
* create an instance of this fragment.
*/
public
class
BodyRecyclerViewFragment
extends
Fragment
implements
TransitionTargetFragment
,
TransitionTargetChild
{
p
rivate
static
final
String
TAG
=
"BodyRecyclerViewFragment"
;
p
ublic
static
final
String
TAG
=
"BodyRecyclerViewFragment"
;
public
Fragment
parentFragment
=
null
;
private
RecyclerView
recyclerView
;
...
...
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
6b94b5ed
...
...
@@ -65,14 +65,10 @@ import ru.noties.markwon.Markwon;
* A simple {@link Fragment} subclass.
*/
public
class
EventFragment
extends
BackHandledFragment
implements
TransitionTargetFragment
{
Event
event
;
Button
goingButton
;
Button
interestedButton
;
ImageButton
navigateButton
;
ImageButton
webEventButton
;
ImageButton
shareEventButton
;
RecyclerView
bodyRecyclerView
;
String
TAG
=
"EventFragment"
;
private
Event
event
;
private
Button
goingButton
;
private
Button
interestedButton
;
public
String
TAG
=
"EventFragment"
;
private
int
appBarOffset
=
0
;
private
boolean
creatingView
=
false
;
...
...
@@ -198,14 +194,14 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
private
void
inflateViews
(
final
Event
event
)
{
eventPicture
=
(
ImageView
)
getActivity
().
findViewById
(
R
.
id
.
event_picture_2
);
TextView
eventTitle
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_title
);
TextView
eventDate
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_date
);
TextView
eventDescription
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_description
);
final
TextView
eventTitle
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_title
);
final
TextView
eventDate
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_date
);
final
TextView
eventDescription
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_description
);
goingButton
=
getActivity
().
findViewById
(
R
.
id
.
going_button
);
interestedButton
=
getActivity
().
findViewById
(
R
.
id
.
interested_button
);
navigateButton
=
getActivity
().
findViewById
(
R
.
id
.
navigate_button
);
webEventButton
=
getActivity
().
findViewById
(
R
.
id
.
web_event_button
);
shareEventButton
=
getActivity
().
findViewById
(
R
.
id
.
share_event_button
);
final
ImageButton
navigateButton
=
getActivity
().
findViewById
(
R
.
id
.
navigate_button
);
final
ImageButton
webEventButton
=
getActivity
().
findViewById
(
R
.
id
.
web_event_button
);
final
ImageButton
shareEventButton
=
getActivity
().
findViewById
(
R
.
id
.
share_event_button
);
if
(
event
.
isEventBigImage
()
||
!
creatingView
)
{
Picasso
.
get
().
load
(
event
.
getEventImageURL
()).
into
(
eventPicture
);
...
...
@@ -221,7 +217,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
SimpleDateFormat
simpleDateFormatTime
=
new
SimpleDateFormat
(
"HH:mm"
);
final
List
<
Body
>
bodyList
=
event
.
getEventBodies
();
bodyRecyclerView
=
(
RecyclerView
)
getActivity
().
findViewById
(
R
.
id
.
body_card_recycler_view
);
final
RecyclerView
bodyRecyclerView
=
getActivity
().
findViewById
(
R
.
id
.
body_card_recycler_view
);
BodyAdapter
bodyAdapter
=
new
BodyAdapter
(
bodyList
,
this
);
bodyRecyclerView
.
setAdapter
(
bodyAdapter
);
bodyRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
...
...
app/src/main/java/app/insti/fragment/ExploreFragment.java
View file @
6b94b5ed
...
...
@@ -41,7 +41,7 @@ import retrofit2.Response;
public
class
ExploreFragment
extends
Fragment
{
private
RecyclerView
recyclerView
;
LinearLayoutManager
mLayoutManager
;
private
LinearLayoutManager
mLayoutManager
;
private
static
List
<
Body
>
allBodies
=
new
ArrayList
<>();
private
static
List
<
Body
>
bodies
=
new
ArrayList
<>();
...
...
app/src/main/java/app/insti/fragment/FeedFragment.java
View file @
6b94b5ed
...
...
@@ -35,7 +35,7 @@ public class FeedFragment extends BaseFragment {
private
RecyclerView
feedRecyclerView
;
private
SwipeRefreshLayout
feedSwipeRefreshLayout
;
private
FloatingActionButton
fab
;
LinearLayoutManager
mLayoutManager
;
private
LinearLayoutManager
mLayoutManager
;
private
int
index
=
-
1
,
top
=
-
1
;
private
FeedAdapter
feedAdapter
=
null
;
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
6b94b5ed
...
...
@@ -121,7 +121,7 @@ public class MapFragment extends Fragment implements TextWatcher,
public
TextView
placeNameTextView
;
public
TextView
placeSubHeadTextView
;
public
EditText
editText
;
public
HashMap
<
String
,
com
.
mrane
.
data
.
Marker
>
data
;
public
HashMap
<
String
,
Marker
>
data
;
public
FragmentTransaction
transaction
;
public
CampusMapView
campusMapView
;
public
ImageButton
addMarkerIcon
;
...
...
@@ -134,7 +134,7 @@ public class MapFragment extends Fragment implements TextWatcher,
private
ListFragment
listFragment
;
private
Fragment
fragment
;
private
RelativeLayout
fragmentContainer
;
private
List
<
com
.
mrane
.
data
.
Marker
>
markerlist
;
private
List
<
Marker
>
markerlist
;
private
SlidingUpPanelLayout
slidingLayout
;
private
CardSlideListener
cardSlideListener
;
private
boolean
noFragments
=
true
;
...
...
@@ -269,7 +269,7 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
getView
()
==
null
||
getActivity
()
==
null
)
return
;
Locations
mLocations
=
new
Locations
(
venues
);
data
=
mLocations
.
data
;
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
markerlist
=
new
ArrayList
<>(
data
.
values
());
if
(
getArguments
()
!=
null
)
{
setupMap
(
getArguments
().
getString
(
Constants
.
MAP_INITIAL_MARKER
));
}
...
...
@@ -520,7 +520,7 @@ public class MapFragment extends Fragment implements TextWatcher,
String
key
=
editText
.
getText
().
toString
();
// get Marker object if exists
com
.
mrane
.
data
.
Marker
marker
=
data
.
get
(
key
);
Marker
marker
=
data
.
get
(
key
);
// display and zoom to marker if exists
if
(
marker
!=
null
)
{
...
...
@@ -535,17 +535,12 @@ public class MapFragment extends Fragment implements TextWatcher,
}
private
void
showResultOnMap
(
String
key
)
{
com
.
mrane
.
data
.
Marker
marker
=
data
.
get
(
key
);
Marker
marker
=
data
.
get
(
key
);
showCard
(
marker
);
campusMapView
.
setAndShowResultMarker
(
marker
);
}
public
void
showCard
()
{
com
.
mrane
.
data
.
Marker
marker
=
campusMapView
.
getResultMarker
();
showCard
(
marker
);
}
public
void
showCard
(
com
.
mrane
.
data
.
Marker
marker
)
{
public
void
showCard
(
Marker
marker
)
{
String
name
=
marker
.
getName
();
if
(!
marker
.
getShortName
().
equals
(
"0"
))
name
=
marker
.
getShortName
();
...
...
@@ -561,7 +556,7 @@ public class MapFragment extends Fragment implements TextWatcher,
cardSlideListener
.
showCard
();
}
private
void
setImage
(
LinearLayout
parent
,
com
.
mrane
.
data
.
Marker
marker
)
{
private
void
setImage
(
LinearLayout
parent
,
Marker
marker
)
{
View
v
=
getLayoutInflater
().
inflate
(
R
.
layout
.
map_card_image
,
parent
);
ImageView
iv
=
(
ImageView
)
v
.
findViewById
(
R
.
id
.
place_image
);
int
imageId
=
getResources
().
getIdentifier
(
marker
.
getImageUri
(),
...
...
@@ -569,7 +564,7 @@ public class MapFragment extends Fragment implements TextWatcher,
iv
.
setImageResource
(
imageId
);
}
private
void
addDescriptionView
(
com
.
mrane
.
data
.
Marker
marker
)
{
private
void
addDescriptionView
(
Marker
marker
)
{
LinearLayout
parent
=
(
LinearLayout
)
getActivity
().
findViewById
(
R
.
id
.
other_details
);
parent
.
removeAllViews
();
if
(!
marker
.
getImageUri
().
isEmpty
())
{
...
...
@@ -655,7 +650,7 @@ public class MapFragment extends Fragment implements TextWatcher,
}
private
SpannableStringBuilder
getDescriptionText
(
com
.
mrane
.
data
.
Marker
marker
)
{
private
SpannableStringBuilder
getDescriptionText
(
Marker
marker
)
{
String
text
=
marker
.
getDescription
();
SpannableStringBuilder
desc
=
new
SpannableStringBuilder
(
text
);
String
[]
toBoldParts
=
{
"Email"
,
"Phone No."
,
"Fax No."
};
...
...
@@ -674,7 +669,7 @@ public class MapFragment extends Fragment implements TextWatcher,
SpannableStringBuilder
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
}
private
void
setSubHeading
(
com
.
mrane
.
data
.
Marker
marker
)
{
private
void
setSubHeading
(
Marker
marker
)
{
SpannableStringBuilder
result
=
new
SpannableStringBuilder
(
""
);
result
.
append
(
marker
.
getName
());
if
(
marker
instanceof
Room
)
{
...
...
@@ -766,17 +761,17 @@ public class MapFragment extends Fragment implements TextWatcher,
placeSubHeadTextView
.
setText
(
result
);
}
private
Drawable
getLockIcon
(
com
.
mrane
.
data
.
Marker
marker
)
{
private
Drawable
getLockIcon
(
Marker
marker
)
{
int
color
=
marker
.
getColor
();
int
drawableId
=
R
.
drawable
.
lock_all_off
;
if
(
campusMapView
.
isAddedMarker
(
marker
))
{
if
(
color
==
com
.
mrane
.
data
.
Marker
.
COLOR_BLUE
)
if
(
color
==
Marker
.
COLOR_BLUE
)
drawableId
=
R
.
drawable
.
lock_blue_on
;
else
if
(
color
==
com
.
mrane
.
data
.
Marker
.
COLOR_YELLOW
)
else
if
(
color
==
Marker
.
COLOR_YELLOW
)
drawableId
=
R
.
drawable
.
lock_on_yellow
;
else
if
(
color
==
com
.
mrane
.
data
.
Marker
.
COLOR_GREEN
)
else
if
(
color
==
Marker
.
COLOR_GREEN
)
drawableId
=
R
.
drawable
.
lock_green_on
;
else
if
(
color
==
com
.
mrane
.
data
.
Marker
.
COLOR_GRAY
)
else
if
(
color
==
Marker
.
COLOR_GRAY
)
drawableId
=
R
.
drawable
.
lock_gray_on
;
}
Drawable
lock
=
getResources
().
getDrawable
(
drawableId
);
...
...
@@ -788,11 +783,11 @@ public class MapFragment extends Fragment implements TextWatcher,
}
private
void
reCenterMarker
()
{
com
.
mrane
.
data
.
Marker
marker
=
campusMapView
.
getResultMarker
();
Marker
marker
=
campusMapView
.
getResultMarker
();
reCenterMarker
(
marker
);
}
private
void
reCenterMarker
(
com
.
mrane
.
data
.
Marker
marker
)
{
private
void
reCenterMarker
(
Marker
marker
)
{
PointF
p
=
marker
.
getPoint
();
float
shift
=
getResources
().
getDimension
(
R
.
dimen
.
expanded_card_height
)
/
2.0f
;
PointF
center
=
new
PointF
(
p
.
x
,
p
.
y
+
shift
);
...
...
@@ -847,7 +842,7 @@ public class MapFragment extends Fragment implements TextWatcher,
}
private
void
setOldText
()
{
com
.
mrane
.
data
.
Marker
oldMarker
=
campusMapView
.
getResultMarker
();
Marker
oldMarker
=
campusMapView
.
getResultMarker
();
if
(
oldMarker
==
null
)
{
if
(
editText
.
length
()
>
0
)
{
editText
.
getText
().
clear
();
...
...
@@ -928,7 +923,7 @@ public class MapFragment extends Fragment implements TextWatcher,
setAddMarkerIcon
(
campusMapView
.
getResultMarker
());
}
private
void
setAddMarkerIcon
(
com
.
mrane
.
data
.
Marker
m
)
{
private
void
setAddMarkerIcon
(
Marker
m
)
{
addMarkerIcon
.
setImageDrawable
(
getLockIcon
(
m
));
}
...
...
app/src/main/java/app/insti/fragment/SettingsFragment.java
View file @
6b94b5ed
...
...
@@ -25,7 +25,7 @@ import retrofit2.Response;
public
class
SettingsFragment
extends
PreferenceFragmentCompat
{
private
SharedPreferences
.
Editor
editor
;
SwitchPreferenceCompat
showContactPref
;
private
SwitchPreferenceCompat
showContactPref
;
@Override
public
void
onCreatePreferences
(
Bundle
savedInstanceState
,
String
rootKey
)
{
...
...
app/src/main/java/com/mrane/campusmap/ListFragment.java
View file @
6b94b5ed
...
...
@@ -17,7 +17,6 @@ import app.insti.fragment.MapFragment;
public
class
ListFragment
extends
Fragment
{
MapFragment
mainActivity
;
FuzzySearchAdapter
adapter
;
View
rootView
;
ListView
list
;
...
...
@@ -28,7 +27,7 @@ public class ListFragment extends Fragment {
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
mainActivity
=
MapFragment
.
getMainActivity
();
adapter
=
mainActivity
.
getAdapter
();
final
FuzzySearchAdapter
adapter
=
mainActivity
.
getAdapter
();
rootView
=
inflater
.
inflate
(
R
.
layout
.
map_list_fragment
,
container
,
false
);
list
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
suggestion_list
);
list
.
setAdapter
(
adapter
);
...
...
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