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
cbc3a595
Commit
cbc3a595
authored
Oct 11, 2018
by
Preetam Ozarde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor Codacy Changes and Tag Categories Added
parent
b3143ebe
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
16 deletions
+33
-16
app/src/main/java/app/insti/adapter/CommentsAdapter.java
app/src/main/java/app/insti/adapter/CommentsAdapter.java
+1
-1
app/src/main/java/app/insti/adapter/UpVotesAdapter.java
app/src/main/java/app/insti/adapter/UpVotesAdapter.java
+1
-1
app/src/main/java/app/insti/adapter/UserAdapter.java
app/src/main/java/app/insti/adapter/UserAdapter.java
+2
-2
app/src/main/java/app/insti/fragment/FileComplaintFragment.java
...c/main/java/app/insti/fragment/FileComplaintFragment.java
+15
-3
app/src/main/java/app/insti/fragment/RelevantComplaintsFragment.java
...n/java/app/insti/fragment/RelevantComplaintsFragment.java
+1
-2
app/src/main/java/app/insti/utils/DateTimeUtil.java
app/src/main/java/app/insti/utils/DateTimeUtil.java
+5
-6
app/src/main/java/app/insti/utils/TagCategories.java
app/src/main/java/app/insti/utils/TagCategories.java
+8
-1
No files found.
app/src/main/java/app/insti/adapter/CommentsAdapter.java
View file @
cbc3a595
...
@@ -72,7 +72,7 @@ public class CommentsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
...
@@ -72,7 +72,7 @@ public class CommentsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
circleImageView
=
itemView
.
findViewById
(
R
.
id
.
circleImageViewUserImage
);
circleImageView
=
itemView
.
findViewById
(
R
.
id
.
circleImageViewUserImage
);
}
}
void
bindHolder
(
final
int
position
)
{
private
void
bindHolder
(
final
int
position
)
{
final
Venter
.
Comment
comment
=
commentList
.
get
(
position
);
final
Venter
.
Comment
comment
=
commentList
.
get
(
position
);
try
{
try
{
...
...
app/src/main/java/app/insti/adapter/UpVotesAdapter.java
View file @
cbc3a595
...
@@ -51,7 +51,7 @@ public class UpVotesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
...
@@ -51,7 +51,7 @@ public class UpVotesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
});
});
}
}
void
bindHolder
(
final
int
position
)
{
private
void
bindHolder
(
final
int
position
)
{
final
User
user
=
userList
.
get
(
position
);
final
User
user
=
userList
.
get
(
position
);
try
{
try
{
...
...
app/src/main/java/app/insti/adapter/UserAdapter.java
View file @
cbc3a595
...
@@ -73,8 +73,8 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
...
@@ -73,8 +73,8 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
}
}
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
TextView
userName
;
private
TextView
userName
;
TextView
role
;
private
TextView
role
;
public
ImageView
image
;
public
ImageView
image
;
public
ViewHolder
(
View
itemView
)
{
public
ViewHolder
(
View
itemView
)
{
...
...
app/src/main/java/app/insti/fragment/FileComplaintFragment.java
View file @
cbc3a595
...
@@ -127,6 +127,7 @@ public class FileComplaintFragment extends Fragment {
...
@@ -127,6 +127,7 @@ public class FileComplaintFragment extends Fragment {
private
CollapsingToolbarLayout
collapsing_toolbar
;
private
CollapsingToolbarLayout
collapsing_toolbar
;
private
LinearLayout
linearLayoutAnalyse
;
private
LinearLayout
linearLayoutAnalyse
;
private
LinearLayout
linearLayoutScrollTags
;
private
LinearLayout
linearLayoutScrollTags
;
private
boolean
userAddedTag
=
false
;
public
static
FileComplaintFragment
getMainActivity
()
{
public
static
FileComplaintFragment
getMainActivity
()
{
return
mainactivity
;
return
mainactivity
;
...
@@ -265,8 +266,10 @@ public class FileComplaintFragment extends Fragment {
...
@@ -265,8 +266,10 @@ public class FileComplaintFragment extends Fragment {
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
//Add Tags
//Add Tags
populateTags
(
editTextTags
.
getText
().
toString
());
userAddedTag
=
true
;
populateTags
(
editTextTags
.
getText
().
toString
(),
userAddedTag
);
editTextTags
.
setText
(
""
);
editTextTags
.
setText
(
""
);
userAddedTag
=
false
;
tagViewPopulate
.
addTags
(
new
ArrayList
<
Tag
>());
tagViewPopulate
.
addTags
(
new
ArrayList
<
Tag
>());
MainActivity
.
hideKeyboard
(
getActivity
());
MainActivity
.
hideKeyboard
(
getActivity
());
linearLayoutScrollTags
.
setVisibility
(
View
.
INVISIBLE
);
linearLayoutScrollTags
.
setVisibility
(
View
.
INVISIBLE
);
...
@@ -354,9 +357,10 @@ public class FileComplaintFragment extends Fragment {
...
@@ -354,9 +357,10 @@ public class FileComplaintFragment extends Fragment {
tagViewPopulate
.
setOnTagClickListener
(
new
TagView
.
OnTagClickListener
()
{
tagViewPopulate
.
setOnTagClickListener
(
new
TagView
.
OnTagClickListener
()
{
@Override
@Override
public
void
onTagClick
(
Tag
tag
,
int
i
)
{
public
void
onTagClick
(
Tag
tag
,
int
i
)
{
userAddedTag
=
false
;
editTextTags
.
setText
(
tag
.
text
);
editTextTags
.
setText
(
tag
.
text
);
editTextTags
.
setSelection
(
tag
.
text
.
length
());
editTextTags
.
setSelection
(
tag
.
text
.
length
());
populateTags
(
editTextTags
.
getText
().
toString
());
populateTags
(
editTextTags
.
getText
().
toString
()
,
userAddedTag
);
editTextTags
.
setText
(
""
);
editTextTags
.
setText
(
""
);
tagViewPopulate
.
addTags
(
new
ArrayList
<
Tag
>());
tagViewPopulate
.
addTags
(
new
ArrayList
<
Tag
>());
MainActivity
.
hideKeyboard
(
getActivity
());
MainActivity
.
hideKeyboard
(
getActivity
());
...
@@ -572,8 +576,9 @@ public class FileComplaintFragment extends Fragment {
...
@@ -572,8 +576,9 @@ public class FileComplaintFragment extends Fragment {
}
}
}
}
private
void
populateTags
(
String
cs
)
{
private
void
populateTags
(
String
cs
,
Boolean
userAddedTag
)
{
if
(!(
cs
.
isEmpty
()))
{
if
(!(
cs
.
isEmpty
()))
{
tagList2
.
add
(
new
ComplaintTag
(
cs
));
tagList2
.
add
(
new
ComplaintTag
(
cs
));
ArrayList
<
Tag
>
tags
=
new
ArrayList
<>();
ArrayList
<
Tag
>
tags
=
new
ArrayList
<>();
Tag
tag
;
Tag
tag
;
...
@@ -584,6 +589,13 @@ public class FileComplaintFragment extends Fragment {
...
@@ -584,6 +589,13 @@ public class FileComplaintFragment extends Fragment {
tags
.
add
(
tag
);
tags
.
add
(
tag
);
}
}
tagView
.
addTags
(
tags
);
tagView
.
addTags
(
tags
);
for
(
int
i
=
0
;
i
<
tagList2
.
size
();
i
++){
if
(
userAddedTag
==
true
){
if
(
tagList2
.
get
(
i
).
getName
()
==
cs
)
tagList2
.
get
(
i
).
setName
(
cs
+
" (U)"
);
}
}
}
else
{
}
else
{
linearLayoutScrollTags
.
setVisibility
(
View
.
INVISIBLE
);
linearLayoutScrollTags
.
setVisibility
(
View
.
INVISIBLE
);
linearLayoutScrollTags
.
setVisibility
(
View
.
GONE
);
linearLayoutScrollTags
.
setVisibility
(
View
.
GONE
);
...
...
app/src/main/java/app/insti/fragment/RelevantComplaintsFragment.java
View file @
cbc3a595
...
@@ -14,7 +14,6 @@ import app.insti.adapter.ComplaintsAdapter;
...
@@ -14,7 +14,6 @@ import app.insti.adapter.ComplaintsAdapter;
public
class
RelevantComplaintsFragment
extends
Fragment
{
public
class
RelevantComplaintsFragment
extends
Fragment
{
private
ComplaintsAdapter
relevantComplaintsAdapter
;
private
SwipeRefreshLayout
swipeContainer
;
private
SwipeRefreshLayout
swipeContainer
;
private
boolean
isCalled
=
false
;
private
boolean
isCalled
=
false
;
private
static
String
sID
,
uID
;
private
static
String
sID
,
uID
;
...
@@ -48,7 +47,7 @@ public class RelevantComplaintsFragment extends Fragment {
...
@@ -48,7 +47,7 @@ public class RelevantComplaintsFragment extends Fragment {
Bundle
savedInstanceState
)
{
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_relevant_complaints
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_relevant_complaints
,
container
,
false
);
RecyclerView
recyclerViewRelevantComplaints
=
(
RecyclerView
)
view
.
findViewById
(
R
.
id
.
recyclerViewRelevantComplaints
);
RecyclerView
recyclerViewRelevantComplaints
=
(
RecyclerView
)
view
.
findViewById
(
R
.
id
.
recyclerViewRelevantComplaints
);
relevantComplaintsAdapter
=
new
ComplaintsAdapter
(
getActivity
(),
sID
,
uID
,
""
);
//Change userProfileUrl to the current user Profile Pic
ComplaintsAdapter
relevantComplaintsAdapter
=
new
ComplaintsAdapter
(
getActivity
(),
sID
,
uID
,
""
);
//Change userProfileUrl to the current user Profile Pic
swipeContainer
=
(
SwipeRefreshLayout
)
view
.
findViewById
(
R
.
id
.
swipeContainer
);
swipeContainer
=
(
SwipeRefreshLayout
)
view
.
findViewById
(
R
.
id
.
swipeContainer
);
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
getActivity
());
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
getActivity
());
...
...
app/src/main/java/app/insti/utils/DateTimeUtil.java
View file @
cbc3a595
...
@@ -16,17 +16,16 @@ public class DateTimeUtil {
...
@@ -16,17 +16,16 @@ public class DateTimeUtil {
long
seconds
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
now
.
getTime
()
-
date
.
getTime
());
long
seconds
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
now
.
getTime
()
-
date
.
getTime
());
long
minutes
=
TimeUnit
.
MILLISECONDS
.
toMinutes
(
now
.
getTime
()
-
date
.
getTime
());
long
minutes
=
TimeUnit
.
MILLISECONDS
.
toMinutes
(
now
.
getTime
()
-
date
.
getTime
());
long
hours
=
TimeUnit
.
MILLISECONDS
.
toHours
(
now
.
getTime
()
-
date
.
getTime
());
long
hours
=
TimeUnit
.
MILLISECONDS
.
toHours
(
now
.
getTime
()
-
date
.
getTime
());
String
time_ago
=
""
;
if
(
seconds
<=
0
)
{
if
(
seconds
<=
0
)
{
return
time_ago
=
"now"
;
return
"now"
;
}
else
if
(
seconds
==
1
){
}
else
if
(
seconds
==
1
){
return
time_ago
=
seconds
+
" second ago"
;
return
seconds
+
" second ago"
;
}
else
if
(
seconds
<
60
&&
seconds
>
1
)
{
}
else
if
(
seconds
<
60
&&
seconds
>
1
)
{
return
time_ago
=
seconds
+
" seconds ago"
;
return
seconds
+
" seconds ago"
;
}
else
if
(
minutes
==
1
)
{
}
else
if
(
minutes
==
1
)
{
return
time_ago
=
minutes
+
" 1 minute ago"
;
return
minutes
+
" 1 minute ago"
;
}
else
if
(
minutes
<
60
&&
minutes
>
1
)
{
}
else
if
(
minutes
<
60
&&
minutes
>
1
)
{
return
time_ago
=
minutes
+
" minutes ago"
;
return
minutes
+
" minutes ago"
;
}
else
if
(
hours
==
1
)
{
}
else
if
(
hours
==
1
)
{
return
hours
+
" hour ago"
;
return
hours
+
" hour ago"
;
}
else
if
(
hours
<
24
&&
hours
>
1
)
{
}
else
if
(
hours
<
24
&&
hours
>
1
)
{
...
...
app/src/main/java/app/insti/utils/TagCategories.java
View file @
cbc3a595
...
@@ -28,6 +28,13 @@ public class TagCategories {
...
@@ -28,6 +28,13 @@ public class TagCategories {
"Fencing issues"
,
"Fencing issues"
,
"Security issues"
,
"Security issues"
,
"Infrastructural defaults in the academic area"
,
"Infrastructural defaults in the academic area"
,
"Cycle pooling issues"
};
"Cycle pooling issues"
,
"Water coolers & Aqua Guards"
,
"Mess menu complaints"
,
"PHO cleaning complaints"
,
"PHO cleaning complaints"
,
"Hostel common room complaints"
,
"Hostel Stationary shop complaints"
};
}
}
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