Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SEProject
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kishore Kumar
SEProject
Commits
c8804fa4
Commit
c8804fa4
authored
8 years ago
by
melvinabraham
Browse files
Options
Downloads
Patches
Plain Diff
Added Field for adding the complaint and linked with Mail API
parent
c218a861
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/com/mapps/seproject/UserActivity.java
+35
-6
35 additions, 6 deletions
app/src/main/java/com/mapps/seproject/UserActivity.java
app/src/main/res/layout/activity_user.xml
+25
-6
25 additions, 6 deletions
app/src/main/res/layout/activity_user.xml
with
60 additions
and
12 deletions
app/src/main/java/com/mapps/seproject/UserActivity.java
+
35
−
6
View file @
c8804fa4
...
@@ -23,15 +23,23 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -23,15 +23,23 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
Button
bComposeMail
;
Button
bComposeMail
;
TextView
welcome
;
TextView
welcome
;
Spinner
dropdown
;
Spinner
dropdown
;
TextView
emailText
;
int
flag
=
0
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_user
);
setContentView
(
R
.
layout
.
activity_user
);
welcome
=
(
TextView
)
findViewById
(
R
.
id
.
tvWelcome
);
welcome
=
(
TextView
)
findViewById
(
R
.
id
.
tvWelcome
);
bSignOut
=
(
Button
)
findViewById
(
R
.
id
.
bSignOut
);
bSignOut
=
(
Button
)
findViewById
(
R
.
id
.
bSignOut
);
bComposeMail
=
(
Button
)
findViewById
(
R
.
id
.
bComposeMail
);
bComposeMail
=
(
Button
)
findViewById
(
R
.
id
.
bComposeMail
);
emailText
=
(
TextView
)
findViewById
(
R
.
id
.
tvEmailMessage
);
firebaseAuth
=
FirebaseAuth
.
getInstance
();
firebaseAuth
=
FirebaseAuth
.
getInstance
();
...
@@ -44,7 +52,7 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -44,7 +52,7 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
}
}
FirebaseUser
user
=
firebaseAuth
.
getCurrentUser
();
// Get user
FirebaseUser
user
=
firebaseAuth
.
getCurrentUser
();
// Get user
welcome
.
setText
(
"Welcome "
+
user
.
getEmail
());
// Get Email
x
welcome
.
setText
(
"Welcome "
+
user
.
getEmail
());
// Get Email
dropdown
=
(
Spinner
)
findViewById
(
R
.
id
.
spSelectCitiy
);
dropdown
=
(
Spinner
)
findViewById
(
R
.
id
.
spSelectCitiy
);
String
[]
items
=
new
String
[]{
"Coimbatore"
,
"Chennai"
};
String
[]
items
=
new
String
[]{
"Coimbatore"
,
"Chennai"
};
...
@@ -54,6 +62,8 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -54,6 +62,8 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
bSignOut
.
setOnClickListener
(
this
);
// Start listener on Button
bSignOut
.
setOnClickListener
(
this
);
// Start listener on Button
bComposeMail
.
setOnClickListener
(
this
);
bComposeMail
.
setOnClickListener
(
this
);
dropdown
.
setOnItemSelectedListener
(
new
AdapterView
.
OnItemSelectedListener
()
{
dropdown
.
setOnItemSelectedListener
(
new
AdapterView
.
OnItemSelectedListener
()
{
...
@@ -65,11 +75,13 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -65,11 +75,13 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
case
0
:
case
0
:
// setCityCoimbatore();
// setCityCoimbatore();
Log
.
i
(
"City: "
,
"Coimbatore"
);
Log
.
i
(
"City: "
,
"Coimbatore"
);
flag
=
0
;
break
;
break
;
case
1
:
case
1
:
// setCityChennai();
// setCityChennai();
Log
.
i
(
"City:"
,
"Chennai"
);
Log
.
i
(
"City:"
,
"Chennai"
);
flag
=
1
;
break
;
break
;
}
}
...
@@ -90,16 +102,33 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -90,16 +102,33 @@ public class UserActivity extends AppCompatActivity implements View.OnClickListe
public
void
composeEmail
()
{
public
void
composeEmail
()
{
Log
.
i
(
"Sending Email"
,
""
);
Log
.
i
(
"Sending Email"
,
""
);
String
[]
TO
=
{
""
};
String
[]
TO
;
if
(
flag
==
0
)
{
TO
=
new
String
[]{
"commr.coimbatore@tn.gov.in"
};
}
else
{
TO
=
new
String
[]{
"mayor@chennaicorporation.gov.in"
};
}
String
[]
CC
=
{
""
};
String
[]
CC
=
{
""
};
String
mailText
=
emailText
.
getText
().
toString
();
Intent
emailIntent
=
new
Intent
(
Intent
.
ACTION_SEND
);
Intent
emailIntent
=
new
Intent
(
Intent
.
ACTION_SEND
);
emailIntent
.
setData
(
Uri
.
parse
(
"mailto"
));
emailIntent
.
setData
(
Uri
.
parse
(
"mailto"
));
emailIntent
.
setType
(
"text/plain"
);
emailIntent
.
setType
(
"text/plain"
);
emailIntent
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
TO
);
emailIntent
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
TO
);
emailIntent
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"Your Subject"
);
if
(
flag
==
0
)
{
emailIntent
.
putExtra
(
Intent
.
EXTRA_TEXT
,
"Type your text here"
);
emailIntent
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"Regarding cleanliness in Coimbatore"
);
}
else
{
emailIntent
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"Regarding cleanliness in Chennai"
);
}
emailIntent
.
putExtra
(
Intent
.
EXTRA_TEXT
,
mailText
);
try
{
try
{
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_user.xml
+
25
−
6
View file @
c8804fa4
...
@@ -26,6 +26,23 @@
...
@@ -26,6 +26,23 @@
android:layout_alignParentTop=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
/>
android:layout_alignParentEnd=
"true"
/>
<Spinner
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/spSelectCitiy"
android:layout_marginTop=
"31dp"
android:layout_below=
"@+id/bSignOut"
android:layout_alignParentStart=
"true"
/>
<Button
android:text=
"Add Image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/bAddImage"
android:layout_above=
"@+id/bComposeMail"
android:layout_alignEnd=
"@+id/bComposeMail"
android:layout_alignStart=
"@+id/bComposeMail"
/>
<Button
<Button
android:text=
"Compose Email"
android:text=
"Compose Email"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -34,12 +51,14 @@
...
@@ -34,12 +51,14 @@
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
/>
android:layout_centerHorizontal=
"true"
/>
<
Spinner
<
EditText
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"250dp"
android:id=
"@+id/spSelectCitiy"
android:inputType=
"textPersonName"
android:layout_marginTop=
"31dp"
android:ems=
"10"
android:layout_below=
"@+id/bSignOut"
android:layout_centerVertical=
"true"
android:layout_alignParentStart=
"true"
/>
android:layout_centerHorizontal=
"true"
android:id=
"@+id/tvEmailMessage"
android:hint=
"Enter your complaint here"
/>
</RelativeLayout>
</RelativeLayout>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment