@@ -12,10 +12,13 @@ import android.content.Intent
1212import android.content.res.Configuration
1313import android.graphics.BitmapFactory
1414import android.graphics.drawable.BitmapDrawable
15+ import android.net.Uri
1516import android.os.Bundle
1617import android.support.design.widget.Snackbar
18+ import android.support.v4.content.ContextCompat
1719import android.support.v4.view.GravityCompat
1820import android.support.v7.app.ActionBarDrawerToggle
21+ import android.support.v7.app.AlertDialog
1922import android.support.v7.app.AppCompatActivity
2023import android.support.v7.app.AppCompatDelegate
2124import android.support.v7.widget.Toolbar
@@ -96,7 +99,7 @@ class MainActivity : AppCompatActivity() {
9699 val toolbar = findViewById<Toolbar >(R .id.toolbar)
97100 setSupportActionBar(toolbar)
98101 if (prefs.transparentBars) {
99- toolbar.setBackgroundColor(android.R .color.transparent)
102+ toolbar.setBackgroundColor(ContextCompat .getColor( this , android.R .color.transparent) )
100103 window.setFlags(WindowManager .LayoutParams .FLAG_LAYOUT_NO_LIMITS , WindowManager .LayoutParams .FLAG_LAYOUT_NO_LIMITS )
101104 toolbar.setPadding(0 , statusBarHeight, 0 , 0 )
102105 }
@@ -163,6 +166,23 @@ class MainActivity : AppCompatActivity() {
163166// startActivity(Intent(this, AboutSiaActivity::class.java))
164167 prefs.firstTime = false
165168 }
169+
170+ if (! prefs.viewedNewApp) {
171+ prefs.viewedNewApp = true
172+ AlertDialog .Builder (this )
173+ .setTitle(" New Sia Android app" )
174+ .setMessage(" I've released a hugely revamped and improved Android app for Sia. " +
175+ " You'll be taken to it upon closing this. I highly recommend switching to it from Sia Mobile. " +
176+ " All development efforts are being focused on it - Sia Mobile likely will not receive any more updates. " +
177+ " Thank you for using my app." )
178+ .setPositiveButton(" Okay" ) { dialogInterface, i ->
179+ startActivity(Intent (Intent .ACTION_VIEW , Uri .parse(" https://play.google.com/store/apps/details?id=com.vandyke.sia" )))
180+ }
181+ .setOnDismissListener {
182+ startActivity(Intent (Intent .ACTION_VIEW , Uri .parse(" https://play.google.com/store/apps/details?id=com.vandyke.sia" )))
183+ }
184+ .show()
185+ }
166186 }
167187
168188 public override fun onActivityResult (requestCode : Int , resultCode : Int , data : Intent ? ) {
0 commit comments