Chuyển đến nội dung chính

Bài đăng

Using BottomSheetDialogFragment with Material Design Guideline

https://medium.com/@kosta.palash/using-bottomsheetdialogfragment-with-material-design-guideline-f9814c39b9fc As per the material design guideline for BottomSheet, there are two types of BottomSheets: Modal bottom sheets : It Can be implemented using BottomSheetDialog or BottomSheetDialogFragment. Elevation is higher than the app. It is fundamentally acting as the dialog. Persistent bottom sheets : It can be implemented using  BottomSheetBehavior  in conjunction with a  CoordinatorLayout . Links:  https://material.io/guidelines/components/bottom-sheets.html#bottom-sheets-modal-bottom-sheets https://material.io/components/android/catalog/bottom-sheet-dialog-fragment/ In this article, we are going to learn how to implement the BottomSheetDialogFragment to use the bottom sheet as a modal dialog. Final Outcome: So lets get started… Step 1: Create the layout file for bottom sheet (consider the material design guideline while building the gu...

Google Maps Android Custom Info Window Example

https://www.zoftino.com/google-maps-android-custom-info-window-example You can display information about a location where you add a marker on the Google map by customizing info window. This post shows how to define custom info window layout and custom info window adapter and use it to display customized info window on the Google map. You can read my previous tutorial about  Google maps android API  to know how to use Google play service API in android applications and view Google maps android API examples. Before you continue with this example, you may want to learn android and latest features with examples. Please visit  android tutorials  for all android concepts, components and libraries with examples which use latest components and API. Google Maps Android Custom Info Window Example Output Google Maps Android Custom Info Window Example To create custom info window, first you need to define layout for info window with elements such as image and text...

Cách chuyển đổi kiểu String có dấu "." sang kiểu LatLng

NumberFormat nf = NumberFormat. getInstance () ; double lat = 0 ; double lng = 0 ; try { lat = nf.parse(bienQuangCao.getBqc_latitude()).doubleValue() ; lng = nf.parse(bienQuangCao.getBqc_longtidue()).doubleValue() ; makerOptions.position( new LatLng(lat , lng)) ; mMap .addMarker(makerOptions) ; } catch (ParseException e) { e.printStackTrace() ; }

Parse JSON array response using Retrofit & Gson

@FormUrlEncoded @POST ( "api/sponsors" ) Call < List < SponsorsResult >> getStatesAndDistrict ( @Field ( "xyz" ) String field1 ); Call < List < SponsorsResult >> call = service . getSponsorsValue (); call . enqueue ( new Callback < List < SponsorsResult >>() { @Override public void onResponse ( Call < List < SponsorsResult >> call , Response < List < SponsorsResult >> response ) { List < SponsorsResult > rs = response . body (); } @Override public void onFailure ( Call < List < SponsorsResult >> call , Throwable t ) { } }); class SponsorsResult { @SerializedName ( "sponsors" ) private List < SponsorsValue > sponsors ; public List < SponsorsValue > getSponsors () { return sponsors ; } } ...