From 3cc8c8be88a415a49f6c9adedc50f60637b07310 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 23 Jul 2024 17:35:43 +0200 Subject: [PATCH] feat: include display size and font scale in device info dialog --- .../libretube/ui/activities/AboutActivity.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt index 20b9f3c5f..fd466640a 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/AboutActivity.kt @@ -1,6 +1,7 @@ package com.github.libretube.ui.activities import android.content.Intent +import android.content.res.Resources import android.os.Build import android.os.Bundle import androidx.core.text.HtmlCompat @@ -93,13 +94,15 @@ class AboutActivity : BaseActivity() { } private fun showDeviceInfo() { + val metrics = Resources.getSystem().displayMetrics + val text = "Manufacturer: ${Build.MANUFACTURER}\n" + - "Model: ${Build.MODEL}\n" + - "SDK: ${Build.VERSION.SDK_INT}\n" + - "Board: ${Build.BOARD}\n" + - "OS: Android ${Build.VERSION.RELEASE}\n" + - "Arch: ${Build.SUPPORTED_ABIS[0]}\n" + - "Product: ${Build.PRODUCT}" + "Board: ${Build.BOARD}\n" + + "Arch: ${Build.SUPPORTED_ABIS[0]}\n" + + "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) .setTitle(R.string.device_info)