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
6f740b76
Commit
6f740b76
authored
Jul 12, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish article done
parent
9f151440
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
ArticleDialogFragment.kt
ydl-webview/src/main/java/com/ydl/view/ArticleDialogFragment.kt
+36
-0
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+4
-1
layout_comment_article.xml
ydl-webview/src/main/res/layout/layout_comment_article.xml
+2
-3
No files found.
ydl-webview/src/main/java/com/ydl/view/ArticleDialogFragment.kt
View file @
6f740b76
...
...
@@ -12,6 +12,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import
androidx.fragment.app.DialogFragment
import
com.blankj.utilcode.util.KeyboardUtils
import
com.ydl.webview.R
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper
class
ArticleDialogFragment
:
DialogFragment
()
{
...
...
@@ -20,6 +21,13 @@ class ArticleDialogFragment: DialogFragment() {
private
lateinit
var
etComment
:
EditText
private
lateinit
var
tvPublish
:
TextView
private
lateinit
var
cslLayout
:
ConstraintLayout
private
lateinit
var
mListener
:
OnPublishArticleCommentListener
private
var
mTitle
:
String
=
""
fun
setOnPublishListener
(
listener
:
OnPublishArticleCommentListener
){
mListener
=
listener
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -45,18 +53,23 @@ class ArticleDialogFragment: DialogFragment() {
}
private
fun
initView
(
view
:
View
){
mTitle
=
arguments
?.
getString
(
KEY_ARTICLE_TITLE
)
?:
""
ivClose
=
view
.
findViewById
(
R
.
id
.
iv_close_dialog
)
etComment
=
view
.
findViewById
(
R
.
id
.
et_article_comment
)
tvPublish
=
view
.
findViewById
(
R
.
id
.
tv_publish_comment
)
cslLayout
=
view
.
findViewById
(
R
.
id
.
csl_root_layout
)
cslLayout
.
setOnClickListener
{
ActionCountUtils
.
record
(
"article_detail_page"
,
"article_detail_cancelcomment_click"
,
mTitle
)
dismiss
()
}
KeyboardUtils
.
showSoftInput
(
etComment
)
ivClose
.
setOnClickListener
{
ActionCountUtils
.
record
(
"article_detail_page"
,
"article_detail_cancelcomment_click"
,
mTitle
)
dismiss
()
}
tvPublish
.
setOnClickListener
{
...
...
@@ -64,6 +77,9 @@ class ArticleDialogFragment: DialogFragment() {
ToastHelper
.
show
(
"评论内容不能为空~"
)
return
@setOnClickListener
}
mListener
.
onPublishClick
(
etComment
.
text
.
toString
())
ActionCountUtils
.
record
(
"article_detail_page"
,
"article_detail_issuecomment_click"
,
mTitle
)
etComment
.
setText
(
""
)
dismiss
()
}
...
...
@@ -74,4 +90,23 @@ class ArticleDialogFragment: DialogFragment() {
super
.
dismiss
()
}
companion
object
{
private
const
val
KEY_ARTICLE_TITLE
=
"key_share_title"
@JvmStatic
fun
newInstance
(
title
:
String
):
ArticleDialogFragment
{
val
args
=
Bundle
()
args
.
putString
(
KEY_ARTICLE_TITLE
,
title
)
val
fragment
=
ArticleDialogFragment
()
fragment
.
arguments
=
args
return
fragment
}
}
interface
OnPublishArticleCommentListener
{
fun
onPublishClick
(
comment
:
String
)
}
}
\ No newline at end of file
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
6f740b76
...
...
@@ -1547,7 +1547,10 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
public
void
showCommentArticleDialog
(){
if
(
commentArticleDialog
==
null
)
{
commentArticleDialog
=
new
ArticleDialogFragment
();
commentArticleDialog
=
ArticleDialogFragment
.
newInstance
(
wv_content
.
getTitle
());
commentArticleDialog
.
setOnPublishListener
(
comment
->
{
callJSFunc
(
"sendComment('"
+
comment
+
"')"
);
});
}
if
(
commentArticleDialog
!=
null
&&
!
commentArticleDialog
.
isAdded
())
{
commentArticleDialog
.
show
(
getSupportFragmentManager
(),
"article_comment"
);
...
...
ydl-webview/src/main/res/layout/layout_comment_article.xml
View file @
6f740b76
...
...
@@ -59,13 +59,12 @@
android:background=
"@null"
android:focusedByDefault=
"true"
android:gravity=
"start|top"
android:hint=
"
请输入你的评论
"
android:hint=
"
说点什么吧...
"
android:paddingHorizontal=
"20dp"
android:textColor=
"#1C1F28"
android:textColorHint=
"#C3C4CA"
android:textSize=
"16sp"
app:layout_constraintTop_toBottomOf=
"@id/iv_close_dialog"
tools:text=
"默认好评!默认好评!默认好评!默认好评!默认好评"
/>
app:layout_constraintTop_toBottomOf=
"@id/iv_close_dialog"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
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