Experience upgrade splash screen.

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 #4151
This commit is contained in:
Jake McGinty
2015-09-29 13:14:22 -07:00
committed by Moxie Marlinspike
parent 0b20e99cd2
commit 3035dc4df9
16 changed files with 475 additions and 12 deletions

View File

@@ -0,0 +1,38 @@
package org.thoughtcrime.securesms;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.List;
public class IntroPagerAdapter extends FragmentStatePagerAdapter {
public static class IntroPage {
final int backgroundColor;
final Fragment fragment;
public IntroPage(int backgroundColor, Fragment fragment) {
this.backgroundColor = backgroundColor;
this.fragment = fragment;
}
}
private List<IntroPage> pages;
public IntroPagerAdapter(FragmentManager fm, List<IntroPage> pages) {
super(fm);
this.pages = pages;
}
@Override
public Fragment getItem(int i) {
IntroPage page = pages.get(i);
return page.fragment;
}
@Override
public int getCount() {
return pages.size();
}
}