This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentPhoneCall.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(Intent.ACTION_CALL); | |
String phoneNumber = "1234567890"; | |
intent.setData(Uri.parse("tel:" + phoneNumber)); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { | |
if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, Manifest.permission.READ_CONTACTS)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentCamera.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivityForResult(intent, 1); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentMaps.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
String latitude = "0"; | |
String longitude = "0"; | |
String query = "1600 Amphitheatre Parkway, CA"; | |
String zoomLevel = "10"; | |
Intent intent = new Intent(); | |
intent.setAction(Intent.ACTION_VIEW); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentGooglePlay.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName()); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivity(intent); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentShare.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(Intent.ACTION_SEND); | |
intent.setType("text/plain"); | |
String message = "hey there..."; | |
intent.putExtra(Intent.EXTRA_TEXT, message); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivity(intent.createChooser(intent, "Share Using :")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentEmail.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(Intent.ACTION_SENDTO); | |
intent.setType("text/plain"); | |
intent.setData(Uri.parse("mailto:")); | |
String[] email = new String[]{"[email protected]"}; | |
String subject = "Email Subject"; | |
String text = "Email text"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intentWebsite.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Uri uri = Uri.parse("http://www.google.com"); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
if (intent.resolveActivity(getPackageManager()) != null) { | |
startActivity(intent); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.theappnerds.shubham.floatingbutton; | |
import android.os.Bundle; | |
import android.support.design.widget.FloatingActionButton; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.view.animation.Animation; | |
import android.view.animation.AnimationUtils; | |
import android.widget.TextView; | |
import android.widget.Toast; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:fillAfter="true"> | |
<scale | |
android:duration = "300" | |
android:fromXScale="0.8" | |
android:fromYScale="0.8" | |
android:toXScale="0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> | |
<TextView |