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
979e0461
Commit
979e0461
authored
Aug 19, 2018
by
Sajal Narang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make email ID and phone number clickable
parent
98756e42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
app/src/main/java/app/insti/fragment/ProfileFragment.java
app/src/main/java/app/insti/fragment/ProfileFragment.java
+39
-2
No files found.
app/src/main/java/app/insti/fragment/ProfileFragment.java
View file @
979e0461
...
@@ -5,9 +5,11 @@ import android.animation.Animator;
...
@@ -5,9 +5,11 @@ import android.animation.Animator;
import
android.animation.AnimatorListenerAdapter
;
import
android.animation.AnimatorListenerAdapter
;
import
android.animation.AnimatorSet
;
import
android.animation.AnimatorSet
;
import
android.animation.ObjectAnimator
;
import
android.animation.ObjectAnimator
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.Point
;
import
android.graphics.Point
;
import
android.graphics.Rect
;
import
android.graphics.Rect
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.design.widget.TabLayout
;
import
android.support.design.widget.TabLayout
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
...
@@ -122,7 +124,7 @@ public class ProfileFragment extends BackHandledFragment {
...
@@ -122,7 +124,7 @@ public class ProfileFragment extends BackHandledFragment {
userProfilePictureImageView
=
getActivity
().
findViewById
(
R
.
id
.
user_profile_picture_profile
);
userProfilePictureImageView
=
getActivity
().
findViewById
(
R
.
id
.
user_profile_picture_profile
);
TextView
userNameTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_name_profile
);
TextView
userNameTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_name_profile
);
TextView
userRollNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_rollno_profile
);
TextView
userRollNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_rollno_profile
);
TextView
userEmailIDTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_email_profile
);
final
TextView
userEmailIDTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_email_profile
);
TextView
userContactNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_contact_no_profile
);
TextView
userContactNumberTextView
=
getActivity
().
findViewById
(
R
.
id
.
user_contact_no_profile
);
/* Show tabs */
/* Show tabs */
...
@@ -186,12 +188,47 @@ public class ProfileFragment extends BackHandledFragment {
...
@@ -186,12 +188,47 @@ public class ProfileFragment extends BackHandledFragment {
tabLayout
.
setupWithViewPager
(
viewPager
);
tabLayout
.
setupWithViewPager
(
viewPager
);
userNameTextView
.
setText
(
user
.
getUserName
());
userNameTextView
.
setText
(
user
.
getUserName
());
userRollNumberTextView
.
setText
(
user
.
getUserRollNumber
());
userRollNumberTextView
.
setText
(
user
.
getUserRollNumber
());
userEmailIDTextView
.
setText
(
user
.
getUserEmail
());
if
(!
user
.
getUserEmail
().
equals
(
"N/A"
))
{
userEmailIDTextView
.
setText
(
user
.
getUserEmail
());
}
else
{
userEmailIDTextView
.
setText
(
user
.
getUserRollNumber
()
+
"@iitb.ac.in"
);
}
userContactNumberTextView
.
setText
(
user
.
getUserContactNumber
());
userContactNumberTextView
.
setText
(
user
.
getUserContactNumber
());
userEmailIDTextView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
mail
((
String
)
userEmailIDTextView
.
getText
());
}
});
if
(
user
.
getUserContactNumber
()
!=
null
)
{
userContactNumberTextView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
call
(
user
.
getUserContactNumber
());
}
});
}
getActivity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
getActivity
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
}
}
private
void
call
(
String
contactNumber
)
{
String
uri
=
"tel:"
+
contactNumber
;
Intent
intent
=
new
Intent
(
Intent
.
ACTION_DIAL
);
intent
.
setData
(
Uri
.
parse
(
uri
));
startActivity
(
Intent
.
createChooser
(
intent
,
"PLace a Call"
));
}
private
void
mail
(
String
email
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_SENDTO
);
intent
.
setData
(
Uri
.
parse
(
"mailto:"
));
intent
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
email
);
intent
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"Let's have Coffee!"
);
startActivity
(
Intent
.
createChooser
(
intent
,
"Send Email"
));
}
private
void
zoomOut
(
final
ImageView
expandedImageView
,
Rect
startBounds
,
float
startScaleFinal
,
final
View
thumbView
)
{
private
void
zoomOut
(
final
ImageView
expandedImageView
,
Rect
startBounds
,
float
startScaleFinal
,
final
View
thumbView
)
{
expandedImageView
.
setBackgroundColor
(
0x00000000
);
expandedImageView
.
setBackgroundColor
(
0x00000000
);
if
(
mCurrentAnimator
!=
null
)
{
if
(
mCurrentAnimator
!=
null
)
{
...
...
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