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
4afc573b
Commit
4afc573b
authored
Jun 24, 2021
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:代码提交
parent
58ad4489
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
4 deletions
+65
-4
QuestionInformationView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/QuestionInformationView.kt
+58
-1
im_view_question_infomation.xml
m-im/src/main/res_uikit/layout/im_view_question_infomation.xml
+7
-3
No files found.
m-im/src/main/java/com/yidianling/uikit/business/session/view/QuestionInformationView.kt
View file @
4afc573b
...
@@ -5,6 +5,9 @@ import android.app.Activity
...
@@ -5,6 +5,9 @@ import android.app.Activity
import
android.content.Context
import
android.content.Context
import
android.os.Build
import
android.os.Build
import
android.os.Handler
import
android.os.Handler
import
android.text.Editable
import
android.text.TextUtils
import
android.text.TextWatcher
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.view.inputmethod.InputMethodManager
import
android.view.inputmethod.InputMethodManager
...
@@ -49,6 +52,7 @@ class QuestionInformationView(
...
@@ -49,6 +52,7 @@ class QuestionInformationView(
private
lateinit
var
mQuestionAdapter
:
QuestionAdapter
private
lateinit
var
mQuestionAdapter
:
QuestionAdapter
private
var
mData
=
ArrayList
<
QuestionMultiItem
>();
private
var
mData
=
ArrayList
<
QuestionMultiItem
>();
private
var
mQuestionBean
:
QuestionsInfoBean
?
=
null
private
var
mQuestionBean
:
QuestionsInfoBean
?
=
null
private
var
problemContent
=
""
init
{
init
{
val
params
=
LayoutParams
(
val
params
=
LayoutParams
(
...
@@ -113,11 +117,13 @@ class QuestionInformationView(
...
@@ -113,11 +117,13 @@ class QuestionInformationView(
//显示输入框
//显示输入框
cl_input
.
visibility
=
VISIBLE
cl_input
.
visibility
=
VISIBLE
tv_problem
.
visibility
=
VISIBLE
tv_problem
.
visibility
=
VISIBLE
hsv_problem_tips
.
visibility
=
GONE
var
problem
=
"已选:"
var
problem
=
"已选:"
list
?.
forEach
{
list
?.
forEach
{
problem
+=
"# "
+
it
?.
name
problem
+=
"# "
+
it
?.
name
}
}
tv_problem
.
text
=
problem
tv_problem
.
text
=
problem
et_input_problem
.
hint
=
"请输入其他事件......"
// 打开软件盘
// 打开软件盘
showInputMethod
(
et_input_problem
)
showInputMethod
(
et_input_problem
)
// 滚动到底部
// 滚动到底部
...
@@ -154,7 +160,59 @@ class QuestionInformationView(
...
@@ -154,7 +160,59 @@ class QuestionInformationView(
return
@forEach
return
@forEach
}
}
}
}
tv_send
.
setOnClickListener
{
et_input_problem
.
setText
(
""
)
hideInputMethod
(
et_input_problem
)
}
tv_cur_problem
.
setOnClickListener
{
problemContent
=
et_input_problem
.
text
.
toString
()
et_input_problem
.
setText
(
"$problemContent${tv_cur_problem.text}:\n"
)
et_input_problem
.
setSelection
(
et_input_problem
.
text
.
toString
().
length
-
1
)
recycle
.
smoothScrollToPosition
(
mData
.
size
-
1
)
}
tv_duration
.
setOnClickListener
{
problemContent
=
et_input_problem
.
text
.
toString
()
et_input_problem
.
setText
(
"$problemContent\n${tv_duration.text}:\n"
)
et_input_problem
.
setSelection
(
et_input_problem
.
text
.
toString
().
length
-
1
)
recycle
.
smoothScrollToPosition
(
mData
.
size
-
1
)
}
tv_problem_impact
.
setOnClickListener
{
problemContent
=
et_input_problem
.
text
.
toString
()
et_input_problem
.
setText
(
"$problemContent\n${tv_problem_impact.text}:\n"
)
et_input_problem
.
setSelection
(
et_input_problem
.
text
.
toString
().
length
-
1
)
recycle
.
smoothScrollToPosition
(
mData
.
size
-
1
)
}
et_input_problem
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
p0
:
Editable
?)
{
// 动态监听输入行数大于等于4行,滚动列表到底部
if
(
et_input_problem
.
lineCount
>=
4
&&
recycle
.
canScrollVertically
(
1
))
{
recycle
.
smoothScrollToPosition
(
mData
.
size
-
1
)
}
}
override
fun
beforeTextChanged
(
p0
:
CharSequence
,
p1
:
Int
,
p2
:
Int
,
p3
:
Int
)
{
}
override
fun
onTextChanged
(
char
:
CharSequence
,
p1
:
Int
,
p2
:
Int
,
p3
:
Int
)
{
if
(
char
.
isNotEmpty
())
{
if
(
char
.
contains
(
"\n"
))
{
val
s
=
char
.
toString
().
replace
(
"\n"
,
""
)
if
(
TextUtils
.
isEmpty
(
s
))
{
tv_send
.
visibility
=
View
.
GONE
et_input_problem
.
setText
(
""
)
}
else
{
tv_send
.
visibility
=
View
.
VISIBLE
}
}
else
{
tv_send
.
visibility
=
View
.
VISIBLE
}
}
else
{
tv_send
.
visibility
=
View
.
GONE
}
}
})
// 监听键盘状态
// 监听键盘状态
SoftKeyBoardListener
.
setListener
(
mContext
,
SoftKeyBoardListener
.
setListener
(
mContext
,
object
:
SoftKeyBoardListener
.
OnSoftKeyBoardChangeListener
{
object
:
SoftKeyBoardListener
.
OnSoftKeyBoardChangeListener
{
...
@@ -178,7 +236,6 @@ class QuestionInformationView(
...
@@ -178,7 +236,6 @@ class QuestionInformationView(
// 显示键盘布局
// 显示键盘布局
private
fun
showInputMethod
(
editTextMessage
:
EditText
)
{
private
fun
showInputMethod
(
editTextMessage
:
EditText
)
{
editTextMessage
.
requestFocus
()
editTextMessage
.
requestFocus
()
val
imm
=
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
val
imm
=
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
showSoftInput
(
editTextMessage
,
0
)
imm
.
showSoftInput
(
editTextMessage
,
0
)
}
}
...
...
m-im/src/main/res_uikit/layout/im_view_question_infomation.xml
View file @
4afc573b
...
@@ -57,18 +57,19 @@
...
@@ -57,18 +57,19 @@
android:id=
"@+id/recycle"
android:id=
"@+id/recycle"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:background=
"@color/
platform_color_F0F0F0
"
android:background=
"@color/
color_f8f8f8
"
app:layout_constraintBottom_toTopOf=
"@id/cl_input"
app:layout_constraintBottom_toTopOf=
"@id/cl_input"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:paddingBottom=
"50dp"
app:layout_constraintVertical_weight=
"1"
/>
app:layout_constraintVertical_weight=
"1"
/>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_input"
android:id=
"@+id/cl_input"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:visibility=
"gone"
android:visibility=
"gone"
tools:visibility=
"visible"
app:layout_constraintBottom_toBottomOf=
"parent"
>
app:layout_constraintBottom_toBottomOf=
"parent"
>
<TextView
<TextView
...
@@ -80,17 +81,19 @@
...
@@ -80,17 +81,19 @@
android:textColor=
"@color/color_242424"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
android:textSize=
"14sp"
android:visibility=
"gone"
android:visibility=
"gone"
android:background=
"@color/color_f8f8f8"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
tools:text=
"已选:"
/>
tools:text=
"已选:"
/>
<EditText
<EditText
android:id=
"@+id/et_input_problem"
android:id=
"@+id/et_input_problem"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@null"
android:gravity=
"top"
android:gravity=
"top"
android:hint=
"请简单描述遇到的问题......"
android:hint=
"请简单描述遇到的问题......"
android:background=
"@color/white"
android:maxHeight=
"200dp"
android:maxHeight=
"200dp"
android:padding=
"12dp"
android:padding=
"12dp"
android:textColor=
"@color/color_242424"
android:textColor=
"@color/color_242424"
...
@@ -104,6 +107,7 @@
...
@@ -104,6 +107,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"69dp"
android:layout_marginEnd=
"69dp"
android:layout_marginBottom=
"14dp"
android:layout_marginBottom=
"14dp"
android:background=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/et_input_problem"
>
app:layout_constraintTop_toBottomOf=
"@id/et_input_problem"
>
...
...
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