mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	Merge pull request #6689 from Isira-Seneviratne/Use_WindowInsetsCompat_getInsets
Use WindowInsetsCompat's getInsets() method.
This commit is contained in:
		| @@ -55,9 +55,10 @@ import androidx.appcompat.app.AppCompatActivity; | |||||||
| import androidx.appcompat.content.res.AppCompatResources; | import androidx.appcompat.content.res.AppCompatResources; | ||||||
| import androidx.appcompat.widget.AppCompatImageButton; | import androidx.appcompat.widget.AppCompatImageButton; | ||||||
| import androidx.core.content.ContextCompat; | import androidx.core.content.ContextCompat; | ||||||
| import androidx.core.view.DisplayCutoutCompat; | import androidx.core.graphics.Insets; | ||||||
| import androidx.core.view.GestureDetectorCompat; | import androidx.core.view.GestureDetectorCompat; | ||||||
| import androidx.core.view.ViewCompat; | import androidx.core.view.ViewCompat; | ||||||
|  | import androidx.core.view.WindowInsetsCompat; | ||||||
| import androidx.preference.PreferenceManager; | import androidx.preference.PreferenceManager; | ||||||
| import androidx.recyclerview.widget.ItemTouchHelper; | import androidx.recyclerview.widget.ItemTouchHelper; | ||||||
| import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.RecyclerView; | ||||||
| @@ -560,10 +561,9 @@ public final class Player implements | |||||||
|         binding.getRoot().addOnLayoutChangeListener(this::onLayoutChange); |         binding.getRoot().addOnLayoutChangeListener(this::onLayoutChange); | ||||||
|  |  | ||||||
|         ViewCompat.setOnApplyWindowInsetsListener(binding.itemsListPanel, (view, windowInsets) -> { |         ViewCompat.setOnApplyWindowInsetsListener(binding.itemsListPanel, (view, windowInsets) -> { | ||||||
|             final DisplayCutoutCompat cutout = windowInsets.getDisplayCutout(); |             final Insets cutout = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()); | ||||||
|             if (cutout != null) { |             if (!cutout.equals(Insets.NONE)) { | ||||||
|                 view.setPadding(cutout.getSafeInsetLeft(), cutout.getSafeInsetTop(), |                 view.setPadding(cutout.left, cutout.top, cutout.right, cutout.bottom); | ||||||
|                         cutout.getSafeInsetRight(), cutout.getSafeInsetBottom()); |  | ||||||
|             } |             } | ||||||
|             return windowInsets; |             return windowInsets; | ||||||
|         }); |         }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox