aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-03-31 16:46:31 +0200
committerChristian Schneppe <christian@pix-art.de>2018-03-31 16:46:31 +0200
commita539271df66a6c519f995e693c3414516f600f66 (patch)
treea23118f83196c324e7b9cc2f83da1e9a03b2c9d2 /src/main/java
parentea7aa63bb951ce8680d28a131f4f7230076708ef (diff)
some menu fixes
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java13
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java15
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java14
3 files changed, 27 insertions, 15 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 0f6994b21..b80469649 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -433,6 +433,19 @@ public class ConversationActivity extends XmppActivity implements OnConversation
case R.id.action_scan_qr_code:
UriHandlerActivity.scan(this);
return true;
+ case R.id.action_check_updates:
+ if (xmppConnectionService.hasInternetConnection()) {
+ if (!installFromUnknownSourceAllowed() && !xmppConnectionService.installedFromPlayStore()) {
+ openInstallFromUnknownSourcesDialogIfNeeded();
+ } else {
+ UpdateService task = new UpdateService(this, xmppConnectionService.installedFromPlayStore());
+ task.executeOnExecutor(UpdateService.THREAD_POOL_EXECUTOR, "true");
+ Log.d(Config.LOGTAG, "AppUpdater started");
+ }
+ } else {
+ Toast.makeText(this, R.string.account_status_no_internet, Toast.LENGTH_LONG).show();
+ }
+ break;
}
return super.onOptionsItemSelected(item);
}
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index dbf303cd5..338e899f4 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -1056,12 +1056,25 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
menuInflater.inflate(R.menu.fragment_conversation, menu);
final MenuItem menuInviteContact = menu.findItem(R.id.action_invite);
- final MenuItem menuUpdater = menu.findItem(R.id.action_check_updates);
+ final MenuItem menuNeedHelp = menu.findItem(R.id.action_create_issue);
final MenuItem menuSearchHistory = menu.findItem(R.id.action_search_history);
+ final MenuItem menuSearchUpdates = menu.findItem(R.id.action_check_updates);
if (conversation != null) {
+ if (conversation.getMode() == Conversation.MODE_MULTI) {
+ menuInviteContact.setVisible(true);
+ } else {
+ menuInviteContact.setVisible(false);
+ }
+ menuNeedHelp.setVisible(true);
+ menuSearchHistory.setVisible(true);
+ menuSearchUpdates.setVisible(false);
ConversationMenuConfigurator.configureAttachmentMenu(conversation, menu);
ConversationMenuConfigurator.configureEncryptionMenu(conversation, menu);
+ } else {
+ menuNeedHelp.setVisible(false);
+ menuSearchHistory.setVisible(false);
+ menuSearchUpdates.setVisible(true);
}
super.onCreateOptionsMenu(menu, menuInflater);
}
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index a2a568b9d..c6f9a70ca 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -72,7 +72,6 @@ import de.pixart.messenger.entities.MucOptions;
import de.pixart.messenger.entities.Presences;
import de.pixart.messenger.services.AvatarService;
import de.pixart.messenger.services.BarcodeProvider;
-import de.pixart.messenger.services.UpdateService;
import de.pixart.messenger.services.XmppConnectionService;
import de.pixart.messenger.services.XmppConnectionService.XmppConnectionBinder;
import de.pixart.messenger.ui.util.PresenceSelector;
@@ -382,19 +381,6 @@ public abstract class XmppActivity extends AppCompatActivity {
case R.id.action_settings:
startActivity(new Intent(this, SettingsActivity.class));
break;
- case R.id.action_check_updates:
- if (xmppConnectionService.hasInternetConnection()) {
- if (!installFromUnknownSourceAllowed() && !xmppConnectionService.installedFromPlayStore()) {
- openInstallFromUnknownSourcesDialogIfNeeded();
- } else {
- UpdateService task = new UpdateService(this, xmppConnectionService.installedFromPlayStore());
- task.executeOnExecutor(UpdateService.THREAD_POOL_EXECUTOR, "true");
- Log.d(Config.LOGTAG, "AppUpdater started");
- }
- } else {
- Toast.makeText(this, R.string.account_status_no_internet, Toast.LENGTH_LONG).show();
- }
- break;
case R.id.action_accounts:
if (xmppConnectionService.getAccounts().size() == 1 && !xmppConnectionService.multipleAccounts()) {
final Intent intent = new Intent(getApplicationContext(), EditAccountActivity.class);