This file contains 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
/** | |
* verify google play services on the device | |
* */ | |
private boolean checkPlayServices() { | |
int resultCode = GooglePlayServicesUtil | |
.isGooglePlayServicesAvailable(this); | |
if (resultCode != ConnectionResult.SUCCESS) { | |
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) { | |
GooglePlayServicesUtil.getErrorDialog(resultCode, this, | |
PLAY_SERVICES_RESOLUTION_REQUEST).show(); |
This file contains 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
public void setDrawableFromSVG(ImageView imageView, int resource) { | |
SVG svg = new SVGBuilder() | |
.readFromResource(mContext.getResources(), resource) | |
.build(); | |
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); | |
imageView.setImageDrawable(new PictureDrawable(svg.getPicture())); | |
} |
This file contains 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
private void launchGoogleMaps(Context context, double latitude, | |
double longitude) { | |
try { | |
String format = "geo:0,0?q=" + Double.toString(latitude) + "," | |
+ Double.toString(longitude); | |
Uri uri = Uri.parse(format); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
context.startActivity(intent); |
This file contains 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"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#fde0dc</color> | |
<color name="md_red_100">#f9bdbb</color> | |
<color name="md_red_200">#f69988</color> |
NewerOlder