diff --git a/app/src/main/java/com/readrops/app/activities/AccountTypeListActivity.java b/app/src/main/java/com/readrops/app/activities/AccountTypeListActivity.java index ff2c8603..52396c26 100644 --- a/app/src/main/java/com/readrops/app/activities/AccountTypeListActivity.java +++ b/app/src/main/java/com/readrops/app/activities/AccountTypeListActivity.java @@ -3,6 +3,7 @@ package com.readrops.app.activities; import android.content.Intent; import android.os.Bundle; import android.os.Parcelable; +import android.view.MenuItem; import android.widget.LinearLayout; import androidx.appcompat.app.AppCompatActivity; @@ -48,6 +49,8 @@ public class AccountTypeListActivity extends AppCompatActivity { fromMainActivity = getIntent().getBooleanExtra("fromMainActivity", false); + if (fromMainActivity) + getSupportActionBar().setDisplayHomeAsUpEnabled(true); adapter = new AccountTypeListAdapter(accountType -> { if (!(accountType == AccountType.LOCAL)) { @@ -111,4 +114,15 @@ public class AccountTypeListActivity extends AppCompatActivity { } }); } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + + return super.onOptionsItemSelected(item); + } } diff --git a/app/src/main/java/com/readrops/app/activities/AddAccountActivity.java b/app/src/main/java/com/readrops/app/activities/AddAccountActivity.java index 3c03242e..30edbfc4 100644 --- a/app/src/main/java/com/readrops/app/activities/AddAccountActivity.java +++ b/app/src/main/java/com/readrops/app/activities/AddAccountActivity.java @@ -3,6 +3,7 @@ package com.readrops.app.activities; import android.content.Intent; import android.os.Bundle; import android.util.Patterns; +import android.view.MenuItem; import android.view.View; import androidx.appcompat.app.AppCompatActivity; @@ -50,6 +51,9 @@ public class AddAccountActivity extends AppCompatActivity { accountToEdit = getIntent().getParcelableExtra(EDIT_ACCOUNT); + if (forwardResult || accountToEdit != null) + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + try { if (accountToEdit != null) { viewModel.setAccountType(accountToEdit.getAccountType()); @@ -226,4 +230,15 @@ public class AddAccountActivity extends AppCompatActivity { } }); } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + + return super.onOptionsItemSelected(item); + } } diff --git a/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java b/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java index bad501e5..0542358e 100644 --- a/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java +++ b/app/src/main/java/com/readrops/app/activities/ManageFeedsFoldersActivity.java @@ -45,6 +45,7 @@ public class ManageFeedsFoldersActivity extends AppCompatActivity { binding = DataBindingUtil.setContentView(this, R.layout.activity_manage_feeds_folders); setSupportActionBar(binding.manageFeedsFoldersToolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); binding.manageFeedsFoldersToolbar.setTitleTextColor(Color.WHITE); binding.manageFeedsFoldersTablayout.setTabTextColors(Color.WHITE, Color.WHITE); diff --git a/app/src/main/java/com/readrops/app/activities/SettingsActivity.java b/app/src/main/java/com/readrops/app/activities/SettingsActivity.java index 4b3cbd68..006c1ea5 100644 --- a/app/src/main/java/com/readrops/app/activities/SettingsActivity.java +++ b/app/src/main/java/com/readrops/app/activities/SettingsActivity.java @@ -1,6 +1,7 @@ package com.readrops.app.activities; import android.os.Bundle; +import android.view.MenuItem; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; @@ -18,6 +19,8 @@ public class SettingsActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + Account account = getIntent().getParcelableExtra(AccountSettingsFragment.ACCOUNT); SettingsKey settingsKey = SettingsKey.values()[getIntent().getIntExtra(SETTINGS_KEY, -1)]; @@ -39,4 +42,15 @@ public class SettingsActivity extends AppCompatActivity { public enum SettingsKey { ACCOUNT_SETTINGS } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + + return super.onOptionsItemSelected(item); + } }