Simple Horizontal Divider Item Decoration for RecyclerView
mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
getApplicationContext()
));
NOTE: Add item decoration prior to setting the adapter
FullScreenDialog dialog = new FullScreenDialog(); | |
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
dialog.show(ft, FullScreenDialog.TAG); |
MIT License | |
Copyright (c) 2020 Jan Heinrich Reimer | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
apply plugin: 'com.android.application' | |
ext.versionMajor = 1 | |
ext.versionMinor = 2 | |
ext.versionPatch = 3 | |
ext.versionClassifier = null | |
ext.isSnapshot = true | |
ext.minimumSdkVersion = 19 | |
android { |
/* | |
reference link ->https://www.opengeeks.me/2015/08/filechooser-and-android-webview/ | |
https://github.com/OpenGeeksMe/Android-File-Chooser | |
*/ | |
import android.app.Activity; | |
import android.app.ProgressDialog; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.net.Uri; |
import android.content.SharedPreferences | |
import android.os.Bundle | |
import android.os.Parcel | |
inline fun <reified T : Enum<T>> Bundle.getEnum(key: String, default: T) = | |
getInt(key).let { if (it >= 0) enumValues<T>()[it] else default } | |
fun <T : Enum<T>> Bundle.putEnum(key: String, value: T?) = | |
putInt(key, value?.ordinal ?: -1) |
func updateProfileInfo(withImage image: Data? = nil, name: String? = nil, _ callback: ((Error?) -> ())? = nil){ | |
guard let user = Auth.auth().currentUser else { | |
callback?(nil) | |
return | |
} | |
if let image = image{ | |
let profileImgReference = Storage.storage().reference().child("profile_pictures").child("\(user.uid).png") | |
_ = profileImgReference.putData(image, metadata: nil) { (metadata, error) in |
class PeekingLinearLayoutManager : LinearLayoutManager { | |
@Suppress("Unused") | |
@JvmOverloads | |
constructor(context: Context?, @RecyclerView.Orientation orientation: Int = RecyclerView.VERTICAL, reverseLayout: Boolean = false) : super(context, orientation, reverseLayout) | |
@Suppress("Unused") | |
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) | |
override fun generateDefaultLayoutParams() = | |
scaledLayoutParams(super.generateDefaultLayoutParams()) |
/** | |
* Observable manager for saving the [Cart]'s resource information. | |
*/ | |
class CartManager : LiveData<Resource<Cart?>>() { | |
init { | |
value = Success(null) | |
} | |
/** |
/** | |
* Kotlin Extensions for simpler, easier and funw way | |
* of launching of Activities | |
*/ | |
inline fun <reified T : Any> Activity.launchActivity ( | |
requestCode: Int = -1, | |
options: Bundle? = null, | |
noinline init: Intent.() -> Unit = {}) | |
{ |