AboutActivity.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. Polassis: personal voice assistant for Android devices
  3. Copyright (C) 2018 Maksymilian Graczyk
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.mg.polassis.gui;
  16. import android.content.Intent;
  17. import android.net.Uri;
  18. import android.os.Bundle;
  19. import android.support.v7.app.AppCompatActivity;
  20. import android.view.View;
  21. import android.view.WindowManager;
  22. import android.widget.Button;
  23. import android.widget.TextView;
  24. import com.mg.polassis.R;
  25. import com.mg.polassis.misc.Translations;
  26. public class AboutActivity extends AppCompatActivity {
  27. public void prepareGUI()
  28. {
  29. getSupportActionBar().setTitle(Translations.getStringResource(this, getSupportActionBar().getTitle().toString()));
  30. ((TextView)findViewById(R.id.appDescription)).setText(Translations.getStringResource(this, "app_description"));
  31. ((TextView)findViewById(R.id.appDetails)).setText(Translations.getStringResource(this, "app_details"));
  32. ((Button)findViewById(R.id.exp4jButton)).setText(Translations.getStringResource(this, "exp4j"));
  33. ((Button)findViewById(R.id.ETIcon)).setText(Translations.getStringResource(this, "ET_icon"));
  34. }
  35. @Override
  36. protected void onCreate(Bundle savedInstanceState) {
  37. super.onCreate(savedInstanceState);
  38. setContentView(R.layout.activity_about);
  39. getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
  40. getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
  41. prepareGUI();
  42. }
  43. @Override
  44. public void onDestroy()
  45. {
  46. super.onDestroy();
  47. }
  48. public void onButtonOneClick(View v)
  49. {
  50. Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://projects.congrace.de/exp4j/index.html"));
  51. startActivity(intent);
  52. }
  53. public void onButtonTwoClick(View v)
  54. {
  55. Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.flaticon.com/free-icon/mic_10032"));
  56. startActivity(intent);
  57. }
  58. }