Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
d4abe83a
Commit
d4abe83a
authored
Jan 18, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug也不跳过logo
parent
441e6519
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
50 deletions
+44
-50
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
.../java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
+7
-8
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+37
-42
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
View file @
d4abe83a
package
cn.garymb.ygomobile.ui.activities
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
...
...
@@ -20,7 +19,7 @@ public class LogoActivity extends BaseActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_logo
);
if
(
AppsSettings
.
get
().
isOnlyGame
())
{
if
(
AppsSettings
.
get
().
isOnlyGame
())
{
YGOStarter
.
startGame
(
this
,
null
);
finish
();
return
;
...
...
@@ -34,11 +33,11 @@ public class LogoActivity extends BaseActivity {
// 拒绝时, 关闭页面, 缺少主要权限, 无法运行
if
(
requestCode
==
REQUEST_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
finish
();
}
else
{
if
(
BuildConfig
.
DEBUG
)
{
startActivity
(
new
Intent
(
LogoActivity
.
this
,
MainActivity
.
class
));
finish
();
}
else
{
}
else
{
// if (BuildConfig.DEBUG)
{
//
startActivity(new Intent(LogoActivity.this, MainActivity.class));
//
finish();
// }
else {
handler
=
new
Handler
();
runnable
=
new
Runnable
()
{
@Override
...
...
@@ -49,7 +48,7 @@ public class LogoActivity extends BaseActivity {
};
handler
.
postDelayed
(
runnable
,
1000
);
Toast
.
makeText
(
LogoActivity
.
this
,
R
.
string
.
logo_text
,
Toast
.
LENGTH_SHORT
).
show
();
}
//
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
d4abe83a
...
...
@@ -3,18 +3,13 @@ package cn.garymb.ygomobile.ui.home;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.graphics.Color
;
import
android.os.AsyncTask
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.support.annotation.NonNull
;
import
android.support.v4.app.ActivityCompat
;
import
android.support.v4.app.NotificationManagerCompat
;
import
android.util.Log
;
import
java.io.IOException
;
...
...
@@ -38,12 +33,12 @@ import static cn.garymb.ygomobile.Constants.NETWORK_IMAGE;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
ResCheckListener
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
getDatapath
;
public
class
MainActivity
extends
HomeActivity
{
public
class
MainActivity
extends
HomeActivity
{
private
GameUriManager
mGameUriManager
;
private
ImageUpdater
mImageUpdater
;
private
boolean
enableStart
;
ResCheckTask
mResCheckTask
;
private
final
String
[]
PERMISSIONS
={
private
final
String
[]
PERMISSIONS
=
{
// Manifest.permission.RECORD_AUDIO,
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
SYSTEM_ALERT_WINDOW
,
...
...
@@ -56,7 +51,7 @@ public class MainActivity extends HomeActivity{
super
.
onCreate
(
savedInstanceState
);
YGOStarter
.
onCreated
(
this
);
mImageUpdater
=
new
ImageUpdater
(
this
);
//动态权限
//动态权限
// ActivityCompat.requestPermissions(this, PERMISSIONS, 0);
//资源复制
checkRes
();
...
...
@@ -84,7 +79,7 @@ public class MainActivity extends HomeActivity{
}
if
(
isNew
)
{
if
(!
getGameUriManager
().
doIntent
(
getIntent
()))
{
DialogPlus
dialog
=
new
DialogPlus
(
this
)
DialogPlus
dialog
=
new
DialogPlus
(
this
)
.
setTitleText
(
getString
(
R
.
string
.
settings_about_change_log
))
.
loadUrl
(
"file:///android_asset/changelog.html"
,
Color
.
TRANSPARENT
)
.
hideButton
()
...
...
@@ -97,17 +92,17 @@ public class MainActivity extends HomeActivity{
}
}
});
dialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialogInterface
)
{
PermissionUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
}
});
dialog
.
show
();
dialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialogInterface
)
{
PermissionUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
}
});
dialog
.
show
();
}
}
else
{
PermissionUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
PermissionUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
getGameUriManager
().
doIntent
(
getIntent
());
}
...
...
@@ -128,8 +123,8 @@ public class MainActivity extends HomeActivity{
protected
void
onDestroy
()
{
YGOStarter
.
onDestroy
(
this
);
super
.
onDestroy
();
if
(
mResCheckTask
!=
null
)
mResCheckTask
.
unregisterMReceiver
();
if
(
mResCheckTask
!=
null
)
mResCheckTask
.
unregisterMReceiver
();
}
@Override
...
...
@@ -177,35 +172,35 @@ public class MainActivity extends HomeActivity{
@Override
public
void
updateImages
()
{
Log
.
e
(
"MainActivity"
,
"重置资源"
);
Log
.
e
(
"MainActivity"
,
"重置资源"
);
DialogPlus
dialog
=
DialogPlus
.
show
(
this
,
null
,
getString
(
R
.
string
.
message
));
dialog
.
show
();
VUiKit
.
defer
().
when
(()
->
{
Log
.
e
(
"MainActivity"
,
"开始复制"
);
try
{
IOUtils
.
createNoMedia
(
AppsSettings
.
get
().
getResourcePath
());
if
(
IOUtils
.
hasAssets
(
this
,
getDatapath
(
Constants
.
CORE_PICS_ZIP
)))
{
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_PICS_ZIP
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
}
if
(
IOUtils
.
hasAssets
(
this
,
getDatapath
(
Constants
.
CORE_SCRIPTS_ZIP
)))
{
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_SCRIPTS_ZIP
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
}
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
DATABASE_NAME
),
Log
.
e
(
"MainActivity"
,
"开始复制"
);
try
{
IOUtils
.
createNoMedia
(
AppsSettings
.
get
().
getResourcePath
());
if
(
IOUtils
.
hasAssets
(
this
,
getDatapath
(
Constants
.
CORE_PICS_ZIP
)))
{
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_PICS_ZIP
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_STRING_PATH
),
}
if
(
IOUtils
.
hasAssets
(
this
,
getDatapath
(
Constants
.
CORE_SCRIPTS_ZIP
)))
{
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_SCRIPTS_ZIP
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_SKIN_PATH
),
AppsSettings
.
get
().
getCoreSkinPath
(),
false
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
Log
.
e
(
"MainActivity"
,
"错误"
+
e
);
}
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
DATABASE_NAME
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_STRING_PATH
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_SKIN_PATH
),
AppsSettings
.
get
().
getCoreSkinPath
(),
false
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
Log
.
e
(
"MainActivity"
,
"错误"
+
e
);
}
}).
done
((
rs
)
->
{
Log
.
e
(
"MainActivity"
,
"复制完毕"
);
Log
.
e
(
"MainActivity"
,
"复制完毕"
);
dialog
.
dismiss
();
});
}
...
...
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