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
bb9ced53
Commit
bb9ced53
authored
Jan 04, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直接显示卡图,不new一个activity
parent
1e8dadec
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
106 deletions
+13
-106
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/PhotoViewActivity.java
.../cn/garymb/ygomobile/ui/activities/PhotoViewActivity.java
+0
-84
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+7
-3
mobile/src/main/res/layout/activity_photo.xml
mobile/src/main/res/layout/activity_photo.xml
+0
-19
mobile/src/main/res/layout/dialog_photo.xml
mobile/src/main/res/layout/dialog_photo.xml
+6
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/PhotoViewActivity.java
deleted
100644 → 0
View file @
1e8dadec
package
cn.garymb.ygomobile.ui.activities
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
androidx.appcompat.widget.Toolbar
;
import
java.io.IOException
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
uk.co.senab.photoview.PhotoView
;
public
class
PhotoViewActivity
extends
BaseActivity
{
PhotoView
mPhotoView
;
private
long
cardCode
;
private
String
mName
;
private
ImageLoader
mImageLoader
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_photo
);
final
Toolbar
toolbar
=
$
(
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
enableBackHome
();
mImageLoader
=
ImageLoader
.
get
(
this
);
mPhotoView
=
$
(
R
.
id
.
photoview
);
if
(
loadItem
(
getIntent
()))
{
loadImage
();
}
}
@Override
protected
void
onDestroy
()
{
ImageLoader
.
onDestory
(
this
);
try
{
mImageLoader
.
close
();
}
catch
(
IOException
e
)
{
}
super
.
onDestroy
();
}
private
void
loadImage
()
{
if
(!
TextUtils
.
isEmpty
(
mName
))
{
setTitle
(
mName
);
}
mImageLoader
.
bindImage
(
mPhotoView
,
cardCode
,
null
,
true
);
}
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
if
(
loadItem
(
intent
))
{
loadImage
();
}
}
public
static
void
showImage
(
Context
context
,
long
code
,
String
name
)
{
Intent
intent
=
new
Intent
(
context
,
PhotoViewActivity
.
class
);
intent
.
putExtra
(
Intent
.
EXTRA_TITLE
,
name
);
intent
.
putExtra
(
Intent
.
EXTRA_TEXT
,
code
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
context
.
startActivity
(
intent
);
}
private
boolean
loadItem
(
Intent
intent
)
{
try
{
if
(
intent
.
hasExtra
(
Intent
.
EXTRA_TITLE
))
{
mName
=
intent
.
getStringExtra
(
Intent
.
EXTRA_TITLE
);
}
if
(
intent
.
hasExtra
(
Intent
.
EXTRA_TEXT
))
{
cardCode
=
intent
.
getLongExtra
(
Intent
.
EXTRA_TEXT
,
0
);
}
}
catch
(
Exception
e
)
{
}
return
cardCode
>
0
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
bb9ced53
package
cn.garymb.ygomobile.ui.cards
;
package
cn.garymb.ygomobile.ui.cards
;
import
android.app.Dialog
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
...
@@ -10,12 +11,10 @@ import android.widget.Toast;
...
@@ -10,12 +11,10 @@ import android.widget.Toast;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
import
cn.garymb.ygomobile.ui.activities.PhotoViewActivity
;
import
cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus
;
import
cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus
;
import
cn.garymb.ygomobile.utils.CardUtils
;
import
cn.garymb.ygomobile.utils.CardUtils
;
import
ocgcore.StringManager
;
import
ocgcore.StringManager
;
import
ocgcore.data.Card
;
import
ocgcore.data.Card
;
import
ocgcore.data.CardData
;
import
ocgcore.enums.CardType
;
import
ocgcore.enums.CardType
;
/***
/***
...
@@ -160,7 +159,12 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -160,7 +159,12 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
mCardInfo
=
cardInfo
;
mCardInfo
=
cardInfo
;
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
,
null
,
true
);
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
,
null
,
true
);
cardImage
.
setOnClickListener
((
v
)
->
{
cardImage
.
setOnClickListener
((
v
)
->
{
PhotoViewActivity
.
showImage
(
context
,
cardInfo
.
Code
,
cardInfo
.
Name
);
Dialog
dialog
=
new
Dialog
(
context
);
dialog
.
setContentView
(
R
.
layout
.
dialog_photo
);
dialog
.
show
();
ImageView
photoView
=
dialog
.
findViewById
(
R
.
id
.
photoView
);
imageLoader
.
bindImage
(
photoView
,
cardInfo
.
Code
,
null
,
true
);
});
});
name
.
setText
(
cardInfo
.
Name
);
name
.
setText
(
cardInfo
.
Name
);
desc
.
setText
(
cardInfo
.
Desc
);
desc
.
setText
(
cardInfo
.
Desc
);
...
...
mobile/src/main/res/layout/activity_photo.xml
deleted
100644 → 0
View file @
1e8dadec
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/content_toolbar"
/>
<uk.co.senab.photoview.PhotoView
android:id=
"@+id/photoview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
mobile/src/main/res/layout/dialog_photo.xml
0 → 100644
View file @
bb9ced53
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/photoView"
android:layout_width=
"421dp"
android:layout_height=
"614dp"
android:layout_gravity=
"center_vertical"
android:background=
"@color/tr_transparent_background"
/>
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