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
b513ec08
Commit
b513ec08
authored
Apr 01, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:倾诉优化
parent
512b9218
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
24 deletions
+49
-24
HomeButtonBannerView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
+15
-1
qingsu_new_free_dynamic.gif
m-home/src/ydl/res/drawable-xhdpi/qingsu_new_free_dynamic.gif
+0
-0
qingsu_new_free_temp.gif
m-home/src/ydl/res/drawable-xhdpi/qingsu_new_free_temp.gif
+0
-0
home_button_banner_view.xml
m-home/src/ydl/res/layout/home_button_banner_view.xml
+34
-23
No files found.
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
View file @
b513ec08
...
@@ -3,11 +3,15 @@ package com.yidianling.home.ui.view
...
@@ -3,11 +3,15 @@ package com.yidianling.home.ui.view
import
android.content.Context
import
android.content.Context
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.yidianling.home.R
import
com.yidianling.home.R
import
com.yidianling.home.event.IHomeBaseEvent
import
com.yidianling.home.event.IHomeBaseEvent
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
kotlinx.android.synthetic.ydl.home_button_banner_view.view.*
import
kotlinx.android.synthetic.ydl.home_button_banner_view.view.*
/**
/**
...
@@ -20,6 +24,8 @@ import kotlinx.android.synthetic.ydl.home_button_banner_view.view.*
...
@@ -20,6 +24,8 @@ import kotlinx.android.synthetic.ydl.home_button_banner_view.view.*
class
HomeButtonBannerView
(
private
val
mContext
:
Context
,
private
var
homeEvent
:
IHomeBaseEvent
?)
:
LinearLayout
(
mContext
)
{
class
HomeButtonBannerView
(
private
val
mContext
:
Context
,
private
var
homeEvent
:
IHomeBaseEvent
?)
:
LinearLayout
(
mContext
)
{
private
var
buttonParams
:
LinearLayout
.
LayoutParams
?
=
null
private
var
buttonParams
:
LinearLayout
.
LayoutParams
?
=
null
private
var
buttonParamsFrame
:
FrameLayout
.
LayoutParams
?
=
null
private
var
buttonParamsFrame2
:
FrameLayout
.
LayoutParams
?
=
null
init
{
init
{
initView
()
initView
()
...
@@ -29,7 +35,10 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
...
@@ -29,7 +35,10 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
val
params
=
RecyclerView
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
val
params
=
RecyclerView
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
params
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
home_button_banner_view
,
this
)
View
.
inflate
(
mContext
,
R
.
layout
.
home_button_banner_view
,
this
)
Glide
.
with
(
context
)
.
load
(
R
.
drawable
.
qingsu_new_free_temp
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
RESOURCE
)
.
into
(
qingsuGif
)
initButtonView
()
initButtonView
()
homeModuleButtonBannerFirst
.
setOnClickListener
{
homeModuleButtonBannerFirst
.
setOnClickListener
{
...
@@ -55,6 +64,11 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
...
@@ -55,6 +64,11 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
var
viewWidth
=
((
screenWidth
-
2
*
9
*
RxDeviceTool
.
getScreenDensity
(
mContext
))
/
4
).
toInt
()
var
viewWidth
=
((
screenWidth
-
2
*
9
*
RxDeviceTool
.
getScreenDensity
(
mContext
))
/
4
).
toInt
()
var
viewHeight
=
viewWidth
*
78
/
80
var
viewHeight
=
viewWidth
*
78
/
80
buttonParams
=
LinearLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParams
=
LinearLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame
=
FrameLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame2
=
FrameLayout
.
LayoutParams
((
viewWidth
/
2
)+
10
,
viewHeight
/
2
-
30
)
buttonParamsFrame2
!!
.
setMargins
(
RxImageTool
.
dp2px
((
viewWidth
/
19f
)),
0
,
0
,
0
)
qingsuGif
.
layoutParams
=
buttonParamsFrame2
homeModuleButtonBannerSecondFrame
.
layoutParams
=
buttonParamsFrame
homeModuleButtonBannerFirst
.
layoutParams
=
buttonParams
homeModuleButtonBannerFirst
.
layoutParams
=
buttonParams
homeModuleButtonBannerSecond
.
layoutParams
=
buttonParams
homeModuleButtonBannerSecond
.
layoutParams
=
buttonParams
homeModuleButtonBannerThird
.
layoutParams
=
buttonParams
homeModuleButtonBannerThird
.
layoutParams
=
buttonParams
...
...
m-home/src/ydl/res/drawable-xhdpi/qingsu_new_free_dynamic.gif
0 → 100644
View file @
b513ec08
21.1 KB
m-home/src/ydl/res/drawable-xhdpi/qingsu_new_free_temp.gif
0 → 100644
View file @
b513ec08
68.2 KB
m-home/src/ydl/res/layout/home_button_banner_view.xml
View file @
b513ec08
...
@@ -79,28 +79,39 @@
...
@@ -79,28 +79,39 @@
android:textSize=
"@dimen/platform_dp_12"
android:textSize=
"@dimen/platform_dp_12"
android:text=
"学习与成长"
/>
android:text=
"学习与成长"
/>
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id=
"@+id/homeModuleButtonBannerSecond"
android:layout_width=
"80dp"
android:layout_height=
"78dp"
android:background=
"@drawable/home_button_banner_fourth_img_new"
>
<RelativeLayout
android:id=
"@+id/homeModuleButtonBannerSecondFrame"
android:layout_width=
"80dp"
android:layout_height=
"78dp"
android:gravity=
"center"
>
<TextView
android:id=
"@+id/homeModuleButtonBannerSecondTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textStyle=
"bold"
android:textColor=
"@color/platform_color_FFFFFF"
android:textSize=
"@dimen/platform_dp_16"
android:text=
"即时倾诉"
/>
<RelativeLayout
<TextView
android:id=
"@+id/homeModuleButtonBannerSecond"
android:layout_below=
"@+id/homeModuleButtonBannerSecondTitle"
android:layout_width=
"80dp"
android:layout_width=
"wrap_content"
android:layout_height=
"78dp"
android:layout_height=
"wrap_content"
android:background=
"@drawable/home_button_banner_fourth_img_new"
android:textColor=
"@color/platform_color_FFFFFF"
android:gravity=
"center"
>
android:textSize=
"@dimen/platform_dp_12"
<TextView
android:text=
"24小时在线"
/>
android:id=
"@+id/homeModuleButtonBannerSecondTitle"
</RelativeLayout>
android:layout_width=
"wrap_content"
<ImageView
android:layout_height=
"wrap_content"
android:layout_width=
"wrap_content"
android:textStyle=
"bold"
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_FFFFFF"
android:id=
"@+id/qingsuGif"
android:textSize=
"@dimen/platform_dp_16"
>
android:text=
"即时倾诉"
/>
</ImageView>
<TextView
</FrameLayout>
android:layout_below=
"@+id/homeModuleButtonBannerSecondTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_FFFFFF"
android:textSize=
"@dimen/platform_dp_12"
android:text=
"24小时在线"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
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