// Path: app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/tutorial/IntroActivity.java
// public class IntroActivity extends AppIntro2 {
// 
//     AnalyticsHelper analyticsHelper;
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         analyticsHelper = AnalyticsHelper.getInstance(this);
//         addSlide(AppIntro2Fragment.newInstance("Percorri sempre la stessa tratta?",
//                 "Aggiungi le tue tratte e i tuoi treni abituali ai preferiti, per averli sempre a portata di mano!", R.drawable.tut1, Color.parseColor("#717C8D")));
//         addSlide(AppIntro2Fragment.newInstance("Andata? Ritorno?", "No problem. Trascina la tratta preferita verso dove vuoi andare. Proprio come ti verrebbe naturale fare.", R.drawable.tut2, Color.parseColor("#717C8D")));
//         addSlide(AppIntro2Fragment.newInstance("Treno poco affidabile?", "Tienilo sempre sotto controllo tramite la notifica!", R.drawable.tut3, Color.parseColor("#717C8D")));
//     }
// 
//     @Override
//     public void onDonePressed(Fragment currentFragment) {
//         super.onDonePressed(currentFragment);
//         analyticsHelper.logScreenEvent(SCREEN_TUTORIAL, ACTION_TUTORIAL_DONE);
//         finish();
//     }
// 
//     @Override
//     public void onSkipPressed(Fragment currentFragment) {
//         super.onSkipPressed(currentFragment);
//         analyticsHelper.logScreenEvent(SCREEN_TUTORIAL, ACTION_TUTORIAL_SKIP);
//         finish();
//     }
// 
//     @Override
//     public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
//         super.onSlideChanged(oldFragment, newFragment);
//         analyticsHelper.logScreenEvent(SCREEN_TUTORIAL, ACTION_TUTORIAL_NEXT);
//     }
// 
// 
//     @Override
//     protected void attachBaseContext(Context newBase) {
//         super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.jaus.albertogiunta.justintrain_oraritreni.BuildConfig;
import com.jaus.albertogiunta.justintrain_oraritreni.R;
import com.jaus.albertogiunta.justintrain_oraritreni.tutorial.IntroActivity;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
                            startActivity(Intent.createChooser(sendIntent, "Consiglia l'app via..."));
                        })
                        .build())
                .addSeparator() //-----------------------------------------//
                .addItem(new ItemBuilder(this, linearLayout)
                        .addItemWithTitleSubtitle("Iscriviti al canale Telegram!", "Per anticipazioni e per votare nuove feature")
                        .addOnClickListener(view -> {
                            if (AboutPageUtils.isAppInstalled(this, "org.telegram.messenger")) {
                                Intent intent = new Intent();
                                intent.setAction(Intent.ACTION_VIEW);
                                intent.addCategory(Intent.CATEGORY_BROWSABLE);
                                intent.setData(Uri.parse("https://telegram.me/justintrain"));
                                startActivity(intent);
                            } else {
                                Toast.makeText(this, "Telegram non sembra essere installato sul tuo dispositivo!", Toast.LENGTH_LONG).show();
                            }
                        })
                        .build())

                .addItem(new ItemBuilder(this, linearLayout).addItemGroupHeader("Info sull'app").build())
                .addItem(new ItemBuilder(this, linearLayout)
                        .addItemWithTitleSubtitle("Changelog", "Versione " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")")
                        .addOnClickListener(view -> {
                            handler.sendEmptyMessage(1);
                        })
                        .build())
                .addSeparator() //-----------------------------------------//
                .addItem(new ItemBuilder(this, linearLayout)
                        .addItemWithTitleSubtitle("Tutorial", "Clicca per visualizzare il Tutorial")
                        .addOnClickListener(view -> {
// Path: app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/tutorial/IntroActivity.java
// public class IntroActivity extends AppIntro2 {
// 
//     AnalyticsHelper analyticsHelper;
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         analyticsHelper = AnalyticsHelper.getInstance(this);
//         addSlide(AppIntro2Fragment.newInstance("Percorri sempre la stessa tratta?",
//                 "Aggiungi le tue tratte e i tuoi treni abituali ai preferiti, per averli sempre a portata di mano!", R.drawable.tut1, Color.parseColor("#717C8D")));
//         addSlide(AppIntro2Fragment.newInstance("Andata? Ritorno?", "No problem. Trascina la tratta preferita verso dove vuoi andare. Proprio come ti verrebbe naturale fare.", R.drawable.tut2, Color.parseColor("#717C8D")));
//         addSlide(AppIntro2Fragment.newInstance("Treno poco affidabile?", "Tienilo sempre sotto controllo tramite la notifica!", R.drawable.tut3, Color.parseColor("#717C8D")));
//     }
// 
//     @Override
//     public void onDonePressed(Fragment currentFragment) {
//         super.onDonePressed(currentFragment);
//         analyticsHelper.logScreenEvent(SCREEN_TUTORIAL, ACTION_TUTORIAL_DONE);
//         finish();
//     }
// 
//     @Override
//     public void onSkipPressed(Fragment currentFragment) {
//         super.onSkipPressed(currentFragment);
//         analyticsHelper.logScreenEvent(SCREEN_TUTORIAL, ACTION_TUTORIAL_SKIP);
//         finish();
//     }
// 
//     @Override
//     public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
//         super.onSlideChanged(oldFragment, newFragment);
//         analyticsHelper.logScreenEvent(SCREEN_TUTORIAL, ACTION_TUTORIAL_NEXT);
//     }
// 
// 
//     @Override
//     protected void attachBaseContext(Context newBase) {
//         super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
//     }
// }


// Path: app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/aboutAndSettings/AboutActivity.java
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.jaus.albertogiunta.justintrain_oraritreni.BuildConfig;
import com.jaus.albertogiunta.justintrain_oraritreni.R;
import com.jaus.albertogiunta.justintrain_oraritreni.tutorial.IntroActivity;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;

                            startActivity(Intent.createChooser(sendIntent, "Consiglia l'app via..."));
                        })
                        .build())
                .addSeparator() //-----------------------------------------//
                .addItem(new ItemBuilder(this, linearLayout)
                        .addItemWithTitleSubtitle("Iscriviti al canale Telegram!", "Per anticipazioni e per votare nuove feature")
                        .addOnClickListener(view -> {
                            if (AboutPageUtils.isAppInstalled(this, "org.telegram.messenger")) {
                                Intent intent = new Intent();
                                intent.setAction(Intent.ACTION_VIEW);
                                intent.addCategory(Intent.CATEGORY_BROWSABLE);
                                intent.setData(Uri.parse("https://telegram.me/justintrain"));
                                startActivity(intent);
                            } else {
                                Toast.makeText(this, "Telegram non sembra essere installato sul tuo dispositivo!", Toast.LENGTH_LONG).show();
                            }
                        })
                        .build())

                .addItem(new ItemBuilder(this, linearLayout).addItemGroupHeader("Info sull'app").build())
                .addItem(new ItemBuilder(this, linearLayout)
                        .addItemWithTitleSubtitle("Changelog", "Versione " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")")
                        .addOnClickListener(view -> {
                            handler.sendEmptyMessage(1);
                        })
                        .build())
                .addSeparator() //-----------------------------------------//
                .addItem(new ItemBuilder(this, linearLayout)
                        .addItemWithTitleSubtitle("Tutorial", "Clicca per visualizzare il Tutorial")
                        .addOnClickListener(view -> {
                            Intent i = new Intent(AboutActivity.this, IntroActivity.class);