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
4b1e4417
Commit
4b1e4417
authored
Aug 10, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加大图分享按钮
更改重新下载交互方式
parent
8e95fd6c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
138 additions
and
46 deletions
+138
-46
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+39
-20
mobile/src/main/res/layout/dialog_photo.xml
mobile/src/main/res/layout/dialog_photo.xml
+95
-22
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+1
-1
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-1
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+2
-2
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
4b1e4417
package
cn.garymb.ygomobile.ui.cards
;
import
android.annotation.SuppressLint
;
import
android.content.
DialogInterface
;
import
android.content.
Intent
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.animation.AnimationUtils
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
...
...
@@ -29,12 +29,13 @@ import java.io.File;
import
java.util.List
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.core.IrrlichtBridge
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.CardLoader
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
import
cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.utils.CardUtils
;
import
cn.garymb.ygomobile.utils.DownloadUtil
;
import
cn.garymb.ygomobile.utils.FileUtils
;
...
...
@@ -46,6 +47,7 @@ import ocgcore.StringManager;
import
ocgcore.data.Card
;
import
ocgcore.enums.CardType
;
import
static
cn
.
garymb
.
ygomobile
.
core
.
IrrlichtBridge
.
ACTION_SHARE_FILE
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
cards
.
DeckManagerActivityImpl
.
Favorite
;
/***
...
...
@@ -95,6 +97,9 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
LinearLayout
ll_bar
;
private
ProgressBar
pb_loading
;
private
TextView
tv_loading
;
private
LinearLayout
ll_btn
;
private
Button
btn_redownload
;
private
Button
btn_share
;
private
boolean
isDownloadCardImage
=
true
;
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
...
...
@@ -389,11 +394,20 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
tv_loading
=
view
.
findViewById
(
R
.
id
.
tv_name
);
pb_loading
.
setMax
(
100
);
ll_btn
=
view
.
findViewById
(
R
.
id
.
ll_btn
);
btn_redownload
=
view
.
findViewById
(
R
.
id
.
btn_redownload
);
btn_share
=
view
.
findViewById
(
R
.
id
.
btn_share
);
// 启用图片缩放功能
photoView
.
enable
();
photoView
.
setOnClickListener
(
View
->
{
if
(
ll_btn
.
getVisibility
()
==
View
.
VISIBLE
)
{
ll_btn
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
push_out
));
ll_btn
.
setVisibility
(
View
.
GONE
);
}
else
{
dialog
.
dis
();
}
});
photoView
.
setOnLongClickListener
(
new
View
.
OnLongClickListener
()
{
...
...
@@ -401,25 +415,30 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
public
boolean
onLongClick
(
View
v
)
{
if
(!
isDownloadCardImage
||
cardManager
.
getCard
(
code
)
==
null
)
return
false
;
DialogPlus
dialogPlus
=
new
DialogPlus
(
context
);
dialogPlus
.
setMessage
(
R
.
string
.
tip_redownload
);
dialogPlus
.
setMessageGravity
(
Gravity
.
CENTER_HORIZONTAL
);
dialogPlus
.
setLeftButtonText
(
R
.
string
.
Download
);
dialogPlus
.
setRightButtonText
(
R
.
string
.
Cancel
);
dialogPlus
.
setRightButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
dialogPlus
.
setLeftButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
ll_btn
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
push_in
));
ll_btn
.
setVisibility
(
View
.
VISIBLE
);
btn_redownload
.
setOnClickListener
((
s
)
->
{
ll_btn
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
push_out
));
ll_btn
.
setVisibility
(
View
.
GONE
);
downloadCardImage
(
code
,
file
);
});
btn_share
.
setOnClickListener
((
s
)
->
{
ll_btn
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
push_out
));
ll_btn
.
setVisibility
(
View
.
GONE
);
String
fname
=
String
.
valueOf
(
code
);
Intent
intent
=
new
Intent
(
ACTION_SHARE_FILE
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
intent
.
putExtra
(
IrrlichtBridge
.
EXTRA_SHARE_TYPE
,
"jpg"
);
intent
.
putExtra
(
IrrlichtBridge
.
EXTRA_SHARE_FILE
,
fname
+
Constants
.
IMAGE_URL_EX
);
intent
.
setPackage
(
context
.
getPackageName
());
try
{
context
.
startActivity
(
intent
);
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
context
,
"dev error:not found activity."
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
dialogPlus
.
show
();
imageLoader
.
bindImage
(
cardImage
,
code
,
null
,
true
);
return
true
;
}
...
...
mobile/src/main/res/layout/dialog_photo.xml
View file @
4b1e4417
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_
height
=
"match_parent"
android:layout_
width
=
"match_parent"
>
android:layout_
width
=
"match_parent"
android:layout_
height
=
"match_parent"
>
<!-- <ImageView-->
<!-- android:layout_marginLeft="1dp"-->
<!-- android:layout_marginRight="1dp"-->
<!-- android:id="@+id/photoView"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_centerInParent="true"-->
<!-- android:scaleType="fitCenter" />-->
<!-- <ImageView-->
<!-- android:layout_marginLeft="1dp"-->
<!-- android:layout_marginRight="1dp"-->
<!-- android:id="@+id/photoView"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_centerInParent="true"-->
<!-- android:scaleType="fitCenter" />-->
<com.bm.library.PhotoView
android:id=
"@+id/photoView"
...
...
@@ -18,32 +18,105 @@
android:scaleType=
"fitCenter"
/>
<LinearLayout
android:visibility=
"gone"
android:id=
"@+id/ll_bar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/radius"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:visibility=
"gone"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_name"
android:textColor=
"@color/white"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"5dp"
android:gravity=
"center"
android:textStyle=
"bold"
android:text=
"@string/Download"
android:
layout_width=
"match_parent
"
android:
layout_height=
"wrap_content
"
/>
android:
textColor=
"@color/white
"
android:
textStyle=
"bold
"
/>
<ProgressBar
android:layout_marginBottom=
"5dp"
android:id=
"@+id/pb_loading"
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:id=
"@+id/pb_loading"
android:layout_marginBottom=
"5dp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_btn"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
/>
android:layout_alignParentBottom=
"true"
android:layout_gravity=
"bottom"
android:gravity=
"center_horizontal"
android:orientation=
"horizontal"
android:paddingBottom=
"100dp"
android:visibility=
"gone"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<Button
android:id=
"@+id/btn_redownload"
android:layout_width=
"@dimen/label_width_50dp"
android:layout_height=
"@dimen/label_width_50dp"
android:layout_gravity=
"center|bottom"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/downloadimages"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"2"
android:shadowRadius=
"2"
android:text=
"@string/tip_redownload"
android:textColor=
"@color/white"
/>
</LinearLayout>
<TextView
android:layout_width=
"60dp"
android:layout_height=
"wrap_content"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<Button
android:id=
"@+id/btn_share"
android:layout_width=
"@dimen/label_width_50dp"
android:layout_height=
"@dimen/label_width_50dp"
android:layout_gravity=
"center|bottom"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shareicon"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"2"
android:shadowRadius=
"2"
android:text=
"@string/screenshoot"
android:textColor=
"@color/white"
/>
</LinearLayout>
</LinearLayout>
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
4b1e4417
...
...
@@ -273,7 +273,7 @@
<string
name=
"about_pref_settings_keep_scale"
>
원래 해상도 표시
</string>
<string
name=
"already_top"
>
첫 번째
</string>
<string
name=
"already_end"
>
마지막
</string>
<string
name=
"tip_redownload"
>
카드를 다시 다운로드하겠습니까?
</string>
<string
name=
"tip_redownload"
>
다시 다운로드
</string>
<string
name=
"tip_expansions_image"
>
카드의 고화질 이미지가 없습니다.
</string>
<string
name=
"tip_return_to_duel"
>
현재 게임으로 돌아왔습니다
</string>
<string
name=
"my_favorites"
>
즐겨 찾기★
</string>
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
4b1e4417
...
...
@@ -273,7 +273,7 @@
<string
name=
"about_pref_settings_keep_scale"
>
开启原始比例的游戏画面
</string>
<string
name=
"already_top"
>
已经是第一张啦
</string>
<string
name=
"already_end"
>
已经是最后一张啦
</string>
<string
name=
"tip_redownload"
>
重新下载
?
</string>
<string
name=
"tip_redownload"
>
重新下载
</string>
<string
name=
"tip_expansions_image"
>
非自带卡片没有大图
</string>
<string
name=
"tip_return_to_duel"
>
已回到当前游戏
</string>
<string
name=
"my_favorites"
>
我的收藏★
</string>
...
...
mobile/src/main/res/values/strings.xml
View file @
4b1e4417
...
...
@@ -270,13 +270,13 @@
<string
name=
"done"
>
done\!
</string>
<string
name=
"donot_editor_bot_Deck"
>
Pls Donot edit/remove AI Deck, if you do\nAI mode wont work properly
</string>
<string
name=
"code_share"
>
Code Share
</string>
<string
name=
"screenshoot"
>
S
creenshoo
t
</string>
<string
name=
"screenshoot"
>
S
hare Ar
t
</string>
<string
name=
"unable_to_edit_empty_deck"
>
unable to edit empty deck
</string>
<string
name=
"create_new_failed"
>
Create Failed
</string>
<string
name=
"about_pref_settings_keep_scale"
>
Original Resolution Scale Display
</string>
<string
name=
"already_top"
>
Already the first card
</string>
<string
name=
"already_end"
>
Already the last card
</string>
<string
name=
"tip_redownload"
>
Redownload
\?
</string>
<string
name=
"tip_redownload"
>
Redownload
</string>
<string
name=
"tip_expansions_image"
>
no Large image for pre-released data
</string>
<string
name=
"tip_return_to_duel"
>
Current game has been Returned
</string>
<string
name=
"my_favorites"
>
myFav★
</string>
...
...
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