class CubeTransformer : ViewPager.PageTransformer {
override fun transformPage(view: View, position: Float) {
val deltaY = 0.5F
view.pivotX = if (position < 0F) view.width.toFloat() else 0F
view.pivotY = view.height * deltaY
view.rotationY = 45F * position
fun sendCurrentUserEmailVerification(completion: ((user: FirebaseUser?, error: Exception?) -> Unit)) {
val currentUser = this.authFireBase.currentUser
if (currentUser != null) {
currentUser.sendEmailVerification()
.addOnCompleteListener { task ->
if (task.isSuccessful) {
open class Photo(val url: String)
fun Activity.getGalleryImages(): ArrayList<Photo> {
val galleryImageUrls: ArrayList<GalleryPickerFragment.Photo> = ArrayList()
val columns = arrayOf(MediaStore.Images.Media.DATA, MediaStore.Images.Media._ID)
val orderBy = MediaStore.Images.Media.DATE_TAKEN
class AuthRegistrationTest {
sealed class AuthRegistrationState: FSMState {
object Presenting : AuthRegistrationState()
object Registering : AuthRegistrationState()
class Failed(var error: Error) : AuthRegistrationState()
class Completed(var user: User?) : AuthRegistrationState()
}
@Serializer(forClass = DateSerializer::class)
object DateSerializer : KSerializer<Date> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor(DateSerializer.javaClass.simpleName, PrimitiveKind.STRING)
override fun serialize(encoder: Encoder, value: Date) {
JSON that conform to the structure of https://jsonapi.org/. Flattening the JSON to able to deserialize into Kotlin objects later on.
data_post.json
{
"data": [
{
OlderNewer