feat(banner): 배너 XML 레이아웃 속성을 추가한다
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
15
app/src/main/res/layout/item_banner.xml
Normal file
15
app/src/main/res/layout/item_banner.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_banner_preview_placeholder">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_banner_preview_placeholder"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
</FrameLayout>
|
||||
60
app/src/main/res/layout/view_banner.xml
Normal file
60
app/src/main/res/layout/view_banner.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge 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"
|
||||
tools:background="@drawable/bg_banner_preview_placeholder"
|
||||
tools:parentTag="kr.co.vividnext.sodalive.v2.widget.banner.BannerView">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_banner" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_banner_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_marginTop="@dimen/spacing_14"
|
||||
android:layout_marginEnd="@dimen/spacing_14"
|
||||
android:background="@drawable/bg_banner_counter"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/spacing_6"
|
||||
android:paddingVertical="@dimen/spacing_4"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_banner_current_index"
|
||||
style="@style/Typography.Caption2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
tools:text="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_banner_counter_separator"
|
||||
style="@style/Typography.Caption2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/gray_400"
|
||||
tools:text="/" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_banner_total_count"
|
||||
style="@style/Typography.Caption2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/gray_400"
|
||||
tools:text="5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</merge>
|
||||
8
app/src/main/res/values/attrs.xml
Normal file
8
app/src/main/res/values/attrs.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="BannerView">
|
||||
<attr name="bannerPreviewItemCount" format="integer" />
|
||||
<attr name="bannerPreviewCurrentIndex" format="integer" />
|
||||
<attr name="bannerPreviewImage" format="reference" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user