diff options
Diffstat (limited to 'src')
19 files changed, 88 insertions, 44 deletions
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 Binary files differnew file mode 100644 index 000000000..79f95fcfa --- /dev/null +++ b/src/main/res/drawable-hdpi/intro_location_icon.png diff --git a/src/main/res/drawable-hdpi/intro_security_icon.png b/src/main/res/drawable-hdpi/intro_security_icon.png Binary files differnew file mode 100644 index 000000000..e8ad1b398 --- /dev/null +++ b/src/main/res/drawable-hdpi/intro_security_icon.png diff --git a/src/main/res/drawable-mdpi/intro_location_icon.png b/src/main/res/drawable-mdpi/intro_location_icon.png Binary files differnew file mode 100644 index 000000000..3c67dea97 --- /dev/null +++ b/src/main/res/drawable-mdpi/intro_location_icon.png diff --git a/src/main/res/drawable-mdpi/intro_security_icon.png b/src/main/res/drawable-mdpi/intro_security_icon.png Binary files differnew file mode 100644 index 000000000..55395f010 --- /dev/null +++ b/src/main/res/drawable-mdpi/intro_security_icon.png diff --git a/src/main/res/drawable-xhdpi/intro_location_icon.png b/src/main/res/drawable-xhdpi/intro_location_icon.png Binary files differnew file mode 100644 index 000000000..777b847c2 --- /dev/null +++ b/src/main/res/drawable-xhdpi/intro_location_icon.png diff --git a/src/main/res/drawable-xhdpi/intro_security_icon.png b/src/main/res/drawable-xhdpi/intro_security_icon.png Binary files differnew file mode 100644 index 000000000..572e83b3a --- /dev/null +++ b/src/main/res/drawable-xhdpi/intro_security_icon.png diff --git a/src/main/res/drawable-xxhdpi/intro_location_icon.png b/src/main/res/drawable-xxhdpi/intro_location_icon.png Binary files differnew file mode 100644 index 000000000..450652e84 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/intro_location_icon.png diff --git a/src/main/res/drawable-xxhdpi/intro_security_icon.png b/src/main/res/drawable-xxhdpi/intro_security_icon.png Binary files differnew file mode 100644 index 000000000..ff6111b7f --- /dev/null +++ b/src/main/res/drawable-xxhdpi/intro_security_icon.png diff --git a/src/main/res/drawable-xxxhdpi/intro_location_icon.png b/src/main/res/drawable-xxxhdpi/intro_location_icon.png Binary files differnew file mode 100644 index 000000000..1a6ee7a3d --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/intro_location_icon.png diff --git a/src/main/res/drawable-xxxhdpi/intro_security_icon.png b/src/main/res/drawable-xxxhdpi/intro_security_icon.png Binary files differnew file mode 100644 index 000000000..d60d9ea71 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/intro_security_icon.png 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 @@ <string name="this_device">Dieses Gerät</string> <string name="intro_desc_main">Erfahre, wie du Pix-Art Messenger nutzen kannst.</string> <string name="welcome_header">Willkommen beim Pix-Art Messenger</string> - <string name="intro_permissions">Berechtigungen</string> - <string name="intro_desc_permissions">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. </string> + <string name="intro_required_permissions">Berechtigungen</string> + <string name="intro_desc_required_permissions">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. </string> <string name="intro_account">Dein Profil</string> <string name="intro_desc_account">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.</string> <string name="intro_start_chatting">Chat starten</string> @@ -962,6 +962,6 @@ <string name="show_intro_again_failed">Zurücksetzen der Hilfen fehlgeschlagen. Versuche es erneut…</string> <string name="intro_desc_whats_xmpp">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.</string> <string name="intro_whats_xmpp">Was ist XMPP / Jabber?</string> - <string name="intro_desc_contacts_permissions">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.</string> + <string name="intro_desc_optional_permissions">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.</string> <string name="intro_desc_account2">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.</string> </resources> 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 @@ <string name="this_device">Este dispositivo</string> <string name="intro_desc_main">Aprende como usar Pix-Art Messenger.</string> <string name="welcome_header">Bienvenido a Pix-Art Messenger</string> - <string name="intro_permissions">Permisos</string> + <string name="intro_required_permissions">Permisos</string> <string name="intro_account">Tu cuenta</string> <string name="intro_start_chatting">Iniciar conversación</string> <string name="intro_desc_open_chat">Ahora ya puedes empezar a chatear, compartir ubicaciones, archivos, videos e imágenes, o enviar mensajes de voz.</string> 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 @@ <string name="this_device">Questo dispositivo</string> <string name="intro_desc_main">Impara come utilizzare Pix-Art Messenger.</string> <string name="welcome_header">Benvenuto su Pix-Art Messenger</string> - <string name="intro_permissions">Permessi</string> + <string name="intro_required_permissions">Permessi</string> <string name="intro_account">Il tuo account</string> </resources> 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 @@ <string name="this_device">Это устройство</string> <string name="intro_desc_main">Узнайте как использовать Pix-Art Messenger.</string> <string name="welcome_header">Добро пожаловать в Pix-Art Messenger</string> - <string name="intro_permissions">Разрешения</string> + <string name="intro_required_permissions">Разрешения</string> <string name="intro_account">Ваш аккаунт</string> <string name="intro_start_chatting">Начать чат</string> <string name="intro_chat_details">Сведения о чате</string> 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 @@ <string name="this_device">此设备</string> <string name="intro_desc_main">学习如何使用Pix-Art聊天</string> <string name="welcome_header">邀请至Pix-Art聊天</string> - <string name="intro_permissions">权限</string> + <string name="intro_required_permissions">权限</string> <string name="intro_account">您的帐户</string> <string name="intro_start_chatting">开始聊天</string> <string name="intro_chat_details">聊天详情</string> 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 @@ <string name="pref_use_invidious">Replace YouTube links with Invidious</string> <string name="pref_use_invidious_summary">Invidious is a privacy friendly alternative to YouTube</string> <string name="this_device">This device</string> - <string name="intro_desc_main">Learn how to use Pix-Art Messenger.</string> - <string name="welcome_header">Welcome to Pix-Art Messenger</string> - <string name="intro_permissions">Permissions</string> - <string name="intro_desc_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. </string> + <string name="intro_desc_main">Learn more…</string> + <string name="welcome_header">Welcome to\nPix-Art Messenger</string> + <string name="intro_required_permissions">Required permissions</string> + <string name="intro_desc_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.</string> <string name="intro_account">Your account</string> - <string name="intro_desc_account">To start over, you will need an own account. If you have an own account, just login with your Jabber-ID and password.</string> - <string name="intro_start_chatting">Start chatting</string> - <string name="intro_desc_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.</string> + <string name="intro_desc_account">If you already have an account, you can simply log in with your Jabber-ID and password</string> + <string name="intro_start_chatting">Contacts</string> + <string name="intro_desc_start_chatting">If you have given the contact permissions, already existing Jabber contacts are automatically displayed in your address book. Otherwise, just add Jabber-IDs</string> <string name="intro_desc_open_chat">Now you can start chatting, share locations, files, videos and images or send voice messages.</string> <string name="intro_chat_details">Chat details</string> <string name="intro_desc_chat_details">You want to open the chat details? Just tip on the chat name in the menu bar on the top.</string> @@ -960,9 +960,16 @@ <string name="pref_show_intro">Show intro again</string> <string name="show_intro_again">Intro screens will be shown again</string> <string name="show_intro_again_failed">Resetting intro screens failed. Try again…</string> - <string name="intro_desc_whats_xmpp">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.</string> - <string name="intro_whats_xmpp">What is XMPP / Jabber?</string> - <string name="intro_desc_contacts_permissions">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.</string> - <string name="intro_desc_account2">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.</string> + <string name="intro_desc_whats_xmpp">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.</string> + <string name="intro_whats_xmpp">What is XMPP / Jabber / Pix-Art Messenger?</string> + <string name="intro_desc_optional_permissions">Permissions to read your address book are required to read Jabber-IDs (if any) from your contacts. Contacts are never shared, uploaded or copied.</string> + <string name="intro_desc_account2">You can create a new profile by selecting a custom server or one from the drop-down menu and entering a nickname.</string> <string name="open_join_dialog">Join public channel…</string> + <string name="intro_optional_permissions">Optional permissions</string> + <string name="intro_desc_optional_permissions2">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.</string> + <string name="intro_desc_account3">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.</string> + <string name="intro_desc_start_chatting2">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.</string> + <string name="intro_desc_start_chatting3">Congratulations!\nHere we go and have fun…</string> + <string name="intro_privacy">Your privacy\nYour sovereignty</string> + <string name="intro_desc_privacy">Pix-Art Messenger will neither sell nor analyze your data and you decide which permissions you grant.</string> </resources> |