Browse Source

Fixed album position in track info and ensure safe callback to current recycler view.

housekeeping/remove-warnings
Antoine POPINEAU 4 years ago
parent
commit
eb6b7a807b
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
  1. 10
      app/src/main/java/com/github/apognu/otter/fragments/OtterFragment.kt
  2. 2
      app/src/main/java/com/github/apognu/otter/fragments/TrackInfoDetailsFragment.kt

10
app/src/main/java/com/github/apognu/otter/fragments/OtterFragment.kt

@ -178,9 +178,13 @@ abstract class OtterFragment<D : Any, A : OtterAdapter<D, *>> : Fragment() { @@ -178,9 +178,13 @@ abstract class OtterFragment<D : Any, A : OtterAdapter<D, *>> : Fragment() {
}
private fun needsMoreOffscreenPages(): Boolean {
val offset = recycler.computeVerticalScrollOffset()
val left = recycler.computeVerticalScrollRange() - recycler.height - offset
view?.let {
val offset = recycler.computeVerticalScrollOffset()
val left = recycler.computeVerticalScrollRange() - recycler.height - offset
return left < (recycler.height * OFFSCREEN_PAGES)
return left < (recycler.height * OFFSCREEN_PAGES)
}
return false
}
}

2
app/src/main/java/com/github/apognu/otter/fragments/TrackInfoDetailsFragment.kt

@ -53,7 +53,7 @@ class TrackInfoDetailsFragment : DialogFragment() { @@ -53,7 +53,7 @@ class TrackInfoDetailsFragment : DialogFragment() {
properties.add(Pair(R.string.track_info_details_track_copyright, getString("trackCopyright")))
properties.add(Pair(R.string.track_info_details_track_license, getString("trackLicense")))
properties.add(Pair(R.string.track_info_details_track_duration, getString("trackDuration")))
properties.add(Pair(R.string.track_info_details_track_position, getString("trackPosition")))
properties.add(Pair(R.string.track_info_details_track_position, getInt("trackPosition").toString()))
properties.add(Pair(R.string.track_info_details_track_bitrate, getString("trackBitrate")))
properties.add(Pair(R.string.track_info_details_track_instance, getString("trackInstance")))
}

Loading…
Cancel
Save