main: Move title text up and add sub text

This commit is contained in:
Willi Ye 2021-02-08 19:20:53 +01:00 committed by ◱ Mark
parent 4db75022d2
commit bcdd2d9027
2 changed files with 24 additions and 10 deletions

View File

@ -22,7 +22,6 @@ import androidx.core.view.isVisible
import androidx.core.view.size import androidx.core.view.size
import androidx.lifecycle.observe import androidx.lifecycle.observe
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.chip.Chip import com.google.android.material.chip.Chip
@ -163,7 +162,7 @@ class MainActivity : AppCompatActivity() {
binding.appList.apply { binding.appList.apply {
while (itemDecorationCount > 0) removeItemDecorationAt(0) while (itemDecorationCount > 0) removeItemDecorationAt(0)
when (layoutType) { when (layoutType) {
LayoutType.List -> addItemDecoration(DividerItemDecoration(context, RecyclerView.VERTICAL)) LayoutType.List -> Unit
LayoutType.Grid, LayoutType.GridCompact -> addItemDecoration(GridSpacingItemDecoration()) LayoutType.Grid, LayoutType.GridCompact -> addItemDecoration(GridSpacingItemDecoration())
} }

View File

@ -33,14 +33,14 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginTop="16dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/refresh" android:contentDescription="@string/refresh"
android:padding="5dp" android:padding="5dp"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/sub_text"
app:layout_constraintEnd_toStartOf="@id/log_icon" app:layout_constraintEnd_toStartOf="@id/log_icon"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="@id/title_text"
app:srcCompat="@drawable/ic_refresh" app:srcCompat="@drawable/ic_refresh"
app:tint="?android:attr/textColorSecondary" app:tint="?android:attr/textColorSecondary"
tools:visibility="visible" /> tools:visibility="visible" />
@ -50,13 +50,13 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginTop="16dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/log" android:contentDescription="@string/log"
android:padding="5dp" android:padding="5dp"
app:layout_constraintBottom_toBottomOf="@id/sub_text"
app:layout_constraintEnd_toStartOf="@id/settings_icon" app:layout_constraintEnd_toStartOf="@id/settings_icon"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="@id/title_text"
app:srcCompat="@drawable/ic_log" app:srcCompat="@drawable/ic_log"
app:tint="?android:attr/textColorSecondary" /> app:tint="?android:attr/textColorSecondary" />
@ -65,13 +65,13 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/settings" android:contentDescription="@string/settings"
android:padding="5dp" android:padding="5dp"
app:layout_constraintBottom_toBottomOf="@id/sub_text"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="@id/title_text"
app:srcCompat="@drawable/ic_settings" app:srcCompat="@drawable/ic_settings"
app:tint="?android:attr/textColorSecondary" /> app:tint="?android:attr/textColorSecondary" />
@ -87,7 +87,22 @@
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="32sp" android:textSize="32sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/settings_icon" /> app:layout_constraintEnd_toStartOf="@id/refresh_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/sub_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginEnd="18dp"
android:fontFamily="sans-serif-medium"
android:letterSpacing="0.1"
android:text="@string/emulator"
android:textAllCaps="true"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title_text" />
<emu.skyline.views.SearchBarView <emu.skyline.views.SearchBarView
android:id="@+id/search_bar" android:id="@+id/search_bar"
@ -98,7 +113,7 @@
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
app:cardCornerRadius="16dp" app:cardCornerRadius="16dp"
app:cardElevation="2dp" app:cardElevation="2dp"
app:layout_constraintTop_toBottomOf="@id/title_text" /> app:layout_constraintTop_toBottomOf="@id/sub_text" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout> </com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>