WhatsNew2Activity.java 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* _____ _
  2. * |_ _| |_ _ _ ___ ___ _ __ __ _
  3. * | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. * |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. *
  6. * Threema for Android
  7. * Copyright (c) 2017-2023 Threema GmbH
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. package ch.threema.app.activities;
  22. import android.content.Intent;
  23. import android.os.Bundle;
  24. import android.view.View;
  25. import android.widget.LinearLayout;
  26. import ch.threema.app.R;
  27. import ch.threema.app.utils.AnimationUtil;
  28. import ch.threema.app.utils.ConfigUtils;
  29. import static ch.threema.app.activities.WhatsNewActivity.EXTRA_NO_ANIMATION;
  30. public class WhatsNew2Activity extends ThreemaAppCompatActivity {
  31. @Override
  32. protected void onCreate(Bundle savedInstanceState) {
  33. ConfigUtils.configureSystemBars(this);
  34. super.onCreate(savedInstanceState);
  35. setContentView(R.layout.activity_whatsnew2);
  36. /*
  37. ((TextView) findViewById(R.id.whatsnew_body)).setText(Html.fromHtml(getString(R.string.whatsnew2_body, getString(R.string.app_name))));
  38. */
  39. findViewById(R.id.ok_button).setOnClickListener(v -> {
  40. finish();
  41. overridePendingTransition(R.anim.slide_in_right_short, R.anim.slide_out_left_short);
  42. });
  43. if (!getIntent().getBooleanExtra(EXTRA_NO_ANIMATION, false)) {
  44. LinearLayout buttonLayout = findViewById(R.id.button_layout);
  45. if (savedInstanceState == null) {
  46. buttonLayout.setVisibility(View.GONE);
  47. buttonLayout.postDelayed(() -> AnimationUtil.slideInFromBottomOvershoot(buttonLayout), 200);
  48. }
  49. }
  50. }
  51. @Override
  52. protected boolean enableOnBackPressedCallback() {
  53. return true;
  54. }
  55. @Override
  56. protected void handleOnBackPressed() {
  57. Intent intent = new Intent(WhatsNew2Activity.this, WhatsNewActivity.class);
  58. intent.putExtra(EXTRA_NO_ANIMATION, true);
  59. startActivity(intent);
  60. overridePendingTransition(R.anim.slide_in_left_short, R.anim.slide_out_right_short);
  61. finish();
  62. }
  63. }