Fixed Search fragment keyboard visibility bug
https://github.com/RetroMusicPlayer/RetroMusicPlayer/issues/1185
This commit is contained in:
parent
a072e2a629
commit
a10459c08a
6 changed files with 17 additions and 18 deletions
|
@ -39,7 +39,7 @@ class LicenseActivity : AbsThemeActivity() {
|
|||
ToolbarContentTintHelper.colorBackButton(binding.toolbar)
|
||||
try {
|
||||
val buf = StringBuilder()
|
||||
val json = assets.open("oldindex.html")
|
||||
val json = assets.open("license.html")
|
||||
BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)).use { br ->
|
||||
var str: String?
|
||||
while (br.readLine().also { str = it } != null) {
|
||||
|
|
|
@ -16,7 +16,6 @@ package code.name.monkey.retromusic.fragments.other
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
|
@ -31,8 +30,6 @@ import androidx.core.view.doOnPreDraw
|
|||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.retromusic.Constants.USER_BANNER
|
||||
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
||||
import code.name.monkey.retromusic.R
|
||||
|
@ -87,6 +84,7 @@ class UserInfoFragment : Fragment() {
|
|||
applyToolbar(binding.toolbar)
|
||||
|
||||
binding.nameContainer.accentColor()
|
||||
binding.next.accentColor()
|
||||
binding.name.setText(PreferenceUtil.userName)
|
||||
|
||||
binding.userImage.setOnClickListener {
|
||||
|
@ -111,14 +109,6 @@ class UserInfoFragment : Fragment() {
|
|||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
val textColor =
|
||||
MaterialValueHelper.getPrimaryTextColor(
|
||||
requireContext(),
|
||||
ColorUtil.isColorLight(accentColor())
|
||||
)
|
||||
binding.next.backgroundTintList = ColorStateList.valueOf(accentColor())
|
||||
binding.next.iconTint = ColorStateList.valueOf(textColor)
|
||||
binding.next.setTextColor(textColor)
|
||||
loadProfile()
|
||||
postponeEnterTransition()
|
||||
view.doOnPreDraw {
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.google.android.material.chip.ChipGroup
|
|||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
import net.yslibrary.android.keyboardvisibilityevent.KeyboardVisibilityEvent
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
@ -100,6 +101,13 @@ class SearchFragment : AbsMainActivityFragment(R.layout.fragment_search), TextWa
|
|||
bottomMargin = it
|
||||
}
|
||||
})
|
||||
KeyboardVisibilityEvent.setEventListener(requireActivity(), viewLifecycleOwner) {
|
||||
if (it) {
|
||||
binding.keyboardPopup.isGone = true
|
||||
} else {
|
||||
binding.keyboardPopup.show()
|
||||
}
|
||||
}
|
||||
binding.appBarLayout.statusBarForeground =
|
||||
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue