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
85a07ca9
Commit
85a07ca9
authored
Jul 02, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态按钮高度
parent
2fc0d570
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
75 deletions
+103
-75
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
+14
-9
mobile/src/main/res/layout/fragment_home.xml
mobile/src/main/res/layout/fragment_home.xml
+89
-66
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
View file @
85a07ca9
...
...
@@ -8,6 +8,7 @@ import static cn.garymb.ygomobile.ui.home.ResCheckTask.getDatapath;
import
android.annotation.SuppressLint
;
import
android.content.Intent
;
import
android.graphics.Paint
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
...
...
@@ -23,6 +24,7 @@ import android.view.ViewGroup;
import
android.view.inputmethod.EditorInfo
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ListView
;
...
...
@@ -87,6 +89,7 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
private
static
final
String
ARG_MC_NEWS_LIST
=
"mcNewsList"
;
private
boolean
isMcNewsLoadException
=
false
;
private
FrameLayout
ll_back
;
ShimmerTextView
tv
;
Shimmer
shimmer
;
private
SwipeMenuRecyclerView
mServerList
;
...
...
@@ -106,10 +109,8 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
private
CardView
cv_watch_replay
;
//辅助功能
private
CardView
cv_download_ex
;
private
CardView
cv_reset_res
;
//外连
private
CardView
cv_donation
;
private
CardView
cv_join_QQ
;
private
CardView
cv_help
;
@Nullable
...
...
@@ -124,7 +125,7 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
initBanner
(
layoutView
,
savedInstanceState
);
initView
(
layoutView
);
//event
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
//加上判断
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
//加上判断
EventBus
.
getDefault
().
register
(
this
);
}
return
layoutView
;
...
...
@@ -179,14 +180,17 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
cv_help
=
view
.
findViewById
(
R
.
id
.
action_help
);
cv_help
.
setOnClickListener
(
this
);
ll_back
=
view
.
findViewById
(
R
.
id
.
return_to_duel
);
ll_back
.
setOnClickListener
(
this
);
tv
=
(
ShimmerTextView
)
view
.
findViewById
(
R
.
id
.
shimmer_tv
);
toggleAnimation
(
tv
);
mImageLoader
=
new
ImageLoader
(
false
);
mCardManager
=
DataManager
.
get
().
getCardManager
();
}
//轮播图
public
void
initBanner
(
View
view
,
Bundle
saveBundle
){
public
void
initBanner
(
View
view
,
Bundle
saveBundle
)
{
xb_banner
=
view
.
findViewById
(
R
.
id
.
xb_banner
);
cv_banner
=
view
.
findViewById
(
R
.
id
.
cv_banner
);
tv_banner_loading
=
view
.
findViewById
(
R
.
id
.
tv_banner_loading
);
...
...
@@ -419,13 +423,10 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
public
void
BacktoDuel
()
{
tv
.
setOnClickListener
((
v
)
->
{
openGame
();
});
if
(
YGOStarter
.
isGameRunning
(
getActivity
()))
{
tv
.
setVisibility
(
View
.
VISIBLE
);
ll_back
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv
.
setVisibility
(
View
.
GONE
);
ll_back
.
setVisibility
(
View
.
GONE
);
}
}
...
...
@@ -663,6 +664,10 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
startActivity
(
intent
);
}
break
;
case
R
.
id
.
return_to_duel
:
{
openGame
();
}
break
;
case
R
.
id
.
tv_banner_loading
:
if
(
isMcNewsLoadException
)
findMcNews
();
...
...
mobile/src/main/res/layout/fragment_home.xml
View file @
85a07ca9
...
...
@@ -66,7 +66,9 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"5dp"
android:layout_marginLeft=
"5dp"
android:layout_marginRight=
"5dp"
android:layout_marginBottom=
"60dp"
android:orientation=
"horizontal"
android:weightSum=
"3"
>
...
...
@@ -74,7 +76,6 @@
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_marginRight=
"5dp"
android:layout_marginBottom=
"60dp"
android:layout_weight=
"2"
android:background=
"@drawable/dialogshort"
android:orientation=
"vertical"
>
...
...
@@ -100,16 +101,39 @@
android:layout_height=
"wrap_content"
android:scrollbars=
"none"
/>
<
cn.garymb.ygomobile.ui.widget.ShimmerTextView
android:id=
"@+id/
shimmer_tv
"
<
FrameLayout
android:id=
"@+id/
return_to_duel
"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentLeft=
"true"
android:background=
"@drawable/window3"
android:gravity=
"center"
android:text=
"@string/return_to_duel"
android:textColor=
"@color/item_title"
android:visibility=
"visible"
/>
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"150dp"
android:layout_height=
"150dp"
android:layout_gravity=
"center"
android:gravity=
"center"
android:src=
"@drawable/ic_launcher3"
/>
<cn.garymb.ygomobile.ui.widget.ShimmerTextView
android:id=
"@+id/shimmer_tv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentLeft=
"true"
android:gravity=
"center"
android:text=
"@string/return_to_duel"
android:textColor=
"@color/item_title"
/>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>
...
...
@@ -118,13 +142,11 @@
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"right"
android:layout_marginBottom=
"60dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/dialogshort"
android:orientation=
"vertical"
>
...
...
@@ -134,13 +156,13 @@
android:layout_height=
"wrap_content"
android:background=
"@drawable/veil2"
android:gravity=
"center"
android:text=
"
YGOPro
"
android:text=
"
@string/Function_Menu
"
android:textSize=
"10sp"
>
</androidx.appcompat.widget.AppCompatTextView>
<androidx.cardview.widget.CardView
android:id=
"@+id/action_
game
"
android:id=
"@+id/action_
help
"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_margin=
"5dp"
...
...
@@ -166,7 +188,7 @@
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-10dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/
start
"
/>
android:src=
"@drawable/
help
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -174,14 +196,14 @@
android:background=
"@drawable/dialogcube"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"@string/
action_game
"
android:textColor=
"@color/
brightgreen
"
android:text=
"@string/
help
"
android:textColor=
"@color/
holo_blue_bright
"
android:textStyle=
"bold"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/
action_bot
"
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/
nav_webpage
"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_margin=
"5dp"
...
...
@@ -207,7 +229,7 @@
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-10dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/
bo
t"
/>
android:src=
"@drawable/
abou
t"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -215,18 +237,38 @@
android:background=
"@drawable/dialogcube"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"@string/
bot_mode
"
android:textColor=
"@color/
brightgreen
"
android:text=
"@string/
donation
"
android:textColor=
"@color/
holo_blue_bright
"
android:textSize=
"10sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"bottom"
android:layout_marginTop=
"5dp"
android:background=
"@drawable/dialogshort"
android:orientation=
"vertical"
android:weightSum=
"4"
>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/action_replay"
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_height=
"wrap_content"
android:background=
"@drawable/veil2"
android:gravity=
"center"
android:text=
"@string/action_game"
android:textSize=
"10sp"
>
</androidx.appcompat.widget.AppCompatTextView>
<androidx.cardview.widget.CardView
android:id=
"@+id/action_game"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_margin=
"5dp"
android:layout_weight=
"1"
android:clickable=
"true"
android:foreground=
"?android:attr/selectableItemBackground"
android:orientation=
"vertical"
...
...
@@ -249,7 +291,7 @@
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-10dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/
replay
"
/>
android:src=
"@drawable/
start
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -257,18 +299,18 @@
android:background=
"@drawable/dialogcube"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"
@string/replay
"
android:text=
"
YGOPro
"
android:textColor=
"@color/brightgreen"
android:textSize=
"10sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/action_
download_ex
"
<androidx.cardview.widget.CardView
android:id=
"@+id/action_
bot
"
android:layout_width=
"match_parent"
android:layout_height=
"
5
0dp"
android:layout_height=
"0dp"
android:layout_margin=
"5dp"
android:layout_weight=
"1"
android:clickable=
"true"
android:foreground=
"?android:attr/selectableItemBackground"
android:orientation=
"vertical"
...
...
@@ -291,7 +333,7 @@
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-10dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/
downloadimages
"
/>
android:src=
"@drawable/
bot
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -299,40 +341,19 @@
android:background=
"@drawable/dialogcube"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"@string/
action_download_expansions
"
android:text=
"@string/
bot_mode
"
android:textColor=
"@color/brightgreen"
android:textSize=
"10sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:background=
"@drawable/dialogshort"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/veil2"
android:gravity=
"center"
android:text=
"@string/Function_Menu"
android:textSize=
"10sp"
>
</androidx.appcompat.widget.AppCompatTextView>
<androidx.cardview.widget.CardView
android:id=
"@+id/action_help"
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/action_replay"
android:layout_width=
"match_parent"
android:layout_height=
"
5
0dp"
android:layout_height=
"0dp"
android:layout_margin=
"5dp"
android:layout_weight=
"1"
android:clickable=
"true"
android:foreground=
"?android:attr/selectableItemBackground"
android:orientation=
"vertical"
...
...
@@ -355,7 +376,7 @@
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-10dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/
help
"
/>
android:src=
"@drawable/
replay
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -363,17 +384,19 @@
android:background=
"@drawable/dialogcube"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"@string/help"
android:textColor=
"@color/holo_blue_bright"
android:text=
"@string/replay"
android:textColor=
"@color/brightgreen"
android:textSize=
"10sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/
nav_webpage
"
android:id=
"@+id/
action_download_ex
"
android:layout_width=
"match_parent"
android:layout_height=
"
5
0dp"
android:layout_height=
"0dp"
android:layout_margin=
"5dp"
android:layout_weight=
"1"
android:clickable=
"true"
android:foreground=
"?android:attr/selectableItemBackground"
android:orientation=
"vertical"
...
...
@@ -396,7 +419,7 @@
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-10dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/
about
"
/>
android:src=
"@drawable/
downloadimages
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -404,8 +427,8 @@
android:background=
"@drawable/dialogcube"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"@string/
donation
"
android:textColor=
"@color/
holo_blue_bright
"
android:text=
"@string/
action_download_expansions
"
android:textColor=
"@color/
brightgreen
"
android:textSize=
"10sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
...
...
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