That fuck shit the fascists are using
at master 36 lines 1.1 kB view raw
1package org.tm.archive.util; 2 3import android.app.Activity; 4import android.content.res.Resources; 5import android.os.Build; 6 7import androidx.annotation.NonNull; 8import androidx.annotation.Nullable; 9 10import org.tm.archive.R; 11import org.tm.archive.keyvalue.SettingsValues; 12 13public final class SplashScreenUtil { 14 private SplashScreenUtil() {} 15 16 /** 17 * Sets the splash screen for Android 12+ devices based on the passed-in theme. 18 */ 19 public static void setSplashScreenThemeIfNecessary(@Nullable Activity activity, @NonNull SettingsValues.Theme theme) { 20 if (Build.VERSION.SDK_INT < 31 || activity == null) { 21 return; 22 } 23 24 switch (theme) { 25 case LIGHT: 26 activity.getSplashScreen().setSplashScreenTheme(R.style.Theme_Signal_DayNight_NoActionBar_LightSplash); 27 break; 28 case DARK: 29 activity.getSplashScreen().setSplashScreenTheme(R.style.Theme_Signal_DayNight_NoActionBar_DarkSplash); 30 break; 31 case SYSTEM: 32 activity.getSplashScreen().setSplashScreenTheme(Resources.ID_NULL); 33 break; 34 } 35 } 36}