Read the blog at http://fokkezb.nl/2013/09/20/url-schemes-for-ios-and-android-2/
This file contains hidden or 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.homeking365.kotlindemo | |
import android.content.Intent | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup |
This file contains hidden or 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
public static String encryptString(String str, String encryptStr) { | |
String resultStr; | |
int startIndex = indexOfNormalText(str, false); | |
int endIndex = indexOfNormalText(str, true); | |
if (startIndex == NOT_FOUND) { | |
resultStr = str + encryptStr; | |
} else { | |
if (str.length() == 1) { |
This file contains hidden or 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
[ | |
{"keys": ["enter"], "command": "move", "args": {"by": "characters", "forward": true}, "context": | |
[ | |
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)\\]\\>\\'\\\"\\ %>\\}\\;\\,]", "match_all": true }, | |
{ "key": "preceding_text", "operator": "not_regex_match", "operand": "^.*\\{$", "match_all": true }, | |
{ "key": "auto_complete_visible", "operator": "equal", "operand": false } | |
] | |
} | |
] |
This file contains hidden or 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
/** | |
* 判断是否是debug环境 | |
* @param context 上下文 | |
* @return true: debug, false: release | |
*/ | |
public static boolean isDebugMode(Context context) { | |
return (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; | |
} |
This file contains hidden or 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
public static int getStatusBarHeight(Context context){ | |
Class<?> c = null; | |
Object obj = null; | |
Field field = null; | |
int x = 0, statusBarHeight = 0; | |
try { | |
c = Class.forName("com.android.internal.R$dimen"); | |
obj = c.newInstance(); | |
field = c.getField("status_bar_height"); | |
x = Integer.parseInt(field.get(obj).toString()); |
This file contains hidden or 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
/** | |
* Shows the progress UI and hides the login form. | |
*/ | |
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) | |
public void showProgress(final boolean show) { | |
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow | |
// for very easy animations. If available, use these APIs to fade-in | |
// the progress spinner. | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { | |
int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); |
This file contains hidden or 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
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
buildNumber=$(printf "%04d" $buildNumber) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" |
This file contains hidden or 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
UIStoryboard *storyBoard; | |
if ([language isEqualToString:@"ar"]) { | |
lan = [[NSLocale preferredLanguages] objectAtIndex:0]; | |
storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone5Arabic" bundle:bnd]; | |
} | |
else if([language isEqualToString:@"en"]) { | |
NSLog(@"DDD "); | |
lan = [[NSLocale preferredLanguages] objectAtIndex:20]; | |
storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone5English" bundle:bnd]; | |
} |
This file contains hidden or 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
/** | |
* 把response中的NSNull对象删除掉 | |
* | |
* @param response 要处理的对象 | |
* | |
* @return 删除掉NSNull后的新对象 | |
*/ | |
- (id)convertNullObject:(id)response | |
{ | |
if (response == nil || [response isKindOfClass:[NSNull class]]) { |
NewerOlder