Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.0 KiB

  1. package eu.faircode.email;
  2. /*
  3. This file is part of FairEmail.
  4. FairEmail 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. NetGuard 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 NetGuard. If not, see <http://www.gnu.org/licenses/>.
  14. Copyright 2018 by Marcel Bokhorst (M66B)
  15. */
  16. import android.content.SharedPreferences;
  17. import android.os.Bundle;
  18. import android.preference.PreferenceManager;
  19. import android.view.LayoutInflater;
  20. import android.view.View;
  21. import android.view.ViewGroup;
  22. import android.widget.Button;
  23. import androidx.annotation.NonNull;
  24. import androidx.annotation.Nullable;
  25. public class FragmentEula extends FragmentEx {
  26. @Override
  27. @Nullable
  28. public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  29. setSubtitle(R.string.title_eula);
  30. View view = inflater.inflate(R.layout.fragment_eula, container, false);
  31. Button btnAgree = view.findViewById(R.id.btnOk);
  32. Button btnDisagree = view.findViewById(R.id.btnCancel);
  33. btnAgree.setOnClickListener(new View.OnClickListener() {
  34. @Override
  35. public void onClick(View view) {
  36. SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
  37. prefs.edit().putBoolean("eula", true).apply();
  38. }
  39. });
  40. btnDisagree.setOnClickListener(new View.OnClickListener() {
  41. @Override
  42. public void onClick(View view) {
  43. getActivity().finish();
  44. }
  45. });
  46. return view;
  47. }
  48. }