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
5d70ba73
Commit
5d70ba73
authored
Apr 12, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CallBack 刷新收藏夹
parent
4eb41383
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
14 deletions
+63
-14
mobile/assets/changelog.html
mobile/assets/changelog.html
+5
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/BaseCardsAcitivity.java
...java/cn/garymb/ygomobile/ui/cards/BaseCardsAcitivity.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+30
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
...cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
+14
-0
mobile/src/main/java/ocgcore/ConfigManager.java
mobile/src/main/java/ocgcore/ConfigManager.java
+13
-7
No files found.
mobile/assets/changelog.html
View file @
5d70ba73
...
...
@@ -20,12 +20,15 @@
<pre>
更新:
1.更新ygo内核;
新增:
1.搜索结果增加卡片收藏夹列表;
2.卡片详情可增加/移出搜藏;
变更:
1.ygopro进程将不再能从
历史进程中被单独唤起。
游戏途中切回请点击“点此返回决斗”
游戏途中切回请点击“点此返回决斗”
;
2.未退出ygopro但重新从服务器进入游戏
不再重复建立房间而是回到当前游戏
不再重复建立房间而是回到当前游戏
;
</pre>
<h3
style=
"color:#ff0000"
>
注意
</h3>
<pre>
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/BaseCardsAcitivity.java
View file @
5d70ba73
...
...
@@ -142,7 +142,7 @@ public abstract class BaseCardsAcitivity extends BaseActivity implements CardLoa
}
public
void
AnimationShake2
(){
public
void
AnimationShake2
()
{
Animation
shake
=
AnimationUtils
.
loadAnimation
(
this
,
R
.
anim
.
shake
);
//加载动画资源文件
findViewById
(
R
.
id
.
cube2
).
startAnimation
(
shake
);
//给组件播放动画效果
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
5d70ba73
...
...
@@ -4,9 +4,9 @@ import android.annotation.SuppressLint;
import
android.content.DialogInterface
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.provider.ContactsContract
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -23,9 +23,11 @@ import androidx.annotation.NonNull;
import
com.feihua.dialogutils.util.DialogUtils
;
import
java.io.File
;
import
java.util.List
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.CardLoader
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
import
cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus
;
...
...
@@ -41,6 +43,8 @@ import ocgcore.StringManager;
import
ocgcore.data.Card
;
import
ocgcore.enums.CardType
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
cards
.
DeckManagerActivityImpl
.
Favorite
;
/***
* 卡片详情
*/
...
...
@@ -86,6 +90,14 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
ProgressBar
pb_loading
;
private
TextView
tv_loading
;
private
boolean
isDownloadCardImage
=
true
;
private
CallBack
mCallBack
;
public
interface
CallBack
{
void
onSearchStart
();
void
onSearchResult
(
List
<
Card
>
Cards
,
boolean
isHide
);
}
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
...
...
@@ -193,18 +205,28 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
});
}
private
void
doMyFavorites
(
Card
cardInfo
)
{
public
void
doMyFavorites
(
Card
cardInfo
)
{
CardLoader
mCardLoader
=
new
CardLoader
(
context
);
ConfigManager
favConf
=
DataManager
.
openConfig
(
AppsSettings
.
get
().
getSystemConfig
());
Integer
code
=
cardInfo
.
Code
;
if
(
favConf
.
mLines
.
contains
(
code
))
{
favConf
.
mLines
.
remove
(
code
);
favConf
.
save
();
mImageFav
.
setBackgroundResource
(
R
.
drawable
.
ic_control_point
);
}
else
{
favConf
.
mLines
.
add
(
code
);
favConf
.
save
();
mImageFav
.
setBackgroundResource
(
R
.
drawable
.
ic_fav
);
}
favConf
.
save
(
"#Favorite"
);
favConf
.
read
();
Favorite
.
clear
();
SparseArray
<
Card
>
id
=
mCardLoader
.
readCards
(
ConfigManager
.
mLines
);
if
(
id
!=
null
)
{
for
(
int
i
=
0
;
i
<
id
.
size
();
i
++)
Favorite
.
add
(
id
.
valueAt
(
i
));
}
if
(
mCallBack
!=
null
)
mCallBack
.
onSearchResult
(
Favorite
,
true
);
}
public
ImageView
getCardImage
()
{
...
...
@@ -232,6 +254,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
mListener
=
listener
;
}
public
void
setCallBack
(
CallBack
callBack
)
{
mCallBack
=
callBack
;
}
public
void
bind
(
Card
cardInfo
,
final
int
position
,
final
CardListProvider
provider
)
{
curPosition
=
position
;
mProvider
=
provider
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
View file @
5d70ba73
...
...
@@ -159,6 +159,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
//最后卡组
_file
=
new
File
(
mSettings
.
getLastDeckPath
());
}
Favorite
.
clear
();
init
(
_file
);
EventBus
.
getDefault
().
register
(
this
);
tv_deck
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
@@ -437,6 +438,19 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
addMainCard
(
cardInfo
);
}
});
mCardDetail
.
setCallBack
(
new
CardDetail
.
CallBack
()
{
@Override
public
void
onSearchStart
()
{
}
@Override
public
void
onSearchResult
(
List
<
Card
>
Cards
,
boolean
isHide
)
{
DeckManagerActivityImpl
.
this
.
onSearchResult
(
Cards
,
isHide
);
}
;
});
}
mCardDetail
.
showAdd
();
if
(
mDialog
==
null
)
{
...
...
mobile/src/main/java/ocgcore/ConfigManager.java
View file @
5d70ba73
...
...
@@ -10,6 +10,7 @@ import java.io.InputStreamReader;
import
java.io.OutputStreamWriter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Locale
;
import
cn.garymb.ygomobile.utils.IOUtils
;
...
...
@@ -52,7 +53,7 @@ public class ConfigManager implements Closeable {
return
mLines
.
size
()
>
0
;
}
public
void
save
()
{
public
void
save
(
String
words
)
{
if
(!
isLoad
())
{
read
();
}
...
...
@@ -64,9 +65,13 @@ public class ConfigManager implements Closeable {
outputStream
=
new
FileOutputStream
(
tmp
);
out
=
new
OutputStreamWriter
(
outputStream
,
"utf-8"
);
BufferedWriter
writer
=
new
BufferedWriter
(
out
);
if
(
words
!=
null
||
words
!=
""
)
{
writer
.
write
(
words
);
writer
.
newLine
();
}
int
count
=
mLines
.
size
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
writer
.
write
(
mLines
.
get
(
i
));
writer
.
write
(
(
mLines
.
get
(
i
)).
toString
(
));
if
(
i
<
count
-
1
)
{
writer
.
newLine
();
}
...
...
@@ -86,14 +91,15 @@ public class ConfigManager implements Closeable {
tmp
.
renameTo
(
file
);
}
}
/*//已弃用通过system.conf设置字体大小
//已弃用通过system.conf设置字体大小
public
void
setFontSize
(
int
size
)
{
if
(!
isLoad
())
{
read
();
}
int
count
=
mLines
.
size
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
String line = mLines.get(i);
String
line
=
mLines
.
get
(
i
)
.
toString
()
;
if
(
line
==
null
)
continue
;
line
=
line
.
toLowerCase
(
Locale
.
US
);
if
(
line
.
contains
(
"textfont"
))
{
...
...
@@ -104,11 +110,11 @@ public class ConfigManager implements Closeable {
String
newline
=
key
+
"= "
;
String
[]
vs
=
val
.
trim
().
split
(
" "
);
newline
+=
vs
[
0
]
+
" "
+
size
;
mLines.add(i,
newline
);
mLines
.
add
(
i
,
Integer
.
parseInt
(
newline
)
);
mLines
.
remove
(
i
+
1
);
}
}
}
save();
}
*/
save
(
""
);
}
}
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