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
f98ae2cb
Commit
f98ae2cb
authored
Feb 04, 2019
by
Varun Patil
Committed by
GitHub
Feb 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce technical debt (#271)
* Reduce technical debt (4) * Remove test files * Reduce technical debt (5)
parent
3449c40a
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
29 additions
and
175 deletions
+29
-175
app/src/androidTest/java/app/insti/ExampleInstrumentedTest.java
...c/androidTest/java/app/insti/ExampleInstrumentedTest.java
+0
-26
app/src/main/java/app/insti/InstiAppFirebaseMessagingService.java
...main/java/app/insti/InstiAppFirebaseMessagingService.java
+0
-1
app/src/main/java/app/insti/SessionManager.java
app/src/main/java/app/insti/SessionManager.java
+3
-3
app/src/main/java/app/insti/activity/LoginActivity.java
app/src/main/java/app/insti/activity/LoginActivity.java
+2
-18
app/src/main/java/app/insti/activity/MainActivity.java
app/src/main/java/app/insti/activity/MainActivity.java
+2
-2
app/src/main/java/app/insti/adapter/ComplaintsAdapter.java
app/src/main/java/app/insti/adapter/ComplaintsAdapter.java
+0
-3
app/src/main/java/app/insti/adapter/MessMenuAdapter.java
app/src/main/java/app/insti/adapter/MessMenuAdapter.java
+1
-2
app/src/main/java/app/insti/adapter/TrainingBlogAdapter.java
app/src/main/java/app/insti/adapter/TrainingBlogAdapter.java
+1
-3
app/src/main/java/app/insti/api/model/Body.java
app/src/main/java/app/insti/api/model/Body.java
+0
-17
app/src/main/java/app/insti/api/model/Event.java
app/src/main/java/app/insti/api/model/Event.java
+1
-16
app/src/main/java/app/insti/api/model/Venue.java
app/src/main/java/app/insti/api/model/Venue.java
+1
-12
app/src/main/java/app/insti/fragment/BodyFragment.java
app/src/main/java/app/insti/fragment/BodyFragment.java
+1
-1
app/src/main/java/app/insti/fragment/BodyRecyclerViewFragment.java
...ain/java/app/insti/fragment/BodyRecyclerViewFragment.java
+2
-5
app/src/main/java/app/insti/fragment/CalendarFragment.java
app/src/main/java/app/insti/fragment/CalendarFragment.java
+1
-1
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+2
-2
app/src/main/java/app/insti/fragment/EventRecyclerViewFragment.java
...in/java/app/insti/fragment/EventRecyclerViewFragment.java
+2
-5
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+3
-25
app/src/main/java/app/insti/fragment/MessMenuFragment.java
app/src/main/java/app/insti/fragment/MessMenuFragment.java
+1
-2
app/src/main/java/app/insti/fragment/RoleRecyclerViewFragment.java
...ain/java/app/insti/fragment/RoleRecyclerViewFragment.java
+1
-1
app/src/main/java/com/mrane/campusmap/FuzzySearchAdapter.java
...src/main/java/com/mrane/campusmap/FuzzySearchAdapter.java
+2
-2
app/src/main/java/com/mrane/campusmap/ListFragment.java
app/src/main/java/com/mrane/campusmap/ListFragment.java
+3
-11
app/src/test/java/app/insti/ExampleUnitTest.java
app/src/test/java/app/insti/ExampleUnitTest.java
+0
-17
No files found.
app/src/androidTest/java/app/insti/ExampleInstrumentedTest.java
deleted
100644 → 0
View file @
3449c40a
package
app.insti
;
import
android.content.Context
;
import
android.support.test.InstrumentationRegistry
;
import
android.support.test.runner.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
throws
Exception
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"app.insti"
,
appContext
.
getPackageName
());
}
}
app/src/main/java/app/insti/InstiAppFirebaseMessagingService.java
View file @
f98ae2cb
...
@@ -199,7 +199,6 @@ public class InstiAppFirebaseMessagingService extends FirebaseMessagingService {
...
@@ -199,7 +199,6 @@ public class InstiAppFirebaseMessagingService extends FirebaseMessagingService {
Bitmap
.
Config
.
ARGB_8888
);
Bitmap
.
Config
.
ARGB_8888
);
Canvas
canvas
=
new
Canvas
(
output
);
Canvas
canvas
=
new
Canvas
(
output
);
final
int
color
=
0xffa19774
;
final
Paint
paint
=
new
Paint
();
final
Paint
paint
=
new
Paint
();
final
Rect
rect
=
new
Rect
(
0
,
0
,
radius
,
radius
);
final
Rect
rect
=
new
Rect
(
0
,
0
,
radius
,
radius
);
final
Rect
destRect
=
new
Rect
(
final
Rect
destRect
=
new
Rect
(
...
...
app/src/main/java/app/insti/SessionManager.java
View file @
f98ae2cb
...
@@ -11,9 +11,9 @@ import app.insti.api.model.User;
...
@@ -11,9 +11,9 @@ import app.insti.api.model.User;
public
class
SessionManager
{
public
class
SessionManager
{
public
SharedPreferences
pref
;
public
SharedPreferences
pref
;
Editor
editor
;
private
Editor
editor
;
Context
context
;
private
Context
context
;
int
PRIVATE_MODE
=
0
;
private
final
int
PRIVATE_MODE
=
0
;
public
SessionManager
(
Context
context
)
{
public
SessionManager
(
Context
context
)
{
this
.
context
=
context
;
this
.
context
=
context
;
...
...
app/src/main/java/app/insti/activity/LoginActivity.java
View file @
f98ae2cb
...
@@ -36,8 +36,8 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -36,8 +36,8 @@ public class LoginActivity extends AppCompatActivity {
private
final
String
guestUri
=
"https://guesturi"
;
private
final
String
guestUri
=
"https://guesturi"
;
public
String
authCode
=
null
;
public
String
authCode
=
null
;
public
String
fcmId
=
null
;
public
String
fcmId
=
null
;
SessionManager
session
;
private
SessionManager
session
;
Context
mContext
=
this
;
private
Context
mContext
=
this
;
private
boolean
loggingIn
=
false
;
private
boolean
loggingIn
=
false
;
private
ProgressDialog
progressDialog
;
private
ProgressDialog
progressDialog
;
...
@@ -169,22 +169,6 @@ public class LoginActivity extends AppCompatActivity {
...
@@ -169,22 +169,6 @@ public class LoginActivity extends AppCompatActivity {
});
});
}
}
private
boolean
checkPlayServices
()
{
GoogleApiAvailability
apiAvailability
=
GoogleApiAvailability
.
getInstance
();
int
resultCode
=
apiAvailability
.
isGooglePlayServicesAvailable
(
this
);
if
(
resultCode
!=
ConnectionResult
.
SUCCESS
)
{
if
(
apiAvailability
.
isUserResolvableError
(
resultCode
))
{
apiAvailability
.
getErrorDialog
(
this
,
resultCode
,
PLAY_SERVICES_RESOLUTION_REQUEST
)
.
show
();
}
else
{
Log
.
i
(
TAG
,
"This device is not supported."
);
finish
();
}
return
false
;
}
return
true
;
}
private
class
WvClient
extends
WebViewClient
{
private
class
WvClient
extends
WebViewClient
{
@Override
@Override
public
boolean
shouldOverrideUrlLoading
(
final
WebView
view
,
final
String
url
)
{
public
boolean
shouldOverrideUrlLoading
(
final
WebView
view
,
final
String
url
)
{
...
...
app/src/main/java/app/insti/activity/MainActivity.java
View file @
f98ae2cb
...
@@ -93,8 +93,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -93,8 +93,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private
static
final
String
TAG
=
"MainActivity"
;
private
static
final
String
TAG
=
"MainActivity"
;
SessionManager
session
;
private
SessionManager
session
;
FeedFragment
feedFragment
;
private
FeedFragment
feedFragment
;
private
User
currentUser
;
private
User
currentUser
;
private
BackHandledFragment
selectedFragment
;
private
BackHandledFragment
selectedFragment
;
private
Menu
menu
;
private
Menu
menu
;
...
...
app/src/main/java/app/insti/adapter/ComplaintsAdapter.java
View file @
f98ae2cb
...
@@ -18,8 +18,6 @@ import android.widget.LinearLayout;
...
@@ -18,8 +18,6 @@ import android.widget.LinearLayout;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
com.squareup.picasso.Picasso
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -30,7 +28,6 @@ import app.insti.api.model.User;
...
@@ -30,7 +28,6 @@ import app.insti.api.model.User;
import
app.insti.api.model.Venter
;
import
app.insti.api.model.Venter
;
import
app.insti.fragment.ComplaintFragment
;
import
app.insti.fragment.ComplaintFragment
;
import
app.insti.utils.DateTimeUtil
;
import
app.insti.utils.DateTimeUtil
;
import
de.hdodenhof.circleimageview.CircleImageView
;
import
retrofit2.Call
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
import
retrofit2.Response
;
...
...
app/src/main/java/app/insti/adapter/MessMenuAdapter.java
View file @
f98ae2cb
...
@@ -15,7 +15,6 @@ import app.insti.api.model.MessMenu;
...
@@ -15,7 +15,6 @@ import app.insti.api.model.MessMenu;
public
class
MessMenuAdapter
extends
RecyclerView
.
Adapter
<
MessMenuAdapter
.
ViewHolder
>
{
public
class
MessMenuAdapter
extends
RecyclerView
.
Adapter
<
MessMenuAdapter
.
ViewHolder
>
{
private
List
<
MessMenu
>
messMenus
;
private
List
<
MessMenu
>
messMenus
;
private
Context
context
;
public
MessMenuAdapter
(
List
<
MessMenu
>
messMenus
)
{
public
MessMenuAdapter
(
List
<
MessMenu
>
messMenus
)
{
this
.
messMenus
=
messMenus
;
this
.
messMenus
=
messMenus
;
...
@@ -25,7 +24,7 @@ public class MessMenuAdapter extends RecyclerView.Adapter<MessMenuAdapter.ViewHo
...
@@ -25,7 +24,7 @@ public class MessMenuAdapter extends RecyclerView.Adapter<MessMenuAdapter.ViewHo
@NonNull
@NonNull
@Override
@Override
public
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
public
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
context
=
parent
.
getContext
();
final
Context
context
=
parent
.
getContext
();
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
View
postView
=
inflater
.
inflate
(
R
.
layout
.
mess_menu_card
,
parent
,
false
);
View
postView
=
inflater
.
inflate
(
R
.
layout
.
mess_menu_card
,
parent
,
false
);
...
...
app/src/main/java/app/insti/adapter/TrainingBlogAdapter.java
View file @
f98ae2cb
...
@@ -28,7 +28,6 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
...
@@ -28,7 +28,6 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
private
final
int
VIEW_PROG
=
0
;
private
final
int
VIEW_PROG
=
0
;
private
List
<
TrainingBlogPost
>
posts
;
private
List
<
TrainingBlogPost
>
posts
;
private
Context
context
;
private
ItemClickListener
itemClickListener
;
private
ItemClickListener
itemClickListener
;
public
TrainingBlogAdapter
(
List
<
TrainingBlogPost
>
posts
,
ItemClickListener
itemClickListener
)
{
public
TrainingBlogAdapter
(
List
<
TrainingBlogPost
>
posts
,
ItemClickListener
itemClickListener
)
{
...
@@ -47,7 +46,7 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
...
@@ -47,7 +46,7 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
@Override
@Override
public
RecyclerView
.
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
public
RecyclerView
.
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
context
=
parent
.
getContext
();
final
Context
context
=
parent
.
getContext
();
if
(
viewType
==
VIEW_ITEM
)
{
if
(
viewType
==
VIEW_ITEM
)
{
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
View
postView
=
inflater
.
inflate
(
R
.
layout
.
blog_post_card
,
parent
,
false
);
View
postView
=
inflater
.
inflate
(
R
.
layout
.
blog_post_card
,
parent
,
false
);
...
@@ -63,7 +62,6 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
...
@@ -63,7 +62,6 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
}
else
{
}
else
{
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
LayoutInflater
inflater
=
LayoutInflater
.
from
(
context
);
View
loadView
=
inflater
.
inflate
(
R
.
layout
.
blog_load_item
,
parent
,
false
);
View
loadView
=
inflater
.
inflate
(
R
.
layout
.
blog_load_item
,
parent
,
false
);
final
TrainingBlogAdapter
.
ViewHolder
postViewHolder
=
new
TrainingBlogAdapter
.
ViewHolder
(
loadView
);
return
new
TrainingBlogAdapter
.
ProgressViewHolder
(
loadView
);
return
new
TrainingBlogAdapter
.
ProgressViewHolder
(
loadView
);
}
}
}
}
...
...
app/src/main/java/app/insti/api/model/Body.java
View file @
f98ae2cb
...
@@ -56,23 +56,6 @@ public class Body implements CardInterface {
...
@@ -56,23 +56,6 @@ public class Body implements CardInterface {
this
.
bodyID
=
bodyID
;
this
.
bodyID
=
bodyID
;
}
}
public
Body
(
String
bodyID
,
String
bodyStrID
,
String
bodyName
,
String
bodyShortDescription
,
String
bodyDescription
,
String
bodyImageURL
,
List
<
Body
>
bodyChildren
,
List
<
Body
>
bodyParents
,
List
<
Event
>
bodyEvents
,
int
bodyFollowersCount
,
String
bodyWebsiteURL
,
String
bodyBlogURL
,
boolean
bodyUserFollows
,
List
<
Role
>
bodyRoles
)
{
this
.
bodyID
=
bodyID
;
this
.
bodyStrID
=
bodyStrID
;
this
.
bodyName
=
bodyName
;
this
.
bodyShortDescription
=
bodyShortDescription
;
this
.
bodyDescription
=
bodyDescription
;
this
.
bodyImageURL
=
bodyImageURL
;
this
.
bodyChildren
=
bodyChildren
;
this
.
bodyParents
=
bodyParents
;
this
.
bodyEvents
=
bodyEvents
;
this
.
bodyFollowersCount
=
bodyFollowersCount
;
this
.
bodyWebsiteURL
=
bodyWebsiteURL
;
this
.
bodyBlogURL
=
bodyBlogURL
;
this
.
bodyUserFollows
=
bodyUserFollows
;
this
.
bodyRoles
=
bodyRoles
;
}
public
String
getBodyID
()
{
public
String
getBodyID
()
{
return
bodyID
;
return
bodyID
;
}
}
...
...
app/src/main/java/app/insti/api/model/Event.java
View file @
f98ae2cb
...
@@ -66,23 +66,8 @@ public class Event implements CardInterface {
...
@@ -66,23 +66,8 @@ public class Event implements CardInterface {
private
boolean
eventBigImage
=
false
;
private
boolean
eventBigImage
=
false
;
public
Event
(
String
eventID
,
String
eventStrID
,
String
eventName
,
String
eventDescription
,
String
eventImageURL
,
Timestamp
eventStartTime
,
Timestamp
eventEndTime
,
boolean
allDayEvent
,
List
<
Venue
>
eventVenues
,
List
<
Body
>
eventBodies
,
int
eventInterestedCount
,
int
eventGoingCount
,
List
<
User
>
eventInterested
,
List
<
User
>
eventGoing
,
String
eventWebsiteURL
,
int
eventUserUes
)
{
public
Event
(
@NonNull
String
eventID
)
{
this
.
eventID
=
eventID
;
this
.
eventID
=
eventID
;
this
.
eventStrID
=
eventStrID
;
this
.
eventName
=
eventName
;
this
.
eventDescription
=
eventDescription
;
this
.
eventImageURL
=
eventImageURL
;
this
.
eventStartTime
=
eventStartTime
;
this
.
eventEndTime
=
eventEndTime
;
this
.
allDayEvent
=
allDayEvent
;
this
.
eventVenues
=
eventVenues
;
this
.
eventBodies
=
eventBodies
;
this
.
eventInterestedCount
=
eventInterestedCount
;
this
.
eventGoingCount
=
eventGoingCount
;
this
.
eventInterested
=
eventInterested
;
this
.
eventGoing
=
eventGoing
;
this
.
eventWebsiteURL
=
eventWebsiteURL
;
this
.
eventUserUes
=
eventUserUes
;
}
}
public
String
getEventID
()
{
public
String
getEventID
()
{
...
...
app/src/main/java/app/insti/api/model/Venue.java
View file @
f98ae2cb
...
@@ -42,19 +42,8 @@ public class Venue {
...
@@ -42,19 +42,8 @@ public class Venue {
@SerializedName
(
"lng"
)
@SerializedName
(
"lng"
)
private
double
venueLongitude
;
private
double
venueLongitude
;
public
Venue
(
String
venueID
,
String
venueName
,
String
venueShortName
,
String
venueDescripion
,
String
venueParentId
,
String
venueParentRelation
,
Integer
venueGroupId
,
Integer
venuePixelX
,
Integer
venuePixelY
,
Boolean
venueReusable
,
double
venueLatitude
,
double
venueLongitude
)
{
public
Venue
(
@NonNull
String
venueID
)
{
this
.
venueID
=
venueID
;
this
.
venueID
=
venueID
;
this
.
venueName
=
venueName
;
this
.
venueShortName
=
venueShortName
;
this
.
venueDescripion
=
venueDescripion
;
this
.
venueParentId
=
venueParentId
;
this
.
venueParentRelation
=
venueParentRelation
;
this
.
venueGroupId
=
venueGroupId
;
this
.
venuePixelX
=
venuePixelX
;
this
.
venuePixelY
=
venuePixelY
;
this
.
venueReusable
=
venueReusable
;
this
.
venueLatitude
=
venueLatitude
;
this
.
venueLongitude
=
venueLongitude
;
}
}
public
String
getVenueID
()
{
public
String
getVenueID
()
{
...
...
app/src/main/java/app/insti/fragment/BodyFragment.java
View file @
f98ae2cb
...
@@ -50,7 +50,7 @@ import retrofit2.Response;
...
@@ -50,7 +50,7 @@ import retrofit2.Response;
* create an instance of this fragment.
* create an instance of this fragment.
*/
*/
public
class
BodyFragment
extends
BackHandledFragment
implements
TransitionTargetFragment
{
public
class
BodyFragment
extends
BackHandledFragment
implements
TransitionTargetFragment
{
String
TAG
=
"BodyFragment"
;
public
final
String
TAG
=
"BodyFragment"
;
private
Body
min_body
;
private
Body
min_body
;
private
SwipeRefreshLayout
bodySwipeRefreshLayout
;
private
SwipeRefreshLayout
bodySwipeRefreshLayout
;
...
...
app/src/main/java/app/insti/fragment/BodyRecyclerViewFragment.java
View file @
f98ae2cb
...
@@ -30,9 +30,6 @@ public class BodyRecyclerViewFragment extends Fragment implements TransitionTarg
...
@@ -30,9 +30,6 @@ public class BodyRecyclerViewFragment extends Fragment implements TransitionTarg
public
static
final
String
TAG
=
"BodyRecyclerViewFragment"
;
public
static
final
String
TAG
=
"BodyRecyclerViewFragment"
;
public
Fragment
parentFragment
=
null
;
public
Fragment
parentFragment
=
null
;
private
RecyclerView
recyclerView
;
private
BodyAdapter
bodyAdapter
;
private
List
<
Body
>
bodyList
;
private
List
<
Body
>
bodyList
;
public
BodyRecyclerViewFragment
()
{
public
BodyRecyclerViewFragment
()
{
...
@@ -74,8 +71,8 @@ public class BodyRecyclerViewFragment extends Fragment implements TransitionTarg
...
@@ -74,8 +71,8 @@ public class BodyRecyclerViewFragment extends Fragment implements TransitionTarg
public
void
onStart
()
{
public
void
onStart
()
{
super
.
onStart
();
super
.
onStart
();
recyclerView
=
(
RecyclerView
)
getActivity
().
findViewById
(
R
.
id
.
body_recycler_view
);
RecyclerView
recyclerView
=
(
RecyclerView
)
getActivity
().
findViewById
(
R
.
id
.
body_recycler_view
);
bodyAdapter
=
new
BodyAdapter
(
bodyList
,
this
);
BodyAdapter
bodyAdapter
=
new
BodyAdapter
(
bodyList
,
this
);
bodyAdapter
.
uid
=
"BRVFrag"
;
bodyAdapter
.
uid
=
"BRVFrag"
;
recyclerView
.
setAdapter
(
bodyAdapter
);
recyclerView
.
setAdapter
(
bodyAdapter
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
...
...
app/src/main/java/app/insti/fragment/CalendarFragment.java
View file @
f98ae2cb
...
@@ -60,7 +60,7 @@ import static android.view.View.VISIBLE;
...
@@ -60,7 +60,7 @@ import static android.view.View.VISIBLE;
*/
*/
public
class
CalendarFragment
extends
BaseFragment
{
public
class
CalendarFragment
extends
BaseFragment
{
FloatingActionButton
fab
;
private
FloatingActionButton
fab
;
private
View
view
;
private
View
view
;
private
FeedAdapter
feedAdapter
=
null
;
private
FeedAdapter
feedAdapter
=
null
;
private
List
<
Event
>
events
=
new
ArrayList
<>();
private
List
<
Event
>
events
=
new
ArrayList
<>();
...
...
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
f98ae2cb
...
@@ -352,7 +352,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
...
@@ -352,7 +352,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
}
}
/** Setup button colors depending on status */
/** Setup button colors depending on status */
void
setFollowButtons
(
int
status
)
{
private
void
setFollowButtons
(
int
status
)
{
// Set colors
// Set colors
Utils
.
setupFollowButton
(
getContext
(),
interestedButton
,
status
==
Constants
.
STATUS_INTERESTED
);
Utils
.
setupFollowButton
(
getContext
(),
interestedButton
,
status
==
Constants
.
STATUS_INTERESTED
);
Utils
.
setupFollowButton
(
getContext
(),
goingButton
,
status
==
Constants
.
STATUS_GOING
);
Utils
.
setupFollowButton
(
getContext
(),
goingButton
,
status
==
Constants
.
STATUS_GOING
);
...
@@ -362,7 +362,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
...
@@ -362,7 +362,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
goingButton
.
setText
(
getCountBadgeSpannable
(
"GOING"
,
event
.
getEventGoingCount
()));
goingButton
.
setText
(
getCountBadgeSpannable
(
"GOING"
,
event
.
getEventGoingCount
()));
}
}
View
.
OnClickListener
getUESOnClickListener
(
final
int
status
)
{
private
View
.
OnClickListener
getUESOnClickListener
(
final
int
status
)
{
return
new
View
.
OnClickListener
()
{
return
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
...
...
app/src/main/java/app/insti/fragment/EventRecyclerViewFragment.java
View file @
f98ae2cb
...
@@ -29,9 +29,6 @@ public class EventRecyclerViewFragment extends Fragment implements TransitionTar
...
@@ -29,9 +29,6 @@ public class EventRecyclerViewFragment extends Fragment implements TransitionTar
private
static
final
String
TAG
=
"EventRecyclerViewFragment"
;
private
static
final
String
TAG
=
"EventRecyclerViewFragment"
;
public
Fragment
parentFragment
=
null
;
public
Fragment
parentFragment
=
null
;
private
RecyclerView
recyclerView
;
private
FeedAdapter
feedAdapter
;
private
List
<
Event
>
eventList
;
private
List
<
Event
>
eventList
;
public
EventRecyclerViewFragment
()
{
public
EventRecyclerViewFragment
()
{
...
@@ -72,8 +69,8 @@ public class EventRecyclerViewFragment extends Fragment implements TransitionTar
...
@@ -72,8 +69,8 @@ public class EventRecyclerViewFragment extends Fragment implements TransitionTar
public
void
onStart
()
{
public
void
onStart
()
{
super
.
onStart
();
super
.
onStart
();
recyclerView
=
(
RecyclerView
)
getActivity
().
findViewById
(
R
.
id
.
event_recycler_view
);
RecyclerView
recyclerView
=
getActivity
().
findViewById
(
R
.
id
.
event_recycler_view
);
feedAdapter
=
new
FeedAdapter
(
eventList
,
this
);
FeedAdapter
feedAdapter
=
new
FeedAdapter
(
eventList
,
this
);
recyclerView
.
setAdapter
(
feedAdapter
);
recyclerView
.
setAdapter
(
feedAdapter
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
f98ae2cb
...
@@ -282,7 +282,7 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -282,7 +282,7 @@ public class MapFragment extends Fragment implements TextWatcher,
});
});
}
}
void
setupWithData
(
List
<
Venue
>
venues
)
{
private
void
setupWithData
(
List
<
Venue
>
venues
)
{
if
(
getActivity
()
==
null
||
getView
()
==
null
||
getContext
()
==
null
)
return
;
if
(
getActivity
()
==
null
||
getView
()
==
null
||
getContext
()
==
null
)
return
;
// Setup fade animation for background
// Setup fade animation for background
...
@@ -502,7 +502,6 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -502,7 +502,6 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
@Override
public
void
onTextChanged
(
CharSequence
arg0
,
int
arg1
,
int
arg2
,
int
arg3
)
{
public
void
onTextChanged
(
CharSequence
arg0
,
int
arg1
,
int
arg2
,
int
arg3
)
{
this
.
setCorrectIcons
();
}
}
@Override
@Override
...
@@ -536,7 +535,6 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -536,7 +535,6 @@ public class MapFragment extends Fragment implements TextWatcher,
fragmentManager
.
popBackStack
(
firstStackTag
,
fragmentManager
.
popBackStack
(
firstStackTag
,
FragmentManager
.
POP_BACK_STACK_INCLUSIVE
);
FragmentManager
.
POP_BACK_STACK_INCLUSIVE
);
this
.
removeEditTextFocus
(
null
);
this
.
removeEditTextFocus
(
null
);
this
.
setCorrectIcons
();
this
.
displayMap
();
this
.
displayMap
();
}
}
...
@@ -898,23 +896,6 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -898,23 +896,6 @@ public class MapFragment extends Fragment implements TextWatcher,
}
}
}
}
private
void
setCorrectIcons
()
{
if
(
noFragments
)
{
if
(
this
.
handleRemoveIcon
())
{
this
.
noIndexButton
();
}
}
else
{
if
(
fragment
instanceof
ListFragment
)
{
if
(
this
.
handleRemoveIcon
())
{
this
.
noIndexButton
();
}
}
}
}
private
void
noIndexButton
()
{
}
private
boolean
handleRemoveIcon
()
{
private
boolean
handleRemoveIcon
()
{
String
text
=
editText
.
getText
().
toString
();
String
text
=
editText
.
getText
().
toString
();
return
!
text
.
isEmpty
();
return
!
text
.
isEmpty
();
...
@@ -932,7 +913,6 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -932,7 +913,6 @@ public class MapFragment extends Fragment implements TextWatcher,
}
else
{
}
else
{
fragmentContainer
.
setOnTouchListener
(
null
);
fragmentContainer
.
setOnTouchListener
(
null
);
}
}
this
.
setCorrectIcons
();
}
}
private
void
hideKeyboard
()
{
private
void
hideKeyboard
()
{
...
@@ -953,10 +933,8 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -953,10 +933,8 @@ public class MapFragment extends Fragment implements TextWatcher,
}
}
public
void
playAnimSound
(
int
sound_index
)
{
public
void
playAnimSound
(
int
sound_index
)
{
if
(
sound_index
>=
0
&&
sound_index
<
soundPoolIds
.
length
)
{
if
((
sound_index
>=
0
&&
sound_index
<
soundPoolIds
.
length
)
&&
!
settingsManager
.
isMuted
())
{
if
(!
settingsManager
.
isMuted
())
{
soundPool
.
play
(
soundPoolIds
[
sound_index
],
1.0f
,
1.0f
,
1
,
0
,
1
f
);
soundPool
.
play
(
soundPoolIds
[
sound_index
],
1.0f
,
1.0f
,
1
,
0
,
1
f
);
}
}
}
}
}
...
...
app/src/main/java/app/insti/fragment/MessMenuFragment.java
View file @
f98ae2cb
...
@@ -40,7 +40,6 @@ public class MessMenuFragment extends BaseFragment {
...
@@ -40,7 +40,6 @@ public class MessMenuFragment extends BaseFragment {
private
MessMenuAdapter
messMenuAdapter
;
private
MessMenuAdapter
messMenuAdapter
;
private
RecyclerView
messMenuRecyclerView
;
private
RecyclerView
messMenuRecyclerView
;
private
SwipeRefreshLayout
messMenuSwipeRefreshLayout
;
private
SwipeRefreshLayout
messMenuSwipeRefreshLayout
;
private
Spinner
hostelSpinner
;
private
String
hostel
;
private
String
hostel
;
public
MessMenuFragment
()
{
public
MessMenuFragment
()
{
...
@@ -74,7 +73,7 @@ public class MessMenuFragment extends BaseFragment {
...
@@ -74,7 +73,7 @@ public class MessMenuFragment extends BaseFragment {
}
}
});
});
hostelSpinner
=
getActivity
().
findViewById
(
R
.
id
.
hostel_spinner
);
Spinner
hostelSpinner
=
getActivity
().
findViewById
(
R
.
id
.
hostel_spinner
);
ArrayAdapter
<
CharSequence
>
adapter
=
ArrayAdapter
.
createFromResource
(
getContext
(),
R
.
array
.
hostels_array
,
R
.
layout
.
hostel_spinner_item
);
ArrayAdapter
<
CharSequence
>
adapter
=
ArrayAdapter
.
createFromResource
(
getContext
(),
R
.
array
.
hostels_array
,
R
.
layout
.
hostel_spinner_item
);
adapter
.
setDropDownViewResource
(
android
.
R
.
layout
.
simple_spinner_dropdown_item
);
adapter
.
setDropDownViewResource
(
android
.
R
.
layout
.
simple_spinner_dropdown_item
);
hostelSpinner
.
setAdapter
(
adapter
);
hostelSpinner
.
setAdapter
(
adapter
);
...
...
app/src/main/java/app/insti/fragment/RoleRecyclerViewFragment.java
View file @
f98ae2cb
...
@@ -24,7 +24,7 @@ import app.insti.api.model.Role;
...
@@ -24,7 +24,7 @@ import app.insti.api.model.Role;
* create an instance of this fragment.
* create an instance of this fragment.
*/
*/
public
class
RoleRecyclerViewFragment
extends
Fragment
implements
TransitionTargetFragment
,
TransitionTargetChild
{
public
class
RoleRecyclerViewFragment
extends
Fragment
implements
TransitionTargetFragment
,
TransitionTargetChild
{
p
rivate
static
final
String
TAG
=
"RoleRecyclerViewFragment"
;
p
ublic
static
final
String
TAG
=
"RoleRecyclerViewFragment"
;
public
Fragment
parentFragment
=
null
;
public
Fragment
parentFragment
=
null
;
private
List
<
Role
>
roleList
;
private
List
<
Role
>
roleList
;
...
...
app/src/main/java/com/mrane/campusmap/FuzzySearchAdapter.java
View file @
f98ae2cb
...
@@ -24,8 +24,8 @@ import app.insti.fragment.MapFragment;
...
@@ -24,8 +24,8 @@ import app.insti.fragment.MapFragment;
public
class
FuzzySearchAdapter
extends
BaseAdapter
{
public
class
FuzzySearchAdapter
extends
BaseAdapter
{
Context
mContext
;
private
Context
mContext
;
LayoutInflater
inflater
;
private
LayoutInflater
inflater
;
private
List
<
Marker
>
resultlist
=
null
;
private
List
<
Marker
>
resultlist
=
null
;
private
ArrayList
<
Marker
>
inputlist
;
private
ArrayList
<
Marker
>
inputlist
;
private
List
<
ScoredMarker
>
map
;
private
List
<
ScoredMarker
>
map
;
...
...
app/src/main/java/com/mrane/campusmap/ListFragment.java
View file @
f98ae2cb
...
@@ -7,29 +7,21 @@ import android.view.View;
...
@@ -7,29 +7,21 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ListView
;
import
android.widget.ListView
;
import
com.mrane.data.Marker
;
import
java.util.HashMap
;
import
app.insti.R
;
import
app.insti.R
;
import
app.insti.fragment.MapFragment
;
import
app.insti.fragment.MapFragment
;
public
class
ListFragment
extends
Fragment
{
public
class
ListFragment
extends
Fragment
{
MapFragment
mainActivity
;
View
rootView
;
ListView
list
;
public
ListFragment
()
{
public
ListFragment
()
{
}
}
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
Bundle
savedInstanceState
)
{
mainActivity
=
MapFragment
.
getMainActivity
();
MapFragment
mainActivity
=
MapFragment
.
getMainActivity
();
final
FuzzySearchAdapter
adapter
=
mainActivity
.
getAdapter
();
final
FuzzySearchAdapter
adapter
=
mainActivity
.
getAdapter
();
rootView
=
inflater
.
inflate
(
R
.
layout
.
map_list_fragment
,
container
,
false
);
View
rootView
=
inflater
.
inflate
(
R
.
layout
.
map_list_fragment
,
container
,
false
);
list
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
suggestion_list
);
ListView
list
=
rootView
.
findViewById
(
R
.
id
.
suggestion_list
);
list
.
setAdapter
(
adapter
);
list
.
setAdapter
(
adapter
);
list
.
setOnItemClickListener
(
mainActivity
);
list
.
setOnItemClickListener
(
mainActivity
);
list
.
setOnTouchListener
(
mainActivity
);
list
.
setOnTouchListener
(
mainActivity
);
...
...
app/src/test/java/app/insti/ExampleUnitTest.java
deleted
100644 → 0
View file @
3449c40a
package
app.insti
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public
class
ExampleUnitTest
{
@Test
public
void
addition_isCorrect
()
throws
Exception
{
assertEquals
(
4
,
2
+
2
);
}
}
\ No newline at end of file
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