diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7a8d93b..290ca0e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -22,6 +22,11 @@
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
+
+
= 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 welcome sliders
+ // add few more layouts if you want
+ layouts = new int[]{
+ R.layout.tutorial_slide1,
+ R.layout.tutorial_slide2,
+ R.layout.tutorial_slide3,};
+
+ // adding bottom dots
+ addBottomDots(0);
+
+ // 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) {
+ launchHomeScreen();
+ }
+ });
+
+ btnNext.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ // checking for last page
+ // if last page home screen will be launched
+ int current = getItem(+1);
+ if (current < layouts.length) {
+ // move to next screen
+ viewPager.setCurrentItem(current);
+ } else {
+ launchHomeScreen();
+ }
+ }
+ });
+ }
+
+ 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 launchHomeScreen() {
+ prefManager.setFirstTimeLaunch(false);
+ startActivity(new Intent(TutorialActivity.this, MainActivity.class));
+ finish();
+ }
+
+ // viewpager change listener
+ ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
+
+ @Override
+ public void onPageSelected(int position) {
+ addBottomDots(position);
+
+ // changing the next button text 'NEXT' / 'GOT IT'
+ if (position == layouts.length - 1) {
+ // last page. make button text to GOT IT
+ btnNext.setText(getString(R.string.okay));
+ btnSkip.setVisibility(View.GONE);
+ } else {
+ // still pages are left
+ btnNext.setText(getString(R.string.next));
+ btnSkip.setVisibility(View.VISIBLE);
+ }
+ }
+
+ @Override
+ public void onPageScrolled(int arg0, float arg1, int arg2) {
+
+ }
+
+ @Override
+ public void onPageScrollStateChanged(int arg0) {
+
+ }
+ };
+
+ /**
+ * Making notification bar transparent
+ */
+ 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/res/layout/activity_tutorial.xml b/app/src/main/res/layout/activity_tutorial.xml
new file mode 100644
index 0000000..78a7d05
--- /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 0000000..0bcc19d
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide1.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 0000000..5d896fd
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide2.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 0000000..b7df435
--- /dev/null
+++ b/app/src/main/res/layout/tutorial_slide3.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/welcome_dialog.xml b/app/src/main/res/layout/welcome_dialog.xml
index fb25daf..92acb02 100644
--- a/app/src/main/res/layout/welcome_dialog.xml
+++ b/app/src/main/res/layout/welcome_dialog.xml
@@ -64,7 +64,7 @@
android:id="@+id/difficultyBar"
android:layout_gravity="center_horizontal"
android:isIndicator="true"
- android:numStars="3"
+ android:numStars="4"
android:rating="1"
android:stepSize="1"
style="@style/RatingBar"/>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index a1c9c0a..4f3641a 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -10,4 +10,22 @@
#f6d126
#ffffff
#000000
+
+
+ #026499
+
+
+ #448bb2
+
+
+ - @color/dot_light_screen
+ - @color/dot_light_screen
+ - @color/dot_light_screen
+
+
+
+ - @color/dot_dark_screen
+ - @color/dot_dark_screen
+ - @color/dot_dark_screen
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index bb1ad1b..227286b 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -15,4 +15,13 @@
35sp
30dp
+
+ 30dp
+ 20dp
+ 120dp
+ 30dp
+ 16dp
+ 20dp
+ 40dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fd256d4..29ff0ca 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -144,4 +144,18 @@
Highlight input mistakes
Keep Screen On
Don\'t turn the screen off while playing
+
+
+ Welcome!
+ Welcome to Privacy Friendly Sudoku!
+
+ Game mode
+ Swipe or press the arrow buttons on the left and right to change the game mode.
+
+ Difficulty
+ Press or swipe the stars to change the difficulty.
+
+ View Help
+ Next
+ Skip