初始版本建立
This commit is contained in:
commit
b51bdb5fa2
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>zftlive</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,12 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/com/zftlive/android/base=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseActivity.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseAdapter.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseBroadcastReceiver.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseContentProvider.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseEntity.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseException.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseFragment.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseFragmentV4.java=UTF-8
|
||||
encoding//src/com/zftlive/android/base/BaseService.java=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,17 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zftlive.android"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="19" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,7 @@
|
|||
==========================================
|
||||
2014.12.05更新日志:
|
||||
1、初始版本建立
|
||||
2、Base基类建立
|
||||
3、大概目录结构分包完成
|
||||
4、加入配置文件assets目录
|
||||
==========================================
|
|
@ -0,0 +1,8 @@
|
|||
#\u4e3b\u673aip
|
||||
host=www.chinabond.com.cn
|
||||
|
||||
#\u7aef\u53e3
|
||||
port=9080
|
||||
|
||||
#\u6570\u636e\u5206\u9875\u9ed8\u8ba4\u6761\u6570
|
||||
pageSize=10
|
|
@ -0,0 +1,17 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zftlive.android"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="19" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,3 @@
|
|||
# cache for current jar dependency. DO NOT EDIT.
|
||||
# format is <lastModified> <length> <SHA-1> <path>
|
||||
# Encoding is UTF-8
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
src = D:\\AndroidSource\\ormlite\\4.48\\ormlite-android-4.48-sources
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
src = D:\\AndroidSource\\ormlite\\4.48\\ormlite-core-4.48-sources
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
<issue id="NewApi" severity="ignore" />
|
||||
</lint>
|
|
@ -0,0 +1,20 @@
|
|||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# 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 *;
|
||||
#}
|
|
@ -0,0 +1,14 @@
|
|||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-19
|
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
|
@ -0,0 +1,11 @@
|
|||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme for API 11+. This theme completely replaces
|
||||
AppBaseTheme from res/values/styles.xml on API 11+ devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
|
||||
<!-- API 11 theme customizations can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,12 @@
|
|||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme for API 14+. This theme completely replaces
|
||||
AppBaseTheme from BOTH res/values/styles.xml and
|
||||
res/values-v11/styles.xml on API 14+ devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
|
||||
<!-- API 14 theme customizations can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,5 @@
|
|||
<resources>
|
||||
|
||||
<string name="app_name">zftlive</string>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,20 @@
|
|||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme, dependent on API level. This theme is replaced
|
||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Light">
|
||||
<!--
|
||||
Theme customizations available in newer API levels can go in
|
||||
res/values-vXX/styles.xml, while customizations related to
|
||||
backward-compatibility can go here.
|
||||
-->
|
||||
</style>
|
||||
|
||||
<!-- Application theme. -->
|
||||
<style name="AppTheme" parent="AppBaseTheme">
|
||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,12 @@
|
|||
package com.zftlive.android;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
/**
|
||||
* 整个应用程序Applicaiton
|
||||
* @author 曾繁添
|
||||
*
|
||||
*/
|
||||
public class MApplication extends Application {
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
/**
|
||||
* android 系统中的四大组件之一Activity基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseActivity extends Activity {
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/**
|
||||
* Adapter基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseAdapter extends android.widget.BaseAdapter {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* android 系统中的四大组件之一BroadcastReceiver基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseBroadcastReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
|
||||
/**
|
||||
* android 系统中的四大组件之一ContentProvider基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseContentProvider extends ContentProvider {
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor query(Uri uri, String[] projection, String selection,
|
||||
String[] selectionArgs, String sortOrder) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(Uri uri) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri insert(Uri uri, ContentValues values) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Uri uri, ContentValues values, String selection,
|
||||
String[] selectionArgs) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*/
|
||||
private static final long serialVersionUID = 6337104618534280060L;
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
/**
|
||||
* 异常基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseException extends Exception {
|
||||
|
||||
/**
|
||||
*/
|
||||
private static final long serialVersionUID = -7157241910640575948L;
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Fragment;
|
||||
|
||||
/**
|
||||
* Fragment基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
public class BaseFragment extends Fragment {
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
/**
|
||||
* Fragment基类(V4包)
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseFragmentV4 extends Fragment {
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.zftlive.android.base;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
/**
|
||||
* android 系统中的四大组件之一Service基类
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class BaseService extends Service {
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.zftlive.android.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* 数据传输对象
|
||||
*
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*/
|
||||
public class DTO<K, V> extends HashMap<K, V> implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6377960213315892547L;
|
||||
|
||||
/**
|
||||
* 赋值
|
||||
*
|
||||
* @param objKey
|
||||
* 键值
|
||||
* @param objValue
|
||||
* 对应值
|
||||
*/
|
||||
public V put(K objKey, V objValue) {
|
||||
if (readonly) {
|
||||
throw new RuntimeException("属性只读");
|
||||
} else {
|
||||
return super.put(objKey, objValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 只读开关
|
||||
*/
|
||||
private boolean readonly = false;
|
||||
|
||||
public void setReadonly(boolean readonly) {
|
||||
this.readonly = readonly;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除空值的Item
|
||||
*/
|
||||
public void removeEmptyValueItem(){
|
||||
for (Iterator<K> iterator = keySet().iterator(); iterator.hasNext();) {
|
||||
Object key = iterator.next();
|
||||
if(null == get(key) || "".equals(String.valueOf(get(key)))){
|
||||
remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.zftlive.android.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractCollection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据传输对象集合
|
||||
*
|
||||
* @author 曾繁添
|
||||
* @version 1.0
|
||||
*/
|
||||
public class DTOCollection<E extends DTO<?, ?>> extends AbstractCollection<E>
|
||||
implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2303371883543057514L;
|
||||
|
||||
public Iterator<E> iterator() {
|
||||
try {
|
||||
return new DTOIterator();
|
||||
} catch (Throwable cause) {
|
||||
throw new RuntimeException("创建迭代器失败", cause);
|
||||
}
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.transferData.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 赋值
|
||||
*
|
||||
* @exception RuntimeException
|
||||
* 操作DTO失败异常
|
||||
* @param object
|
||||
* 值
|
||||
*/
|
||||
public boolean add(E object) {
|
||||
if (!DTO.class.isInstance(object)) {
|
||||
throw new RuntimeException("要添加的对象不是DTO类或其子类的实例");
|
||||
}
|
||||
if (readonly) {
|
||||
throw new RuntimeException("该DTOCollection不可写");
|
||||
} else {
|
||||
return this.transferData.add(object);
|
||||
}
|
||||
}
|
||||
|
||||
protected class DTOIterator implements Iterator<E> {
|
||||
|
||||
public boolean hasNext() {
|
||||
return cursor != transferData.size();
|
||||
}
|
||||
|
||||
public E next() {
|
||||
E dtoObject = transferData.get(cursor++);
|
||||
dtoObject.setReadonly(readonly);
|
||||
return dtoObject;
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
if (readonly) {
|
||||
throw new RuntimeException("该DTOIterator不可写");
|
||||
} else {
|
||||
transferData.remove(--cursor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int cursor = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 传递数据
|
||||
*/
|
||||
private List<E> transferData = new ArrayList<E>();
|
||||
|
||||
protected List<E> getTransferData() {
|
||||
return this.transferData;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 只读开关
|
||||
*/
|
||||
private boolean readonly = false;
|
||||
|
||||
public void setReadonly(boolean readonly) {
|
||||
this.readonly = readonly;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue