Open in app

Sign In

Write

Sign In

Jacky Tsang
Jacky Tsang

64 Followers

Home

About

Jan 14

Day164 — Splash Screen API

I tried out the new Splash Screen API. Splash screens | Android Developers If you have previously implemented a custom splash screen in Android 11 or lower, you'll need to migrate your app to…developer.android.com The splash screen icon uses the same specifications as Adaptive icons Enter and Exit animation can be customized. An animated icon can be used in the format of “Animated Vector Drawable XML”

Android

2 min read

Day164 — Splash Screen API
Day164 — Splash Screen API
Android

2 min read


Jan 13

Day163 — ViewModels, LiveData and Lifecycles

Here records the notes I took when watching “droidcon NYC 2017 — ViewModels, LiveData and Lifecycles, oh my!”. The talk is fairly old. Some of the mentioned methods are outdated and the code here is translated into Kotlin. Problems to be solved: interruptions at any time rotation asynchronous tasks + destroyed UI =…

Livedata

5 min read

Day163 — ViewModels, LiveData and Lifecycles
Day163 — ViewModels, LiveData and Lifecycles
Livedata

5 min read


Jan 10

Day162 — Convert callback to Coroutine

Here record the notes I took when I am reading “Avoid Callback Hell With Kotlin Coroutines”. Avoid Callback Hell With Kotlin Coroutines Replace your nested callbacks calls for one-shot or subscribe operations with just a few lines of codelevelup.gitconnected.com One-shot callbacks use suspendCoroutine suspend fun DatabaseReference.read(): DataSnapshot = suspendCoroutine { continuation -> val valueEventListener = object : ValueEventListener { override fun onCancelled(error: DatabaseError) {…

Android

2 min read

Android

2 min read


Jan 8

Day161 — mutableStateOf() in android compose

Here records the note I took when reading this article. Jetpack Compose: remember, mutableStateOf, derivedStateOf and rememberSaveable explained If you have a composable function you might stumble over the following block of code. You might have even written it by…stefma.medium.com val stringState = remember { mutableStateOf("") } It “remember” the value so it won’t be lost after recomposition. State and Jetpack Compose | Android Developers State in an app is any value that can change over time. This is a very broad definition and encompasses everything from…developer.android.com

Android

2 min read

Android

2 min read


Jan 7

Day160 — Return a value from a kotlin coroutine scope

Return value within a coroutine scope Return value outside a coroutine scope invokeOnCompletion Registers handler that is synchronously invoked once on completion of this job. When the job is already complete, then…kotlinlang.org Use invokeOnCompletion when it is really necessary because it has no difference from “Return value within a coroutine scope” with a CoroutineExceptionHandler to me. And it disrupts the coroutine pattern by introducing a callback.

Kotlin

1 min read

Kotlin

1 min read


Jan 4

Day159 — Kotlin tips

convert callback to coroutine to avoid callback hell using suspendCoroutine Make Any Callback a Suspend Function in Kotlin 🤯 #Shorts Coroutines in Kotlin are a blessing if you dealt with callbacks before. However you still often get callbacks you would…youtube.com callback: suspendCoroutine: note that suspendCoroutine does not change the CoroutineContext. It simply converts callback to suspend function which is more manageable.

Kotlin

1 min read

Kotlin

1 min read


Dec 27, 2022

Day158 — draw an overlay on an image using CSS

.home {} img { width: 100%; padding: 0; margin: 0; display: block; } .wrap { position: relative; } .wrap:before { content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 100%; background: rgba(0, 0, 0, 0.5); z-index: 999; } <div class="home"> <div class="wrap"> <img src="http://via.placeholder.com/350x150" /> </div> </div> Reference: How to add color overlay on an image Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share…stackoverflow.com

CSS

1 min read

CSS

1 min read


Dec 27, 2022

Day157 — get images from json in Gatsby

Here records the method I used to import images from a json file in Gatsby.js v5. By the nature of the Gatsby.js framework, anything dynamic relies on graphql query. Therefore, graphal query plus GatsbyImage are used. …

Gatsbyjs

2 min read

Gatsbyjs

2 min read


Dec 14, 2022

Day156 — CSS card flip

Here records the thing I learned when I did a card flip in my project. vanilla CSS How To Create a Flip Card with CSS The flip card container - set the width and height to whatever you want.www.w3schools.com Tailwind CSS GitHub - Sridhar-C-25/animated3dflipcard_tailwind: animated 3D Flip Card Using Tailwind CSS You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…github.com

CSS

2 min read

CSS

2 min read


Aug 17, 2022

Day155 — ReactNative vs Flutter, Amplify vs Firebase

I researched on which cross-platform solution I wanted to use in my next project which is a offline-first mobile app. Website is only for later stage. Pros to use Flutter officially support Material 3 want to try new language (most important) Cons skia engine is not that good in iOS…

React Native

3 min read

Day155 — ReactNative vs Flutter, Amplify
Day155 — ReactNative vs Flutter, Amplify
React Native

3 min read

Jacky Tsang

Jacky Tsang

64 Followers
Following
  • Synced

    Synced

  • Stakingbits

    Stakingbits

  • Microsoft Design

    Microsoft Design

  • Henrique Centieiro

    Henrique Centieiro

  • UX Collective Editors

    UX Collective Editors

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech