diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f066027380..796b4ef67d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -572,6 +572,10 @@
+
+
+
+
+ tools:background="#FF2090ea">
+ tools:src="@drawable/profile_splash"
+ android:layout_gravity="center_horizontal"/>
diff --git a/res/layout/profile_create_activity.xml b/res/layout/profile_create_activity.xml
index e4ea5000ad..90800b5271 100644
--- a/res/layout/profile_create_activity.xml
+++ b/res/layout/profile_create_activity.xml
@@ -61,7 +61,7 @@
android:layout_marginLeft="3dp"
android:layout_gravity="center_vertical"
android:textColor="#73B7F0"
- android:text="Who can see this information?"/>
+ android:text="@string/profile_create_activity__who_can_see_this_information"/>
@@ -73,7 +73,7 @@
android:clipToPadding="false">
+
+
Signal now supports secure video calling.
Signal now supports secure video calling. Tap to explore.
+ Ready for your closeup?
+ Now you can share a profile photo and name with friends on Signal
+ Signal profiles are here
+
Export
Export plaintext to storage?
@@ -975,6 +979,11 @@
Signal requires MMS settings to deliver media and group messages through your wireless carrier. Your device does not make this information available, which is occasionally true for locked devices and other restrictive configurations.
To send media and group messages, tap \'OK\' and complete the requested settings. The MMS settings for your carrier can generally be located by searching for \'your carrier APN\'. You will only need to do this once.
+
+ Set later
+ FINISH
+ Who can see this information?
+
BLOCKED
@@ -1447,7 +1456,6 @@
Transport icon
-
diff --git a/src/org/thoughtcrime/securesms/CreateProfileActivity.java b/src/org/thoughtcrime/securesms/CreateProfileActivity.java
index 857c23d80e..b9b6171e93 100644
--- a/src/org/thoughtcrime/securesms/CreateProfileActivity.java
+++ b/src/org/thoughtcrime/securesms/CreateProfileActivity.java
@@ -22,6 +22,7 @@ import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
+import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
@@ -80,6 +81,7 @@ public class CreateProfileActivity extends PassphraseRequiredActionBarActivity i
private InputAwareLayout container;
private ImageView avatar;
private Button finishButton;
+ private TextView skipButton;
private EditText name;
private EmojiToggle emojiToggle;
private EmojiDrawer emojiDrawer;
@@ -165,6 +167,7 @@ public class CreateProfileActivity extends PassphraseRequiredActionBarActivity i
this.emojiDrawer = ViewUtil.findById(this, R.id.emoji_drawer);
this.container = ViewUtil.findById(this, R.id.container);
this.finishButton = ViewUtil.findById(this, R.id.finish_button);
+ this.skipButton = ViewUtil.findById(this, R.id.skip_button);
this.nextIntent = getIntent().getParcelableExtra(NEXT_INTENT);
this.avatar.setImageDrawable(ContactPhotoFactory.getResourceContactPhoto(R.drawable.ic_camera_alt_white_24dp)
@@ -202,6 +205,11 @@ public class CreateProfileActivity extends PassphraseRequiredActionBarActivity i
this.finishButton.setOnClickListener(view -> {
handleUpload();
});
+
+ this.skipButton.setOnClickListener(view -> {
+ if (nextIntent != null) startActivity(nextIntent);
+ finish();
+ });
}
private void initializeProfileName(boolean excludeSystem) {
diff --git a/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java b/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java
index da280dfb29..2835a060c8 100644
--- a/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java
+++ b/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java
@@ -8,6 +8,7 @@ import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.NotificationCompat;
import android.support.v4.view.ViewPager;
@@ -30,6 +31,7 @@ import java.util.List;
public class ExperienceUpgradeActivity extends BaseActionBarActivity {
private static final String TAG = ExperienceUpgradeActivity.class.getSimpleName();
+ private static final String DISMISS_ACTION = "org.thoughtcrime.securesms.ExperienceUpgradeActivity.DISMISS_ACTION";
private static final int NOTIFICATION_ID = 1339;
private enum ExperienceUpgrade {
@@ -40,7 +42,8 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
R.string.ExperienceUpgradeActivity_textsecure_is_now_called_signal)),
R.string.ExperienceUpgradeActivity_welcome_to_signal_excited,
R.string.ExperienceUpgradeActivity_textsecure_is_now_signal,
- R.string.ExperienceUpgradeActivity_textsecure_is_now_signal_long),
+ R.string.ExperienceUpgradeActivity_textsecure_is_now_signal_long,
+ null),
VIDEO_CALLS(245,
new IntroPage(0xFF2090EA,
BasicIntroFragment.newInstance(R.drawable.video_splash,
@@ -48,34 +51,48 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
R.string.ExperienceUpgradeActivity_signal_now_supports_secure_video_calls)),
R.string.ExperienceUpgradeActivity_say_hello_to_video_calls,
R.string.ExperienceUpgradeActivity_signal_now_supports_secure_video_calling,
- R.string.ExperienceUpgradeActivity_signal_now_supports_secure_video_calling_long);
+ R.string.ExperienceUpgradeActivity_signal_now_supports_secure_video_calling_long,
+ null),
+ PROFILES(286,
+ new IntroPage(0xFF2090EA,
+ BasicIntroFragment.newInstance(R.drawable.profile_splash,
+ R.string.ExperienceUpgradeActivity_ready_for_your_closeup,
+ R.string.ExperienceUpgradeActivity_now_you_can_share_a_profile_photo_and_name_with_friends_on_signal)),
+ R.string.ExperienceUpgradeActivity_signal_profiles_are_here,
+ R.string.ExperienceUpgradeActivity_now_you_can_share_a_profile_photo_and_name_with_friends_on_signal,
+ R.string.ExperienceUpgradeActivity_now_you_can_share_a_profile_photo_and_name_with_friends_on_signal,
+ CreateProfileActivity.class);
private int version;
private List pages;
private @StringRes int notificationTitle;
private @StringRes int notificationText;
private @StringRes int notificationBigText;
+ private @Nullable Class nextIntent;
ExperienceUpgrade(int version,
@NonNull List pages,
@StringRes int notificationTitle,
@StringRes int notificationText,
- @StringRes int notificationBigText)
+ @StringRes int notificationBigText,
+ @Nullable Class nextIntent)
{
- this.version = version;
- this.pages = pages;
- this.notificationTitle = notificationTitle;
- this.notificationText = notificationText;
+ this.version = version;
+ this.pages = pages;
+ this.notificationTitle = notificationTitle;
+ this.notificationText = notificationText;
this.notificationBigText = notificationBigText;
+ this.nextIntent = nextIntent;
}
ExperienceUpgrade(int version,
@NonNull IntroPage page,
@StringRes int notificationTitle,
@StringRes int notificationText,
- @StringRes int notificationBigText)
+ @StringRes int notificationBigText,
+ @Nullable Class nextIntent)
{
- this(version, Collections.singletonList(page), notificationTitle, notificationText, notificationBigText);
+ this(version, Collections.singletonList(page), notificationTitle, notificationText, notificationBigText, nextIntent);
}
public int getVersion() {
@@ -136,7 +153,15 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
int latestVersion = seenUpgrade.isPresent() ? seenUpgrade.get().getVersion()
: Util.getCurrentApkReleaseVersion(this);
TextSecurePreferences.setLastExperienceVersionCode(this, latestVersion);
- startActivity((Intent)getIntent().getParcelableExtra("next_intent"));
+ if (seenUpgrade.isPresent() && seenUpgrade.get().nextIntent != null) {
+ Intent intent = new Intent(this, seenUpgrade.get().nextIntent);
+ Intent nextIntent = new Intent(this, ConversationListActivity.class);
+ intent.putExtra("next_intent", nextIntent);
+ startActivity(intent);
+ } else {
+ startActivity((Intent) getIntent().getParcelableExtra("next_intent"));
+ }
+
finish();
}
@@ -190,13 +215,23 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
public static class AppUpgradeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
- if(Intent.ACTION_PACKAGE_REPLACED.equals(intent.getAction()) &&
- intent.getData().getSchemeSpecificPart().equals(context.getPackageName()))
+ if (Intent.ACTION_PACKAGE_REPLACED.equals(intent.getAction()) &&
+ intent.getData().getSchemeSpecificPart().equals(context.getPackageName()))
{
Optional experienceUpgrade = getExperienceUpgrade(context);
- if (!experienceUpgrade.isPresent()) return;
- Intent targetIntent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
+ if (!experienceUpgrade.isPresent()) {
+ return;
+ }
+
+ if (experienceUpgrade.get().getVersion() == TextSecurePreferences.getExperienceDismissedVersionCode(context)) {
+ return;
+ }
+
+ Intent targetIntent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
+ Intent dismissIntent = new Intent(context, AppUpgradeReceiver.class);
+ dismissIntent.setAction(DISMISS_ACTION);
+
Notification notification = new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.icon_notification)
.setColor(context.getResources().getColor(R.color.signal_primary))
@@ -207,8 +242,14 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
.setContentIntent(PendingIntent.getActivity(context, 0,
targetIntent,
PendingIntent.FLAG_UPDATE_CURRENT))
+
+ .setDeleteIntent(PendingIntent.getBroadcast(context, 0,
+ dismissIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT))
.build();
ServiceUtil.getNotificationManager(context).notify(NOTIFICATION_ID, notification);
+ } else if (DISMISS_ACTION.equals(intent.getAction())) {
+ TextSecurePreferences.setExperienceDismissedVersionCode(context, Util.getCurrentApkReleaseVersion(context));
}
}
}
diff --git a/src/org/thoughtcrime/securesms/jobs/MultiDeviceProfileKeyUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/MultiDeviceProfileKeyUpdateJob.java
index 4ad020ffaf..b91aab8da7 100644
--- a/src/org/thoughtcrime/securesms/jobs/MultiDeviceProfileKeyUpdateJob.java
+++ b/src/org/thoughtcrime/securesms/jobs/MultiDeviceProfileKeyUpdateJob.java
@@ -2,18 +2,16 @@ package org.thoughtcrime.securesms.jobs;
import android.content.Context;
-import android.text.TextUtils;
import android.util.Log;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.ProfileKeyUtil;
import org.thoughtcrime.securesms.dependencies.InjectableType;
-import org.thoughtcrime.securesms.util.Base64;
+import org.thoughtcrime.securesms.dependencies.SignalCommunicationModule.SignalMessageSenderFactory;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.jobqueue.JobParameters;
import org.whispersystems.jobqueue.requirements.NetworkRequirement;
import org.whispersystems.libsignal.util.guava.Optional;
-import org.whispersystems.signalservice.api.SignalServiceMessageSender;
import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
@@ -35,7 +33,7 @@ public class MultiDeviceProfileKeyUpdateJob extends MasterSecretJob implements I
private static final long serialVersionUID = 1L;
private static final String TAG = MultiDeviceProfileKeyUpdateJob.class.getSimpleName();
- @Inject SignalServiceMessageSender messageSender;
+ @Inject SignalMessageSenderFactory messageSender;
public MultiDeviceProfileKeyUpdateJob(Context context) {
super(context, JobParameters.newBuilder()
@@ -73,7 +71,7 @@ public class MultiDeviceProfileKeyUpdateJob extends MasterSecretJob implements I
SignalServiceSyncMessage syncMessage = SignalServiceSyncMessage.forContacts(new ContactsMessage(attachmentStream, false));
- messageSender.sendMessage(syncMessage);
+ messageSender.create().sendMessage(syncMessage);
}
@Override
diff --git a/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java b/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java
index 11e8f3e72e..4efce0b15c 100644
--- a/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java
+++ b/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java
@@ -48,6 +48,7 @@ public class TextSecurePreferences {
private static final String LAST_VERSION_CODE_PREF = "last_version_code";
private static final String LAST_EXPERIENCE_VERSION_PREF = "last_experience_version_code";
+ private static final String EXPERIENCE_DISMISSED_PREF = "experience_dismissed";
public static final String RINGTONE_PREF = "pref_key_ringtone";
private static final String VIBRATE_PREF = "pref_key_vibrate";
private static final String NOTIFICATION_PREF = "pref_key_enable_notifications";
@@ -488,6 +489,14 @@ public class TextSecurePreferences {
setIntegerPrefrence(context, LAST_EXPERIENCE_VERSION_PREF, versionCode);
}
+ public static int getExperienceDismissedVersionCode(Context context) {
+ return getIntegerPreference(context, EXPERIENCE_DISMISSED_PREF, 0);
+ }
+
+ public static void setExperienceDismissedVersionCode(Context context, int versionCode) {
+ setIntegerPrefrence(context, EXPERIENCE_DISMISSED_PREF, versionCode);
+ }
+
public static String getTheme(Context context) {
return getStringPreference(context, THEME_PREF, "light");
}