forked from litesuits/android-common
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change project to android studio type
- Loading branch information
Showing
79 changed files
with
7,428 additions
and
7,070 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,8 @@ gen/com/litesuits/common/BuildConfig.java | |
lint.xml | ||
|
||
project.properties | ||
|
||
.gradle | ||
/local.properties | ||
/.idea | ||
/build |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
*.iml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'com.novoda.bintray-release' | ||
|
||
android { | ||
compileSdkVersion 20 | ||
buildToolsVersion "23.0.3" | ||
|
||
defaultConfig { | ||
minSdkVersion 7 | ||
targetSdkVersion 20 | ||
versionCode 13 | ||
versionName "1.1.3" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
} | ||
|
||
publish { | ||
userOrg = 'luffykou' //bintray.com username | ||
groupId = 'com.luffykou' //jcenter url | ||
artifactId = 'android-common-utils' //library name | ||
publishVersion = '1.1.3' //version | ||
desc = 'A powerful android common utils library.' //description | ||
website = 'https://github.com/luffykou/android-common' //github url | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/luffy/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.litesuits.common"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application> | ||
|
||
<service | ||
android:name=".service.NotificationService" | ||
android:label="@string/app_name" | ||
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"> | ||
<intent-filter> | ||
<action android:name="android.service.notification.NotificationListenerService" /> | ||
</intent-filter> | ||
</service> | ||
</application> | ||
|
||
</manifest> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
140 changes: 70 additions & 70 deletions
140
...com/litesuits/common/assist/Averager.java → ...com/litesuits/common/assist/Averager.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
package com.litesuits.common.assist; | ||
|
||
import com.litesuits.android.log.Log; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* 用以统计平均数 | ||
* | ||
* @author MaTianyu | ||
* 2013-12-11下午3:31:03 | ||
*/ | ||
public class Averager { | ||
private static final String TAG = "Averager"; | ||
private ArrayList<Number> numList = new ArrayList<Number>(); | ||
|
||
/** | ||
* 添加一个数字 | ||
* | ||
* @param num | ||
*/ | ||
public synchronized void add(Number num) { | ||
numList.add(num); | ||
} | ||
|
||
/** | ||
* 清除全部 | ||
*/ | ||
public void clear() { | ||
numList.clear(); | ||
} | ||
|
||
/** | ||
* 返回参与均值计算的数字个数 | ||
* | ||
* @return | ||
*/ | ||
public Number size() { | ||
return numList.size(); | ||
} | ||
|
||
/** | ||
* 获取平均数 | ||
* | ||
* @return | ||
*/ | ||
public Number getAverage() { | ||
if (numList.size() == 0) { | ||
return 0; | ||
} else { | ||
Float sum = 0f; | ||
for (int i = 0, size = numList.size(); i < size; i++) { | ||
sum = sum.floatValue() + numList.get(i).floatValue(); | ||
} | ||
return sum / numList.size(); | ||
} | ||
} | ||
|
||
/** | ||
* 打印数字列 | ||
* | ||
* @return | ||
*/ | ||
public String print() { | ||
String str = "PrintList(" + size() + "): " + numList; | ||
Log.i(TAG, str); | ||
return str; | ||
} | ||
|
||
} | ||
package com.litesuits.common.assist; | ||
|
||
import com.litesuits.android.log.Log; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* 用以统计平均数 | ||
* | ||
* @author MaTianyu | ||
* 2013-12-11下午3:31:03 | ||
*/ | ||
public class Averager { | ||
private static final String TAG = "Averager"; | ||
private ArrayList<Number> numList = new ArrayList<Number>(); | ||
|
||
/** | ||
* 添加一个数字 | ||
* | ||
* @param num | ||
*/ | ||
public synchronized void add(Number num) { | ||
numList.add(num); | ||
} | ||
|
||
/** | ||
* 清除全部 | ||
*/ | ||
public void clear() { | ||
numList.clear(); | ||
} | ||
|
||
/** | ||
* 返回参与均值计算的数字个数 | ||
* | ||
* @return | ||
*/ | ||
public Number size() { | ||
return numList.size(); | ||
} | ||
|
||
/** | ||
* 获取平均数 | ||
* | ||
* @return | ||
*/ | ||
public Number getAverage() { | ||
if (numList.size() == 0) { | ||
return 0; | ||
} else { | ||
Float sum = 0f; | ||
for (int i = 0, size = numList.size(); i < size; i++) { | ||
sum = sum.floatValue() + numList.get(i).floatValue(); | ||
} | ||
return sum / numList.size(); | ||
} | ||
} | ||
|
||
/** | ||
* 打印数字列 | ||
* | ||
* @return | ||
*/ | ||
public String print() { | ||
String str = "PrintList(" + size() + "): " + numList; | ||
Log.i(TAG, str); | ||
return str; | ||
} | ||
|
||
} |
File renamed without changes.
66 changes: 33 additions & 33 deletions
66
src/com/litesuits/common/assist/Check.java → ...va/com/litesuits/common/assist/Check.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
package com.litesuits.common.assist; | ||
|
||
import java.util.Collection; | ||
import java.util.Map; | ||
|
||
/** | ||
* 辅助判断 | ||
* | ||
* @author mty | ||
* @date 2013-6-10下午5:50:57 | ||
*/ | ||
public class Check { | ||
|
||
public static boolean isEmpty(CharSequence str) { | ||
return isNull(str) || str.length() == 0; | ||
} | ||
|
||
public static boolean isEmpty(Object[] os) { | ||
return isNull(os) || os.length == 0; | ||
} | ||
|
||
public static boolean isEmpty(Collection<?> l) { | ||
return isNull(l) || l.isEmpty(); | ||
} | ||
|
||
public static boolean isEmpty(Map<?, ?> m) { | ||
return isNull(m) || m.isEmpty(); | ||
} | ||
|
||
public static boolean isNull(Object o) { | ||
return o == null; | ||
} | ||
} | ||
package com.litesuits.common.assist; | ||
|
||
import java.util.Collection; | ||
import java.util.Map; | ||
|
||
/** | ||
* 辅助判断 | ||
* | ||
* @author mty | ||
* @date 2013-6-10下午5:50:57 | ||
*/ | ||
public class Check { | ||
|
||
public static boolean isEmpty(CharSequence str) { | ||
return isNull(str) || str.length() == 0; | ||
} | ||
|
||
public static boolean isEmpty(Object[] os) { | ||
return isNull(os) || os.length == 0; | ||
} | ||
|
||
public static boolean isEmpty(Collection<?> l) { | ||
return isNull(l) || l.isEmpty(); | ||
} | ||
|
||
public static boolean isEmpty(Map<?, ?> m) { | ||
return isNull(m) || m.isEmpty(); | ||
} | ||
|
||
public static boolean isNull(Object o) { | ||
return o == null; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.