<?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="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout
android:layout_width="80dp"
android:layout_height="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/top_left"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="top|start"
android:background="@drawable/rect_black_stroke_40dp" />
<Button
android:id="@+id/top_right"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="top|end"
android:background="@drawable/rect_black_stroke_40dp" />
<Button
android:id="@+id/bottom_left"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="bottom|start"
android:background="@drawable/rect_black_stroke_40dp" />
<Button
android:id="@+id/bottom_right"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="bottom|end"
android:background="@drawable/rect_black_stroke_40dp" />
<Button
android:id="@+id/center"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:background="@drawable/circle_black_stroke_40dp" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size
android:width="40dp"
android:height="40dp" />
<stroke
android:width="1dp"
android:color="#000" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size
android:width="40dp"
android:height="40dp" />
<stroke
android:width="1dp"
android:color="#000" />
</shape>
override fun getItemViewType(position: Int): Int {
return when (val item = dataSource[position]) {
is FirstLetter -> 1
is Acronym ->2
else -> throw IllegalArgumentException("unknown item type $item")
}
}
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/detail_backdrop_height"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fitsSystemWindows="true"
app:statusBarScrim="@android:color/transparent"
app:contentScrim="@android:color/transparent">
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@android:color/transparent"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_collapseMode="pin" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
allprojects {
repositories {
google()
jcenter()
//other repositories
}
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@drawable/shadow_4dp"
app:layout_constraintBottom_toTopOf="@+id/buttons_background"
/>
<View
android:id="@+id/buttons_background"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#dadada"
app:layout_constraintBottom_toBottomOf="parent" />
<ImageButton
android:id="@+id/red_ibtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_circle_solid_red_72dp"
android:translationY="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_android_black_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/red_ibtn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/buttons_background" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_android_black_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/red_ibtn"
app:layout_constraintTop_toTopOf="@id/buttons_background" />
</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" android:visible="true">
<size
android:width="72dp"
android:height="72dp" />
<solid android:color="#cb253d" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:width="0dp" android:height="4dp"/>
<gradient
android:angle="90"
android:endColor="#02000000"
android:startColor="#32000000" />
</shape>