Fix some issues in toolbars.

This commit is contained in:
Alex Ning 2020-10-28 09:13:55 +08:00
parent 84e4dd09c3
commit 1e5d70cfd8
2 changed files with 31 additions and 0 deletions

View File

@ -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);
}
@ -232,6 +238,16 @@ public class CommentFullMarkdownActivity extends BaseActivity {
markwonAdapter.notifyDataSetChanged();
}
@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;

View File

@ -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);
}
@ -177,6 +182,16 @@ public class GiveAwardActivity extends BaseActivity {
recyclerView.setAdapter(adapter);
}
@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;