diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-03 21:46:59 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-03 21:46:59 +0200 |
commit | 810ac88a4995851892b1af7a084dba677f4e1fb3 (patch) | |
tree | eeaeb87364481a70d43c9123c464d51888126a1a /src/main/java | |
parent | ed4f8e44a368e4b07e49ba263608ca1713ae2e5c (diff) |
added splash screen
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AudioPlayer.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/NotificationService.java | 12 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 22 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationsActivity.java (renamed from src/main/java/de/pixart/messenger/ui/ConversationActivity.java) | 20 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/StartUI.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 12 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 4 |
9 files changed, 42 insertions, 42 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AudioPlayer.java b/src/main/java/de/pixart/messenger/services/AudioPlayer.java index 4993935b5..6d8a3cf4c 100644 --- a/src/main/java/de/pixart/messenger/services/AudioPlayer.java +++ b/src/main/java/de/pixart/messenger/services/AudioPlayer.java @@ -20,7 +20,7 @@ import java.util.Locale; import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.entities.Message; -import de.pixart.messenger.ui.ConversationActivity; +import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.adapter.MessageAdapter; import de.pixart.messenger.ui.util.PendingItem; import de.pixart.messenger.utils.WeakReferenceSet; @@ -108,7 +108,7 @@ public class AudioPlayer implements View.OnClickListener, MediaPlayer.OnCompleti private void startStop(ImageButton playPause) { if (ContextCompat.checkSelfPermission(messageAdapter.getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { pendingOnClickView.push(new WeakReference<>(playPause)); - ActivityCompat.requestPermissions(messageAdapter.getActivity(), new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ConversationActivity.REQUEST_PLAY_PAUSE); + ActivityCompat.requestPermissions(messageAdapter.getActivity(), new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ConversationsActivity.REQUEST_PLAY_PAUSE); return; } final RelativeLayout audioPlayer = (RelativeLayout) playPause.getParent(); diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java index 4354f77b0..ad6c9f518 100644 --- a/src/main/java/de/pixart/messenger/services/NotificationService.java +++ b/src/main/java/de/pixart/messenger/services/NotificationService.java @@ -44,7 +44,7 @@ import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.Message; import de.pixart.messenger.persistance.FileBackend; -import de.pixart.messenger.ui.ConversationActivity; +import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.EditAccountActivity; import de.pixart.messenger.ui.ManageAccountActivity; import de.pixart.messenger.ui.TimePreference; @@ -625,11 +625,11 @@ public class NotificationService { } private PendingIntent createContentIntent(final String conversationUuid, final String downloadMessageUuid) { - final Intent viewConversationIntent = new Intent(mXmppConnectionService, ConversationActivity.class); - viewConversationIntent.setAction(ConversationActivity.ACTION_VIEW_CONVERSATION); - viewConversationIntent.putExtra(ConversationActivity.EXTRA_CONVERSATION, conversationUuid); + final Intent viewConversationIntent = new Intent(mXmppConnectionService, ConversationsActivity.class); + viewConversationIntent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); + viewConversationIntent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversationUuid); if (downloadMessageUuid != null) { - viewConversationIntent.putExtra(ConversationActivity.EXTRA_DOWNLOAD_UUID, downloadMessageUuid); + viewConversationIntent.putExtra(ConversationsActivity.EXTRA_DOWNLOAD_UUID, downloadMessageUuid); return PendingIntent.getActivity(mXmppConnectionService, generateRequestCode(conversationUuid, 8), viewConversationIntent, @@ -791,7 +791,7 @@ public class NotificationService { } private PendingIntent createOpenConversationsIntent() { - return PendingIntent.getActivity(mXmppConnectionService, 0, new Intent(mXmppConnectionService, ConversationActivity.class), 0); + return PendingIntent.getActivity(mXmppConnectionService, 0, new Intent(mXmppConnectionService, ConversationsActivity.class), 0); } public void updateErrorNotification() { diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 730215cdd..6f6c4188b 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -105,7 +105,7 @@ import de.pixart.messenger.parser.MessageParser; import de.pixart.messenger.parser.PresenceParser; import de.pixart.messenger.persistance.DatabaseBackend; import de.pixart.messenger.persistance.FileBackend; -import de.pixart.messenger.ui.ConversationActivity; +import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.SettingsActivity; import de.pixart.messenger.ui.UiCallback; import de.pixart.messenger.utils.ConversationsFileObserver; @@ -176,7 +176,7 @@ public class XmppConnectionService extends Service { private ReplacingSerialSingleThreadExecutor mContactMergerExecutor = new ReplacingSerialSingleThreadExecutor(true); private WakeLock wakeLock; private long mLastActivity = 0; - ConversationActivity mConversationActivity; + ConversationsActivity mConversationsActivity; private ContentObserver contactObserver = new ContentObserver(null) { diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index e82c321d6..dae489e18 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -76,8 +76,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers DestroyMucDialog.setTitle(getString(R.string.destroy_muc)); DestroyMucDialog.setMessage(getString(R.string.destroy_muc_text, mConversation.getName())); DestroyMucDialog.setPositiveButton(getString(R.string.delete), (dialogInterface, i) -> { - Intent intent = new Intent(xmppConnectionService, ConversationActivity.class); - intent.setAction(ConversationActivity.ACTION_DESTROY_MUC); + Intent intent = new Intent(xmppConnectionService, ConversationsActivity.class); + intent.setAction(ConversationsActivity.ACTION_DESTROY_MUC); intent.putExtra("MUC_UUID", mConversation.getUuid()); Log.d(Config.LOGTAG, "Sending DESTROY intent for " + mConversation.getName()); startActivity(intent); diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 41047b785..b2fd1813b 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -153,7 +153,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke protected Message lastHistoryMessage = null; SimpleDateFormat sdf = new SimpleDateFormat("EEEE, dd. MMM yyyy", Locale.getDefault()); private Toast messageLoaderToast; - private ConversationActivity activity; + private ConversationsActivity activity; private boolean reInitRequiredOnStart = true; @@ -980,11 +980,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke if (activity.xmppConnectionServiceBound) { if (ImageUrisCount == 1) { Uri uri = imageUris.get(0); - Log.d(Config.LOGTAG, "ConversationActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE"); + Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE"); attachImageToConversation(conversation, uri, false); } else { for (Iterator<Uri> i = imageUris.iterator(); i.hasNext(); i.remove()) { - Log.d(Config.LOGTAG, "ConversationActivity.onActivityResult() - attaching images to conversations. CHOOSE_IMAGES"); + Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching images to conversations. CHOOSE_IMAGES"); attachImagesToConversation(conversation, i.next()); } } @@ -1057,10 +1057,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke public void onAttach(Activity activity) { super.onAttach(activity); Log.d(Config.LOGTAG, "ConversationFragment.onAttach()"); - if (activity instanceof ConversationActivity) { - this.activity = (ConversationActivity) activity; + if (activity instanceof ConversationsActivity) { + this.activity = (ConversationsActivity) activity; } else { - throw new IllegalStateException("Trying to attach fragment to activity that is not the ConversationActivity"); + throw new IllegalStateException("Trying to attach fragment to activity that is not the ConversationsActivity"); } } @@ -2118,10 +2118,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } private void processExtras(Bundle extras) { - final String downloadUuid = extras.getString(ConversationActivity.EXTRA_DOWNLOAD_UUID); - final String text = extras.getString(ConversationActivity.EXTRA_TEXT); - final String nick = extras.getString(ConversationActivity.EXTRA_NICK); - final boolean pm = extras.getBoolean(ConversationActivity.EXTRA_IS_PRIVATE_MESSAGE, false); + final String downloadUuid = extras.getString(ConversationsActivity.EXTRA_DOWNLOAD_UUID); + final String text = extras.getString(ConversationsActivity.EXTRA_TEXT); + final String nick = extras.getString(ConversationsActivity.EXTRA_NICK); + final boolean pm = extras.getBoolean(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, false); if (nick != null) { if (pm) { Jid jid = conversation.getJid(); @@ -2633,7 +2633,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } protected void sendOtrMessage(final Message message) { - final ConversationActivity activity = (ConversationActivity) getActivity(); + final ConversationsActivity activity = (ConversationsActivity) getActivity(); final XmppConnectionService xmppService = activity.xmppConnectionService; activity.selectPresence(message.getConversation(), () -> { diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java index be7fdbc28..00d5e2a7c 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java @@ -89,7 +89,7 @@ import de.pixart.messenger.xmpp.chatstate.ChatState; import static de.pixart.messenger.ui.ConversationFragment.REQUEST_DECRYPT_PGP; import static de.pixart.messenger.ui.SettingsActivity.USE_BUNDLED_EMOJIS; -public class ConversationActivity extends XmppActivity implements OnConversationSelected, OnConversationArchived, OnConversationsListItemUpdated, OnConversationRead, XmppConnectionService.OnAccountUpdate, XmppConnectionService.OnConversationUpdate, XmppConnectionService.OnRosterUpdate, OnUpdateBlocklist, XmppConnectionService.OnShowErrorToast { +public class ConversationsActivity extends XmppActivity implements OnConversationSelected, OnConversationArchived, OnConversationsListItemUpdated, OnConversationRead, XmppConnectionService.OnAccountUpdate, XmppConnectionService.OnConversationUpdate, XmppConnectionService.OnRosterUpdate, OnUpdateBlocklist, XmppConnectionService.OnShowErrorToast { public static final String ACTION_VIEW_CONVERSATION = "de.pixart.messenger.VIEW"; public static final String EXTRA_CONVERSATION = "conversationUuid"; @@ -120,7 +120,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation } private static Intent createLauncherIntent(Context context) { - final Intent intent = new Intent(context, ConversationActivity.class); + final Intent intent = new Intent(context, ConversationsActivity.class); intent.setAction(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); return intent; @@ -554,7 +554,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (extras != null && extras.containsKey("MUC_UUID")) { Log.d(Config.LOGTAG, "Get " + intent.getAction() + " intent for " + extras.getString("MUC_UUID")); Conversation conversation = xmppConnectionService.findConversationByUuid(extras.getString("MUC_UUID")); - ConversationActivity.this.xmppConnectionService.clearConversationHistory(conversation); + ConversationsActivity.this.xmppConnectionService.clearConversationHistory(conversation); xmppConnectionService.destroyMuc(conversation); endConversation(conversation); } @@ -640,7 +640,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (conversation.getMode() == Conversation.MODE_SINGLE) { switchToContactDetails(conversation.getContact()); } else if (conversation.getMode() == Conversation.MODE_MULTI) { - Intent intent = new Intent(ConversationActivity.this, ConferenceDetailsActivity.class); + Intent intent = new Intent(ConversationsActivity.this, ConferenceDetailsActivity.class); intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); @@ -656,7 +656,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (conversation.getMode() == Conversation.MODE_SINGLE) { switchToContactDetails(conversation.getContact()); } else if (conversation.getMode() == Conversation.MODE_MULTI) { - Intent intent = new Intent(ConversationActivity.this, ConferenceDetailsActivity.class); + Intent intent = new Intent(ConversationsActivity.this, ConferenceDetailsActivity.class); intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); @@ -671,7 +671,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (conversation.getMode() == Conversation.MODE_SINGLE) { switchToContactDetails(conversation.getContact()); } else if (conversation.getMode() == Conversation.MODE_MULTI) { - Intent intent = new Intent(ConversationActivity.this, ConferenceDetailsActivity.class); + Intent intent = new Intent(ConversationsActivity.this, ConferenceDetailsActivity.class); intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); @@ -688,7 +688,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (conversation.getMode() == Conversation.MODE_SINGLE) { switchToContactDetails(conversation.getContact()); } else if (conversation.getMode() == Conversation.MODE_MULTI) { - Intent intent = new Intent(ConversationActivity.this, ConferenceDetailsActivity.class); + Intent intent = new Intent(ConversationsActivity.this, ConferenceDetailsActivity.class); intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); @@ -733,7 +733,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (conversation.getMode() == Conversation.MODE_SINGLE) { switchToContactDetails(conversation.getContact()); } else if (conversation.getMode() == Conversation.MODE_MULTI) { - Intent intent = new Intent(ConversationActivity.this, ConferenceDetailsActivity.class); + Intent intent = new Intent(ConversationsActivity.this, ConferenceDetailsActivity.class); intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); @@ -746,7 +746,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation if (conversation.getMode() == Conversation.MODE_SINGLE) { switchToContactDetails(conversation.getContact()); } else if (conversation.getMode() == Conversation.MODE_MULTI) { - Intent intent = new Intent(ConversationActivity.this, ConferenceDetailsActivity.class); + Intent intent = new Intent(ConversationsActivity.this, ConferenceDetailsActivity.class); intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); @@ -782,7 +782,7 @@ public class ConversationActivity extends XmppActivity implements OnConversation popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem menuItem) { - Intent intent = new Intent(ConversationActivity.this, VerifyOTRActivity.class); + Intent intent = new Intent(ConversationsActivity.this, VerifyOTRActivity.class); intent.setAction(VerifyOTRActivity.ACTION_VERIFY_CONTACT); intent.putExtra("contact", conversation.getContact().getJid().asBareJid().toString()); intent.putExtra(EXTRA_ACCOUNT, conversation.getAccount().getJid().asBareJid().toString()); diff --git a/src/main/java/de/pixart/messenger/ui/StartUI.java b/src/main/java/de/pixart/messenger/ui/StartUI.java index 08bd844ba..f45cdbb53 100644 --- a/src/main/java/de/pixart/messenger/ui/StartUI.java +++ b/src/main/java/de/pixart/messenger/ui/StartUI.java @@ -44,7 +44,7 @@ public class StartUI extends AppCompatActivity if (EasyPermissions.hasPermissions(this, perms)) { // Already have permission, start ConversationsActivity Log.d(Config.LOGTAG, "All permissions granted, starting " + getString(R.string.app_name) + "(" + FirstStartTime + ")"); - Intent intent = new Intent(this, ConversationActivity.class); + Intent intent = new Intent(this, ConversationsActivity.class); intent.putExtra(PREF_FIRST_START, FirstStartTime); startActivity(intent); finish(); diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 3e95af5ed..76d6f2fa5 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -491,15 +491,15 @@ public abstract class XmppActivity extends AppCompatActivity { } private void switchToConversation(Conversation conversation, String text, String nick, boolean pm, boolean newTask) { - Intent intent = new Intent(this, ConversationActivity.class); - intent.setAction(ConversationActivity.ACTION_VIEW_CONVERSATION); - intent.putExtra(ConversationActivity.EXTRA_CONVERSATION, conversation.getUuid()); + Intent intent = new Intent(this, ConversationsActivity.class); + intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); + intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid()); if (text != null) { - intent.putExtra(ConversationActivity.EXTRA_TEXT, text); + intent.putExtra(ConversationsActivity.EXTRA_TEXT, text); } if (nick != null) { - intent.putExtra(ConversationActivity.EXTRA_NICK, nick); - intent.putExtra(ConversationActivity.EXTRA_IS_PRIVATE_MESSAGE, pm); + intent.putExtra(ConversationsActivity.EXTRA_NICK, nick); + intent.putExtra(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, pm); } if (newTask) { intent.setFlags(intent.getFlags() diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index d243e60bd..19bf6734f 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -72,7 +72,7 @@ import de.pixart.messenger.persistance.FileBackend; import de.pixart.messenger.services.AudioPlayer; import de.pixart.messenger.services.MessageArchiveService; import de.pixart.messenger.services.NotificationService; -import de.pixart.messenger.ui.ConversationActivity; +import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.ConversationFragment; import de.pixart.messenger.ui.ShowFullscreenMessageActivity; import de.pixart.messenger.ui.XmppActivity; @@ -1071,7 +1071,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie public void openDownloadable(Message message) { if (ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ConversationFragment.registerPendingMessage(activity, message); - ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ConversationActivity.REQUEST_OPEN_MESSAGE); + ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ConversationsActivity.REQUEST_OPEN_MESSAGE); return; } DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message); |