Optimize layout
This commit is contained in:
@@ -37,15 +37,15 @@ class ChipsView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setChips(items: List<ChipModel>) {
|
fun setChips(items: Collection<ChipModel>) {
|
||||||
suppressLayoutCompat(true)
|
suppressLayoutCompat(true)
|
||||||
try {
|
try {
|
||||||
for ((i, model) in items.withIndex()) {
|
for ((i, model) in items.withIndex()) {
|
||||||
val chip = getChildAt(i) as Chip? ?: addChip()
|
val chip = getChildAt(i) as Chip? ?: addChip()
|
||||||
bindChip(chip, model)
|
bindChip(chip, model)
|
||||||
}
|
}
|
||||||
for (i in items.size until childCount) {
|
if (childCount > items.size) {
|
||||||
removeViewAt(i)
|
removeViews(items.size, childCount - items.size)
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
suppressLayoutCompat(false)
|
suppressLayoutCompat(false)
|
||||||
@@ -60,6 +60,7 @@ class ChipsView @JvmOverloads constructor(
|
|||||||
chip.isCheckedIconVisible = true
|
chip.isCheckedIconVisible = true
|
||||||
chip.setChipIconResource(model.icon)
|
chip.setChipIconResource(model.icon)
|
||||||
}
|
}
|
||||||
|
chip.isClickable = onChipClickListener != null
|
||||||
chip.tag = model.data
|
chip.tag = model.data
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +72,6 @@ class ChipsView @JvmOverloads constructor(
|
|||||||
chip.isCloseIconVisible = false
|
chip.isCloseIconVisible = false
|
||||||
chip.setEnsureMinTouchTargetSize(false)
|
chip.setEnsureMinTouchTargetSize(false)
|
||||||
chip.setOnClickListener(chipOnClickListener)
|
chip.setOnClickListener(chipOnClickListener)
|
||||||
chip.isClickable = onChipClickListener != null
|
|
||||||
addView(chip)
|
addView(chip)
|
||||||
return chip
|
return chip
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import androidx.core.view.updatePadding
|
|||||||
import coil.ImageLoader
|
import coil.ImageLoader
|
||||||
import coil.util.CoilUtils
|
import coil.util.CoilUtils
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.koin.android.ext.android.inject
|
import org.koin.android.ext.android.inject
|
||||||
@@ -30,13 +29,13 @@ import org.koitharu.kotatsu.reader.ui.ReaderActivity
|
|||||||
import org.koitharu.kotatsu.reader.ui.ReaderState
|
import org.koitharu.kotatsu.reader.ui.ReaderState
|
||||||
import org.koitharu.kotatsu.utils.FileSizeUtils
|
import org.koitharu.kotatsu.utils.FileSizeUtils
|
||||||
import org.koitharu.kotatsu.utils.ext.*
|
import org.koitharu.kotatsu.utils.ext.*
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
class DetailsFragment : BaseFragment<FragmentDetailsBinding>(), View.OnClickListener,
|
class DetailsFragment : BaseFragment<FragmentDetailsBinding>(), View.OnClickListener,
|
||||||
View.OnLongClickListener {
|
View.OnLongClickListener {
|
||||||
|
|
||||||
private val viewModel by sharedViewModel<DetailsViewModel>()
|
private val viewModel by sharedViewModel<DetailsViewModel>()
|
||||||
private val coil by inject<ImageLoader>(mode = LazyThreadSafetyMode.NONE)
|
private val coil by inject<ImageLoader>(mode = LazyThreadSafetyMode.NONE)
|
||||||
private var tagsJob: Job? = null
|
|
||||||
|
|
||||||
override fun onInflateView(
|
override fun onInflateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
@@ -196,16 +195,13 @@ class DetailsFragment : BaseFragment<FragmentDetailsBinding>(), View.OnClickList
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun bindTags(manga: Manga) {
|
private fun bindTags(manga: Manga) {
|
||||||
tagsJob?.cancel()
|
binding.chipsTags.setChips(
|
||||||
tagsJob = viewLifecycleScope.launch {
|
manga.tags.map { tag ->
|
||||||
val tags = ArrayList<ChipsView.ChipModel>(manga.tags.size + 2)
|
ChipsView.ChipModel(
|
||||||
for (tag in manga.tags) {
|
|
||||||
tags += ChipsView.ChipModel(
|
|
||||||
title = tag.title,
|
title = tag.title,
|
||||||
icon = 0
|
icon = 0
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.chipsTags.setChips(tags)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,10 +13,7 @@ import androidx.appcompat.app.ActionBarDrawerToggle
|
|||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.graphics.Insets
|
import androidx.core.graphics.Insets
|
||||||
import androidx.core.view.GravityCompat
|
import androidx.core.view.*
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import androidx.core.view.updateLayoutParams
|
|
||||||
import androidx.core.view.updatePadding
|
|
||||||
import androidx.drawerlayout.widget.DrawerLayout
|
import androidx.drawerlayout.widget.DrawerLayout
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentTransaction
|
import androidx.fragment.app.FragmentTransaction
|
||||||
@@ -88,17 +85,18 @@ class MainActivity : BaseActivity<ActivityMainBinding>(),
|
|||||||
binding.drawer.addDrawerListener(drawerToggle)
|
binding.drawer.addDrawerListener(drawerToggle)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
binding.searchView.apply {
|
with(binding.searchView) {
|
||||||
onFocusChangeListener = this@MainActivity
|
onFocusChangeListener = this@MainActivity
|
||||||
searchSuggestionListener = this@MainActivity
|
searchSuggestionListener = this@MainActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.navigationView.apply {
|
with(binding.navigationView) {
|
||||||
val menuView = findViewById<RecyclerView>(com.google.android.material.R.id.design_navigation_view)
|
val menuView = findViewById<RecyclerView>(com.google.android.material.R.id.design_navigation_view)
|
||||||
navHeaderBinding.root.setOnApplyWindowInsetsListener { v, insets ->
|
ViewCompat.setOnApplyWindowInsetsListener(navHeaderBinding.root) { v, insets ->
|
||||||
v.updatePadding(top = insets.systemWindowInsetTop)
|
val systemWindowInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
v.updatePadding(top = systemWindowInsets.top)
|
||||||
// NavigationView doesn't dispatch insets to the menu view, so pad the bottom here.
|
// NavigationView doesn't dispatch insets to the menu view, so pad the bottom here.
|
||||||
menuView.updatePadding(bottom = insets.systemWindowInsetBottom)
|
menuView.updatePadding(bottom = systemWindowInsets.bottom)
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
addHeaderView(navHeaderBinding.root)
|
addHeaderView(navHeaderBinding.root)
|
||||||
@@ -117,9 +115,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(),
|
|||||||
openDefaultSection()
|
openDefaultSection()
|
||||||
}
|
}
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
TrackWorker.setup(applicationContext)
|
onFirstStart()
|
||||||
AppUpdateChecker(this).launchIfNeeded()
|
|
||||||
OnboardDialogFragment.showWelcome(get(), supportFragmentManager)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.onOpenReader.observe(this, this::onOpenReader)
|
viewModel.onOpenReader.observe(this, this::onOpenReader)
|
||||||
@@ -347,6 +343,12 @@ class MainActivity : BaseActivity<ActivityMainBinding>(),
|
|||||||
binding.toolbarCard.cardElevation = searchViewElevation
|
binding.toolbarCard.cardElevation = searchViewElevation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun onFirstStart() {
|
||||||
|
TrackWorker.setup(applicationContext)
|
||||||
|
AppUpdateChecker(this@MainActivity).launchIfNeeded()
|
||||||
|
OnboardDialogFragment.showWelcome(get(), supportFragmentManager)
|
||||||
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
|
|
||||||
const val TAG_PRIMARY = "primary"
|
const val TAG_PRIMARY = "primary"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
android:layout_width="98dp"
|
android:layout_width="98dp"
|
||||||
android:layout_height="98dp"
|
android:layout_height="98dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
|
tools:ignore="ContentDescription"
|
||||||
tools:src="@drawable/ic_alert_outline" />
|
tools:src="@drawable/ic_alert_outline" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/list_footer_height"
|
android:layout_height="@dimen/list_footer_height_outer"
|
||||||
android:background="?selectableItemBackground"
|
android:background="?selectableItemBackground"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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_width="match_parent"
|
||||||
android:layout_height="@dimen/list_footer_height"
|
android:layout_height="@dimen/list_footer_height_outer">
|
||||||
android:padding="6dp">
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:indeterminate="true" />
|
android:indeterminate="true"
|
||||||
|
app:indicatorSize="@dimen/list_footer_height_inner" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -1,50 +1,41 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/list_selector">
|
android:background="@drawable/list_selector"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/card"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
app:cardCornerRadius="4dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||||
android:id="@+id/card"
|
android:id="@+id/imageView_cover"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
android:scaleType="centerCrop"
|
||||||
app:cardCornerRadius="4dp"
|
android:orientation="horizontal"
|
||||||
app:cardElevation="4dp"
|
tools:ignore="ContentDescription" />
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
</com.google.android.material.card.MaterialCardView>
|
||||||
android:id="@+id/imageView_cover"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
<TextView
|
||||||
|
android:id="@+id/textView_title"
|
||||||
|
style="@style/TextAppearance.AppCompat.Body2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:lineSpacingExtra="-2dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:elegantTextHeight="false"
|
||||||
|
tools:text="Sample name" />
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:id="@+id/textView_title"
|
|
||||||
style="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:lineSpacingExtra="-2dp"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/card"
|
|
||||||
tools:text="Sample name" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
@@ -8,86 +8,80 @@
|
|||||||
android:background="@drawable/list_selector"
|
android:background="@drawable/list_selector"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
|
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||||
|
android:id="@+id/imageView_cover"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<TextView
|
||||||
|
android:id="@+id/textView_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textAppearance="@style/TextAppearance.Kotatsu.ToolbarTitle"
|
||||||
|
android:textSize="18sp"
|
||||||
|
tools:text="@tools:sample/lorem/random" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView_subtitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
app:cardElevation="4dp">
|
android:ellipsize="none"
|
||||||
|
android:gravity="center_vertical"
|
||||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
android:requiresFadingEdge="horizontal"
|
||||||
android:id="@+id/imageView_cover"
|
android:singleLine="true"
|
||||||
android:layout_width="wrap_content"
|
android:textSize="16sp"
|
||||||
android:layout_height="match_parent"
|
tools:text="@tools:sample/lorem/random" />
|
||||||
android:orientation="vertical"
|
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:orientation="horizontal">
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_title"
|
android:id="@+id/textView_tags"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_weight="1"
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:textAppearance="@style/TextAppearance.Kotatsu.ToolbarTitle"
|
|
||||||
android:textSize="18sp"
|
|
||||||
tools:text="@tools:sample/lorem/random" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_subtitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:ellipsize="none"
|
android:ellipsize="none"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:requiresFadingEdge="horizontal"
|
android:requiresFadingEdge="horizontal"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="16sp"
|
|
||||||
tools:text="@tools:sample/lorem/random" />
|
tools:text="@tools:sample/lorem/random" />
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/textView_rating"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_gravity="bottom"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
<TextView
|
android:paddingStart="6dp"
|
||||||
android:id="@+id/textView_tags"
|
app:drawableEndCompat="@drawable/ic_star"
|
||||||
android:layout_width="0dp"
|
tools:ignore="RtlSymmetry"
|
||||||
android:layout_height="wrap_content"
|
tools:text="9.6" />
|
||||||
android:layout_weight="1"
|
|
||||||
android:ellipsize="none"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:requiresFadingEdge="horizontal"
|
|
||||||
android:singleLine="true"
|
|
||||||
tools:text="@tools:sample/lorem/random" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView_rating"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:drawablePadding="4dp"
|
|
||||||
android:paddingStart="6dp"
|
|
||||||
app:drawableEndCompat="@drawable/ic_star"
|
|
||||||
tools:text="9.6" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +1,43 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/navigation_header"
|
android:id="@+id/navigation_header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
|
android:id="@+id/imageView_logo"
|
||||||
|
android:layout_width="@dimen/nav_header_logo_size"
|
||||||
|
android:layout_height="@dimen/nav_header_logo_size"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginStart="@dimen/margin_normal"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:contentDescription="@string/app_name"
|
||||||
|
android:src="@drawable/ic_totoro" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_alignTop="@id/imageView_logo"
|
||||||
android:orientation="horizontal">
|
android:layout_alignBottom="@id/imageView_logo"
|
||||||
|
android:layout_marginStart="@dimen/nav_item_horizontal_padding"
|
||||||
<ImageView
|
android:layout_toEndOf="@id/imageView_logo"
|
||||||
android:layout_width="@dimen/nav_header_logo_size"
|
android:gravity="center_vertical"
|
||||||
android:layout_height="@dimen/nav_header_logo_size"
|
android:singleLine="true"
|
||||||
android:layout_marginStart="@dimen/margin_normal"
|
android:text="@string/app_name"
|
||||||
android:layout_marginTop="24dp"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
|
||||||
android:layout_marginBottom="24dp"
|
|
||||||
app:srcCompat="@drawable/ic_totoro" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/nav_item_horizontal_padding"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/divider"
|
android:id="@+id/divider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/imageView_logo"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
<dimen name="preferred_grid_width">120dp</dimen>
|
<dimen name="preferred_grid_width">120dp</dimen>
|
||||||
<dimen name="header_height">34dp</dimen>
|
<dimen name="header_height">34dp</dimen>
|
||||||
<dimen name="elevation_large">16dp</dimen>
|
<dimen name="elevation_large">16dp</dimen>
|
||||||
<dimen name="list_footer_height">48dp</dimen>
|
<dimen name="list_footer_height_inner">36dp</dimen>
|
||||||
|
<dimen name="list_footer_height_outer">48dp</dimen>
|
||||||
<dimen name="screen_padding">16dp</dimen>
|
<dimen name="screen_padding">16dp</dimen>
|
||||||
|
|
||||||
<!--SearchView dimens-->
|
<!--SearchView dimens-->
|
||||||
|
|||||||
Reference in New Issue
Block a user