Skip to content

Commit

Permalink
change project to android studio type
Browse files Browse the repository at this point in the history
  • Loading branch information
luffykou committed Aug 3, 2016
1 parent 33c17d6 commit 1f46a0c
Show file tree
Hide file tree
Showing 79 changed files with 7,428 additions and 7,070 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ gen/com/litesuits/common/BuildConfig.java
lint.xml

project.properties

.gradle
/local.properties
/.idea
/build
20 changes: 0 additions & 20 deletions AndroidManifest.xml

This file was deleted.

2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
*.iml
36 changes: 36 additions & 0 deletions app/build.gradle
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
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
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 *;
#}
18 changes: 18 additions & 0 deletions app/src/main/AndroidManifest.xml
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.
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.
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;
}
}
Loading

0 comments on commit 1f46a0c

Please sign in to comment.