use the original view pager indicator library

This commit is contained in:
dkanada 2021-04-18 01:02:06 +09:00
commit cf37684854
4 changed files with 33 additions and 23 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -9,19 +10,23 @@
android:id="@+id/now_playing_screen_view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:clipToPadding="false"
android:paddingLeft="72dp"
android:paddingRight="72dp" />
android:padding="64dp"
app:layout_constraintBottom_toTopOf="@id/page_indicator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<com.heinrichreimersoftware.materialintro.view.InkPageIndicator
<com.pixelcan.inkpageindicator.InkPageIndicator
android:id="@+id/page_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
app:currentPageIndicatorColor="?android:textColorPrimary"
app:dotDiameter="8dp"
app:dotGap="8dp"
app:pageIndicatorColor="?android:textColorHint" />
android:layout_margin="32dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:ipi_dotDiameter="8dp"
app:ipi_dotGap="8dp"
app:ipi_currentPageIndicatorColor="?android:textColorPrimary"
app:ipi_pageIndicatorColor="?android:textColorHint" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="ContentDescription">
@ -11,16 +13,21 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
tools:text="Card Layout" />
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="@string/flat" />
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
tools:src="@drawable/np_card" />
android:layout_margin="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintEnd_toEndOf="parent"
tools:src="@drawable/np_flat" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>