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
ee69b3ab
Commit
ee69b3ab
authored
Jun 12, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加点赞淡出动画
parent
c01a66c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
11 deletions
+67
-11
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
+24
-4
mobile/src/main/res/anim/fade_out.xml
mobile/src/main/res/anim/fade_out.xml
+29
-0
mobile/src/main/res/layout/fragment_deck_cards.xml
mobile/src/main/res/layout/fragment_deck_cards.xml
+14
-7
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
View file @
ee69b3ab
...
...
@@ -79,6 +79,7 @@ import cn.garymb.ygomobile.core.IrrlichtBridge;
import
cn.garymb.ygomobile.deck_square.DeckManageDialog
;
import
cn.garymb.ygomobile.deck_square.DeckSquareApiUtil
;
import
cn.garymb.ygomobile.deck_square.DeckSquareFileUtil
;
import
cn.garymb.ygomobile.deck_square.api_response.BasicResponse
;
import
cn.garymb.ygomobile.deck_square.api_response.DownloadDeckResponse
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.CardLoader
;
...
...
@@ -133,6 +134,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
private
HomeActivity
activity
;
private
String
mDeckId
;
private
LinearLayout
ll_click_like
;
private
TextView
tv_add_1
;
protected
int
screenWidth
;
...
...
@@ -210,9 +212,28 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
initBoomMenuButton
(
layoutView
.
findViewById
(
R
.
id
.
bmb
));
layoutView
.
findViewById
(
R
.
id
.
btn_nav_search
).
setOnClickListener
((
v
)
->
doMenu
(
R
.
id
.
action_search
));
layoutView
.
findViewById
(
R
.
id
.
btn_nav_list
).
setOnClickListener
((
v
)
->
doMenu
(
R
.
id
.
action_card_list
));
//只有当加载的是具有id的deck时才显示点赞按钮
tv_add_1
=
layoutView
.
findViewById
(
R
.
id
.
tv_add_1
);
ll_click_like
=
layoutView
.
findViewById
(
R
.
id
.
ll_click_like
);
ll_click_like
.
setOnClickListener
(
v
->
{
ll_click_like
.
setVisibility
(
View
.
GONE
);
if
(
mDeckId
!=
null
)
{
VUiKit
.
defer
().
when
(()
->
{
BasicResponse
result
=
DeckSquareApiUtil
.
likeDeck
(
mDeckId
);
return
result
;
}).
fail
(
e
->
{
LogUtil
.
i
(
TAG
,
"Like deck fail"
+
e
.
getMessage
());
YGOUtil
.
showTextToast
(
"点赞失败"
);
}).
done
(
data
->
{
if
(
data
!=
null
&&
data
.
getMessage
()
!=
null
&&
data
.
getMessage
().
equals
(
"true"
))
{
// 显示点赞动画
tv_add_1
.
setText
(
"+1"
);
ll_click_like
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
getContext
(),
R
.
anim
.
fade_out
));
ll_click_like
.
setVisibility
(
View
.
GONE
);
}
else
{
YGOUtil
.
showTextToast
(
data
!=
null
?
data
.
getMessage
()
:
"点赞失败"
);
}
});
}
});
tv_deck
.
setOnClickListener
(
v
->
{
new
DeckManageDialog
(
this
).
show
(
...
...
@@ -1275,10 +1296,8 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
if
(
deckData
!=
null
)
{
mDeckId
=
deckData
.
getDeckId
();
Log
.
w
(
"seesee mDeckId"
,
mDeckId
);
if
(
mDeckId
!=
null
)
ll_click_like
.
setVisibility
(
View
.
VISIBLE
);
deckData
.
getDeckYdk
();
String
fileFullName
=
deckData
.
getDeckName
()
+
".ydk"
;
// String path = AppsSettings.get().getDeckDir();
File
dir
=
new
File
(
getActivity
().
getApplicationInfo
().
dataDir
,
"cache"
);
//将卡组存到cache缓存目录中
boolean
result
=
DeckSquareFileUtil
.
saveFileToPath
(
dir
.
getPath
(),
fileFullName
,
deckData
.
getDeckYdk
());
...
...
@@ -1286,8 +1305,9 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
LogUtil
.
i
(
TAG
,
"square deck detail done"
);
//File file = new File(dir, fileFullName);
preLoadFile
(
dir
.
getPath
()
+
"/"
+
fileFullName
);
tv_add_1
.
setText
(
R
.
string
.
like_deck_thumb
);
ll_click_like
.
setVisibility
(
View
.
VISIBLE
);
}
}
});
...
...
mobile/src/main/res/anim/fade_out.xml
0 → 100644
View file @
ee69b3ab
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:fillAfter=
"false"
>
<!-- 位移动画:从当前位置向上移动150dp -->
<translate
android:duration=
"1000"
android:fromYDelta=
"0"
android:toYDelta=
"-150dp"
android:interpolator=
"@android:anim/decelerate_interpolator"
/>
<!-- 透明度动画:从完全可见到完全透明 -->
<alpha
android:duration=
"1000"
android:fromAlpha=
"1.0"
android:toAlpha=
"0.0"
android:interpolator=
"@android:anim/accelerate_interpolator"
/>
<!-- 缩放动画:稍微缩小一点 -->
<scale
android:duration=
"1000"
android:fromXScale=
"1.0"
android:fromYScale=
"1.0"
android:pivotX=
"50%"
android:pivotY=
"50%"
android:toXScale=
"0.8"
android:toYScale=
"0.8"
android:interpolator=
"@android:anim/decelerate_interpolator"
/>
</set>
\ No newline at end of file
mobile/src/main/res/layout/fragment_deck_cards.xml
View file @
ee69b3ab
...
...
@@ -24,7 +24,7 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"
70dp
"
android:layout_height=
"
wrap_content
"
android:layout_gravity=
"bottom"
android:layout_marginLeft=
"10dp"
android:orientation=
"horizontal"
...
...
@@ -32,8 +32,9 @@
<LinearLayout
android:id=
"@+id/tv_deckmanger"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/item_and_text_height"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/dialogshort"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
...
...
@@ -57,9 +58,9 @@
<LinearLayout
android:id=
"@+id/ll_click_like"
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/
button_radius_red
"
android:background=
"@drawable/
veil2
"
android:visibility=
"gone"
android:orientation=
"horizontal"
>
...
...
@@ -67,11 +68,17 @@
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
android:src=
"@drawable/baseline_thumb_up_24"
/>
<TextView
android:layout_width=
"match_parent"
android:id=
"@+id/tv_add_1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:layout_weight=
"1"
android:layout_marginStart=
"5dp"
android:layout_marginEnd=
"5dp"
android:textColor=
"@color/white"
android:text=
"@string/like_deck_thumb"
/>
...
...
@@ -84,13 +91,13 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"2dp"
android:background=
"@drawable/button_radius_black_transparents"
android:ellipsize=
"end"
android:gravity=
"center|left"
android:maxLines=
"1"
android:paddingStart=
"5dp"
android:paddingEnd=
"5dp"
android:shadowColor=
"@color/black"
android:background=
"@drawable/button_radius_black_transparents"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
...
...
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