(Bundle savedInstanceState)
| 89 | boolean isDialogShowing = false; |
| 90 | |
| 91 | @Override |
| 92 | protected void onCreate(Bundle savedInstanceState) { |
| 93 | SplashScreen splashScreen = SplashScreen.installSplashScreen(this); |
| 94 | super.onCreate(savedInstanceState); |
| 95 | setContentView(R.layout.main_ui); |
| 96 | |
| 97 | context = getApplicationContext(); |
| 98 | |
| 99 | new Thread( |
| 100 | () -> { |
| 101 | // Initialize GMA Next-Gen SDK on a background thread. |
| 102 | MobileAds.initialize( |
| 103 | this, |
| 104 | // Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 |
| 105 | new InitializationConfig.Builder("ca-app-pub-5748356089815497~5704037803") |
| 106 | .build(), |
| 107 | initializationStatus -> { |
| 108 | // Adapter initialization is complete. |
| 109 | }); |
| 110 | // SDK initialization is complete. If you don't want to wait for bidding adapters to |
| 111 | // finish initializing, start loading ads now. |
| 112 | }) |
| 113 | .start(); |
| 114 | |
| 115 | sharedPreferences = context.getSharedPreferences("GlobalPreferences", 0); |
| 116 | editor = sharedPreferences.edit(); |
| 117 | |
| 118 | shouldShowAds = sharedPreferences.getBoolean("ShouldShowAds", false); |
| 119 | isOreoNotified = sharedPreferences.getBoolean("IsOreoNotified", false); |
| 120 | isFirstBugNotified = sharedPreferences.getBoolean("IsFirstBugNotified", false); |
| 121 | |
| 122 | final long splashDelay = 3500; |
| 123 | final long startTime = System.currentTimeMillis(); |
| 124 | if(isOreoNotified){ |
| 125 | splashScreen.setKeepOnScreenCondition( |
| 126 | () -> { |
| 127 | long elapsed = System.currentTimeMillis() - startTime; |
| 128 | return elapsed < splashDelay; |
| 129 | }); |
| 130 | }else{ |
| 131 | splashScreen.setKeepOnScreenCondition(() -> false); |
| 132 | showFirstDialog(); |
| 133 | isDialogShowing = true; |
| 134 | } |
| 135 | splashScreen.setOnExitAnimationListener(splashScreenview ->{ |
| 136 | appOpenAdManager.loadAd(MainUI.this); |
| 137 | splashScreenview.remove(); |
| 138 | }); |
| 139 | |
| 140 | frameLayout = findViewById(R.id.ad_view_container); |
| 141 | |
| 142 | mAdView = new AdView(this); |
| 143 | frameLayout.addView(mAdView); |
| 144 | |
| 145 | appOpenAdManager = new AppOpenAdManager(); |
| 146 | |
| 147 | Toolbar toolbar = findViewById(R.id.toolbar); |
| 148 |
nothing calls this directly
no test coverage detected