mirror of
https://github.com/etlegacy/etlegacy-android.git
synced 2024-11-10 06:52:06 +00:00
java: remove absolete functions for getting images from assets dir
This commit is contained in:
parent
9998d3f61d
commit
7e9d54f2db
2 changed files with 0 additions and 38 deletions
|
@ -328,24 +328,6 @@ public class ETLActivity extends SDLActivity implements JoyStickListener {
|
||||||
return (int) (px / Resources.getSystem().getDisplayMetrics().density);
|
return (int) (px / Resources.getSystem().getDisplayMetrics().density);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get an image stored from Asset Dir of an App
|
|
||||||
* @param strName name of the image to get
|
|
||||||
* @return "resized" image
|
|
||||||
*/
|
|
||||||
private Bitmap getBitmapFromAsset(String strName) {
|
|
||||||
AssetManager assetManager = getAssets();
|
|
||||||
InputStream istr = null;
|
|
||||||
try {
|
|
||||||
istr = assetManager.open(strName);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Bitmap bitmap = BitmapFactory.decodeStream(istr);
|
|
||||||
Bitmap resized = Bitmap.createScaledBitmap(bitmap, 80, 80, true);
|
|
||||||
return resized;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(final Bundle savedInstanceState) {
|
protected void onCreate(final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
|
@ -30,26 +30,6 @@ import cz.msebera.android.httpclient.Header;
|
||||||
|
|
||||||
public class ETLMain extends Activity {
|
public class ETLMain extends Activity {
|
||||||
|
|
||||||
/**
|
|
||||||
* Get an splash screen image from Asset Dir of an App
|
|
||||||
* @param strName name of the splash screen image
|
|
||||||
* @return image
|
|
||||||
*/
|
|
||||||
private Drawable getSplashScreenFromAsset(String strName) {
|
|
||||||
AssetManager assetManager = getAssets();
|
|
||||||
InputStream istr = null;
|
|
||||||
try {
|
|
||||||
istr = assetManager.open(strName);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
// It somehow looks ugly and expensive, find a better solution
|
|
||||||
Bitmap bitmap = BitmapFactory.decodeStream(istr);
|
|
||||||
Drawable etl_drawable = new BitmapDrawable(getResources(), bitmap);
|
|
||||||
return etl_drawable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy InputStream to a File.
|
* Copy InputStream to a File.
|
||||||
* @param in inputstream to be saved
|
* @param in inputstream to be saved
|
||||||
|
|
Loading…
Reference in a new issue