// Path: app/src/main/java/io/github/krtkush/marsexplorer/UtilityMethods.java
// public class UtilityMethods {
// 
//     /**
//      * Method to detect network connection on the device
//      * @return
//      */
//     public static boolean isNetworkAvailable() {
// 
//         ConnectivityManager connectivityManager =
//                 (ConnectivityManager) MarsExplorerApplication.getApplicationInstance()
//                         .getSystemService(MarsExplorerApplication.getApplicationInstance()
//                                 .CONNECTIVITY_SERVICE);
// 
//         return connectivityManager.getActiveNetworkInfo() != null
//                 && connectivityManager.getActiveNetworkInfo().isConnectedOrConnecting();
//     }
// 
//     /**
//      * It's usually very important for websites to track where their traffic is coming from.
//      * We make sure to let them know that we are sending them users by setting the referrer when
//      * launching our Custom Tab.
//      * @return The value of the Referrer Intent.
//      */
//     public static String customTabReferrerString() {
// 
//         int URI_ANDROID_APP_SCHEME;
// 
//         // Prepare for SDK version compatibility problems.
//         if(Build.VERSION.SDK_INT < 22)
//             URI_ANDROID_APP_SCHEME = 1<<1;
//         else
//             URI_ANDROID_APP_SCHEME = Intent.URI_ANDROID_APP_SCHEME;
// 
//         return URI_ANDROID_APP_SCHEME + "//" + MarsExplorerApplication.getApplicationInstance()
//                 .getPackageName();
//     }
// 
//     /**
//      * @return The Referrer intent key.
//      */
//     public static String customTabReferrerKey() {
// 
//         String EXTRA_REFERRER;
// 
//         // Prepare for SDK version compatibility problems.
//         if(Build.VERSION.SDK_INT < 17)
//             EXTRA_REFERRER = "android.intent.extra.REFERRER";
//         else
//             EXTRA_REFERRER = Intent.EXTRA_REFERRER;
// 
//         return EXTRA_REFERRER;
//     }
// }


import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.customtabs.CustomTabsClient;
import android.support.customtabs.CustomTabsIntent;
import android.support.customtabs.CustomTabsServiceConnection;
import android.support.customtabs.CustomTabsSession;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.github.krtkush.marsexplorer.R;
import io.github.krtkush.marsexplorer.UtilityMethods;
     * Method to prepare the CustomTabs.
     */
    private void prepareCustomTabs() {
        final String CUSTOM_TAB_PACKAGE_NAME = "com.android.chrome";

        CustomTabsServiceConnection customTabsServiceConnection =
                new CustomTabsServiceConnection() {
                    @Override
                    public void onCustomTabsServiceConnected(ComponentName name,
                                                             CustomTabsClient client) {
                        customTabsClient = client;
                        customTabsClient.warmup(0L);
                        customTabsSession = customTabsClient.newSession(null);
                    }

                    @Override
                    public void onServiceDisconnected(ComponentName name) {
                        customTabsClient = null;
                    }
                };

        isConnectedToCustomTabService = CustomTabsClient.bindCustomTabsService(activity,
                CUSTOM_TAB_PACKAGE_NAME, customTabsServiceConnection);

        customTabsIntent = new CustomTabsIntent.Builder(customTabsSession)
                .setShowTitle(true)
                .setStartAnimations(activity, R.anim.slide_up_enter, R.anim.stay)
                .setExitAnimations(activity, R.anim.stay, R.anim.slide_down_exit)
                .build();

// Path: app/src/main/java/io/github/krtkush/marsexplorer/UtilityMethods.java
// public class UtilityMethods {
// 
//     /**
//      * Method to detect network connection on the device
//      * @return
//      */
//     public static boolean isNetworkAvailable() {
// 
//         ConnectivityManager connectivityManager =
//                 (ConnectivityManager) MarsExplorerApplication.getApplicationInstance()
//                         .getSystemService(MarsExplorerApplication.getApplicationInstance()
//                                 .CONNECTIVITY_SERVICE);
// 
//         return connectivityManager.getActiveNetworkInfo() != null
//                 && connectivityManager.getActiveNetworkInfo().isConnectedOrConnecting();
//     }
// 
//     /**
//      * It's usually very important for websites to track where their traffic is coming from.
//      * We make sure to let them know that we are sending them users by setting the referrer when
//      * launching our Custom Tab.
//      * @return The value of the Referrer Intent.
//      */
//     public static String customTabReferrerString() {
// 
//         int URI_ANDROID_APP_SCHEME;
// 
//         // Prepare for SDK version compatibility problems.
//         if(Build.VERSION.SDK_INT < 22)
//             URI_ANDROID_APP_SCHEME = 1<<1;
//         else
//             URI_ANDROID_APP_SCHEME = Intent.URI_ANDROID_APP_SCHEME;
// 
//         return URI_ANDROID_APP_SCHEME + "//" + MarsExplorerApplication.getApplicationInstance()
//                 .getPackageName();
//     }
// 
//     /**
//      * @return The Referrer intent key.
//      */
//     public static String customTabReferrerKey() {
// 
//         String EXTRA_REFERRER;
// 
//         // Prepare for SDK version compatibility problems.
//         if(Build.VERSION.SDK_INT < 17)
//             EXTRA_REFERRER = "android.intent.extra.REFERRER";
//         else
//             EXTRA_REFERRER = Intent.EXTRA_REFERRER;
// 
//         return EXTRA_REFERRER;
//     }
// }


// Path: app/src/main/java/io/github/krtkush/marsexplorer/About/Credits/CreditsRecyclerViewAdapter.java
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.customtabs.CustomTabsClient;
import android.support.customtabs.CustomTabsIntent;
import android.support.customtabs.CustomTabsServiceConnection;
import android.support.customtabs.CustomTabsSession;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.github.krtkush.marsexplorer.R;
import io.github.krtkush.marsexplorer.UtilityMethods;

     * Method to prepare the CustomTabs.
     */
    private void prepareCustomTabs() {
        final String CUSTOM_TAB_PACKAGE_NAME = "com.android.chrome";

        CustomTabsServiceConnection customTabsServiceConnection =
                new CustomTabsServiceConnection() {
                    @Override
                    public void onCustomTabsServiceConnected(ComponentName name,
                                                             CustomTabsClient client) {
                        customTabsClient = client;
                        customTabsClient.warmup(0L);
                        customTabsSession = customTabsClient.newSession(null);
                    }

                    @Override
                    public void onServiceDisconnected(ComponentName name) {
                        customTabsClient = null;
                    }
                };

        isConnectedToCustomTabService = CustomTabsClient.bindCustomTabsService(activity,
                CUSTOM_TAB_PACKAGE_NAME, customTabsServiceConnection);

        customTabsIntent = new CustomTabsIntent.Builder(customTabsSession)
                .setShowTitle(true)
                .setStartAnimations(activity, R.anim.slide_up_enter, R.anim.stay)
                .setExitAnimations(activity, R.anim.stay, R.anim.slide_down_exit)
                .build();

        customTabsIntent.intent.putExtra(UtilityMethods.customTabReferrerKey(),