mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-30 23:03:00 +00:00 
			
		
		
		
	Fixed feed when animations are off
Introduced a check if corresponding animations on the devices are enabled
This commit is contained in:
		| @@ -73,6 +73,7 @@ import org.schabi.newpipe.local.feed.item.StreamItem | ||||
| import org.schabi.newpipe.local.feed.service.FeedLoadService | ||||
| import org.schabi.newpipe.local.subscription.SubscriptionManager | ||||
| import org.schabi.newpipe.player.helper.PlayerHolder | ||||
| import org.schabi.newpipe.util.DeviceUtils | ||||
| import org.schabi.newpipe.util.Localization | ||||
| import org.schabi.newpipe.util.NavigationHelper | ||||
| import org.schabi.newpipe.util.StreamDialogEntry | ||||
| @@ -624,8 +625,12 @@ class FeedFragment : BaseStateFragment<FeedState>() { | ||||
|                 250L, | ||||
|                 delay = 100, | ||||
|                 execOnEnd = { | ||||
|                     // Hide the new items-"popup" after 10s | ||||
|                     hideNewItemsLoaded(true, 10000) | ||||
|                     // Disabled animations would result in immediately hiding the button | ||||
|                     // after it showed up | ||||
|                     if (DeviceUtils.hasAnimationsAnimatorDurationEnabled(context)) { | ||||
|                         // Hide the new items-"popup" after 10s | ||||
|                         hideNewItemsLoaded(true, 10000) | ||||
|                     } | ||||
|                 } | ||||
|             ) | ||||
|     } | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import android.content.pm.PackageManager; | ||||
| import android.content.res.Configuration; | ||||
| import android.os.BatteryManager; | ||||
| import android.os.Build; | ||||
| import android.provider.Settings; | ||||
| import android.util.TypedValue; | ||||
| import android.view.KeyEvent; | ||||
|  | ||||
| @@ -144,4 +145,11 @@ public final class DeviceUtils { | ||||
|     public static boolean isInMultiWindow(final AppCompatActivity activity) { | ||||
|         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && activity.isInMultiWindowMode(); | ||||
|     } | ||||
|  | ||||
|     public static boolean hasAnimationsAnimatorDurationEnabled(final Context context) { | ||||
|         return Settings.System.getFloat( | ||||
|                 context.getContentResolver(), | ||||
|                 Settings.Global.ANIMATOR_DURATION_SCALE, | ||||
|                 1F) != 0F; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 litetex
					litetex