// Path: WhatAndroid/src/main/java/what/whatandroid/WhatApplication.java
// public class WhatApplication extends Application {
// 
// 	//TODO: Developers put your local Gazelle install IP here instead of testing on the live site
// 	//I recommend setting up with Vagrant: https://github.com/dr4g0nnn/VagrantGazelle
// 	public static final String DEFAULT_SITE = "";
// 
// 	@Override
// 	public void onCreate() {
// 		super.onCreate();
// 
// 		initSoup(DEFAULT_SITE);
// 		if (SettingsActivity.lightThemeEnabled(getApplicationContext())) {
// 			AppCompatDelegate.setDefaultNightMode(
// 					AppCompatDelegate.MODE_NIGHT_NO);
// 		} else {
// 			AppCompatDelegate.setDefaultNightMode(
// 					AppCompatDelegate.MODE_NIGHT_YES);
// 		}
// 	}
// 
// 	/**
// 	 * Initialize MySoup so that we can start making API requests
// 	 */
// 	public void initSoup(String site) {
// 		MySoup.setSite(site, true);
// 		MySoup.setUserAgent("WhatAndroid Android");
// 	}
// 
// 	/**
// 	 * Main method for all image displaying operations
// 	 * Fail tracking is done here instead of wherever this method is called from.
// 	 */
// 
// 	public static void loadImage(Context context, final String url, final ImageView imageView, final ProgressBar spinner, final ImageLoadFailTracker failTracker, final Integer failImage) {
// 
// 		if (failTracker != null && failTracker.failed(url)) {
// 			if (spinner != null) spinner.setVisibility(View.GONE);
// 			if (failImage != null) {
// 				imageView.setImageResource(failImage);
// 			} else {
// 				imageView.setImageResource(R.drawable.no_artwork);
// 			}
// 		} else {
// 			if (spinner != null) spinner.setVisibility(View.VISIBLE);
// 			Glide.with(context)
// 					.load(url)
// 					.listener(new RequestListener<String, GlideDrawable>() {
// 						@Override
// 						public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
// 							if (spinner != null) {
// 								spinner.setVisibility(View.GONE);
// 							}
// 							if (failTracker != null) {
// 								failTracker.addFailed(url);
// 							}
// 							if (failImage != null) {
// 								imageView.setImageResource(failImage);
// 							} else {
// 								imageView.setImageResource(R.drawable.no_artwork);
// 							}
// 							return true;
// 						}
// 
// 						@Override
// 						public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
// 							if (spinner != null) {
// 								spinner.setVisibility(View.GONE);
// 							}
// //                            imageView.setImageDrawable(resource);
// 							return false;
// 						}
// 					})
// 					.into(imageView);
// 		}
// 
// 	}
// 
// }
// 
// Path: WhatAndroid/src/main/java/what/whatandroid/callbacks/ViewArtistCallbacks.java
// public interface ViewArtistCallbacks {
// 	/**
// 	 * Launch an artists activity viewing the artist
// 	 *
// 	 * @param id artist id to view
// 	 */
// 	public void viewArtist(int id);
// }


import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.util.List;
import api.torrents.torrents.Artist;
import api.torrents.torrents.EditionTorrents;
import api.torrents.torrents.MusicInfo;
import api.torrents.torrents.TorrentGroup;
import what.whatandroid.R;
import what.whatandroid.WhatApplication;
import what.whatandroid.callbacks.LoadingListener;
import what.whatandroid.callbacks.SetTitleCallback;
import what.whatandroid.callbacks.ViewArtistCallbacks;
import what.whatandroid.settings.SettingsActivity;
import what.whatandroid.views.ImageDialog;
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.expandable_list_view, container, false);
		torrentList = (ExpandableListView) view.findViewById(R.id.exp_list);

		View imageHeader = inflater.inflate(R.layout.header_image, null);
		image = (ImageView) imageHeader.findViewById(R.id.image);
		spinner = (ProgressBar) imageHeader.findViewById(R.id.loading_indicator);
		image.setOnClickListener(this);
		artContainer = imageHeader.findViewById(R.id.art_container);

		View titleHeader = inflater.inflate(R.layout.header_album_title, null);
		artistA = (TextView) titleHeader.findViewById(R.id.artist_a);
		artistB = (TextView) titleHeader.findViewById(R.id.artist_b);
		albumTitle = (TextView) titleHeader.findViewById(R.id.title);

		torrentList.addHeaderView(imageHeader);
		torrentList.addHeaderView(titleHeader, null, false);
		if (group != null) {
			populateViews();
		}
		return view;
	}

	/**
	 * When the image in the header is clicked toggle expand/hide on it
	 */
	@Override
	public void onClick(View v) {
		if (group != null) {
			if (v.getId() == R.id.image) {
// Path: WhatAndroid/src/main/java/what/whatandroid/WhatApplication.java
// public class WhatApplication extends Application {
// 
// 	//TODO: Developers put your local Gazelle install IP here instead of testing on the live site
// 	//I recommend setting up with Vagrant: https://github.com/dr4g0nnn/VagrantGazelle
// 	public static final String DEFAULT_SITE = "";
// 
// 	@Override
// 	public void onCreate() {
// 		super.onCreate();
// 
// 		initSoup(DEFAULT_SITE);
// 		if (SettingsActivity.lightThemeEnabled(getApplicationContext())) {
// 			AppCompatDelegate.setDefaultNightMode(
// 					AppCompatDelegate.MODE_NIGHT_NO);
// 		} else {
// 			AppCompatDelegate.setDefaultNightMode(
// 					AppCompatDelegate.MODE_NIGHT_YES);
// 		}
// 	}
// 
// 	/**
// 	 * Initialize MySoup so that we can start making API requests
// 	 */
// 	public void initSoup(String site) {
// 		MySoup.setSite(site, true);
// 		MySoup.setUserAgent("WhatAndroid Android");
// 	}
// 
// 	/**
// 	 * Main method for all image displaying operations
// 	 * Fail tracking is done here instead of wherever this method is called from.
// 	 */
// 
// 	public static void loadImage(Context context, final String url, final ImageView imageView, final ProgressBar spinner, final ImageLoadFailTracker failTracker, final Integer failImage) {
// 
// 		if (failTracker != null && failTracker.failed(url)) {
// 			if (spinner != null) spinner.setVisibility(View.GONE);
// 			if (failImage != null) {
// 				imageView.setImageResource(failImage);
// 			} else {
// 				imageView.setImageResource(R.drawable.no_artwork);
// 			}
// 		} else {
// 			if (spinner != null) spinner.setVisibility(View.VISIBLE);
// 			Glide.with(context)
// 					.load(url)
// 					.listener(new RequestListener<String, GlideDrawable>() {
// 						@Override
// 						public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
// 							if (spinner != null) {
// 								spinner.setVisibility(View.GONE);
// 							}
// 							if (failTracker != null) {
// 								failTracker.addFailed(url);
// 							}
// 							if (failImage != null) {
// 								imageView.setImageResource(failImage);
// 							} else {
// 								imageView.setImageResource(R.drawable.no_artwork);
// 							}
// 							return true;
// 						}
// 
// 						@Override
// 						public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
// 							if (spinner != null) {
// 								spinner.setVisibility(View.GONE);
// 							}
// //                            imageView.setImageDrawable(resource);
// 							return false;
// 						}
// 					})
// 					.into(imageView);
// 		}
// 
// 	}
// 
// }
// 
// Path: WhatAndroid/src/main/java/what/whatandroid/callbacks/ViewArtistCallbacks.java
// public interface ViewArtistCallbacks {
// 	/**
// 	 * Launch an artists activity viewing the artist
// 	 *
// 	 * @param id artist id to view
// 	 */
// 	public void viewArtist(int id);
// }


// Path: WhatAndroid/src/main/java/what/whatandroid/torrentgroup/group/TorrentGroupOverviewFragment.java
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.util.List;
import api.torrents.torrents.Artist;
import api.torrents.torrents.EditionTorrents;
import api.torrents.torrents.MusicInfo;
import api.torrents.torrents.TorrentGroup;
import what.whatandroid.R;
import what.whatandroid.WhatApplication;
import what.whatandroid.callbacks.LoadingListener;
import what.whatandroid.callbacks.SetTitleCallback;
import what.whatandroid.callbacks.ViewArtistCallbacks;
import what.whatandroid.settings.SettingsActivity;
import what.whatandroid.views.ImageDialog;

	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.expandable_list_view, container, false);
		torrentList = (ExpandableListView) view.findViewById(R.id.exp_list);

		View imageHeader = inflater.inflate(R.layout.header_image, null);
		image = (ImageView) imageHeader.findViewById(R.id.image);
		spinner = (ProgressBar) imageHeader.findViewById(R.id.loading_indicator);
		image.setOnClickListener(this);
		artContainer = imageHeader.findViewById(R.id.art_container);

		View titleHeader = inflater.inflate(R.layout.header_album_title, null);
		artistA = (TextView) titleHeader.findViewById(R.id.artist_a);
		artistB = (TextView) titleHeader.findViewById(R.id.artist_b);
		albumTitle = (TextView) titleHeader.findViewById(R.id.title);

		torrentList.addHeaderView(imageHeader);
		torrentList.addHeaderView(titleHeader, null, false);
		if (group != null) {
			populateViews();
		}
		return view;
	}

	/**
	 * When the image in the header is clicked toggle expand/hide on it
	 */
	@Override
	public void onClick(View v) {
		if (group != null) {
			if (v.getId() == R.id.image) {
				ImageDialog dialog = ImageDialog.newInstance(group.getResponse().getGroup().getWikiImage());