// Path: app/src/main/java/com/didikee/cnbetareader/utils/MD5.java
// public class MD5 {
//     public static String md5(String content){
//         byte[] result;
//         try {
//             MessageDigest messageDigest = MessageDigest.getInstance("MD5");
//             messageDigest.update(content.getBytes("UTF-8"));
//             result = messageDigest.digest();
//         } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
//             return "";
//         }
//         return byte2Hex(result);
//     }
//     private static String byte2Hex(byte[] bytes) {
//         StringBuilder sb = new StringBuilder();
//         for (byte b: bytes) {
//             String hex = Integer.toHexString(b & 0xFF);
//             if (hex.length() == 1) {
//                 hex = "0" + hex;   // one byte to double-digit hex
//             }
//             sb.append(hex);
//         }
//         return sb.toString();
//     }
// }


import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Environment;
import android.text.Html.ImageGetter;
import android.widget.TextView;
import com.didikee.cnbetareader.R;
import com.didikee.cnbetareader.utils.MD5;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
package com.didikee.cnbetareader.test;




public class MyImageGetter implements ImageGetter {
	
	private Context context;
	private TextView tv;
	
	public MyImageGetter(Context context, TextView tv) {
		this.context = context;
		this.tv = tv;
	}
	
	@Override
	public Drawable getDrawable(String source) {

// Path: app/src/main/java/com/didikee/cnbetareader/utils/MD5.java
// public class MD5 {
//     public static String md5(String content){
//         byte[] result;
//         try {
//             MessageDigest messageDigest = MessageDigest.getInstance("MD5");
//             messageDigest.update(content.getBytes("UTF-8"));
//             result = messageDigest.digest();
//         } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
//             return "";
//         }
//         return byte2Hex(result);
//     }
//     private static String byte2Hex(byte[] bytes) {
//         StringBuilder sb = new StringBuilder();
//         for (byte b: bytes) {
//             String hex = Integer.toHexString(b & 0xFF);
//             if (hex.length() == 1) {
//                 hex = "0" + hex;   // one byte to double-digit hex
//             }
//             sb.append(hex);
//         }
//         return sb.toString();
//     }
// }


// Path: app/src/main/java/com/didikee/cnbetareader/test/MyImageGetter.java
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Environment;
import android.text.Html.ImageGetter;
import android.widget.TextView;
import com.didikee.cnbetareader.R;
import com.didikee.cnbetareader.utils.MD5;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

package com.didikee.cnbetareader.test;




public class MyImageGetter implements ImageGetter {
	
	private Context context;
	private TextView tv;
	
	public MyImageGetter(Context context, TextView tv) {
		this.context = context;
		this.tv = tv;
	}
	
	@Override
	public Drawable getDrawable(String source) {

		String imageName = MD5.md5(source);