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
467f17a3
Commit
467f17a3
authored
Jul 16, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美化toast view
parent
4366e5fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
16 deletions
+15
-16
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetailRandom.java
...n/java/cn/garymb/ygomobile/ui/cards/CardDetailRandom.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+2
-3
mobile/src/main/res/drawable-xhdpi/window2.9.png
mobile/src/main/res/drawable-xhdpi/window2.9.png
+0
-0
mobile/src/main/res/layout/dialog_cardinfo_small.xml
mobile/src/main/res/layout/dialog_cardinfo_small.xml
+11
-11
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetailRandom.java
View file @
467f17a3
...
@@ -34,6 +34,7 @@ public class CardDetailRandom {
...
@@ -34,6 +34,7 @@ public class CardDetailRandom {
private
static
StringManager
mStringManager
;
private
static
StringManager
mStringManager
;
public
static
void
RandomCardDetail
(
Context
context
,
Card
cardInfo
)
{
public
static
void
RandomCardDetail
(
Context
context
,
Card
cardInfo
)
{
if
(
cardInfo
==
null
)
return
;
imageLoader
=
ImageLoader
.
get
(
context
);
imageLoader
=
ImageLoader
.
get
(
context
);
viewCardDetail
=
inflate
(
context
,
R
.
layout
.
dialog_cardinfo_small
,
null
);
viewCardDetail
=
inflate
(
context
,
R
.
layout
.
dialog_cardinfo_small
,
null
);
cardImage
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_image_toast
);
cardImage
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_image_toast
);
...
@@ -49,7 +50,6 @@ public class CardDetailRandom {
...
@@ -49,7 +50,6 @@ public class CardDetailRandom {
textdefView
=
viewCardDetail
.
findViewById
(
R
.
id
.
TextDef_toast
);
textdefView
=
viewCardDetail
.
findViewById
(
R
.
id
.
TextDef_toast
);
desc
=
viewCardDetail
.
findViewById
(
R
.
id
.
text_desc_toast
);
desc
=
viewCardDetail
.
findViewById
(
R
.
id
.
text_desc_toast
);
if
(
cardInfo
==
null
)
return
;
mStringManager
=
DataManager
.
get
().
getStringManager
();
mStringManager
=
DataManager
.
get
().
getStringManager
();
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
);
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
);
name
.
setText
(
cardInfo
.
Name
);
name
.
setText
(
cardInfo
.
Name
);
...
@@ -89,7 +89,7 @@ public class CardDetailRandom {
...
@@ -89,7 +89,7 @@ public class CardDetailRandom {
Toast
toast
=
new
Toast
(
context
);
Toast
toast
=
new
Toast
(
context
);
toast
.
setView
(
viewCardDetail
);
toast
.
setView
(
viewCardDetail
);
toast
.
setDuration
(
Toast
.
LENGTH_LONG
);
toast
.
setDuration
(
Toast
.
LENGTH_LONG
);
toast
.
setGravity
(
Gravity
.
LEFT
,
5
0
,
0
);
toast
.
setGravity
(
Gravity
.
LEFT
,
3
0
,
0
);
toast
.
show
();
toast
.
show
();
}
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
467f17a3
...
@@ -665,9 +665,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
...
@@ -665,9 +665,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
cards
=
mCardManager
.
getAllCards
();
cards
=
mCardManager
.
getAllCards
();
int
y
=
(
int
)
(
Math
.
random
()
*
cards
.
size
());
int
y
=
(
int
)
(
Math
.
random
()
*
cards
.
size
());
Card
cardInfo
=
cards
.
valueAt
(
y
);
Card
cardInfo
=
cards
.
valueAt
(
y
);
if
(
cardInfo
==
null
)
{
if
(
cardInfo
==
null
)
Toast
.
makeText
(
this
,
"code为空"
,
Toast
.
LENGTH_LONG
).
show
();
return
;
}
CardDetailRandom
.
RandomCardDetail
(
this
,
cardInfo
);
CardDetailRandom
.
RandomCardDetail
(
this
,
cardInfo
);
}
}
}
}
mobile/src/main/res/drawable-xhdpi/window2.9.png
0 → 100644
View file @
467f17a3
22.3 KB
mobile/src/main/res/layout/dialog_cardinfo_small.xml
View file @
467f17a3
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<LinearLayout
<LinearLayout
android:layout_width=
"
wrap_content
"
android:layout_width=
"
170dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"5dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/window2"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<ImageView
<ImageView
...
@@ -90,7 +94,9 @@
...
@@ -90,7 +94,9 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:background=
"@drawable/window2"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"10dp"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<cn.garymb.ygomobile.ui.widget.AlwaysMarqueeTextView
<cn.garymb.ygomobile.ui.widget.AlwaysMarqueeTextView
...
@@ -99,7 +105,7 @@
...
@@ -99,7 +105,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:maxLines=
"1"
android:shadowColor=
"@color/black"
android:shadowColor=
"@color/black"
android:shadowDx=
"
1
"
android:shadowDx=
"
-2
"
android:shadowDy=
"2"
android:shadowDy=
"2"
android:shadowRadius=
"2"
android:shadowRadius=
"2"
android:singleLine=
"true"
android:singleLine=
"true"
...
@@ -112,7 +118,6 @@
...
@@ -112,7 +118,6 @@
android:id=
"@+id/star_attr_race_toast"
android:id=
"@+id/star_attr_race_toast"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center_horizontal"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
...
@@ -175,11 +180,6 @@
...
@@ -175,11 +180,6 @@
android:textColor=
"@color/gray"
android:textColor=
"@color/gray"
tools:text=
"SpellCaster"
/>
tools:text=
"SpellCaster"
/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width=
"0dp"
android:layout_height=
"1dp"
android:layout_weight=
"1"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
...
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