This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mp.setOnInfoListener(new OnInfoListener() { | |
@Override | |
public boolean onInfo(MediaPlayer mp, int what, int extra) { | |
if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) { | |
loadingDialog.setVisibility(View.VISIBLE); | |
} else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) { | |
loadingDialog.setVisibility(View.GONE); | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.terrynow.common; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Locale; | |
/** | |
* @author Terry E-mail: yaoxinghuo at 126 dot com | |
* @date Aug 19, 2013 9:54:05 AM | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void setDefaultFont() { | |
try { | |
final Typeface bold = Typeface.createFromAsset(getAssets(), | |
"stheitilight.ttf"); | |
final Typeface italic = Typeface.createFromAsset(getAssets(), | |
"stheitilight.ttf"); | |
final Typeface boldItalic = Typeface.createFromAsset(getAssets(), | |
"stheitilight.ttf"); | |
final Typeface regular = Typeface.createFromAsset(getAssets(), | |
"stheitilight.ttf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 检查某个包 是否有自启动或者桌面小插件 | |
* | |
* @param context | |
* @return 0 木有 1有自启动 2有小插件 3都有 | |
*/ | |
public static int checkStartupAndWidget(Context context, String packageName) { | |
PackageManager pm = context.getPackageManager(); | |
boolean haveStartup = false; | |
boolean haveWidget = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DetailController *detailController=[[DetailController alloc] initWithNibName:@"DetailController" bundle:nil]; | |
self.view.window.rootViewController=detailController; | |
//another: | |
TwoViewController *tempTwoViewController = [[TwoViewController alloc] initWithNibName:@"TwoViewController" bundle:nil]; | |
[self.view.superview addSubview:tempTwoViewController.view]; | |
[self.view removeFromSuperview]; | |
[tempTwoViewController release]; | |
//方法一右侧进入 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Location: /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist | |
--> | |
<key>GDI Commands</key> | |
<dict> | |
<key>GDI Duplicate Current Line</key> | |
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string> | |
<key>GDI Delete Current Line</key> | |
<string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:</string> | |
<key>GDI Move Current Line Up</key> | |
<string>selectLine:, cut:, moveUp:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 用字符串生成二维码 | |
* @param str | |
* @author zhouzhe@lenovo-cw.com | |
* @return | |
* @throws WriterException | |
*/ | |
public static Bitmap create2DCode(String str) throws WriterException { | |
//生成二维矩阵,编码时指定大小,不要生成了图片以后再进行缩放,这样会模糊导致识别失败 | |
BitMatrix matrix = new MultiFormatWriter().encode(str,BarcodeFormat.QR_CODE, 300, 300); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TRYBlockAlertView.h | |
// HelloWorld | |
// | |
// Created by Terry on 2013-10-07. | |
// Copyright (c) 2013 Terry. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
typedef void(^ClickedBlock)(NSInteger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//NSDictionary中 储存 NSInteger 不是对象,所以存过去的时候,都转换成了 NSNUmber 了 | |
//需要转换成 NSInteger: | |
[change setValue:[NSNumber numberWithInteger:3] forKey:@"new"]; | |
NSInteger val = [[change objectForKey:@"new"] intValue]; | |
NSLog(@"%d",(int) val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UserConext.m | |
// HelloWorld | |
// | |
// Created by Terry on 2013-10-07. | |
// Copyright (c) 2013 Terry. All rights reserved. | |
// | |
#import "UserConext.h" |
OlderNewer