修改cpu

This commit is contained in:
yuqian 2025-12-25 15:11:30 +08:00
parent 38f87df5c9
commit 0f20afb726
8 changed files with 105 additions and 108 deletions

View File

@ -3,6 +3,7 @@ package com.xyzshell.myphoneinfo.dashboard
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.xyzshell.andinfo.AndInfo
import com.xyzshell.myphoneinfo.R
import com.xyzshell.myphoneinfo.databinding.ActivityAnalysisBinding
import com.xyzshell.myphoneinfo.dialog.DialogCpuInfo
@ -32,6 +33,8 @@ class AnalysisActivity : AppCompatActivity() {
private fun initText() {
//processor
binding.proText1.textTitle.text=getString(R.string.hardware)
binding.proText1.textContent.text=AndInfo.instance.cpu.text()
println(AndInfo.instance.cpu.text())
binding.proText2.textTitle.text=getString(R.string.manufacturer)
binding.proText3.textTitle.text=getString(R.string.marketing_name)
binding.proText4.textTitle.text=getString(R.string.process)

View File

@ -8,6 +8,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.xyzshell.andinfo.AndInfo
import com.xyzshell.andinfo.libs.CpuInfo
import com.xyzshell.myphoneinfo.R
import com.xyzshell.myphoneinfo.databinding.FragmentHardWareBinding
import com.xyzshell.myphoneinfo.dialog.DialogBlueTooth
@ -63,47 +64,66 @@ class HardWareFragment : Fragment() {
}
private fun initText() {
val cpu = AndInfo.instance.cpu//cpu信息
val device = AndInfo.instance.device//设备信息
val gpu=AndInfo.instance.gpu//gpu信息
//processor
//处理器
binding.text0.textTitle.text = getString(R.string.processor)
binding.text0.textContent.text= cpu.getProcessorName()
//制造商
binding.text1.textTitle.text = getString(R.string.vendor)
binding.text1.textContent.text=AndInfo.instance.device.manufacturer
binding.text1.textContent.text=cpu.getVendor()
//硬件
binding.text2.textTitle.text = getString(R.string.hardware)
binding.text2.textContent.text=AndInfo.instance.device.hardwareName
binding.text2.textContent.text=cpu.getProcessorName()
binding.text3.textTitle.text = getString(R.string.cores)
binding.text3.textContent.text=AndInfo.instance.cpu.cores.size.toString()
binding.text3.textContent.text=cpu.cores.size.toString()
//cpu内核详情
binding.text4.textTitle.text = getString(R.string.CPU)
binding.text4.textContent.text=AndInfo.instance.cpu.text()
binding.text4.textContent.text=cpu.getCpuText()
//制程工艺
binding.text5.textTitle.text = getString(R.string.process)
binding.text5.textContent.text=cpu.getProcessInfo().process
//架构
binding.text6.textTitle.text = getString(R.string.architecture)
binding.text6.textContent.text=cpu.getArchitecture()
//ABI
binding.text7.textTitle.text = getString(R.string.ABI)
binding.text7.textContent.text=cpu.getAbi()
//supported_ABls
binding.text8.textTitle.text = getString(R.string.supported_ABls)
binding.text8.textContent.text=cpu.getSupportedAbis().joinToString()
//频率
binding.text9.textTitle.text = getString(R.string.frequencies)
binding.text9.textContent.text=cpu.getFrequencyText()
println(cpu.getFrequencyText())
//gpu
binding.cpuText1.textTitle.text = getString(R.string.vendor)
binding.cpuText2.textTitle.text = getString(R.string.gpu)
val gpuInfo=AndInfo.instance.gpu.getGpuInformation()
gpuInfo.vkPhysicalDevices?.let { devices ->
binding.gpuText1.textTitle.text = getString(R.string.vendor)
binding.gpuText1.textContent.text=gpu.getVendorName()
binding.gpuText2.textTitle.text = getString(R.string.gpu)
gpu.getGpuInformation().vkPhysicalDevices?.let { devices ->
if (devices.isNotEmpty()) {
devices.forEachIndexed { index, vkPhysicalDevice ->
binding.cpuText1.textContent.text=vkPhysicalDevice.vendorId.toString()
binding.cpuText2.textContent.text=vkPhysicalDevice.deviceName
binding.gpuText2.textContent.text=vkPhysicalDevice.deviceName
}
}
}
binding.cpuText3.textTitle.text=getString(R.string.max_frequency)
binding.cpuText4.textTitle.text=getString(R.string.architecture)
binding.cpuText5.textTitle.text=getString(R.string.cores)
binding.cpuText6.textTitle.text=getString(R.string.total_l2)
binding.cpuText7.textTitle.text=getString(R.string.bus_width)
binding.cpuText8.textTitle.text=getString(R.string.vulkan_support)
binding.cpuText9.textTitle.text=getString(R.string.vulkan_API)
binding.gpuText3.textTitle.text=getString(R.string.max_frequency)
binding.gpuText4.textTitle.text=getString(R.string.architecture)
binding.gpuText5.textTitle.text=getString(R.string.cores)
binding.gpuText6.textTitle.text=getString(R.string.total_l2)
binding.gpuText7.textTitle.text=getString(R.string.bus_width)
binding.gpuText8.textTitle.text=getString(R.string.vulkan_support)
binding.gpuText9.textTitle.text=getString(R.string.vulkan_API)
binding.open1.text=getString(R.string.opengl)
gpuInfo.eglInformation?.let { eglInfo ->
eglInfo.eglExtensions?.let {

View File

@ -14,28 +14,25 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:background="@color/white"
android:orientation="vertical">
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/back_btn"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/go_back"
android:padding="13dp"
android:layout_margin="10dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20dp"
android:paddingVertical="10dp"
android:orientation="horizontal">
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cpu_analysis"
android:textStyle="bold"
android:textSize="18sp"
android:textColor="@color/black"
style="@style/TextHeavy20"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
@ -117,7 +114,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal"
android:orientation="vertical"
android:visibility="visible">
<com.google.android.material.textview.MaterialTextView
@ -125,16 +122,19 @@
style="@style/LeftContent"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="@string/proc_cpuinfo"
android:textStyle="bold" />
android:text="@string/proc_cpuinfo" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/infoShow"
style="@style/TextButteryRight"
android:layout_width="wrap_content"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:layout_marginTop="11dp"
android:background="@drawable/hard_bg"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp"
android:textSize="14sp"
android:textAlignment="center"
android:textColor="@color/module_title_color"
android:text="@string/show"
tools:ignore="RelativeOverlap" />
</LinearLayout>
@ -143,23 +143,29 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal"
android:orientation="vertical"
android:visibility="visible">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/time1"
style="@style/LeftContent"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="@string/cpu_times"
android:textStyle="bold" />
android:text="@string/cpu_times" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/timeShow"
style="@style/TextButteryRight"
android:layout_width="wrap_content"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:layout_marginTop="11dp"
android:background="@drawable/hard_bg"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp"
android:textSize="14sp"
android:textAlignment="center"
android:textColor="@color/module_title_color"
android:text="@string/show"
tools:ignore="RelativeOverlap" />
</LinearLayout>
@ -182,11 +188,13 @@
android:text="@string/cluster_1"
tools:ignore="RelativeOverlap" />
<com.google.android.material.textview.MaterialTextView
style="@style/TextSecondaryTitle"
style="@style/LeftContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/cpu0"
android:textSize="14sp"
android:textColor="@color/module_title_color"
tools:ignore="RelativeOverlap" />
<include
android:id="@+id/clu1_text1"
@ -205,47 +213,6 @@
layout="@layout/common_text_style" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/dashboard_model_background"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="22dp"
android:visibility="visible">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/cluster2Title"
style="@style/TextHeavy20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cluster_2"
tools:ignore="RelativeOverlap" />
<com.google.android.material.textview.MaterialTextView
style="@style/TextSecondaryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/cpu0"
tools:ignore="RelativeOverlap" />
<include
android:id="@+id/clu2_text1"
layout="@layout/common_text_style" />
<include
android:id="@+id/clu2_text2"
layout="@layout/common_text_style" />
<include
android:id="@+id/clu2_text3"
layout="@layout/common_text_style" />
<include
android:id="@+id/clu2_text4"
layout="@layout/common_text_style" />
<include
android:id="@+id/clu2_text5"
layout="@layout/common_text_style" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -74,9 +74,9 @@
android:id="@+id/text9"
layout="@layout/common_text_style" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/cpuBtn"
style="@style/TextDialogSubTitle"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
@ -84,7 +84,6 @@
android:paddingHorizontal="12dp"
android:paddingVertical="8dp"
android:textSize="14sp"
android:textStyle="normal"
android:text="@string/cpu_analysis"
android:textAlignment="center"
android:textColor="@color/module_title_color" />
@ -109,39 +108,39 @@
tools:ignore="RelativeOverlap" />
<include
android:id="@+id/cpu_text1"
android:id="@+id/gpu_text1"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text2"
android:id="@+id/gpu_text2"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text3"
android:id="@+id/gpu_text3"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text4"
android:id="@+id/gpu_text4"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text5"
android:id="@+id/gpu_text5"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text6"
android:id="@+id/gpu_text6"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text7"
android:id="@+id/gpu_text7"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text8"
android:id="@+id/gpu_text8"
layout="@layout/common_text_style" />
<include
android:id="@+id/cpu_text9"
android:id="@+id/gpu_text9"
layout="@layout/common_text_style" />
<LinearLayout
@ -205,7 +204,7 @@
android:textStyle="bold" />
<TextView
android:id="@+id/extensionShow"
style="@style/TextButteryRight"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
@ -215,6 +214,7 @@
android:textSize="14sp"
android:textStyle="normal"
android:text="@string/show"
android:textColor="@color/module_title_color"
android:textAlignment="center"
tools:ignore="RelativeOverlap" />
</LinearLayout>
@ -405,7 +405,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
style="@style/LeftContent"
@ -416,10 +416,16 @@
<com.google.android.material.textview.MaterialTextView
android:id="@+id/othertext"
style="@style/TextButteryRight"
android:layout_width="wrap_content"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:layout_marginTop="11dp"
android:background="@drawable/hard_bg"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp"
android:textSize="14sp"
android:textAlignment="center"
android:textColor="@color/module_title_color"
android:text="@string/show"
tools:ignore="RelativeOverlap" />
</LinearLayout>

View File

@ -81,7 +81,7 @@
<com.google.android.material.textview.MaterialTextView
android:id="@+id/conText2"
style="@style/TextButteryRight"
style="@style/LeftContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LUX·433 Mbps"
@ -90,7 +90,7 @@
<com.google.android.material.textview.MaterialTextView
android:id="@+id/conTExt3"
style="@style/TextButteryRight"
style="@style/LeftContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="80% -60dBm"

View File

@ -53,7 +53,7 @@
android:layout_weight="1"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pair1"
style="@style/TextButteryRight"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
@ -63,6 +63,7 @@
android:background="@drawable/hard_bg"
android:textStyle="normal"
android:text="@string/show"
android:textColor="@color/module_title_color"
android:textAlignment="center"
tools:ignore="RelativeOverlap" />
@ -84,7 +85,7 @@
<!-- android:layout_weight="1"/>-->
<!-- <com.google.android.material.textview.MaterialTextView-->
<!-- android:id="@+id/pair2"-->
<!-- style="@style/TextButteryRight"-->
<!-- style="@style/LeftContent"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:paddingHorizontal="10dp"-->

View File

@ -167,7 +167,7 @@
android:textStyle="bold" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/pubShow"
style="@style/TextButteryRight"
style="@style/LeftContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 234 B