Skip to content

Instantly share code, notes, and snippets.

View DanishAmjad12's full-sized avatar
🎯
Focusing

Danish Amjad DanishAmjad12

🎯
Focusing
View GitHub Profile
android {
....
dataBinding {
enabled = true
}
}
private void onLocationReceived() {
String location = getLocationName(mLocationModel.getLat(), mLocationModel.getLng());
if(location!=null && !location.isEmpty())
//your work
}
private String getLocationName(double lattitude, double longitude) {
String locationStr = "";
Geocoder gcd = new Geocoder(getActivity(), Locale.getDefault());
private void onLocationReceived() {
String location = getLocationName(mLocationModel.getLat(), mLocationModel.getLng());
if(!TextUtils.isEmpty(location))
//your work
}
private String getLocationName(double lattitude, double longitude) {
String locationStr = "";
Geocoder gcd = new Geocoder(getActivity(), Locale.getDefault());
try {
ProjectUtils.setVectorForPreLollipop(Edittext,R.drawable.mic, activity, ApplicationConstants.DRAWABLE_RIGHT);
//region Helper method for PreLollipop TextView & Buttons Vector Images
public static Drawable setVectorForPreLollipop(int resourceId, Context activity) {
Drawable icon;
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
icon = VectorDrawableCompat.create(activity.getResources(), resourceId, activity.getTheme());
} else {
icon = activity.getResources().getDrawable(resourceId, activity.getTheme());
}
return icon;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="horizontal"
tools:context="com.example.daamjad.googleapiclient.MainActivity">
<TextView
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getWindow().setBackgroundDrawable(null);
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="horizontal"
tools:context="com.example.daamjad.googleapiclient.MainActivity">
<TextView
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
<!-- The background color, preferably the same as your normal theme -->
<item android:drawable="@android:color/white"/>
<!-- Your product logo - 144dp color version of your app icon -->
<item>
<bitmap
android:src="@drawable/product_logo_144dp"
android:gravity="center"/>
</item>
</layer-list>
private int SPLASH_TIME = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
Thread timer = new Thread() {
public void run() {
try {