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
05aa16dd
Commit
05aa16dd
authored
Aug 01, 2018
by
Sajal Narang
Committed by
GitHub
Aug 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #166 from pulsejet/patch-5
Patch 5
parents
efd3ca90
f54afa7d
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
337 additions
and
547 deletions
+337
-547
app/src/main/java/app/insti/MainActivity.java
app/src/main/java/app/insti/MainActivity.java
+14
-0
app/src/main/java/app/insti/adapter/UserAdapter.java
app/src/main/java/app/insti/adapter/UserAdapter.java
+5
-1
app/src/main/java/app/insti/fragment/AddEventFragment.java
app/src/main/java/app/insti/fragment/AddEventFragment.java
+30
-0
app/src/main/java/app/insti/fragment/BodyFragment.java
app/src/main/java/app/insti/fragment/BodyFragment.java
+40
-8
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+14
-10
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+0
-105
app/src/main/java/com/mrane/campusmap/IndexFragment.java
app/src/main/java/com/mrane/campusmap/IndexFragment.java
+0
-158
app/src/main/res/layout/fragment_body.xml
app/src/main/res/layout/fragment_body.xml
+186
-166
app/src/main/res/layout/fragment_calendar.xml
app/src/main/res/layout/fragment_calendar.xml
+2
-1
app/src/main/res/layout/fragment_explore.xml
app/src/main/res/layout/fragment_explore.xml
+13
-14
app/src/main/res/layout/fragment_feed.xml
app/src/main/res/layout/fragment_feed.xml
+2
-1
app/src/main/res/layout/fragment_map.xml
app/src/main/res/layout/fragment_map.xml
+13
-76
app/src/main/res/layout/fragment_mess_menu.xml
app/src/main/res/layout/fragment_mess_menu.xml
+2
-1
app/src/main/res/layout/fragment_my_events.xml
app/src/main/res/layout/fragment_my_events.xml
+2
-1
app/src/main/res/layout/fragment_news.xml
app/src/main/res/layout/fragment_news.xml
+2
-1
app/src/main/res/layout/fragment_notifications.xml
app/src/main/res/layout/fragment_notifications.xml
+2
-1
app/src/main/res/layout/fragment_placement_blog.xml
app/src/main/res/layout/fragment_placement_blog.xml
+2
-1
app/src/main/res/layout/fragment_profile.xml
app/src/main/res/layout/fragment_profile.xml
+2
-1
app/src/main/res/layout/fragment_training_blog.xml
app/src/main/res/layout/fragment_training_blog.xml
+2
-1
app/src/main/res/values/styles.xml
app/src/main/res/values/styles.xml
+4
-0
No files found.
app/src/main/java/app/insti/MainActivity.java
View file @
05aa16dd
...
...
@@ -472,6 +472,20 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
return
false
;
}
public
boolean
editBodyAccess
(
Body
toEditBody
)
{
if
(
currentUser
==
null
||
currentUser
.
getUserRoles
()
==
null
||
currentUser
.
getUserRoles
().
size
()
==
0
)
return
false
;
for
(
Role
role
:
currentUser
.
getUserRoles
())
{
for
(
Body
body
:
role
.
getRoleBodies
())
{
if
(
body
.
getBodyID
().
equals
(
toEditBody
.
getBodyID
()))
{
return
true
;
}
}
}
return
false
;
}
public
static
void
hideKeyboard
(
Activity
activity
)
{
InputMethodManager
imm
=
(
InputMethodManager
)
activity
.
getSystemService
(
Activity
.
INPUT_METHOD_SERVICE
);
//Find the currently focused view, so we can grab the correct window token from it.
...
...
app/src/main/java/app/insti/adapter/UserAdapter.java
View file @
05aa16dd
...
...
@@ -48,7 +48,11 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
public
void
onBindViewHolder
(
ViewHolder
holder
,
int
position
)
{
User
user
=
userList
.
get
(
position
);
holder
.
userName
.
setText
(
user
.
getUserName
());
if
(
user
.
getCurrentRole
()
==
null
||
user
.
getCurrentRole
().
equals
(
""
))
{
holder
.
role
.
setText
(
user
.
getUserLDAPId
());
}
else
{
holder
.
role
.
setText
(
user
.
getCurrentRole
());
}
Picasso
.
get
()
.
load
(
user
.
getUserProfilePictureUrl
())
.
resize
(
150
,
0
)
...
...
app/src/main/java/app/insti/fragment/AddEventFragment.java
View file @
05aa16dd
...
...
@@ -29,6 +29,7 @@ import app.insti.MainActivity;
import
app.insti.R
;
import
app.insti.api.RetrofitInterface
;
import
app.insti.api.ServiceGenerator
;
import
app.insti.data.Body
;
import
app.insti.data.Event
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
...
...
@@ -89,6 +90,9 @@ public class AddEventFragment extends BaseFragment {
String
url
=
"https://"
+
host
+
"/add-event?sandbox=true"
;
if
(
getArguments
().
containsKey
(
"id"
))
{
url
=
"https://"
+
host
+
"/edit-event/"
+
getArguments
().
getString
(
"id"
)
+
"?sandbox=true"
;
}
else
if
(
getArguments
().
containsKey
(
"bodyId"
))
{
url
=
"https://"
+
host
+
"/edit-body/"
+
getArguments
().
getString
(
"bodyId"
)
+
"?sandbox=true"
;
toolbar
.
setTitle
(
"Update Organization"
);
}
webView
.
loadUrl
(
url
);
...
...
@@ -144,6 +148,23 @@ public class AddEventFragment extends BaseFragment {
public
void
onFailure
(
Call
<
Event
>
call
,
Throwable
t
)
{
}
});
return
true
;
}
else
if
(
url
.
contains
(
"/org/"
))
{
url
=
url
.
substring
(
url
.
lastIndexOf
(
"/"
)
+
1
);
RetrofitInterface
retrofitInterface
=
ServiceGenerator
.
createService
(
RetrofitInterface
.
class
);
retrofitInterface
.
getBody
(((
MainActivity
)
getActivity
()).
getSessionIDHeader
(),
url
).
enqueue
(
new
Callback
<
Body
>()
{
@Override
public
void
onResponse
(
Call
<
Body
>
call
,
Response
<
Body
>
response
)
{
if
(
response
.
isSuccessful
())
{
openBody
(
response
.
body
());
}
}
@Override
public
void
onFailure
(
Call
<
Body
>
call
,
Throwable
t
)
{
}
});
return
true
;
}
// return true; //Indicates WebView to NOT load the url;
...
...
@@ -201,6 +222,15 @@ public class AddEventFragment extends BaseFragment {
transaction
.
addToBackStack
(
eventFragment
.
getTag
()).
commit
();
}
void
openBody
(
Body
body
)
{
BodyFragment
bodyFragment
=
BodyFragment
.
newInstance
(
body
);
FragmentManager
manager
=
getActivity
().
getSupportFragmentManager
();
FragmentTransaction
transaction
=
manager
.
beginTransaction
();
transaction
.
setCustomAnimations
(
R
.
anim
.
slide_in_left
,
R
.
anim
.
slide_out_left
,
R
.
anim
.
slide_in_right
,
R
.
anim
.
slide_out_right
);
transaction
.
replace
(
R
.
id
.
framelayout_for_fragment
,
bodyFragment
,
bodyFragment
.
getTag
());
transaction
.
addToBackStack
(
bodyFragment
.
getTag
()).
commit
();
}
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
){
if
(
requestCode
==
101
)
{
if
(
uploadMessage
==
null
)
return
;
...
...
app/src/main/java/app/insti/fragment/BodyFragment.java
View file @
05aa16dd
...
...
@@ -12,8 +12,10 @@ import android.graphics.Rect;
import
android.net.Uri
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.widget.NestedScrollView
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
...
...
@@ -85,7 +87,7 @@ public class BodyFragment extends BackHandledFragment {
private
float
startScaleFinal
;
private
ImageView
bodyPicture
;
private
Body
body
;
private
boolean
bodyDisplayed
=
false
;
public
BodyFragment
()
{
// Required empty public constructor
...
...
@@ -134,6 +136,9 @@ public class BodyFragment extends BackHandledFragment {
body
=
min_body
;
displayBody
();
new
getDbBody
().
execute
(
min_body
.
getBodyID
());
updateBody
();
bodySwipeRefreshLayout
=
getActivity
().
findViewById
(
R
.
id
.
body_swipe_refresh_layout
);
bodySwipeRefreshLayout
.
setOnRefreshListener
(
new
SwipeRefreshLayout
.
OnRefreshListener
()
{
@Override
...
...
@@ -156,8 +161,11 @@ public class BodyFragment extends BackHandledFragment {
new
updateDbBody
().
execute
(
bodyResponse
);
if
(!
bodyDisplayed
)
{
body
=
bodyResponse
;
displayBody
();
}
if
(
bodySwipeRefreshLayout
.
isRefreshing
())
bodySwipeRefreshLayout
.
setRefreshing
(
false
);
}
}
...
...
@@ -180,7 +188,8 @@ public class BodyFragment extends BackHandledFragment {
private
void
displayBody
()
{
/* Skip if we're already destroyed */
if
(
getView
()
==
null
)
return
;
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
if
(!
body
.
equals
(
min_body
))
bodyDisplayed
=
true
;
TextView
bodyName
=
(
TextView
)
getView
().
findViewById
(
R
.
id
.
body_name
);
TextView
bodyDescription
=
(
TextView
)
getView
().
findViewById
(
R
.
id
.
body_description
);
...
...
@@ -345,6 +354,31 @@ public class BodyFragment extends BackHandledFragment {
childrenRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
getActivity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
/* Show update button if role */
if
(((
MainActivity
)
getActivity
()).
editBodyAccess
(
body
))
{
final
FloatingActionButton
fab
=
(
FloatingActionButton
)
getView
().
findViewById
(
R
.
id
.
edit_fab
);
fab
.
setVisibility
(
View
.
VISIBLE
);
NestedScrollView
nsv
=
(
NestedScrollView
)
getView
().
findViewById
(
R
.
id
.
body_scrollview
);
nsv
.
setOnScrollChangeListener
(
new
NestedScrollView
.
OnScrollChangeListener
()
{
@Override
public
void
onScrollChange
(
NestedScrollView
v
,
int
scrollX
,
int
scrollY
,
int
oldScrollX
,
int
oldScrollY
)
{
if
(
scrollY
>
oldScrollY
)
fab
.
hide
();
else
fab
.
show
();
}
});
fab
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
AddEventFragment
addEventFragment
=
new
AddEventFragment
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"bodyId"
,
body
.
getBodyID
());
addEventFragment
.
setArguments
(
bundle
);
((
MainActivity
)
getActivity
()).
updateFragment
(
addEventFragment
);
}
});
}
}
/**
...
...
@@ -389,11 +423,9 @@ public class BodyFragment extends BackHandledFragment {
@Override
protected
void
onPostExecute
(
Body
[]
result
)
{
if
(
result
.
length
>
0
)
{
if
(
result
.
length
>
0
&&
!
bodyDisplayed
)
{
body
=
result
[
0
];
displayBody
();
}
else
{
updateBody
();
}
}
}
...
...
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
05aa16dd
...
...
@@ -187,6 +187,9 @@ public class EventFragment extends BackHandledFragment {
setFollowButtonColors
(
event
.
getEventUserUes
());
if
(
event
.
getEventVenues
().
get
(
0
).
getVenueLatitude
()
==
0
)
{
navigateButton
.
setVisibility
(
View
.
GONE
);
}
else
{
navigateButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
...
...
@@ -197,6 +200,7 @@ public class EventFragment extends BackHandledFragment {
startActivity
(
mapIntent
);
}
});
}
shareEventButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
String
shareUrl
=
ShareURLMaker
.
getEventURL
(
event
);
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
05aa16dd
...
...
@@ -69,7 +69,6 @@ import com.google.android.gms.tasks.OnCompleteListener;
import
com.google.android.gms.tasks.Task
;
import
com.mrane.campusmap.ExpandableListAdapter
;
import
com.mrane.campusmap.FuzzySearchAdapter
;
import
com.mrane.campusmap.IndexFragment
;
import
com.mrane.campusmap.ListFragment
;
import
com.mrane.campusmap.SettingsManager
;
import
com.mrane.data.Building
;
...
...
@@ -110,7 +109,6 @@ public class MapFragment extends Fragment implements TextWatcher,
private
ExpandableListAdapter
expAdapter
;
private
FragmentManager
fragmentManager
;
private
ListFragment
listFragment
;
private
IndexFragment
indexFragment
;
private
Fragment
fragment
;
public
LinearLayout
newSmallCard
;
public
ImageView
placeColor
;
...
...
@@ -123,9 +121,6 @@ public class MapFragment extends Fragment implements TextWatcher,
private
List
<
com
.
mrane
.
data
.
Marker
>
markerlist
;
public
FragmentTransaction
transaction
;
public
CampusMapView
campusMapView
;
public
ImageButton
removeIcon
;
public
ImageButton
indexIcon
;
public
ImageButton
mapIcon
;
public
ImageButton
addMarkerIcon
;
private
DrawerLayout
mDrawerLayout
;
private
ActionBarDrawerToggle
mDrawerToggle
;
...
...
@@ -256,7 +251,6 @@ public class MapFragment extends Fragment implements TextWatcher,
Locations
mLocations
=
new
Locations
(
venues
);
data
=
mLocations
.
data
;
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
setUpDrawer
();
setupMap
();
// Setup locate button
...
...
@@ -320,32 +314,10 @@ public class MapFragment extends Fragment implements TextWatcher,
campusMapView
.
setSettingsManager
(
settingsManager
);
campusMapView
.
setData
(
data
);
removeIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
remove_icon
);
removeIcon
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
removeClick
(
v
);
}
});
indexIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
index_icon
);
indexIcon
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
indexClick
(
v
);
}
});
mapIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
map_icon
);
mapIcon
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
mapClick
(
v
);
}
});
addMarkerIcon
=
(
ImageButton
)
getActivity
().
findViewById
(
R
.
id
.
add_marker_icon
);
fragmentManager
=
getChildFragmentManager
();
listFragment
=
new
ListFragment
();
indexFragment
=
new
IndexFragment
();
adapter
.
setSettingsManager
(
settingsManager
);
...
...
@@ -362,41 +334,6 @@ public class MapFragment extends Fragment implements TextWatcher,
getActivity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
}
private
void
setUpDrawer
()
{
Toolbar
mToolbar
=
(
Toolbar
)
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
actionBarView
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
mDrawerLayout
=
(
DrawerLayout
)
getActivity
().
findViewById
(
R
.
id
.
drawer_layout
);
mDrawerToggle
=
new
ActionBarDrawerToggle
(
getActivity
(),
mDrawerLayout
,
mToolbar
,
R
.
string
.
drawer_open
,
R
.
string
.
drawer_close
)
{
TextView
settingsTitle
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
settings_title
);
/** Called when a drawer has settled in a completely closed state. */
public
void
onDrawerClosed
(
View
view
)
{
super
.
onDrawerClosed
(
view
);
settingsTitle
.
setVisibility
(
View
.
GONE
);
editText
.
setVisibility
(
View
.
VISIBLE
);
setCorrectIcons
();
}
/** Called when a drawer has settled in a completely open state. */
public
void
onDrawerOpened
(
View
drawerView
)
{
super
.
onDrawerOpened
(
drawerView
);
editText
.
setVisibility
(
View
.
GONE
);
indexIcon
.
setVisibility
(
View
.
GONE
);
mapIcon
.
setVisibility
(
View
.
GONE
);
removeIcon
.
setVisibility
(
View
.
GONE
);
settingsTitle
.
setVisibility
(
View
.
VISIBLE
);
}
};
mDrawerLayout
.
setDrawerListener
(
mDrawerToggle
);
}
@Override
public
void
onConfigurationChanged
(
Configuration
newConfig
)
{
// TODO Auto-generated method stub
...
...
@@ -454,15 +391,6 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
placeSubHeadTextView
!=
null
)
{
placeSubHeadTextView
.
setTypeface
(
regular
);
}
if
(
editText
!=
null
)
{
editText
.
setTypeface
(
regular
);
}
TextView
settingsTitle
=
(
TextView
)
getActivity
()
.
findViewById
(
R
.
id
.
settings_title
);
if
(
settingsTitle
!=
null
)
{
settingsTitle
.
setTypeface
(
regular
);
}
}
private
Runnable
setAnchor
()
{
...
...
@@ -958,22 +886,6 @@ public class MapFragment extends Fragment implements TextWatcher,
campusMapView
.
invalidate
();
}
public
void
removeClick
(
View
v
)
{
this
.
editText
.
setText
(
""
);
displayMap
();
}
public
void
indexClick
(
View
v
)
{
this
.
putFragment
(
indexFragment
);
this
.
removeEditTextFocus
(
null
);
this
.
setCorrectIcons
();
}
public
void
mapClick
(
View
v
)
{
this
.
backToMap
();
this
.
removeEditTextFocus
(
""
);
}
private
void
removeEditTextFocus
(
String
text
)
{
if
(
this
.
editTextFocused
)
{
this
.
hideKeyboard
();
...
...
@@ -1009,45 +921,28 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
noFragments
)
{
if
(
this
.
handleRemoveIcon
())
{
this
.
noIndexButton
();
}
else
{
this
.
setVisibleButton
(
indexIcon
);
}
}
else
{
if
(
fragment
instanceof
ListFragment
)
{
if
(
this
.
handleRemoveIcon
())
{
this
.
noIndexButton
();
}
else
{
this
.
setVisibleButton
(
indexIcon
);
}
}
else
if
(
fragment
instanceof
IndexFragment
)
{
this
.
setVisibleButton
(
mapIcon
);
}
}
}
private
void
noIndexButton
()
{
indexIcon
.
setVisibility
(
View
.
GONE
);
mapIcon
.
setVisibility
(
View
.
GONE
);
}
private
boolean
handleRemoveIcon
()
{
String
text
=
editText
.
getText
().
toString
();
if
(
text
.
isEmpty
()
||
text
.
equals
(
null
))
{
removeIcon
.
setVisibility
(
View
.
GONE
);
return
false
;
}
else
{
removeIcon
.
setVisibility
(
View
.
VISIBLE
);
return
true
;
}
}
private
void
setVisibleButton
(
ImageButton
icon
)
{
indexIcon
.
setVisibility
(
View
.
GONE
);
mapIcon
.
setVisibility
(
View
.
GONE
);
icon
.
setVisibility
(
View
.
VISIBLE
);
}
@Override
public
void
onFocusChange
(
View
v
,
boolean
focus
)
{
this
.
editTextFocused
=
focus
;
...
...
app/src/main/java/com/mrane/campusmap/IndexFragment.java
deleted
100644 → 0
View file @
efd3ca90
package
com.mrane.campusmap
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ExpandableListView
;
import
android.widget.ExpandableListView.OnGroupClickListener
;
import
android.widget.ExpandableListView.OnGroupCollapseListener
;
import
android.widget.ExpandableListView.OnGroupExpandListener
;
import
com.mrane.data.Marker
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
app.insti.R
;
import
app.insti.fragment.MapFragment
;
public
class
IndexFragment
extends
Fragment
implements
OnGroupExpandListener
,
OnGroupCollapseListener
,
OnGroupClickListener
{
MapFragment
mainActivity
;
ExpandableListAdapter
adapter
;
HashMap
<
String
,
Marker
>
data
;
View
rootView
;
ExpandableListView
list
;
List
<
String
>
headers
=
new
ArrayList
<
String
>();
HashMap
<
String
,
List
<
String
>>
childData
=
new
HashMap
<
String
,
List
<
String
>>();
int
pos
;
int
prevGroup
=
-
1
;
public
IndexFragment
()
{
}
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
mainActivity
=
MapFragment
.
getMainActivity
();
data
=
mainActivity
.
data
;
if
(
headers
.
isEmpty
())
{
setHeaderAndChildData
();
}
adapter
=
new
ExpandableListAdapter
(
mainActivity
.
getContext
(),
headers
,
childData
);
rootView
=
inflater
.
inflate
(
R
.
layout
.
map_index_fragment
,
container
,
false
);
list
=
(
ExpandableListView
)
rootView
.
findViewById
(
R
.
id
.
index_list
);
mainActivity
.
setExpAdapter
(
adapter
);
list
.
setAdapter
(
adapter
);
list
.
setOnChildClickListener
(
mainActivity
);
list
.
setOnGroupExpandListener
(
this
);
list
.
setOnGroupCollapseListener
(
this
);
list
.
setOnGroupClickListener
(
this
);
return
rootView
;
}
@Override
public
void
onResume
()
{
String
name
=
mainActivity
.
editText
.
getText
().
toString
();
if
(
name
.
isEmpty
())
{
collapseAllGroups
();
list
.
setSelectedGroup
(
0
);
}
else
{
if
(
data
.
containsKey
(
name
))
{
String
groupName
=
data
.
get
(
name
).
getGroupName
();
int
groupId
=
getGroupId
(
groupName
);
if
(
groupId
!=
-
1
)
{
list
.
expandGroup
(
groupId
);
list
.
setSelectedGroup
(
groupId
);
}
}
}
super
.
onResume
();
}
private
int
getGroupId
(
String
groupName
)
{
int
groupCount
=
adapter
.
getGroupCount
();
int
temp
=
-
1
;
for
(
int
i
=
0
;
i
<
groupCount
;
i
++)
{
if
(
adapter
.
getGroup
(
i
).
equals
(
groupName
))
{
temp
=
i
;
}
}
return
temp
;
}
private
void
collapseAllGroups
()
{
int
groupCount
=
adapter
.
getGroupCount
();
for
(
int
i
=
0
;
i
<
groupCount
;
i
++)
{
list
.
collapseGroup
(
i
);
}
}
private
void
setChildData
()
{
Collection
<
Marker
>
keys
=
data
.
values
();
for
(
Marker
key
:
keys
)
{
List
<
String
>
child
=
childData
.
get
(
key
.
getGroupName
());
child
.
add
(
key
.
getName
());
}
sortChildData
();
}
private
void
sortChildData
()
{
for
(
String
header
:
headers
)
{
List
<
String
>
child
=
childData
.
get
(
header
);
Collections
.
sort
(
child
);
}
}
private
void
setHeaderAndChildData
()
{
String
[]
headerString
=
Marker
.
getGroupNames
();
Collections
.
addAll
(
headers
,
headerString
);
for
(
String
header
:
headers
)
{
childData
.
put
(
header
,
new
ArrayList
<
String
>());
}
setChildData
();
}
@Override
public
void
onGroupExpand
(
int
groupPosition
)
{
if
(
prevGroup
!=
-
1
&&
prevGroup
!=
groupPosition
)
{
list
.
collapseGroup
(
prevGroup
);
}
prevGroup
=
groupPosition
;
}
@Override
public
void
onGroupCollapse
(
int
groupPosition
)
{
if
(
prevGroup
!=
-
1
)
{
//list.setSelectionFromTop(prevGroup, 0);
}
}
@Override
public
boolean
onGroupClick
(
ExpandableListView
parent
,
View
v
,
int
groupPosition
,
long
id
)
{
// Implement this method to scroll to the correct position as this doesn't
// happen automatically if we override onGroupExpand() as above
parent
.
smoothScrollToPosition
(
groupPosition
);
// Need default behaviour here otherwise group does not get expanded/collapsed
// on click
if
(
parent
.
isGroupExpanded
(
groupPosition
))
{
parent
.
collapseGroup
(
groupPosition
);
}
else
{
parent
.
expandGroup
(
groupPosition
);
}
return
true
;
}
}
app/src/main/res/layout/fragment_body.xml
View file @
05aa16dd
...
...
@@ -8,12 +8,17 @@
android:orientation=
"vertical"
tools:context=
".fragment.BodyFragment"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v4.widget.SwipeRefreshLayout
android:id=
"@+id/body_swipe_refresh_layout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<android.support.v4.widget.NestedScrollView
android:id=
"@+id/body_scrollview"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
...
...
@@ -202,8 +207,22 @@
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/edit_fab"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentRight=
"true"
android:layout_margin=
"16dp"
android:src=
"@drawable/ic_edit_black_24dp"
android:tint=
"@android:color/black"
android:visibility=
"gone"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/loadingPanel"
android:layout_width=
"match_parent"
...
...
@@ -213,7 +232,8 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
<app.insti.TouchImageView
...
...
app/src/main/res/layout/fragment_calendar.xml
View file @
05aa16dd
...
...
@@ -83,7 +83,8 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_explore.xml
View file @
05aa16dd
...
...
@@ -12,20 +12,18 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<android.support.design.widget.TextInputLayout
android:layout_marginTop=
"8dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<android.support.design.widget.TextInputEditText
<EditText
android:id=
"@+id/explore_search"
android:background=
"@color/colorPrimary"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"6dp"
android:layout_marginRight=
"6dp"
android:layout_marginTop=
"3dp"
android:hint=
"Search"
/>
</android.support.design.widget.TextInputLayout>
android:paddingLeft=
"18dp"
android:paddingRight=
"6dp"
android:paddingTop=
"3dp"
android:paddingBottom=
"15dp"
android:hint=
"Search"
android:textColor=
"@color/primaryTextColor"
android:textColorHint=
"@color/primaryTextColor"
/>
<android.support.v4.widget.NestedScrollView
android:layout_width=
"match_parent"
...
...
@@ -70,7 +68,8 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_feed.xml
View file @
05aa16dd
...
...
@@ -37,6 +37,7 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_map.xml
View file @
05aa16dd
...
...
@@ -10,83 +10,19 @@
android:focusable=
"true"
android:focusableInTouchMode=
"true"
>
<android.support.v7.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
android:background=
"@color/colorPrimary"
>
<EditText
android:id=
"@+id/search"
android:layout_width=
"fill_parent
"
android:layout_height=
"48dp
"
android:layout_alignParentLeft=
"true
"
android:layout_alignParentTop=
"true
"
android:background=
"@null
"
android:dropDownHeight=
"0
dp"
android:fontFamily=
"sans-serif
"
android:background=
"@color/colorPrimary
"
android:layout_width=
"match_parent
"
android:layout_height=
"wrap_content
"
android:paddingLeft=
"18dp
"
android:paddingRight=
"6dp
"
android:paddingTop=
"3
dp"
android:paddingBottom=
"15dp
"
android:hint=
"Search"
android:imeOptions=
"actionSearch"
android:inputType=
"textNoSuggestions"
android:paddingBottom=
"8dp"
android:paddingLeft=
"8dp"
android:paddingRight=
"50dp"
android:paddingTop=
"8dp"
android:selectAllOnFocus=
"true"
android:singleLine=
"true"
android:textColor=
"@color/primaryTextColor"
android:textColorHint=
"@color/primaryTextColor"
/>
<TextView
android:id=
"@+id/settings_title"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:fontFamily=
"sans-serif-light"
android:paddingLeft=
"8dp"
android:paddingRight=
"76dp"
android:text=
"Settings"
android:visibility=
"gone"
/>
<ImageButton
android:id=
"@+id/index_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_alignParentRight=
"true"
android:background=
"@android:color/transparent"
android:contentDescription=
"index"
android:cropToPadding=
"true"
android:padding=
"12dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/dept_menu"
/>
<ImageButton
android:id=
"@+id/map_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_alignParentRight=
"true"
android:background=
"@android:color/transparent"
android:contentDescription=
"map"
android:cropToPadding=
"true"
android:padding=
"12dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/dept_menu_off"
android:visibility=
"gone"
/>
<ImageButton
android:id=
"@+id/remove_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_alignParentRight=
"true"
android:background=
"@android:color/transparent"
android:contentDescription=
"remove"
android:padding=
"8dp"
android:src=
"@drawable/ic_action_remove"
android:visibility=
"gone"
/>
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.DrawerLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/drawer_layout"
android:layout_width=
"match_parent"
...
...
@@ -148,7 +84,8 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
<RelativeLayout
...
...
app/src/main/res/layout/fragment_mess_menu.xml
View file @
05aa16dd
...
...
@@ -46,6 +46,7 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_my_events.xml
View file @
05aa16dd
...
...
@@ -38,6 +38,7 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
app/src/main/res/layout/fragment_news.xml
View file @
05aa16dd
...
...
@@ -26,6 +26,7 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
app/src/main/res/layout/fragment_notifications.xml
View file @
05aa16dd
...
...
@@ -18,7 +18,8 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</FrameLayout>
app/src/main/res/layout/fragment_placement_blog.xml
View file @
05aa16dd
...
...
@@ -26,6 +26,7 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
app/src/main/res/layout/fragment_profile.xml
View file @
05aa16dd
...
...
@@ -104,7 +104,8 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
<app.insti.TouchImageView
...
...
app/src/main/res/layout/fragment_training_blog.xml
View file @
05aa16dd
...
...
@@ -26,6 +26,7 @@
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
android:theme=
"@style/BlueAccent"
/>
</RelativeLayout>
</RelativeLayout>
app/src/main/res/values/styles.xml
View file @
05aa16dd
...
...
@@ -13,6 +13,10 @@
<item
name=
"windowNoTitle"
>
true
</item>
</style>
<style
name=
"BlueAccent"
>
<item
name=
"colorAccent"
>
@color/colorPrimary
</item>
</style>
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<style
name=
"AppTheme.PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
...
...
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