Fixed Search fragment keyboard visibility bug

https://github.com/RetroMusicPlayer/RetroMusicPlayer/issues/1185
This commit is contained in:
Prathamesh More 2021-12-23 13:37:26 +05:30
parent a072e2a629
commit a10459c08a
6 changed files with 17 additions and 18 deletions

View file

@ -153,6 +153,8 @@ dependencies {
implementation 'com.github.bosphere.android-fadingedgelayout:fadingedgelayout:1.0.0'
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3'
implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5'
implementation 'com.github.Adonai:jaudiotagger:2.3.15'
implementation 'com.anjlab.android.iab.v3:library:2.0.3'

View file

@ -66,6 +66,8 @@
title="Slidr">Slidr</a></b> by Drew Heavner</p>
<p><b><a href="https://github.com/bosphere/Android-FadingEdgeLayout"
title="FadingEdgeLayout">FadingEdgeLayout</a></b> by bosphere</p>
<p><b><a href="https://github.com/yshrsmz/KeyboardVisibilityEvent"
title="KeyboardVisibilityEvent">KeyboardVisibilityEvent</a></b> by Yasuhiro SHIMIZU</p>
<p><b><a href="https://materialdesignicons.com" title="Icons"> Icons</a></b> by Austin Andrews</p>
<p><b><a href="https://www.techjuice.pk" title="City wallpaper"> Material Design City Wallpaper</a></b>
</p>

View file

@ -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) {

View file

@ -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 {

View file

@ -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())
}

View file

@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:fitsSystemWindows="true"
android:orientation="vertical">
@ -12,8 +11,7 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScroll="true">
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
@ -25,7 +23,7 @@
</com.google.android.material.appbar.AppBarLayout>
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@ -85,7 +83,7 @@
tools:text="@tools:sample/full_names" />
</com.google.android.material.textfield.TextInputLayout>
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
@ -94,7 +92,6 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="70dp"
android:fitsSystemWindows="false"
android:gravity="center"
android:text="@string/save"