Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
6b63d52d
Commit
6b63d52d
authored
Aug 28, 2021
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部分注释
parent
5735c1fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
133 additions
and
0 deletions
+133
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
.../java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
+133
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
View file @
6b63d52d
...
@@ -7,15 +7,24 @@ import android.content.Context;
...
@@ -7,15 +7,24 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.content.res.Resources
;
import
android.graphics.Canvas
;
import
android.graphics.Rect
;
import
android.graphics.Rect
;
import
android.graphics.SurfaceTexture
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Looper
;
import
android.os.Looper
;
import
android.provider.Settings
;
import
android.provider.Settings
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.Display
;
import
android.view.MenuItem
;
import
android.view.MenuItem
;
import
android.view.Surface
;
import
android.view.SurfaceControl
;
import
android.view.SurfaceHolder
;
import
android.view.View
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -24,7 +33,10 @@ import androidx.appcompat.app.ActionBar;
...
@@ -24,7 +33,10 @@ import androidx.appcompat.app.ActionBar;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.appcompat.widget.Toolbar
;
import
java.io.IOException
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
import
ocgcore.data.Card
;
import
ocgcore.data.Card
;
...
@@ -95,6 +107,127 @@ public class BaseActivity extends AppCompatActivity {
...
@@ -95,6 +107,127 @@ public class BaseActivity extends AppCompatActivity {
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
/*
M 是 6.0,6.0修改了新的api,并且就已经支持修改window的刷新率了。
但是6.0那会儿,也没什么手机支持高刷新率吧,所以也没什么人注意它。
我更倾向于直接判断 O,也就是 Android 8.0,我觉得这个时候支持高刷新率的手机已经开始了。
*/
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// // 获取系统window支持的模式
//// val = window.windowManager.defaultDisplay.supportedModes;
// Display display = getWindowManager().getDefaultDisplay();
//
// Surface surface = new Surface(new SurfaceTexture(10));
// TextView textVie
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// SurfaceHolder surfaceHolder=new SurfaceHolder() {
// @Override
// public void addCallback(Callback callback) {
//
// }
//
// @Override
// public void removeCallback(Callback callback) {
//
// }
//
// @Override
// public boolean isCreating() {
// return false;
// }
//
// @Override
// public void setType(int type) {
//
// }
//
// @Override
// public void setFixedSize(int width, int height) {
//
// }
//
// @Override
// public void setSizeFromLayout() {
//
// }
//
// @Override
// public void setFormat(int format) {
//
// }
//
// @Override
// public void setKeepScreenOn(boolean screenOn) {
//
// }
//
// @Override
// public Canvas lockCanvas() {
// return null;
// }
//
// @Override
// public Canvas lockCanvas(Rect dirty) {
// return null;
// }
//
// @Override
// public void unlockCanvasAndPost(Canvas canvas) {
//
// }
//
// @Override
// public Rect getSurfaceFrame() {
// return null;
// }
//
// @Override
// public Surface getSurface() {
// return null;
// }
// }
// getWindow().getDecorView().getd.setFrameRate(90, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT);
// } else {
//
// Display.Mode[] modes = display.getSupportedModes();
// Log.e("BaseActivity", "个数" + modes.length);
// try {
// FileLogUtil.writeAndTime("刷新率个数" + modes.length);
//
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// Display.Mode maxMode = null;
// for (Display.Mode mode : modes) {
// if (maxMode == null) {
// maxMode = mode;
// } else {
// if (mode.getRefreshRate() > maxMode.getRefreshRate())
// maxMode = mode;
// }
// try {
// FileLogUtil.writeAndTime("" + "状态信息" + mode.getModeId() + " " + mode.getRefreshRate() + " " + mode.getPhysicalWidth() + " " + mode.getPhysicalHeight());
// } catch (IOException e) {
// e.printStackTrace();
// }
// Log.e("BaseActivity", "状态信息" + mode.getModeId() + " " + mode.getRefreshRate() + " " + mode.getPhysicalWidth() + " " + mode.getPhysicalHeight());
// }
//// if (maxMode!=null) {
//// Log.e("BaseACtivity","设置刷新率"+maxMode.getRefreshRate());
// try {
// FileLogUtil.writeAndTime("设置刷新率" + modes[0].getRefreshRate());
// } catch (IOException e) {
// e.printStackTrace();
// }
// WindowManager.LayoutParams att = getWindow().getAttributes();
// att.preferredDisplayModeId = modes[0].getModeId();
// getWindow().setAttributes(att);
//
// }
// }
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment