`
chjmars
  • 浏览: 76138 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
  Spannable span = (Spannable) textView.getText(); TextAppearanceSpan textappearancespan = new TextAppearanceSpan( mcontext, R.style.SynonyText); span.setSpan(textappearancespan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);  SynonyText为Styles.xml设置的属性(颜色,字体,大小等等); 注意: TextView的Buffer ...
  public static boolean isEnglish(String word) { boolean isEnglish = false; for (int i = 0; i < word.length(); i++) { if (word.charAt(i) >= 0x0000 && word.charAt(i) <= 0x00ff) { isEnglish = true; } else { isEnglish = false; break; } } return isEngl ...
  public static boolean isChinese(String word) { boolean isChinese = false; for (int i = 0; i < word.length(); i++) { if (word.charAt(i) >= 0x0391 && word.charAt(i) <= 0xffe5) { isChinese = true; } else { isChinese = false; break; } } return isChin ...
  public static final String HALFANDFULLHORNSYMBOLS = "[-,/,|,$,+,%,&,',(,),*," + "\\x20-\\x2f,\\x3a-\\x40,\\x5b-\\x60,\\x7b-\\x7e,\\x80-\\xff," + "\u3000-\u3002,\u300a,\u300b,\u300e-\u3011,\u2014,\u2018,\u2019," + "\u201c,\u201d,\u2026,\u203b,\u25c ...
  private String stringFormatterTime(int timeMs) { int totalSeconds = timeMs / 1000; int s = totalSeconds % 60; int m = (totalSeconds / 60) % 60; int h = totalSeconds / 3600; StringBuffer formatterBuffer = new StringBuffer(); Formatter formatter = new Formatter(formatterBuffer, Loc ...
检查SDcard是否存在:   private boolean checkSDCard() { if (Environment.MEDIA_MOUNTED.equals(Environment .getExternalStorageState()) && Environment.getExternalStorageDirectory().canWrite()) { return true; } else return false; }  录音:   public void recording() { if (checkSDCard() ...
  public class SimpleMenuView extends RelativeLayout implements OnClickListener { private Context mContext; public SimpleMenuView(Context context) { super(context); mContext = context; } public SimpleMenuView(Context context, AttributeSet attrs) { super(context, attrs); mCo ...
  public static Bitmap getRoundedCornerBitmap(Bitmap bitmap) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); ...
Global site tag (gtag.js) - Google Analytics