diff --git a/app/build.gradle b/app/build.gradle index 3113ba435..f9ddb7123 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,6 +24,7 @@ android { dependencies { compile 'com.android.support:support-v4:23.1.1' + compile 'com.github.paolorotolo:appintro:3.4.0' compile files('libs/ActiveAndroid.jar') } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 13de0139a..5c2273efe 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -56,6 +56,10 @@ android:name="android.support.PARENT_ACTIVITY" android:value="org.isoron.uhabits.MainActivity"/> + + diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png index cc35fe691..85ad242d1 100644 Binary files a/app/src/main/ic_launcher-web.png and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/org/isoron/uhabits/IntroActivity.java b/app/src/main/java/org/isoron/uhabits/IntroActivity.java new file mode 100644 index 000000000..d847c0df5 --- /dev/null +++ b/app/src/main/java/org/isoron/uhabits/IntroActivity.java @@ -0,0 +1,51 @@ +package org.isoron.uhabits; + +import android.app.Activity; +import android.graphics.Color; +import android.os.Bundle; + +import com.github.paolorotolo.appintro.AppIntro2; +import com.github.paolorotolo.appintro.AppIntroFragment; + +public class IntroActivity extends AppIntro2 +{ + @Override + public void init(Bundle savedInstanceState) + { + showStatusBar(false); + + addSlide(AppIntroFragment.newInstance("Welcome", + "Habits Tracker helps you create and mantain good habits.", R.drawable.tutorial_1, + Color.parseColor("#194673"))); + + addSlide(AppIntroFragment.newInstance("Create some new habits", + "Every day, after performing your habit, put a checkmark on the app.", + R.drawable.tutorial_2, Color.parseColor("#ffa726"))); + + addSlide(AppIntroFragment.newInstance("Keep doing it", + "Habits performed consistently for a long time will earn a full star.", + R.drawable.tutorial_3, Color.parseColor("#7cb342"))); + + addSlide(AppIntroFragment.newInstance("Track your progress", + "Detailed graphs show you how your habits improved over time.", + R.drawable.tutorial_4, Color.parseColor("#9575cd"))); + } + + @Override + public void onNextPressed() + { + + } + + @Override + public void onDonePressed() + { + finish(); + } + + @Override + public void onSlideChanged() + { + + } +} diff --git a/app/src/main/java/org/isoron/uhabits/MainActivity.java b/app/src/main/java/org/isoron/uhabits/MainActivity.java index 989970c8c..e3adc04f6 100644 --- a/app/src/main/java/org/isoron/uhabits/MainActivity.java +++ b/app/src/main/java/org/isoron/uhabits/MainActivity.java @@ -1,6 +1,8 @@ package org.isoron.uhabits; +import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; @@ -29,6 +31,24 @@ public class MainActivity extends ReplayableActivity R.id.fragment1); ReminderHelper.createReminderAlarms(MainActivity.this); + + showTutorial(); + } + + private void showTutorial() + { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + Boolean firstRun = prefs.getBoolean("pref_first_run", true); + + if(firstRun) + { + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("pref_first_run", false); + editor.apply(); + + Intent intent = new Intent(this, IntroActivity.class); + this.startActivity(intent); + } } @Override diff --git a/app/src/main/res/drawable/tutorial_1.png b/app/src/main/res/drawable/tutorial_1.png new file mode 100644 index 000000000..7907954db Binary files /dev/null and b/app/src/main/res/drawable/tutorial_1.png differ diff --git a/app/src/main/res/drawable/tutorial_2.png b/app/src/main/res/drawable/tutorial_2.png new file mode 100644 index 000000000..8955a7d8a Binary files /dev/null and b/app/src/main/res/drawable/tutorial_2.png differ diff --git a/app/src/main/res/drawable/tutorial_3.png b/app/src/main/res/drawable/tutorial_3.png new file mode 100644 index 000000000..5509e7828 Binary files /dev/null and b/app/src/main/res/drawable/tutorial_3.png differ diff --git a/app/src/main/res/drawable/tutorial_4.png b/app/src/main/res/drawable/tutorial_4.png new file mode 100644 index 000000000..5f16c991e Binary files /dev/null and b/app/src/main/res/drawable/tutorial_4.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 95103ffcd..c2cd08fa0 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 1ee59aee9..9b6293ce5 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index ba5e44ae7..a9fcd24c7 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 2a1285ac4..97b9df2d3 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4b27333d3..ddde65f4c 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index c893e4341..625b63db6 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -43,6 +43,18 @@ android:action="android.intent.action.VIEW" android:data="https://github.com/iSoron/uhabits"/> + + + + + + + + diff --git a/art/feature.png b/art/feature.png new file mode 100644 index 000000000..5f4e2a668 Binary files /dev/null and b/art/feature.png differ diff --git a/art/feature.svg b/art/feature.svg new file mode 100644 index 000000000..7a47af5f9 --- /dev/null +++ b/art/feature.svg @@ -0,0 +1,2117 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + HabitTracker HabitsTracker + + + + ad-free and open source ad-free and open source + + + + + + diff --git a/art/tutorial.svg b/art/tutorial.svg new file mode 100644 index 000000000..5c2c8b22f --- /dev/null +++ b/art/tutorial.svg @@ -0,0 +1,2616 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + Habits Tracker helps you create and mantain good habits + + + + + Welcome + Every day, after performing your habit, put a checkmark on the app + + + + + Create somenew habits + Habits that are performed consistently for a long time will eventually earn a full star + + + + + Keep doing it + Detailed graphs and statistics show you how your habits improved over time + + + + + Track your progress + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Meditate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +