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
e217fd9a
Commit
e217fd9a
authored
Oct 02, 2018
by
sshivam95
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Venter: clean the changes for merge
parent
346905ff
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
101 deletions
+9
-101
app/src/main/java/app/insti/TagClass.java
app/src/main/java/app/insti/TagClass.java
+5
-24
app/src/main/java/app/insti/adapter/CommentRecyclerViewAdapter.java
...in/java/app/insti/adapter/CommentRecyclerViewAdapter.java
+0
-11
app/src/main/java/app/insti/adapter/ComplaintsRecyclerViewAdapter.java
...java/app/insti/adapter/ComplaintsRecyclerViewAdapter.java
+2
-29
app/src/main/java/app/insti/fragment/DetailedComplaintFragment.java
...in/java/app/insti/fragment/DetailedComplaintFragment.java
+0
-35
app/src/main/java/app/insti/fragment/FileComplaintFragment.java
...c/main/java/app/insti/fragment/FileComplaintFragment.java
+0
-2
app/src/main/res/values/colors.xml
app/src/main/res/values/colors.xml
+2
-0
No files found.
app/src/main/java/app/insti/TagClass.java
View file @
e217fd9a
package
app.insti
;
package
app.insti
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.support.v4.content.ContextCompat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Random
;
import
java.util.Random
;
...
@@ -13,22 +18,6 @@ public class TagClass {
...
@@ -13,22 +18,6 @@ public class TagClass {
public
TagClass
(
String
name
)
{
public
TagClass
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
color
=
getRandomColor
();
}
public
String
getRandomColor
()
{
ArrayList
<
String
>
colors
=
new
ArrayList
<>();
colors
.
add
(
"#ED7D31"
);
colors
.
add
(
"#00B0F0"
);
colors
.
add
(
"#FF0000"
);
colors
.
add
(
"#D0CECE"
);
colors
.
add
(
"#00B050"
);
colors
.
add
(
"#9999FF"
);
colors
.
add
(
"#FF5FC6"
);
colors
.
add
(
"#FFC000"
);
colors
.
add
(
"#7F7F7F"
);
colors
.
add
(
"#4800FF"
);
return
colors
.
get
(
new
Random
().
nextInt
(
colors
.
size
()));
}
}
public
String
getName
()
{
public
String
getName
()
{
...
@@ -38,12 +27,4 @@ public class TagClass {
...
@@ -38,12 +27,4 @@ public class TagClass {
public
void
setName
(
String
name
)
{
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
}
}
public
String
getColor
()
{
return
color
;
}
public
void
setColor
(
String
color
)
{
this
.
color
=
color
;
}
}
}
\ No newline at end of file
app/src/main/java/app/insti/adapter/CommentRecyclerViewAdapter.java
View file @
e217fd9a
...
@@ -90,20 +90,9 @@ public class CommentRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
...
@@ -90,20 +90,9 @@ public class CommentRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
}
try
{
try
{
textViewName
.
setText
(
comment
.
getUser
().
getUserName
());
textViewName
.
setText
(
comment
.
getUser
().
getUserName
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
String
time
=
DateTimeUtil
.
getDate
(
comment
.
getTime
().
toString
());
String
time
=
DateTimeUtil
.
getDate
(
comment
.
getTime
().
toString
());
Log
.
i
(
TAG
,
"time: "
+
time
);
Log
.
i
(
TAG
,
"time: "
+
time
);
Log
.
i
(
TAG
,
"inside try"
);
textViewCommentTime
.
setText
(
time
);
textViewCommentTime
.
setText
(
time
);
}
catch
(
Exception
e
)
{
Log
.
i
(
TAG
,
"Inside catch"
);
e
.
printStackTrace
();
}
try
{
textViewComment
.
setText
(
comment
.
getText
());
textViewComment
.
setText
(
comment
.
getText
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
app/src/main/java/app/insti/adapter/ComplaintsRecyclerViewAdapter.java
View file @
e217fd9a
...
@@ -86,50 +86,23 @@ public class ComplaintsRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
...
@@ -86,50 +86,23 @@ public class ComplaintsRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
Venter
.
Complaint
complaint
=
complaintList
.
get
(
position
);
Venter
.
Complaint
complaint
=
complaintList
.
get
(
position
);
try
{
try
{
textViewDescription
.
setText
(
complaint
.
getDescription
());
textViewDescription
.
setText
(
complaint
.
getDescription
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewLocation
.
setText
(
complaint
.
getLocationDescription
());
textViewLocation
.
setText
(
complaint
.
getLocationDescription
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewUserName
.
setText
(
complaint
.
getComplaintCreatedBy
().
getUserName
());
textViewUserName
.
setText
(
complaint
.
getComplaintCreatedBy
().
getUserName
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewStatus
.
setText
(
complaint
.
getStatus
().
toUpperCase
());
textViewStatus
.
setText
(
complaint
.
getStatus
().
toUpperCase
());
if
(
complaint
.
getStatus
().
equalsIgnoreCase
(
"Reported"
))
{
if
(
complaint
.
getStatus
().
equalsIgnoreCase
(
"Reported"
))
{
textViewStatus
.
setBackgroundColor
(
Color
.
parseColor
(
"#FF0000"
));
textViewStatus
.
setBackgroundColor
(
context
.
getResources
().
getColor
(
R
.
color
.
colorRed
));
textViewStatus
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
primaryTextColor
));
textViewStatus
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
primaryTextColor
));
}
else
if
(
complaint
.
getStatus
().
equalsIgnoreCase
(
"In Progress"
))
{
}
else
if
(
complaint
.
getStatus
().
equalsIgnoreCase
(
"In Progress"
))
{
textViewStatus
.
setBackgroundColor
(
context
.
getResources
().
getColor
(
R
.
color
.
colorSecondary
));
textViewStatus
.
setBackgroundColor
(
context
.
getResources
().
getColor
(
R
.
color
.
colorSecondary
));
textViewStatus
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
secondaryTextColor
));
textViewStatus
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
secondaryTextColor
));
}
else
if
(
complaint
.
getStatus
().
equalsIgnoreCase
(
"Resolved"
))
{
}
else
if
(
complaint
.
getStatus
().
equalsIgnoreCase
(
"Resolved"
))
{
textViewStatus
.
setBackgroundColor
(
Color
.
parseColor
(
"#00FF00"
));
textViewStatus
.
setBackgroundColor
(
context
.
getResources
().
getColor
(
R
.
color
.
colorGreen
));
textViewStatus
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
secondaryTextColor
));
textViewStatus
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
secondaryTextColor
));
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
String
time
=
DateTimeUtil
.
getDate
(
complaint
.
getComplaintReportDate
().
toString
());
String
time
=
DateTimeUtil
.
getDate
(
complaint
.
getComplaintReportDate
().
toString
());
Log
.
i
(
TAG
,
"time: "
+
time
);
Log
.
i
(
TAG
,
"time: "
+
time
);
textViewReportDate
.
setText
(
time
);
textViewReportDate
.
setText
(
time
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
buttonComments
.
setText
(
"COMMENTS("
+
complaint
.
getComment
().
size
()
+
")"
);
buttonComments
.
setText
(
"COMMENTS("
+
complaint
.
getComment
().
size
()
+
")"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
buttonVotes
.
setText
(
"UP VOTES("
+
complaint
.
getUsersUpVoted
().
size
()
+
")"
);
buttonVotes
.
setText
(
"UP VOTES("
+
complaint
.
getUsersUpVoted
().
size
()
+
")"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
app/src/main/java/app/insti/fragment/DetailedComplaintFragment.java
View file @
e217fd9a
...
@@ -175,30 +175,11 @@ public class DetailedComplaintFragment extends Fragment {
...
@@ -175,30 +175,11 @@ public class DetailedComplaintFragment extends Fragment {
private
void
populateViews
()
{
private
void
populateViews
()
{
try
{
try
{
textViewUserName
.
setText
(
detailedComplaint
.
getComplaintCreatedBy
().
getUserName
());
textViewUserName
.
setText
(
detailedComplaint
.
getComplaintCreatedBy
().
getUserName
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
String
time
=
DateTimeUtil
.
getDate
(
detailedComplaint
.
getComplaintReportDate
().
toString
());
String
time
=
DateTimeUtil
.
getDate
(
detailedComplaint
.
getComplaintReportDate
().
toString
());
Log
.
i
(
TAG
,
" time: "
+
time
);
Log
.
i
(
TAG
,
" time: "
+
time
);
Log
.
i
(
TAG
,
"inside try"
);
textViewReportDate
.
setText
(
time
);
textViewReportDate
.
setText
(
time
);
}
catch
(
Exception
e
)
{
Log
.
i
(
TAG
,
"Inside catch"
);
e
.
printStackTrace
();
}
try
{
textViewLocation
.
setText
(
detailedComplaint
.
getLocationDescription
());
textViewLocation
.
setText
(
detailedComplaint
.
getLocationDescription
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewDescription
.
setText
(
detailedComplaint
.
getDescription
());
textViewDescription
.
setText
(
detailedComplaint
.
getDescription
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewStatus
.
setText
(
detailedComplaint
.
getStatus
().
toUpperCase
());
textViewStatus
.
setText
(
detailedComplaint
.
getStatus
().
toUpperCase
());
if
(
detailedComplaint
.
getStatus
().
equalsIgnoreCase
(
"Reported"
))
{
if
(
detailedComplaint
.
getStatus
().
equalsIgnoreCase
(
"Reported"
))
{
textViewStatus
.
setBackgroundColor
(
Color
.
parseColor
(
"#FF0000"
));
textViewStatus
.
setBackgroundColor
(
Color
.
parseColor
(
"#FF0000"
));
...
@@ -210,25 +191,9 @@ public class DetailedComplaintFragment extends Fragment {
...
@@ -210,25 +191,9 @@ public class DetailedComplaintFragment extends Fragment {
textViewStatus
.
setBackgroundColor
(
Color
.
parseColor
(
"#00FF00"
));
textViewStatus
.
setBackgroundColor
(
Color
.
parseColor
(
"#00FF00"
));
textViewStatus
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
secondaryTextColor
));
textViewStatus
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
secondaryTextColor
));
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewCommentLabel
.
setText
(
"COMMENTS"
);
textViewCommentLabel
.
setText
(
"COMMENTS"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
textViewVoteUpLabel
.
setText
(
"UP VOTES"
);
textViewVoteUpLabel
.
setText
(
"UP VOTES"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
addVotesToView
(
detailedComplaint
);
addVotesToView
(
detailedComplaint
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
addCommentsToView
(
detailedComplaint
);
addCommentsToView
(
detailedComplaint
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
app/src/main/java/app/insti/fragment/FileComplaintFragment.java
View file @
e217fd9a
...
@@ -535,7 +535,6 @@ public class FileComplaintFragment extends Fragment {
...
@@ -535,7 +535,6 @@ public class FileComplaintFragment extends Fragment {
for
(
int
i
=
0
;
i
<
tagList2
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
tagList2
.
size
();
i
++)
{
tag
=
new
Tag
(
tagList2
.
get
(
i
).
getName
());
tag
=
new
Tag
(
tagList2
.
get
(
i
).
getName
());
tag
.
radius
=
10
f
;
tag
.
radius
=
10
f
;
tag
.
layoutColor
=
Color
.
parseColor
(
tagList2
.
get
(
i
).
getColor
());
tag
.
isDeletable
=
true
;
tag
.
isDeletable
=
true
;
tags
.
add
(
tag
);
tags
.
add
(
tag
);
}
}
...
@@ -552,7 +551,6 @@ public class FileComplaintFragment extends Fragment {
...
@@ -552,7 +551,6 @@ public class FileComplaintFragment extends Fragment {
tagsLayout
.
setVisibility
(
View
.
VISIBLE
);
tagsLayout
.
setVisibility
(
View
.
VISIBLE
);
tag
=
new
Tag
(
tagList
.
get
(
i
).
getName
());
tag
=
new
Tag
(
tagList
.
get
(
i
).
getName
());
tag
.
radius
=
10
f
;
tag
.
radius
=
10
f
;
tag
.
layoutColor
=
Color
.
parseColor
(
tagList
.
get
(
i
).
getColor
());
tag
.
isDeletable
=
false
;
tag
.
isDeletable
=
false
;
tags
.
add
(
tag
);
tags
.
add
(
tag
);
}
}
...
...
app/src/main/res/values/colors.xml
View file @
e217fd9a
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
<color
name=
"colorGray"
>
#757575
</color>
<color
name=
"colorGray"
>
#757575
</color>
<color
name=
"colorWhite"
>
#FFFFFF
</color>
<color
name=
"colorWhite"
>
#FFFFFF
</color>
<color
name=
"colorRed"
>
#FF0000
</color>
<color
name=
"colorGreen"
>
#00FF00
</color>
<!-- Map -->
<!-- Map -->
<item
name=
"transparent_black"
type=
"color"
>
#20000000
</item>
<item
name=
"transparent_black"
type=
"color"
>
#20000000
</item>
<item
name=
"list_item_gray_even"
type=
"color"
>
#ffe6e6e6
</item>
<item
name=
"list_item_gray_even"
type=
"color"
>
#ffe6e6e6
</item>
...
...
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