aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java5
-rw-r--r--src/main/java/de/pixart/messenger/ui/IntroActivity.java47
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java37
3 files changed, 63 insertions, 26 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) {