-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
app/src/main/java/sopt/motivoo/util/custom_view/MotivooStepCountText.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |