Skip to content

Commit

Permalink
[add] #13 커스텀 원형 그래프 내부 걸음 수 텍스트
Browse files Browse the repository at this point in the history
  • Loading branch information
Jokwanhee committed Jan 4, 2024
1 parent 5a272b8 commit 8c0af74
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package sopt.motivoo.util.custom_view

import android.content.Context
import android.util.AttributeSet
import androidx.constraintlayout.widget.ConstraintLayout
import sopt.motivoo.R
import sopt.motivoo.databinding.MotivooStepCountTextBinding

class MotivooStepCountText @JvmOverloads constructor(
context: Context,
attributeSet: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attributeSet, defStyleAttr) {
private lateinit var binding: MotivooStepCountTextBinding

init {
initView()
}

private fun initView() {
binding = MotivooStepCountTextBinding.bind(
inflate(
context,
R.layout.motivoo_step_count_text,
this
)
)
}

fun setStepCountText(stepCountText: String) {
binding.tvStepCount.text = stepCountText
}
}
32 changes: 32 additions & 0 deletions app/src/main/res/layout/motivoo_step_count_text.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content"
android:layout_height="wrap_content">

<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/gray_600_707276"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@id/tv_step_count"
app:layout_constraintStart_toStartOf="@id/tv_step_count"
app:layout_constraintTop_toTopOf="parent"
tools:text="내 걸음" />

<TextView
android:id="@+id/tv_step_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black_090909"
android:textSize="48sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:text="8900" />


</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 8c0af74

Please sign in to comment.