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
| import android.content.Context | |
| import android.graphics.Canvas | |
| import android.graphics.Paint | |
| import android.graphics.RectF | |
| import android.util.AttributeSet | |
| import androidx.appcompat.widget.AppCompatSeekBar | |
| import androidx.core.content.ContextCompat | |
| import com.example.code.R | |
| enum class SeekbarElementType { PROGRESS_BAR, PROGRESS_INDICATOR, PROGRESS_DIVIDER } |
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.example.code.percentSeekBar | |
| import androidx.appcompat.app.AppCompatActivity | |
| import android.os.Bundle | |
| import android.util.Log | |
| import com.example.code.R | |
| import com.example.code.percentSeekBar.PercentSeekBar | |
| import com.example.code.percentSeekBar.ProgressItem | |
| import java.util.ArrayList |
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 LegacyCallbackSampleTwo( | |
| override val coroutineContext: CoroutineContext | |
| ) : CoroutineScope { | |
| fun initiateDemo() { | |
| launch { | |
| val user = getUser("111") | |
| println(user.userName) | |
| } | |
| } |
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 SuspendingFuncActivity : BaseActivity() { | |
| override fun getToolbarTitle() = "Suspending Functions" | |
| private lateinit var binding: ActivitySuspendingFuncBinding | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| binding = ActivitySuspendingFuncBinding.inflate(layoutInflater) | |
| setContentView(binding.root) |
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
| private fun simpleDemo() { | |
| retrieveUserFromNetwork("111") { | |
| println(it.userName) | |
| } | |
| } | |
| private fun retrieveUserFromNetwork( | |
| userId:String, | |
| userRetrieved:(user:User) -> Unit | |
| ) { |
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
| fun main() { | |
| println("Start") | |
| initiateUploadingImage(service) | |
| println("End") | |
| } | |
| fun initiateUploadingImage( | |
| imageUpload:(image :String)->Boolean | |
| ) { | |
| val result = imageUpload("/Desktop") |
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
| fun main() { | |
| println("Start") | |
| initiateUploadingImage(service) | |
| println("End") | |
| } | |
| fun initiateUploadingImage( | |
| imageUpload:(image :String)->Unit | |
| ) { | |
| imageUpload("/Desktop") |
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
| fun main() { | |
| println("Start") | |
| initiateUploadingImage(service) | |
| println("End") | |
| } | |
| fun initiateUploadingImage( | |
| imageUpload:()->Unit | |
| ) { | |
| imageUpload() |
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
| // Define the type alisas in a class | |
| import pkgone.MyViewClass | |
| typealias PkgOneClass = MyViewClass | |
| typealias PkgTwoClass = pkgtwo.MyViewClass | |
| typealias PkgThreeClass = pkgthree.MyViewClass | |
| // Main function | |
| fun main() { | |
| println("Start") |
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
| // Define the type alisas in a class | |
| import pkgone.MyViewClass | |
| typealias PkgOneClass = MyViewClass | |
| typealias PkgTwoClass = pkgtwo.MyViewClass | |
| typealias PkgThreeClass = pkgthree.MyViewClass | |
| // Main function | |
| fun main() { | |
| println("Start") |