Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
82aa8edf
Commit
82aa8edf
authored
Dec 27, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 修改文案,扩展弹窗文字加粗样式
parent
56476718
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
160 additions
and
32 deletions
+160
-32
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
config.gradle
config.gradle
+4
-4
MedicalAddNewArchivesActivity.kt
m-im/src/main/java/com/yidianling/medical/archives/MedicalAddNewArchivesActivity.kt
+12
-4
EditTextUtils.kt
m-im/src/main/java/com/yidianling/medical/utils/EditTextUtils.kt
+79
-0
medical_bg_1a3464ec.xml
m-im/src/main/res/drawable/medical_bg_1a3464ec.xml
+6
-2
im_nim_inquiry_end_layout.xml
m-im/src/main/res/layout/im_nim_inquiry_end_layout.xml
+6
-4
im_nim_inquiry_receive_layout.xml
m-im/src/main/res/layout/im_nim_inquiry_receive_layout.xml
+0
-1
medical_add_new_archives_activity.xml
m-im/src/main/res/layout/medical_add_new_archives_activity.xml
+5
-1
medical_graphic_consultation_flow1.xml
m-im/src/main/res/layout/medical_graphic_consultation_flow1.xml
+1
-1
FontUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/FontUtils.kt
+34
-0
NormalDialog.java
ydl-platform/src/main/java/com/ydl/ydlcommon/view/dialog/NormalDialog.java
+11
-13
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
82aa8edf
...
...
@@ -19,8 +19,8 @@ import java.util.List;
*/
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
//
public static String appEnv = YDLConstants.ENV_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_NEW_TEST
;
public
static
String
appEnv
=
YDLConstants
.
ENV_TEST
;
//
public static String appEnv = YDLConstants.ENV_NEW_TEST;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
...
...
config.gradle
View file @
82aa8edf
...
...
@@ -10,7 +10,7 @@ ext {
"m-fm"
:
"0.0.30.03"
,
"m-user"
:
"0.0.61.89"
,
"m-home"
:
"0.0.22.70"
,
"m-im"
:
"0.0.20.7
2
"
,
"m-im"
:
"0.0.20.7
3
"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.6
3
"
,
"ydl-platform"
:
"0.0.40.6
6
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.56"
,
...
...
@@ -94,7 +94,7 @@ ext {
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.89"
,
"m-home"
:
"0.0.22.70"
,
"m-im"
:
"0.0.20.7
2
"
,
"m-im"
:
"0.0.20.7
3
"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.8"
,
...
...
@@ -116,7 +116,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.6
3
"
,
"ydl-platform"
:
"0.0.40.6
6
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.56"
,
...
...
m-im/src/main/java/com/yidianling/medical/archives/MedicalAddNewArchivesActivity.kt
View file @
82aa8edf
...
...
@@ -3,11 +3,13 @@ package com.yidianling.medical.archives
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Intent
import
android.view.*
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.view.dialog.NormalDialog
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.R
import
com.yidianling.medical.utils.EditTextUtils
import
com.yidianling.uikit.custom.http.ServiceImpl
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
...
...
@@ -36,6 +38,8 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
}
override
fun
initDataAndEvent
()
{
mMarried
=
-
1
mRelation
=
-
1
initStatus
()
group_merried
.
setOnCheckedChangeListener
{
group
,
checkedId
->
//婚姻状态
...
...
@@ -102,6 +106,8 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
checkInfo
()
}
EditTextUtils
.
disableCopyAndPaste
(
et_name
)
iv_back
.
setOnClickListener
{
finish
()
}
showDialogTip
()
...
...
@@ -110,10 +116,10 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
private
fun
showDialogTip
()
{
val
builder
=
NormalDialog
.
Builder
(
this
@MedicalAddNewArchivesActivity
,
"center"
,
false
)
builder
.
setTitle
(
""
)
builder
.
setMessage
(
"\n为向您添加的就诊人提供问诊服务,您需要向我们提供该就诊人的身份证号码,并确保在提供前已取得该就诊人的授权同意;若该就诊人为儿童的,您需要在提供前征得该儿童监护人的同意。\n
"
)
builder
.
setMessage
EndBold
(
"\n为向您添加的就诊人提供问诊服务,您需要向我们提供该"
,
"就诊人的身份证号码,并确保在提供前已取得该就诊人的授权同意;若该就诊人为儿童的,您需要在提供前征得该儿童监护人的同意。\n"
var
strs
=
arrayOf
(
"就诊人的身份证号码"
,
"就诊人的授权同意"
,
"您需要在提供前征得该儿童监护人的同意
"
)
builder
.
setMessage
AndBolds
(
"\n为向您添加的就诊人提供问诊服务,您需要向我们提供该
就诊人的身份证号码,并确保在提供前已取得该就诊人的授权同意;若该就诊人为儿童的,您需要在提供前征得该儿童监护人的同意。\n
"
,
strs
)
builder
.
setPositiveButton
(
"同意"
...
...
@@ -185,4 +191,5 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
StatusBarUtils
.
setTransparentForImageView
(
this
@MedicalAddNewArchivesActivity
,
null
)
StatusBarUtils
.
statusBarLightMode
(
this
@MedicalAddNewArchivesActivity
)
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/medical/utils/EditTextUtils.kt
0 → 100644
View file @
82aa8edf
package
com.yidianling.medical.utils
import
android.view.*
import
android.widget.EditText
import
android.widget.TextView
import
java.lang.reflect.Field
class
EditTextUtils
{
companion
object
{
/**
* 禁止输入框复制粘贴菜单
*/
fun
disableCopyAndPaste
(
editText
:
EditText
?)
{
try
{
if
(
editText
==
null
)
{
return
}
editText
.
setOnLongClickListener
(
object
:
View
.
OnLongClickListener
{
override
fun
onLongClick
(
v
:
View
?):
Boolean
{
return
true
}
})
editText
.
setLongClickable
(
false
)
editText
.
setOnTouchListener
(
object
:
View
.
OnTouchListener
{
override
fun
onTouch
(
v
:
View
?,
event
:
MotionEvent
):
Boolean
{
if
(
event
.
getAction
()
===
MotionEvent
.
ACTION_DOWN
)
{
// setInsertionDisabled when user touches the view
setInsertionDisabled
(
editText
)
}
return
false
}
})
editText
.
setCustomSelectionActionModeCallback
(
object
:
ActionMode
.
Callback
{
override
fun
onCreateActionMode
(
mode
:
ActionMode
?,
menu
:
Menu
?):
Boolean
{
return
false
}
override
fun
onPrepareActionMode
(
mode
:
ActionMode
?,
menu
:
Menu
?):
Boolean
{
return
false
}
override
fun
onActionItemClicked
(
mode
:
ActionMode
?,
item
:
MenuItem
?):
Boolean
{
return
false
}
override
fun
onDestroyActionMode
(
mode
:
ActionMode
?)
{}
})
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
private
fun
setInsertionDisabled
(
editText
:
EditText
)
{
try
{
val
editorField
:
Field
=
TextView
::
class
.
java
.
getDeclaredField
(
"mEditor"
)
editorField
.
setAccessible
(
true
)
val
editorObject
:
Any
=
editorField
.
get
(
editText
)
// if this view supports insertion handles
val
editorClass
=
Class
.
forName
(
"android.widget.Editor"
)
val
mInsertionControllerEnabledField
:
Field
=
editorClass
.
getDeclaredField
(
"mInsertionControllerEnabled"
)
mInsertionControllerEnabledField
.
setAccessible
(
true
)
mInsertionControllerEnabledField
.
set
(
editorObject
,
false
)
// if this view supports selection handles
val
mSelectionControllerEnabledField
:
Field
=
editorClass
.
getDeclaredField
(
"mSelectionControllerEnabled"
)
mSelectionControllerEnabledField
.
setAccessible
(
true
)
mSelectionControllerEnabledField
.
set
(
editorObject
,
false
)
}
catch
(
e
:
java
.
lang
.
Exception
)
{
e
.
printStackTrace
()
}
}
}
}
\ No newline at end of file
m-im/src/main/res/drawable/medical_bg_1a3464ec.xml
View file @
82aa8edf
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#1a3464ec"
/>
<corners
android:radius=
"4dp"
/>
<solid
android:color=
"#1a3464ec"
/>
<corners
android:radius=
"4dp"
/>
<stroke
android:width=
"1px"
android:color=
"@color/medical_color_3464ec"
/>
</shape>
\ No newline at end of file
m-im/src/main/res/layout/im_nim_inquiry_end_layout.xml
View file @
82aa8edf
...
...
@@ -5,8 +5,8 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/platform_dp_12"
android:background=
"#
cc
e7ecf0"
app:cardBackgroundColor=
"#
cc
e7ecf0"
android:background=
"#e7ecf0"
app:cardBackgroundColor=
"#e7ecf0"
android:elevation=
"0dp"
android:maxWidth=
"263dp"
android:minWidth=
"263dp"
...
...
@@ -21,8 +21,9 @@
android:layout_marginTop=
"8dp"
android:layout_marginRight=
"12dp"
android:layout_marginBottom=
"8dp"
android:textStyle=
"bold"
android:text=
"本次诊断结束,如有问题可联系客服或再次向医生问诊"
android:textColor=
"
#ff8595a9
"
android:textSize=
"1
3
sp"
/>
android:textColor=
"
@color/medical_color_0c1d31
"
android:textSize=
"1
6
sp"
/>
</androidx.cardview.widget.CardView>
\ No newline at end of file
m-im/src/main/res/layout/im_nim_inquiry_receive_layout.xml
View file @
82aa8edf
...
...
@@ -28,7 +28,6 @@
android:text=
"图文问诊"
android:textColor=
"#ff0c1d31"
android:textSize=
"18sp"
android:textStyle=
"bold"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
m-im/src/main/res/layout/medical_add_new_archives_activity.xml
View file @
82aa8edf
...
...
@@ -2,7 +2,8 @@
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
...
...
@@ -70,6 +71,9 @@
android:background=
"@null"
android:textStyle=
"bold"
android:hint=
"请输入真实姓名"
android:maxEms=
"15"
android:maxLength=
"15"
tools:text=
"123456789012345678910111212"
android:textColor=
"@color/medical_color_0c1d31"
android:textColorHint=
"@color/medical_color_c0c9d4"
android:textSize=
"16sp"
...
...
m-im/src/main/res/layout/medical_graphic_consultation_flow1.xml
View file @
82aa8edf
...
...
@@ -272,7 +272,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"13dp"
android:text=
"上传检查报告
或患处
照片(最多9张)"
android:text=
"上传检查报告照片(最多9张)"
android:textColor=
"@color/medical_color_0c1d31"
app:layout_constraintBottom_toTopOf=
"@id/camera_text_bottom"
app:layout_constraintLeft_toRightOf=
"@id/camera_bg"
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/FontUtils.kt
0 → 100644
View file @
82aa8edf
package
com.ydl.ydlcommon.utils
import
android.content.Context
import
android.graphics.Typeface
import
android.text.SpannableString
import
android.text.Spanned
import
android.text.style.StyleSpan
class
FontUtils
{
companion
object
{
fun
getMultiFontText
(
text
:
String
,
wordsToBold
:
Array
<
String
>
):
SpannableString
?
{
val
spannableString
=
SpannableString
(
text
)
for
(
word
in
wordsToBold
)
{
var
startIndex
=
text
.
indexOf
(
word
)
while
(
startIndex
>=
0
)
{
val
endIndex
=
startIndex
+
word
.
length
spannableString
.
setSpan
(
StyleSpan
(
Typeface
.
BOLD
),
startIndex
,
endIndex
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
startIndex
=
text
.
indexOf
(
word
,
endIndex
+
1
)
}
}
return
spannableString
}
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/view/dialog/NormalDialog.java
View file @
82aa8edf
...
...
@@ -6,10 +6,7 @@ import android.app.Dialog;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.graphics.Color
;
import
android.graphics.Typeface
;
import
android.text.Spannable
;
import
android.text.SpannableStringBuilder
;
import
android.text.style.StyleSpan
;
import
android.text.SpannableString
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup.LayoutParams
;
...
...
@@ -18,6 +15,7 @@ import android.widget.LinearLayout;
import
android.widget.TextView
;
import
com.ydl.ydlcommon.R
;
import
com.ydl.ydlcommon.utils.FontUtils
;
/**
...
...
@@ -42,8 +40,7 @@ public class NormalDialog extends Dialog {
private
Context
context
;
//上下文对象
private
String
title
;
//对话框标题
private
String
message
;
//对话框内容
private
String
messageStar
;
//对话框内容开始
private
String
messageEnd
;
//对话框内容加粗部分
private
String
[]
wordsToBold
;
//对话框需要加粗字体
private
String
confirm_btnText
;
//按钮名称“确定”
private
String
cancel_btnText
;
//按钮名称“取消”
private
View
contentView
;
//对话框中间加载的其他布局界面
...
...
@@ -96,9 +93,9 @@ public class NormalDialog extends Dialog {
return
this
;
}
public
Builder
setMessage
EndBold
(
String
strStart
,
String
strEn
d
)
{
this
.
message
Star
=
strStart
;
this
.
messageEnd
=
strEn
d
;
public
Builder
setMessage
AndBolds
(
String
message
,
String
[]
wordsToBol
d
)
{
this
.
message
=
message
;
this
.
wordsToBold
=
wordsToBol
d
;
return
this
;
}
...
...
@@ -267,6 +264,7 @@ public class NormalDialog extends Dialog {
right_btn
.
setText
(
confirm_btnText
);
if
(
confirm_btnClickListener
!=
null
)
{
right_btn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
confirm_btnClickListener
.
onClick
(
dialog
,
DialogInterface
.
BUTTON_POSITIVE
);
...
...
@@ -286,6 +284,7 @@ public class NormalDialog extends Dialog {
left_btn
.
setText
(
cancel_btnText
);
if
(
cancel_btnClickListener
!=
null
)
{
left_btn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
cancel_btnClickListener
.
onClick
(
dialog
,
DialogInterface
.
BUTTON_NEGATIVE
);
...
...
@@ -309,10 +308,9 @@ public class NormalDialog extends Dialog {
message_tv
.
setTextColor
(
Color
.
parseColor
(
content_color
));
}
if
(
messageStar
!=
null
)
{
SpannableStringBuilder
builder
=
new
SpannableStringBuilder
(
messageStar
+
messageEnd
);
builder
.
setSpan
(
new
StyleSpan
(
Typeface
.
BOLD
),
messageStar
.
length
(),
messageStar
.
length
()
+
messageEnd
.
length
(),
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
message_tv
.
setText
(
builder
);
if
(
wordsToBold
!=
null
&&
wordsToBold
.
length
>
0
)
{
SpannableString
multiFontText
=
FontUtils
.
Companion
.
getMultiFontText
(
message
,
wordsToBold
);
message_tv
.
setText
(
multiFontText
);
}
else
{
message_tv
.
setText
(
message
);
}
...
...
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