diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-05-05 22:28:32 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-05-05 22:28:32 +0200 |
commit | ac70233fa49c8fb2477a5b3d8752aa126791e372 (patch) | |
tree | 29883656ecb813c3145ad57c3c16029bd5cdec56 /src | |
parent | 89cca15e77130eae3b1c79b054b72de01debeb57 (diff) |
add animators for more activities
Diffstat (limited to 'src')
23 files changed, 90 insertions, 12 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 6465d0364..995fdc0aa 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -78,6 +78,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers intent.putExtra("MUC_UUID", mConversation.getUuid()); Log.d(Config.LOGTAG, "Sending DESTROY intent for " + mConversation.getName()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); deleteBookmark(); finish(); }); @@ -631,6 +632,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers LeaveMucDialog.setPositiveButton(getString(R.string.action_end_conversation_muc), (dialog, which) -> { startActivity(new Intent(xmppConnectionService, ConversationsActivity.class)); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); this.xmppConnectionService.archiveConversation(mConversation); finish(); }); diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index d2aa75ca3..a9f2a3e51 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -128,6 +128,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp CommonDataKinds.Im.PROTOCOL_JABBER); intent.putExtra("finishActivityOnSaveCompleted", true); ContactDetailsActivity.this.startActivityForResult(intent, 0); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }; @@ -148,6 +149,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(systemAccount); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } } }; @@ -318,6 +320,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp intent.setDataAndType(systemAccount, Contacts.CONTENT_ITEM_TYPE); intent.putExtra("finishActivityOnSaveCompleted", true); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } break; case R.id.action_block: diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 8e79d0acb..a7163af5d 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -185,6 +185,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }; private OnClickListener leaveMuc = new OnClickListener() { @@ -388,6 +389,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke intent.putExtra(VerifyOTRActivity.EXTRA_ACCOUNT, conversation.getAccount().getJid().asBareJid().toString()); intent.putExtra("mode", VerifyOTRActivity.MODE_ANSWER_QUESTION); startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }; @@ -1714,6 +1716,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, attachmentChoice); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); }); builder.setPositiveButton(getString(R.string.action_take_video), (dialog, which) -> { @@ -1721,6 +1724,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setAction(MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent, attachmentChoice); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); }); builder.create().show(); break; @@ -1732,9 +1736,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke break; case ATTACHMENT_CHOICE_RECORD_VOICE: startActivityForResult(new Intent(getActivity(), RecordingActivity.class), attachmentChoice); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); break; case ATTACHMENT_CHOICE_LOCATION: startActivityForResult(new Intent(getActivity(), ShareLocationActivity.class), attachmentChoice); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); break; } if (intent.resolveActivity(getActivity().getPackageManager()) != null) { diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java index 17227ff83..686d435bb 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java @@ -183,6 +183,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio restartintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); restartintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(restartintent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); System.exit(0); } @@ -228,6 +229,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio final Intent intent = getRedirectionIntent(noAnimation); runOnUiThread(() -> { startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); if (noAnimation) { overridePendingTransition(0, 0); } @@ -681,6 +683,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); abtitle.setSelected(true); @@ -697,6 +700,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); } else { @@ -712,6 +716,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); } else { @@ -729,6 +734,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); } @@ -774,6 +780,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); } else { @@ -787,6 +794,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC); intent.putExtra("uuid", conversation.getUuid()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); } @@ -829,6 +837,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio break; } startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return true; } }); diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java index d2f7110f9..4ce263d0a 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java @@ -213,6 +213,7 @@ public class ConversationsOverviewFragment extends XmppFragment { switch (item.getItemId()) { case R.id.action_search: startActivity(new Intent(getActivity(), SearchActivity.class)); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return true; } return super.onOptionsItemSelected(item); diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 573e7078f..070a88bb0 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -160,6 +160,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (url != null && redirectionWorthyStatus && !wasDisabled) { try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString()))); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return; } catch (ActivityNotFoundException e) { Toast.makeText(EditAccountActivity.this, R.string.application_found_to_open_website, Toast.LENGTH_SHORT).show(); @@ -294,8 +295,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (mAccount != null && mAccount.getStatus() != Account.State.ONLINE && mFetchingAvatar) { - startActivity(new Intent(getApplicationContext(), - ManageAccountActivity.class)); + startActivity(new Intent(getApplicationContext(), ManageAccountActivity.class)); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); finish(); } else if (mInitMode && mAccount != null && mAccount.getStatus() == Account.State.ONLINE) { if (!mFetchingAvatar) { @@ -329,6 +330,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat Intent intent = new Intent(EditAccountActivity.this, WelcomeActivity.class); WelcomeActivity.addInviteUri(intent, getIntent()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } } @@ -396,6 +398,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat final Intent intent = new Intent(getApplicationContext(), PublishProfilePictureActivity.class); intent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().asBareJid().toString()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } } }; @@ -421,6 +424,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } WelcomeActivity.addInviteUri(intent, getIntent()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); finish(); }); } @@ -807,6 +811,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat final Intent showBlocklistIntent = new Intent(this, BlocklistActivity.class); showBlocklistIntent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().toString()); startActivity(showBlocklistIntent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); break; case R.id.action_server_info_show_more: changeMoreTableVisibility(!item.isChecked()); @@ -856,6 +861,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setType("image/png"); startActivity(Intent.createChooser(intent, getText(R.string.share_with))); + } private void changeMoreTableVisibility(boolean visible) { @@ -869,6 +875,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat changePasswordIntent.putExtra("password", newPassword); } startActivity(changePasswordIntent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } private void renewCertificate() { diff --git a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java index 90531b0fd..b05a43226 100644 --- a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java +++ b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java @@ -83,6 +83,7 @@ public class MagicCreateActivity extends XmppActivity implements TextWatcher { Toast.makeText(MagicCreateActivity.this, R.string.secure_password_generated, Toast.LENGTH_SHORT).show(); WelcomeActivity.addInviteUri(intent, getIntent()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } } catch (IllegalArgumentException e) { mUsername.setError(getString(R.string.invalid_username)); diff --git a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java index b50c77207..a47a128ab 100644 --- a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java @@ -194,8 +194,8 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda } switch (item.getItemId()) { case R.id.action_add_account: - startActivity(new Intent(getApplicationContext(), - EditAccountActivity.class)); + startActivity(new Intent(getApplicationContext(), EditAccountActivity.class)); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); break; case R.id.action_add_account_with_cert: addAccountFromKey(); @@ -240,6 +240,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda PublishProfilePictureActivity.class); intent.putExtra(EXTRA_ACCOUNT, account.getJid().toString()); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } private void disableAllAccounts() { @@ -370,6 +371,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda intent.putExtra("jid", account.getJid().asBareJid().toString()); intent.putExtra("init", true); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } @Override diff --git a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java index f59e9b30c..8dfcd11da 100644 --- a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java +++ b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java @@ -66,6 +66,7 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC WelcomeActivity.addInviteUri(intent, getIntent()); intent.putExtra("init", true); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } Toast.makeText(PublishProfilePictureActivity.this, R.string.avatar_has_been_published, @@ -117,6 +118,7 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC intent.putExtra("init", true); } startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } finish(); }); @@ -134,6 +136,7 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC attachFileIntent.setAction(Intent.ACTION_GET_CONTENT); Intent chooser = Intent.createChooser(attachFileIntent, getString(R.string.attach_file)); startActivityForResult(chooser, crop ? REQUEST_CHOOSE_FILE_AND_CROP : REQUEST_CHOOSE_FILE); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } @Override diff --git a/src/main/java/de/pixart/messenger/ui/ScanActivity.java b/src/main/java/de/pixart/messenger/ui/ScanActivity.java index 7ca801948..263b46492 100644 --- a/src/main/java/de/pixart/messenger/ui/ScanActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ScanActivity.java @@ -274,6 +274,7 @@ public final class ScanActivity extends Activity implements SurfaceTextureListen if (ContextCompat.checkSelfPermission(activity, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { Intent intent = new Intent(activity, ScanActivity.class); activity.startActivityForResult(intent, REQUEST_SCAN_QR_CODE); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } else { ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.CAMERA}, REQUEST_CAMERA_PERMISSIONS_TO_SCAN); } diff --git a/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java index 9967d72b3..2ac05fffc 100644 --- a/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java @@ -111,6 +111,7 @@ public class ShareLocationActivity extends LocationActivity implements LocationL setShareButtonEnabled(false); requestLocationUpdates(); startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS)); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }); ThemeHelper.fix(this.snackBar); diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java index f8ded022e..b34e49653 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java @@ -88,7 +88,6 @@ public class ShowFullscreenMessageActivity extends XmppActivity { Intent share = new Intent(Intent.ACTION_SEND); share.setType(getMimeType(mFile.toString())); share.putExtra(Intent.EXTRA_STREAM, FileBackend.getUriForFile(this, mFile)); - startActivity(Intent.createChooser(share, getString(R.string.share_with))); try { startActivity(Intent.createChooser(share, getText(R.string.share_with))); } catch (ActivityNotFoundException e) { diff --git a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java index 4aad02be8..be2c98de5 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java @@ -187,6 +187,7 @@ public class ShowLocationActivity extends XmppActivity { try { Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:" + String.valueOf(latitude) + "," + String.valueOf(longitude))); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } catch (ActivityNotFoundException e) { Toast.makeText(this, R.string.no_application_found_to_display_location, Toast.LENGTH_SHORT).show(); } diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index 8f153be6f..25744bdad 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -371,6 +371,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne shareIntent.setType("text/plain"); try { startActivity(Intent.createChooser(shareIntent, getText(R.string.share_uri_with))); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } catch (ActivityNotFoundException e) { Toast.makeText(this, R.string.no_application_to_share_uri, Toast.LENGTH_SHORT).show(); } @@ -960,6 +961,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toString()); intent.putExtra(ChooseContactActivity.EXTRA_TITLE_RES_ID, R.string.choose_participants); startActivityForResult(intent, REQUEST_CREATE_CONFERENCE); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } @Override diff --git a/src/main/java/de/pixart/messenger/ui/StartUI.java b/src/main/java/de/pixart/messenger/ui/StartUI.java index f45cdbb53..8e8c0e9d1 100644 --- a/src/main/java/de/pixart/messenger/ui/StartUI.java +++ b/src/main/java/de/pixart/messenger/ui/StartUI.java @@ -47,6 +47,7 @@ public class StartUI extends AppCompatActivity Intent intent = new Intent(this, ConversationsActivity.class); intent.putExtra(PREF_FIRST_START, FirstStartTime); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); finish(); } else { // set first start to 0 if there are permissions to request @@ -85,6 +86,7 @@ public class StartUI extends AppCompatActivity Uri uri = Uri.fromParts("package", getPackageName(), null); intent.setData(uri); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } }) .setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() { diff --git a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java index 96d53aa97..0915d3399 100644 --- a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java +++ b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java @@ -131,10 +131,12 @@ public class UpdaterActivity extends XmppActivity { List<ResolveInfo> infos = manager.queryIntentActivities(marketIntent, 0); if (infos.size() > 0) { startActivity(marketIntent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } else { uri = Uri.parse("https://jabber.pix-art.de/"); Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); startActivity(browserIntent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } } else { Toast.makeText(getApplicationContext(), getText(R.string.download_started), Toast.LENGTH_LONG).show(); @@ -150,6 +152,7 @@ public class UpdaterActivity extends XmppActivity { Intent intent = new Intent(Intent.ACTION_VIEW, uri); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); //restart updater to show dialog again after coming back after opening changelog recreate(); }) @@ -300,6 +303,7 @@ public class UpdaterActivity extends XmppActivity { installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); installIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(installIntent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); UpdaterActivity.this.finish(); } } diff --git a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java index 84a14c7c0..d9930ca28 100644 --- a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java +++ b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java @@ -126,6 +126,7 @@ public class WelcomeActivity extends XmppActivity { } addInviteUri(intent); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); }); } @@ -305,6 +306,7 @@ public class WelcomeActivity extends XmppActivity { intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); System.exit(0); } diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index c7dba686d..fc5f6a30e 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -286,9 +286,9 @@ public abstract class XmppActivity extends ActionBarActivity { startActivity(marketIntent); } else { uri = Uri.parse("http://www.openkeychain.org/"); - Intent browserIntent = new Intent( - Intent.ACTION_VIEW, uri); + Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); startActivity(browserIntent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } finish(); }); @@ -359,6 +359,7 @@ public abstract class XmppActivity extends ActionBarActivity { break; case R.id.action_settings: startActivity(new Intent(this, SettingsActivity.class)); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); break; case R.id.action_accounts: if (xmppConnectionServiceBound && this.xmppConnectionService.getAccounts().size() == 1 && !this.xmppConnectionService.multipleAccounts()) { @@ -367,9 +368,11 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra("jid", mAccount.getJid().asBareJid().toString()); intent.putExtra("init", false); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } else { final Intent intent = new Intent(getApplicationContext(), ManageAccountActivity.class); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } break; case android.R.id.home: @@ -489,10 +492,10 @@ public abstract class XmppActivity extends ActionBarActivity { | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); } else { - intent.setFlags(intent.getFlags() - | Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_CLEAR_TOP); } startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); finish(); } @@ -507,6 +510,7 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra("contact", contact.getJid().toString()); intent.putExtra("fingerprint", messageFingerprint); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } public void switchToAccount(Account account, String fingerprint) { @@ -528,6 +532,7 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra("fingerprint", fingerprint); } startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); if (init) { overridePendingTransition(0, 0); } @@ -947,6 +952,7 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra(Intent.EXTRA_SUBJECT, user + " " + getString(R.string.inviteUser_Subject) + " " + getString(R.string.app_name)); intent.putExtra(Intent.EXTRA_TEXT, inviteText + "\n\n" + inviteURL); startActivity(Intent.createChooser(intent, getString(R.string.invite_contact))); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } else { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.chooce_account); @@ -976,6 +982,7 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra(Intent.EXTRA_SUBJECT, user + " " + getString(R.string.inviteUser_Subject) + " " + getString(R.string.app_name)); intent.putExtra(Intent.EXTRA_TEXT, inviteText + "\n\n" + inviteURL); startActivity(Intent.createChooser(intent, getString(R.string.invite_contact))); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); }); builder.setNegativeButton(R.string.cancel, null); builder.create().show(); @@ -987,6 +994,7 @@ public abstract class XmppActivity extends ActionBarActivity { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(IssueURL)); startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } protected void shareLink(boolean http) { @@ -999,6 +1007,7 @@ public abstract class XmppActivity extends ActionBarActivity { intent.putExtra(Intent.EXTRA_TEXT, getShareableUri(http)); try { startActivity(Intent.createChooser(intent, getText(R.string.share_uri_with))); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } catch (ActivityNotFoundException e) { Toast.makeText(this, R.string.no_application_to_share_uri, Toast.LENGTH_SHORT).show(); } 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 f97ca0beb..2e602102e 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -437,6 +437,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(body)); activity.startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); }); viewHolder.image.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.GONE); @@ -1072,6 +1073,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie intent.putExtra("image", Uri.fromFile(file)); try { activity.startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return; } catch (ActivityNotFoundException e) { //ignored @@ -1081,6 +1083,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie intent.putExtra("video", Uri.fromFile(file)); try { activity.startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return; } catch (ActivityNotFoundException e) { //ignored @@ -1107,6 +1110,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } try { getContext().startActivity(openIntent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } catch (ActivityNotFoundException e) { Toast.makeText(activity, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); } @@ -1116,6 +1120,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie for (Intent intent : GeoHelper.createGeoIntentsFromMessage(message, this.getContext())) { if (intent.resolveActivity(getContext().getPackageManager()) != null) { getContext().startActivity(intent); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return; } } diff --git a/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java b/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java index ee72649b8..1f53a4c72 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java +++ b/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java @@ -72,6 +72,7 @@ public class ShareUtil { } try { activity.startActivity(Intent.createChooser(shareIntent, activity.getText(R.string.share_with))); + activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } catch (ActivityNotFoundException e) { //This should happen only on faulty androids because normally chooser is always available Toast.makeText(activity, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); diff --git a/src/main/res/animator/fade_in.xml b/src/main/res/animator/fade_in.xml new file mode 100644 index 000000000..8307c7835 --- /dev/null +++ b/src/main/res/animator/fade_in.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> + <alpha xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="200" + android:fromAlpha="0.0" + android:interpolator="@android:anim/accelerate_interpolator" + android:toAlpha="1.0" /> +</set>
\ No newline at end of file diff --git a/src/main/res/animator/fade_out.xml b/src/main/res/animator/fade_out.xml new file mode 100644 index 000000000..d5912c116 --- /dev/null +++ b/src/main/res/animator/fade_out.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android"> + <alpha xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="200" + android:fromAlpha="1.0" + android:interpolator="@android:anim/anticipate_interpolator" + android:toAlpha="0.0" /> +</set>
\ No newline at end of file diff --git a/src/main/res/layout/activity_publish_profile_picture.xml b/src/main/res/layout/activity_publish_profile_picture.xml index d761169d8..dd3afeeac 100644 --- a/src/main/res/layout/activity_publish_profile_picture.xml +++ b/src/main/res/layout/activity_publish_profile_picture.xml @@ -5,13 +5,14 @@ android:layout_height="match_parent" android:background="?attr/color_background_secondary"> - <include layout="@layout/toolbar" /> + <include + android:id="@+id/toolbar" + layout="@layout/toolbar" /> <ScrollView - android:layout_width="fill_parent" + android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/button_bar" - android:layout_alignParentTop="true" android:layout_below="@id/toolbar"> <android.support.v7.widget.CardView |