feat: include display size and font scale in device info dialog

This commit is contained in:
Bnyro 2024-07-23 17:35:43 +02:00
parent 7a4635d873
commit 3cc8c8be88

View File

@ -1,6 +1,7 @@
package com.github.libretube.ui.activities package com.github.libretube.ui.activities
import android.content.Intent import android.content.Intent
import android.content.res.Resources
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import androidx.core.text.HtmlCompat import androidx.core.text.HtmlCompat
@ -93,13 +94,15 @@ class AboutActivity : BaseActivity() {
} }
private fun showDeviceInfo() { private fun showDeviceInfo() {
val metrics = Resources.getSystem().displayMetrics
val text = "Manufacturer: ${Build.MANUFACTURER}\n" + val text = "Manufacturer: ${Build.MANUFACTURER}\n" +
"Model: ${Build.MODEL}\n" +
"SDK: ${Build.VERSION.SDK_INT}\n" +
"Board: ${Build.BOARD}\n" + "Board: ${Build.BOARD}\n" +
"OS: Android ${Build.VERSION.RELEASE}\n" +
"Arch: ${Build.SUPPORTED_ABIS[0]}\n" + "Arch: ${Build.SUPPORTED_ABIS[0]}\n" +
"Product: ${Build.PRODUCT}" "Android SDK: ${Build.VERSION.SDK_INT}\n" +
"OS: Android ${Build.VERSION.RELEASE}\n" +
"Display: ${metrics.widthPixels}x${metrics.heightPixels}\n" +
"Font scale: ${Resources.getSystem().configuration.fontScale}"
MaterialAlertDialogBuilder(this) MaterialAlertDialogBuilder(this)
.setTitle(R.string.device_info) .setTitle(R.string.device_info)