handler) {
50 | Bitmap bt = readImg(media);
51 | if (bt == null) {
52 | LoadImgThread thread = new LoadImgThread(media, handler);
53 | threadPool.execute(thread);
54 | } else {
55 | if (handler != null) {
56 | handler.process(new VIPMediaBitmap(bt, media));
57 | }
58 | }
59 | }
60 |
61 | public static Bitmap readImg(VIPMedia media) {
62 | return ImageBuffer.readImg(media);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/com/mx/vipmediaplayer/util/MethodHandler.java:
--------------------------------------------------------------------------------
1 | package com.mx.vipmediaplayer.util;
2 |
3 | /**
4 | * Method Handler class
5 | *
6 | * @author Xiao Mei
7 | * @weibo http://weibo.com/u/1675796095
8 | * @email tss_chs@126.com
9 | *
10 | */
11 | public interface MethodHandler {
12 | public void process(P para);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/com/mx/vipmediaplayer/util/PinyinUtils.java:
--------------------------------------------------------------------------------
1 | package com.mx.vipmediaplayer.util;
2 |
3 | import net.sourceforge.pinyin4j.PinyinHelper;
4 | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
5 | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
6 | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
7 | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
8 |
9 | /**
10 | * Pinyi Utils class
11 | *
12 | * @author Xiao Mei
13 | * @weibo http://weibo.com/u/1675796095
14 | * @email tss_chs@126.com
15 | *
16 | */
17 | public final class PinyinUtils {
18 |
19 | private static HanyuPinyinOutputFormat spellFormat = new HanyuPinyinOutputFormat();
20 |
21 | static {
22 | spellFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
23 | spellFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
24 | //spellFormat.setVCharType(HanyuPinyinVCharType.WITH_V);
25 | }
26 |
27 | public static String chineneToSpell(String chineseStr) throws BadHanyuPinyinOutputFormatCombination {
28 | StringBuffer result = new StringBuffer();
29 | for (char c : chineseStr.toCharArray()) {
30 | if (c > 128) {
31 | String[] array = PinyinHelper.toHanyuPinyinStringArray(c, spellFormat);
32 | if (array != null && array.length > 0)
33 | result.append(array[0]);
34 | else
35 | result.append(" ");
36 | } else
37 | result.append(c);
38 | }
39 | return result.toString();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/com/mx/vipmediaplayer/util/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.mx.vipmediaplayer.util;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.ArrayList;
5 | import java.util.Date;
6 |
7 | /**
8 | * String Utils class
9 | *
10 | * @author Xiao Mei
11 | * @weibo http://weibo.com/u/1675796095
12 | * @email tss_chs@126.com
13 | *
14 | */
15 | public class StringUtils {
16 | private static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd";
17 | private static final String DEFAULT_DATETIME_PATTERN = "yyyy-MM-dd hh:mm:ss";
18 | public final static String EMPTY = "";
19 |
20 | /**
21 | * 格式化日期字符串
22 | *
23 | * @param date
24 | * @param pattern
25 | * @return
26 | */
27 | public static String formatDate(Date date, String pattern) {
28 | SimpleDateFormat format = new SimpleDateFormat(pattern);
29 | return format.format(date);
30 | }
31 |
32 | /**
33 | * 格式化日期字符串
34 | *
35 | * @param date
36 | * @return 例如2011-3-24
37 | */
38 | public static String formatDate(Date date) {
39 | return formatDate(date, DEFAULT_DATE_PATTERN);
40 | }
41 |
42 | /**
43 | * 获取当前时间 格式为yyyy-MM-dd 例如2011-07-08
44 | *
45 | * @return
46 | */
47 | public static String getDate() {
48 | return formatDate(new Date(), DEFAULT_DATE_PATTERN);
49 | }
50 |
51 | /**
52 | * 获取当前时间
53 | *
54 | * @return
55 | */
56 | public static String getDateTime() {
57 | return formatDate(new Date(), DEFAULT_DATETIME_PATTERN);
58 | }
59 |
60 | /**
61 | * 格式化日期时间字符串
62 | *
63 | * @param date
64 | * @return 例如2011-11-30 16:06:54
65 | */
66 | public static String formatDateTime(Date date) {
67 | return formatDate(date, DEFAULT_DATETIME_PATTERN);
68 | }
69 |
70 | public static String join(final ArrayList array, String separator) {
71 | StringBuffer result = new StringBuffer();
72 | if (array != null && array.size() > 0) {
73 | for (String str : array) {
74 | result.append(str);
75 | result.append(separator);
76 | }
77 | result.delete(result.length() - 1, result.length());
78 | }
79 | return result.toString();
80 | }
81 |
82 | public static boolean isEmpty(String str) {
83 | return str == null || str.length() == 0;
84 | }
85 |
86 | // public static String trim(String str) {
87 | // if (IsUtil.isNullOrEmpty(str)) {
88 | // return "";
89 | // }
90 | // return str.trim();
91 | // }
92 | //
93 | // /** 将中文转换成unicode编码 */
94 | // public static String gbEncoding(final String gbString) {
95 | // char[] utfBytes = gbString.toCharArray();
96 | // String unicodeBytes = "";
97 | // for (char utfByte : utfBytes) {
98 | // String hexB = Integer.toHexString(utfByte);
99 | // if (hexB.length() <= 2) {
100 | // hexB = "00" + hexB;
101 | // }
102 | // unicodeBytes = unicodeBytes + "\\u" + hexB;
103 | // }
104 | // //System.out.println("unicodeBytes is: " + unicodeBytes);
105 | // return unicodeBytes;
106 | // }
107 | //
108 | // /** 将unicode编码转换成中�?*/
109 | // public static String decodeUnicode(final String dataStr) {
110 | // int start = 0;
111 | // int end = 0;
112 | // final StringBuffer buffer = new StringBuffer();
113 | // while (start > -1) {
114 | // end = dataStr.indexOf("\\u", start + 2);
115 | // String charStr = "";
116 | // if (end == -1) {
117 | // charStr = dataStr.substring(start + 2, dataStr.length());
118 | // } else {
119 | // charStr = dataStr.substring(start + 2, end);
120 | // }
121 | // char letter = (char) Integer.parseInt(charStr, 16); // 16进制parse整形字符串�?
122 | // buffer.append(new Character(letter).toString());
123 | // start = end;
124 | // }
125 | // //System.out.println(buffer.toString());
126 | // return buffer.toString();
127 | // }
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/src/io/vov/vitamio/.svn/all-wcprops:
--------------------------------------------------------------------------------
1 | K 25
2 | svn:wc:ra_dav:version-url
3 | V 56
4 | /svn/oplayer/!svn/ver/8/trunk/OPlayer/src/io/vov/vitamio
5 | END
6 | R.java
7 | K 25
8 | svn:wc:ra_dav:version-url
9 | V 63
10 | /svn/oplayer/!svn/ver/8/trunk/OPlayer/src/io/vov/vitamio/R.java
11 | END
12 |
--------------------------------------------------------------------------------
/src/io/vov/vitamio/.svn/entries:
--------------------------------------------------------------------------------
1 | 10
2 |
3 | dir
4 | 11
5 | http://code.taobao.org/svn/oplayer/trunk/OPlayer/src/io/vov/vitamio
6 | http://code.taobao.org/svn/oplayer
7 |
8 |
9 |
10 | 2012-11-07T09:11:36.592339Z
11 | 8
12 | over140@gmail.com
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 11631169-8b53-4088-bc37-abf19808aea1
28 |
29 | R.java
30 | file
31 |
32 |
33 |
34 |
35 | 2013-07-19T13:52:20.234375Z
36 | a821d8bb44a90d63c0dd58d478818128
37 | 2012-11-07T09:11:36.592339Z
38 | 8
39 | over140@gmail.com
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | 206
62 |
63 | widget
64 | dir
65 |
66 |
--------------------------------------------------------------------------------
/src/io/vov/vitamio/.svn/text-base/R.java.svn-base:
--------------------------------------------------------------------------------
1 | package io.vov.vitamio;
2 |
3 | public class R {
4 | public static final class raw {
5 | public static final int libarm = com.nmbb.oplayer.R.raw.libarm;
6 | public static final int pub = com.nmbb.oplayer.R.raw.pub;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/io/vov/vitamio/R.java:
--------------------------------------------------------------------------------
1 | package io.vov.vitamio;
2 |
3 | public class R {
4 | public static final class raw {
5 | public static final int libarm = com.mx.vipmediaplayer.R.raw.libarm;
6 | public static final int pub = com.mx.vipmediaplayer.R.raw.pub;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/io/vov/vitamio/activity/InitActivity.java:
--------------------------------------------------------------------------------
1 | package io.vov.vitamio.activity;
2 |
3 | import io.vov.vitamio.Vitamio;
4 | import android.app.Activity;
5 | import android.app.ProgressDialog;
6 | import android.content.Intent;
7 | import android.os.AsyncTask;
8 | import android.os.Bundle;
9 | import android.os.Handler;
10 | import android.os.Message;
11 | import android.view.WindowManager;
12 |
13 | import com.mx.vipmediaplayer.R;
14 |
15 | public class InitActivity extends Activity {
16 | public static final String FROM_ME = "fromVitamioInitActivity";
17 | public static final String EXTRA_MSG = "EXTRA_MSG";
18 | public static final String EXTRA_FILE = "EXTRA_FILE";
19 | private ProgressDialog mPD;
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
25 |
26 | new AsyncTask