mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Merge pull request #245 from Bnyro/topbar
App Title follows Material You
This commit is contained in:
commit
b6b3c643e9
@ -11,6 +11,7 @@ import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.*
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Button
|
||||
@ -118,7 +119,9 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
toolbar = findViewById(R.id.toolbar)
|
||||
val hexColor = String.format("#%06X", 0xFFFFFF and 0xcc322d)
|
||||
val typedValue = TypedValue()
|
||||
this.theme.resolveAttribute(R.attr.colorPrimaryDark, typedValue, true)
|
||||
val hexColor = String.format("#%06X", (0xFFFFFF and typedValue.data))
|
||||
val appName = HtmlCompat.fromHtml(
|
||||
"Libre<span style='color:$hexColor';>Tube</span>",
|
||||
HtmlCompat.FROM_HTML_MODE_COMPACT
|
||||
@ -344,4 +347,4 @@ fun Activity.hideKeyboard() {
|
||||
fun Context.hideKeyboard(view: View) {
|
||||
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user