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
1cb563a4
Commit
1cb563a4
authored
Oct 26, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/fallenstardust/YGOMobile-cn-ko-en
parents
3c20e61f
0e4babd2
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
617 additions
and
695 deletions
+617
-695
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+9
-18
Classes/gframe/gframe.cpp
Classes/gframe/gframe.cpp
+0
-1
Classes/gframe/sound_manager.h
Classes/gframe/sound_manager.h
+2
-0
build.gradle
build.gradle
+1
-1
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
+2
-0
mobile/build.gradle
mobile/build.gradle
+3
-3
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+2
-1
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
+2
-3
mobile/src/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
...c/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
+17
-26
mobile/src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
...src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
+5
-2
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
.../src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
+0
-2
mobile/src/main/java/cn/garymb/ygomobile/loader/ImageLoader.java
...src/main/java/cn/garymb/ygomobile/loader/ImageLoader.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
+14
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/SimpleSpinnerItem.java
...va/cn/garymb/ygomobile/ui/adapters/SimpleSpinnerItem.java
+5
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+38
-29
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
...java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
+5
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
.../main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
+1
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
+22
-9
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
.../java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
+13
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+9
-6
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableListDialog.java
...a/cn/garymb/ygomobile/ui/widget/SearchableListDialog.java
+59
-147
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableSpinner.java
...java/cn/garymb/ygomobile/ui/widget/SearchableSpinner.java
+32
-49
mobile/src/main/java/cn/garymb/ygomobile/utils/CardUtils.java
...le/src/main/java/cn/garymb/ygomobile/utils/CardUtils.java
+13
-41
mobile/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
...le/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
+1
-13
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
...rc/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
+340
-320
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+2
-2
mobile/src/main/res/layout/nav_card_search.xml
mobile/src/main/res/layout/nav_card_search.xml
+14
-13
mobile/src/main/res/values/colors.xml
mobile/src/main/res/values/colors.xml
+3
-0
No files found.
Classes/gframe/game.cpp
View file @
1cb563a4
...
...
@@ -131,20 +131,17 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
ILogger
*
logger
=
device
->
getLogger
();
// logger->setLogLevel(ELL_WARNING);
isPSEnabled
=
options
->
isPendulumScaleEnabled
();
dataManager
.
FileSystem
=
device
->
getFileSystem
();
((
CIrrDeviceAndroid
*
)
device
)
->
onAppCmd
=
onHandleAndroidCommand
;
xScale
=
android
::
getXScale
(
app
);
yScale
=
android
::
getYScale
(
app
);
char
log_scale
[
256
]
=
{
0
};
sprintf
(
log_scale
,
"xScale = %f, yScale = %f"
,
xScale
,
yScale
);
Printer
::
log
(
log_scale
);
ALOGD
(
"xScale = %f, yScale = %f"
,
xScale
,
yScale
);
//io::path databaseDir = options->getDBDir();
io
::
path
workingDir
=
options
->
getWorkDir
();
char
log_working
[
256
]
=
{
0
};
sprintf
(
log_working
,
"workingDir= %s"
,
workingDir
.
c_str
());
Printer
::
log
(
log_working
);
ALOGD
(
"workingDir= %s"
,
workingDir
.
c_str
());
dataManager
.
FileSystem
->
changeWorkingDirectoryTo
(
workingDir
);
/* Your media must be somewhere inside the assets folder. The assets folder is the root for the file system.
...
...
@@ -201,9 +198,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
}
else
{
isNPOTSupported
=
((
COGLES1Driver
*
)
driver
)
->
queryOpenGLFeature
(
COGLES1ExtensionHandler
::
IRR_OES_texture_npot
);
}
char
log_npot
[
256
];
sprintf
(
log_npot
,
"isNPOTSupported = %d"
,
isNPOTSupported
);
Printer
::
log
(
log_npot
);
ALOGD
(
"isNPOTSupported = %d"
,
isNPOTSupported
);
if
(
isNPOTSupported
)
{
if
(
quality
==
1
)
{
driver
->
setTextureCreationFlag
(
irr
::
video
::
ETCF_CREATE_MIP_MAPS
,
false
);
...
...
@@ -1301,14 +1296,14 @@ void Game::MainLoop() {
if
(
!
driver
->
queryFeature
(
video
::
EVDF_PIXEL_SHADER_1_1
)
&&
!
driver
->
queryFeature
(
video
::
EVDF_ARB_FRAGMENT_PROGRAM_1
))
{
Printer
::
log
(
"WARNING: Pixel shaders disabled "
ALOGD
(
"WARNING: Pixel shaders disabled "
"because of missing driver/hardware support."
);
psFileName
=
""
;
}
if
(
!
driver
->
queryFeature
(
video
::
EVDF_VERTEX_SHADER_1_1
)
&&
!
driver
->
queryFeature
(
video
::
EVDF_ARB_VERTEX_PROGRAM_1
))
{
Printer
::
log
(
"WARNING: Vertex shaders disabled "
ALOGD
(
"WARNING: Vertex shaders disabled "
"because of missing driver/hardware support."
);
solidvsFileName
=
""
;
TACvsFileName
=
""
;
...
...
@@ -1316,7 +1311,6 @@ void Game::MainLoop() {
}
video
::
IGPUProgrammingServices
*
gpu
=
driver
->
getGPUProgrammingServices
();
if
(
gpu
)
{
char
log_custom_shader
[
1024
];
const
video
::
E_GPU_SHADING_LANGUAGE
shadingLanguage
=
video
::
EGSL_DEFAULT
;
ogles2Solid
=
gpu
->
addHighLevelShaderMaterialFromFiles
(
psFileName
,
"vertexMain"
,
video
::
EVST_VS_1_1
,
...
...
@@ -1330,12 +1324,9 @@ void Game::MainLoop() {
psFileName
,
"vertexMain"
,
video
::
EVST_VS_1_1
,
blendvsFileName
,
"pixelMain"
,
video
::
EPST_PS_1_1
,
&
customShadersCallback
,
video
::
EMT_ONETEXTURE_BLEND
,
0
,
shadingLanguage
);
sprintf
(
log_custom_shader
,
"ogles2Sold = %d"
,
ogles2Solid
);
Printer
::
log
(
log_custom_shader
);
sprintf
(
log_custom_shader
,
"ogles2BlendTexture = %d"
,
ogles2BlendTexture
);
Printer
::
log
(
log_custom_shader
);
sprintf
(
log_custom_shader
,
"ogles2TrasparentAlpha = %d"
,
ogles2TrasparentAlpha
);
Printer
::
log
(
log_custom_shader
);
ALOGD
(
"ogles2Sold = %d"
,
ogles2Solid
);
ALOGD
(
"ogles2BlendTexture = %d"
,
ogles2BlendTexture
);
ALOGD
(
"ogles2TrasparentAlpha = %d"
,
ogles2TrasparentAlpha
);
}
}
matManager
.
mCard
.
MaterialType
=
(
video
::
E_MATERIAL_TYPE
)
ogles2BlendTexture
;
...
...
Classes/gframe/gframe.cpp
View file @
1cb563a4
...
...
@@ -41,7 +41,6 @@ int GetListBoxIndex(IGUIListBox* listbox, const wchar_t * target){
}
void
android_main
(
ANDROID_APP
app
)
{
app
->
inputPollSource
.
process
=
android
::
process_input
;
app_dummy
();
#else
int
main
(
int
argc
,
char
*
argv
[])
{
#endif
...
...
Classes/gframe/sound_manager.h
View file @
1cb563a4
...
...
@@ -85,6 +85,8 @@ private:
bool
musicEnabled
=
false
;
};
//extern SoundManager soundManager;
}
#endif //SOUNDMANAGER_H
\ No newline at end of file
build.gradle
View file @
1cb563a4
...
...
@@ -9,7 +9,7 @@ buildscript {
google
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:
4.2.1
'
classpath
'com.android.tools.build:gradle:
7.0.3
'
classpath
'com.android.tools.build:gradle-experimental:0.11.1'
//classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
1cb563a4
...
...
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
6.7.1
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
7.0.2
-all.zip
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
View file @
1cb563a4
...
...
@@ -186,6 +186,8 @@ static void* join_game_thread(void* param) {
ygo
::
mainGame
->
gMutex
.
unlock
();
return
NULL
;
}
//auto exit when join game by mycard.
exit_on_return
=
true
;
irr
::
android
::
YGOGameOptions
options
=
irr
::
android
::
YGOGameOptions
(
param
);
irr
::
SEvent
event
;
...
...
mobile/build.gradle
View file @
1cb563a4
...
...
@@ -77,10 +77,10 @@ android {
exclude
'META-INF/LICENSE'
exclude
'META-INF/rxjava.properties'
}
a
aptOption
s
{
noCompress
'dll'
,
"config"
a
ndroidResource
s
{
noCompress
'dll'
,
'config'
}
// buildToolsVersion '28.0.3'
// buildToolsVersion '28.0.3'
}
repositories
{
...
...
mobile/src/main/AndroidManifest.xml
View file @
1cb563a4
...
...
@@ -177,7 +177,8 @@
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:launchMode=
"singleTop"
android:theme=
"@style/AppTheme.Mycard"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
<activity
android:name=
"cn.garymb.ygomobile.ui.mycard.mcchat.McchatActivity"
android:label=
"@string/app_name"
...
...
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
View file @
1cb563a4
...
...
@@ -113,8 +113,8 @@ public class GameUriManager {
}
return
new
File
(
dir
,
"tmp_"
+
System
.
currentTimeMillis
()
+
".ydk"
);
}
else
{
IOUtils
.
createFolder
(
dir
);
file
=
new
File
(
dir
,
name
+
".ydk"
);
IOUtils
.
createFolder
(
dir
);
file
=
new
File
(
dir
,
name
+
".ydk"
);
}
return
file
;
}
...
...
@@ -197,7 +197,6 @@ public class GameUriManager {
}
private
void
doUri
(
Uri
uri
)
{
Intent
startSeting
=
new
Intent
(
activity
,
SettingsActivity
.
class
);
if
(
"file"
.
equals
(
uri
.
getScheme
())
||
"content"
.
equals
(
uri
.
getScheme
()))
{
File
file
=
toLocalFile
(
uri
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
View file @
1cb563a4
...
...
@@ -6,48 +6,39 @@ import cn.garymb.ygomobile.bean.TextSelect;
public
class
DeckFile
extends
TextSelect
{
private
String
name
;
private
String
path
;
private
Long
date
;
private
final
File
path
;
private
final
String
fullName
;
public
DeckFile
(
String
path
)
{
this
.
path
=
path
;
name
=
new
File
(
path
).
getName
();
int
end
=
name
.
lastIndexOf
(
"."
);
if
(
end
!=
-
1
)
name
=
name
.
substring
(
0
,
end
);
super
.
setName
(
name
);
setObject
(
this
);
this
(
new
File
(
path
));
}
public
DeckFile
(
File
file
)
{
path
=
file
.
getAbsolutePath
();
name
=
file
.
getName
();
name
=
name
.
substring
(
0
,
name
.
lastIndexOf
(
"."
));
date
=
file
.
lastModified
();
path
=
file
;
fullName
=
file
.
getName
();
String
name
=
fullName
;
int
index
=
name
.
lastIndexOf
(
"."
);
if
(
index
>
0
)
{
name
=
name
.
substring
(
0
,
index
);
}
super
.
setName
(
name
);
setObject
(
this
);
}
public
String
getName
()
{
return
name
;
}
public
String
getFileName
(){
return
new
File
(
path
).
getName
();
public
String
getFileName
()
{
return
fullName
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
public
File
getPathFile
(
)
{
return
path
;
}
public
String
getPath
()
{
return
path
;
return
path
.
getAbsolutePath
()
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
public
Long
getDate
(
)
{
return
path
.
lastModified
()
;
}
public
Long
getDate
()
{
return
date
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
View file @
1cb563a4
...
...
@@ -3,8 +3,11 @@ package cn.garymb.ygomobile.loader;
import
android.text.TextUtils
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Locale
;
import
ocgcore.DataManager
;
import
ocgcore.data.Card
;
...
...
@@ -72,10 +75,10 @@ public class CardKeyWord {
private
final
long
setcode
;
//包含系列,或者包含名字、描述
public
NameFilter
(
String
word
,
boolean
exclude
,
boolean
onlyText
)
{
public
NameFilter
(
@NonNull
String
word
,
boolean
exclude
,
boolean
onlyText
)
{
this
.
setcode
=
onlyText
?
0
:
DataManager
.
get
().
getStringManager
().
getSetCode
(
word
);
this
.
exclude
=
exclude
;
this
.
word
=
word
;
this
.
word
=
word
.
toLowerCase
(
Locale
.
US
)
;
if
(
this
.
setcode
>
0
){
Log
.
d
(
TAG
,
"filter:setcode="
+
setcode
+
", exclude="
+
exclude
+
", word="
+
word
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
View file @
1cb563a4
...
...
@@ -29,7 +29,6 @@ import ocgcore.enums.LimitType;
public
class
CardLoader
implements
ICardSearcher
{
private
final
LimitManager
mLimitManager
;
private
final
CardManager
mCardManager
;
private
final
StringManager
mStringManager
;
private
final
Context
context
;
private
CallBack
mCallBack
;
private
LimitList
mLimitList
;
...
...
@@ -50,7 +49,6 @@ public class CardLoader implements ICardSearcher {
this
.
context
=
context
;
mLimitManager
=
DataManager
.
get
().
getLimitManager
();
mCardManager
=
DataManager
.
get
().
getCardManager
();
mStringManager
=
DataManager
.
get
().
getStringManager
();
mLimitList
=
mLimitManager
.
getTopLimit
();
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/ImageLoader.java
View file @
1cb563a4
...
...
@@ -68,7 +68,7 @@ public class ImageLoader implements Closeable {
private
final
boolean
useCache
;
private
static
final
String
TAG
=
ImageLoader
.
class
.
getSimpleName
();
private
final
Map
<
String
,
ZipFile
>
zipFileCache
=
new
ConcurrentHashMap
<>();
private
final
Map
<
Long
,
Cache
>
zipDataCache
=
new
ConcurrentHashMap
<>();
private
final
Map
<
Long
,
ImageLoader
.
Cache
>
zipDataCache
=
new
ConcurrentHashMap
<>();
private
ZipFile
mDefaultZipFile
;
private
File
mPicsFile
;
...
...
@@ -182,7 +182,7 @@ public class ImageLoader implements Closeable {
try
{
RequestBuilder
<
Drawable
>
resource
=
GlideCompat
.
with
(
imageview
.
getContext
()).
load
(
file
);
setDefaults
(
resource
,
new
MediaStoreSignature
(
"image/*"
,
file
.
lastModified
(),
Type
.
origin
.
getId
()),
new
MediaStoreSignature
(
"image/*"
,
file
.
lastModified
(),
ImageLoader
.
Type
.
origin
.
getId
()),
pre
,
type
);
resource
.
into
(
imageview
);
}
catch
(
Exception
e
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
View file @
1cb563a4
package
cn.garymb.ygomobile.ui.adapters
;
import
android.content.Context
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
com.tubb.smrv.SwipeHorizontalMenuLayout
;
import
org.greenrobot.eventbus.EventBus
;
...
...
@@ -63,6 +66,14 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
return
false
;
}
public
void
notifyItemChanged
(
Card
card
)
{
for
(
int
i
=
0
;
i
<
getItemCount
();
i
++)
{
if
(
getCard
(
i
).
Code
==
card
.
Code
)
{
notifyItemChanged
(
i
);
}
}
}
public
void
hideMenu
(
View
view
)
{
if
(
view
==
null
)
{
view
=
mShowMenuView
;
...
...
@@ -88,6 +99,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
}
}
@NonNull
@Override
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
view
=
inflate
(
R
.
layout
.
item_search_card_swipe
,
parent
,
false
);
...
...
@@ -100,8 +112,8 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
}
@Override
public
void
onBindViewHolder
(
ViewHolder
holder
,
int
position
)
{
Card
item
=
get
Item
(
position
);
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
Card
item
=
get
Card
(
position
);
if
(
item
==
null
){
return
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/SimpleSpinnerItem.java
View file @
1cb563a4
package
cn.garymb.ygomobile.ui.adapters
;
import
androidx.annotation.NonNull
;
public
class
SimpleSpinnerItem
{
public
long
value
;
public
String
text
;
public
Object
tag
;
public
transient
Object
tag
;
public
SimpleSpinnerItem
(
long
value
,
String
text
)
{
this
.
value
=
value
;
...
...
@@ -20,8 +22,9 @@ public class SimpleSpinnerItem {
return
this
;
}
@NonNull
@Override
public
String
toString
()
{
return
text
;
return
""
+
text
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
1cb563a4
...
...
@@ -107,6 +107,9 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
ll_bar
.
setVisibility
(
View
.
GONE
);
imageLoader
.
bindImage
(
photoView
,
msg
.
arg1
,
ImageLoader
.
Type
.
origin
);
imageLoader
.
bindImage
(
cardImage
,
msg
.
arg1
,
ImageLoader
.
Type
.
middle
);
if
(
mListener
!=
null
){
mListener
.
onImageUpdate
(
mCardInfo
);
}
break
;
case
TYPE_DOWNLOAD_CARD_IMAGE_ING:
tv_loading
.
setText
(
msg
.
arg1
+
"%"
);
...
...
@@ -128,32 +131,32 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
public
CardDetail
(
BaseActivity
context
,
ImageLoader
imageLoader
,
StringManager
stringManager
)
{
super
(
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
dialog_cardinfo
,
null
));
mContext
=
context
;
cardImage
=
bin
d
(
R
.
id
.
card_image
);
cardImage
=
findViewByI
d
(
R
.
id
.
card_image
);
this
.
imageLoader
=
imageLoader
;
mStringManager
=
stringManager
;
name
=
bin
d
(
R
.
id
.
text_name
);
desc
=
bin
d
(
R
.
id
.
text_desc
);
close
=
bin
d
(
R
.
id
.
btn_close
);
cardCode
=
bin
d
(
R
.
id
.
card_code
);
level
=
bin
d
(
R
.
id
.
card_level
);
linkArrow
=
bin
d
(
R
.
id
.
detail_link_arrows
);
type
=
bin
d
(
R
.
id
.
card_type
);
View
faq
=
bin
d
(
R
.
id
.
btn_faq
);
cardAtk
=
bin
d
(
R
.
id
.
card_atk
);
cardDef
=
bin
d
(
R
.
id
.
card_def
);
atkdefView
=
bin
d
(
R
.
id
.
layout_atkdef2
);
mImageFav
=
bin
d
(
R
.
id
.
image_fav
);
monsterLayout
=
bin
d
(
R
.
id
.
layout_monster
);
layoutDetailPScale
=
bin
d
(
R
.
id
.
detail_p_scale
);
detailCardScale
=
bin
d
(
R
.
id
.
detail_cardscale
);
race
=
bin
d
(
R
.
id
.
card_race
);
setName
=
bin
d
(
R
.
id
.
card_setname
);
addMain
=
bin
d
(
R
.
id
.
btn_add_main
);
addSide
=
bin
d
(
R
.
id
.
btn_add_side
);
otView
=
bin
d
(
R
.
id
.
card_ot
);
attrView
=
bin
d
(
R
.
id
.
card_attribute
);
lbSetCode
=
bin
d
(
R
.
id
.
label_setcode
);
name
=
findViewByI
d
(
R
.
id
.
text_name
);
desc
=
findViewByI
d
(
R
.
id
.
text_desc
);
close
=
findViewByI
d
(
R
.
id
.
btn_close
);
cardCode
=
findViewByI
d
(
R
.
id
.
card_code
);
level
=
findViewByI
d
(
R
.
id
.
card_level
);
linkArrow
=
findViewByI
d
(
R
.
id
.
detail_link_arrows
);
type
=
findViewByI
d
(
R
.
id
.
card_type
);
View
faq
=
findViewByI
d
(
R
.
id
.
btn_faq
);
cardAtk
=
findViewByI
d
(
R
.
id
.
card_atk
);
cardDef
=
findViewByI
d
(
R
.
id
.
card_def
);
atkdefView
=
findViewByI
d
(
R
.
id
.
layout_atkdef2
);
mImageFav
=
findViewByI
d
(
R
.
id
.
image_fav
);
monsterLayout
=
findViewByI
d
(
R
.
id
.
layout_monster
);
layoutDetailPScale
=
findViewByI
d
(
R
.
id
.
detail_p_scale
);
detailCardScale
=
findViewByI
d
(
R
.
id
.
detail_cardscale
);
race
=
findViewByI
d
(
R
.
id
.
card_race
);
setName
=
findViewByI
d
(
R
.
id
.
card_setname
);
addMain
=
findViewByI
d
(
R
.
id
.
btn_add_main
);
addSide
=
findViewByI
d
(
R
.
id
.
btn_add_side
);
otView
=
findViewByI
d
(
R
.
id
.
card_ot
);
attrView
=
findViewByI
d
(
R
.
id
.
card_attribute
);
lbSetCode
=
findViewByI
d
(
R
.
id
.
label_setcode
);
cardManager
=
DataManager
.
get
().
getCardManager
();
close
.
setOnClickListener
((
v
)
->
{
if
(
mListener
!=
null
)
{
...
...
@@ -187,10 +190,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
mListener
.
onOpenUrl
(
cardInfo
);
}
});
bin
d
(
R
.
id
.
lastone
).
setOnClickListener
((
v
)
->
{
findViewByI
d
(
R
.
id
.
lastone
).
setOnClickListener
((
v
)
->
{
onPreCard
();
});
bin
d
(
R
.
id
.
nextone
).
setOnClickListener
((
v
)
->
{
findViewByI
d
(
R
.
id
.
nextone
).
setOnClickListener
((
v
)
->
{
onNextCard
();
});
mImageFav
.
setOnClickListener
((
v
)
->
{
...
...
@@ -532,9 +535,6 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
}
}
private
<
T
extends
View
>
T
bind
(
int
id
)
{
return
(
T
)
findViewById
(
id
);
}
public
interface
OnFavoriteChangedListener
{
void
onFavoriteChange
(
Card
card
,
boolean
favorite
);
...
...
@@ -547,6 +547,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
void
onAddSideCard
(
Card
cardInfo
);
void
onImageUpdate
(
Card
cardInfo
);
void
onClose
();
}
...
...
@@ -563,6 +567,11 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
public
void
onClose
()
{
}
@Override
public
void
onImageUpdate
(
Card
cardInfo
)
{
}
@Override
public
void
onAddSideCard
(
Card
cardInfo
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
View file @
1cb563a4
...
...
@@ -291,6 +291,11 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
WebActivity
.
openFAQ
(
getContext
(),
cardInfo
);
}
@Override
public
void
onImageUpdate
(
Card
cardInfo
)
{
mCardListAdapter
.
notifyItemChanged
(
cardInfo
);
}
@Override
public
void
onClose
()
{
mDialog
.
dismiss
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
View file @
1cb563a4
...
...
@@ -120,6 +120,7 @@ public class CardSearcher implements View.OnClickListener {
resetButton
.
setOnClickListener
(
this
);
mCardLoader
=
dataLoader
;
// setCodeSpinner.setFirstIndex(1);
OnEditorActionListener
searchListener
=
(
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
InputMethodManager
imm
=
(
InputMethodManager
)
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
View file @
1cb563a4
...
...
@@ -38,7 +38,6 @@ import com.feihua.dialogutils.util.DialogUtils;
import
com.nightonke.boommenu.BoomButtons.BoomButton
;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
import
com.nightonke.boommenu.BoomMenuButton
;
import
com.ourygo.assistant.service.DuelAssistantService
;
import
com.ourygo.assistant.util.DuelAssistantManagement
;
import
org.greenrobot.eventbus.EventBus
;
...
...
@@ -420,6 +419,12 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
WebActivity
.
openFAQ
(
getContext
(),
cardInfo
);
}
@Override
public
void
onImageUpdate
(
Card
cardInfo
)
{
mDeckAdapater
.
notifyItemChanged
(
cardInfo
);
mCardListAdapter
.
notifyItemChanged
(
cardInfo
);
}
@Override
public
void
onClose
()
{
mDialog
.
dismiss
();
...
...
@@ -1117,7 +1122,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public
void
onDeckSelect
(
DeckFile
deckFile
)
{
loadDeckFromFile
(
new
File
(
deckFile
.
getPath
()
));
loadDeckFromFile
(
deckFile
.
getPathFile
(
));
}
@Override
...
...
@@ -1127,7 +1132,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
return
;
String
currentDeckPath
=
deck
.
getAbsolutePath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
deckFile
.
getPath
().
equals
(
currentDeckPath
))
{
if
(
TextUtils
.
equals
(
deckFile
.
getPath
(),
currentDeckPath
))
{
List
<
File
>
files
=
getYdkFiles
();
File
file
=
null
;
if
(
files
!=
null
&&
files
.
size
()
>
0
)
{
...
...
@@ -1145,10 +1150,14 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public
void
onDeckMove
(
List
<
DeckFile
>
deckFileList
,
DeckType
toDeckType
)
{
String
currentDeckPath
=
mDeckAdapater
.
getYdkFile
().
getAbsolutePath
();
File
ydk
=
mDeckAdapater
.
getYdkFile
();
if
(
ydk
==
null
){
return
;
}
String
currentDeckPath
=
ydk
.
getPath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
deckFile
.
getPath
().
equals
(
currentDeckPath
))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
Name
()
+
".ydk"
));
if
(
TextUtils
.
equals
(
currentDeckPath
,
deckFile
.
getPath
()
))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
FileName
()
));
return
;
}
}
...
...
@@ -1156,10 +1165,14 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public
void
onDeckCopy
(
List
<
DeckFile
>
deckFileList
,
DeckType
toDeckType
)
{
String
currentDeckPath
=
mDeckAdapater
.
getYdkFile
().
getAbsolutePath
();
File
ydk
=
mDeckAdapater
.
getYdkFile
();
if
(
ydk
==
null
){
return
;
}
String
currentDeckPath
=
ydk
.
getPath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
deckFile
.
getPath
().
equals
(
currentDeckPath
))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
Name
()
+
".ydk"
));
if
(
TextUtils
.
equals
(
currentDeckPath
,
deckFile
.
getPath
()
))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
FileName
()
));
return
;
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
View file @
1cb563a4
...
...
@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.Nullable
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.io.File
;
...
...
@@ -189,7 +190,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
}
@Override
public
Card
getCard
(
int
posotion
)
{
public
@Nullable
Card
getCard
(
int
posotion
)
{
int
count
=
mMainCount
;
int
index
=
0
;
if
(
posotion
<
count
)
{
...
...
@@ -388,7 +389,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
return
mLimitList
;
}
public
File
getYdkFile
(){
public
@Nullable
File
getYdkFile
(){
if
(
mDeckInfo
!=
null
){
return
mDeckInfo
.
source
;
}
...
...
@@ -477,6 +478,16 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
mItems
.
add
(
deckItem
);
}
public
void
notifyItemChanged
(
Card
card
){
for
(
int
i
=
0
;
i
<
getItemCount
();
i
++)
{
DeckItem
item
=
getItem
(
i
);
Card
c
=
item
.
getCardInfo
();
if
(
c
!=
null
&&
c
.
Code
==
card
.
Code
)
{
notifyItemChanged
(
i
);
}
}
}
public
void
addItem
(
int
pos
,
DeckItem
deckItem
)
{
if
(
deckItem
.
getCardInfo
()
!=
null
)
{
if
(
pos
>=
DeckItem
.
MainStart
&&
pos
<=
DeckItem
.
MainEnd
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
1cb563a4
...
...
@@ -142,12 +142,15 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
};
//x5内核初始化接口
QbSdk
.
initX5Environment
(
this
,
cb
);
if
(!
Constants
.
ACTION_OPEN_GAME
.
equals
(
getIntent
().
getAction
()))
{
Log
.
d
(
Constants
.
TAG
,
"start check update"
);
//check update
Beta
.
checkUpgrade
(
false
,
false
);
}
else
{
Log
.
d
(
Constants
.
TAG
,
"skip check update"
);
if
(!
BuildConfig
.
BUILD_TYPE
.
equals
(
"debug"
))
{
//release才检查版本
if
(!
Constants
.
ACTION_OPEN_GAME
.
equals
(
getIntent
().
getAction
()))
{
Log
.
d
(
Constants
.
TAG
,
"start check update"
);
//check update
Beta
.
checkUpgrade
(
false
,
false
);
}
else
{
Log
.
d
(
Constants
.
TAG
,
"skip check update"
);
}
}
//初始化决斗助手
initDuelAssistant
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableListDialog.java
View file @
1cb563a4
This diff is collapsed.
Click to expand it.
mobile/src/main/java/cn/garymb/ygomobile/ui/widget/SearchableSpinner.java
View file @
1cb563a4
...
...
@@ -3,7 +3,6 @@ package cn.garymb.ygomobile.ui.widget;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.ContextWrapper
;
import
android.content.DialogInterface
;
import
android.content.res.TypedArray
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
...
...
@@ -16,88 +15,81 @@ import android.widget.SpinnerAdapter;
import
androidx.appcompat.widget.AppCompatSpinner
;
import
java.util.ArrayList
;
import
java.util.List
;
import
cn.garymb.ygomobile.lite.R
;
public
class
SearchableSpinner
extends
AppCompatSpinner
implements
View
.
OnTouchListener
,
SearchableListDialog
.
SearchableItem
{
SearchableListDialog
.
onSearchItemClickListener
{
public
static
final
int
NO_ITEM_SELECTED
=
-
1
;
private
Context
_context
;
private
List
_items
;
private
SearchableListDialog
_searchableListDialog
;
private
final
ArrayList
<
Object
>
_items
=
new
ArrayList
<>();
private
boolean
_isDirty
;
private
BaseAdapter
_arrayAdapter
;
private
String
_strHintText
;
private
boolean
_isFromInit
;
private
String
mTitleString
=
"Select Item"
;
private
int
mFirstIndex
=
0
;
public
SearchableSpinner
(
Context
context
)
{
super
(
context
);
this
.
_context
=
context
;
init
();
this
(
context
,
null
);
}
public
SearchableSpinner
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
this
.
_context
=
context
;
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SearchableSpinner
);
final
int
N
=
a
.
getIndexCount
();
for
(
int
i
=
0
;
i
<
N
;
++
i
)
{
int
attr
=
a
.
getIndex
(
i
);
if
(
attr
==
R
.
styleable
.
SearchableSpinner_hintText
)
{
_strHintText
=
a
.
getString
(
attr
);
}
else
if
(
attr
==
R
.
styleable
.
SearchableSpinner_searchTitle
)
{
mTitleString
=
a
.
getString
(
attr
);
}
}
a
.
recycle
();
init
();
this
(
context
,
attrs
,
0
);
}
public
SearchableSpinner
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
this
.
_context
=
context
;
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SearchableSpinner
);
if
(
a
!=
null
)
{
final
int
N
=
a
.
getIndexCount
();
for
(
int
i
=
0
;
i
<
N
;
++
i
)
{
int
attr
=
a
.
getIndex
(
i
);
if
(
attr
==
R
.
styleable
.
SearchableSpinner_hintText
)
{
_strHintText
=
a
.
getString
(
attr
);
}
else
if
(
attr
==
R
.
styleable
.
SearchableSpinner_searchTitle
)
{
mTitleString
=
a
.
getString
(
attr
);
}
}
a
.
recycle
();
}
init
();
}
private
void
init
()
{
_items
=
new
ArrayList
();
_searchableListDialog
=
SearchableListDialog
.
newInstance
(
_items
);
_searchableListDialog
=
new
SearchableListDialog
(
getContext
());
_searchableListDialog
.
setTitle
(
mTitleString
);
_searchableListDialog
.
setOnSearchableItemClickListener
(
this
);
setOnTouchListener
(
this
);
_arrayAdapter
=
(
BaseAdapter
)
getAdapter
();
if
(!
TextUtils
.
isEmpty
(
_strHintText
))
{
ArrayAdapter
arrayAdapter
=
new
ArrayAdapter
(
_context
,
android
.
R
.
layout
.
simple_list_item_1
,
new
String
[]{
_strHintText
});
ArrayAdapter
<
String
>
arrayAdapter
=
new
ArrayAdapter
<>(
getContext
(),
android
.
R
.
layout
.
simple_list_item_1
,
new
String
[]{
_strHintText
});
_isFromInit
=
true
;
setAdapter
(
arrayAdapter
);
}
}
public
void
setFirstIndex
(
int
firstIndex
)
{
this
.
mFirstIndex
=
firstIndex
;
}
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
if
(
event
.
getAction
()
==
MotionEvent
.
ACTION_UP
)
{
if
(
null
!=
_arrayAdapter
)
{
// Refresh content #6
// Change Start
// Description: The items were only set initially, not reloading the data in the
// spinner every time it is loaded with items in the adapter.
// Change end.
//修复 重复点击 bug
if
(!
_searchableListDialog
.
isAdded
())
{
if
(!
_searchableListDialog
.
isShowing
())
{
_items
.
clear
();
for
(
int
i
=
0
;
i
<
_arrayAdapter
.
getCount
();
i
++)
{
int
N
=
_arrayAdapter
.
getCount
();
for
(
int
i
=
mFirstIndex
;
i
<
N
;
i
++)
{
_items
.
add
(
_arrayAdapter
.
getItem
(
i
));
}
_searchableListDialog
.
show
(
scanForActivity
(
_context
).
getFragmentManager
(),
"TAG"
);
_searchableListDialog
.
show
(
_items
);
}
}
}
...
...
@@ -109,7 +101,7 @@ public class SearchableSpinner extends AppCompatSpinner implements View.OnTouchL
if
(!
_isFromInit
)
{
_arrayAdapter
=
(
BaseAdapter
)
adapter
;
if
(!
TextUtils
.
isEmpty
(
_strHintText
)
&&
!
_isDirty
)
{
ArrayAdapter
arrayAdapter
=
new
ArrayAdapter
(
_context
,
android
.
R
.
layout
ArrayAdapter
<
String
>
arrayAdapter
=
new
ArrayAdapter
<>(
getContext
()
,
android
.
R
.
layout
.
simple_list_item_1
,
new
String
[]{
_strHintText
});
super
.
setAdapter
(
arrayAdapter
);
}
else
{
...
...
@@ -124,8 +116,7 @@ public class SearchableSpinner extends AppCompatSpinner implements View.OnTouchL
@Override
public
void
onSearchableItemClicked
(
Object
item
,
int
position
)
{
setSelection
(
_items
.
indexOf
(
item
));
setSelection
(
_items
.
indexOf
(
item
)
+
mFirstIndex
);
if
(!
_isDirty
)
{
_isDirty
=
true
;
setAdapter
(
_arrayAdapter
);
...
...
@@ -137,14 +128,6 @@ public class SearchableSpinner extends AppCompatSpinner implements View.OnTouchL
_searchableListDialog
.
setTitle
(
strTitle
);
}
public
void
setPositiveButton
(
String
strPositiveButtonText
)
{
_searchableListDialog
.
setPositiveButton
(
strPositiveButtonText
);
}
public
void
setPositiveButton
(
String
strPositiveButtonText
,
DialogInterface
.
OnClickListener
onClickListener
)
{
_searchableListDialog
.
setPositiveButton
(
strPositiveButtonText
,
onClickListener
);
}
public
void
setOnSearchTextChangedListener
(
SearchableListDialog
.
OnSearchTextChanged
onSearchTextChanged
)
{
_searchableListDialog
.
setOnSearchTextChangedListener
(
onSearchTextChanged
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/CardUtils.java
View file @
1cb563a4
...
...
@@ -10,48 +10,20 @@ public class CardUtils {
public
static
String
getAllTypeString
(
Card
card
,
StringManager
stringManager
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
CardType
[]
cardTypes
=
CardType
.
values
();
boolean
isFrst
=
true
;
if
(
card
.
isType
(
CardType
.
Spell
))
{
for
(
CardType
type
:
cardTypes
)
{
if
(
card
.
isType
(
type
))
{
if
(!
isFrst
)
{
stringBuilder
.
append
(
"|"
);
}
else
{
isFrst
=
false
;
}
stringBuilder
.
append
(
stringManager
.
getTypeString
(
type
.
getId
()));
// break;
boolean
isFirst
=
true
;
for
(
CardType
type
:
cardTypes
)
{
if
(
card
.
isType
(
type
))
{
if
(!
isFirst
)
{
stringBuilder
.
append
(
"/"
);
}
else
{
isFirst
=
false
;
}
}
// stringBuilder.append(stringManager.getTypeString(CardType.Spell.value()));
}
else
if
(
card
.
isType
(
CardType
.
Trap
))
{
for
(
CardType
type
:
cardTypes
)
{
if
(
card
.
isType
(
type
))
{
if
(!
isFrst
)
{
stringBuilder
.
append
(
"|"
);
}
else
{
isFrst
=
false
;
}
stringBuilder
.
append
(
stringManager
.
getTypeString
(
type
.
getId
()));
}
// break;
}
// stringBuilder.append(stringManager.getTypeString(CardType.Trap.value()));
}
else
{
for
(
CardType
type
:
cardTypes
)
{
if
(
card
.
isType
(
type
))
{
if
(!
isFrst
)
{
stringBuilder
.
append
(
"/"
);
}
else
{
isFrst
=
false
;
}
String
str
=
stringManager
.
getTypeString
(
type
.
getId
());
if
(
TextUtils
.
isEmpty
(
str
))
{
stringBuilder
.
append
(
"0x"
);
stringBuilder
.
append
(
String
.
format
(
"%X"
,
type
.
getId
()));
}
else
{
stringBuilder
.
append
(
str
);
}
String
str
=
stringManager
.
getTypeString
(
type
.
getId
());
if
(
TextUtils
.
isEmpty
(
str
))
{
stringBuilder
.
append
(
"0x"
);
stringBuilder
.
append
(
String
.
format
(
"%X"
,
type
.
getId
()));
}
else
{
stringBuilder
.
append
(
str
);
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
View file @
1cb563a4
...
...
@@ -167,22 +167,10 @@ public class FileUtils {
}
public
static
void
copyFile
(
String
oldPath
,
String
newPath
)
throws
IOException
{
copyFile
(
oldPath
,
newPath
,
true
);
}
public
static
void
copyFile
(
String
oldPath
,
String
newPath
,
boolean
isName
)
throws
IOException
{
//判断复制后的路径是否含有文件名,如果没有则加上
if
(!
isName
)
{
//由于newPath是路径加文件名,所以获取要复制的文件名与复制后的路径组成新的newPath
String
abb
[]
=
oldPath
.
split
(
"/"
);
newPath
=
newPath
+
"/"
+
abb
[
abb
.
length
-
1
];
}
FileInputStream
fis
=
new
FileInputStream
(
oldPath
);
FileOutputStream
fos
=
new
FileOutputStream
(
newPath
);
byte
[]
buf
=
new
byte
[
1024
];
int
len
=
0
;
int
len
;
while
((
len
=
fis
.
read
(
buf
))
!=
-
1
)
{
fos
.
write
(
buf
,
0
,
len
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
View file @
1cb563a4
This diff is collapsed.
Click to expand it.
mobile/src/main/java/ocgcore/data/Card.java
View file @
1cb563a4
...
...
@@ -155,11 +155,11 @@ public class Card extends CardData implements Parcelable {
}
public
boolean
containsName
(
String
key
){
return
Name
!=
null
&&
Name
.
toLowerCase
(
Locale
.
US
).
contains
(
key
.
toLowerCase
(
Locale
.
US
)
);
return
Name
!=
null
&&
Name
.
toLowerCase
(
Locale
.
US
).
contains
(
key
);
}
public
boolean
containsDesc
(
String
key
){
return
Desc
!=
null
&&
Desc
.
toLowerCase
(
Locale
.
US
).
contains
(
key
.
toLowerCase
(
Locale
.
US
)
);
return
Desc
!=
null
&&
Desc
.
toLowerCase
(
Locale
.
US
).
contains
(
key
);
}
/**
...
...
mobile/src/main/res/layout/nav_card_search.xml
View file @
1cb563a4
<?xml version="1.0" encoding="utf-8"?>
<
Linea
rLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
androidx.coordinatorlayout.widget.Coordinato
rLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
...
...
@@ -242,6 +242,7 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"60dp"
android:orientation=
"horizontal"
>
<com.google.android.material.textfield.TextInputLayout
...
...
@@ -266,20 +267,11 @@
</LinearLayout>
<LinearLayout
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_
gravity=
"center_horizontal
"
android:layout_
marginBottom=
"60dp
"
android:orientation=
"horizontal"
>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_search"
android:layout_width=
"wrap_content"
android:layout_height=
"40dp"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/button_bg"
android:text=
"@string/search"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_reset"
android:layout_marginLeft=
"10dp"
...
...
@@ -289,6 +281,15 @@
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/button_bg"
android:text=
"@string/reset"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_search"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"10dp"
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/button_bg"
android:text=
"@string/search"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
mobile/src/main/res/values/colors.xml
View file @
1cb563a4
...
...
@@ -29,4 +29,7 @@
<color
name=
"colorMain"
>
#2196F3
</color>
<color
name=
"background"
>
#ECEFF1
</color>
<color
name=
"transparent"
>
#00000000
</color>
<color
name=
"search_text_color"
>
#ff8800
</color>
<color
name=
"search_list_item_color"
>
#b8be35
</color>
</resources>
\ No newline at end of file
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