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
2b36949e
Commit
2b36949e
authored
Jan 15, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整拓展卡下载页面布局
parent
73b1d7d2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
85 deletions
+92
-85
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardActivity.java
...main/java/cn/garymb/ygomobile/ex_card/ExCardActivity.java
+53
-0
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
.../java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+0
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
+2
-2
mobile/src/main/res/layout/activity_ex_card.xml
mobile/src/main/res/layout/activity_ex_card.xml
+28
-35
mobile/src/main/res/layout/activity_ex_card2.xml
mobile/src/main/res/layout/activity_ex_card2.xml
+0
-33
mobile/src/main/res/layout/item_ex_card.xml
mobile/src/main/res/layout/item_ex_card.xml
+7
-11
No files found.
mobile/src/main/AndroidManifest.xml
View file @
2b36949e
...
...
@@ -149,7 +149,7 @@
<!-- android:screenOrientation="landscape"-->
<activity
android:name=
"cn.garymb.ygomobile.ex_card.ExCardActivity
2
"
android:name=
"cn.garymb.ygomobile.ex_card.ExCardActivity"
android:theme=
"@style/AppTheme.Mycard"
android:launchMode=
"singleTop"
/>
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardActivity.java
0 → 100644
View file @
2b36949e
package
cn.garymb.ygomobile.ex_card
;
import
android.content.Context
;
import
android.os.Bundle
;
import
android.util.Log
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.viewpager.widget.ViewPager
;
import
com.google.android.material.tabs.TabLayout
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
public
class
ExCardActivity
extends
BaseActivity
{
private
Context
context
;
private
Toolbar
toolbar
;
public
static
TabLayout
tabLayout
;
public
static
ViewPager
viewPager
;
private
PackageTabAdapter
adapter
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_ex_card
);
viewPager
=
(
ViewPager
)
findViewById
(
R
.
id
.
viewPager
);
viewPager
.
setOffscreenPageLimit
(
2
);
tabLayout
=
(
TabLayout
)
findViewById
(
R
.
id
.
packagetablayout
);
createTabFragment
();
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
Log
.
i
(
"webCrawler"
,
"excard activity destroy"
);
}
private
void
createTabFragment
()
{
adapter
=
new
PackageTabAdapter
(
getSupportFragmentManager
(),
tabLayout
);
viewPager
.
setAdapter
(
adapter
);
/* setupWithViewPager() is used to link the TabLayout to the ViewPager */
tabLayout
.
setupWithViewPager
(
viewPager
);
}
@Override
public
boolean
onSupportNavigateUp
()
{
onBackPressed
();
return
true
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
View file @
2b36949e
...
...
@@ -140,7 +140,7 @@ public class ExCardListFragment extends Fragment {
//btn_download展示默认视图
textDownload
.
setText
(
R
.
string
.
tip_redownload
);
}
else
if
(
ServerUtil
.
exCardState
==
ServerUtil
.
ExCardState
.
NEED_UPDATE
)
{
textDownload
.
setText
(
R
.
string
.
action_download_expansions
);
textDownload
.
setText
(
R
.
string
.
Download
);
}
else
if
(
ServerUtil
.
exCardState
==
ServerUtil
.
ExCardState
.
ERROR
)
{
Toast
.
makeText
(
getActivity
(),
"无法获取服务器先行卡信息"
,
Toast
.
LENGTH_LONG
).
show
();
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
2b36949e
...
...
@@ -91,7 +91,6 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
break
;
case
TYPE_GET_VERSION_FAILED:
String
error
=
msg
.
obj
.
toString
();
Log
.
e
(
BuildConfig
.
VERSION_NAME
,
error
);
break
;
}
...
...
@@ -365,7 +364,6 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
@Override
public
void
onResponse
(
Call
call
,
Response
response
)
throws
IOException
{
String
json
=
response
.
body
().
string
();
Log
.
i
(
BuildConfig
.
VERSION_NAME
,
json
);
Message
message
=
new
Message
();
message
.
what
=
TYPE_GET_VERSION_OK
;
message
.
obj
=
json
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
View file @
2b36949e
...
...
@@ -59,7 +59,7 @@ import cn.garymb.ygomobile.bean.ServerInfo;
import
cn.garymb.ygomobile.bean.ServerList
;
import
cn.garymb.ygomobile.bean.events.ServerInfoEvent
;
import
cn.garymb.ygomobile.bean.events.ExCardEvent
;
import
cn.garymb.ygomobile.ex_card.ExCardActivity
2
;
import
cn.garymb.ygomobile.ex_card.ExCardActivity
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
cn.garymb.ygomobile.ui.activities.WebActivity
;
...
...
@@ -722,7 +722,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
// break;
// }
/* using Web crawler to extract the information of pre card */
Intent
exCardIntent
=
new
Intent
(
getActivity
(),
ExCardActivity
2
.
class
);
Intent
exCardIntent
=
new
Intent
(
getActivity
(),
ExCardActivity
.
class
);
startActivity
(
exCardIntent
);
break
;
case
R
.
id
.
action_help
:
{
...
...
mobile/src/main/res/layout/activity_ex_card.xml
View file @
2b36949e
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"@drawable/bg3"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<androidx.viewpager.widget.ViewPager
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:background=
"#aa000000"
/>
<com.google.android.material.tabs.TabLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<ExpandableListView
android:id=
"@+id/expandableListView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:divider=
"@android:color/darker_gray"
android:dividerHeight=
"0.5dp"
android:indicatorLeft=
"?android:attr/expandableListPreferredItemIndicatorLeft"
/>
<com.google.android.material.appbar.AppBarLayout
android:id=
"@+id/appbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@null"
android:paddingBottom=
"5dp"
app:elevation=
"0dp"
>
<com.tubb.smrv.SwipeMenuRecyclerView
android:id=
"@+id/list_ex_cards"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:divider=
"@android:color/transparent"
android:dividerHeight=
"4dp"
android:padding=
"5dp"
android:scrollbars=
"vertical"
/>
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/packagetablayout"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
app:tabGravity=
"fill"
app:tabMode=
"scrollable"
/>
</com.google.android.material.appbar.AppBarLayout>
</androidx.viewpager.widget.ViewPager>
<Button
android:id=
"@+id/web_btn_download_prerelease"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:background=
"@drawable/button_bg"
android:text=
"@string/Download"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/viewPager"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
mobile/src/main/res/layout/activity_ex_card2.xml
deleted
100644 → 0
View file @
73b1d7d2
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
android:layout_height=
"match_parent"
android:background=
"@drawable/list_item_bg"
>
<com.google.android.material.appbar.AppBarLayout
android:id=
"@+id/appbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@null"
android:paddingBottom=
"5dp"
app:elevation=
"0dp"
>
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/packagetablayout"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
app:tabGravity=
"fill"
app:tabMode=
"scrollable"
/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/viewPager"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
mobile/src/main/res/layout/item_ex_card.xml
View file @
2b36949e
...
...
@@ -4,6 +4,8 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingBottom=
"10dp"
android:background=
"@drawable/list_item_bg"
android:orientation=
"horizontal"
>
<!-- set the layout_height in the linear layout to “wrap_content”
so it doesn’t only show one TextView per page.-->
...
...
@@ -12,13 +14,15 @@
android:id=
"@+id/ex_card_image"
android:layout_width=
"@dimen/card_width_middle"
android:layout_height=
"@dimen/card_height_middle"
android:paddingTop=
"5dp"
android:padding=
"10dp"
android:layout_gravity=
"center_vertical"
android:scaleType=
"fitXY"
tools:src=
"@drawable/unknown"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"10dp"
android:orientation=
"vertical"
>
<cn.garymb.ygomobile.ui.widget.AlwaysMarqueeTextView
...
...
@@ -32,8 +36,7 @@
android:shadowRadius=
"2"
android:singleLine=
"true"
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
android:textColor=
"@color/brightgreen"
android:padding=
"20dp"
android:textColor=
"@color/gold"
android:textSize=
"15sp"
tools:text=
"Card Name"
/>
...
...
@@ -41,15 +44,8 @@
android:id=
"@+id/ex_card_description"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:
padding=
"20dp
"
android:
textColor=
"@color/white
"
android:textSize=
"12sp"
/>
<View
android:id=
"@+id/view_bar"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_marginTop=
"3dp"
android:background=
"@color/colorPrimaryDark"
/>
</LinearLayout>
</LinearLayout>
\ 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