Commit b513ec08 by 霍志良

feat:倾诉优化

parent 512b9218
......@@ -3,11 +3,15 @@ package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
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.event.IHomeBaseEvent
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
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) {
private var buttonParams: LinearLayout.LayoutParams? = null
private var buttonParamsFrame: FrameLayout.LayoutParams? = null
private var buttonParamsFrame2: FrameLayout.LayoutParams? = null
init {
initView()
......@@ -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)
layoutParams = params
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()
homeModuleButtonBannerFirst.setOnClickListener {
......@@ -55,6 +64,11 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
var viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
var viewHeight = viewWidth * 78 / 80
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
homeModuleButtonBannerSecond.layoutParams = buttonParams
homeModuleButtonBannerThird.layoutParams = buttonParams
......
......@@ -79,12 +79,16 @@
android:textSize="@dimen/platform_dp_12"
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"
......@@ -94,6 +98,7 @@
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
......@@ -102,5 +107,11 @@
android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/>
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/qingsuGif"
>
</ImageView>
</FrameLayout>
</LinearLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment