This commit is contained in:
Koitharu
2022-03-26 09:07:15 +02:00
parent 85b8bc5d07
commit b0f221e5a7
13 changed files with 51 additions and 20 deletions

View File

@@ -15,7 +15,8 @@ import org.koitharu.kotatsu.main.ui.AppBarOwner
import org.koitharu.kotatsu.search.ui.suggestion.adapter.SearchSuggestionAdapter
import org.koitharu.kotatsu.utils.ext.measureHeight
class SearchSuggestionFragment : BaseFragment<FragmentSearchSuggestionBinding>(),
class SearchSuggestionFragment :
BaseFragment<FragmentSearchSuggestionBinding>(),
SearchSuggestionItemCallback.SuggestionItemListener {
private val viewModel by sharedViewModel<SearchSuggestionViewModel>()
@@ -44,8 +45,8 @@ class SearchSuggestionFragment : BaseFragment<FragmentSearchSuggestionBinding>()
val headerHeight = (activity as? AppBarOwner)?.appBar?.measureHeight() ?: insets.top
binding.root.updatePadding(
top = headerHeight,
left = insets.left,
right = insets.right,
// left = insets.left,
// right = insets.right,
bottom = insets.bottom,
)
}

View File

@@ -11,6 +11,7 @@ import androidx.appcompat.widget.AppCompatEditText
import androidx.core.content.ContextCompat
import com.google.android.material.R
import org.koitharu.kotatsu.search.ui.suggestion.SearchSuggestionListener
import org.koitharu.kotatsu.utils.ext.drawableStart
private const val DRAWABLE_END = 2
@@ -57,7 +58,7 @@ class SearchEditText @JvmOverloads constructor(
) {
super.onTextChanged(text, start, lengthBefore, lengthAfter)
setCompoundDrawablesRelativeWithIntrinsicBounds(
null,
drawableStart,
null,
if (text.isNullOrEmpty()) null else clearIcon,
null,
@@ -86,4 +87,4 @@ class SearchEditText @JvmOverloads constructor(
super.clearFocus()
text?.clear()
}
}
}