福利act UI
This commit is contained in:
parent
408f96e493
commit
18bc685c24
|
|
@ -4,8 +4,6 @@ import android.app.Activity
|
|||
import android.content.Intent
|
||||
import android.view.LayoutInflater
|
||||
import androidx.activity.viewModels
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.ama.core.architecture.appBase.AppViewsActivity
|
||||
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
|
@ -29,6 +27,16 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
|||
|
||||
override fun ViewBinding.initViews() {
|
||||
|
||||
taskItem1.setActionFun {
|
||||
gotoWatchVideo()
|
||||
}
|
||||
taskItem2.setActionFun {
|
||||
gotoWatchVideo()
|
||||
}
|
||||
taskItem3.setActionFun {
|
||||
gotoWatchVideo()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun ViewBinding.initListeners() {
|
||||
|
|
@ -48,6 +56,12 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
|||
}
|
||||
|
||||
|
||||
private fun gotoWatchVideo() {
|
||||
//TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
|
||||
companion object {
|
||||
internal fun startActivity(activity: Activity) {
|
||||
activity.startActivity(Intent(activity.applicationContext, BenefitActivity::class.java))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package com.gamedog.vididin.features.benefit.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.gamedog.vididin.databinding.BenefitTaskItemViewBinding
|
||||
|
||||
|
||||
class BenefitTaskItemView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||
private lateinit var mAction: () -> Unit
|
||||
private var mBinding: BenefitTaskItemViewBinding
|
||||
|
||||
|
||||
init {
|
||||
mBinding = BenefitTaskItemViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
mBinding.run {
|
||||
setOnClickBatch(tvAction) {
|
||||
when (this) {
|
||||
tvAction-> {
|
||||
mAction.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setActionFun(action: ()->Unit) {
|
||||
mAction = action
|
||||
}
|
||||
|
||||
|
||||
fun setProgressInfo(progress: String) {
|
||||
mBinding.tvProgressInfo.text = progress
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -273,10 +273,35 @@
|
|||
android:layout_height="1dp"
|
||||
android:background="@color/gray_f2"
|
||||
/>
|
||||
<com.gamedog.vididin.main.fragments.task.widget.DailyTaskItemView
|
||||
android:id="@+id/daily_task_watch_5"
|
||||
<com.gamedog.vididin.features.benefit.widget.BenefitTaskItemView
|
||||
android:id="@+id/task_item_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="20dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_f2"
|
||||
/>
|
||||
<com.gamedog.vididin.features.benefit.widget.BenefitTaskItemView
|
||||
android:id="@+id/task_item_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="20dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_f2"
|
||||
/>
|
||||
<com.gamedog.vididin.features.benefit.widget.BenefitTaskItemView
|
||||
android:id="@+id/task_item_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="20dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginRight="100dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_item_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@mipmap/icon_video_task"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="9dp"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/gray3"
|
||||
android:text="@string/benefit_task_item_description"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="28dp">
|
||||
<com.ama.core.architecture.widget.CustomProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_centerVertical="true"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_progress_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/progress_bar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="9dp"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/gray9"
|
||||
android:text="(0/800)"
|
||||
/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_action"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="7dp"
|
||||
android:background="@mipmap/zero_bg_but"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/go_and_do"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -44,6 +44,8 @@
|
|||
<string name="onging">Concluído</string>
|
||||
<string name="waitting">Em andamento</string>
|
||||
<string name="benefit_task_top_hint">Conclua todas as tarefas para retirar R$ 1.0</string>
|
||||
<string name="benefit_task_item_description">Assista a notícias ou vídeos curtos por 800 min</string>
|
||||
<string name="go_and_do">Ir para</string>
|
||||
|
||||
|
||||
</resources>
|
||||
Loading…
Reference in New Issue