// Path: app/src/main/java/discovery/contentful/adapters/SpacePagerAdapter.java
// public class SpacePagerAdapter extends FragmentPagerAdapter {
//   private final Context context;
//   private static final int COUNT = 2;
// 
//   public static final int TAB_POS_CONTENT_TYPES = 0;
//   public static final int TAB_POS_ASSETS = 1;
// 
//   private ContentTypesFragment contentTypesFragment;
//   private AssetsFragment assetsFragment;
// 
//   public SpacePagerAdapter(Context context, FragmentManager fm) {
//     super(fm);
//     this.context = context;
//   }
// 
//   @Override public int getCount() {
//     return COUNT;
//   }
// 
//   @Override public Fragment getItem(int position) {
//     switch (position) {
//       case TAB_POS_CONTENT_TYPES:
//         if (contentTypesFragment == null) {
//           contentTypesFragment = ContentTypesFragment.newInstance();
//         }
// 
//         return contentTypesFragment;
// 
//       case TAB_POS_ASSETS:
//         if (assetsFragment == null) {
//           assetsFragment = AssetsFragment.newInstance();
//         }
// 
//         return assetsFragment;
// 
//       default:
//         throw new IllegalStateException("Invalid adapter count");
//     }
//   }
// 
//   @Override public CharSequence getPageTitle(int position) {
//     switch (position) {
//       case 0:
//         return context.getString(R.string.tab_content_types);
// 
//       case 1:
//         return context.getString(R.string.tab_assets);
// 
//       default:
//         throw new IllegalStateException("Invalid adapter count");
//     }
//   }
// }
// 
// Path: app/src/main/java/discovery/contentful/api/CFClient.java
// public class CFClient {
//   private static CDAClient sInstance;
//   private static String locale;
// 
//   private CFClient() {
//   }
// 
//   /**
//    * Initialize this client.
//    *
//    * @param space String representing the Space key.
//    * @param token String representing the access token required to log in to the Space.
//    * @return {@link com.contentful.java.cda.CDAClient} instance.
//    */
//   public synchronized static CDAClient init(String space, String token) {
//     SharedPreferences prefs = CFPrefs.getInstance();
// 
//     prefs.edit()
//         .putString(CFPrefs.KEY_SPACE, space)
//         .putString(CFPrefs.KEY_ACCESS_TOKEN, token)
//         .apply();
// 
//     sInstance = CDAClient.builder().setSpace(space).setToken(token).build();
// 
//     locale = null;
// 
//     return sInstance;
//   }
// 
//   public synchronized static CDAClient getClient() {
//     if (sInstance == null) {
//       SharedPreferences prefs = CFPrefs.getInstance();
// 
//       String space = prefs.getString(CFPrefs.KEY_SPACE, null);
//       String token = prefs.getString(CFPrefs.KEY_ACCESS_TOKEN, null);
// 
//       if (StringUtils.isBlank(space) || StringUtils.isBlank(token)) {
//         throw new IllegalStateException("Uninitialized client.");
//       }
// 
//       return init(space, token);
//     }
// 
//     return sInstance;
//   }
// 
//   /**
//    * Set the locale for this client.
//    *
//    * @param locale String representing the Locale code.
//    */
//   public synchronized static void setLocale(String locale) {
//     CFClient.locale = locale;
//   }
// 
//   /**
//    * Gets the current locale defined for this client.
//    *
//    * @return String representing the current configured locale, null in case the default
//    * locale is being used.
//    */
//   public static String getLocale() {
//     return locale;
//   }
// }
// 
// Path: app/src/main/java/discovery/contentful/utils/IntentConsts.java
// public class IntentConsts {
//   private IntentConsts() {
//   }
// 
//   public static final String PACKAGE_NAME = CFApp.getInstance().getPackageName();
// 
//   public static final String EXTRA_SPACE = PACKAGE_NAME + ".EXTRA_SPACE";
//   public static final String EXTRA_CREDENTIALS = PACKAGE_NAME + ".EXTRA_CREDENTIALS";
//   public static final String EXTRA_CONTENT_TYPE = PACKAGE_NAME + ".EXTRA_CONTENT_TYPE";
//   public static final String EXTRA_ENTRY = PACKAGE_NAME + ".EXTRA_ENTRY";
//   public static final String EXTRA_ASSET = PACKAGE_NAME + ".EXTRA_ASSET";
//   public static final String EXTRA_TEXT = PACKAGE_NAME + ".EXTRA_TEXT";
//   public static final String EXTRA_LOCATION = PACKAGE_NAME + ".EXTRA_LOCATION";
//   public static final String EXTRA_TITLE = PACKAGE_NAME + ".EXTRA_TITLE";
//   public static final String EXTRA_LIST = PACKAGE_NAME + ".EXTRA_LIST";
//   public static final String EXTRA_URL = PACKAGE_NAME + ".EXTRA_URL";
//   public static final String EXTRA_ALLOW_LINKS = PACKAGE_NAME + ".EXTRA_ALLOW_LINKS";
//   public static final String EXTRA_CONTENT_TYPES_MAP = PACKAGE_NAME + ".EXTRA_CONTENT_TYPES_MAP";
// 
//   /**
//    * DBIntentService
//    */
//   public static class DB {
//     public static final String ACTION_SAVE_CREDENTIALS = PACKAGE_NAME + ".ACTION_SAVE_CREDENTIALS";
//   }
// }


import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import discovery.contentful.R;
import discovery.contentful.adapters.SpacePagerAdapter;
import discovery.contentful.api.CFClient;
import discovery.contentful.utils.IntentConsts;
import com.contentful.java.cda.CDALocale;
import com.contentful.java.cda.CDASpace;
import java.util.ArrayList;
package discovery.contentful.activities;


public class SpaceActivity extends AbsTabsActivity {
  private CDASpace space;
  private SpacePagerAdapter adapter;

  @Override protected void initOnCreate(Bundle savedInstanceState) {
    space = (CDASpace) getIntent().getSerializableExtra(IntentConsts.EXTRA_SPACE);
  }

  @Override public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_space, menu);
    return true;
  }

// Path: app/src/main/java/discovery/contentful/adapters/SpacePagerAdapter.java
// public class SpacePagerAdapter extends FragmentPagerAdapter {
//   private final Context context;
//   private static final int COUNT = 2;
// 
//   public static final int TAB_POS_CONTENT_TYPES = 0;
//   public static final int TAB_POS_ASSETS = 1;
// 
//   private ContentTypesFragment contentTypesFragment;
//   private AssetsFragment assetsFragment;
// 
//   public SpacePagerAdapter(Context context, FragmentManager fm) {
//     super(fm);
//     this.context = context;
//   }
// 
//   @Override public int getCount() {
//     return COUNT;
//   }
// 
//   @Override public Fragment getItem(int position) {
//     switch (position) {
//       case TAB_POS_CONTENT_TYPES:
//         if (contentTypesFragment == null) {
//           contentTypesFragment = ContentTypesFragment.newInstance();
//         }
// 
//         return contentTypesFragment;
// 
//       case TAB_POS_ASSETS:
//         if (assetsFragment == null) {
//           assetsFragment = AssetsFragment.newInstance();
//         }
// 
//         return assetsFragment;
// 
//       default:
//         throw new IllegalStateException("Invalid adapter count");
//     }
//   }
// 
//   @Override public CharSequence getPageTitle(int position) {
//     switch (position) {
//       case 0:
//         return context.getString(R.string.tab_content_types);
// 
//       case 1:
//         return context.getString(R.string.tab_assets);
// 
//       default:
//         throw new IllegalStateException("Invalid adapter count");
//     }
//   }
// }
// 
// Path: app/src/main/java/discovery/contentful/api/CFClient.java
// public class CFClient {
//   private static CDAClient sInstance;
//   private static String locale;
// 
//   private CFClient() {
//   }
// 
//   /**
//    * Initialize this client.
//    *
//    * @param space String representing the Space key.
//    * @param token String representing the access token required to log in to the Space.
//    * @return {@link com.contentful.java.cda.CDAClient} instance.
//    */
//   public synchronized static CDAClient init(String space, String token) {
//     SharedPreferences prefs = CFPrefs.getInstance();
// 
//     prefs.edit()
//         .putString(CFPrefs.KEY_SPACE, space)
//         .putString(CFPrefs.KEY_ACCESS_TOKEN, token)
//         .apply();
// 
//     sInstance = CDAClient.builder().setSpace(space).setToken(token).build();
// 
//     locale = null;
// 
//     return sInstance;
//   }
// 
//   public synchronized static CDAClient getClient() {
//     if (sInstance == null) {
//       SharedPreferences prefs = CFPrefs.getInstance();
// 
//       String space = prefs.getString(CFPrefs.KEY_SPACE, null);
//       String token = prefs.getString(CFPrefs.KEY_ACCESS_TOKEN, null);
// 
//       if (StringUtils.isBlank(space) || StringUtils.isBlank(token)) {
//         throw new IllegalStateException("Uninitialized client.");
//       }
// 
//       return init(space, token);
//     }
// 
//     return sInstance;
//   }
// 
//   /**
//    * Set the locale for this client.
//    *
//    * @param locale String representing the Locale code.
//    */
//   public synchronized static void setLocale(String locale) {
//     CFClient.locale = locale;
//   }
// 
//   /**
//    * Gets the current locale defined for this client.
//    *
//    * @return String representing the current configured locale, null in case the default
//    * locale is being used.
//    */
//   public static String getLocale() {
//     return locale;
//   }
// }
// 
// Path: app/src/main/java/discovery/contentful/utils/IntentConsts.java
// public class IntentConsts {
//   private IntentConsts() {
//   }
// 
//   public static final String PACKAGE_NAME = CFApp.getInstance().getPackageName();
// 
//   public static final String EXTRA_SPACE = PACKAGE_NAME + ".EXTRA_SPACE";
//   public static final String EXTRA_CREDENTIALS = PACKAGE_NAME + ".EXTRA_CREDENTIALS";
//   public static final String EXTRA_CONTENT_TYPE = PACKAGE_NAME + ".EXTRA_CONTENT_TYPE";
//   public static final String EXTRA_ENTRY = PACKAGE_NAME + ".EXTRA_ENTRY";
//   public static final String EXTRA_ASSET = PACKAGE_NAME + ".EXTRA_ASSET";
//   public static final String EXTRA_TEXT = PACKAGE_NAME + ".EXTRA_TEXT";
//   public static final String EXTRA_LOCATION = PACKAGE_NAME + ".EXTRA_LOCATION";
//   public static final String EXTRA_TITLE = PACKAGE_NAME + ".EXTRA_TITLE";
//   public static final String EXTRA_LIST = PACKAGE_NAME + ".EXTRA_LIST";
//   public static final String EXTRA_URL = PACKAGE_NAME + ".EXTRA_URL";
//   public static final String EXTRA_ALLOW_LINKS = PACKAGE_NAME + ".EXTRA_ALLOW_LINKS";
//   public static final String EXTRA_CONTENT_TYPES_MAP = PACKAGE_NAME + ".EXTRA_CONTENT_TYPES_MAP";
// 
//   /**
//    * DBIntentService
//    */
//   public static class DB {
//     public static final String ACTION_SAVE_CREDENTIALS = PACKAGE_NAME + ".ACTION_SAVE_CREDENTIALS";
//   }
// }


// Path: app/src/main/java/discovery/contentful/activities/SpaceActivity.java
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import discovery.contentful.R;
import discovery.contentful.adapters.SpacePagerAdapter;
import discovery.contentful.api.CFClient;
import discovery.contentful.utils.IntentConsts;
import com.contentful.java.cda.CDALocale;
import com.contentful.java.cda.CDASpace;
import java.util.ArrayList;

package discovery.contentful.activities;


public class SpaceActivity extends AbsTabsActivity {
  private CDASpace space;
  private SpacePagerAdapter adapter;

  @Override protected void initOnCreate(Bundle savedInstanceState) {
    space = (CDASpace) getIntent().getSerializableExtra(IntentConsts.EXTRA_SPACE);
  }

  @Override public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_space, menu);
    return true;
  }

  @Override public boolean onOptionsItemSelected(MenuItem item) {