Attempt to avoid some contextual issues with info display

This commit is contained in:
TwistedUmbrella 2014-05-20 12:10:50 -04:00
parent 45a3cff0d5
commit 1d3a0a633b
3 changed files with 9 additions and 13 deletions

View File

@ -290,9 +290,7 @@ public class FileBrowser extends Fragment {
final View childview = parentActivity.getLayoutInflater().inflate(
R.layout.app_list_item, null, false);
final boolean webInfo = mPrefs.getBoolean(Config.pref_gamedetails, false);
final XMLParser xmlParser = new XMLParser(game, index, webInfo);
final XMLParser xmlParser = new XMLParser(game, index, mPrefs);
xmlParser.setViewParent(parentActivity, childview);
xmlParser.execute(game.getName());
@ -304,7 +302,7 @@ public class FileBrowser extends Fragment {
new OnClickListener() {
public void onClick(View view) {
vib.vibrate(50);
if (webInfo) {
if (mPrefs.getBoolean(Config.pref_gamedetails, false)) {
final AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setCancelable(true);
builder.setTitle(getString(R.string.game_details,

View File

@ -519,11 +519,6 @@ public class MainActivity extends SlidingFragmentActivity implements
menuHeading.setText(title);
}
/**
* When using the ActionBarDrawerToggle, you must call it during
* onPostCreate() and onConfigurationChanged()...
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

View File

@ -27,7 +27,10 @@ import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.reicast.emulator.config.Config;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
@ -44,7 +47,7 @@ import android.widget.TextView;
public class XMLParser extends AsyncTask<String, Integer, String> {
private boolean webInfo;
private SharedPreferences mPrefs;
private File game;
private int index;
private View childview;
@ -56,8 +59,8 @@ public class XMLParser extends AsyncTask<String, Integer, String> {
public SparseArray<String> game_details = new SparseArray<String>();
public SparseArray<Bitmap> game_preview = new SparseArray<Bitmap>();
public XMLParser(File game, int index, boolean webInfo) {
this.webInfo = webInfo;
public XMLParser(File game, int index, SharedPreferences mPrefs) {
this.mPrefs = mPrefs;
this.game = game;
this.index = index;
}
@ -114,7 +117,7 @@ public class XMLParser extends AsyncTask<String, Integer, String> {
@Override
protected String doInBackground(String... params) {
String filename = game_name = params[0];
if (isNetworkAvailable() && webInfo) {
if (isNetworkAvailable() && mPrefs.getBoolean(Config.pref_gamedetails, false)) {
if (params[0].contains("[")) {
filename = params[0].substring(0, params[0].lastIndexOf("["));
} else {