mochadwi 2:17 AMPinned
Jump http://chrisjenx.com/gson-empty-json-object-to-null/
buat handle response: { }, [ ]
mochadwi 2:17 AMPinned
Jump http://chrisjenx.com/gson-empty-json-object-to-null/
buat handle response: { }, [ ]
@channel
temen2, ada yang pernah ngalamin gini:
pengen add by index or by item / element, buat list of SingeLiveEvent
val movieList = SingleLiveEvent<MutableList>()
movieListFromApi.forEachIndexed { index, movie -> movieList.value[i] = movie // ini ga bisa diakses
another improved kotlin idiom to handle nullable values:
https://medium.com/@elye.project/using-kotlin-takeif-or-takeunless-c9eeb7099c22
@all
kalo ada yang nemuin error begindrang: Caused by android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment id.gits.jasaraharjainternal.mvvm.santunan.listsantunan.ListSantunanFragment: could not find Fragment constructor
make sure ketika bikin fragment, ga perlu pake default constructor yaaa, dan buat pass / receive data dari luar ke fragment, pake arguments aja yaaa & pake singleton pattern newInstance(data: Int) = TestFragment().withArgs { putInt(ARGUMENT_TYPE, data) }
@all
kalo ada yang nemuin error begindrang: Caused by android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment id.gits.jasaraharjainternal.mvvm.santunan.listsantunan.ListSantunanFragment: could not find Fragment constructor
make sure ketika bikin fragment, ga perlu pake default constructor yaaa, dan buat pass / receive data dari luar ke fragment, pake arguments aja yaaa & pake singleton pattern newInstance(data: Int) = TestFragment().withArgs { putInt(ARGUMENT_TYPE, data) }
private fun bitmapDescriptorFromVector(context: Context, @DrawableRes vectorDrawableResourceId: Int): BitmapDescriptor { val background = ContextCompat.getDrawable(context, R.drawable.ic_marker_address) background.setBounds(0, 0, background.intrinsicWidth, background.intrinsicHeight) val vectorDrawable = ContextCompat.getDrawable(context, vectorDrawableResourceId) vectorDrawable.setBounds(40, 20, vectorDrawable.intrinsicWidth + 40, vectorDrawable.intrinsicHeight + 20) val bitmap = Bitmap.createBitmap(background.intrinsicWidth, background.intrinsicHeight, Bitmap.Config.ARGB_8888) val canvas = Canvas(bitmap) background.draw(canvas) vectorDrawable.draw(canvas) return BitmapDescriptorFactory.fromBitmap(bitmap)
@channel
For current active project, a must have guide
https://developer.android.com/work/guide For future preferences cross-platform
https://github.com/uber/RIBs thanks to @nizarassegaf
http://rabbit.eng.miami.edu/info/htmlchars.html https://stackoverflow.com/a/37152978/3763032 buat escape html entities, and using logic inside xml data binding @aderayanbima31