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
37345d4c
Commit
37345d4c
authored
Oct 13, 2018
by
Preetam Ozarde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Toast & rename textview
parent
27a15f55
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
app/src/main/java/app/insti/fragment/FileComplaintFragment.java
...c/main/java/app/insti/fragment/FileComplaintFragment.java
+5
-6
app/src/main/java/app/insti/utils/DateTimeUtil.java
app/src/main/java/app/insti/utils/DateTimeUtil.java
+5
-7
No files found.
app/src/main/java/app/insti/fragment/FileComplaintFragment.java
View file @
37345d4c
...
...
@@ -98,7 +98,7 @@ public class FileComplaintFragment extends Fragment {
private
static
final
String
TAG
=
FileComplaintFragment
.
class
.
getSimpleName
();
private
static
FileComplaintFragment
mainactivity
;
private
Button
buttonSubmit
;
private
CustomAutoCompleteTextView
autoCompleteTextV
iew
;
private
CustomAutoCompleteTextView
descriptionAutoCompleteTextv
iew
;
private
EditText
editTextSuggestions
;
private
EditText
editTextTags
;
private
EditText
editTextLocationDetails
;
...
...
@@ -215,7 +215,7 @@ public class FileComplaintFragment extends Fragment {
}
});
autoCompleteTextV
iew
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
descriptionAutoCompleteTextv
iew
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
@Override
public
void
onFocusChange
(
View
v
,
boolean
hasFocus
)
{
searchComplaint
(
hasFocus
);
...
...
@@ -285,7 +285,7 @@ public class FileComplaintFragment extends Fragment {
editTextSuggestions
=
view
.
findViewById
(
R
.
id
.
editTextSuggestions
);
editTextLocationDetails
=
view
.
findViewById
(
R
.
id
.
editTextLocationDetails
);
editTextTags
=
view
.
findViewById
(
R
.
id
.
editTextTags
);
autoCompleteTextV
iew
=
view
.
findViewById
(
R
.
id
.
dynamicAutoCompleteTextView
);
descriptionAutoCompleteTextv
iew
=
view
.
findViewById
(
R
.
id
.
dynamicAutoCompleteTextView
);
mMapView
=
view
.
findViewById
(
R
.
id
.
google_map
);
tagView
=
view
.
findViewById
(
R
.
id
.
tag_view
);
tagViewPopulate
=
view
.
findViewById
(
R
.
id
.
tag_populate
);
...
...
@@ -298,7 +298,7 @@ public class FileComplaintFragment extends Fragment {
private
void
searchComplaint
(
boolean
hasFocus
)
{
if
(!
hasFocus
)
{
if
(!(
autoCompleteTextV
iew
.
getText
().
toString
().
trim
().
isEmpty
()))
{
if
(!(
descriptionAutoCompleteTextv
iew
.
getText
().
toString
().
trim
().
isEmpty
()))
{
int
paddingDp
=
60
;
float
density
=
getContext
().
getResources
().
getDisplayMetrics
().
density
;
int
paddingPixel
=
(
int
)
(
paddingDp
*
density
);
...
...
@@ -654,7 +654,7 @@ public class FileComplaintFragment extends Fragment {
}
private
void
addComplaint
()
{
final
String
complaint
=
"Complaint: "
+
autoCompleteTextV
iew
.
getText
().
toString
();
final
String
complaint
=
"Complaint: "
+
descriptionAutoCompleteTextv
iew
.
getText
().
toString
();
final
String
suggestion
;
final
String
locationDetails
;
Log
.
i
(
TAG
,
"Suggestion: "
+
editTextSuggestions
.
getText
().
toString
());
...
...
@@ -861,7 +861,6 @@ public class FileComplaintFragment extends Fragment {
viewPager
.
notifyAll
();
}
imageViewPagerAdapter
.
notifyDataSetChanged
();
Toast
.
makeText
(
getContext
(),
"Picture Taken"
,
Toast
.
LENGTH_SHORT
).
show
();
progressDialog
.
dismiss
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
app/src/main/java/app/insti/utils/DateTimeUtil.java
View file @
37345d4c
...
...
@@ -18,16 +18,14 @@ public class DateTimeUtil {
long
hours
=
TimeUnit
.
MILLISECONDS
.
toHours
(
now
.
getTime
()
-
date
.
getTime
());
if
(
seconds
<=
0
)
{
return
"now"
;
}
else
if
(
seconds
==
1
){
return
seconds
+
" second ago"
;
}
else
if
(
seconds
<
60
&&
seconds
>
1
)
{
return
seconds
+
" seconds ago"
;
}
else
if
(
minutes
==
1
)
{
return
minutes
+
" 1 minute ago"
;
return
" 1 minute ago"
;
}
else
if
(
minutes
<
60
&&
minutes
>
1
)
{
return
minutes
+
" minutes ago"
;
}
else
if
(
hours
==
1
)
{
return
hours
+
"
hour ago"
;
return
"an
hour ago"
;
}
else
if
(
hours
<
24
&&
hours
>
1
)
{
return
hours
+
" hours ago"
;
}
else
{
...
...
@@ -37,12 +35,12 @@ public class DateTimeUtil {
else
if
(
days
==
1
)
return
"yesterday"
;
else
if
(
days
==
1
)
return
days
+
"
day ago"
;
return
"a
day ago"
;
else
if
(
days
<
14
)
return
days
+
" days ago"
;
else
if
(
days
<
30
)
if
((
int
)
(
days
/
7
)
==
1
)
return
((
int
)
(
days
/
7
))
+
"
week ago"
;
return
"a
week ago"
;
else
return
((
int
)
(
days
/
7
))
+
" weeks ago"
;
else
if
(
days
<
365
)
...
...
@@ -52,7 +50,7 @@ public class DateTimeUtil {
return
((
int
)
(
days
/
30
))
+
" months ago"
;
else
if
((
int
)
(
days
/
365
)
==
1
)
return
((
int
)
(
days
/
365
))
+
"
year ago"
;
return
"a
year ago"
;
else
return
((
int
)
(
days
/
365
))
+
" years ago"
;
}
...
...
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