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
f2d28839
Commit
f2d28839
authored
Jun 25, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
迁移mycard为fragment
parent
823d7c33
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
354 additions
and
582 deletions
+354
-582
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+0
-22
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
...e/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
+3
-21
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCardActivity.java
...in/java/cn/garymb/ygomobile/ui/mycard/MyCardActivity.java
+0
-391
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
...in/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
+283
-5
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/mcchat/SplashActivity.java
.../cn/garymb/ygomobile/ui/mycard/mcchat/SplashActivity.java
+10
-10
mobile/src/main/res/layout/activity_online_mycard.xml
mobile/src/main/res/layout/activity_online_mycard.xml
+0
-60
mobile/src/main/res/layout/fragment_mycard.xml
mobile/src/main/res/layout/fragment_mycard.xml
+55
-4
mobile/src/main/res/layout/fragment_settings.xml
mobile/src/main/res/layout/fragment_settings.xml
+1
-1
mobile/src/main/res/layout/nav_main_head.xml
mobile/src/main/res/layout/nav_main_head.xml
+0
-57
mobile/src/main/res/layout/nav_mycard_head.xml
mobile/src/main/res/layout/nav_mycard_head.xml
+1
-1
mobile/src/main/res/menu/nav_mycard_menu.xml
mobile/src/main/res/menu/nav_mycard_menu.xml
+0
-9
mobile/src/main/res/xml/shortcuts.xml
mobile/src/main/res/xml/shortcuts.xml
+1
-1
No files found.
mobile/src/main/AndroidManifest.xml
View file @
f2d28839
...
@@ -143,22 +143,6 @@
...
@@ -143,22 +143,6 @@
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
android:theme=
"@style/AppTheme"
android:theme=
"@style/AppTheme"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
<activity
android:name=
"cn.garymb.ygomobile.ui.cards.CardSearchActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:label=
"@string/card_search"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/AppTheme"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustPan"
/>
<activity
android:name=
"cn.garymb.ygomobile.ui.cards.DeckManagerActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:label=
"@string/deck_manager"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/AppTheme"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustPan"
/>
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.file.FileActivity"
android:name=
"cn.garymb.ygomobile.ui.file.FileActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
...
@@ -172,12 +156,6 @@
...
@@ -172,12 +156,6 @@
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:theme=
"@style/AppTheme.Mycard"
android:theme=
"@style/AppTheme.Mycard"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
<activity
android:name=
"cn.garymb.ygomobile.ui.mycard.MyCardActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:launchMode=
"singleTop"
android:theme=
"@style/AppTheme.Mycard"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
/>
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.mycard.mcchat.McchatActivity"
android:name=
"cn.garymb.ygomobile.ui.mycard.mcchat.McchatActivity"
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
View file @
f2d28839
...
@@ -51,6 +51,7 @@ public class MyCard {
...
@@ -51,6 +51,7 @@ public class MyCard {
public
MyCard
(
Activity
context
)
{
public
MyCard
(
Activity
context
)
{
mContext
=
context
;
mContext
=
context
;
//context.getActionBar().hide();
lastModified
=
context
.
getSharedPreferences
(
"lastModified"
,
Context
.
MODE_PRIVATE
);
lastModified
=
context
.
getSharedPreferences
(
"lastModified"
,
Context
.
MODE_PRIVATE
);
mDefWebViewClient
=
new
DefWebViewClient
()
{
mDefWebViewClient
=
new
DefWebViewClient
()
{
@Override
@Override
...
@@ -108,21 +109,6 @@ public class MyCard {
...
@@ -108,21 +109,6 @@ public class MyCard {
return
mHomeUrl
;
return
mHomeUrl
;
}
}
// public String getLoginUrl() throws NoSuchAlgorithmException, InvalidKeyException {
// Uri.Builder payloadBuilder = new Uri.Builder();
// payloadBuilder.appendQueryParameter("return_sso_url", return_sso_url);
// byte[] payload = Base64.encode(payloadBuilder.build().getQuery().getBytes(UTF_8), Base64.NO_WRAP);
//
// Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
// SecretKeySpec secret_key = new SecretKeySpec(key.getBytes(UTF_8), "HmacSHA256");
// sha256_HMAC.init(secret_key);
// String signature = byteArrayToHexString(sha256_HMAC.doFinal(payload));
// Uri.Builder requestBuilder = Uri.parse(sso_url).buildUpon();
// requestBuilder.appendQueryParameter("sso", new String(payload, UTF_8));
// requestBuilder.appendQueryParameter("sig", signature);
// return requestBuilder.build().toString();
// }
public
String
getBBSUrl
()
{
public
String
getBBSUrl
()
{
return
mCommunityUrl
;
return
mCommunityUrl
;
}
}
...
@@ -152,10 +138,6 @@ public class MyCard {
...
@@ -152,10 +138,6 @@ public class MyCard {
public
interface
MyCardListener
{
public
interface
MyCardListener
{
void
onLogin
(
String
name
,
String
icon
,
String
statu
);
void
onLogin
(
String
name
,
String
icon
,
String
statu
);
void
watchReplay
();
void
puzzleMode
();
void
openDrawer
();
void
openDrawer
();
void
closeDrawer
();
void
closeDrawer
();
...
@@ -205,7 +187,7 @@ public class MyCard {
...
@@ -205,7 +187,7 @@ public class MyCard {
this
.
activity
=
activity
;
this
.
activity
=
activity
;
mListener
=
listener
;
mListener
=
listener
;
}
}
/*
@JavascriptInterface
@JavascriptInterface
public void edit_deck() {
public void edit_deck() {
activity.startActivity(new Intent(activity, DeckManagerFragment.class));
activity.startActivity(new Intent(activity, DeckManagerFragment.class));
...
@@ -224,7 +206,7 @@ public class MyCard {
...
@@ -224,7 +206,7 @@ public class MyCard {
activity.runOnUiThread(mListener::puzzleMode);
activity.runOnUiThread(mListener::puzzleMode);
}
}
}
}
*/
@JavascriptInterface
@JavascriptInterface
public
void
openDrawer
()
{
public
void
openDrawer
()
{
if
(
mListener
!=
null
)
{
if
(
mListener
!=
null
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCardActivity.java
deleted
100644 → 0
View file @
823d7c33
package
cn.garymb.ygomobile.ui.mycard
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.content.ClipData
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.ImageView
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.drawerlayout.widget.DrawerLayout
;
import
com.google.android.material.navigation.NavigationView
;
import
com.tencent.smtt.sdk.ValueCallback
;
import
com.tencent.smtt.sdk.WebChromeClient
;
import
com.tencent.smtt.sdk.WebSettings
;
import
com.tencent.smtt.sdk.WebView
;
import
java.text.MessageFormat
;
import
cn.garymb.ygomobile.YGOStarter
;
import
cn.garymb.ygomobile.lite.BuildConfig
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
import
cn.garymb.ygomobile.ui.cards.DeckManagerFragment
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.SplashActivity
;
import
cn.garymb.ygomobile.utils.ActivityUtils
;
import
cn.garymb.ygomobile.utils.glide.GlideCompat
;
public
class
MyCardActivity
extends
BaseActivity
implements
MyCard
.
MyCardListener
,
NavigationView
.
OnNavigationItemSelectedListener
{
private
static
final
int
FILECHOOSER_RESULTCODE
=
10
;
private
static
final
int
TYPE_MC_LOGIN
=
0
;
protected
DrawerLayout
mDrawerlayout
;
private
MyCardWebView
mWebViewPlus
;
private
MyCard
mMyCard
;
private
ImageView
mHeadView
;
private
TextView
mNameView
,
mStatusView
;
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
if
(
msg
.
what
==
TYPE_MC_LOGIN
)
{
String
[]
ss
=
(
String
[])
msg
.
obj
;
if
(!
TextUtils
.
isEmpty
(
ss
[
1
])
&&
ActivityUtils
.
isActivityExist
(
MyCardActivity
.
this
))
{
GlideCompat
.
with
(
MyCardActivity
.
this
).
load
(
Uri
.
parse
(
ss
[
1
])).
into
(
mHeadView
);
}
mNameView
.
setText
(
ss
[
0
]);
mStatusView
.
setText
(
ss
[
2
]);
}
}
};
private
ProgressBar
mProgressBar
;
private
TextView
tv_back_mc
;
private
ValueCallback
<
Uri
>
uploadMessage
;
private
ValueCallback
<
Uri
[]>
mUploadCallbackAboveL
;
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_online_mycard
);
enableBackHome
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
getWindow
();
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
setStatusBarColor
(
getResources
().
getColor
(
R
.
color
.
mediumPurple
));
}
YGOStarter
.
onCreated
(
this
);
mMyCard
=
new
MyCard
(
this
);
mWebViewPlus
=
$
(
R
.
id
.
webbrowser
);
mDrawerlayout
=
$
(
R
.
id
.
drawer_layout
);
mProgressBar
=
$
(
R
.
id
.
progressBar
);
tv_back_mc
=
$
(
R
.
id
.
tv_back_mc
);
mProgressBar
.
setMax
(
100
);
NavigationView
navigationView
=
$
(
R
.
id
.
nav_main
);
navigationView
.
setNavigationItemSelectedListener
(
this
);
View
navHead
=
navigationView
.
getHeaderView
(
0
);
mHeadView
=
navHead
.
findViewById
(
R
.
id
.
img_head
);
mNameView
=
navHead
.
findViewById
(
R
.
id
.
tv_name
);
mStatusView
=
navHead
.
findViewById
(
R
.
id
.
tv_dp
);
//mWebViewPlus.enableHtml5();
tv_back_mc
.
setOnClickListener
(
view
->
onHome
());
WebSettings
settings
=
mWebViewPlus
.
getSettings
();
settings
.
setUserAgentString
(
settings
.
getUserAgentString
()
+
MessageFormat
.
format
(
" YGOMobile/{0} ({1} {2,number,#})"
,
BuildConfig
.
VERSION_NAME
,
BuildConfig
.
APPLICATION_ID
,
BuildConfig
.
VERSION_CODE
));
mWebViewPlus
.
setWebChromeClient
(
new
WebChromeClient
()
{
@Override
public
void
onProgressChanged
(
WebView
view
,
int
newProgress
)
{
if
(
newProgress
==
100
)
{
mProgressBar
.
setVisibility
(
View
.
GONE
);
if
(
view
.
getUrl
().
contains
(
mMyCard
.
getMcHost
()))
tv_back_mc
.
setVisibility
(
View
.
GONE
);
else
tv_back_mc
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
if
(
View
.
GONE
==
mProgressBar
.
getVisibility
())
{
mProgressBar
.
setVisibility
(
View
.
VISIBLE
);
}
mProgressBar
.
setProgress
(
newProgress
);
}
super
.
onProgressChanged
(
view
,
newProgress
);
}
@Override
public
void
openFileChooser
(
ValueCallback
<
Uri
>
valueCallback
,
String
acceptType
,
String
capture
)
{
uploadMessage
=
valueCallback
;
Intent
i
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
i
.
addCategory
(
Intent
.
CATEGORY_OPENABLE
);
i
.
setType
(
"*/*"
);
startActivityForResult
(
Intent
.
createChooser
(
i
,
"File Browser"
),
FILECHOOSER_RESULTCODE
);
}
@Override
public
boolean
onShowFileChooser
(
WebView
webView
,
ValueCallback
<
Uri
[]>
valueCallback
,
FileChooserParams
fileChooserParams
)
{
mUploadCallbackAboveL
=
valueCallback
;
Intent
i
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
i
.
addCategory
(
Intent
.
CATEGORY_OPENABLE
);
i
.
setType
(
"*/*"
);
startActivityForResult
(
Intent
.
createChooser
(
i
,
"File Browser"
),
FILECHOOSER_RESULTCODE
);
return
true
;
}
// Android > 4.1.1 调用这个方法
// public void openFileChooser(ValueCallback<Uri> uploadMsg,
// String acceptType, String capture) {
// mUploadMessage = uploadMsg;
// choosePicture();
//
// Intent i = new Intent(Intent.ACTION_GET_CONTENT);
// i.addCategory(Intent.CATEGORY_OPENABLE);
// i.setType("*/*");
// startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
//
// }
//
// // 3.0 + 调用这个方法
// public void openFileChooser(ValueCallback<Uri> uploadMsg,
// String acceptType) {
// mUploadMessage = uploadMsg;
// choosePicture();
//
// }
//
// // Android < 3.0 调用这个方法
// public void openFileChooser(ValueCallback<Uri> uploadMsg) {
// mUploadMessage = uploadMsg;
// choosePicture();
// }
});
/*mWebViewPlus.setUIClient(new XWalkUIClient(mWebViewPlus) {
@Override
public void onReceivedTitle(XWalkView view, String title) {
super.onReceivedTitle(view, title);
setTitle(title);
}
@Override
public boolean onConsoleMessage(X5WebView view, String message, int lineNumber, String sourceId, ConsoleMessageType messageType) {
if (BuildConfig.DEBUG)
Log.i("webview", sourceId + ":" + lineNumber + "\n" + message);
return super.onConsoleMessage(view, message, lineNumber, sourceId, messageType);
}
});*/
mMyCard
.
attachWeb
(
mWebViewPlus
,
this
);
mWebViewPlus
.
loadUrl
(
mMyCard
.
getHomeUrl
());
}
@Override
protected
void
onBackHome
()
{
if
(
mDrawerlayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
closeDrawer
();
return
;
}
if
(
mWebViewPlus
.
getUrl
().
equals
(
mMyCard
.
getMcMainUrl
()))
{
finish
();
return
;
}
if
(
mWebViewPlus
.
canGoBack
())
{
mWebViewPlus
.
goBack
();
}
else
{
finish
();
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
FILECHOOSER_RESULTCODE
)
{
if
(
null
==
uploadMessage
&&
null
==
mUploadCallbackAboveL
)
return
;
Uri
result
=
data
==
null
||
resultCode
!=
RESULT_OK
?
null
:
data
.
getData
();
if
(
mUploadCallbackAboveL
!=
null
)
{
onActivityResultAboveL
(
requestCode
,
resultCode
,
data
);
}
else
if
(
uploadMessage
!=
null
)
{
uploadMessage
.
onReceiveValue
(
result
);
uploadMessage
=
null
;
}
}
}
/*@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (mWebViewPlus != null) {
mWebViewPlus.onActivityResult(requestCode, resultCode, data);
}
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (mWebViewPlus != null) {
mWebViewPlus.onNewIntent(intent);
}
}*/
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
private
void
onActivityResultAboveL
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
if
(
requestCode
!=
FILECHOOSER_RESULTCODE
||
mUploadCallbackAboveL
==
null
)
{
return
;
}
Uri
[]
results
=
null
;
if
(
resultCode
==
Activity
.
RESULT_OK
)
{
if
(
data
!=
null
)
{
String
dataString
=
data
.
getDataString
();
ClipData
clipData
=
data
.
getClipData
();
if
(
clipData
!=
null
)
{
results
=
new
Uri
[
clipData
.
getItemCount
()];
for
(
int
i
=
0
;
i
<
clipData
.
getItemCount
();
i
++)
{
ClipData
.
Item
item
=
clipData
.
getItemAt
(
i
);
results
[
i
]
=
item
.
getUri
();
}
}
if
(
dataString
!=
null
)
results
=
new
Uri
[]{
Uri
.
parse
(
dataString
)};
}
}
mUploadCallbackAboveL
.
onReceiveValue
(
results
);
mUploadCallbackAboveL
=
null
;
}
@Override
public
void
onBackPressed
()
{
onBackHome
();
}
@Override
protected
void
onResume
()
{
YGOStarter
.
onResumed
(
this
);
super
.
onResume
();
}
@Override
protected
void
onDestroy
()
{
mWebViewPlus
.
stopLoading
();
//mWebViewPlus.onDestroy();
YGOStarter
.
onDestroy
(
this
);
super
.
onDestroy
();
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
if
(
doMenu
(
item
.
getItemId
()))
{
return
true
;
}
return
super
.
onOptionsItemSelected
(
item
);
}
private
boolean
doMenu
(
int
id
)
{
closeDrawer
();
switch
(
id
)
{
case
android
.
R
.
id
.
home
:
mWebViewPlus
.
loadUrl
(
mMyCard
.
getHomeUrl
());
break
;
case
R
.
id
.
action_deck_manager
:
startActivity
(
new
Intent
(
this
,
DeckManagerFragment
.
class
));
closeDrawer
();
break
;
case
R
.
id
.
action_arena
:
mWebViewPlus
.
loadUrl
(
mMyCard
.
getArenaUrl
());
break
;
case
R
.
id
.
action_quit
:
finish
();
break
;
case
R
.
id
.
action_home
:
onHome
();
break
;
case
R
.
id
.
action_bbs
:
mWebViewPlus
.
loadUrl
(
mMyCard
.
getBBSUrl
());
break
;
case
R
.
id
.
action_chat
:
startActivity
(
new
Intent
(
MyCardActivity
.
this
,
SplashActivity
.
class
));
break
;
default
:
return
false
;
}
return
true
;
}
@Override
public
void
onLogin
(
String
name
,
String
icon
,
String
statu
)
{
Message
message
=
new
Message
();
message
.
obj
=
new
String
[]{
name
,
icon
,
statu
};
message
.
what
=
TYPE_MC_LOGIN
;
handler
.
sendMessage
(
message
);
}
@Override
public
void
onHome
()
{
mWebViewPlus
.
loadUrl
(
mMyCard
.
getHomeUrl
());
}
@Override
public
void
watchReplay
()
{
}
@Override
public
void
puzzleMode
()
{
}
@Override
public
void
openDrawer
()
{
if
(!
mDrawerlayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
mDrawerlayout
.
openDrawer
(
Gravity
.
LEFT
);
}
}
@Override
public
void
backHome
()
{
finish
();
}
@Override
public
void
closeDrawer
()
{
if
(
mDrawerlayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
mDrawerlayout
.
closeDrawer
(
Gravity
.
LEFT
);
}
}
@Override
public
void
share
(
String
text
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_SEND
);
intent
.
setType
(
"text/plain"
);
intent
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"分享"
);
intent
.
putExtra
(
Intent
.
EXTRA_TEXT
,
text
);
intent
.
putExtra
(
Intent
.
EXTRA_TITLE
,
getString
(
R
.
string
.
app_name
));
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
startActivity
(
Intent
.
createChooser
(
intent
,
"请选择"
));
}
@Override
public
boolean
onNavigationItemSelected
(
@NonNull
MenuItem
item
)
{
return
doMenu
(
item
.
getItemId
());
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
View file @
f2d28839
package
cn.garymb.ygomobile.ui.mycard
;
package
cn.garymb.ygomobile.ui.mycard
;
import
static
android
.
app
.
Activity
.
RESULT_OK
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.content.ClipData
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.drawerlayout.widget.DrawerLayout
;
import
com.google.android.material.navigation.NavigationView
;
import
com.tencent.smtt.sdk.ValueCallback
;
import
com.tencent.smtt.sdk.WebChromeClient
;
import
com.tencent.smtt.sdk.WebSettings
;
import
com.tencent.smtt.sdk.WebView
;
import
java.text.MessageFormat
;
import
cn.garymb.ygomobile.YGOStarter
;
import
cn.garymb.ygomobile.base.BaseFragemnt
;
import
cn.garymb.ygomobile.base.BaseFragemnt
;
import
cn.garymb.ygomobile.lite.BuildConfig
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.SplashActivity
;
import
cn.garymb.ygomobile.utils.glide.GlideCompat
;
public
class
MycardFragment
extends
BaseFragemnt
implements
View
.
OnClickListener
,
MyCard
.
MyCardListener
,
NavigationView
.
OnNavigationItemSelectedListener
{
private
static
final
int
FILECHOOSER_RESULTCODE
=
10
;
private
static
final
int
TYPE_MC_LOGIN
=
0
;
protected
DrawerLayout
mDrawerlayout
;
private
MyCardWebView
mWebViewPlus
;
private
MyCard
mMyCard
;
private
ImageView
mHeadView
;
private
TextView
mNameView
,
mStatusView
;
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
if
(
msg
.
what
==
TYPE_MC_LOGIN
)
{
String
[]
ss
=
(
String
[])
msg
.
obj
;
if
(!
TextUtils
.
isEmpty
(
ss
[
1
]))
{
GlideCompat
.
with
(
getActivity
()).
load
(
Uri
.
parse
(
ss
[
1
])).
into
(
mHeadView
);
}
mNameView
.
setText
(
ss
[
0
]);
mStatusView
.
setText
(
ss
[
2
]);
}
}
};
private
ProgressBar
mProgressBar
;
private
TextView
tv_back_mc
;
private
ValueCallback
<
Uri
>
uploadMessage
;
private
ValueCallback
<
Uri
[]>
mUploadCallbackAboveL
;
public
class
MycardFragment
extends
BaseFragemnt
implements
View
.
OnClickListener
{
private
Bundle
currentBundle
;
@Nullable
@Nullable
@Override
@Override
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
...
@@ -22,10 +78,166 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -22,10 +78,166 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
view
=
inflater
.
inflate
(
R
.
layout
.
mycard_horizontal_fragment
,
container
,
false
);
view
=
inflater
.
inflate
(
R
.
layout
.
mycard_horizontal_fragment
,
container
,
false
);
else
else
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_mycard
,
container
,
false
);
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_mycard
,
container
,
false
);
this
.
currentBundle
=
savedInstanceState
;
initView
(
view
);
//initView(view);
return
view
;
return
view
;
}
}
public
void
initView
(
View
view
)
{
YGOStarter
.
onCreated
(
getActivity
());
mMyCard
=
new
MyCard
(
getActivity
());
mWebViewPlus
=
view
.
findViewById
(
R
.
id
.
webbrowser
);
mDrawerlayout
=
view
.
findViewById
(
R
.
id
.
drawer_layout
);
mProgressBar
=
view
.
findViewById
(
R
.
id
.
progressBar
);
tv_back_mc
=
view
.
findViewById
(
R
.
id
.
tv_back_mc
);
mProgressBar
.
setMax
(
100
);
NavigationView
navigationView
=
view
.
findViewById
(
R
.
id
.
nav_main
);
navigationView
.
setNavigationItemSelectedListener
(
this
);
View
navHead
=
navigationView
.
getHeaderView
(
0
);
mHeadView
=
navHead
.
findViewById
(
R
.
id
.
img_head
);
mNameView
=
navHead
.
findViewById
(
R
.
id
.
tv_name
);
mStatusView
=
navHead
.
findViewById
(
R
.
id
.
tv_dp
);
//mWebViewPlus.enableHtml5();
tv_back_mc
.
setOnClickListener
(
this
);
WebSettings
settings
=
mWebViewPlus
.
getSettings
();
settings
.
setUserAgentString
(
settings
.
getUserAgentString
()
+
MessageFormat
.
format
(
" YGOMobile/{0} ({1} {2,number,#})"
,
BuildConfig
.
VERSION_NAME
,
BuildConfig
.
APPLICATION_ID
,
BuildConfig
.
VERSION_CODE
));
mWebViewPlus
.
setWebChromeClient
(
new
WebChromeClient
()
{
@Override
public
void
onProgressChanged
(
WebView
view
,
int
newProgress
)
{
if
(
newProgress
==
100
)
{
mProgressBar
.
setVisibility
(
View
.
GONE
);
if
(
view
.
getUrl
().
contains
(
mMyCard
.
getMcHost
()))
tv_back_mc
.
setVisibility
(
View
.
GONE
);
else
tv_back_mc
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
if
(
View
.
GONE
==
mProgressBar
.
getVisibility
())
{
mProgressBar
.
setVisibility
(
View
.
VISIBLE
);
}
mProgressBar
.
setProgress
(
newProgress
);
}
super
.
onProgressChanged
(
view
,
newProgress
);
}
@Override
public
void
openFileChooser
(
ValueCallback
<
Uri
>
valueCallback
,
String
acceptType
,
String
capture
)
{
uploadMessage
=
valueCallback
;
Intent
i
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
i
.
addCategory
(
Intent
.
CATEGORY_OPENABLE
);
i
.
setType
(
"*/*"
);
startActivityForResult
(
Intent
.
createChooser
(
i
,
"File Browser"
),
FILECHOOSER_RESULTCODE
);
}
@Override
public
boolean
onShowFileChooser
(
WebView
webView
,
ValueCallback
<
Uri
[]>
valueCallback
,
FileChooserParams
fileChooserParams
)
{
mUploadCallbackAboveL
=
valueCallback
;
Intent
i
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
i
.
addCategory
(
Intent
.
CATEGORY_OPENABLE
);
i
.
setType
(
"*/*"
);
startActivityForResult
(
Intent
.
createChooser
(
i
,
"File Browser"
),
FILECHOOSER_RESULTCODE
);
return
true
;
}
});
mMyCard
.
attachWeb
(
mWebViewPlus
,
this
);
mWebViewPlus
.
loadUrl
(
mMyCard
.
getHomeUrl
());
}
@Override
public
void
onResume
()
{
YGOStarter
.
onResumed
(
getActivity
());
super
.
onResume
();
}
@Override
public
void
onDestroy
()
{
mWebViewPlus
.
stopLoading
();
//mWebViewPlus.onDestroy();
YGOStarter
.
onDestroy
(
getActivity
());
super
.
onDestroy
();
}
@Override
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
FILECHOOSER_RESULTCODE
)
{
if
(
null
==
uploadMessage
&&
null
==
mUploadCallbackAboveL
)
return
;
Uri
result
=
data
==
null
||
resultCode
!=
RESULT_OK
?
null
:
data
.
getData
();
if
(
mUploadCallbackAboveL
!=
null
)
{
onActivityResultAboveL
(
requestCode
,
resultCode
,
data
);
}
else
if
(
uploadMessage
!=
null
)
{
uploadMessage
.
onReceiveValue
(
result
);
uploadMessage
=
null
;
}
}
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
private
void
onActivityResultAboveL
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
if
(
requestCode
!=
FILECHOOSER_RESULTCODE
||
mUploadCallbackAboveL
==
null
)
{
return
;
}
Uri
[]
results
=
null
;
if
(
resultCode
==
RESULT_OK
)
{
if
(
data
!=
null
)
{
String
dataString
=
data
.
getDataString
();
ClipData
clipData
=
data
.
getClipData
();
if
(
clipData
!=
null
)
{
results
=
new
Uri
[
clipData
.
getItemCount
()];
for
(
int
i
=
0
;
i
<
clipData
.
getItemCount
();
i
++)
{
ClipData
.
Item
item
=
clipData
.
getItemAt
(
i
);
results
[
i
]
=
item
.
getUri
();
}
}
if
(
dataString
!=
null
)
results
=
new
Uri
[]{
Uri
.
parse
(
dataString
)};
}
}
mUploadCallbackAboveL
.
onReceiveValue
(
results
);
mUploadCallbackAboveL
=
null
;
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
if
(
doMenu
(
item
.
getItemId
()))
{
return
true
;
}
return
super
.
onOptionsItemSelected
(
item
);
}
private
boolean
doMenu
(
int
id
)
{
closeDrawer
();
switch
(
id
)
{
case
R
.
id
.
action_home
:
onHome
();
break
;
case
R
.
id
.
action_arena
:
mWebViewPlus
.
loadUrl
(
mMyCard
.
getArenaUrl
());
break
;
case
R
.
id
.
action_bbs
:
mWebViewPlus
.
loadUrl
(
mMyCard
.
getBBSUrl
());
break
;
case
R
.
id
.
action_chat
:
startActivity
(
new
Intent
(
getActivity
(),
SplashActivity
.
class
));
break
;
default
:
return
false
;
}
return
true
;
}
/**
/**
* 第一次fragment可见(进行初始化工作)
* 第一次fragment可见(进行初始化工作)
*/
*/
...
@@ -65,7 +277,19 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -65,7 +277,19 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
@Override
@Override
public
void
onBackPressed
()
{
public
void
onBackPressed
()
{
if
(
mDrawerlayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
closeDrawer
();
return
;
}
if
(
mWebViewPlus
.
getUrl
().
equals
(
mMyCard
.
getMcMainUrl
()))
{
//finish();
return
;
}
if
(
mWebViewPlus
.
canGoBack
())
{
mWebViewPlus
.
goBack
();
}
else
{
//finish();
}
}
}
/**
/**
...
@@ -77,4 +301,58 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -77,4 +301,58 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
}
}
@Override
public
void
onLogin
(
String
name
,
String
icon
,
String
statu
)
{
Message
message
=
new
Message
();
message
.
obj
=
new
String
[]{
name
,
icon
,
statu
};
message
.
what
=
TYPE_MC_LOGIN
;
handler
.
sendMessage
(
message
);
}
@Override
public
void
openDrawer
()
{
if
(!
mDrawerlayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
mDrawerlayout
.
openDrawer
(
Gravity
.
LEFT
);
}
}
@Override
public
void
closeDrawer
()
{
if
(
mDrawerlayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
mDrawerlayout
.
closeDrawer
(
Gravity
.
LEFT
);
}
}
@Override
public
void
backHome
()
{
}
@Override
public
void
share
(
String
text
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_SEND
);
intent
.
setType
(
"text/plain"
);
intent
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"分享"
);
intent
.
putExtra
(
Intent
.
EXTRA_TEXT
,
text
);
intent
.
putExtra
(
Intent
.
EXTRA_TITLE
,
getString
(
R
.
string
.
app_name
));
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
startActivity
(
Intent
.
createChooser
(
intent
,
"请选择"
));
}
@Override
public
void
onHome
()
{
mWebViewPlus
.
loadUrl
(
mMyCard
.
getHomeUrl
());
}
/**
* Called when an item in the navigation menu is selected.
*
* @param item The selected item
* @return true to display the item as the selected item
*/
@Override
public
boolean
onNavigationItemSelected
(
@NonNull
MenuItem
item
)
{
return
false
;
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/mcchat/SplashActivity.java
View file @
f2d28839
...
@@ -20,7 +20,7 @@ import org.jivesoftware.smack.XMPPException;
...
@@ -20,7 +20,7 @@ import org.jivesoftware.smack.XMPPException;
import
java.io.IOException
;
import
java.io.IOException
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.mycard.My
CardActivity
;
import
cn.garymb.ygomobile.ui.mycard.My
cardFragment
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.ServiceManagement
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.ServiceManagement
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.UserManagement
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.UserManagement
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
...
@@ -43,7 +43,7 @@ public class SplashActivity extends Activity {
...
@@ -43,7 +43,7 @@ public class SplashActivity extends Activity {
su
.
setIsConnected
(
false
);
su
.
setIsConnected
(
false
);
sp_jz
.
setVisibility
(
View
.
GONE
);
sp_jz
.
setVisibility
(
View
.
GONE
);
sp_tv
.
setText
(
getString
(
R
.
string
.
logining_failed
));
sp_tv
.
setText
(
getString
(
R
.
string
.
logining_failed
));
YGOUtil
.
show
(
getString
(
R
.
string
.
failed_reason
)
+
msg
.
obj
);
YGOUtil
.
show
(
getString
(
R
.
string
.
failed_reason
)
+
msg
.
obj
);
break
;
break
;
case
1
:
case
1
:
startActivity
(
new
Intent
(
SplashActivity
.
this
,
McchatActivity
.
class
));
startActivity
(
new
Intent
(
SplashActivity
.
this
,
McchatActivity
.
class
));
...
@@ -65,7 +65,7 @@ public class SplashActivity extends Activity {
...
@@ -65,7 +65,7 @@ public class SplashActivity extends Activity {
case
5
:
case
5
:
/*sp_jz.setVisibility(View.GONE);
/*sp_jz.setVisibility(View.GONE);
sp_tv.setText("用户名或密码为空");*/
sp_tv.setText("用户名或密码为空");*/
startActivity
(
new
Intent
(
SplashActivity
.
this
,
My
CardActivity
.
class
));
startActivity
(
new
Intent
(
SplashActivity
.
this
,
My
cardFragment
.
class
));
finish
();
finish
();
break
;
break
;
...
@@ -145,28 +145,28 @@ public class SplashActivity extends Activity {
...
@@ -145,28 +145,28 @@ public class SplashActivity extends Activity {
String
password
=
UserManagement
.
getUserPassword
();
String
password
=
UserManagement
.
getUserPassword
();
if
(
name
!=
null
&&
password
!=
null
)
{
if
(
name
!=
null
&&
password
!=
null
)
{
Message
me
=
new
Message
();
Message
me
=
new
Message
();
me
.
what
=
0
;
me
.
what
=
0
;
try
{
try
{
su
.
login
(
name
,
password
);
su
.
login
(
name
,
password
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
me
.
obj
=
"InterruptedException:"
+
e
;
me
.
obj
=
"InterruptedException:"
+
e
;
han
.
sendMessage
(
me
);
han
.
sendMessage
(
me
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
me
.
obj
=
"IOException:"
+
e
;
me
.
obj
=
"IOException:"
+
e
;
e
.
printStackTrace
();
e
.
printStackTrace
();
han
.
sendMessage
(
me
);
han
.
sendMessage
(
me
);
}
catch
(
SmackException
e
)
{
}
catch
(
SmackException
e
)
{
me
.
obj
=
"SmackException:"
+
e
;
me
.
obj
=
"SmackException:"
+
e
;
e
.
printStackTrace
();
e
.
printStackTrace
();
han
.
sendMessage
(
me
);
han
.
sendMessage
(
me
);
}
catch
(
XMPPException
e
)
{
}
catch
(
XMPPException
e
)
{
me
.
obj
=
"XMPPException:"
+
e
;
me
.
obj
=
"XMPPException:"
+
e
;
e
.
printStackTrace
();
e
.
printStackTrace
();
han
.
sendMessage
(
me
);
han
.
sendMessage
(
me
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
)
{
me
.
obj
=
"其他错误:"
+
e
;
me
.
obj
=
"其他错误:"
+
e
;
e
.
printStackTrace
();
e
.
printStackTrace
();
han
.
sendMessage
(
me
);
han
.
sendMessage
(
me
);
}
}
...
...
mobile/src/main/res/layout/activity_online_mycard.xml
deleted
100644 → 0
View file @
823d7c33
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
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:id=
"@+id/drawer_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:clipToPadding=
"false"
android:fitsSystemWindows=
"true"
tools:openDrawer=
"left"
>
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.appcompat.widget.AppCompatTextView
android:visibility=
"gone"
android:id=
"@+id/tv_back_mc"
android:background=
"@drawable/click_background"
android:textColor=
"@color/black"
android:layout_width=
"match_parent"
android:text=
"返回萌卡大厅"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:gravity=
"center"
android:paddingTop=
"6dp"
android:paddingBottom=
"6dp"
android:layout_height=
"wrap_content"
/>
<cn.garymb.ygomobile.ui.mycard.MyCardWebView
android:id=
"@+id/webbrowser"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ProgressBar
android:id=
"@+id/progressBar"
style=
"@style/StyleProgressBarMini"
android:layout_width=
"match_parent"
android:layout_height=
"5px"
/>
</cn.garymb.ygomobile.ui.mycard.MyCardWebView>
</LinearLayout>
<com.google.android.material.navigation.NavigationView
android:id=
"@+id/nav_main"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_gravity=
"left"
android:background=
"@color/white"
app:headerLayout=
"@layout/nav_mycard_head"
app:itemIconTint=
"@color/gold"
app:itemTextColor=
"@color/mediumPurple"
app:menu=
"@menu/nav_mycard_menu"
/>
</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file
mobile/src/main/res/layout/fragment_mycard.xml
View file @
f2d28839
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/fragment_mycard"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/drawer_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:clipToPadding=
"false"
android:fitsSystemWindows=
"false"
tools:openDrawer=
"left"
>
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.appcompat.widget.AppCompatTextView
android:visibility=
"gone"
android:id=
"@+id/tv_back_mc"
android:background=
"@drawable/click_background"
android:textColor=
"@color/black"
android:layout_width=
"match_parent"
android:text=
"返回萌卡大厅"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:gravity=
"center"
android:paddingTop=
"6dp"
android:paddingBottom=
"6dp"
android:layout_height=
"wrap_content"
/>
<cn.garymb.ygomobile.ui.mycard.MyCardWebView
android:id=
"@+id/webbrowser"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ProgressBar
android:id=
"@+id/progressBar"
style=
"@style/StyleProgressBarMini"
android:layout_width=
"match_parent"
android:layout_height=
"5px"
/>
</cn.garymb.ygomobile.ui.mycard.MyCardWebView>
</LinearLayout>
<com.google.android.material.navigation.NavigationView
android:id=
"@+id/nav_main"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_gravity=
"left"
android:background=
"@color/white"
app:headerLayout=
"@layout/nav_mycard_head"
app:itemIconTint=
"@color/gold"
app:itemTextColor=
"@color/mediumPurple"
app:menu=
"@menu/nav_mycard_menu"
/>
</LinearLayout>
</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file
\ No newline at end of file
mobile/src/main/res/layout/fragment_settings.xml
View file @
f2d28839
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
android:background=
"#80000000"
android:background=
"#80000000"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<
FrameLayout
<
fragment
android:name=
"cn.garymb.ygomobile.ui.preference.fragments.SettingFragment"
android:id=
"@+id/fragment"
android:id=
"@+id/fragment"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
...
...
mobile/src/main/res/layout/nav_main_head.xml
deleted
100644 → 0
View file @
823d7c33
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/nav_head_height"
android:orientation=
"vertical"
android:paddingTop=
"24dp"
tools:showIn=
"@layout/activity_home"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"@dimen/nav_icon_width"
android:layout_height=
"@dimen/nav_icon_height"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"15dp"
android:src=
"@drawable/ic_icon"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/settings_about_author_pref"
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
android:textColor=
"@color/white"
/>
<TextView
android:id=
"@+id/textView2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:text=
"@string/settings_author"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textColor=
"@color/white"
/>
<Button
android:id=
"@+id/nav_webpage"
android:layout_width=
"124dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_margin=
"5dp"
android:background=
"@drawable/button_bg"
android:gravity=
"center"
android:text=
"@string/donation"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
android:textColor=
"@color/white"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
mobile/src/main/res/layout/nav_mycard_head.xml
View file @
f2d28839
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
android:background=
"@color/mediumPurple"
android:background=
"@color/mediumPurple"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingTop=
"20dp"
android:paddingTop=
"20dp"
tools:showIn=
"@layout/
activity_online
_mycard"
>
tools:showIn=
"@layout/
fragment
_mycard"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
mobile/src/main/res/menu/nav_mycard_menu.xml
View file @
f2d28839
...
@@ -16,13 +16,4 @@
...
@@ -16,13 +16,4 @@
android:id=
"@+id/action_arena"
android:id=
"@+id/action_arena"
android:icon=
"@drawable/ic_highlight"
android:icon=
"@drawable/ic_highlight"
android:title=
"@string/arena"
/>
android:title=
"@string/arena"
/>
<item
android:id=
"@+id/action_deck_manager"
android:icon=
"@drawable/ic_edit"
android:title=
"@string/deck_manager"
/>
<item
android:id=
"@+id/action_quit"
android:icon=
"@drawable/ic_close_black_24dp"
android:title=
"@string/quit"
/>
</menu>
</menu>
mobile/src/main/res/xml/shortcuts.xml
View file @
f2d28839
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<intent
<intent
android:action=
"android.intent.action.VIEW"
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.mycard.My
CardActivity
"
android:targetClass=
"cn.garymb.ygomobile.ui.mycard.My
cardFragment
"
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