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
| meta: | |
| title: The Lost Adventure | |
| description: A magical bedtime story about a curious boy who learns the value of courage and wisdom. | |
| author: Lily | |
| version: 1.1.0 | |
| items: | |
| - id: flashlight | |
| name: Shimmering Lantern | |
| description: A tiny lantern that glows with a soft golden light. Helpful in the dark. |
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
| // ListView applies a tight constraint (minHeight = maxHeight in this case) to its children. | |
| // So all children are forced to have the same height. To let an item to have its own size, | |
| // first, remove constraints by using UnconstrainedBox. | |
| // then, apply new loosen constraints with ConstrainedBox. | |
| // Using only UnconstrainedBox would be sufficient in this specific case, | |
| // but it can cause errors in case the child want to be as big as possible. | |
| // So ConstrainedBox is needed to provide a specific constraints. | |
| ListView( | |
| scrollDirection: Axis.horizontal, |
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
| /** | |
| * Zlib decompress a file and return its contents | |
| * | |
| * @param filePath absolute path to file | |
| * @return unzipped file contents | |
| */ | |
| fun decompress(filePath: String) : String { | |
| val content = File(filePath).readBytes() | |
| val inflater = Inflater() | |
| val outputStream = ByteArrayOutputStream() |
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
| class AuthenticateInterceptor( | |
| private val dataStorage: DataStorage, | |
| private val authService: AuthService | |
| ) : Interceptor { | |
| | |
| override fun intercept(chain: Chain): Response { | |
| val newRequest = buildAuthorizedRequest(chain) | |
| val response = chain.proceed(newRequest) | |
| | |
| return if (response.code == CODE_TOKEN_EXPIRED) { |
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
| /** | |
| * You can edit, run, and share this code. | |
| * play.kotlinlang.org | |
| */ | |
| import kotlinx.coroutines.* | |
| import kotlinx.coroutines.flow.* | |
| import kotlin.system.* | |
| fun test1() { | |
| var time = 0L |
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
| abstract class BaseRecyclerAdapter<Item, ViewBinding : ViewDataBinding>( | |
| callBack: DiffUtil.ItemCallback<Item> | |
| ) : ListAdapter<Item, BaseViewHolder<ViewBinding>>( | |
| AsyncDifferConfig.Builder<Item>(callBack) | |
| .setBackgroundThreadExecutor(Executors.newSingleThreadExecutor()) | |
| .build() | |
| ) { | |
| override fun submitList(list: List<Item>?) { | |
| super.submitList(ArrayList<Item>(list ?: listOf())) |
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
| recyclerMessages.addOnLayoutChangeListener { v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom -> | |
| if (bottom < oldBottom) { | |
| recyclerMessages.smoothScrollToPosition(0) | |
| } | |
| } |
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
| <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | |
| <!-- Customize your theme here. --> | |
| <item name="colorPrimary">@color/colorPrimary</item> | |
| <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
| <item name="colorAccent">@color/colorAccent</item> | |
| <item name="drawerArrowStyle">@style/AppTheme.DrawerArrowStyle</item> | |
| <item name="android:textSize">14sp</item> | |
| </style> | |
| <style name="AppTheme.DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> |
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
| package com.miller.futurechat | |
| import android.content.Context | |
| import android.util.Log | |
| import android.widget.ImageView | |
| import com.bumptech.glide.Glide | |
| import com.bumptech.glide.signature.ObjectKey | |
| import io.reactivex.Single | |
| import io.reactivex.android.schedulers.AndroidSchedulers | |
| import io.reactivex.disposables.CompositeDisposable |
NewerOlder