Skip to content

Commit

Permalink
front: Hopefully fixed crash when editing active video plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
fzurita committed Feb 14, 2016
1 parent 0be7228 commit 9f15159
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Expand Up @@ -274,7 +274,6 @@ public void deserialize( String s )
if( s != null )
{
int psuedoId = -100;
Log.v("PlayerMap", "Deserializing: " + s);

// Read the input mappings
String[] pairs = s.split( "," );
Expand Down
Expand Up @@ -154,21 +154,23 @@ protected void refreshViews()

String openGlVersion = AppData.getOpenGlEsVersion(this);

if(openGlVersion.equals("2.0"))
{
mScreenRoot.removePreference(mPreferenceVideoSubPlugin);
}
else if(openGlVersion.equals("3.0"))
if(mPreferenceVideoSubPlugin != null)
{
mPreferenceVideoSubPlugin.setEntries(new String[]{
getString(R.string.videoSubPlugin_entryGles20),
getString(R.string.videoSubPlugin_entryGles30)
});
mPreferenceVideoSubPlugin.setEntryValues(new String[]{
"-gles20",
"-gles30"});
if(openGlVersion.equals("2.0"))
{
mScreenRoot.removePreference(mPreferenceVideoSubPlugin);
}
else if(openGlVersion.equals("3.0"))
{
mPreferenceVideoSubPlugin.setEntries(new String[]{
getString(R.string.videoSubPlugin_entryGles20),
getString(R.string.videoSubPlugin_entryGles30)
});
mPreferenceVideoSubPlugin.setEntryValues(new String[]{
"-gles20",
"-gles30"});
}
}


// Get the current values
String videoPlugin = mPrefs.getString( VIDEO_PLUGIN, null );
Expand Down Expand Up @@ -257,7 +259,7 @@ else if(openGlVersion.equals("3.0"))
}
}

if(mPreferenceVideoSubPlugin != null)
if(mPreferenceVideoSubPlugin != null && !openGlVersion.equals("2.0"))
{
if( videoPlugin.contains( "%1$s" ) )
mScreenRoot.addPreference( mPreferenceVideoSubPlugin );
Expand Down
Expand Up @@ -45,7 +45,6 @@
import android.support.v4.app.FragmentManager;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -509,6 +508,6 @@ public View getView( int position, View convertView, ViewGroup parent )
protected void RemoveProfile(String profileName)
{
Profile profile = new Profile(true, profileName, null);
boolean test = mProfileList.remove(profile);
mProfileList.remove(profile);
}
}

0 comments on commit 9f15159

Please sign in to comment.