diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-10-28 01:13:55 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-10-28 01:13:55 +0000 |
commit | 1e5d70cfd881652a7675fdb44358a41714e77df1 (patch) | |
tree | 399093bc3c7fad8a63d818095317e256f97bb858 /app/src | |
parent | 84e4dd09c3bb585c4cfc4166c9f9207610458cf2 (diff) | |
download | infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.tar infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.tar.gz infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.tar.bz2 infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.tar.lz infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.tar.xz infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.tar.zst infinity-for-reddit-1e5d70cfd881652a7675fdb44358a41714e77df1.zip |
Fix some issues in toolbars.
Diffstat (limited to 'app/src')
2 files changed, 31 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentFullMarkdownActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentFullMarkdownActivity.java index 0cf15283..9d8f1f6f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentFullMarkdownActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/CommentFullMarkdownActivity.java @@ -12,6 +12,7 @@ import android.text.TextPaint; import android.text.style.ClickableSpan; import android.text.style.SuperscriptSpan; import android.text.util.Linkify; +import android.view.MenuItem; import android.view.View; import android.view.Window; import android.view.WindowManager; @@ -87,6 +88,11 @@ public class CommentFullMarkdownActivity extends BaseActivity { applyCustomTheme(); + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + setTitle(" "); + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) { mSlidrInterface = Slidr.attach(this); } @@ -233,6 +239,16 @@ public class CommentFullMarkdownActivity extends BaseActivity { } @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + + return false; + } + + @Override protected SharedPreferences getDefaultSharedPreferences() { return mSharedPreferences; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/GiveAwardActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/GiveAwardActivity.java index 803743aa..9b8fec82 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/GiveAwardActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/GiveAwardActivity.java @@ -8,10 +8,12 @@ import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; +import android.view.MenuItem; import android.view.View; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.recyclerview.widget.LinearLayoutManager; @@ -85,6 +87,9 @@ public class GiveAwardActivity extends BaseActivity { applyCustomTheme(); + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) { Slidr.attach(this); } @@ -178,6 +183,16 @@ public class GiveAwardActivity extends BaseActivity { } @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + + return false; + } + + @Override protected SharedPreferences getDefaultSharedPreferences() { return mSharedPreferences; } |