Skip to content

Commit

Permalink
Experience upgrade splash screen.
Browse files Browse the repository at this point in the history
Behaves similarly to the DatabaseUpgradeActivity. You have a
static list of ExperienceUpgrade models that include a "trigger"
version, where when a user upgrades through it a notification
will appear, and there will be a splash explanation screen.

Right now the splash screens are basic and not too configurable,
but that can be reworked as upgrades demand.

Closes signalapp#4151
  • Loading branch information
mcginty authored and moxie0 committed Oct 1, 2015
1 parent 0b20e99 commit 3035dc4
Show file tree
Hide file tree
Showing 16 changed files with 475 additions and 12 deletions.
12 changes: 12 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@
android:launchMode="singleTask"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".ExperienceUpgradeActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
android:launchMode="singleTask"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".PassphraseCreateActivity"
android:label="@string/AndroidManifest__create_passphrase"
android:windowSoftInputMode="stateUnchanged"
Expand Down Expand Up @@ -435,5 +440,12 @@
</intent-filter>
</receiver>

<receiver android:name=".ExperienceUpgradeActivity$AppUpgradeReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<data android:scheme="package" />
</intent-filter>
</receiver>

</application>
</manifest>
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependencies {
compile 'com.soundcloud.android:android-crop:0.9.10@aar'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.melnykov:floatingactionbutton:1.1.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.google.zxing:android-integration:3.1.0'
compile ('com.android.support:support-v4-preferencefragment:1.0.0@aar'){
exclude module: 'support-v4'
Expand All @@ -80,6 +80,7 @@ dependencies {
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'org.whispersystems:textsecure-android:1.8.1'
compile 'com.h6ah4i.android.compat:mulsellistprefcompat:1.0.0'
compile 'me.relex:circleindicator:1.0.0@aar'

testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
Expand Down Expand Up @@ -118,7 +119,7 @@ dependencyVerification {
'com.soundcloud.android:android-crop:ffd4b973cf6e97f7d64118a0dc088df50e9066fd5634fe6911dd0c0c5d346177',
'com.android.support:appcompat-v7:9a2355537c2f01cf0b95523605c18606b8d824017e6e94a05c77b0cfc8f21c96',
'com.android.support:recyclerview-v7:e525ad3f33c84bb12b73d2dc975b55364a53f0f2d0697e043efba59ba73e22d2',
'com.melnykov:floatingactionbutton:0679ad9f7d61eb7aeab91e8dc56358cdedd5b1c1b9c48464499ffa05c40d3985',
'com.melnykov:floatingactionbutton:15d58d4fac0f7a288d0e5301bbaf501a146f5b3f5921277811bf99bd3b397263',
'com.google.zxing:android-integration:89e56aadf1164bd71e57949163c53abf90af368b51669c0d4a47a163335f95c4',
'com.android.support:support-v4-preferencefragment:5470f5872514a6226fa1fc6f4e000991f38805691c534cf0bd2778911fc773ad',
'com.android.support:gridlayout-v7:a9b770cffca2c7c5cd83cba4dd12503365de5e8d9c79c479165adf18ab3bc25b',
Expand All @@ -129,6 +130,7 @@ dependencyVerification {
'org.whispersystems:libpastelog:550d33c565380d90f4c671e7b8ed5f3a6da55a9fda468373177106b2eb5220b2',
'com.amulyakhare:com.amulyakhare.textdrawable:54c92b5fba38cfd316a07e5a30528068f45ce8515a6890f1297df4c401af5dcb',
'com.h6ah4i.android.compat:mulsellistprefcompat:47167c5cb796de1a854788e9ff318358e36c8fb88123baaa6e38fb78511dfabe',
'me.relex:circleindicator:996766d3dad51401331515e742948f2a10982d17c626edd976a246b9bf046aac',
'com.nineoldandroids:library:68025a14e3e7673d6ad2f95e4b46d78d7d068343aa99256b686fe59de1b3163a',
'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f',
Expand Down
Binary file added res/drawable-xxhdpi/splash_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_arrow_forward_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions res/layout/color_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:background="#FF2090ea">

<TextView android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/blurb"
android:textSize="34sp"
android:textIsSelectable="false"
android:gravity="center_horizontal|bottom"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:fontFamily="sans-serif-light"
tools:text="@string/ExperienceUpgradeActivity_welcome_to_signal"
android:textColor="@android:color/white" />

<ImageView android:id="@+id/watermark"
android:layout_width="@dimen/onboarding_watermark_size"
android:layout_height="0dp"
android:layout_weight="2"
android:maxHeight="@dimen/onboarding_watermark_size"
android:scaleType="fitCenter"
tools:src="@drawable/splash_logo"
android:layout_gravity="center_horizontal"
android:layout_below="@id/blurb"
android:layout_marginBottom="20dp"
android:layout_marginTop="@dimen/onboarding_margin_vert" />

<TextView android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:id="@+id/subblurb"
android:textSize="20sp"
android:textIsSelectable="false"
android:gravity="center_horizontal"
android:layout_marginTop="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:fontFamily="sans-serif-light"
tools:text="@string/ExperienceUpgradeActivity_textsecure_is_now_called_signal"
android:textColor="@android:color/white" />

</LinearLayout>
44 changes: 44 additions & 0 deletions res/layout/experience_upgrade_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<Button android:id="@+id/continue_button"
android:layout_width="140sp"
android:layout_height="wrap_content"
android:text="continue"
android:visibility="invisible"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />

<me.relex.circleindicator.CircleIndicator
android:id="@+id/indicator"
android:layout_gravity="bottom|center_horizontal"
android:layout_width="fill_parent"
android:layout_marginBottom="25dp"
android:clickable="false"
android:focusable="false"
android:layout_height="40dp" />

<com.melnykov.fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="25dp"
android:src="@drawable/ic_arrow_forward_white_24dp"
android:focusable="true"
android:contentDescription="@string/conversation_list_fragment__fab_content_description"
fab:fab_shadow="false"
fab:fab_colorNormal="#33000000"
fab:fab_colorPressed="#66000000"
fab:fab_colorRipple="#66000000" />
</FrameLayout>
9 changes: 6 additions & 3 deletions res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<color name="textsecure_primary">#ff2090ea</color>
<color name="textsecure_primary_dark">#ff1c7ac5</color>
<color name="signal_primary">#ff2090ea</color>
<color name="signal_primary_dark">#ff1c7ac5</color>
<color name="signal_primary_alpha33">#552090ea</color>

<color name="textsecure_primary_alpha33">#552090ea</color>
<color name="textsecure_primary">@color/signal_primary</color>
<color name="textsecure_primary_dark">@color/signal_primary_dark</color>
<color name="textsecure_primary_alpha33">@color/signal_primary_alpha33</color>

<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
Expand Down
4 changes: 4 additions & 0 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@
holding the phone, *before* moving it up to your face and having
the prox sensor kick in.) -->
<dimen name="button_cluster_side_padding">20dp</dimen>

<dimen name="onboarding_margin_vert">35dp</dimen>
<dimen name="onboarding_margin_land">20dp</dimen>
<dimen name="onboarding_watermark_size">140dp</dimen>
</resources>
6 changes: 6 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@
<!-- ShareActivity -->
<string name="ShareActivity_share_with">Share with</string>

<!-- ExperienceUpgradeActivity -->
<string name="ExperienceUpgradeActivity_welcome_to_signal_dgaf">Welcome to Signal.</string>
<string name="ExperienceUpgradeActivity_textsecure_is_now_called_signal">TextSecure and RedPhone are now one private messenger, for every situation: Signal.</string>
<string name="ExperienceUpgradeActivity_welcome_to_signal_excited">Welcome to Signal!</string>
<string name="ExperienceUpgradeActivity_textsecure_is_now_signal">TextSecure is now Signal.</string>
<string name="ExperienceUpgradeActivity_textsecure_is_now_signal_long">TextSecure and RedPhone are now one app: Signal. Tap to explore.</string>
<!-- ExportFragment -->
<string name="ExportFragment_export">Export</string>
<string name="ExportFragment_export_plaintext_to_sd_card">Export plaintext to SD card?</string>
Expand Down
54 changes: 54 additions & 0 deletions src/org/thoughtcrime/securesms/BasicIntroFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package org.thoughtcrime.securesms;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class BasicIntroFragment extends Fragment {

private static final String ARG_DRAWABLE = "drawable";
private static final String ARG_TEXT = "text";
private static final String ARG_SUBTEXT = "subtext";

private int drawable;
private int text;
private int subtext;

public static BasicIntroFragment newInstance(int drawable, int text, int subtext) {
BasicIntroFragment fragment = new BasicIntroFragment();
Bundle args = new Bundle();
args.putInt(ARG_DRAWABLE, drawable);
args.putInt(ARG_TEXT, text);
args.putInt(ARG_SUBTEXT, subtext);
fragment.setArguments(args);
return fragment;
}

public BasicIntroFragment() {}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
drawable = getArguments().getInt(ARG_DRAWABLE);
text = getArguments().getInt(ARG_TEXT );
subtext = getArguments().getInt(ARG_SUBTEXT );
}
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.color_fragment, container, false);

((ImageView)v.findViewById(R.id.watermark)).setImageResource(drawable);
((TextView)v.findViewById(R.id.blurb)).setText(text);
((TextView)v.findViewById(R.id.subblurb)).setText(subtext);

return v;
}
}
Loading

0 comments on commit 3035dc4

Please sign in to comment.