Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06d033da authored by stefan-niedermann's avatar stefan-niedermann
Browse files

SSO Announcment - Extract string resources and comment out

parent cdf60e6c
Loading
Loading
Loading
Loading
+19 −22
Original line number Diff line number Diff line
package it.niedermann.owncloud.notes.android.activity;

import android.app.AlertDialog;
import android.app.SearchManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ShortcutInfo;
@@ -189,26 +187,25 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
        setupNavigationList(categoryAdapterSelectedItem);
        setupNavigationMenu();

        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        boolean ssoAnnouncmentShown = prefs.getBoolean("sp_sso_announchment_shown", false);
        if(!ssoAnnouncmentShown) {
            AlertDialog dialog = new AlertDialog.Builder(this)
                    .setTitle("Single-Sign-On")
                    .setCancelable(false)
                    .setMessage("The Notes app will beginning with the next major version use the great Single-Sign-On-Feature of Nextcloud.\n\nThis will increase the security, reliability and comfort for you.\n\nPlease make sure, you have installed at least version 3.8.0 of the files app and select at the first run the same account which you are already using.")
                    .setNegativeButton("More information", (a, b) -> {
                        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/stefan-niedermann/nextcloud-notes/blob/master/SSO%20Announcment.md")));
                    })
                    .setPositiveButton("Understood" , (a, b) -> {
                        SharedPreferences.Editor editor = prefs.edit();
                        editor.putBoolean("sp_sso_announchment_shown", true);
                        editor.apply();
                    })
                    .show();
            dialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getResources().getColor(R.color.fg_default));
            dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(getResources().getColor(R.color.fg_default));
        }

        //SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        //boolean ssoAnnouncmentShown = prefs.getBoolean("sp_sso_announchment_shown", false);
        //if (!ssoAnnouncmentShown) {
        //    AlertDialog dialog = new AlertDialog.Builder(this)
        //            .setTitle(R.string.sso_announcment_title)
        //            .setCancelable(false)
        //            .setMessage(R.string.sso_announcment_message)
        //            .setNegativeButton(R.string.sso_announcment_more_info, (a, b) -> {
        //                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/stefan-niedermann/nextcloud-notes/blob/master/SSO%20Announcment.md")));
        //            })
        //            .setPositiveButton(R.string.sso_announcment_understood, (a, b) -> {
        //                SharedPreferences.Editor editor = prefs.edit();
        //                editor.putBoolean("sp_sso_announchment_shown", true);
        //                editor.apply();
        //            })
        //            .show();
        //    dialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getResources().getColor(R.color.fg_default));
        //    dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(getResources().getColor(R.color.fg_default));
        //}
    }

    @Override
+4 −0
Original line number Diff line number Diff line
@@ -168,6 +168,10 @@
    <string name="note_has_been_deleted">This note has been deleted</string>
    <string name="fallback_weblogin_text">Revert to old login method</string>
    <string name="fallback_weblogin_back">Back</string>
    <string name="sso_announcment_title">Single-Sign-On</string>
    <string name="sso_announcment_message">The Notes app will beginning with the next major version use the great Single-Sign-On-Feature of Nextcloud.  This will increase the security, reliability and comfort for you.  Please make sure, you have installed at least version 3.8.0 of the files app and select at the first run the same account which you are already using.</string>
    <string name="sso_announcment_more_info">More information</string>
    <string name="sso_announcment_understood">Understood</string>

    <!-- Array: note modes -->
    <string-array name="noteMode_entries">