// Path: app/src/main/java/com/tos_bot/utility/FileLoader.java
// public class FileLoader {
// 	private static Context ctx = null;
// 	private FileLoader(){
// 		
// 	}
// 	static public void setContext(Context c){
// 		ctx = c;
// 	}
// 	
// 	static public InputStream getFileStreamByAsset(String path){
// 		assert(ctx!=null);
// 		AssetManager am = ctx.getAssets();
// 		try {
// 			return am.open(path);
// 		} catch (IOException e) {
// 			// TODO Auto-generated catch block
// 			e.printStackTrace();
// 			return null;
// 		}
// 	}
// }


import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.ImageButton;
import com.tos_bot.utility.FileLoader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
package com.tos_bot.ui;



/**
 * Created by Sean.
 */
public abstract class TosImageButton extends ImageButton{
    public TosImageButton(Context context) {
        super(context);
    }

    protected Bitmap resizeImage(Bitmap srcImage, double ratio){
       return srcImage;
    	/*
    	return Bitmap.createScaledBitmap(
                srcImage,
                (int) (srcImage.getWidth() * ratio),
                (int) (srcImage.getHeight() * ratio),
                false);
                */
    }

    protected Bitmap getBitmapByFilename(String filename, double ratio) {
// Path: app/src/main/java/com/tos_bot/utility/FileLoader.java
// public class FileLoader {
// 	private static Context ctx = null;
// 	private FileLoader(){
// 		
// 	}
// 	static public void setContext(Context c){
// 		ctx = c;
// 	}
// 	
// 	static public InputStream getFileStreamByAsset(String path){
// 		assert(ctx!=null);
// 		AssetManager am = ctx.getAssets();
// 		try {
// 			return am.open(path);
// 		} catch (IOException e) {
// 			// TODO Auto-generated catch block
// 			e.printStackTrace();
// 			return null;
// 		}
// 	}
// }


// Path: app/src/main/java/com/tos_bot/ui/TosImageButton.java
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.ImageButton;
import com.tos_bot.utility.FileLoader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

package com.tos_bot.ui;



/**
 * Created by Sean.
 */
public abstract class TosImageButton extends ImageButton{
    public TosImageButton(Context context) {
        super(context);
    }

    protected Bitmap resizeImage(Bitmap srcImage, double ratio){
       return srcImage;
    	/*
    	return Bitmap.createScaledBitmap(
                srcImage,
                (int) (srcImage.getWidth() * ratio),
                (int) (srcImage.getHeight() * ratio),
                false);
                */
    }

    protected Bitmap getBitmapByFilename(String filename, double ratio) {
        FileLoader.setContext(this.getContext());