Add: Icon for details action

Improve: Smaller App name on top app bar
This commit is contained in:
LooKeR 2021-10-26 11:36:09 +05:30
parent 3296feecbe
commit 229a7a3c09
3 changed files with 5 additions and 2 deletions

View File

@ -1194,6 +1194,7 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
when (action) {
Action.CANCEL -> context.getDrawable(R.drawable.ic_cancel)
Action.LAUNCH -> context.getDrawable(R.drawable.ic_launch)
Action.DETAILS -> context.getDrawable(R.drawable.ic_tune)
else -> context.getDrawable(R.drawable.ic_download)
}
iconTint = if (action == Action.CANCEL) holder.actionTintOnCancel

View File

@ -29,6 +29,7 @@ import com.looker.droidify.utility.RxUtils
import com.looker.droidify.utility.Utils
import com.looker.droidify.utility.Utils.startUpdate
import com.looker.droidify.utility.extension.android.*
import com.looker.droidify.utility.extension.text.trimAfter
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.disposables.Disposable
@ -329,7 +330,8 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
} == true
(toolbar.parent as CollapsingToolbarLayout).title =
if (showPackageName) products[0].first.name else getString(R.string.application)
if (showPackageName) products[0].first.name.trimAfter(' ', 2)
else getString(R.string.application)
}
private fun updateToolbarButtons() {

View File

@ -27,7 +27,7 @@ fun String?.trimAfter(char: Char, repeated: Int): String? {
if (repeated == count) return it.substring(0, i)
}
}
return null
return this
}
fun String?.trimBefore(char: Char, repeated: Int): String? {