Fix icons in TouchControlsEditing
This commit is contained in:
parent
82c24fc4cb
commit
98d60887b2
2 changed files with 12 additions and 6 deletions
|
@ -114,7 +114,7 @@ public class Settings {
|
||||||
if (!d.exists())
|
if (!d.exists())
|
||||||
d.mkdirs();
|
d.mkdirs();
|
||||||
else
|
else
|
||||||
return;
|
return; // Note: if you move it back to <datadir>/files, disable this as it may exist
|
||||||
|
|
||||||
AssetManager assetManager = ctx.getAssets();
|
AssetManager assetManager = ctx.getAssets();
|
||||||
String[] files = null;
|
String[] files = null;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import in.celest.xash3d.hl.R;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -131,11 +132,16 @@ public class TouchControlsEditing {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
String png = activity.getFilesDir() + "/" + ci.image + ".png";
|
//String png = activity.getFilesDir() + "/" + ci.image + ".png";
|
||||||
Log.d(TAG,"png = " + png);
|
//Log.d(TAG,"png = " + png);
|
||||||
BitmapDrawable bm = new BitmapDrawable(png);
|
//BitmapDrawable bm = new BitmapDrawable(png);
|
||||||
|
try
|
||||||
image.setImageDrawable(bm);
|
{
|
||||||
|
image.setImageDrawable(Drawable.createFromStream(context.getAssets().open(ci.image + ".png"), null));
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue