Commit 93677f44 authored by kenan's avatar kenan

print info

parent 3457e3f5
......@@ -68,7 +68,7 @@ public class GameSize {
}
public void setScreen(int fullW, int fullH, int actW, int actH) {
this.fullW = width;
this.fullW = fullW;
this.fullH = fullH;
this.actW = actW;
this.actH = actH;
......
......@@ -161,6 +161,10 @@ class LocalGameHost extends GameHost {
//fix touch point
int left = (maxW - gw) / 2;
int top = (maxH - gh) / 2;
if(!immerSiveMode){
//fix touch
left = (maxW - gw - config.getNotouchHeight()) / 2;
}
Log.i("kk", "touch fix=" + left + "x" + top);
//if(huawei and liuhai){
// left-=liuhai
......@@ -219,13 +223,12 @@ class LocalGameHost extends GameHost {
Log.i("kk", "gen size " + size);
}
((TextView) dlg.findViewById(R.id.tv_model)).setText(Build.MODEL + "/" + Build.PRODUCT);
((TextView) dlg.findViewById(R.id.tv_android)).setText(Build.VERSION.RELEASE);
((TextView) dlg.findViewById(R.id.tv_rom)).setText(String.valueOf(RomIdentifier.getRomInfo(activity).getRom()));
((TextView) dlg.findViewById(R.id.tv_rom_ver)).setText(RomIdentifier.getRomInfo(activity).getVersion());
((TextView) dlg.findViewById(R.id.tv_cut_screen)).setText(ScreenUtil.hasNotchInformation(activity) ? "Yes" : "No");
((TextView) dlg.findViewById(R.id.tv_android)).setText(Build.VERSION.RELEASE+" ("+Build.VERSION.SDK_INT+")");
((TextView) dlg.findViewById(R.id.tv_rom)).setText(String.valueOf(RomIdentifier.getRomInfo(activity)));
((TextView) dlg.findViewById(R.id.tv_cut_screen)).setText(ScreenUtil.hasNotchInformation(activity) ? "Yes/("+config.getNotouchHeight()+")" : "No");
((TextView) dlg.findViewById(R.id.tv_nav_bar)).setText(ScreenUtil.isNavigationBarShown(activity) ? "Yes" : "No");
((TextView) dlg.findViewById(R.id.tv_screen_size)).setText(String.format("real:%dx%d, cur=%dx%d, game=%dx%d, notouch=%d",
size.getFullW(), size.getFullH(), size.getActW(), size.getActH(), size.getWidth(), size.getHeight(), config.getNotouchHeight()));
((TextView) dlg.findViewById(R.id.tv_screen_size)).setText(String.format("r:%dx%d,a=%dx%d,k=%s, g=%dx%d,c=%dx%d",
size.getFullW(), size.getFullH(), size.getActW(), size.getActH(), config.isKeepScale()?"Y":"N", size.getWidth(), size.getHeight(), size.getTouchX(), size.getTouchY()));
dlg.findViewById(R.id.btn_ok).setOnClickListener((v) -> {
dlg.dismiss();
});
......
package cn.garymb.ygomobile.utils.rom;
import android.os.Build;
import android.text.TextUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class GoogleChecker extends Checker {
@Override
protected String getManufacturer() {
return ManufacturerList.GOOGLE;
}
@Override
protected String[] getAppList() {
return new String[]{"com.google.android.apps.nexuslauncher"};
}
@Override
public ROM getRom() {
return ROM.Google;
}
@Override
public ROMInfo checkBuildProp(RomProperties properties) throws Exception {
ROMInfo info = new ROMInfo(getRom());
info.setVersion(Build.VERSION.RELEASE);
info.setBaseVersion(Build.VERSION.SDK_INT);
return info;
}
}
......@@ -24,4 +24,6 @@ interface ManufacturerList {
String VIVO = "vivo"; // vivo
String AMIGO = "amigo"; // 金立 // todo
String GOOGLE = "Google";
}
......@@ -47,4 +47,12 @@ public class ROMInfo {
public String getVersion() {
return version;
}
@Override
public String toString() {
if(version != null){
return rom+"/"+version;
}
return String.valueOf(rom);
}
}
......@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
......@@ -36,7 +37,8 @@ public class RomIdentifier {
new FuntouchOsChecker(),
new FlymeChecker(),
new EuiChecker(),
new AmigoOsChecker()
new AmigoOsChecker(),
new GoogleChecker()
};
}
......@@ -58,6 +60,7 @@ public class RomIdentifier {
// 优先检查 Manufacturer
String manufacturer = Build.MANUFACTURER;
Log.i("kk", "manufacturer="+manufacturer);
for (IChecker checker : checkers) {
if (checker.checkManufacturer(manufacturer)) {
// 检查完 Manufacturer 后, 再核对一遍应用列表
......
......@@ -78,30 +78,6 @@
tools:text="9.0.0" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/white"
android:text="@string/lb_rom_version"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_rom_ver"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textColor="@color/white"
android:textSize="12sp"
tools:text="9.0.0" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment