diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b2c4c1b00..452f89059 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -32,6 +32,8 @@
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
+ android:hardwareAccelerated="false"
+ android:largeHeap="true"
android:supportsRtl="false"
android:theme="@style/AppTheme.DayNight.NoActionBar"
tools:ignore="GoogleAppIndexingWarning">
@@ -50,16 +52,23 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask">
-
-
-
-
+
+
+
+
+
+
+
+
+
= 21) {
+ getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+ }
+
+ setContentView(R.layout.activity_tutorial);
+
+ viewPager = (ViewPager) findViewById(R.id.view_pager);
+ dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
+ btnSkip = (Button) findViewById(R.id.btn_skip);
+ btnNext = (Button) findViewById(R.id.btn_next);
+
+
+ // layouts of all Tutorial sliders
+ layouts = new int[]{
+ R.layout.tutorial_slide1,
+ R.layout.tutorial_slide2,
+ R.layout.tutorial_slide3,
+ R.layout.tutorial_slide4};
+
+ // for adding bottom dots
+ addBottomDots(0);
+
+ // for making notification bar transparent
+ changeStatusBarColor();
+
+ myViewPagerAdapter = new MyViewPagerAdapter();
+ viewPager.setAdapter(myViewPagerAdapter);
+ viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
+
+ btnSkip.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ launchZulipActivity();
+ }
+ });
+
+ btnNext.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ // checking for last page
+ // if last page Zulip screen will be launched
+ int current = getItem(+1);
+ if (current < layouts.length) {
+ // move to next screen
+ viewPager.setCurrentItem(current);
+ } else {
+ launchZulipActivity();
+ }
+ }
+ });
+ }
+
+ private void addBottomDots(int currentPage) {
+ dots = new TextView[layouts.length];
+
+ int[] colorsActive = getResources().getIntArray(R.array.array_dot_active);
+ int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive);
+
+ dotsLayout.removeAllViews();
+ for (int i = 0; i < dots.length; i++) {
+ dots[i] = new TextView(this);
+ dots[i].setText(Html.fromHtml("•"));
+ dots[i].setTextSize(35);
+ dots[i].setTextColor(colorsInactive[currentPage]);
+ dotsLayout.addView(dots[i]);
+ }
+
+ if (dots.length > 0)
+ dots[currentPage].setTextColor(colorsActive[currentPage]);
+ }
+
+ private int getItem(int i) {
+ return viewPager.getCurrentItem() + i;
+ }
+
+ private void launchZulipActivity() {
+ prefManager.setFirstTimeLaunch(false);
+ startActivity(new Intent(TutorialActivity.this, ZulipActivity.class));
+ ActivityTransitionAnim.transition(TutorialActivity.this);
+ finish();
+ }
+
+ /**
+ * Making notification bar transparent in SDK Versions > 21
+ */
+ private void changeStatusBarColor() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ Window window = getWindow();
+ window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ window.setStatusBarColor(Color.TRANSPARENT);
+ }
+ }
+
+ /**
+ * View pager adapter
+ */
+ public class MyViewPagerAdapter extends PagerAdapter {
+ private LayoutInflater layoutInflater;
+
+ public MyViewPagerAdapter() {
+ }
+
+ @Override
+ public Object instantiateItem(ViewGroup container, int position) {
+ layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+
+ View view = layoutInflater.inflate(layouts[position], container, false);
+ container.addView(view);
+
+ return view;
+ }
+
+ @Override
+ public int getCount() {
+ return layouts.length;
+ }
+
+ @Override
+ public boolean isViewFromObject(View view, Object obj) {
+ return view == obj;
+ }
+
+
+ @Override
+ public void destroyItem(ViewGroup container, int position, Object object) {
+ View view = (View) object;
+ container.removeView(view);
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/zulip/android/activities/ZulipActivity.java b/app/src/main/java/com/zulip/android/activities/ZulipActivity.java
index 05b7a757b..dac6d7163 100644
--- a/app/src/main/java/com/zulip/android/activities/ZulipActivity.java
+++ b/app/src/main/java/com/zulip/android/activities/ZulipActivity.java
@@ -113,6 +113,7 @@
import com.zulip.android.util.FileUtils;
import com.zulip.android.util.ListDialog;
import com.zulip.android.util.MutedTopics;
+import com.zulip.android.util.PrefManager;
import com.zulip.android.util.RemoveViewsOnScroll;
import com.zulip.android.util.SwipeRemoveLinearLayout;
import com.zulip.android.util.UrlHelper;
@@ -2334,6 +2335,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
FragmentManager.POP_BACK_STACK_INCLUSIVE);
clearSearch();
break;
+ case R.id.helpMe:
+ PrefManager prefManager = new PrefManager(getApplicationContext());
+ // making the first time launch TRUE
+ prefManager.setFirstTimeLaunch(true);
+ startActivity(new Intent(ZulipActivity.this, TutorialActivity.class));
+ finish();
+ break;
+
case R.id.search:
// show a pop up dialog only if gingerbread or under
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
diff --git a/app/src/main/java/com/zulip/android/util/PrefManager.java b/app/src/main/java/com/zulip/android/util/PrefManager.java
new file mode 100644
index 000000000..cc965f17e
--- /dev/null
+++ b/app/src/main/java/com/zulip/android/util/PrefManager.java
@@ -0,0 +1,33 @@
+package com.zulip.android.util;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+
+
+public class PrefManager {
+
+ // Shared preferences file name
+ private static final String PREF_NAME = "zulip-slides";
+ private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
+ SharedPreferences pref;
+ SharedPreferences.Editor editor;
+ Context _context;
+ // shared pref mode
+ int PRIVATE_MODE = 0;
+
+ public PrefManager(Context context) {
+ this._context = context;
+ pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
+ editor = pref.edit();
+ }
+
+ public boolean isFirstTimeLaunch() {
+ return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
+ }
+
+ public void setFirstTimeLaunch(boolean isFirstTime) {
+ editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
+ editor.commit();
+ }
+}
diff --git a/app/src/main/res/drawable/slide1.png b/app/src/main/res/drawable/slide1.png
new file mode 100644
index 000000000..8f5547b6e
Binary files /dev/null and b/app/src/main/res/drawable/slide1.png differ
diff --git a/app/src/main/res/drawable/slide2.png b/app/src/main/res/drawable/slide2.png
new file mode 100644
index 000000000..45d06aa5f
Binary files /dev/null and b/app/src/main/res/drawable/slide2.png differ
diff --git a/app/src/main/res/drawable/slide3.png b/app/src/main/res/drawable/slide3.png
new file mode 100644
index 000000000..bb21a5c02
Binary files /dev/null and b/app/src/main/res/drawable/slide3.png differ
diff --git a/app/src/main/res/drawable/slide4.png b/app/src/main/res/drawable/slide4.png
new file mode 100644
index 000000000..d9cbe4a92
Binary files /dev/null and b/app/src/main/res/drawable/slide4.png differ
diff --git a/app/src/main/res/layout/activity_tutorial.xml b/app/src/main/res/layout/activity_tutorial.xml
new file mode 100644
index 000000000..261bcd918
--- /dev/null
+++ b/app/src/main/res/layout/activity_tutorial.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide1.xml b/app/src/main/res/layout/tutorial_slide1.xml
new file mode 100644
index 000000000..4c8b9f833
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide1.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide2.xml b/app/src/main/res/layout/tutorial_slide2.xml
new file mode 100644
index 000000000..6e570dd6f
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide2.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide3.xml b/app/src/main/res/layout/tutorial_slide3.xml
new file mode 100644
index 000000000..3f193b8d8
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide3.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide4.xml b/app/src/main/res/layout/tutorial_slide4.xml
new file mode 100644
index 000000000..f0c70db3b
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide4.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/options.xml b/app/src/main/res/menu/options.xml
index a5d50c597..686440c39 100644
--- a/app/src/main/res/menu/options.xml
+++ b/app/src/main/res/menu/options.xml
@@ -31,6 +31,11 @@
+
+
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index d5b070310..cc7e2a979 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -31,4 +31,39 @@
#ffffff
#444444
#009688
+
+
+
+ #f64c73
+ #20d2bb
+ #3395ff
+ #c873f4
+
+
+ #d1395c
+ #14a895
+ #2278d4
+ #a854d4
+
+
+ #f98da5
+ #8cf9eb
+ #93c6fd
+ #e4b5fc
+
+
+ - @color/dot_light_screen1
+ - @color/dot_light_screen2
+ - @color/dot_light_screen3
+ - @color/dot_light_screen4
+
+
+
+ - @color/dot_dark_screen1
+ - @color/dot_dark_screen2
+ - @color/dot_dark_screen3
+ - @color/dot_dark_screen4
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index aca1fe1a6..cebd10583 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -174,4 +174,15 @@
Pick a file
" to "
Upload started
+ NEXT
+ SKIP
+ GOT IT
+ Slide left to open the people drawer to message anyone
+ Slide left to open the people drawer
+ Slide right to open the stream drawer to narrow to any stream
+ Slide right to open the stream drawer
+ Switch between Day/Night theme from the overflow menu anytime.
+ Switch between day/night theme
+ Swipe to remove the chatBox anytime you want
+ Swipe to remove