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"?> | |
<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 |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
getWindow().setBackgroundDrawable(null); | |
} |
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"?> | |
<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 |
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
//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; |
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
ProjectUtils.setVectorForPreLollipop(Edittext,R.drawable.mic, activity, ApplicationConstants.DRAWABLE_RIGHT); |
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
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()); |
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
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 { |
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
private void openDrawerActivity(final Class className) { | |
new Handler().postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
ProjectUtils.genericIntent(NewDrawer.this, className, null, false); | |
} | |
}, 200); | |
} |