INNER CODE UNIT · Kotlin

refreshUserInfo

fumiama/copymanga · app/src/main/java/top/fumiama/copymanga/MainActivity.kt:311

    suspend fun refreshUserInfo(): Unit = withContext(Dispatchers.IO) {
        var name = Config.nickname.value
        if (name.isNullOrEmpty()) name = Config.username.value
        val avatar = Config.avatar.value
        navttitle.apply { post {
            if(!name.isNullOrEmpty()) text = name
            else setText(R.string.noLogin)
        } }
        navhicon.apply ic@ { post {
            if(!avatar.isNullOrEmpty())
                Glide.with(this@MainActivity).load(avatar)
                    .apply(RequestOptions.bitmapTransform(CircleCrop()))
                    .timeout(60000)
                    .into(this@ic)
            else setImageResource(R.mipmap.ic_launcher)
        } }
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…