Fix icons in TouchControlsEditing

This commit is contained in:
mittorn 2015-09-05 02:14:52 +07:00
parent 82c24fc4cb
commit 98d60887b2
2 changed files with 12 additions and 6 deletions

View file

@ -114,7 +114,7 @@ public class Settings {
if (!d.exists())
d.mkdirs();
else
return;
return; // Note: if you move it back to <datadir>/files, disable this as it may exist
AssetManager assetManager = ctx.getAssets();
String[] files = null;

View file

@ -4,6 +4,7 @@ import in.celest.xash3d.hl.R;
import android.app.Activity;
import android.app.Dialog;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
@ -131,11 +132,16 @@ public class TouchControlsEditing {
}
});
String png = activity.getFilesDir() + "/" + ci.image + ".png";
Log.d(TAG,"png = " + png);
BitmapDrawable bm = new BitmapDrawable(png);
image.setImageDrawable(bm);
//String png = activity.getFilesDir() + "/" + ci.image + ".png";
//Log.d(TAG,"png = " + png);
//BitmapDrawable bm = new BitmapDrawable(png);
try
{
image.setImageDrawable(Drawable.createFromStream(context.getAssets().open(ci.image + ".png"), null));
}
catch(Exception e)
{
}
return convertView;
}