From 72f2b8650ec86af524dcdefd81d8037388a60622 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 29 Sep 2019 13:57:58 +0200 Subject: rework intro --- .../ui/ConversationsOverviewFragment.java | 5 ++- .../java/de/pixart/messenger/ui/IntroActivity.java | 47 ++++++++++++++++++--- .../java/de/pixart/messenger/ui/XmppActivity.java | 37 ++++++++-------- src/main/res/drawable-hdpi/intro_location_icon.png | Bin 0 -> 1867 bytes src/main/res/drawable-hdpi/intro_security_icon.png | Bin 0 -> 1863 bytes src/main/res/drawable-mdpi/intro_location_icon.png | Bin 0 -> 1408 bytes src/main/res/drawable-mdpi/intro_security_icon.png | Bin 0 -> 1574 bytes .../res/drawable-xhdpi/intro_location_icon.png | Bin 0 -> 2839 bytes .../res/drawable-xhdpi/intro_security_icon.png | Bin 0 -> 3167 bytes .../res/drawable-xxhdpi/intro_location_icon.png | Bin 0 -> 3848 bytes .../res/drawable-xxhdpi/intro_security_icon.png | Bin 0 -> 3687 bytes .../res/drawable-xxxhdpi/intro_location_icon.png | Bin 0 -> 9784 bytes .../res/drawable-xxxhdpi/intro_security_icon.png | Bin 0 -> 10568 bytes src/main/res/values-de/strings.xml | 6 +-- src/main/res/values-es/strings.xml | 2 +- src/main/res/values-it/strings.xml | 2 +- src/main/res/values-ru/strings.xml | 2 +- src/main/res/values-zh/strings.xml | 2 +- src/main/res/values/strings.xml | 29 ++++++++----- 19 files changed, 88 insertions(+), 44 deletions(-) create mode 100644 src/main/res/drawable-hdpi/intro_location_icon.png create mode 100644 src/main/res/drawable-hdpi/intro_security_icon.png create mode 100644 src/main/res/drawable-mdpi/intro_location_icon.png create mode 100644 src/main/res/drawable-mdpi/intro_security_icon.png create mode 100644 src/main/res/drawable-xhdpi/intro_location_icon.png create mode 100644 src/main/res/drawable-xhdpi/intro_security_icon.png create mode 100644 src/main/res/drawable-xxhdpi/intro_location_icon.png create mode 100644 src/main/res/drawable-xxhdpi/intro_security_icon.png create mode 100644 src/main/res/drawable-xxxhdpi/intro_location_icon.png create mode 100644 src/main/res/drawable-xxxhdpi/intro_security_icon.png diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java index 1ddb30c66..ff5154b65 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java @@ -34,9 +34,7 @@ import android.animation.AnimatorInflater; import android.app.Activity; import android.app.Fragment; import android.content.Intent; -import androidx.databinding.DataBindingUtil; import android.os.Bundle; -import androidx.recyclerview.widget.LinearLayoutManager; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -45,6 +43,9 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import androidx.databinding.DataBindingUtil; +import androidx.recyclerview.widget.LinearLayoutManager; + import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/pixart/messenger/ui/IntroActivity.java b/src/main/java/de/pixart/messenger/ui/IntroActivity.java index 6164b2df3..e7438a87d 100644 --- a/src/main/java/de/pixart/messenger/ui/IntroActivity.java +++ b/src/main/java/de/pixart/messenger/ui/IntroActivity.java @@ -1,5 +1,6 @@ package de.pixart.messenger.ui; +import android.Manifest; import android.content.Intent; import android.os.Bundle; @@ -30,10 +31,8 @@ public class IntroActivity extends AppIntro { final int backgroundColor = getResources().getColor(R.color.primary_dark); final int barColor = getResources().getColor(R.color.primary); - final int separatorColor = getResources().getColor(R.color.accent); setBarColor(barColor); - setSeparatorColor(separatorColor); setProgressButtonEnabled(true); showSkipButton(false); setBackButtonVisibilityWithDone(true); @@ -57,6 +56,14 @@ public class IntroActivity extends AppIntro { welcome.setBgColor(backgroundColor); addSlide(AppIntroFragment.newInstance(welcome)); + SliderPage privacy = new SliderPage(); + privacy.setTitle(getString(R.string.intro_privacy)); + privacy.setDescription(getString(R.string.intro_desc_privacy)); + privacy.setImageDrawable(R.drawable.intro_security_icon); + privacy.setBgColor(backgroundColor); + addSlide(AppIntroFragment.newInstance(privacy)); + + SliderPage xmpp = new SliderPage(); xmpp.setTitle(getString(R.string.intro_whats_xmpp)); xmpp.setDescription(getString(R.string.intro_desc_whats_xmpp)); @@ -65,19 +72,26 @@ public class IntroActivity extends AppIntro { addSlide(AppIntroFragment.newInstance(xmpp)); SliderPage permissions = new SliderPage(); - permissions.setTitle(getString(R.string.intro_permissions)); - permissions.setDescription(getString(R.string.intro_desc_permissions)); + permissions.setTitle(getString(R.string.intro_required_permissions)); + permissions.setDescription(getString(R.string.intro_desc_required_permissions)); permissions.setImageDrawable(R.drawable.intro_memory_icon); permissions.setBgColor(backgroundColor); addSlide(AppIntroFragment.newInstance(permissions)); SliderPage permissions2 = new SliderPage(); - permissions2.setTitle(getString(R.string.intro_permissions)); - permissions2.setDescription(getString(R.string.intro_desc_contacts_permissions)); + permissions2.setTitle(getString(R.string.intro_optional_permissions)); + permissions2.setDescription(getString(R.string.intro_desc_optional_permissions)); permissions2.setImageDrawable(R.drawable.intro_contacts_icon); permissions2.setBgColor(backgroundColor); addSlide(AppIntroFragment.newInstance(permissions2)); + SliderPage permissions3 = new SliderPage(); + permissions3.setTitle(getString(R.string.intro_optional_permissions)); + permissions3.setDescription(getString(R.string.intro_desc_optional_permissions2)); + permissions3.setImageDrawable(R.drawable.intro_location_icon); + permissions3.setBgColor(backgroundColor); + addSlide(AppIntroFragment.newInstance(permissions3)); + SliderPage account = new SliderPage(); account.setTitle(getString(R.string.intro_account)); account.setDescription(getString(R.string.intro_desc_account)); @@ -92,12 +106,33 @@ public class IntroActivity extends AppIntro { account2.setBgColor(backgroundColor); addSlide(AppIntroFragment.newInstance(account2)); + SliderPage account3 = new SliderPage(); + account3.setTitle(getString(R.string.intro_account)); + account3.setDescription(getString(R.string.intro_desc_account3)); + account3.setImageDrawable(R.drawable.intro_account_icon); + account3.setBgColor(backgroundColor); + addSlide(AppIntroFragment.newInstance(account3)); + SliderPage startChatting = new SliderPage(); startChatting.setTitle(getString(R.string.intro_start_chatting)); startChatting.setDescription(getString(R.string.intro_desc_start_chatting)); startChatting.setImageDrawable(R.drawable.intro_start_chat_icon); startChatting.setBgColor(backgroundColor); addSlide(AppIntroFragment.newInstance(startChatting)); + + SliderPage startChatting2 = new SliderPage(); + startChatting2.setTitle(getString(R.string.intro_start_chatting)); + startChatting2.setDescription(getString(R.string.intro_desc_start_chatting2)); + startChatting2.setImageDrawable(R.drawable.intro_start_chat_icon); + startChatting2.setBgColor(backgroundColor); + addSlide(AppIntroFragment.newInstance(startChatting2)); + + SliderPage startChatting3 = new SliderPage(); + startChatting3.setTitle(getString(R.string.intro_start_chatting)); + startChatting3.setDescription(getString(R.string.intro_desc_start_chatting3)); + startChatting3.setImageDrawable(R.drawable.intro_start_chat_icon); + startChatting3.setBgColor(backgroundColor); + addSlide(AppIntroFragment.newInstance(startChatting3)); break; case CONVERSATIONS_ACTIVITY: SliderPage openChat = new SliderPage(); diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 79cfbac5e..4c756b2f6 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -20,7 +20,6 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Resources; import android.content.res.TypedArray; -import androidx.databinding.DataBindingUtil; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Point; @@ -38,12 +37,6 @@ import android.os.PowerManager; import android.os.SystemClock; import android.preference.PreferenceManager; import android.provider.Settings; -import androidx.annotation.BoolRes; -import androidx.annotation.NonNull; -import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatDelegate; import android.text.InputType; import android.util.DisplayMetrics; import android.util.Log; @@ -55,6 +48,14 @@ import android.widget.ImageView; import android.widget.Spinner; import android.widget.Toast; +import androidx.annotation.BoolRes; +import androidx.annotation.NonNull; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.core.content.ContextCompat; +import androidx.databinding.DataBindingUtil; + import net.java.otr4j.session.SessionID; import java.io.File; @@ -195,7 +196,7 @@ public abstract class XmppActivity extends ActionBarActivity { return null; } - protected void hideToast() { + protected void hideToast() { if (mToast != null) { mToast.cancel(); } @@ -421,7 +422,7 @@ public abstract class XmppActivity extends ActionBarActivity { } public int getThemeResource(int r_attr_name, int r_drawable_def) { - int[] attrs = { r_attr_name }; + int[] attrs = {r_attr_name}; TypedArray ta = this.getTheme().obtainStyledAttributes(attrs); int res = ta.getResourceId(0, r_drawable_def); @@ -565,7 +566,7 @@ public abstract class XmppActivity extends ActionBarActivity { } protected void inviteToConversation(Conversation conversation) { - startActivityForResult(ChooseContactActivity.create(this,conversation), REQUEST_INVITE_TO_CONVERSATION); + startActivityForResult(ChooseContactActivity.create(this, conversation), REQUEST_INVITE_TO_CONVERSATION); } protected void announcePgp(final Account account, final Conversation conversation, Intent intent, final Runnable onSuccess) { @@ -732,7 +733,7 @@ public abstract class XmppActivity extends ActionBarActivity { boolean password, boolean permitEmpty) { AlertDialog.Builder builder = new AlertDialog.Builder(this); - DialogQuickeditBinding binding = DataBindingUtil.inflate(getLayoutInflater(),R.layout.dialog_quickedit, null, false); + DialogQuickeditBinding binding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.dialog_quickedit, null, false); if (password) { binding.inputEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } @@ -960,7 +961,7 @@ public abstract class XmppActivity extends ActionBarActivity { Toast.makeText(this, R.string.not_connected_try_again, Toast.LENGTH_SHORT).show(); return; } - if (xmppConnectionService.getAccounts() == null){ + if (xmppConnectionService.getAccounts() == null) { Toast.makeText(this, R.string.no_accounts, Toast.LENGTH_SHORT).show(); return; } @@ -1038,7 +1039,7 @@ public abstract class XmppActivity extends ActionBarActivity { while (features.adhocinviteURI == null && counter <= 10) { try { Thread.sleep(500); - } catch(InterruptedException e) { + } catch (InterruptedException e) { // Process exception } counter++; @@ -1293,11 +1294,11 @@ public abstract class XmppActivity extends ActionBarActivity { int isUnknownAllowed = 0; if (Build.VERSION.SDK_INT >= 26) { /* - * On Android 8 with applications targeting lower versions, - * it's impossible to check unknown sources enabled: using old APIs will always return true - * and using the new one will always return false, - * so in order to avoid a stuck dialog that can't be bypassed we will assume true. - */ + * On Android 8 with applications targeting lower versions, + * it's impossible to check unknown sources enabled: using old APIs will always return true + * and using the new one will always return false, + * so in order to avoid a stuck dialog that can't be bypassed we will assume true. + */ installFromUnknownSource = this.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O || packageManager.canRequestPackageInstalls(); } else if (Build.VERSION.SDK_INT >= 17 && Build.VERSION.SDK_INT < 26) { diff --git a/src/main/res/drawable-hdpi/intro_location_icon.png b/src/main/res/drawable-hdpi/intro_location_icon.png new file mode 100644 index 000000000..79f95fcfa Binary files /dev/null and b/src/main/res/drawable-hdpi/intro_location_icon.png differ diff --git a/src/main/res/drawable-hdpi/intro_security_icon.png b/src/main/res/drawable-hdpi/intro_security_icon.png new file mode 100644 index 000000000..e8ad1b398 Binary files /dev/null and b/src/main/res/drawable-hdpi/intro_security_icon.png differ diff --git a/src/main/res/drawable-mdpi/intro_location_icon.png b/src/main/res/drawable-mdpi/intro_location_icon.png new file mode 100644 index 000000000..3c67dea97 Binary files /dev/null and b/src/main/res/drawable-mdpi/intro_location_icon.png differ diff --git a/src/main/res/drawable-mdpi/intro_security_icon.png b/src/main/res/drawable-mdpi/intro_security_icon.png new file mode 100644 index 000000000..55395f010 Binary files /dev/null and b/src/main/res/drawable-mdpi/intro_security_icon.png differ diff --git a/src/main/res/drawable-xhdpi/intro_location_icon.png b/src/main/res/drawable-xhdpi/intro_location_icon.png new file mode 100644 index 000000000..777b847c2 Binary files /dev/null and b/src/main/res/drawable-xhdpi/intro_location_icon.png differ diff --git a/src/main/res/drawable-xhdpi/intro_security_icon.png b/src/main/res/drawable-xhdpi/intro_security_icon.png new file mode 100644 index 000000000..572e83b3a Binary files /dev/null and b/src/main/res/drawable-xhdpi/intro_security_icon.png differ diff --git a/src/main/res/drawable-xxhdpi/intro_location_icon.png b/src/main/res/drawable-xxhdpi/intro_location_icon.png new file mode 100644 index 000000000..450652e84 Binary files /dev/null and b/src/main/res/drawable-xxhdpi/intro_location_icon.png differ diff --git a/src/main/res/drawable-xxhdpi/intro_security_icon.png b/src/main/res/drawable-xxhdpi/intro_security_icon.png new file mode 100644 index 000000000..ff6111b7f Binary files /dev/null and b/src/main/res/drawable-xxhdpi/intro_security_icon.png differ diff --git a/src/main/res/drawable-xxxhdpi/intro_location_icon.png b/src/main/res/drawable-xxxhdpi/intro_location_icon.png new file mode 100644 index 000000000..1a6ee7a3d Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/intro_location_icon.png differ diff --git a/src/main/res/drawable-xxxhdpi/intro_security_icon.png b/src/main/res/drawable-xxxhdpi/intro_security_icon.png new file mode 100644 index 000000000..d60d9ea71 Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/intro_security_icon.png differ diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml index 999b338d1..1a7333622 100644 --- a/src/main/res/values-de/strings.xml +++ b/src/main/res/values-de/strings.xml @@ -944,8 +944,8 @@ Dieses Gerät Erfahre, wie du Pix-Art Messenger nutzen kannst. Willkommen beim Pix-Art Messenger - Berechtigungen - Pix-Art Messenger wird dich um die Erteilung einiger Berechtigungen bitten. Wir müssen zumindest Zugang zum externen Speicher haben. Alle anderen Berechtigungen werden nach Bedarf angefordert und sind nicht zwingend erforderlich. + Berechtigungen + Pix-Art Messenger wird dich um die Erteilung einiger Berechtigungen bitten. Wir müssen zumindest Zugang zum externen Speicher haben. Alle anderen Berechtigungen werden nach Bedarf angefordert und sind nicht zwingend erforderlich. Dein Profil Um anzufangen, benötigst du ein eigenes Profil. Wenn du ein eigenes Profil hast, melde dich einfach mit deiner Jabber-ID und deinem Passwort an. Chat starten @@ -962,6 +962,6 @@ Zurücksetzen der Hilfen fehlgeschlagen. Versuche es erneut… XMPP, auch Jabber genannt, ist ein dezentrales Kommunikationsnetzwerk und funktioniert wie E-Mail. Du brauchst eine Adresse, die Jabber-ID genannt wird, und ein Passwort. Was ist XMPP / Jabber? - Wir werden dich auch nach Berechtigungen zum Lesen deines Adressbuchs fragen, um Jabber-IDs von deinen Kontakten auszulesen. Wir werden niemals Kontakte weitergeben, hochladen oder kopieren. + Wir werden dich auch nach Berechtigungen zum Lesen deines Adressbuchs fragen, um Jabber-IDs von deinen Kontakten auszulesen. Wir werden niemals Kontakte weitergeben, hochladen oder kopieren. Wenn du ein neues Profil erstellen möchtest, hast du die Wahl, einen vorgeschlagenen Server aus dem Dropdown-Menü zu wählen oder einen benutzerdefinierten Server zu verwenden. Du hast auch die Möglichkeit, ein bestehendes Konto zu importieren. diff --git a/src/main/res/values-es/strings.xml b/src/main/res/values-es/strings.xml index 424276c77..67968c2dc 100644 --- a/src/main/res/values-es/strings.xml +++ b/src/main/res/values-es/strings.xml @@ -943,7 +943,7 @@ Este dispositivo Aprende como usar Pix-Art Messenger. Bienvenido a Pix-Art Messenger - Permisos + Permisos Tu cuenta Iniciar conversación Ahora ya puedes empezar a chatear, compartir ubicaciones, archivos, videos e imágenes, o enviar mensajes de voz. diff --git a/src/main/res/values-it/strings.xml b/src/main/res/values-it/strings.xml index eefe9b15c..01d7eb978 100644 --- a/src/main/res/values-it/strings.xml +++ b/src/main/res/values-it/strings.xml @@ -943,6 +943,6 @@ Questo dispositivo Impara come utilizzare Pix-Art Messenger. Benvenuto su Pix-Art Messenger - Permessi + Permessi Il tuo account diff --git a/src/main/res/values-ru/strings.xml b/src/main/res/values-ru/strings.xml index 5b3c77700..25cdd2aa7 100644 --- a/src/main/res/values-ru/strings.xml +++ b/src/main/res/values-ru/strings.xml @@ -918,7 +918,7 @@ Это устройство Узнайте как использовать Pix-Art Messenger. Добро пожаловать в Pix-Art Messenger - Разрешения + Разрешения Ваш аккаунт Начать чат Сведения о чате diff --git a/src/main/res/values-zh/strings.xml b/src/main/res/values-zh/strings.xml index 5060fbf28..164aad567 100644 --- a/src/main/res/values-zh/strings.xml +++ b/src/main/res/values-zh/strings.xml @@ -935,7 +935,7 @@ 此设备 学习如何使用Pix-Art聊天 邀请至Pix-Art聊天 - 权限 + 权限 您的帐户 开始聊天 聊天详情 diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index e453e2d30..f70f3cd4d 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -942,14 +942,14 @@ Replace YouTube links with Invidious Invidious is a privacy friendly alternative to YouTube This device - Learn how to use Pix-Art Messenger. - Welcome to Pix-Art Messenger - Permissions - Pix-Art Messenger will ask you for granting a few permissions. We need to have at least access to your external storage. Any other permissions are requested as required and are not mandatory. + Learn more… + Welcome to\nPix-Art Messenger + Required permissions + At the end of the intro you will be asked to grant storage permissions (mandatory), if you have not already given them. Addition permissions are requested as needed and are optional. Your account - To start over, you will need an own account. If you have an own account, just login with your Jabber-ID and password. - Start chatting - Congratulations! But how about chatting? Just add Jabber-IDs of your contacts, or if you have given contacts permissions and Jabber-IDs in your address book they will be shown up. You can also add or create group chats or join public channels. + If you already have an account, you can simply log in with your Jabber-ID and password + Contacts + If you have given the contact permissions, already existing Jabber contacts are automatically displayed in your address book. Otherwise, just add Jabber-IDs Now you can start chatting, share locations, files, videos and images or send voice messages. Chat details You want to open the chat details? Just tip on the chat name in the menu bar on the top. @@ -960,9 +960,16 @@ Show intro again Intro screens will be shown again Resetting intro screens failed. Try again… - XMPP, also called jabber, is a decentralized communication network and it works like e-mail works. You need an address, which is called Jabber-ID and a password. - What is XMPP / Jabber? - We will also ask you for granting permissions to read your address book, to read out Jabber-IDs from your contacts. We will never share, upload or copy any of your contacts. - If you would like to create a new account, you have the choice between choosing a suggested server from the drop-down menu or use a custom one. + XMPP, also called jabber, is a decentralized communication network and works like e-mail. You need an address called Jabber-ID, a password and a messenger. More about this later. + What is XMPP / Jabber / Pix-Art Messenger? + Permissions to read your address book are required to read Jabber-IDs (if any) from your contacts. Contacts are never shared, uploaded or copied. + You can create a new profile by selecting a custom server or one from the drop-down menu and entering a nickname. Join public channel… + Optional permissions + Permissions for your location is needed if you would like to share your location.\nFor sharing voice messages it is required to get access to your microphone. + You have the option to import an existing account.\nJust touch to the import button. If there are backup files available, they will be shown. Choose an account to import. + You can also add, create or join multi user chats - so-called MUCs. They where distinguished between private group chats and public group chats - so called channels. + Congratulations!\nHere we go and have fun… + Your privacy\nYour sovereignty + Pix-Art Messenger will neither sell nor analyze your data and you decide which permissions you grant. -- cgit v1.2.3