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
24770900
Commit
24770900
authored
Aug 08, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
any about update
parent
4a9b0243
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
40 deletions
+45
-40
build.gradle
build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+7
-9
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+34
-30
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+1
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-0
No files found.
build.gradle
View file @
24770900
...
...
@@ -7,7 +7,7 @@ buildscript {
google
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.1.
2
'
classpath
'com.android.tools.build:gradle:3.1.
4
'
//classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
24770900
...
...
@@ -10,7 +10,6 @@ import android.support.design.widget.NavigationView;
import
android.support.v7.widget.DividerItemDecoration
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.Menu
;
...
...
@@ -28,10 +27,7 @@ import com.base.bj.trpayjar.utils.TrPay;
import
com.nightonke.boommenu.BoomButtons.BoomButton
;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
import
com.nightonke.boommenu.BoomMenuButton
;
import
com.pgyersdk.update.DownloadFileListener
;
import
com.pgyersdk.update.PgyUpdateManager
;
import
com.pgyersdk.update.UpdateManagerListener
;
import
com.pgyersdk.update.javabean.AppBean
;
import
com.tencent.smtt.sdk.QbSdk
;
import
com.tubb.smrv.SwipeMenuRecyclerView
;
...
...
@@ -93,17 +89,19 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
@Override
public
void
onViewInitFinished
(
boolean
arg0
)
{
//x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
if
(
arg0
)
{
// Toast.makeText(getActivity(), "加载成功", Toast.LENGTH_LONG).show();
}
else
{
if
(
arg0
)
{
// Toast.makeText(getActivity(), "加载成功", Toast.LENGTH_LONG).show();
}
else
{
Toast
.
makeText
(
getActivity
(),
"部分资源因机型原因加载错误,不影响使用"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
@Override
public
void
onCoreInitFinished
()
{
}
public
void
onCoreInitFinished
()
{
}
};
//x5内核初始化接口
QbSdk
.
initX5Environment
(
this
,
cb
);
QbSdk
.
initX5Environment
(
this
,
cb
);
//trpay
TrPay
.
getInstance
(
HomeActivity
.
this
).
initPaySdk
(
"e1014da420ea4405898c01273d6731b6"
,
"YGOMobile"
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
24770900
package
cn.garymb.ygomobile.ui.preference.fragments
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.graphics.Color
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.preference.CheckBoxPreference
;
import
android.preference.ListPreference
;
...
...
@@ -15,7 +13,6 @@ import android.util.Log;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.Toast
;
...
...
@@ -23,12 +20,10 @@ import android.widget.Toast;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.signature.StringSignature
;
import
com.pgyersdk.update.DownloadFileListener
;
import
com.pgyersdk.update.PgyUpdateManager
;
import
com.pgyersdk.update.UpdateManagerListener
;
import
com.pgyersdk.update.javabean.AppBean
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
...
...
@@ -36,7 +31,6 @@ import java.io.InputStream;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.lite.BuildConfig
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.home.MainActivity
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
...
...
@@ -46,8 +40,6 @@ import cn.garymb.ygomobile.utils.IOUtils;
import
cn.garymb.ygomobile.utils.SystemUtils
;
import
ocgcore.ConfigManager
;
import
static
android
.
R
.
attr
.
key
;
import
static
android
.
R
.
attr
.
packageNames
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_RELOAD
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_AVATAR_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_BG_SIZE
;
...
...
@@ -60,7 +52,6 @@ import static cn.garymb.ygomobile.Constants.PREF_FONT_ANTIALIAS;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_FONT_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_GAME_FONT
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_GAME_PATH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_GAME_VERSION
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_IMAGE_QUALITY
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_IMMERSIVE_MODE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_LOCK_SCREEN
;
...
...
@@ -99,9 +90,9 @@ public class SettingFragment extends PreferenceFragmentPlus {
addPreferencesFromResource
(
R
.
xml
.
preference_game
);
bind
(
PREF_GAME_PATH
,
mSettings
.
getResourcePath
());
// bind(PREF_GAME_VERSION, mSettings.getVersionString(mSettings.getGameVersion()));
bind
(
PREF_CHANGE_LOG
,
SystemUtils
.
getVersionName
(
getActivity
())
bind
(
PREF_CHANGE_LOG
,
SystemUtils
.
getVersionName
(
getActivity
())
+
"("
+
SystemUtils
.
getVersion
(
getActivity
())
+
")"
);
bind
(
PREF_CHECK_UPDATE
,
getString
(
R
.
string
.
settings_about_author_pref
)+
" : "
+
getString
(
R
.
string
.
settings_author
));
bind
(
PREF_CHECK_UPDATE
,
getString
(
R
.
string
.
settings_about_author_pref
)
+
" : "
+
getString
(
R
.
string
.
settings_author
));
bind
(
PREF_SOUND_EFFECT
,
mSettings
.
isSoundEffect
());
bind
(
PREF_LOCK_SCREEN
,
mSettings
.
isLockSreenOrientation
());
bind
(
PREF_FONT_ANTIALIAS
,
mSettings
.
isFontAntiAlias
());
...
...
@@ -119,7 +110,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
bind
(
PREF_DECK_DELETE_DILAOG
,
mSettings
.
isDialogDelete
());
//bind(PREF_USE_EXTRA_CARD_CARDS, mSettings.isUseExtraCards());
bind
(
SETTINGS_AVATAR
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_ME
).
getAbsolutePath
());
bind
(
SETTINGS_AVATAR
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_ME
).
getAbsolutePath
());
bind
(
SETTINGS_COVER
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_COVER
).
getAbsolutePath
());
bind
(
SETTINGS_CARD_BG
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_BG
).
getAbsolutePath
());
bind
(
PREF_FONT_SIZE
,
mSettings
.
getFontSize
());
...
...
@@ -182,13 +173,26 @@ public class SettingFragment extends PreferenceFragmentPlus {
.
show
();
}
if
(
PREF_CHECK_UPDATE
.
equals
(
preference
.
getKey
()))
{
new
PgyUpdateManager
new
PgyUpdateManager
.
Builder
()
.
setForced
(
true
)
//设置是否强制更新,非自定义回调更新接口此方法有用
.
setUserCanRetry
(
true
)
//失败后是否提示重新下载,非自定义下载 apk 回调此方法有用
.
setDeleteHistroyApk
(
true
)
// 检查更新前是否删除本地历史 Apk, 默认为true
.
register
();
.
setUpdateManagerListener
(
new
UpdateManagerListener
()
{
@Override
public
void
onNoUpdateAvailable
()
{
Toast
.
makeText
(
getContext
(),
R
.
string
.
Already_Lastest
,
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onUpdateAvailable
(
AppBean
appBean
)
{
PgyUpdateManager
.
downLoadApk
(
appBean
.
getDownloadURL
());
}
@Override
public
void
checkUpdateFailed
(
Exception
e
)
{
}
})
.
register
();
}
if
(
PREF_PENDULUM_SCALE
.
equals
(
key
))
{
CheckBoxPreference
checkBoxPreference
=
(
CheckBoxPreference
)
preference
;
...
...
@@ -205,14 +209,14 @@ public class SettingFragment extends PreferenceFragmentPlus {
View
viewDialog
=
dialog
.
getContentView
();
ImageView
avatar1
=
viewDialog
.
findViewById
(
R
.
id
.
me
);
ImageView
avatar2
=
viewDialog
.
findViewById
(
R
.
id
.
opponent
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_AVATAR_ME
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
],
avatar1
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_AVATAR_OPPONENT
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
],
avatar2
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_AVATAR_ME
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
],
avatar1
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_AVATAR_OPPONENT
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
],
avatar2
);
avatar1
.
setOnClickListener
((
v
)
->
{
//打开系统文件相册
String
outFile
=
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_ME
).
getAbsolutePath
();
showImageDialog
(
preference
,
getString
(
R
.
string
.
settings_game_avatar
),
outFile
,
true
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
]);
true
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
]);
dialog
.
dismiss
();
});
avatar2
.
setOnClickListener
((
v
)
->
{
...
...
@@ -220,10 +224,10 @@ public class SettingFragment extends PreferenceFragmentPlus {
String
outFile
=
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_OPPONENT
).
getAbsolutePath
();
showImageDialog
(
preference
,
getString
(
R
.
string
.
settings_game_avatar
),
outFile
,
true
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
]);
true
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
]);
dialog
.
dismiss
();
});
}
else
if
(
SETTINGS_COVER
.
equals
(
key
))
{
}
else
if
(
SETTINGS_COVER
.
equals
(
key
))
{
//显示卡背图片对话框
final
DialogPlus
dialog
=
new
DialogPlus
(
getContext
());
dialog
.
setContentView
(
R
.
layout
.
dialog_cover_select
);
...
...
@@ -232,8 +236,8 @@ public class SettingFragment extends PreferenceFragmentPlus {
View
viewDialog
=
dialog
.
getContentView
();
ImageView
cover1
=
viewDialog
.
findViewById
(
R
.
id
.
cover1
);
ImageView
cover2
=
viewDialog
.
findViewById
(
R
.
id
.
cover2
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_COVER
,
CORE_SKIN_CARD_COVER_SIZE
[
0
],
CORE_SKIN_CARD_COVER_SIZE
[
1
],
cover1
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_COVER2
,
CORE_SKIN_CARD_COVER_SIZE
[
0
],
CORE_SKIN_CARD_COVER_SIZE
[
1
],
cover2
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_COVER
,
CORE_SKIN_CARD_COVER_SIZE
[
0
],
CORE_SKIN_CARD_COVER_SIZE
[
1
],
cover1
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_COVER2
,
CORE_SKIN_CARD_COVER_SIZE
[
0
],
CORE_SKIN_CARD_COVER_SIZE
[
1
],
cover2
);
cover1
.
setOnClickListener
((
v
)
->
{
//打开系统文件相册
String
outFile
=
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_COVER
).
getAbsolutePath
();
...
...
@@ -260,9 +264,9 @@ public class SettingFragment extends PreferenceFragmentPlus {
ImageView
bg
=
viewDialog
.
findViewById
(
R
.
id
.
bg
);
ImageView
bg_menu
=
viewDialog
.
findViewById
(
R
.
id
.
bg_menu
);
ImageView
bg_deck
=
viewDialog
.
findViewById
(
R
.
id
.
bg_deck
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_BG
,
CORE_SKIN_BG_SIZE
[
0
],
CORE_SKIN_BG_SIZE
[
1
],
bg
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_BG_MENU
,
CORE_SKIN_BG_SIZE
[
0
],
CORE_SKIN_BG_SIZE
[
1
],
bg_menu
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_BG_DECK
,
CORE_SKIN_BG_SIZE
[
0
],
CORE_SKIN_BG_SIZE
[
1
],
bg_deck
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_BG
,
CORE_SKIN_BG_SIZE
[
0
],
CORE_SKIN_BG_SIZE
[
1
],
bg
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_BG_MENU
,
CORE_SKIN_BG_SIZE
[
0
],
CORE_SKIN_BG_SIZE
[
1
],
bg_menu
);
setImage
(
mSettings
.
getCoreSkinPath
()
+
"/"
+
Constants
.
CORE_SKIN_BG_DECK
,
CORE_SKIN_BG_SIZE
[
0
],
CORE_SKIN_BG_SIZE
[
1
],
bg_deck
);
bg
.
setOnClickListener
((
v
)
->
{
//打开系统文件相册
String
outFile
=
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_BG
).
getAbsolutePath
();
...
...
@@ -351,13 +355,13 @@ public class SettingFragment extends PreferenceFragmentPlus {
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
layoutParams
.
gravity
=
Gravity
.
CENTER_HORIZONTAL
;
frameLayout
.
addView
(
imageView
,
layoutParams
);
// builder.setContentView(frameLayout);
// builder.setContentView(frameLayout);
//builder.setLeftButtonText(R.string.settings);
//builder.setLeftButtonListener((dlg, s) -> {
showImageCropChooser
(
preference
,
getString
(
R
.
string
.
dialog_select_image
),
outFile
,
isJpeg
,
outWidth
,
outHeight
);
//dlg.dismiss();
// });
showImageCropChooser
(
preference
,
getString
(
R
.
string
.
dialog_select_image
),
outFile
,
isJpeg
,
outWidth
,
outHeight
);
//dlg.dismiss();
// });
// builder.setOnCancelListener((dlg) -> {
// BitmapUtil.destroy(imageView.getDrawable());
// });
...
...
@@ -371,7 +375,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
}
public
void
setImage
(
String
outFile
,
int
outWidth
,
int
outHeight
,
ImageView
imageView
)
{
public
void
setImage
(
String
outFile
,
int
outWidth
,
int
outHeight
,
ImageView
imageView
)
{
File
img
=
new
File
(
outFile
);
if
(
img
.
exists
())
{
Glide
.
with
(
this
).
load
(
img
).
signature
(
new
StringSignature
(
img
.
getName
()
+
img
.
lastModified
()))
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
24770900
...
...
@@ -219,4 +219,5 @@
<string
name=
"bgSelect"
>
배경으로 사용할 이미지를 선택하세요.
</string>
<string
name=
"avatarSelect"
>
아바타로 사용할 이미지를 선택하세요.
</string>
<string
name=
"ClickLinkArrows"
>
활성화된 링크마커
</string>
<string
name=
"Already_Lastest"
>
이미 최신 버전입니다.
</string>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
24770900
...
...
@@ -219,4 +219,5 @@
<string
name=
"bgSelect"
>
点击相应背景选择文件
</string>
<string
name=
"avatarSelect"
>
点击相应头像选择文件
</string>
<string
name=
"ClickLinkArrows"
>
点亮箭头
</string>
<string
name=
"Already_Lastest"
>
已经是最新版本
</string>
</resources>
mobile/src/main/res/values/strings.xml
View file @
24770900
...
...
@@ -222,4 +222,5 @@
<string
name=
"bgSelect"
>
click background and select files
</string>
<string
name=
"avatarSelect"
>
click avatar and select files
</string>
<string
name=
"ClickLinkArrows"
>
click link arrows
</string>
<string
name=
"Already_Lastest"
>
Already be the Lastest Version
</string>
</resources>
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