From a8f3070889be30286d2395a13490ce73f2647e96 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 20 Dec 2019 21:14:22 +0300 Subject: [PATCH] ScheduledTootActivity: fix toolbar back button #1586 (#1591) --- .../com/keylesspalace/tusky/ScheduledTootActivity.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/ScheduledTootActivity.kt b/app/src/main/java/com/keylesspalace/tusky/ScheduledTootActivity.kt index 0bdd14e8..5467a3b8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ScheduledTootActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/ScheduledTootActivity.kt @@ -4,6 +4,7 @@ import android.content.Context import android.content.Intent import android.os.Bundle import android.view.View +import android.view.MenuItem import androidx.appcompat.widget.Toolbar import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.DividerItemDecoration @@ -80,6 +81,16 @@ class ScheduledTootActivity : BaseActivity(), ScheduledTootAdapter.ScheduledToot } } + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + android.R.id.home -> { + onBackPressed() + return true + } + } + return super.onOptionsItemSelected(item) + } + fun loadStatuses() { progress_bar.visibility = View.VISIBLE mastodonApi.scheduledStatuses()