mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
add "All Media" option to global menu
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
android:visible="false"
|
||||
/>
|
||||
|
||||
<item android:title="@string/menu_all_media"
|
||||
android:id="@+id/menu_all_media" />
|
||||
|
||||
<item android:title="@string/menu_settings"
|
||||
android:id="@+id/menu_settings" />
|
||||
|
||||
|
||||
@@ -341,6 +341,9 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
case R.id.menu_all_media:
|
||||
startActivity(new Intent(this, ProfileActivity.class));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -97,17 +97,21 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
setSupportActionBar(this.toolbar);
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||
supportActionBar.setCustomView(R.layout.conversation_title_view);
|
||||
supportActionBar.setDisplayShowCustomEnabled(true);
|
||||
supportActionBar.setDisplayShowTitleEnabled(false);
|
||||
Toolbar parent = (Toolbar) supportActionBar.getCustomView().getParent();
|
||||
parent.setPadding(0,0,0,0);
|
||||
parent.setContentInsetsAbsolute(0,0);
|
||||
|
||||
titleView = (ConversationTitleView) supportActionBar.getCustomView();
|
||||
titleView.setOnBackClickedListener(view -> onBackPressed());
|
||||
titleView.setOnClickListener(view -> onEnlargeAvatar());
|
||||
if (isGlobalProfile()) {
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(true);
|
||||
supportActionBar.setHomeActionContentDescription(getString(R.string.back));
|
||||
} else {
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||
supportActionBar.setDisplayShowTitleEnabled(false);
|
||||
supportActionBar.setDisplayShowCustomEnabled(true);
|
||||
supportActionBar.setCustomView(R.layout.conversation_title_view);
|
||||
titleView = (ConversationTitleView) supportActionBar.getCustomView();
|
||||
titleView.setOnBackClickedListener(view -> onBackPressed());
|
||||
titleView.setOnClickListener(view -> onEnlargeAvatar());
|
||||
Toolbar parent = (Toolbar) supportActionBar.getCustomView().getParent();
|
||||
parent.setPadding(0,0,0,0);
|
||||
parent.setContentInsetsAbsolute(0,0);
|
||||
}
|
||||
|
||||
updateToolbar();
|
||||
|
||||
@@ -128,7 +132,7 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
if (!isSelfProfile()) {
|
||||
if (!isSelfProfile() && !isGlobalProfile()) {
|
||||
getMenuInflater().inflate(R.menu.profile_common, menu);
|
||||
boolean canReceive = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user