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
40f27232
Commit
40f27232
authored
Jun 23, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充首页按钮功能
parent
a876edf8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
30 deletions
+81
-30
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchFragment.java
...java/cn/garymb/ygomobile/ui/cards/CardSearchFragment.java
+8
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
+31
-25
mobile/src/main/res/layout/fragment_home.xml
mobile/src/main/res/layout/fragment_home.xml
+41
-0
mobile/src/main/res/xml/shortcuts.xml
mobile/src/main/res/xml/shortcuts.xml
+1
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchFragment.java
View file @
40f27232
...
@@ -76,12 +76,18 @@ public class CardSearchFragment extends BaseFragemnt implements CardLoader.CallB
...
@@ -76,12 +76,18 @@ public class CardSearchFragment extends BaseFragemnt implements CardLoader.CallB
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
View
layoutView
;
View
layoutView
;
layoutView
=
inflater
.
inflate
(
R
.
layout
.
fragment_search
,
container
,
false
);
layoutView
=
inflater
.
inflate
(
R
.
layout
.
fragment_search
,
container
,
false
);
mResult_count
=
layoutView
.
findViewById
(
R
.
id
.
search_result_count
);
initView
(
layoutView
);
//showNewbieGuide();
return
layoutView
;
}
public
void
initView
(
View
layoutView
){
duelAssistantManagement
=
DuelAssistantManagement
.
getInstance
();
duelAssistantManagement
=
DuelAssistantManagement
.
getInstance
();
intentSearchMessage
=
getActivity
().
getIntent
().
getStringExtra
(
CardSearchFragment
.
SEARCH_MESSAGE
);
intentSearchMessage
=
getActivity
().
getIntent
().
getStringExtra
(
CardSearchFragment
.
SEARCH_MESSAGE
);
mResult_count
=
layoutView
.
findViewById
(
R
.
id
.
search_result_count
);
mDrawerlayout
=
layoutView
.
findViewById
(
R
.
id
.
drawer_layout
);
mDrawerlayout
=
layoutView
.
findViewById
(
R
.
id
.
drawer_layout
);
mImageLoader
=
new
ImageLoader
(
true
);
mListView
=
layoutView
.
findViewById
(
R
.
id
.
list_cards
);
mListView
=
layoutView
.
findViewById
(
R
.
id
.
list_cards
);
mImageLoader
=
new
ImageLoader
(
true
);
mCardListAdapter
=
new
CardListAdapter
(
getContext
(),
mImageLoader
);
mCardListAdapter
=
new
CardListAdapter
(
getContext
(),
mImageLoader
);
mCardListAdapter
.
setItemBg
(
true
);
mCardListAdapter
.
setItemBg
(
true
);
mListView
.
setLayoutManager
(
new
FastScrollLinearLayoutManager
(
getContext
()));
mListView
.
setLayoutManager
(
new
FastScrollLinearLayoutManager
(
getContext
()));
...
@@ -111,8 +117,6 @@ public class CardSearchFragment extends BaseFragemnt implements CardLoader.CallB
...
@@ -111,8 +117,6 @@ public class CardSearchFragment extends BaseFragemnt implements CardLoader.CallB
intentSearch
(
intentSearchMessage
);
intentSearch
(
intentSearchMessage
);
isInitCdbOk
=
true
;
isInitCdbOk
=
true
;
});
});
//showNewbieGuide();
return
layoutView
;
}
}
@Override
@Override
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
View file @
40f27232
...
@@ -58,7 +58,6 @@ import cn.garymb.ygomobile.ui.activities.WebActivity;
...
@@ -58,7 +58,6 @@ import cn.garymb.ygomobile.ui.activities.WebActivity;
import
cn.garymb.ygomobile.ui.adapters.ServerListAdapter
;
import
cn.garymb.ygomobile.ui.adapters.ServerListAdapter
;
import
cn.garymb.ygomobile.ui.adapters.SimpleListAdapter
;
import
cn.garymb.ygomobile.ui.adapters.SimpleListAdapter
;
import
cn.garymb.ygomobile.ui.cards.CardDetailRandom
;
import
cn.garymb.ygomobile.ui.cards.CardDetailRandom
;
import
cn.garymb.ygomobile.ui.mycard.MyCardActivity
;
import
cn.garymb.ygomobile.ui.mycard.MyCardActivity
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
...
@@ -82,11 +81,17 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
...
@@ -82,11 +81,17 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
private
CardManager
mCardManager
;
private
CardManager
mCardManager
;
private
CardDetailRandom
mCardDetailRandom
;
private
CardDetailRandom
mCardDetailRandom
;
private
ImageLoader
mImageLoader
;
private
ImageLoader
mImageLoader
;
//ygopro功能
CardView
cv_deckmanager
;
CardView
cv_donation
;
CardView
cv_game
;
CardView
cv_game
;
CardView
cv_bot_game
;
CardView
cv_watch_replay
;
//辅助功能
CardView
cv_download_ex
;
CardView
cv_download_ex
;
CardView
cv_reset_res
;
//外连
CardView
cv_donation
;
CardView
cv_join_QQ
;
CardView
cv_help
;
@Nullable
@Nullable
@Override
@Override
...
@@ -130,25 +135,30 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
...
@@ -130,25 +135,30 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
mServerListManager
=
new
ServerListManager
(
getContext
(),
mServerListAdapter
);
mServerListManager
=
new
ServerListManager
(
getContext
(),
mServerListAdapter
);
mServerListManager
.
bind
(
mServerList
);
mServerListManager
.
bind
(
mServerList
);
mServerListManager
.
syncLoadData
();
mServerListManager
.
syncLoadData
();
cv_donation
=
view
.
findViewById
(
R
.
id
.
nav_webpage
);
cv_game
=
view
.
findViewById
(
R
.
id
.
action_game
);
cv_game
=
view
.
findViewById
(
R
.
id
.
action_game
);
cv_game
.
setOnClickListener
(
this
);
cv_bot_game
=
view
.
findViewById
(
R
.
id
.
action_bot
);
cv_bot_game
.
setOnClickListener
(
this
);
cv_watch_replay
=
view
.
findViewById
(
R
.
id
.
action_replay
);
cv_watch_replay
.
setOnClickListener
(
this
);
cv_download_ex
=
view
.
findViewById
(
R
.
id
.
action_download_ex
);
cv_download_ex
=
view
.
findViewById
(
R
.
id
.
action_download_ex
);
//萌卡
cv_download_ex
.
setOnClickListener
(
this
);
CardView
iv_mc
=
view
.
findViewById
(
R
.
id
.
action_replay
);
cv_download_ex
.
setOnLongClickListener
(
new
View
.
OnLongClickListener
()
{
iv_mc
.
setOnClickListener
((
v
)
->
{
if
(
Constants
.
SHOW_MYCARD
)
{
startActivity
(
new
Intent
(
getActivity
(),
MyCardActivity
.
class
));
}
});
//
iv_mc
.
setOnLongClickListener
(
new
View
.
OnLongClickListener
()
{
@Override
@Override
public
boolean
onLongClick
(
View
v
)
{
public
boolean
onLongClick
(
View
v
)
{
startActivity
(
new
Intent
(
getActivity
(),
FileLogActivity
.
class
));
startActivity
(
new
Intent
(
getActivity
(),
FileLogActivity
.
class
));
return
true
;
return
true
;
}
}
});
});
cv_reset_res
=
view
.
findViewById
(
R
.
id
.
action_reset_game_res
);
cv_reset_res
.
setOnClickListener
(
this
);
cv_join_QQ
=
view
.
findViewById
(
R
.
id
.
action_join_qq_group
);
cv_join_QQ
.
setOnClickListener
(
this
);
cv_donation
=
view
.
findViewById
(
R
.
id
.
nav_webpage
);
cv_donation
.
setOnClickListener
(
this
);
cv_help
=
view
.
findViewById
(
R
.
id
.
action_help
);
cv_help
.
setOnClickListener
(
this
);
tv
=
(
ShimmerTextView
)
view
.
findViewById
(
R
.
id
.
shimmer_tv
);
tv
=
(
ShimmerTextView
)
view
.
findViewById
(
R
.
id
.
shimmer_tv
);
toggleAnimation
(
tv
);
toggleAnimation
(
tv
);
mImageLoader
=
new
ImageLoader
(
false
);
mImageLoader
=
new
ImageLoader
(
false
);
...
@@ -504,10 +514,6 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
...
@@ -504,10 +514,6 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
switch
(
v
.
getId
())
{
switch
(
v
.
getId
())
{
case
R
.
id
.
action_about
:
case
R
.
id
.
action_about
:
break
;
break
;
case
R
.
id
.
action_replay
:
break
;
case
R
.
id
.
action_bot
:
break
;
case
R
.
id
.
action_game
:
case
R
.
id
.
action_game
:
setRandomCardDetail
();
setRandomCardDetail
();
if
(
mCardDetailRandom
!=
null
)
{
if
(
mCardDetailRandom
!=
null
)
{
...
@@ -515,6 +521,12 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
...
@@ -515,6 +521,12 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
}
}
openGame
();
openGame
();
break
;
break
;
case
R
.
id
.
action_replay
:
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-k"
,
"-r"
);
break
;
case
R
.
id
.
action_bot
:
YGOStarter
.
startGame
(
getActivity
(),
null
,
"-k"
,
"-s"
);
break
;
case
R
.
id
.
action_settings
:
{
case
R
.
id
.
action_settings
:
{
Intent
intent
=
new
Intent
(
getContext
(),
SettingsActivity
.
class
);
Intent
intent
=
new
Intent
(
getContext
(),
SettingsActivity
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
...
@@ -522,12 +534,6 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
...
@@ -522,12 +534,6 @@ public class HomeFragment extends BaseFragemnt implements View.OnClickListener {
}
}
case
R
.
id
.
action_download_ex
:
case
R
.
id
.
action_download_ex
:
WebActivity
.
open
(
getContext
(),
getString
(
R
.
string
.
action_download_expansions
),
Constants
.
URL_YGO233_ADVANCE
);
WebActivity
.
open
(
getContext
(),
getString
(
R
.
string
.
action_download_expansions
),
Constants
.
URL_YGO233_ADVANCE
);
break
;
case
R
.
id
.
action_card_search
:
//startActivity(new Intent(getContext(), CardSearchActivity.class));
break
;
case
R
.
id
.
action_deck_manager
:
break
;
break
;
case
R
.
id
.
action_join_qq_group
:
case
R
.
id
.
action_join_qq_group
:
String
key
=
"anEjPCDdhLgxtfLre-nT52G1Coye3LkK"
;
String
key
=
"anEjPCDdhLgxtfLre-nT52G1Coye3LkK"
;
...
...
mobile/src/main/res/layout/fragment_home.xml
View file @
40f27232
...
@@ -396,6 +396,47 @@
...
@@ -396,6 +396,47 @@
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/action_bot"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"10dp"
android:clickable=
"true"
android:foreground=
"?android:attr/selectableItemBackground"
android:orientation=
"vertical"
app:cardBackgroundColor=
"@color/transparent"
app:cardElevation=
"0dp"
app:cardUseCompatPadding=
"false"
app:elevation=
"0dp"
>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"-30dp"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"-30dp"
android:layout_marginRight=
"-20dp"
android:layout_marginBottom=
"-20dp"
android:scaleType=
"fitEnd"
android:src=
"@drawable/help"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/window3"
android:paddingLeft=
"13dp"
android:paddingTop=
"13dp"
android:text=
"@string/bot_mode"
android:textColor=
"@color/holo_blue_bright"
android:textStyle=
"bold"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
mobile/src/main/res/xml/shortcuts.xml
View file @
40f27232
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<intent
<intent
android:action=
"android.intent.action.VIEW"
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.cards.DeckManager
Activity
"
android:targetClass=
"cn.garymb.ygomobile.ui.cards.DeckManager
Fragment
"
android:targetPackage=
"cn.garymb.ygomobile"
/>
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
</shortcut>
</shortcut>
...
...
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