-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
23 changed files
with
212 additions
and
292 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
package dev.dsi.robust | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.os.Handler | ||
import androidx.appcompat.app.AppCompatActivity | ||
import dev.dsi.robust.databinding.ActivitySplashBinding | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
|
||
class SplashActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivitySplashBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
window.setStatusBarColor(this.getResources().getColor(R.color.gradient_start)) | ||
window.statusBarColor = this.resources.getColor(R.color.gradient_start) | ||
binding = ActivitySplashBinding.inflate(layoutInflater) | ||
val view = binding.root | ||
Handler().postDelayed({ | ||
startActivity(Intent(this, MainActivity::class.java)) | ||
|
||
// Instead of Handler().postDelayed used coroutines | ||
CoroutineScope(Dispatchers.Main).launch { | ||
delay(1000) | ||
startActivity(Intent(this@SplashActivity, MainActivity::class.java)) | ||
finish() | ||
}, 1000) | ||
setContentView(view) | ||
} | ||
|
||
setContentView(binding.root) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
app/src/main/java/dev/dsi/robust/fridge/Database/FridgeRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
app/src/main/java/dev/dsi/robust/fridge/Database/FridgeViewModelFactory.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.