mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-11-26 03:54:50 +00:00
Fix overlapping fonts and crash on tapping anywhere on video after long-pressing 'Popup' button (#5813)
* Overlapping fonts #5096 issue : #5096 * Overlapping fonts #5096 issue : #5096 changed : - If additional textView is overlapped, only title view shows. * Overlapping fonts #5096 issue : #5096 changed : - Remove treeObserve and hiding logic. - RelativeLayout -> ConstraintLayout. - layout size fixed -> wrap_content. - if text size is bigger, layout height bigger too. * Overlapping fonts #5096 issue : #5096 changed : - remove unusable variable * Crash on tapping anywhere on video after long-pressing 'Popup' button #5804 issue : #5804 changed : - checked null - fixed NullPointerException.
This commit is contained in:
@@ -4,8 +4,6 @@ import android.text.TextUtils;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
@@ -14,6 +12,8 @@ import org.schabi.newpipe.info_list.InfoItemBuilder;
|
||||
import org.schabi.newpipe.local.history.HistoryRecordManager;
|
||||
import org.schabi.newpipe.util.Localization;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import static org.schabi.newpipe.MainActivity.DEBUG;
|
||||
|
||||
/*
|
||||
|
||||
@@ -229,8 +229,10 @@ abstract class BasePlayerGestureListener(
|
||||
// because the soft input is visible (the draggable area is currently resized).
|
||||
player.updateScreenSize()
|
||||
player.checkPopupPositionBounds()
|
||||
initialPopupX = player.popupLayoutParams!!.x
|
||||
initialPopupY = player.popupLayoutParams!!.y
|
||||
player.popupLayoutParams?.let {
|
||||
initialPopupX = it.x
|
||||
initialPopupY = it.y
|
||||
}
|
||||
return super.onDown(e)
|
||||
}
|
||||
|
||||
@@ -466,7 +468,7 @@ abstract class BasePlayerGestureListener(
|
||||
// ///////////////////////////////////////////////////////////////////
|
||||
|
||||
private fun getDisplayPortion(e: MotionEvent): DisplayPortion {
|
||||
return if (player.playerType == MainPlayer.PlayerType.POPUP) {
|
||||
return if (player.playerType == MainPlayer.PlayerType.POPUP && player.popupLayoutParams != null) {
|
||||
when {
|
||||
e.x < player.popupLayoutParams!!.width / 3.0 -> DisplayPortion.LEFT
|
||||
e.x > player.popupLayoutParams!!.width * 2.0 / 3.0 -> DisplayPortion.RIGHT
|
||||
|
||||
Reference in New Issue
Block a user