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
79e40df4
Commit
79e40df4
authored
Jul 30, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加聊天室fragment
为萌卡fragment添加承接聊天室fragment的布局 修改聊天气泡风格
parent
bf2b1a3f
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
201 additions
and
175 deletions
+201
-175
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+5
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
...in/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
+14
-32
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/mcchat/MycardChatFragment.java
...garymb/ygomobile/ui/mycard/mcchat/MycardChatFragment.java
+36
-38
mobile/src/main/res/drawable-xhdpi/radius_p.9.png
mobile/src/main/res/drawable-xhdpi/radius_p.9.png
+0
-0
mobile/src/main/res/drawable/button2_bg.xml
mobile/src/main/res/drawable/button2_bg.xml
+2
-2
mobile/src/main/res/layout/activity_home.xml
mobile/src/main/res/layout/activity_home.xml
+3
-3
mobile/src/main/res/layout/fragment_mycard.xml
mobile/src/main/res/layout/fragment_mycard.xml
+68
-50
mobile/src/main/res/layout/fragment_mycard_chating_room.xml
mobile/src/main/res/layout/fragment_mycard_chating_room.xml
+50
-26
mobile/src/main/res/layout/item_chat.xml
mobile/src/main/res/layout/item_chat.xml
+5
-5
mobile/src/main/res/layout/item_chat_me.xml
mobile/src/main/res/layout/item_chat_me.xml
+5
-5
mobile/src/main/res/layout/main_horizontal_fragment.xml
mobile/src/main/res/layout/main_horizontal_fragment.xml
+0
-11
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+4
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+4
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+4
-0
mobile/src/main/res/values/styles.xml
mobile/src/main/res/values/styles.xml
+1
-3
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
79e40df4
...
...
@@ -23,6 +23,7 @@ import cn.garymb.ygomobile.ui.activities.BaseActivity;
import
cn.garymb.ygomobile.ui.cards.CardSearchFragment
;
import
cn.garymb.ygomobile.ui.cards.DeckManagerFragment
;
import
cn.garymb.ygomobile.ui.mycard.MycardFragment
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.MycardChatFragment
;
import
cn.garymb.ygomobile.ui.settings.SettingFragment
;
import
cn.garymb.ygomobile.utils.ScreenUtil
;
...
...
@@ -39,6 +40,7 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
public
DeckManagerFragment
fragment_deck_cards
;
public
MycardFragment
fragment_mycard
;
public
SettingFragment
fragment_settings
;
public
MycardChatFragment
fragment_mycard_chatting_room
;
private
Bundle
mBundle
;
...
...
@@ -108,6 +110,9 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
fragment_deck_cards
=
new
DeckManagerFragment
();
fragment_mycard
=
new
MycardFragment
();
fragment_settings
=
new
SettingFragment
();
fragment_mycard_chatting_room
=
new
MycardChatFragment
();
mFragment
=
fragment_home
;
getSupportFragmentManager
().
beginTransaction
().
add
(
R
.
id
.
fragment_content
,
fragment_home
).
commit
();
getSupportActionBar
().
hide
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
View file @
79e40df4
...
...
@@ -40,9 +40,11 @@ import cn.garymb.ygomobile.YGOStarter;
import
cn.garymb.ygomobile.base.BaseFragemnt
;
import
cn.garymb.ygomobile.lite.BuildConfig
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.home.HomeActivity
;
import
cn.garymb.ygomobile.ui.mycard.base.OnJoinChatListener
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.ChatListener
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.ChatMessage
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.MycardChatFragment
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.ServiceManagement
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.UserManagement
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
...
...
@@ -51,6 +53,7 @@ import cn.garymb.ygomobile.utils.glide.GlideCompat;
public
class
MycardFragment
extends
BaseFragemnt
implements
View
.
OnClickListener
,
MyCard
.
MyCardListener
,
OnJoinChatListener
,
ChatListener
{
private
static
final
int
FILECHOOSER_RESULTCODE
=
10
;
private
static
final
int
TYPE_MC_LOGIN
=
0
;
private
HomeActivity
homeActivity
;
//头像昵称账号
private
ImageView
mHeadView
;
private
TextView
mNameView
,
mStatusView
;
...
...
@@ -89,9 +92,11 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
@Override
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
homeActivity
=
(
HomeActivity
)
getActivity
();
View
view
;
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_mycard
,
container
,
false
);
initView
(
view
);
initData
();
return
view
;
}
...
...
@@ -173,6 +178,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
});
mMyCard
.
attachWeb
(
mWebViewPlus
,
this
);
mWebViewPlus
.
loadUrl
(
mMyCard
.
getHomeUrl
());
getChildFragmentManager
().
beginTransaction
().
add
(
R
.
id
.
fragment_content
,
homeActivity
.
fragment_mycard_chatting_room
).
hide
(
homeActivity
.
fragment_mycard_chatting_room
).
commit
();
}
private
void
initData
()
{
...
...
@@ -238,32 +244,6 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
mUploadCallbackAboveL
=
null
;
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
if
(
doMenu
(
item
.
getItemId
()))
{
return
true
;
}
return
super
.
onOptionsItemSelected
(
item
);
}
private
boolean
doMenu
(
int
id
)
{
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;*/
default
:
return
false
;
}
return
true
;
}
/**
* 第一次fragment可见(进行初始化工作)
*/
...
...
@@ -325,6 +305,11 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
break
;
case
R
.
id
.
rl_chat
:
//这里显示聊天室fragment
if
(
homeActivity
.
fragment_mycard_chatting_room
.
isHidden
())
{
getChildFragmentManager
().
beginTransaction
().
show
(
homeActivity
.
fragment_mycard_chatting_room
).
commit
();
}
else
{
getChildFragmentManager
().
beginTransaction
().
hide
(
homeActivity
.
fragment_mycard_chatting_room
).
commit
();
}
break
;
}
}
...
...
@@ -360,7 +345,6 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
@Override
public
void
onChatLogin
(
String
exception
)
{
Log
.
e
(
"MyCardFragment"
,
"登录情况"
+
exception
);
pb_chat_loading
.
setVisibility
(
View
.
GONE
);
if
(
TextUtils
.
isEmpty
(
exception
))
{
if
(
currentMessage
==
null
)
{
...
...
@@ -381,14 +365,12 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
@Override
public
void
onChatLoginLoading
()
{
Log
.
e
(
"MyCardFragment"
,
"加载中"
);
pb_chat_loading
.
setVisibility
(
View
.
VISIBLE
);
tv_message
.
setText
(
R
.
string
.
logining_in
);
}
@Override
public
void
onJoinRoomLoading
()
{
Log
.
e
(
"MyCardFragment"
,
"加入房间中"
);
pb_chat_loading
.
setVisibility
(
View
.
VISIBLE
);
tv_message
.
setText
(
R
.
string
.
logining_in
);
}
...
...
@@ -421,9 +403,9 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
public
void
reChatLogin
(
boolean
state
)
{
pb_chat_loading
.
setVisibility
(
View
.
VISIBLE
);
if
(
state
)
{
tv_message
.
setText
(
"登录成功"
);
tv_message
.
setText
(
R
.
string
.
login_succeed
);
}
else
{
tv_message
.
setText
(
"连接断开,重新登录中……"
);
tv_message
.
setText
(
R
.
string
.
miss_connection
);
}
}
...
...
@@ -433,7 +415,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
if
(
state
)
{
onChatLogin
(
null
);
}
else
{
tv_message
.
setText
(
"重新加入聊天室中……"
);
tv_message
.
setText
(
R
.
string
.
reChatJoining
);
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/mcchat/MycardChatFragment.java
View file @
79e40df4
...
...
@@ -4,6 +4,7 @@ import android.os.Bundle;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
...
...
@@ -18,51 +19,71 @@ import com.ourygo.assistant.util.Util;
import
cn.garymb.ygomobile.base.BaseFragemnt
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.home.HomeActivity
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.adapter.ChatAdapter
;
import
cn.garymb.ygomobile.ui.mycard.mcchat.management.ServiceManagement
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
public
class
MycardChatFragment
extends
BaseFragemnt
implements
ChatListener
{
private
HomeActivity
homeActivity
;
private
EditText
main_send_message
;
private
Image
Button
main_send
;
private
Button
main_send
;
private
RecyclerView
main_rec
;
private
TextView
main_title
;
private
Button
btn_hide
;
private
LinearLayout
main_bottom_bar
;
private
ChatAdapter
cadp
;
private
ServiceManagement
s
u
;
private
ServiceManagement
s
erviceManagement
;
@Nullable
@Override
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
homeActivity
=
(
HomeActivity
)
getActivity
();
View
view
;
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_mycard_chating_room
,
container
,
false
);
initView
(
view
);
return
view
;
}
private
void
initView
(
View
view
)
{
serviceManagement
=
ServiceManagement
.
getDx
();
cadp
=
new
ChatAdapter
(
getContext
(),
serviceManagement
.
getData
());
serviceManagement
.
addListener
(
this
);
main_rec
=
view
.
findViewById
(
R
.
id
.
main_rec
);
main_send
=
view
.
findViewById
(
R
.
id
.
main_send
);
main_send_message
=
view
.
findViewById
(
R
.
id
.
main_send_message
);
main_title
=
view
.
findViewById
(
R
.
id
.
main_title
);
btn_hide
=
view
.
findViewById
(
R
.
id
.
btn_hide
);
main_bottom_bar
=
view
.
findViewById
(
R
.
id
.
main_bottom_bar
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
VERTICAL
,
false
);
linearLayoutManager
.
setStackFromEnd
(
true
);
//关键 设置此项,当软键盘弹出时,布局会自动顶上去,在结合AndroidManifest.xml设置属性
main_rec
.
setLayoutManager
(
linearLayoutManager
);
main_rec
.
setAdapter
(
cadp
);
initListener
();
}
@Override
public
void
reChatLogin
(
boolean
state
)
{
main_bottom_bar
.
setVisibility
(
View
.
GONE
);
if
(
state
)
{
main_title
.
setText
(
R
.
string
.
logining_in
);
}
else
{
main_title
.
setText
(
"连接断开,重新登录中……"
);
main_title
.
setText
(
R
.
string
.
miss_connection
);
}
// TODO: Implement this method
}
@Override
public
void
reChatJoin
(
boolean
state
)
{
if
(
state
)
{
main_bottom_bar
.
setVisibility
(
View
.
VISIBLE
);
main_title
.
setText
(
get
Resources
().
getString
(
R
.
string
.
app_name
)
);
main_title
.
setText
(
get
String
(
R
.
string
.
mc_chat
)
+
"("
+
serviceManagement
.
getMemberNum
()
+
")"
);
}
else
{
main_bottom_bar
.
setVisibility
(
View
.
GONE
);
main_title
.
setText
(
"重新加入聊天室中……"
);
main_title
.
setText
(
R
.
string
.
reChatJoining
);
}
// TODO: Implement this method
}
@Override
...
...
@@ -73,57 +94,34 @@ public class MycardChatFragment extends BaseFragemnt implements ChatListener {
@Override
public
void
addChatMessage
(
ChatMessage
message
)
{
cadp
.
sx
();
main_rec
.
smoothScrollToPosition
(
su
.
getData
().
size
()
-
1
);
// TODO: Implement this method
main_rec
.
smoothScrollToPosition
(
serviceManagement
.
getData
().
size
()
-
1
);
}
@Override
public
void
removeChatMessage
(
ChatMessage
message
)
{
// TODO: Implement this method
}
private
void
initView
(
View
view
)
{
main_rec
=
view
.
findViewById
(
R
.
id
.
main_rec
);
main_send
=
view
.
findViewById
(
R
.
id
.
main_send
);
main_send_message
=
view
.
findViewById
(
R
.
id
.
main_send_message
);
main_title
=
view
.
findViewById
(
R
.
id
.
main_title
);
main_bottom_bar
=
view
.
findViewById
(
R
.
id
.
main_bottom_bar
);
su
=
ServiceManagement
.
getDx
();
cadp
=
new
ChatAdapter
(
getContext
(),
su
.
getData
());
su
.
addListener
(
this
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
getContext
(),
LinearLayoutManager
.
VERTICAL
,
false
);
linearLayoutManager
.
setStackFromEnd
(
true
);
//关键 设置此项,当软键盘弹出时,布局会自动顶上去,在结合AndroidManifest.xml设置属性
main_rec
.
setLayoutManager
(
linearLayoutManager
);
main_rec
.
setAdapter
(
cadp
);
initListener
();
// TODO: Implement this method
}
private
void
initListener
()
{
main_send
.
setOnClickListener
(
p1
->
{
String
message
=
main_send_message
.
getText
().
toString
().
trim
();
if
(
message
.
equals
(
""
))
{
YGOUtil
.
show
(
getString
(
R
.
string
.
noting_to_send
));
YGOUtil
.
show
(
getString
(
R
.
string
.
noting_to_send
));
}
else
{
try
{
s
u
.
sendMessage
(
message
);
s
erviceManagement
.
sendMessage
(
message
);
main_send_message
.
setText
(
""
);
}
catch
(
Exception
e
)
{
YGOUtil
.
show
(
getString
(
R
.
string
.
sending_failed
));
YGOUtil
.
show
(
getString
(
R
.
string
.
sending_failed
));
}
}
// TODO: Implement this method
});
// TODO: Implement this method
btn_hide
.
setOnClickListener
(
p1
->
{
getParentFragmentManager
().
beginTransaction
().
hide
(
homeActivity
.
fragment_mycard_chatting_room
).
commit
();
});
}
@Override
public
void
onDestroy
()
{
// TODO: Implement this method
super
.
onDestroy
();
// su.disClass();
// UserManagement.setUserName(null);
...
...
mobile/src/main/res/drawable-xhdpi/radius_p.9.png
0 → 100644
View file @
79e40df4
8.47 KB
mobile/src/main/res/drawable/button2_bg.xml
View file @
79e40df4
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@drawable/
button2_p
"
android:state_pressed=
"true"
/>
<item
android:drawable=
"@drawable/
button2_n
"
/>
<item
android:drawable=
"@drawable/
radius
"
android:state_pressed=
"true"
/>
<item
android:drawable=
"@drawable/
radius_p
"
/>
</selector>
\ No newline at end of file
mobile/src/main/res/layout/activity_home.xml
View file @
79e40df4
...
...
@@ -10,13 +10,13 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#aa000000"
/>
android:background=
"#aa000000"
/>
<FrameLayout
android:id=
"@+id/fragment_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"70dp"
>
</FrameLayout>
android:layout_marginBottom=
"70dp"
></FrameLayout>
<com.ashokvarma.bottomnavigation.BottomNavigationBar
android:id=
"@+id/bottom_navigation_bar"
...
...
mobile/src/main/res/layout/fragment_mycard.xml
View file @
79e40df4
<?xml version="1.0" encoding="utf-8"?>
<
LinearLayou
t
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
androidx.appcompat.widget.LinearLayoutCompa
t
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/drawer_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/dialogshort"
android:weightSum=
"12"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/
r
l_head"
android:id=
"@+id/
f
l_head"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"60dp"
android:orientation=
"vertical"
android:padding=
"10dp"
>
...
...
@@ -68,6 +66,15 @@
android:visibility=
"gone"
/>
</FrameLayout>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<cn.garymb.ygomobile.ui.mycard.MyCardWebView
android:id=
"@+id/webbrowser"
android:layout_width=
"match_parent"
...
...
@@ -87,6 +94,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_gravity=
"bottom"
android:background=
"@drawable/button_bg"
android:orientation=
"vertical"
android:padding=
"10dp"
>
...
...
@@ -95,6 +104,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/mc_chat"
android:layout_centerVertical=
"true"
android:textColor=
"@color/holo_green_bright"
android:textStyle=
"bold"
/>
...
...
@@ -104,18 +114,26 @@
android:layout_height=
"15dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"5dp"
android:layout_centerVertical=
"true"
android:layout_toRightOf=
"@id/tv_message_s"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_message"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tv_message_s"
android:layout_marginTop=
"5dp"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_toRightOf=
"@id/pb_chat_loading"
android:layout_centerVertical=
"true"
android:ellipsize=
"end"
android:lines=
"1"
android:text=
""
android:textColor=
"@color/holo_orange_bright"
android:textSize=
"10sp"
/>
android:textColor=
"@color/holo_orange_bright"
/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.fragment.app.FragmentContainerView
android:id=
"@+id/fragment_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</FrameLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
mobile/src/main/res/layout/fragment_mycard_chating_room.xml
View file @
79e40df4
...
...
@@ -2,28 +2,45 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@
color/background
"
android:background=
"@
drawable/button_n
"
android:gravity=
"center"
android:orientation=
"vertical"
>
<
Relativ
eLayout
<
Fram
eLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/mediumPurpleLight"
>
android:background=
"@color/transparent"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/img_head"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:src=
"@drawable/mycard"
/>
<TextView
android:id=
"@+id/main_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"10dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_marginBottom=
"10dp"
android:layout_margin=
"10dp"
android:text=
"@string/mc_chat"
android:textColor=
"@color/white"
android:textSize=
"20sp"
/>
android:textColor=
"@color/holo_green_bright"
android:textSize=
"15sp"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_hide"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"right|center"
android:background=
"@drawable/ic_close_black_24dp"
android:gravity=
"center"
/>
</
Relativ
eLayout>
</
Fram
eLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/main_rec"
...
...
@@ -35,21 +52,27 @@
android:id=
"@+id/main_bottom_bar"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/
white
"
android:background=
"@color/
transparent
"
android:gravity=
"center"
android:orientation=
"horizontal"
android:padding=
"7dp"
>
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/main_send_message"
<com.google.android.material.textfield.TextInputLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"10"
android:background=
"@drawable/chat_edittext_background"
android:maxEms=
"3"
android:padding=
"7dp"
android:textColor=
"@color/black"
android:textSize=
"15sp"
/>
android:layout_weight=
"8"
>
<androidx.appcompat.widget.AppCompatEditText
android:id=
"@+id/main_send_message"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:hint=
"@string/edit_your_message"
android:imeOptions=
"actionSend"
android:inputType=
"textNoSuggestions"
android:maxLines=
"1"
android:singleLine=
"true"
android:textColorHint=
"@color/holo_green_bright"
/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width=
"0dp"
...
...
@@ -59,14 +82,15 @@
android:gravity=
"center"
android:orientation=
"vertical"
>
<
Image
Button
<Button
android:id=
"@+id/main_send"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/
chat_message_background
"
android:background=
"@drawable/
button2_bg
"
android:gravity=
"center"
android:src=
"@drawable/ic_send_black_24dp"
android:text=
"@string/send"
android:textColor=
"@color/brightgreen"
android:textSize=
"12sp"
/>
</LinearLayout>
...
...
mobile/src/main/res/layout/item_chat.xml
View file @
79e40df4
...
...
@@ -21,7 +21,7 @@
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"5dp"
android:layout_toRightOf=
"@id/ic_avatar"
android:background=
"@drawable/
chat_message_background
"
android:background=
"@drawable/
radius
"
android:descendantFocusability=
"blocksDescendants"
android:orientation=
"vertical"
android:padding=
"8dp"
>
...
...
@@ -32,8 +32,8 @@
android:layout_height=
"wrap_content"
android:paddingBottom=
"4dp"
android:text=
"name"
android:textColor=
"
#B8630C
"
android:textSize=
"1
3
sp"
android:textColor=
"
@color/white
"
android:textSize=
"1
0
sp"
android:textStyle=
"bold"
/>
<TextView
...
...
@@ -41,8 +41,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"message"
android:textColor=
"
#000000
"
android:textSize=
"1
6
sp"
/>
android:textColor=
"
@color/holo_blue_bright
"
android:textSize=
"1
3
sp"
/>
</LinearLayout>
...
...
mobile/src/main/res/layout/item_chat_me.xml
View file @
79e40df4
...
...
@@ -22,7 +22,7 @@
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"5dp"
android:layout_toLeftOf=
"@id/icm_avatar"
android:background=
"@drawable/
chat_message_me_background
"
android:background=
"@drawable/
radius_p
"
android:descendantFocusability=
"blocksDescendants"
android:orientation=
"vertical"
android:padding=
"8dp"
>
...
...
@@ -33,8 +33,8 @@
android:layout_height=
"0px"
android:paddingBottom=
"4dp"
android:text=
"name"
android:textColor=
"
#B8630C
"
android:textSize=
"1
3
sp"
android:textColor=
"
@color/holo_blue_bright
"
android:textSize=
"1
0
sp"
android:textStyle=
"bold"
/>
<TextView
...
...
@@ -42,8 +42,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"message"
android:textColor=
"
#000000
"
android:textSize=
"1
6
sp"
/>
android:textColor=
"
@color/brightgreen
"
android:textSize=
"1
3
sp"
/>
</LinearLayout>
...
...
mobile/src/main/res/layout/main_horizontal_fragment.xml
deleted
100644 → 0
View file @
bf2b1a3f
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingLeft=
"10dp"
android:orientation=
"horizontal"
android:background=
"@drawable/bg"
>
</LinearLayout>
\ No newline at end of file
mobile/src/main/res/values-ko/strings.xml
View file @
79e40df4
...
...
@@ -329,4 +329,8 @@
<string
name=
"login_mycard"
>
로그인
</string>
<string
name=
"logout_mycard"
>
로그아웃\?
</string>
<string
name=
"back_to_mycard_home"
>
return to MyCard homepage
</string>
<string
name=
"edit_your_message"
>
Input your message
</string>
<string
name=
"login_succeed"
>
Chatroom logined
</string>
<string
name=
"miss_connection"
>
miss connection, relogining
</string>
<string
name=
"reChatJoining"
>
relogining\.\.\.
</string>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
79e40df4
...
...
@@ -329,4 +329,8 @@
<string
name=
"bot_mode"
>
人机练习
</string>
<string
name=
"personal"
>
我的
</string>
<string
name=
"back_to_mycard_home"
>
返回萌卡首页
</string>
<string
name=
"edit_your_message"
>
输入聊天内容
</string>
<string
name=
"login_succeed"
>
登录成功
</string>
<string
name=
"miss_connection"
>
连接断开,重新登陆中……
</string>
<string
name=
"reChatJoining"
>
连接断开,重新登陆中……
</string>
</resources>
mobile/src/main/res/values/strings.xml
View file @
79e40df4
...
...
@@ -339,4 +339,8 @@
<string
name=
"login_mycard"
>
login
</string>
<string
name=
"logout_mycard"
>
Logout mycard\?
</string>
<string
name=
"back_to_mycard_home"
>
return to MyCard homepage
</string>
<string
name=
"edit_your_message"
>
Input your message
</string>
<string
name=
"login_succeed"
>
Chatroom logined
</string>
<string
name=
"miss_connection"
>
miss connection, relogining
</string>
<string
name=
"reChatJoining"
>
relogining\.\.\.
</string>
</resources>
mobile/src/main/res/values/styles.xml
View file @
79e40df4
...
...
@@ -96,9 +96,7 @@
<item
name=
"android:maxHeight"
>
50dp
</item>
<item
name=
"android:minHeight"
>
10dp
</item>
<item
name=
"android:indeterminateOnly"
>
false
</item>
<item
name=
"android:indeterminateDrawable"
>
@android:drawable/progress_indeterminate_horizontal
</item>
<item
name=
"android:indeterminateDrawable"
>
@android:drawable/progress_indeterminate_horizontal
</item>
<item
name=
"android:progressDrawable"
>
@drawable/progressbar
</item>
</style>
...
...
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