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
0b806b34
Commit
0b806b34
authored
Jul 05, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
article comment dialog done
parent
05a81045
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
222 additions
and
77 deletions
+222
-77
ArticleDialogFragment.kt
m-article/src/main/java/widget/ArticleDialogFragment.kt
+0
-10
HomeArticleItemView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeArticleItemView.kt
+2
-2
home_article_item_view.xml
m-home/src/ydl/res/layout/home_article_item_view.xml
+24
-14
ArticleDialogFragment.kt
ydl-webview/src/main/java/com/ydl/view/ArticleDialogFragment.kt
+78
-0
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+8
-4
dialog_bottom_down.xml
ydl-webview/src/main/res/anim/dialog_bottom_down.xml
+11
-0
dialog_bottom_up.xml
ydl-webview/src/main/res/anim/dialog_bottom_up.xml
+9
-0
article_bg_publish.xml
ydl-webview/src/main/res/drawable/article_bg_publish.xml
+0
-0
article_close_dialog.xml
ydl-webview/src/main/res/drawable/article_close_dialog.xml
+0
-0
bg_comment_article.xml
ydl-webview/src/main/res/drawable/bg_comment_article.xml
+11
-0
layout_comment_article.xml
ydl-webview/src/main/res/layout/layout_comment_article.xml
+64
-47
styles.xml
ydl-webview/src/main/res/values/styles.xml
+15
-0
No files found.
m-article/src/main/java/widget/ArticleDialogFragment.kt
deleted
100644 → 0
View file @
05a81045
package
widget
import
androidx.fragment.app.DialogFragment
class
ArticleDialogFragment
:
DialogFragment
()
{
}
\ No newline at end of file
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeArticleItemView.kt
View file @
0b806b34
...
@@ -38,8 +38,8 @@ class HomeArticleItemView(private val mContext: Context, private var homeEvent:
...
@@ -38,8 +38,8 @@ class HomeArticleItemView(private val mContext: Context, private var homeEvent:
homeModuleArticleItemViewTitle
.
text
=
bean
?.
title
homeModuleArticleItemViewTitle
.
text
=
bean
?.
title
homeModuleArticleItemViewContent
.
text
=
bean
?.
desc
homeModuleArticleItemViewContent
.
text
=
bean
?.
desc
homeModuleArticleItemViewAuthor
.
text
=
bean
?.
name
homeModuleArticleItemViewAuthor
.
text
=
bean
?.
name
homeModuleArticleItemViewGreatNum
.
text
=
"
点赞${bean?.countOfFavorite}
"
homeModuleArticleItemViewGreatNum
.
text
=
"
${bean?.countOfFavorite}点赞
"
homeModuleArticleItemViewLookNum
.
text
=
"
浏览${bean?.readNum}
"
homeModuleArticleItemViewLookNum
.
text
=
"
${bean?.readNum}浏览
"
YDLImageCacheManager
.
showImage
(
mContext
,
bean
?.
imgUrl
,
homeModuleArticleItemViewImg
)
YDLImageCacheManager
.
showImage
(
mContext
,
bean
?.
imgUrl
,
homeModuleArticleItemViewImg
)
setOnClickListener
{
setOnClickListener
{
homeEvent
?.
articleItemClick
(
bean
)
homeEvent
?.
articleItemClick
(
bean
)
...
...
m-home/src/ydl/res/layout/home_article_item_view.xml
View file @
0b806b34
...
@@ -32,33 +32,32 @@
...
@@ -32,33 +32,32 @@
android:textSize=
"16sp"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textStyle=
"bold"
android:textColor=
"#1C1F28"
android:textColor=
"#1C1F28"
android:layout_alignParentTop=
"true"
android:lineSpacingExtra=
"@dimen/platform_dp_1"
android:lineSpacingExtra=
"@dimen/platform_dp_1"
tools:text=
"喧嚣的世界中,你的重要何以而来?喧嚣的世界中,你的重要何以而来?"
tools:text=
"喧嚣的世界中,你的重要何以而来?喧嚣的世界中,你的重要何以而来?"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignTop=
"@id/homeModuleArticleItemViewCardImg"
android:layout_toLeftOf=
"@+id/homeModuleArticleItemViewCardImg"
android:layout_toLeftOf=
"@+id/homeModuleArticleItemViewCardImg"
android:layout_marginRight=
"14dp"
/>
android:layout_marginRight=
"14dp"
/>
<TextView
<TextView
android:id=
"@+id/homeModuleArticleItemViewContent"
android:id=
"@+id/homeModuleArticleItemViewContent"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:singleLine=
"true"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:gravity=
"center_vertical"
android:ellipsize=
"end"
android:ellipsize=
"end"
android:textSize=
"@dimen/platform_dp_13"
android:textSize=
"@dimen/platform_dp_13"
android:layout_marginTop=
"5dp"
android:textColor=
"#9D9EA7"
android:textColor=
"#9D9EA7"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:layout_below=
"@+id/homeModuleArticleItemViewTitle"
tools:text=
"喧嚣的世界中,你的重要何以而来?当我伫立在我所伫立之处..."
tools:text=
"喧嚣的世界中,你的重要何以而来?当我伫立在我所伫立之处..."
android:layout_toLeftOf=
"@+id/homeModuleArticleItemViewCardImg"
android:layout_toLeftOf=
"@+id/homeModuleArticleItemViewCardImg"
android:layout_alignBottom=
"@id/homeModuleArticleItemViewCardImg"
android:layout_marginRight=
"9dp"
/>
android:layout_marginRight=
"9dp"
/>
<
Linear
Layout
<
androidx.constraintlayout.widget.Constraint
Layout
android:id=
"@+id/homeModuleArticleItemViewBottomLayout"
android:id=
"@+id/homeModuleArticleItemViewBottomLayout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:layout_below=
"@+id/homeModuleArticleItemViewCardImg"
android:layout_below=
"@+id/homeModuleArticleItemViewCardImg"
android:layout_marginTop=
"20dp"
>
android:layout_marginTop=
"20dp"
>
...
@@ -67,37 +66,48 @@
...
@@ -67,37 +66,48 @@
android:layout_width=
"16dp"
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:layout_height=
"16dp"
android:src=
"@drawable/home_article_item_icon"
android:src=
"@drawable/home_article_item_icon"
android:layout_alignParentLeft=
"true"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<TextView
<TextView
android:id=
"@+id/homeModuleArticleItemViewAuthor"
android:id=
"@+id/homeModuleArticleItemViewAuthor"
android:layout_width=
"0dp"
android:layout_width=
"wrap_content"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"13sp"
android:textSize=
"13sp"
android:textColor=
"#666666"
android:textColor=
"#666666"
android:layout_marginLeft=
"@dimen/platform_dp_3"
android:layout_marginLeft=
"@dimen/platform_dp_3"
android:textStyle=
"bold"
android:textStyle=
"bold"
app:layout_constraintStart_toEndOf=
"@id/homeModuleArticleItemViewIcon"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
tools:text=
"赵秀英"
/>
tools:text=
"赵秀英"
/>
<TextView
<TextView
android:id=
"@+id/homeModuleArticleItemViewLookNum"
android:id=
"@+id/homeModuleArticleItemViewLookNum"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"浏览2656"
android:layout_marginEnd=
"85dp"
tools:text=
"2656浏览"
android:textSize=
"13sp"
android:textSize=
"13sp"
android:textColor=
"#62636F"
/>
android:textColor=
"#62636F"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<TextView
<TextView
android:id=
"@+id/homeModuleArticleItemViewGreatNum"
android:id=
"@+id/homeModuleArticleItemViewGreatNum"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginStart=
"20dp"
tools:text=
"
点赞3327
"
tools:text=
"
3327点赞
"
android:textSize=
"13sp"
android:textSize=
"13sp"
android:textColor=
"#62636F"
/>
android:textColor=
"#62636F"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
</
Linear
Layout>
</
androidx.constraintlayout.widget.Constraint
Layout>
<View
<View
android:id=
"@+id/homeModuleArticleItemViewBottomLine"
android:id=
"@+id/homeModuleArticleItemViewBottomLine"
...
...
ydl-webview/src/main/java/com/ydl/view/ArticleDialogFragment.kt
0 → 100644
View file @
0b806b34
package
com.ydl.view
import
android.os.Bundle
import
android.util.DisplayMetrics
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.EditText
import
android.widget.ImageView
import
android.widget.TextView
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.remind.ToastHelper
class
ArticleDialogFragment
:
DialogFragment
()
{
private
lateinit
var
ivClose
:
ImageView
private
lateinit
var
etComment
:
EditText
private
lateinit
var
tvPublish
:
TextView
private
lateinit
var
cslLayout
:
ConstraintLayout
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setStyle
(
STYLE_NO_TITLE
,
R
.
style
.
BottomDialogAnimation
)
}
override
fun
onStart
()
{
super
.
onStart
()
val
displayMetrics
=
DisplayMetrics
()
activity
?.
windowManager
?.
defaultDisplay
?.
getMetrics
(
displayMetrics
)
val
window
=
dialog
?.
window
window
?.
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
val
view
=
inflater
.
inflate
(
R
.
layout
.
layout_comment_article
,
container
)
initView
(
view
)
return
view
}
private
fun
initView
(
view
:
View
){
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
{
dismiss
()
}
KeyboardUtils
.
showSoftInput
(
etComment
)
ivClose
.
setOnClickListener
{
dismiss
()
}
tvPublish
.
setOnClickListener
{
if
(
etComment
.
text
.
toString
().
isNullOrBlank
()){
ToastHelper
.
show
(
"评论内容不能为空~"
)
return
@setOnClickListener
}
dismiss
()
}
}
override
fun
dismiss
()
{
KeyboardUtils
.
hideSoftInput
(
etComment
)
super
.
dismiss
()
}
}
\ No newline at end of file
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
0b806b34
...
@@ -37,6 +37,7 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
...
@@ -37,6 +37,7 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
import
com.ydl.utils.PopUtils
;
import
com.ydl.utils.PopUtils
;
import
com.ydl.utils.ProxyCheckUtils
;
import
com.ydl.utils.ProxyCheckUtils
;
import
com.ydl.utils.WebUrlParamsUtils
;
import
com.ydl.utils.WebUrlParamsUtils
;
import
com.ydl.view.ArticleDialogFragment
;
import
com.ydl.view.ShareMeditationDialog
;
import
com.ydl.view.ShareMeditationDialog
;
import
com.ydl.ydl_router.manager.YDLRouterManager
;
import
com.ydl.ydl_router.manager.YDLRouterManager
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.base.BaseActivity
;
...
@@ -1216,10 +1217,13 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
...
@@ -1216,10 +1217,13 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
finish
();
finish
();
}
else
{
}
else
{
if
(
ActivityManager
.
Companion
.
getInstance
().
getActivitys
().
size
()
==
1
)
{
// if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils
.
Companion
.
startMain
(
NewH5Activity
.
this
);
// WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
// }
finish
();
// finish();
new
ArticleDialogFragment
().
show
(
getSupportFragmentManager
(),
"Article"
);
}
}
});
});
}
else
{
}
else
{
...
...
ydl-webview/src/main/res/anim/dialog_bottom_down.xml
0 → 100644
View file @
0b806b34
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:android=
"http://schemas.android.com/apk/res/android"
tools:ignore=
"MissingDefaultResource"
>
<translate
android:duration=
"@android:integer/config_mediumAnimTime"
android:fromYDelta=
"0"
android:interpolator=
"@android:anim/accelerate_interpolator"
android:toYDelta=
"100%p"
/>
</set>
\ No newline at end of file
ydl-webview/src/main/res/anim/dialog_bottom_up.xml
0 → 100644
View file @
0b806b34
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<translate
android:duration=
"@android:integer/config_mediumAnimTime"
android:fromYDelta=
"100%p"
android:interpolator=
"@android:anim/accelerate_interpolator"
android:toYDelta=
"0"
/>
</set>
\ No newline at end of file
m-article
/src/main/res/drawable/article_bg_publish.xml
→
ydl-webview
/src/main/res/drawable/article_bg_publish.xml
View file @
0b806b34
File moved
m-article
/src/main/res/drawable/article_close_dialog.xml
→
ydl-webview
/src/main/res/drawable/article_close_dialog.xml
View file @
0b806b34
File moved
ydl-webview/src/main/res/drawable/bg_comment_article.xml
0 → 100644
View file @
0b806b34
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#FFFFFFFF"
/>
<corners
android:topLeftRadius=
"4dp"
android:topRightRadius=
"4dp"
/>
</shape>
\ No newline at end of file
m-article
/src/main/res/layout/layout_comment_article.xml
→
ydl-webview
/src/main/res/layout/layout_comment_article.xml
View file @
0b806b34
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_cont
ent"
android:layout_height=
"
match_par
ent"
xmlns:app=
"http://schemas.android.com/apk/res-auto
"
>
android:id=
"@+id/csl_root_layout
"
>
<ImageView
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/iv_close_dialog"
android:id=
"@+id/csl_comment_layout"
android:layout_width=
"50dp"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_marginTop=
"2dp"
android:padding=
"13dp"
android:src=
"@drawable/article_close_dialog"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"发布评论"
android:background=
"@drawable/bg_comment_article"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
android:textSize=
"16sp"
android:textColor=
"#1C1F28"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/iv_close_dialog"
app:layout_constraintStart_toStartOf=
"parent"
>
app:layout_constraintBottom_toBottomOf=
"@id/iv_close_dialog"
/>
<TextView
<ImageView
android:id=
"@+id/tv_publish_comment"
android:id=
"@+id/iv_close_dialog"
android:layout_width=
"55dp"
android:layout_width=
"50dp"
android:layout_height=
"28dp"
android:layout_height=
"50dp"
android:gravity=
"center"
android:layout_marginTop=
"2dp"
android:layout_marginEnd=
"15dp"
android:padding=
"13dp"
android:text=
"发布"
android:src=
"@drawable/article_close_dialog"
android:textColor=
"@color/white"
app:layout_constraintStart_toStartOf=
"parent"
android:textStyle=
"bold"
app:layout_constraintTop_toTopOf=
"parent"
/>
android:textSize=
"14sp"
android:background=
"@drawable/article_bg_publish"
app:layout_constraintTop_toTopOf=
"@id/iv_close_dialog"
app:layout_constraintBottom_toBottomOf=
"@id/iv_close_dialog"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatEditText
<TextView
android:id=
"@+id/et_article_comment"
android:layout_width=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"发布评论"
android:padding=
"20dp"
android:textColor=
"#1C1F28"
android:minHeight=
"260dp"
android:textSize=
"16sp"
android:hint=
"请输入你的评论"
android:textStyle=
"bold"
android:textColorHint=
"#C3C4CA"
app:layout_constraintBottom_toBottomOf=
"@id/iv_close_dialog"
android:textSize=
"16sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/iv_close_dialog"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/iv_close_dialog"
/>
<TextView
android:id=
"@+id/tv_publish_comment"
android:layout_width=
"55dp"
android:layout_height=
"28dp"
android:layout_marginEnd=
"15dp"
android:background=
"@drawable/article_bg_publish"
android:gravity=
"center"
android:text=
"发布"
android:textColor=
"@color/white"
android:textSize=
"14sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"@id/iv_close_dialog"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/iv_close_dialog"
/>
<androidx.appcompat.widget.AppCompatEditText
android:id=
"@+id/et_article_comment"
android:layout_width=
"match_parent"
android:layout_height=
"240dp"
android:background=
"@null"
android:focusedByDefault=
"true"
android:gravity=
"start|top"
android:hint=
"请输入你的评论"
android:paddingHorizontal=
"20dp"
android:textColor=
"#1C1F28"
android:textColorHint=
"#C3C4CA"
android:textSize=
"16sp"
app:layout_constraintTop_toBottomOf=
"@id/iv_close_dialog"
tools:text=
"默认好评!默认好评!默认好评!默认好评!默认好评"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
ydl-webview/src/main/res/values/styles.xml
View file @
0b806b34
...
@@ -9,4 +9,18 @@
...
@@ -9,4 +9,18 @@
</style>
</style>
<style
name=
"BottomDialogAnimation"
parent=
"Theme.Design.BottomSheetDialog"
>
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"android:background"
>
@color/transparent
</item>
<item
name=
"android:windowBackground"
>
@color/transparent
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowFrame"
>
@null
</item>
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<item
name=
"android:windowSoftInputMode"
>
stateAlwaysVisible
</item>
<item
name=
"android:windowEnterAnimation"
>
@anim/dialog_bottom_up
</item>
<item
name=
"android:windowExitAnimation"
>
@anim/dialog_bottom_down
</item>
</style>
</resources>
</resources>
\ No newline at end of file
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