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
0ba1b0de
Commit
0ba1b0de
authored
May 25, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
偏好房间置顶,添加标记
parent
4bc05604
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
2 deletions
+32
-2
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/ServerListAdapter.java
...va/cn/garymb/ygomobile/ui/adapters/ServerListAdapter.java
+14
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+1
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ServerInfoViewHolder.java
...ava/cn/garymb/ygomobile/ui/home/ServerInfoViewHolder.java
+3
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ServerListManager.java
...n/java/cn/garymb/ygomobile/ui/home/ServerListManager.java
+1
-0
mobile/src/main/res/layout/item_server_info_swipe.xml
mobile/src/main/res/layout/item_server_info_swipe.xml
+9
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+2
-1
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-0
No files found.
mobile/build.gradle
View file @
0ba1b0de
...
@@ -8,7 +8,7 @@ android {
...
@@ -8,7 +8,7 @@ android {
applicationId
"cn.garymb.ygomobile"
applicationId
"cn.garymb.ygomobile"
minSdkVersion
16
minSdkVersion
16
targetSdkVersion
22
targetSdkVersion
22
versionCode
3201052
4
versionCode
3201052
5
versionName
"3.2.1"
versionName
"3.2.1"
flavorDimensions
"versionCode"
flavorDimensions
"versionCode"
vectorDrawables
.
useSupportLibrary
=
true
vectorDrawables
.
useSupportLibrary
=
true
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/ServerListAdapter.java
View file @
0ba1b0de
package
cn.garymb.ygomobile.ui.adapters
;
package
cn.garymb.ygomobile.ui.adapters
;
import
android.content.Context
;
import
android.content.Context
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.EventBus
;
...
@@ -9,6 +10,7 @@ import cn.garymb.ygomobile.bean.ServerInfo;
...
@@ -9,6 +10,7 @@ import cn.garymb.ygomobile.bean.ServerInfo;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.bean.events.ServerInfoEvent
;
import
cn.garymb.ygomobile.bean.events.ServerInfoEvent
;
import
cn.garymb.ygomobile.ui.home.ServerInfoViewHolder
;
import
cn.garymb.ygomobile.ui.home.ServerInfoViewHolder
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
public
class
ServerListAdapter
extends
BaseRecyclerAdapterPlus
<
ServerInfo
,
ServerInfoViewHolder
>
{
public
class
ServerListAdapter
extends
BaseRecyclerAdapterPlus
<
ServerInfo
,
ServerInfoViewHolder
>
{
public
ServerListAdapter
(
Context
context
)
{
public
ServerListAdapter
(
Context
context
)
{
...
@@ -27,6 +29,18 @@ public class ServerListAdapter extends BaseRecyclerAdapterPlus<ServerInfo, Serve
...
@@ -27,6 +29,18 @@ public class ServerListAdapter extends BaseRecyclerAdapterPlus<ServerInfo, Serve
holder
.
serverIp
.
setText
(
item
.
getServerAddr
());
holder
.
serverIp
.
setText
(
item
.
getServerAddr
());
holder
.
userName
.
setText
(
item
.
getPlayerName
());
holder
.
userName
.
setText
(
item
.
getPlayerName
());
holder
.
serverPort
.
setText
(
String
.
valueOf
(
item
.
getPort
()));
holder
.
serverPort
.
setText
(
String
.
valueOf
(
item
.
getPort
()));
if
(
position
==
0
){
holder
.
iv_fond
.
setVisibility
(
View
.
VISIBLE
);
holder
.
iv_fond
.
setOnClickListener
((
v
)
->
{
DialogPlus
builder
=
new
DialogPlus
(
getContext
());
builder
.
setMessage
(
R
.
string
.
join_helper_tip
);
builder
.
show
();
});
}
else
{
holder
.
iv_fond
.
setVisibility
(
View
.
GONE
);
}
bindMenu
(
holder
,
position
);
bindMenu
(
holder
,
position
);
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
0ba1b0de
...
@@ -103,6 +103,7 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
...
@@ -103,6 +103,7 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
dialogPlus
.
setMessageGravity
(
Gravity
.
CENTER_HORIZONTAL
);
dialogPlus
.
setMessageGravity
(
Gravity
.
CENTER_HORIZONTAL
);
dialogPlus
.
setLeftButtonListener
((
dialog
,
which
)
->
{
dialogPlus
.
setLeftButtonListener
((
dialog
,
which
)
->
{
mServerListManager
.
delete
(
event
.
position
);
mServerListManager
.
delete
(
event
.
position
);
mServerListAdapter
.
notifyDataSetChanged
();
dialog
.
dismiss
();
dialog
.
dismiss
();
});
});
dialogPlus
.
setCancelable
(
false
);
dialogPlus
.
setCancelable
(
false
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ServerInfoViewHolder.java
View file @
0ba1b0de
package
cn.garymb.ygomobile.ui.home
;
package
cn.garymb.ygomobile.ui.home
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.tubb.smrv.SwipeHorizontalMenuLayout
;
import
com.tubb.smrv.SwipeHorizontalMenuLayout
;
...
@@ -19,6 +20,7 @@ public class ServerInfoViewHolder extends BaseRecyclerAdapterPlus.BaseViewHolder
...
@@ -19,6 +20,7 @@ public class ServerInfoViewHolder extends BaseRecyclerAdapterPlus.BaseViewHolder
btnDelete
=
$
(
R
.
id
.
btn_delete
);
btnDelete
=
$
(
R
.
id
.
btn_delete
);
mMenuLayout
=
$
(
R
.
id
.
swipe_layout
);
mMenuLayout
=
$
(
R
.
id
.
swipe_layout
);
contentView
=
$
(
R
.
id
.
smContentView
);
contentView
=
$
(
R
.
id
.
smContentView
);
iv_fond
=
$
(
R
.
id
.
iv_fond
);
}
}
public
final
SwipeHorizontalMenuLayout
mMenuLayout
;
public
final
SwipeHorizontalMenuLayout
mMenuLayout
;
...
@@ -28,4 +30,5 @@ public class ServerInfoViewHolder extends BaseRecyclerAdapterPlus.BaseViewHolder
...
@@ -28,4 +30,5 @@ public class ServerInfoViewHolder extends BaseRecyclerAdapterPlus.BaseViewHolder
public
final
TextView
serverIp
;
public
final
TextView
serverIp
;
public
final
TextView
serverPort
;
public
final
TextView
serverPort
;
public
final
View
btnEdit
,
btnDelete
;
public
final
View
btnEdit
,
btnDelete
;
public
ImageView
iv_fond
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ServerListManager.java
View file @
0ba1b0de
...
@@ -163,6 +163,7 @@ public class ServerListManager {
...
@@ -163,6 +163,7 @@ public class ServerListManager {
super
.
onSelectedChanged
(
viewHolder
,
actionState
);
super
.
onSelectedChanged
(
viewHolder
,
actionState
);
if
(
mChanged
&&
actionState
==
ItemTouchHelper
.
ACTION_STATE_IDLE
)
{
if
(
mChanged
&&
actionState
==
ItemTouchHelper
.
ACTION_STATE_IDLE
)
{
saveItems
();
saveItems
();
mAdapter
.
notifyDataSetChanged
();
}
}
mChanged
=
false
;
mChanged
=
false
;
}
}
...
...
mobile/src/main/res/layout/item_server_info_swipe.xml
View file @
0ba1b0de
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
android:textColor=
"@color/brightgreen"
android:textColor=
"@color/brightgreen"
tools:text=
"233正式服务器"
/>
tools:text=
"233正式服务器"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
@@ -155,6 +156,14 @@
...
@@ -155,6 +156,14 @@
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textColor=
"@color/holo_blue_bright"
android:textColor=
"@color/holo_blue_bright"
tools:text=
"player"
/>
tools:text=
"player"
/>
<ImageView
android:id=
"@+id/iv_fond"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_marginRight=
"20dp"
android:gravity=
"center"
android:background=
"@drawable/buttonfunction"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
0ba1b0de
...
@@ -187,7 +187,7 @@
...
@@ -187,7 +187,7 @@
<string
name=
"mc_home"
>
大厅
</string>
<string
name=
"mc_home"
>
大厅
</string>
<string
name=
"bbs"
>
社区
</string>
<string
name=
"bbs"
>
社区
</string>
<string
name=
"settings_pref_settings_only_game"
>
直接启动游戏
</string>
<string
name=
"settings_pref_settings_only_game"
>
直接启动游戏
</string>
<string
name=
"only_game_tip"
>
取消设置,只能清空应用的数据,或者重装
</string>
<string
name=
"only_game_tip"
>
慎重勾选,清除应用数据或者重装才能恢复
</string>
<string
name=
"title_use_ex"
>
使用额外卡库
</string>
<string
name=
"title_use_ex"
>
使用额外卡库
</string>
<string
name=
"tip_network_image"
>
服务器爆炸了
</string>
<string
name=
"tip_network_image"
>
服务器爆炸了
</string>
<string
name=
"game_version"
>
游戏版本
</string>
<string
name=
"game_version"
>
游戏版本
</string>
...
@@ -200,4 +200,5 @@
...
@@ -200,4 +200,5 @@
<string
name=
"deck_name"
>
卡组
</string>
<string
name=
"deck_name"
>
卡组
</string>
<string
name=
"save_quit"
>
保存并退出
</string>
<string
name=
"save_quit"
>
保存并退出
</string>
<string
name=
"tip_reset_game_res"
>
游戏数据检查完成
</string>
<string
name=
"tip_reset_game_res"
>
游戏数据检查完成
</string>
<string
name=
"join_helper_tip"
>
你可以把偏好的服务器拖到置顶\n那么快捷加房时候就会加入置顶的服务器
</string>
</resources>
</resources>
mobile/src/main/res/values/strings.xml
View file @
0ba1b0de
...
@@ -203,4 +203,5 @@
...
@@ -203,4 +203,5 @@
<string
name=
"deck_name"
>
卡组
</string>
<string
name=
"deck_name"
>
卡组
</string>
<string
name=
"save_quit"
>
Save and quit
</string>
<string
name=
"save_quit"
>
Save and quit
</string>
<string
name=
"tip_reset_game_res"
>
Reset game resources completed
</string>
<string
name=
"tip_reset_game_res"
>
Reset game resources completed
</string>
<string
name=
"join_helper_tip"
>
you can move your favourite sever on top\n then join helper will acquiescently start in it
</string>
</resources>
</resources>
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