Skip to content

CustomTextView

Sieun Ju edited this page Aug 11, 2022 · 2 revisions

CustomTextView

μš”μ•½ (Summary)

  • κ°„λ‹¨ν•œ μ†μ„±κ°’μœΌλ‘œ Corner, Border, Selected, Enable 처리 ν•  수 μžˆλŠ” ViewClass μž…λ‹ˆλ‹€.
    (CustomTextView that can process Corner, Border, Selected, and Enable as attribute values.)

μ§€μ›ν•˜λŠ” κΈ°λŠ₯ (Supported Features)

Attribute Type Description
textViewDefState Boolean Sets the default status value for the view.
textViewTxtColor Color Text color value when view is active
textViewDisableTxtColor Color Text color value when view is inactive
textViewBgColor Color Background Color when view is active
textViewBorder Dimension Background Border when view is active
textViewBorderColor Color Background Border Color when view is active
textViewCorner Dimension Background Corner Radius when view is active
textViewDisableBgColor Color Background Color when view is inactive
textViewDisableBorder Dimension Background Border when view is inactive
textViewDisableBorderColor Color Background Border Color when view is inactive
textViewDisableCorner Dimension Background Corner Radius when view is inactive
textViewTextStyle Reference TextStyle when view is active
textViewDisableTextStyle Reference TextStyle when view is inactive

유의 사항 (Notice)

  • textViewTxtColor 와 textViewTextStyle 같이 μ‚¬μš©ν• μˆ˜ μ—†μŠ΅λ‹ˆλ‹€. μ‚¬μš©ν•˜λ”λΌλ„ textStyle 을 μš°μ„ μˆœμœ„λ‘œ μ²˜λ¦¬ν•©λ‹ˆλ‹€. (TextViewTxtColor and textViewTextStyle cannot be used together. Use to treat textStyle as a priority.)

μ‚¬μš©λ²• (How To)

  • xml
        <hmju.widget.view.CustomTextView
            android:id="@+id/tvSample"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:gravity="center_vertical"
            android:paddingLeft="15dp"
            android:paddingRight="15dp"
            android:text="this is Sample TextView"
            app:textViewBgColor="#601F1F"
            app:textViewBorder="3dp"
            app:textViewBorderColor="#FFFFFF"
            app:textViewCorner="12dp"
            app:textViewDefState="true"
            app:textViewDisableBgColor="#FFC107"
            app:textViewDisableBorder="2dp"
            app:textViewDisableBorderColor="#00BCD4"
            app:textViewDisableCorner="25dp"
            app:textViewDisableTextStyle="@style/SampleText.Medium"
            app:textViewTextStyle="@style/SampleText.Bold" />

Example screen

Example screen