// Path: app/src/main/java/io/github/krtkush/marsexplorer/MarsExplorerApplication.java
// public class MarsExplorerApplication extends Application {
// 
//     // Variable that holds instance of the application class
//     private static MarsExplorerApplication marsExplorerApplicationInstance;
//     // Variable that holds instance of the photos API interface
//     private NASARestApiClient.NASAMarsPhotosApiInterface nasaMarsPhotosApiInterface;
//     // Variable to hold instance of the weather API interface
//     private MarsWeatherClient.MarsWeatherInterface marsWeatherInterface;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// 
//         marsExplorerApplicationInstance = this;
// 
//         // Initialize the API interfaces.
//         nasaMarsPhotosApiInterface = NASARestApiClient.getNasaMarsPhotosApiInterface();
//         marsWeatherInterface = MarsWeatherClient.getMarsWeatherInterface();
// 
//         // Initialize calligraphy with the preferred font.
//         CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
//                 .setDefaultFontPath("fonts/Lato-Regular.ttf")
//                 .setFontAttrId(R.attr.fontPath)
//                 .build()
//         );
// 
//         // Initialize timber logging tool only if in debug mode.
//         if(BuildConfig.DEBUG)
//             Timber.plant(new Timber.DebugTree());
// 
//         // Initialize picasso cache indicator and logging only if in debug mode.
//         if(BuildConfig.DEBUG) {
//             Picasso
//                     .with(marsExplorerApplicationInstance)
//                     .setIndicatorsEnabled(true);
// 
//             Picasso
//                     .with(marsExplorerApplicationInstance)
//                     .setLoggingEnabled(true);
//         }
// 
//         // Initialize Leak Canary only if in debug mode.
//         if(BuildConfig.DEBUG)
//             LeakCanary.install(this);
// 
//         // Initialize fabric only if NOT in debug mode.
// /*        if(!BuildConfig.DEBUG)
//             Fabric.with(this, new Crashlytics());*/
//     }
// 
//     /**
//      * @return Instance of the application class (App Context)
//      */
//     public static MarsExplorerApplication getApplicationInstance() {
//         return marsExplorerApplicationInstance;
//     }
// 
//     /**
//      * @return Instance of the NASAMarsPhotosApiInterface
//      */
//     public NASARestApiClient.NASAMarsPhotosApiInterface getNasaMarsPhotosApiInterface() {
//         return nasaMarsPhotosApiInterface;
//     }
// 
//     /**
//      * @return Instance of MarsWeatherInterface
//      */
//     public MarsWeatherClient.MarsWeatherInterface getMarsWeatherInterface() {
//         return marsWeatherInterface;
//     }
// }


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import io.github.krtkush.marsexplorer.MarsExplorerApplication;
import io.github.krtkush.marsexplorer.R;
package io.github.krtkush.marsexplorer.About;



/**
 * Created by kartikeykushwaha on 25/10/16.
 */

public class ShareUrlBroadcastReceiver extends BroadcastReceiver {

    /**
     * Broadcast receiver to show the share pop-up.
     */

    @Override
    public void onReceive(Context context, Intent intent) {
        String url = intent.getDataString();

        if (url != null) {
            Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_TEXT, url);

            Intent chooserIntent = Intent.createChooser(shareIntent,
// Path: app/src/main/java/io/github/krtkush/marsexplorer/MarsExplorerApplication.java
// public class MarsExplorerApplication extends Application {
// 
//     // Variable that holds instance of the application class
//     private static MarsExplorerApplication marsExplorerApplicationInstance;
//     // Variable that holds instance of the photos API interface
//     private NASARestApiClient.NASAMarsPhotosApiInterface nasaMarsPhotosApiInterface;
//     // Variable to hold instance of the weather API interface
//     private MarsWeatherClient.MarsWeatherInterface marsWeatherInterface;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// 
//         marsExplorerApplicationInstance = this;
// 
//         // Initialize the API interfaces.
//         nasaMarsPhotosApiInterface = NASARestApiClient.getNasaMarsPhotosApiInterface();
//         marsWeatherInterface = MarsWeatherClient.getMarsWeatherInterface();
// 
//         // Initialize calligraphy with the preferred font.
//         CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
//                 .setDefaultFontPath("fonts/Lato-Regular.ttf")
//                 .setFontAttrId(R.attr.fontPath)
//                 .build()
//         );
// 
//         // Initialize timber logging tool only if in debug mode.
//         if(BuildConfig.DEBUG)
//             Timber.plant(new Timber.DebugTree());
// 
//         // Initialize picasso cache indicator and logging only if in debug mode.
//         if(BuildConfig.DEBUG) {
//             Picasso
//                     .with(marsExplorerApplicationInstance)
//                     .setIndicatorsEnabled(true);
// 
//             Picasso
//                     .with(marsExplorerApplicationInstance)
//                     .setLoggingEnabled(true);
//         }
// 
//         // Initialize Leak Canary only if in debug mode.
//         if(BuildConfig.DEBUG)
//             LeakCanary.install(this);
// 
//         // Initialize fabric only if NOT in debug mode.
// /*        if(!BuildConfig.DEBUG)
//             Fabric.with(this, new Crashlytics());*/
//     }
// 
//     /**
//      * @return Instance of the application class (App Context)
//      */
//     public static MarsExplorerApplication getApplicationInstance() {
//         return marsExplorerApplicationInstance;
//     }
// 
//     /**
//      * @return Instance of the NASAMarsPhotosApiInterface
//      */
//     public NASARestApiClient.NASAMarsPhotosApiInterface getNasaMarsPhotosApiInterface() {
//         return nasaMarsPhotosApiInterface;
//     }
// 
//     /**
//      * @return Instance of MarsWeatherInterface
//      */
//     public MarsWeatherClient.MarsWeatherInterface getMarsWeatherInterface() {
//         return marsWeatherInterface;
//     }
// }


// Path: app/src/main/java/io/github/krtkush/marsexplorer/About/ShareUrlBroadcastReceiver.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import io.github.krtkush.marsexplorer.MarsExplorerApplication;
import io.github.krtkush.marsexplorer.R;

package io.github.krtkush.marsexplorer.About;



/**
 * Created by kartikeykushwaha on 25/10/16.
 */

public class ShareUrlBroadcastReceiver extends BroadcastReceiver {

    /**
     * Broadcast receiver to show the share pop-up.
     */

    @Override
    public void onReceive(Context context, Intent intent) {
        String url = intent.getDataString();

        if (url != null) {
            Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_TEXT, url);

            Intent chooserIntent = Intent.createChooser(shareIntent,
                    MarsExplorerApplication.getApplicationInstance().getString(R.string.share));