|
|
|
@ -20,6 +20,7 @@ import androidx.fragment.app.DialogFragment
@@ -20,6 +20,7 @@ import androidx.fragment.app.DialogFragment
|
|
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
|
import androidx.fragment.app.FragmentManager |
|
|
|
|
import androidx.lifecycle.lifecycleScope |
|
|
|
|
import com.github.apognu.otter.Otter |
|
|
|
|
import com.github.apognu.otter.R |
|
|
|
|
import com.github.apognu.otter.fragments.* |
|
|
|
|
import com.github.apognu.otter.playback.MediaControlsManager |
|
|
|
@ -191,6 +192,8 @@ class MainActivity : AppCompatActivity() {
@@ -191,6 +192,8 @@ class MainActivity : AppCompatActivity() {
|
|
|
|
|
|
|
|
|
|
if (resultCode == ResultCode.LOGOUT.code) { |
|
|
|
|
Intent(this, LoginActivity::class.java).apply { |
|
|
|
|
Otter.get().deleteAllData() |
|
|
|
|
|
|
|
|
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP |
|
|
|
|
|
|
|
|
|
stopService(Intent(this@MainActivity, PlayerService::class.java)) |
|
|
|
@ -227,9 +230,7 @@ class MainActivity : AppCompatActivity() {
@@ -227,9 +230,7 @@ class MainActivity : AppCompatActivity() {
|
|
|
|
|
EventBus.get().collect { message -> |
|
|
|
|
when (message) { |
|
|
|
|
is Event.LogOut -> { |
|
|
|
|
PowerPreference.clearAllData() |
|
|
|
|
|
|
|
|
|
cacheDir.deleteRecursively() |
|
|
|
|
Otter.get().deleteAllData() |
|
|
|
|
|
|
|
|
|
startActivity(Intent(this@MainActivity, LoginActivity::class.java).apply { |
|
|
|
|
flags = Intent.FLAG_ACTIVITY_NO_HISTORY |
|
|
|
|