diff --git a/ZBLibrary(ADT)/.classpath b/ZBLibrary(ADT)/.classpath
deleted file mode 100644
index 5176974..0000000
--- a/ZBLibrary(ADT)/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/.project b/ZBLibrary(ADT)/.project
deleted file mode 100644
index 417c0d5..0000000
--- a/ZBLibrary(ADT)/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- ZBLibrary
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/ZBLibrary(ADT)/.settings/org.eclipse.core.resources.prefs b/ZBLibrary(ADT)/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 99f26c0..0000000
--- a/ZBLibrary(ADT)/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/=UTF-8
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/.classpath b/ZBLibrary(ADT)/QRCodeLibrary/.classpath
deleted file mode 100644
index 7d20911..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/.project b/ZBLibrary(ADT)/QRCodeLibrary/.project
deleted file mode 100644
index 9bf870c..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- QRCodeLibrary
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/.settings/org.eclipse.jdt.core.prefs b/ZBLibrary(ADT)/QRCodeLibrary/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7341ab1..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,11 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/AndroidManifest.xml b/ZBLibrary(ADT)/QRCodeLibrary/AndroidManifest.xml
deleted file mode 100644
index dae598c..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/libs/zxing.jar b/ZBLibrary(ADT)/QRCodeLibrary/libs/zxing.jar
deleted file mode 100644
index 29fa881..0000000
Binary files a/ZBLibrary(ADT)/QRCodeLibrary/libs/zxing.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/lint.xml b/ZBLibrary(ADT)/QRCodeLibrary/lint.xml
deleted file mode 100644
index ee0eead..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/lint.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/proguard.cfg b/ZBLibrary(ADT)/QRCodeLibrary/proguard.cfg
deleted file mode 100644
index b1cdf17..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/proguard.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
- native ;
-}
-
--keepclasseswithmembers class * {
- public (android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
- public (android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
- public void *(android.view.View);
-}
-
--keepclassmembers enum * {
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
- public static final android.os.Parcelable$Creator *;
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/project.properties b/ZBLibrary(ADT)/QRCodeLibrary/project.properties
deleted file mode 100644
index b756f44..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/project.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# 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 use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-21
-android.library=true
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/res/layout/camera.xml b/ZBLibrary(ADT)/QRCodeLibrary/res/layout/camera.xml
deleted file mode 100644
index 1141b4e..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/res/layout/camera.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/res/layout/main.xml b/ZBLibrary(ADT)/QRCodeLibrary/res/layout/main.xml
deleted file mode 100644
index b458374..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/res/layout/main.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/res/raw/beep.ogg b/ZBLibrary(ADT)/QRCodeLibrary/res/raw/beep.ogg
deleted file mode 100644
index cb1f7ba..0000000
Binary files a/ZBLibrary(ADT)/QRCodeLibrary/res/raw/beep.ogg and /dev/null differ
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/res/raw/realm_properties b/ZBLibrary(ADT)/QRCodeLibrary/res/raw/realm_properties
deleted file mode 100644
index bdd3234..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/res/raw/realm_properties
+++ /dev/null
@@ -1,2 +0,0 @@
-test: test
-admin: OBF:1u2a1toa1w8v1tok1u30,admin
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/res/values/colors.xml b/ZBLibrary(ADT)/QRCodeLibrary/res/values/colors.xml
deleted file mode 100644
index b3feeee..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/res/values/colors.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
- #EDEDED
- #ff000000
- #ffffffff
- #ffcccccc
- #ff404040
- #c0ffff00
- #ffffffff
- #ffc0c0c0
- #c000ff00
- #ffffffff
- #b0000000
- #ff808080
- #ffffffff
- #fffff0e0
- #ffffffff
- #ff000000
- #ff4b4b4b
- #ff000000
- #ffffffff
- #50000000
- #ffffffff
- #00000000
- #ff000000
- #ffff0000
- #60000000
- #58567D
- #686868
-
-
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/res/values/ids.xml b/ZBLibrary(ADT)/QRCodeLibrary/res/values/ids.xml
deleted file mode 100644
index ea373de..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/res/values/ids.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/activity/CaptureActivity.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/activity/CaptureActivity.java
deleted file mode 100644
index 7d6bdc3..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/activity/CaptureActivity.java
+++ /dev/null
@@ -1,243 +0,0 @@
-package com.zxing.activity;
-
-import java.io.IOException;
-import java.util.Vector;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.AssetFileDescriptor;
-import android.graphics.Bitmap;
-import android.media.AudioManager;
-import android.media.MediaPlayer;
-import android.media.MediaPlayer.OnCompletionListener;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Vibrator;
-import android.view.SurfaceHolder;
-import android.view.SurfaceHolder.Callback;
-import android.view.SurfaceView;
-import android.view.Window;
-import android.widget.Toast;
-
-import com.ericssonlabs.R;
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.Result;
-import com.zxing.camera.CameraManager;
-import com.zxing.decoding.CaptureActivityHandler;
-import com.zxing.decoding.CaptureActivityHandler.DecodeCallback;
-import com.zxing.decoding.InactivityTimer;
-import com.zxing.view.ViewfinderView;
-/**
- * Initial the camera
- * @author Ryan.Tang
- * @modifier Lemon
- * @use extends CaptureActivity并且在setContentView方法后调用init方法
- */
-public abstract class CaptureActivity extends Activity implements Callback, DecodeCallback {
- // private static final String TAG = "CaptureActivity";
-
- protected Activity context;
- protected SurfaceView surfaceView;
- protected ViewfinderView viewfinderView;
- /**初始化,必须在setContentView之后
- * @param context
- * @param viewfinderView
- */
- protected void init(Activity context, SurfaceView surfaceView, ViewfinderView viewfinderView) {
- this.context = context;
- this.surfaceView = surfaceView;
- this.viewfinderView = viewfinderView;
-
- CameraManager.init(getApplication());
-
- hasSurface = false;
- inactivityTimer = new InactivityTimer(this);
- }
-
- private boolean isOn = false;
- protected final boolean isOn() {
- return isOn;
- }
- /**打开或关闭闪关灯
- * @param open
- */
- protected void switchLight(boolean on) {
- if (on == isOn()) {
- return;
- }
- isOn = CameraManager.get().switchLight(on);
- }
-
-
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- }
-
-
- private CaptureActivityHandler handler;
- private boolean hasSurface;
- private Vector decodeFormats;
- private String characterSet;
- private InactivityTimer inactivityTimer;
- private MediaPlayer mediaPlayer;
- private boolean playBeep;
- private static final float BEEP_VOLUME = 0.10f;
- private boolean vibrate;
-
-
- @Override
- protected void onResume() {
- super.onResume();
- SurfaceHolder surfaceHolder = surfaceView.getHolder();
- if (hasSurface) {
- initCamera(surfaceHolder);
- } else {
- surfaceHolder.addCallback(this);
- surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
- }
- decodeFormats = null;
- characterSet = null;
-
- playBeep = true;
- AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
- if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
- playBeep = false;
- }
- initBeepSound();
- vibrate = true;
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- if (handler != null) {
- handler.quitSynchronously();
- handler = null;
- }
- isOn = false;
- CameraManager.get().closeDriver();
- }
-
-
- @Override
- protected void onDestroy() {
- inactivityTimer.shutdown();
- super.onDestroy();
- }
-
-
- public static final String RESULT_QRCODE_STRING = "RESULT_QRCODE_STRING";
- /**
- * Handler scan result
- * @param result
- * @param barcode
- */
- public void handleDecode(Result result, Bitmap barcode) {
- inactivityTimer.onActivity();
- playBeepSoundAndVibrate();
- String resultString = result.getText();
- //FIXME
- if (resultString.equals("")) {
- Toast.makeText(CaptureActivity.this, "Scan failed!", Toast.LENGTH_SHORT).show();
- }
-
- setResult(RESULT_OK, new Intent().putExtra(RESULT_QRCODE_STRING, resultString));
- finish();
- }
-
- private void initCamera(SurfaceHolder surfaceHolder) {
- try {
- CameraManager.get().openDriver(surfaceHolder);
- } catch (IOException ioe) {
- return;
- } catch (RuntimeException e) {
- return;
- }
- if (handler == null) {
- handler = new CaptureActivityHandler(this, decodeFormats,
- characterSet, viewfinderView, this);
- }
- }
-
- @Override
- public void drawViewfinder() {
- viewfinderView.drawViewfinder();
- }
-
-
- @Override
- public void surfaceChanged(SurfaceHolder holder, int format, int width,
- int height) {
-
- }
-
- @Override
- public void surfaceCreated(SurfaceHolder holder) {
- if (!hasSurface) {
- hasSurface = true;
- initCamera(holder);
- }
-
- }
-
- @Override
- public void surfaceDestroyed(SurfaceHolder holder) {
- hasSurface = false;
-
- }
-
-
- public Handler getHandler() {
- return handler;
- }
-
-
- private void initBeepSound() {
- if (playBeep && mediaPlayer == null) {
- // The volume on STREAM_SYSTEM is not adjustable, and users found it
- // too loud,
- // so we now play on the music stream.
- setVolumeControlStream(AudioManager.STREAM_MUSIC);
- mediaPlayer = new MediaPlayer();
- mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
- mediaPlayer.setOnCompletionListener(beepListener);
-
- AssetFileDescriptor file = getResources().openRawResourceFd(
- R.raw.beep);
- try {
- mediaPlayer.setDataSource(file.getFileDescriptor(),
- file.getStartOffset(), file.getLength());
- file.close();
- mediaPlayer.setVolume(BEEP_VOLUME, BEEP_VOLUME);
- mediaPlayer.prepare();
- } catch (IOException e) {
- mediaPlayer = null;
- }
- }
- }
-
- private static final long VIBRATE_DURATION = 200L;
-
- private void playBeepSoundAndVibrate() {
- if (playBeep && mediaPlayer != null) {
- mediaPlayer.start();
- }
- if (vibrate) {
- Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
- vibrator.vibrate(VIBRATE_DURATION);
- }
- }
-
- /**
- * When the beep has finished playing, rewind to queue up another one.
- */
- private final OnCompletionListener beepListener = new OnCompletionListener() {
- public void onCompletion(MediaPlayer mediaPlayer) {
- mediaPlayer.seekTo(0);
- }
- };
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/AutoFocusCallback.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/AutoFocusCallback.java
deleted file mode 100644
index a190bd4..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/AutoFocusCallback.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.camera;
-
-import android.hardware.Camera;
-import android.os.Handler;
-import android.os.Message;
-import android.util.Log;
-
-final class AutoFocusCallback implements Camera.AutoFocusCallback {
-
- private static final String TAG = AutoFocusCallback.class.getSimpleName();
-
- private static final long AUTOFOCUS_INTERVAL_MS = 1500L;
-
- private Handler autoFocusHandler;
- private int autoFocusMessage;
-
- void setHandler(Handler autoFocusHandler, int autoFocusMessage) {
- this.autoFocusHandler = autoFocusHandler;
- this.autoFocusMessage = autoFocusMessage;
- }
-
- public void onAutoFocus(boolean success, Camera camera) {
- if (autoFocusHandler != null) {
- Message message = autoFocusHandler.obtainMessage(autoFocusMessage, success);
- autoFocusHandler.sendMessageDelayed(message, AUTOFOCUS_INTERVAL_MS);
- autoFocusHandler = null;
- } else {
- Log.d(TAG, "Got auto-focus callback, but no handler for it");
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/CameraConfigurationManager.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/CameraConfigurationManager.java
deleted file mode 100644
index a6f6ba5..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/CameraConfigurationManager.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.camera;
-
-import java.util.regex.Pattern;
-
-import android.content.Context;
-import android.graphics.Point;
-import android.hardware.Camera;
-import android.os.Build;
-import android.util.Log;
-import android.view.Display;
-import android.view.WindowManager;
-
-final class CameraConfigurationManager {
-
- private static final String TAG = CameraConfigurationManager.class.getSimpleName();
-
- private static final int TEN_DESIRED_ZOOM = 27;
- private static final int DESIRED_SHARPNESS = 30;
-
- private static final Pattern COMMA_PATTERN = Pattern.compile(",");
-
- private final Context context;
- private Point screenResolution;
- private Point cameraResolution;
- private int previewFormat;
- private String previewFormatString;
-
- CameraConfigurationManager(Context context) {
- this.context = context;
- }
-
- /**
- * Reads, one time, values from the camera that are needed by the app.
- */
- void initFromCameraParameters(Camera camera) {
- Camera.Parameters parameters = camera.getParameters();
- previewFormat = parameters.getPreviewFormat();
- previewFormatString = parameters.get("preview-format");
- Log.d(TAG, "Default preview format: " + previewFormat + '/' + previewFormatString);
- WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
- Display display = manager.getDefaultDisplay();
- screenResolution = new Point(display.getWidth(), display.getHeight());
- Log.d(TAG, "Screen resolution: " + screenResolution);
-
-// //Lemon add 扫描框修改,解决拉伸但导致成像模糊识别率很低。<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-// Point screenResolutionForCamera = new Point();
-// screenResolutionForCamera.x = screenResolution.x;
-// screenResolutionForCamera.y = screenResolution.y;
-// // preview size is always something like 480*320, other 320*480
-// if (screenResolution.x < screenResolution.y) {
-// screenResolutionForCamera.x = screenResolution.y;
-// screenResolutionForCamera.y = screenResolution.x;
-// }
- //Lemon add 扫描框修改,解决拉伸>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- //Lemon 扫描框修改,解决拉伸但导致成像模糊识别率很低 screenResolution改为screenResolutionForCamera);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- cameraResolution = getCameraResolution(parameters, screenResolution);
- Log.d(TAG, "Camera resolution: " + screenResolution);
- //Lemon 扫描框修改,解决拉伸但导致成像模糊识别率很低 screenResolution改为screenResolutionForCamera);>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- }
-
- /**
- * Sets the camera up to take preview images which are used for both preview and decoding.
- * We detect the preview format here so that buildLuminanceSource() can build an appropriate
- * LuminanceSource subclass. In the future we may want to force YUV420SP as it's the smallest,
- * and the planar Y can be used for barcode scanning without a copy in some cases.
- */
- void setDesiredCameraParameters(Camera camera) {
- Camera.Parameters parameters = camera.getParameters();
- Log.d(TAG, "Setting preview size: " + cameraResolution);
- parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
- setFlash(parameters);
- setZoom(parameters);
- //setSharpness(parameters);
- //modify here
- camera.setDisplayOrientation(90);
- camera.setParameters(parameters);
- }
-
- Point getCameraResolution() {
- return cameraResolution;
- }
-
- Point getScreenResolution() {
- return screenResolution;
- }
-
- int getPreviewFormat() {
- return previewFormat;
- }
-
- String getPreviewFormatString() {
- return previewFormatString;
- }
-
- private static Point getCameraResolution(Camera.Parameters parameters, Point screenResolution) {
-
- String previewSizeValueString = parameters.get("preview-size-values");
- // saw this on Xperia
- if (previewSizeValueString == null) {
- previewSizeValueString = parameters.get("preview-size-value");
- }
-
- Point cameraResolution = null;
-
- if (previewSizeValueString != null) {
- Log.d(TAG, "preview-size-values parameter: " + previewSizeValueString);
- cameraResolution = findBestPreviewSizeValue(previewSizeValueString, screenResolution);
- }
-
- if (cameraResolution == null) {
- // Ensure that the camera resolution is a multiple of 8, as the screen may not be.
- cameraResolution = new Point(
- (screenResolution.x >> 3) << 3,
- (screenResolution.y >> 3) << 3);
- }
-
- return cameraResolution;
- }
-
- private static Point findBestPreviewSizeValue(CharSequence previewSizeValueString, Point screenResolution) {
- int bestX = 0;
- int bestY = 0;
- int diff = Integer.MAX_VALUE;
- for (String previewSize : COMMA_PATTERN.split(previewSizeValueString)) {
-
- previewSize = previewSize.trim();
- int dimPosition = previewSize.indexOf('x');
- if (dimPosition < 0) {
- Log.w(TAG, "Bad preview-size: " + previewSize);
- continue;
- }
-
- int newX;
- int newY;
- try {
- newX = Integer.parseInt(previewSize.substring(0, dimPosition));
- newY = Integer.parseInt(previewSize.substring(dimPosition + 1));
- } catch (NumberFormatException nfe) {
- Log.w(TAG, "Bad preview-size: " + previewSize);
- continue;
- }
-
- int newDiff = Math.abs(newX - screenResolution.x) + Math.abs(newY - screenResolution.y);
- if (newDiff == 0) {
- bestX = newX;
- bestY = newY;
- break;
- } else if (newDiff < diff) {
- bestX = newX;
- bestY = newY;
- diff = newDiff;
- }
-
- }
-
- if (bestX > 0 && bestY > 0) {
- return new Point(bestX, bestY);
- }
- return null;
- }
-
- private static int findBestMotZoomValue(CharSequence stringValues, int tenDesiredZoom) {
- int tenBestValue = 0;
- for (String stringValue : COMMA_PATTERN.split(stringValues)) {
- stringValue = stringValue.trim();
- double value;
- try {
- value = Double.parseDouble(stringValue);
- } catch (NumberFormatException nfe) {
- return tenDesiredZoom;
- }
- int tenValue = (int) (10.0 * value);
- if (Math.abs(tenDesiredZoom - value) < Math.abs(tenDesiredZoom - tenBestValue)) {
- tenBestValue = tenValue;
- }
- }
- return tenBestValue;
- }
-
- private void setFlash(Camera.Parameters parameters) {
- // FIXME: This is a hack to turn the flash off on the Samsung Galaxy.
- // And this is a hack-hack to work around a different value on the Behold II
- // Restrict Behold II check to Cupcake, per Samsung's advice
- //if (Build.MODEL.contains("Behold II") &&
- // CameraManager.SDK_INT == Build.VERSION_CODES.CUPCAKE) {
- if (Build.MODEL.contains("Behold II") && CameraManager.SDK_INT == 3) { // 3 = Cupcake
- parameters.set("flash-value", 1);
- } else {
- parameters.set("flash-value", 2);
- }
- // This is the standard setting to turn the flash off that all devices should honor.
- parameters.set("flash-mode", "off");
- }
-
- private void setZoom(Camera.Parameters parameters) {
-
- String zoomSupportedString = parameters.get("zoom-supported");
- if (zoomSupportedString != null && !Boolean.parseBoolean(zoomSupportedString)) {
- return;
- }
-
- int tenDesiredZoom = TEN_DESIRED_ZOOM;
-
- String maxZoomString = parameters.get("max-zoom");
- if (maxZoomString != null) {
- try {
- int tenMaxZoom = (int) (10.0 * Double.parseDouble(maxZoomString));
- if (tenDesiredZoom > tenMaxZoom) {
- tenDesiredZoom = tenMaxZoom;
- }
- } catch (NumberFormatException nfe) {
- Log.w(TAG, "Bad max-zoom: " + maxZoomString);
- }
- }
-
- String takingPictureZoomMaxString = parameters.get("taking-picture-zoom-max");
- if (takingPictureZoomMaxString != null) {
- try {
- int tenMaxZoom = Integer.parseInt(takingPictureZoomMaxString);
- if (tenDesiredZoom > tenMaxZoom) {
- tenDesiredZoom = tenMaxZoom;
- }
- } catch (NumberFormatException nfe) {
- Log.w(TAG, "Bad taking-picture-zoom-max: " + takingPictureZoomMaxString);
- }
- }
-
- String motZoomValuesString = parameters.get("mot-zoom-values");
- if (motZoomValuesString != null) {
- tenDesiredZoom = findBestMotZoomValue(motZoomValuesString, tenDesiredZoom);
- }
-
- String motZoomStepString = parameters.get("mot-zoom-step");
- if (motZoomStepString != null) {
- try {
- double motZoomStep = Double.parseDouble(motZoomStepString.trim());
- int tenZoomStep = (int) (10.0 * motZoomStep);
- if (tenZoomStep > 1) {
- tenDesiredZoom -= tenDesiredZoom % tenZoomStep;
- }
- } catch (NumberFormatException nfe) {
- // continue
- }
- }
-
- // Set zoom. This helps encourage the user to pull back.
- // Some devices like the Behold have a zoom parameter
- if (maxZoomString != null || motZoomValuesString != null) {
- parameters.set("zoom", String.valueOf(tenDesiredZoom / 10.0));
- }
-
- // Most devices, like the Hero, appear to expose this zoom parameter.
- // It takes on values like "27" which appears to mean 2.7x zoom
- if (takingPictureZoomMaxString != null) {
- parameters.set("taking-picture-zoom", tenDesiredZoom);
- }
- }
-
- public static int getDesiredSharpness() {
- return DESIRED_SHARPNESS;
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/CameraManager.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/CameraManager.java
deleted file mode 100644
index feb3170..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/CameraManager.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * Copyright (C) 2008 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.camera;
-
-import java.io.IOException;
-
-import android.content.Context;
-import android.graphics.PixelFormat;
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.hardware.Camera;
-import android.hardware.Camera.Parameters;
-import android.os.Build;
-import android.os.Handler;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.view.SurfaceHolder;
-
-/**
- * This object wraps the Camera service object and expects to be the only one talking to it. The
- * implementation encapsulates the steps needed to take preview-sized images, which are used for
- * both preview and decoding.
- *
- */
-public final class CameraManager {
-
- private static final String TAG = CameraManager.class.getSimpleName();
-
- private static final int MIN_FRAME_WIDTH = 240;
- private static final int MIN_FRAME_HEIGHT = 240;
- private static final int MAX_FRAME_WIDTH = 480;
- private static final int MAX_FRAME_HEIGHT = 360;
-
- private static CameraManager cameraManager;
-
- static final int SDK_INT; // Later we can use Build.VERSION.SDK_INT
- static {
- int sdkInt;
- try {
- sdkInt = Integer.parseInt(Build.VERSION.SDK);
- } catch (NumberFormatException nfe) {
- // Just to be safe
- sdkInt = 10000;
- }
- SDK_INT = sdkInt;
- }
-
- private final Context context;
- private final CameraConfigurationManager configManager;
- private Camera camera;
- private Rect framingRect;
- private Rect framingRectInPreview;
- private boolean initialized;
- private boolean previewing;
- private final boolean useOneShotPreviewCallback;
- /**
- * Preview frames are delivered here, which we pass on to the registered handler. Make sure to
- * clear the handler so it will only receive one message.
- */
- private final PreviewCallback previewCallback;
- /** Autofocus callbacks arrive here, and are dispatched to the Handler which requested them. */
- private final AutoFocusCallback autoFocusCallback;
-
- /**
- * Initializes this static object with the Context of the calling Activity.
- *
- * @param context The Activity which wants to use the camera.
- */
- public static void init(Context context) {
- if (cameraManager == null) {
- cameraManager = new CameraManager(context);
- }
- }
-
- /**
- * Gets the CameraManager singleton instance.
- *
- * @return A reference to the CameraManager singleton.
- */
- public static CameraManager get() {
- return cameraManager;
- }
-
- private CameraManager(Context context) {
-
- this.context = context;
- this.configManager = new CameraConfigurationManager(context);
-
- // Camera.setOneShotPreviewCallback() has a race condition in Cupcake, so we use the older
- // Camera.setPreviewCallback() on 1.5 and earlier. For Donut and later, we need to use
- // the more efficient one shot callback, as the older one can swamp the system and cause it
- // to run out of memory. We can't use SDK_INT because it was introduced in the Donut SDK.
- //useOneShotPreviewCallback = Integer.parseInt(Build.VERSION.SDK) > Build.VERSION_CODES.CUPCAKE;
- useOneShotPreviewCallback = Integer.parseInt(Build.VERSION.SDK) > 3; // 3 = Cupcake
-
- previewCallback = new PreviewCallback(configManager, useOneShotPreviewCallback);
- autoFocusCallback = new AutoFocusCallback();
- }
-
- /**
- * Opens the camera driver and initializes the hardware parameters.
- *
- * @param holder The surface object which the camera will draw preview frames into.
- * @throws IOException Indicates the camera driver failed to open.
- */
- public void openDriver(SurfaceHolder holder) throws IOException {
- if (camera == null) {
- camera = Camera.open();
- if (camera == null) {
- throw new IOException();
- }
- camera.setPreviewDisplay(holder);
-
- if (!initialized) {
- initialized = true;
- configManager.initFromCameraParameters(camera);
- }
- configManager.setDesiredCameraParameters(camera);
-
- //FIXME
- // SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- //�Ƿ�ʹ��ǰ��
- // if (prefs.getBoolean(PreferencesActivity.KEY_FRONT_LIGHT, false)) {
- // FlashlightManager.enableFlashlight();
- // }
- FlashlightManager.enableFlashlight();
- }
- }
-
-
- //Lemon add <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- private Parameters parameter;
- /**开关闪光灯
- * @param open
- * @return
- */
- public boolean switchLight(boolean open) {
- parameter = camera.getParameters();
- if (open) {
- parameter.setFlashMode(Parameters.FLASH_MODE_TORCH);
- camera.setParameters(parameter);
- return true;
- } else {
- parameter.setFlashMode(Parameters.FLASH_MODE_OFF);
- camera.setParameters(parameter);
- return false;
- }
- }
- //Lemon add >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- /**
- * Closes the camera driver if still in use.
- */
- public void closeDriver() {
- if (camera != null) {
- FlashlightManager.disableFlashlight();
- camera.release();
- camera = null;
- }
- }
-
- /**
- * Asks the camera hardware to begin drawing preview frames to the screen.
- */
- public void startPreview() {
- if (camera != null && !previewing) {
- camera.startPreview();
- previewing = true;
- }
- }
-
- /**
- * Tells the camera to stop drawing preview frames.
- */
- public void stopPreview() {
- if (camera != null && previewing) {
- if (!useOneShotPreviewCallback) {
- camera.setPreviewCallback(null);
- }
- camera.stopPreview();
- previewCallback.setHandler(null, 0);
- autoFocusCallback.setHandler(null, 0);
- previewing = false;
- }
- }
-
- /**
- * A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
- * in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
- * respectively.
- *
- * @param handler The handler to send the message to.
- * @param message The what field of the message to be sent.
- */
- public void requestPreviewFrame(Handler handler, int message) {
- if (camera != null && previewing) {
- previewCallback.setHandler(handler, message);
- if (useOneShotPreviewCallback) {
- camera.setOneShotPreviewCallback(previewCallback);
- } else {
- camera.setPreviewCallback(previewCallback);
- }
- }
- }
-
- /**
- * Asks the camera hardware to perform an autofocus.
- *
- * @param handler The Handler to notify when the autofocus completes.
- * @param message The message to deliver.
- */
- public void requestAutoFocus(Handler handler, int message) {
- if (camera != null && previewing) {
- autoFocusCallback.setHandler(handler, message);
- //Log.d(TAG, "Requesting auto-focus callback");
- camera.autoFocus(autoFocusCallback);
- }
- }
-
- /**
- * Calculates the framing rect which the UI should draw to show the user where to place the
- * barcode. This target helps with alignment as well as forces the user to hold the device
- * far enough away to ensure the image will be in focus.
- *
- * @return The rectangle to draw on screen in window coordinates.
- */
- public Rect getFramingRect() {
- Point screenResolution = configManager.getScreenResolution();
- if (framingRect == null) {
- if (camera == null) {
- return null;
- }
- //Lemon 扫描框修改,解决拉伸<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // int width = screenResolution.x * 3 / 4;
- // if (width < MIN_FRAME_WIDTH) {
- // width = MIN_FRAME_WIDTH;
- // } else if (width > MAX_FRAME_WIDTH) {
- // width = MAX_FRAME_WIDTH;
- // }
- // int height = screenResolution.y * 3 / 4;
- // if (height < MIN_FRAME_HEIGHT) {
- // height = MIN_FRAME_HEIGHT;
- // } else if (height > MAX_FRAME_HEIGHT) {
- // height = MAX_FRAME_HEIGHT;
- // }
- // int leftOffset = (screenResolution.x - width) / 2;
- // int topOffset = (screenResolution.y - height) / 2;
- // framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffset + height);
- // Log.d(TAG, "Calculated framing rect: " + framingRect);
-
- //Lemon 扫描框修改,解决拉伸<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- DisplayMetrics metrics = context.getResources().getDisplayMetrics();
- int width = (int) (metrics.widthPixels * 0.6);
- int height = (int) (width * 0.9);
-
- int leftOffset = (screenResolution.x - width) / 2;
- int topOffset = (screenResolution.y - height) / 3;
- framingRect = new Rect(leftOffset, topOffset, leftOffset + width,
- topOffset + height);
- Log.d(TAG, "Calculated framing rect: " + framingRect);
- //Lemon 扫描框修改,解决拉伸>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- }
- return framingRect;
- }
-
- /**
- * Like {@link #getFramingRect} but coordinates are in terms of the preview frame,
- * not UI / screen.
- */
- public Rect getFramingRectInPreview() {
- if (framingRectInPreview == null) {
- Rect rect = new Rect(getFramingRect());
- Point cameraResolution = configManager.getCameraResolution();
- Point screenResolution = configManager.getScreenResolution();
- //modify here
- // rect.left = rect.left * cameraResolution.x / screenResolution.x;
- // rect.right = rect.right * cameraResolution.x / screenResolution.x;
- // rect.top = rect.top * cameraResolution.y / screenResolution.y;
- // rect.bottom = rect.bottom * cameraResolution.y / screenResolution.y;
- rect.left = rect.left * cameraResolution.y / screenResolution.x;
- rect.right = rect.right * cameraResolution.y / screenResolution.x;
- rect.top = rect.top * cameraResolution.x / screenResolution.y;
- rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y;
- framingRectInPreview = rect;
- }
- return framingRectInPreview;
- }
-
- /**
- * Converts the result points from still resolution coordinates to screen coordinates.
- *
- * @param points The points returned by the Reader subclass through Result.getResultPoints().
- * @return An array of Points scaled to the size of the framing rect and offset appropriately
- * so they can be drawn in screen coordinates.
- */
- /*
- public Point[] convertResultPoints(ResultPoint[] points) {
- Rect frame = getFramingRectInPreview();
- int count = points.length;
- Point[] output = new Point[count];
- for (int x = 0; x < count; x++) {
- output[x] = new Point();
- output[x].x = frame.left + (int) (points[x].getX() + 0.5f);
- output[x].y = frame.top + (int) (points[x].getY() + 0.5f);
- }
- return output;
- }
- */
-
- /**
- * A factory method to build the appropriate LuminanceSource object based on the format
- * of the preview buffers, as described by Camera.Parameters.
- *
- * @param data A preview frame.
- * @param width The width of the image.
- * @param height The height of the image.
- * @return A PlanarYUVLuminanceSource instance.
- */
- public PlanarYUVLuminanceSource buildLuminanceSource(byte[] data, int width, int height) {
- Rect rect = getFramingRectInPreview();
- int previewFormat = configManager.getPreviewFormat();
- String previewFormatString = configManager.getPreviewFormatString();
- switch (previewFormat) {
- // This is the standard Android format which all devices are REQUIRED to support.
- // In theory, it's the only one we should ever care about.
- case PixelFormat.YCbCr_420_SP:
- // This format has never been seen in the wild, but is compatible as we only care
- // about the Y channel, so allow it.
- case PixelFormat.YCbCr_422_SP:
- return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top,
- rect.width(), rect.height());
- default:
- // The Samsung Moment incorrectly uses this variant instead of the 'sp' version.
- // Fortunately, it too has all the Y data up front, so we can read it.
- if ("yuv420p".equals(previewFormatString)) {
- return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top,
- rect.width(), rect.height());
- }
- }
- throw new IllegalArgumentException("Unsupported picture format: " +
- previewFormat + '/' + previewFormatString);
- }
-
- public Context getContext() {
- return context;
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/FlashlightManager.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/FlashlightManager.java
deleted file mode 100644
index 4fa8ce0..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/FlashlightManager.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.camera;
-
-import android.os.IBinder;
-import android.util.Log;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- * This class is used to activate the weak light on some camera phones (not flash)
- * in order to illuminate surfaces for scanning. There is no official way to do this,
- * but, classes which allow access to this function still exist on some devices.
- * This therefore proceeds through a great deal of reflection.
- *
- * See
- * http://almondmendoza.com/2009/01/05/changing-the-screen-brightness-programatically/ and
- *
- * http://code.google.com/p/droidled/source/browse/trunk/src/com/droidled/demo/DroidLED.java.
- * Thanks to Ryan Alford for pointing out the availability of this class.
- */
-final class FlashlightManager {
-
- private static final String TAG = FlashlightManager.class.getSimpleName();
-
- private static final Object iHardwareService;
- private static final Method setFlashEnabledMethod;
- static {
- iHardwareService = getHardwareService();
- setFlashEnabledMethod = getSetFlashEnabledMethod(iHardwareService);
- if (iHardwareService == null) {
- Log.v(TAG, "This device does supports control of a flashlight");
- } else {
- Log.v(TAG, "This device does not support control of a flashlight");
- }
- }
-
- private FlashlightManager() {
- }
-
- /**
- * 开启闪光灯
- */
- //FIXME
- static void enableFlashlight() {
- setFlashlight(false);
- }
-
- static void disableFlashlight() {
- setFlashlight(false);
- }
-
- private static Object getHardwareService() {
- Class> serviceManagerClass = maybeForName("android.os.ServiceManager");
- if (serviceManagerClass == null) {
- return null;
- }
-
- Method getServiceMethod = maybeGetMethod(serviceManagerClass, "getService", String.class);
- if (getServiceMethod == null) {
- return null;
- }
-
- Object hardwareService = invoke(getServiceMethod, null, "hardware");
- if (hardwareService == null) {
- return null;
- }
-
- Class> iHardwareServiceStubClass = maybeForName("android.os.IHardwareService$Stub");
- if (iHardwareServiceStubClass == null) {
- return null;
- }
-
- Method asInterfaceMethod = maybeGetMethod(iHardwareServiceStubClass, "asInterface", IBinder.class);
- if (asInterfaceMethod == null) {
- return null;
- }
-
- return invoke(asInterfaceMethod, null, hardwareService);
- }
-
- private static Method getSetFlashEnabledMethod(Object iHardwareService) {
- if (iHardwareService == null) {
- return null;
- }
- Class> proxyClass = iHardwareService.getClass();
- return maybeGetMethod(proxyClass, "setFlashlightEnabled", boolean.class);
- }
-
- private static Class> maybeForName(String name) {
- try {
- return Class.forName(name);
- } catch (ClassNotFoundException cnfe) {
- // OK
- return null;
- } catch (RuntimeException re) {
- Log.w(TAG, "Unexpected error while finding class " + name, re);
- return null;
- }
- }
-
- private static Method maybeGetMethod(Class> clazz, String name, Class>... argClasses) {
- try {
- return clazz.getMethod(name, argClasses);
- } catch (NoSuchMethodException nsme) {
- // OK
- return null;
- } catch (RuntimeException re) {
- Log.w(TAG, "Unexpected error while finding method " + name, re);
- return null;
- }
- }
-
- private static Object invoke(Method method, Object instance, Object... args) {
- try {
- return method.invoke(instance, args);
- } catch (IllegalAccessException e) {
- Log.w(TAG, "Unexpected error while invoking " + method, e);
- return null;
- } catch (InvocationTargetException e) {
- Log.w(TAG, "Unexpected error while invoking " + method, e.getCause());
- return null;
- } catch (RuntimeException re) {
- Log.w(TAG, "Unexpected error while invoking " + method, re);
- return null;
- }
- }
-
- private static void setFlashlight(boolean active) {
- if (iHardwareService != null) {
- invoke(setFlashEnabledMethod, iHardwareService, active);
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/PlanarYUVLuminanceSource.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/PlanarYUVLuminanceSource.java
deleted file mode 100644
index 2da06e7..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/PlanarYUVLuminanceSource.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2009 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.camera;
-
-import com.google.zxing.LuminanceSource;
-
-import android.graphics.Bitmap;
-
-/**
- * This object extends LuminanceSource around an array of YUV data returned from the camera driver,
- * with the option to crop to a rectangle within the full data. This can be used to exclude
- * superfluous pixels around the perimeter and speed up decoding.
- *
- * It works for any pixel format where the Y channel is planar and appears first, including
- * YCbCr_420_SP and YCbCr_422_SP.
- *
- * @author dswitkin@google.com (Daniel Switkin)
- */
-public final class PlanarYUVLuminanceSource extends LuminanceSource {
- private final byte[] yuvData;
- private final int dataWidth;
- private final int dataHeight;
- private final int left;
- private final int top;
-
- public PlanarYUVLuminanceSource(byte[] yuvData, int dataWidth, int dataHeight, int left, int top,
- int width, int height) {
- super(width, height);
-
- if (left + width > dataWidth || top + height > dataHeight) {
- throw new IllegalArgumentException("Crop rectangle does not fit within image data.");
- }
-
- this.yuvData = yuvData;
- this.dataWidth = dataWidth;
- this.dataHeight = dataHeight;
- this.left = left;
- this.top = top;
- }
-
- @Override
- public byte[] getRow(int y, byte[] row) {
- if (y < 0 || y >= getHeight()) {
- throw new IllegalArgumentException("Requested row is outside the image: " + y);
- }
- int width = getWidth();
- if (row == null || row.length < width) {
- row = new byte[width];
- }
- int offset = (y + top) * dataWidth + left;
- System.arraycopy(yuvData, offset, row, 0, width);
- return row;
- }
-
- @Override
- public byte[] getMatrix() {
- int width = getWidth();
- int height = getHeight();
-
- // If the caller asks for the entire underlying image, save the copy and give them the
- // original data. The docs specifically warn that result.length must be ignored.
- if (width == dataWidth && height == dataHeight) {
- return yuvData;
- }
-
- int area = width * height;
- byte[] matrix = new byte[area];
- int inputOffset = top * dataWidth + left;
-
- // If the width matches the full width of the underlying data, perform a single copy.
- if (width == dataWidth) {
- System.arraycopy(yuvData, inputOffset, matrix, 0, area);
- return matrix;
- }
-
- // Otherwise copy one cropped row at a time.
- byte[] yuv = yuvData;
- for (int y = 0; y < height; y++) {
- int outputOffset = y * width;
- System.arraycopy(yuv, inputOffset, matrix, outputOffset, width);
- inputOffset += dataWidth;
- }
- return matrix;
- }
-
- @Override
- public boolean isCropSupported() {
- return true;
- }
-
- public int getDataWidth() {
- return dataWidth;
- }
-
- public int getDataHeight() {
- return dataHeight;
- }
-
- public Bitmap renderCroppedGreyscaleBitmap() {
- int width = getWidth();
- int height = getHeight();
- int[] pixels = new int[width * height];
- byte[] yuv = yuvData;
- int inputOffset = top * dataWidth + left;
-
- for (int y = 0; y < height; y++) {
- int outputOffset = y * width;
- for (int x = 0; x < width; x++) {
- int grey = yuv[inputOffset + x] & 0xff;
- pixels[outputOffset + x] = 0xFF000000 | (grey * 0x00010101);
- }
- inputOffset += dataWidth;
- }
-
- Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
- return bitmap;
- }
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/PreviewCallback.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/PreviewCallback.java
deleted file mode 100644
index ef4d3d5..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/camera/PreviewCallback.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.camera;
-
-import android.graphics.Point;
-import android.hardware.Camera;
-import android.os.Handler;
-import android.os.Message;
-import android.util.Log;
-
-final class PreviewCallback implements Camera.PreviewCallback {
-
- private static final String TAG = PreviewCallback.class.getSimpleName();
-
- private final CameraConfigurationManager configManager;
- private final boolean useOneShotPreviewCallback;
- private Handler previewHandler;
- private int previewMessage;
-
- PreviewCallback(CameraConfigurationManager configManager, boolean useOneShotPreviewCallback) {
- this.configManager = configManager;
- this.useOneShotPreviewCallback = useOneShotPreviewCallback;
- }
-
- void setHandler(Handler previewHandler, int previewMessage) {
- this.previewHandler = previewHandler;
- this.previewMessage = previewMessage;
- }
-
- public void onPreviewFrame(byte[] data, Camera camera) {
- Point cameraResolution = configManager.getCameraResolution();
- if (!useOneShotPreviewCallback) {
- camera.setPreviewCallback(null);
- }
- if (previewHandler != null) {
- Message message = previewHandler.obtainMessage(previewMessage, cameraResolution.x,
- cameraResolution.y, data);
- message.sendToTarget();
- previewHandler = null;
- } else {
- Log.d(TAG, "Got preview callback, but no handler for it");
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/CaptureActivityHandler.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/CaptureActivityHandler.java
deleted file mode 100644
index b1106dd..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/CaptureActivityHandler.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2008 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-
-import java.util.Vector;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.util.Log;
-
-import com.ericssonlabs.R;
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.Result;
-import com.zxing.activity.CaptureActivity;
-import com.zxing.camera.CameraManager;
-import com.zxing.view.ViewfinderResultPointCallback;
-import com.zxing.view.ViewfinderView;
-
-/**
- * This class handles all the messaging which comprises the state machine for capture.
- */
-public final class CaptureActivityHandler extends Handler {
- private static final String TAG = CaptureActivityHandler.class.getSimpleName();
-
- public interface DecodeCallback {
- void handleDecode(Result result, Bitmap barcode);
- void drawViewfinder();
- }
-
- private State state;
- private enum State {
- PREVIEW,
- SUCCESS,
- DONE
- }
-
- private final Activity activity;
- private final DecodeThread decodeThread;
- private DecodeCallback decodeCallback;
- public CaptureActivityHandler(CaptureActivity activity, Vector decodeFormats,
- String characterSet, ViewfinderView viewfinderView, DecodeCallback decodeCallback) {
- this.activity = activity;
- this.decodeCallback = decodeCallback;
-
- decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
- new ViewfinderResultPointCallback(viewfinderView));
- decodeThread.start();
- state = State.SUCCESS;
- // Start ourselves capturing previews and decoding.
- CameraManager.get().startPreview();
- restartPreviewAndDecode();
- }
-
- @Override
- public void handleMessage(Message message) {
- if (message.what == R.id.auto_focus) {
- //Log.d(TAG, "Got auto-focus message");
- // When one auto focus pass finishes, start another. This is the closest thing to
- // continuous AF. It does seem to hunt a bit, but I'm not sure what else to do.
- if (state == State.PREVIEW) {
- CameraManager.get().requestAutoFocus(this, R.id.auto_focus);
- }
- }else if (message.what == R.id.restart_preview) {
- Log.d(TAG, "Got restart preview message");
- restartPreviewAndDecode();
- }else if (message.what == R.id.decode_succeeded) {
- Log.d(TAG, "Got decode succeeded message");
- state = State.SUCCESS;
- Bundle bundle = message.getData();
-
- /***********************************************************************/
- Bitmap barcode = bundle == null ? null :
- (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);//���ñ����߳�
-
- decodeCallback.handleDecode((Result) message.obj, barcode);//���ؽ��
- /***********************************************************************/
- }else if (message.what == R.id.decode_failed) {
- // We're decoding as fast as possible, so when one decode fails, start another.
- state = State.PREVIEW;
- CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode);
- }else if (message.what == R.id.return_scan_result) {
- Log.d(TAG, "Got return scan result message");
- activity.setResult(Activity.RESULT_OK, (Intent) message.obj);
- activity.finish();
- }else if (message.what == R.id.launch_product_query) {
- Log.d(TAG, "Got product query message");
- String url = (String) message.obj;
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
- activity.startActivity(intent);
- }
- }
-
- public void quitSynchronously() {
- state = State.DONE;
- CameraManager.get().stopPreview();
- Message quit = Message.obtain(decodeThread.getHandler(), R.id.quit);
- quit.sendToTarget();
- try {
- decodeThread.join();
- } catch (InterruptedException e) {
- // continue
- }
-
- // Be absolutely sure we don't send any queued up messages
- removeMessages(R.id.decode_succeeded);
- removeMessages(R.id.decode_failed);
- }
-
- private void restartPreviewAndDecode() {
- if (state == State.SUCCESS) {
- state = State.PREVIEW;
- CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode);
- CameraManager.get().requestAutoFocus(this, R.id.auto_focus);
- decodeCallback.drawViewfinder();
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeFormatManager.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeFormatManager.java
deleted file mode 100644
index 91ddce0..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeFormatManager.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-import java.util.regex.Pattern;
-
-import android.content.Intent;
-import android.net.Uri;
-import com.google.zxing.BarcodeFormat;
-
-final class DecodeFormatManager {
-
- private static final Pattern COMMA_PATTERN = Pattern.compile(",");
-
- static final Vector PRODUCT_FORMATS;
- static final Vector ONE_D_FORMATS;
- static final Vector QR_CODE_FORMATS;
- static final Vector DATA_MATRIX_FORMATS;
- static {
- PRODUCT_FORMATS = new Vector(5);
- PRODUCT_FORMATS.add(BarcodeFormat.UPC_A);
- PRODUCT_FORMATS.add(BarcodeFormat.UPC_E);
- PRODUCT_FORMATS.add(BarcodeFormat.EAN_13);
- PRODUCT_FORMATS.add(BarcodeFormat.EAN_8);
- PRODUCT_FORMATS.add(BarcodeFormat.RSS14);
- ONE_D_FORMATS = new Vector(PRODUCT_FORMATS.size() + 4);
- ONE_D_FORMATS.addAll(PRODUCT_FORMATS);
- ONE_D_FORMATS.add(BarcodeFormat.CODE_39);
- ONE_D_FORMATS.add(BarcodeFormat.CODE_93);
- ONE_D_FORMATS.add(BarcodeFormat.CODE_128);
- ONE_D_FORMATS.add(BarcodeFormat.ITF);
- QR_CODE_FORMATS = new Vector(1);
- QR_CODE_FORMATS.add(BarcodeFormat.QR_CODE);
- DATA_MATRIX_FORMATS = new Vector(1);
- DATA_MATRIX_FORMATS.add(BarcodeFormat.DATA_MATRIX);
- }
-
- private DecodeFormatManager() {}
-
- static Vector parseDecodeFormats(Intent intent) {
- List scanFormats = null;
- String scanFormatsString = intent.getStringExtra(Intents.Scan.SCAN_FORMATS);
- if (scanFormatsString != null) {
- scanFormats = Arrays.asList(COMMA_PATTERN.split(scanFormatsString));
- }
- return parseDecodeFormats(scanFormats, intent.getStringExtra(Intents.Scan.MODE));
- }
-
- static Vector parseDecodeFormats(Uri inputUri) {
- List formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
- if (formats != null && formats.size() == 1 && formats.get(0) != null){
- formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
- }
- return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
- }
-
- private static Vector parseDecodeFormats(Iterable scanFormats,
- String decodeMode) {
- if (scanFormats != null) {
- Vector formats = new Vector();
- try {
- for (String format : scanFormats) {
- formats.add(BarcodeFormat.valueOf(format));
- }
- return formats;
- } catch (IllegalArgumentException iae) {
- // ignore it then
- }
- }
- if (decodeMode != null) {
- if (Intents.Scan.PRODUCT_MODE.equals(decodeMode)) {
- return PRODUCT_FORMATS;
- }
- if (Intents.Scan.QR_CODE_MODE.equals(decodeMode)) {
- return QR_CODE_FORMATS;
- }
- if (Intents.Scan.DATA_MATRIX_MODE.equals(decodeMode)) {
- return DATA_MATRIX_FORMATS;
- }
- if (Intents.Scan.ONE_D_MODE.equals(decodeMode)) {
- return ONE_D_FORMATS;
- }
- }
- return null;
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeHandler.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeHandler.java
deleted file mode 100644
index 83b3a4f..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeHandler.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-import java.util.Hashtable;
-
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.util.Log;
-
-import com.ericssonlabs.R;
-import com.google.zxing.BinaryBitmap;
-import com.google.zxing.DecodeHintType;
-import com.google.zxing.MultiFormatReader;
-import com.google.zxing.ReaderException;
-import com.google.zxing.Result;
-import com.google.zxing.common.HybridBinarizer;
-import com.zxing.activity.CaptureActivity;
-import com.zxing.camera.CameraManager;
-import com.zxing.camera.PlanarYUVLuminanceSource;
-
-final class DecodeHandler extends Handler {
-
- private static final String TAG = DecodeHandler.class.getSimpleName();
-
- private final CaptureActivity activity;
- private final MultiFormatReader multiFormatReader;
-
- DecodeHandler(CaptureActivity activity, Hashtable hints) {
- multiFormatReader = new MultiFormatReader();
- multiFormatReader.setHints(hints);
- this.activity = activity;
- }
-
- @Override
- public void handleMessage(Message message) {
- if (message.what == R.id.decode) {
- //Log.d(TAG, "Got decode message");
- decode((byte[]) message.obj, message.arg1, message.arg2);
- }else if (message.what == R.id.quit) {
- Looper.myLooper().quit();
- }
- }
-
- /**
- * Decode the data within the viewfinder rectangle, and time how long it took. For efficiency,
- * reuse the same reader objects from one decode to the next.
- *
- * @param data The YUV preview frame.
- * @param width The width of the preview frame.
- * @param height The height of the preview frame.
- */
- private void decode(byte[] data, int width, int height) {
- long start = System.currentTimeMillis();
- Result rawResult = null;
-
- //modify here
- byte[] rotatedData = new byte[data.length];
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++)
- rotatedData[x * height + height - y - 1] = data[x + y * width];
- }
- int tmp = width; // Here we are swapping, that's the difference to #11
- width = height;
- height = tmp;
-
- PlanarYUVLuminanceSource source = CameraManager.get().buildLuminanceSource(rotatedData, width, height);
- BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
- try {
- rawResult = multiFormatReader.decodeWithState(bitmap);
- } catch (ReaderException re) {
- // continue
- } finally {
- multiFormatReader.reset();
- }
-
- if (rawResult != null) {
- long end = System.currentTimeMillis();
- Log.d(TAG, "Found barcode (" + (end - start) + " ms):\n" + rawResult.toString());
- Message message = Message.obtain(activity.getHandler(), R.id.decode_succeeded, rawResult);
- Bundle bundle = new Bundle();
- bundle.putParcelable(DecodeThread.BARCODE_BITMAP, source.renderCroppedGreyscaleBitmap());
- message.setData(bundle);
- //Log.d(TAG, "Sending decode succeeded message...");
- message.sendToTarget();
- } else {
- Message message = Message.obtain(activity.getHandler(), R.id.decode_failed);
- message.sendToTarget();
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeThread.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeThread.java
deleted file mode 100644
index 028c147..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/DecodeThread.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2008 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.concurrent.CountDownLatch;
-
-import android.os.Handler;
-import android.os.Looper;
-
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.DecodeHintType;
-import com.google.zxing.ResultPointCallback;
-import com.zxing.activity.CaptureActivity;
-
-/**
- * This thread does all the heavy lifting of decoding the images.
- * 编码线程
- */
-final class DecodeThread extends Thread {
-
- public static final String BARCODE_BITMAP = "barcode_bitmap";
- private final CaptureActivity activity;
- private final Hashtable hints;
- private Handler handler;
- private final CountDownLatch handlerInitLatch;
-
- DecodeThread(CaptureActivity activity,
- Vector decodeFormats,
- String characterSet,
- ResultPointCallback resultPointCallback) {
-
- this.activity = activity;
- handlerInitLatch = new CountDownLatch(1);
-
- hints = new Hashtable(3);
-
- if (decodeFormats == null || decodeFormats.isEmpty()) {
- decodeFormats = new Vector();
- decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
- decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
- decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
- }
-
- hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
-
- if (characterSet != null) {
- hints.put(DecodeHintType.CHARACTER_SET, characterSet);
- }
-
- hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
- }
-
- Handler getHandler() {
- try {
- handlerInitLatch.await();
- } catch (InterruptedException ie) {
- // continue?
- }
- return handler;
- }
-
- @Override
- public void run() {
- Looper.prepare();
- handler = new DecodeHandler(activity, hints);
- handlerInitLatch.countDown();
- Looper.loop();
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/FinishListener.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/FinishListener.java
deleted file mode 100644
index 06679ba..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/FinishListener.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-
-import android.app.Activity;
-import android.content.DialogInterface;
-
-/**
- * Simple listener used to exit the app in a few cases.
- *
- */
-public final class FinishListener
- implements DialogInterface.OnClickListener, DialogInterface.OnCancelListener, Runnable {
-
- private final Activity activityToFinish;
-
- public FinishListener(Activity activityToFinish) {
- this.activityToFinish = activityToFinish;
- }
-
- public void onCancel(DialogInterface dialogInterface) {
- run();
- }
-
- public void onClick(DialogInterface dialogInterface, int i) {
- run();
- }
-
- public void run() {
- activityToFinish.finish();
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/InactivityTimer.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/InactivityTimer.java
deleted file mode 100644
index c56087d..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/InactivityTimer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2010 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
-import android.app.Activity;
-
-/**
- * Finishes an activity after a period of inactivity.
- */
-public final class InactivityTimer {
-
- private static final int INACTIVITY_DELAY_SECONDS = 5 * 60;
-
- private final ScheduledExecutorService inactivityTimer =
- Executors.newSingleThreadScheduledExecutor(new DaemonThreadFactory());
- private final Activity activity;
- private ScheduledFuture> inactivityFuture = null;
-
- public InactivityTimer(Activity activity) {
- this.activity = activity;
- onActivity();
- }
-
- public void onActivity() {
- cancel();
- inactivityFuture = inactivityTimer.schedule(new FinishListener(activity),
- INACTIVITY_DELAY_SECONDS,
- TimeUnit.SECONDS);
- }
-
- private void cancel() {
- if (inactivityFuture != null) {
- inactivityFuture.cancel(true);
- inactivityFuture = null;
- }
- }
-
- public void shutdown() {
- cancel();
- inactivityTimer.shutdown();
- }
-
- private static final class DaemonThreadFactory implements ThreadFactory {
- public Thread newThread(Runnable runnable) {
- Thread thread = new Thread(runnable);
- thread.setDaemon(true);
- return thread;
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/Intents.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/Intents.java
deleted file mode 100644
index 88acdaf..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/decoding/Intents.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2008 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.decoding;
-
-/**
- * This class provides the constants to use when sending an Intent to Barcode Scanner.
- * These strings are effectively API and cannot be changed.
- */
-public final class Intents {
- private Intents() {
- }
-
- public static final class Scan {
- /**
- * Send this intent to open the Barcodes app in scanning mode, find a barcode, and return
- * the results.
- */
- public static final String ACTION = "com.google.zxing.client.android.SCAN";
-
- /**
- * By default, sending Scan.ACTION will decode all barcodes that we understand. However it
- * may be useful to limit scanning to certain formats. Use Intent.putExtra(MODE, value) with
- * one of the values below ({@link #PRODUCT_MODE}, {@link #ONE_D_MODE}, {@link #QR_CODE_MODE}).
- * Optional.
- *
- * Setting this is effectively shorthnad for setting explicit formats with {@link #SCAN_FORMATS}.
- * It is overridden by that setting.
- */
- public static final String MODE = "SCAN_MODE";
-
- /**
- * Comma-separated list of formats to scan for. The values must match the names of
- * {@link com.google.zxing.BarcodeFormat}s, such as {@link com.google.zxing.BarcodeFormat#EAN_13}.
- * Example: "EAN_13,EAN_8,QR_CODE"
- *
- * This overrides {@link #MODE}.
- */
- public static final String SCAN_FORMATS = "SCAN_FORMATS";
-
- /**
- * @see com.google.zxing.DecodeHintType#CHARACTER_SET
- */
- public static final String CHARACTER_SET = "CHARACTER_SET";
-
- /**
- * Decode only UPC and EAN barcodes. This is the right choice for shopping apps which get
- * prices, reviews, etc. for products.
- */
- public static final String PRODUCT_MODE = "PRODUCT_MODE";
-
- /**
- * Decode only 1D barcodes (currently UPC, EAN, Code 39, and Code 128).
- */
- public static final String ONE_D_MODE = "ONE_D_MODE";
-
- /**
- * Decode only QR codes.
- */
- public static final String QR_CODE_MODE = "QR_CODE_MODE";
-
- /**
- * Decode only Data Matrix codes.
- */
- public static final String DATA_MATRIX_MODE = "DATA_MATRIX_MODE";
-
- /**
- * If a barcode is found, Barcodes returns RESULT_OK to onActivityResult() of the app which
- * requested the scan via startSubActivity(). The barcodes contents can be retrieved with
- * intent.getStringExtra(RESULT). If the user presses Back, the result code will be
- * RESULT_CANCELED.
- */
- public static final String RESULT = "SCAN_RESULT";
-
- /**
- * Call intent.getStringExtra(RESULT_FORMAT) to determine which barcode format was found.
- * See Contents.Format for possible values.
- */
- public static final String RESULT_FORMAT = "SCAN_RESULT_FORMAT";
-
- /**
- * Setting this to false will not save scanned codes in the history.
- */
- public static final String SAVE_HISTORY = "SAVE_HISTORY";
-
- private Scan() {
- }
- }
-
- public static final class Encode {
- /**
- * Send this intent to encode a piece of data as a QR code and display it full screen, so
- * that another person can scan the barcode from your screen.
- */
- public static final String ACTION = "com.google.zxing.client.android.ENCODE";
-
- /**
- * The data to encode. Use Intent.putExtra(DATA, data) where data is either a String or a
- * Bundle, depending on the type and format specified. Non-QR Code formats should
- * just use a String here. For QR Code, see Contents for details.
- */
- public static final String DATA = "ENCODE_DATA";
-
- /**
- * The type of data being supplied if the format is QR Code. Use
- * Intent.putExtra(TYPE, type) with one of Contents.Type.
- */
- public static final String TYPE = "ENCODE_TYPE";
-
- /**
- * The barcode format to be displayed. If this isn't specified or is blank,
- * it defaults to QR Code. Use Intent.putExtra(FORMAT, format), where
- * format is one of Contents.Format.
- */
- public static final String FORMAT = "ENCODE_FORMAT";
-
- private Encode() {
- }
- }
-
- public static final class SearchBookContents {
- /**
- * Use Google Book Search to search the contents of the book provided.
- */
- public static final String ACTION = "com.google.zxing.client.android.SEARCH_BOOK_CONTENTS";
-
- /**
- * The book to search, identified by ISBN number.
- */
- public static final String ISBN = "ISBN";
-
- /**
- * An optional field which is the text to search for.
- */
- public static final String QUERY = "QUERY";
-
- private SearchBookContents() {
- }
- }
-
- public static final class WifiConnect {
- /**
- * Internal intent used to trigger connection to a wi-fi network.
- */
- public static final String ACTION = "com.google.zxing.client.android.WIFI_CONNECT";
-
- /**
- * The network to connect to, all the configuration provided here.
- */
- public static final String SSID = "SSID";
-
- /**
- * The network to connect to, all the configuration provided here.
- */
- public static final String TYPE = "TYPE";
-
- /**
- * The network to connect to, all the configuration provided here.
- */
- public static final String PASSWORD = "PASSWORD";
-
- private WifiConnect() {
- }
- }
-
-
- public static final class Share {
- /**
- * Give the user a choice of items to encode as a barcode, then render it as a QR Code and
- * display onscreen for a friend to scan with their phone.
- */
- public static final String ACTION = "com.google.zxing.client.android.SHARE";
-
- private Share() {
- }
- }
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/encoding/EncodingHandler.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/encoding/EncodingHandler.java
deleted file mode 100644
index bd1aa00..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/encoding/EncodingHandler.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.zxing.encoding;
-
-import java.util.Hashtable;
-
-import android.graphics.Bitmap;
-
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.EncodeHintType;
-import com.google.zxing.MultiFormatWriter;
-import com.google.zxing.WriterException;
-import com.google.zxing.common.BitMatrix;
-/**
- * @author Ryan Tang
- *
- */
-public final class EncodingHandler {
- private static final int BLACK = 0xff000000;
-
- public static Bitmap createQRCode(String str,int widthAndHeight) throws WriterException {
- Hashtable hints = new Hashtable();
- hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
- BitMatrix matrix = new MultiFormatWriter().encode(str,
- BarcodeFormat.QR_CODE, widthAndHeight, widthAndHeight);
- int width = matrix.getWidth();
- int height = matrix.getHeight();
- int[] pixels = new int[width * height];
-
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
- if (matrix.get(x, y)) {
- pixels[y * width + x] = BLACK;
- }
- }
- }
- Bitmap bitmap = Bitmap.createBitmap(width, height,
- Bitmap.Config.ARGB_8888);
- bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
- return bitmap;
- }
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/view/ViewfinderResultPointCallback.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/view/ViewfinderResultPointCallback.java
deleted file mode 100644
index 8119fdb..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/view/ViewfinderResultPointCallback.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.view;
-
-import com.google.zxing.ResultPoint;
-import com.google.zxing.ResultPointCallback;
-
-public final class ViewfinderResultPointCallback implements ResultPointCallback {
-
- private final ViewfinderView viewfinderView;
-
- public ViewfinderResultPointCallback(ViewfinderView viewfinderView) {
- this.viewfinderView = viewfinderView;
- }
-
- public void foundPossibleResultPoint(ResultPoint point) {
- viewfinderView.addPossibleResultPoint(point);
- }
-
-}
diff --git a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/view/ViewfinderView.java b/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/view/ViewfinderView.java
deleted file mode 100644
index 7622cab..0000000
--- a/ZBLibrary(ADT)/QRCodeLibrary/src/com/zxing/view/ViewfinderView.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2008 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.zxing.view;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Rect;
-import android.util.AttributeSet;
-import android.view.View;
-
-import com.ericssonlabs.R;
-import com.google.zxing.ResultPoint;
-import com.zxing.camera.CameraManager;
-
-/**
- * This view is overlaid on top of the camera preview. It adds the viewfinder rectangle and partial
- * transparency outside it, as well as the laser scanner animation and result points.
- * 二维码扫描解析框
- */
-public final class ViewfinderView extends View {
-
- private static final int[] SCANNER_ALPHA = {0, 64, 128, 192, 255, 192, 128, 64};
- private static final long ANIMATION_DELAY = 100L;
- private static final int OPAQUE = 0xFF;
-
- private final Paint paint;
- private Bitmap resultBitmap;
- private final int maskColor;
- private final int resultColor;
- private final int frameColor;
- private final int laserColor;
- private final int resultPointColor;
- private int scannerAlpha;
- private Collection possibleResultPoints;
- private Collection lastPossibleResultPoints;
-
- // This constructor is used when the class is built from an XML resource.
- public ViewfinderView(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- // Initialize these once for performance rather than calling them every time in onDraw().
- paint = new Paint();
- Resources resources = getResources();
- maskColor = resources.getColor(R.color.viewfinder_mask);
- resultColor = resources.getColor(R.color.result_view);
- frameColor = resources.getColor(R.color.viewfinder_frame);
- laserColor = resources.getColor(R.color.viewfinder_laser);
- resultPointColor = resources.getColor(R.color.possible_result_points);
- scannerAlpha = 0;
- possibleResultPoints = new HashSet(5);
- }
-
- @Override
- public void onDraw(Canvas canvas) {
- Rect frame = CameraManager.get().getFramingRect();
- if (frame == null) {
- return;
- }
- int width = canvas.getWidth();
- int height = canvas.getHeight();
-
- // Draw the exterior (i.e. outside the framing rect) darkened
- paint.setColor(resultBitmap != null ? resultColor : maskColor);
- canvas.drawRect(0, 0, width, frame.top, paint);
- canvas.drawRect(0, frame.top, frame.left, frame.bottom + 1, paint);
- canvas.drawRect(frame.right + 1, frame.top, width, frame.bottom + 1, paint);
- canvas.drawRect(0, frame.bottom + 1, width, height, paint);
-
- if (resultBitmap != null) {
- // Draw the opaque result bitmap over the scanning rectangle
- paint.setAlpha(OPAQUE);
- canvas.drawBitmap(resultBitmap, frame.left, frame.top, paint);
- } else {
-
- // Draw a two pixel solid black border inside the framing rect
- paint.setColor(frameColor);
- canvas.drawRect(frame.left, frame.top, frame.right + 1, frame.top + 2, paint);
- canvas.drawRect(frame.left, frame.top + 2, frame.left + 2, frame.bottom - 1, paint);
- canvas.drawRect(frame.right - 1, frame.top, frame.right + 1, frame.bottom - 1, paint);
- canvas.drawRect(frame.left, frame.bottom - 1, frame.right + 1, frame.bottom + 1, paint);
-
- // Draw a red "laser scanner" line through the middle to show decoding is active
- paint.setColor(laserColor);
- paint.setAlpha(SCANNER_ALPHA[scannerAlpha]);
- scannerAlpha = (scannerAlpha + 1) % SCANNER_ALPHA.length;
- int middle = frame.height() / 2 + frame.top;
- canvas.drawRect(frame.left + 2, middle - 1, frame.right - 1, middle + 2, paint);
-
- Collection currentPossible = possibleResultPoints;
- Collection currentLast = lastPossibleResultPoints;
- if (currentPossible.isEmpty()) {
- lastPossibleResultPoints = null;
- } else {
- possibleResultPoints = new HashSet(5);
- lastPossibleResultPoints = currentPossible;
- paint.setAlpha(OPAQUE);
- paint.setColor(resultPointColor);
- for (ResultPoint point : currentPossible) {
- canvas.drawCircle(frame.left + point.getX(), frame.top + point.getY(), 6.0f, paint);
- }
- }
- if (currentLast != null) {
- paint.setAlpha(OPAQUE / 2);
- paint.setColor(resultPointColor);
- for (ResultPoint point : currentLast) {
- canvas.drawCircle(frame.left + point.getX(), frame.top + point.getY(), 3.0f, paint);
- }
- }
-
- // Request another update at the animation interval, but only repaint the laser line,
- // not the entire viewfinder mask.
- postInvalidateDelayed(ANIMATION_DELAY, frame.left, frame.top, frame.right, frame.bottom);
- }
- }
-
- public void drawViewfinder() {
- resultBitmap = null;
- invalidate();
- }
-
- /**
- * Draw a bitmap with the result points highlighted instead of the live scanning display.
- *
- * @param barcode An image of the decoded barcode.
- */
- public void drawResultBitmap(Bitmap barcode) {
- resultBitmap = barcode;
- invalidate();
- }
-
- public void addPossibleResultPoint(ResultPoint point) {
- possibleResultPoints.add(point);
- }
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/.classpath b/ZBLibrary(ADT)/ZBLibrary/.classpath
deleted file mode 100755
index 5176974..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/.project b/ZBLibrary(ADT)/ZBLibrary/.project
deleted file mode 100755
index 417c0d5..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- ZBLibrary
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/.settings/org.eclipse.jdt.core.prefs b/ZBLibrary(ADT)/ZBLibrary/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7341ab1..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,11 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/ZBLibrary(ADT)/ZBLibrary/AndroidManifest.xml b/ZBLibrary(ADT)/ZBLibrary/AndroidManifest.xml
deleted file mode 100755
index 1e7a2dd..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/AndroidManifest.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/ic_launcher-web.png b/ZBLibrary(ADT)/ZBLibrary/ic_launcher-web.png
deleted file mode 100755
index a18cbb4..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/ic_launcher-web.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/libs/android-support-v4.jar b/ZBLibrary(ADT)/ZBLibrary/libs/android-support-v4.jar
deleted file mode 100755
index 1780ad3..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/libs/android-support-v4.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/libs/fastjson-1.2.24.jar b/ZBLibrary(ADT)/ZBLibrary/libs/fastjson-1.2.24.jar
deleted file mode 100644
index 4a6652f..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/libs/fastjson-1.2.24.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/libs/glide-full-4.1.1.jar b/ZBLibrary(ADT)/ZBLibrary/libs/glide-full-4.1.1.jar
deleted file mode 100644
index 62f4d35..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/libs/glide-full-4.1.1.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/libs/okhttp-2.1.0.jar b/ZBLibrary(ADT)/ZBLibrary/libs/okhttp-2.1.0.jar
deleted file mode 100755
index 837defb..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/libs/okhttp-2.1.0.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/libs/okio-1.0.0.jar b/ZBLibrary(ADT)/ZBLibrary/libs/okio-1.0.0.jar
deleted file mode 100644
index 909cfa9..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/libs/okio-1.0.0.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/libs/universal-image-loader-1.9.4.jar b/ZBLibrary(ADT)/ZBLibrary/libs/universal-image-loader-1.9.4.jar
deleted file mode 100755
index 871d0e8..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/libs/universal-image-loader-1.9.4.jar and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/lint.xml b/ZBLibrary(ADT)/ZBLibrary/lint.xml
deleted file mode 100755
index ee0eead..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/lint.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/proguard-project.txt b/ZBLibrary(ADT)/ZBLibrary/proguard-project.txt
deleted file mode 100755
index f2fe155..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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 *;
-#}
diff --git a/ZBLibrary(ADT)/ZBLibrary/project.properties b/ZBLibrary(ADT)/ZBLibrary/project.properties
deleted file mode 100755
index 7f590e4..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/project.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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-21
-android.library=true
-android.library.reference.1=../recyclerview
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_push_in.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_push_in.xml
deleted file mode 100755
index 852407e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_push_in.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_push_out.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_push_out.xml
deleted file mode 100755
index 69a4802..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_push_out.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_window_enter.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_window_enter.xml
deleted file mode 100755
index d37df4a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_window_enter.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_window_exit.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_window_exit.xml
deleted file mode 100755
index b02a60d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/bottom_window_exit.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/fade.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/fade.xml
deleted file mode 100755
index e4755aa..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/fade.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/hold.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/hold.xml
deleted file mode 100755
index 2016a1e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/hold.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/left_push_in.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/left_push_in.xml
deleted file mode 100755
index 15b2d53..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/left_push_in.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/left_push_out.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/left_push_out.xml
deleted file mode 100755
index 821dabe..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/left_push_out.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/null_anim.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/null_anim.xml
deleted file mode 100755
index aeeb343..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/null_anim.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/push_in.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/push_in.xml
deleted file mode 100755
index f3785ee..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/push_in.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/push_out.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/push_out.xml
deleted file mode 100755
index c6dc25e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/push_out.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/right_push_in.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/right_push_in.xml
deleted file mode 100755
index 053ccc8..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/right_push_in.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/anim/right_push_out.xml b/ZBLibrary(ADT)/ZBLibrary/res/anim/right_push_out.xml
deleted file mode 100755
index 11a5d05..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/anim/right_push_out.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/color/alpha_to_darker.xml b/ZBLibrary(ADT)/ZBLibrary/res/color/alpha_to_darker.xml
deleted file mode 100644
index e770f7b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/color/alpha_to_darker.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/color/black_to_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/color/black_to_white.xml
deleted file mode 100644
index f7754d7..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/color/black_to_white.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/color/white_to_black.xml b/ZBLibrary(ADT)/ZBLibrary/res/color/white_to_black.xml
deleted file mode 100644
index 463db03..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/color/white_to_black.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add.png
deleted file mode 100644
index ad8ada6..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add_light.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add_light.png
deleted file mode 100644
index 5741995..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add_light.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add_small.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add_small.png
deleted file mode 100644
index 4d5d484..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/add_small.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/back2.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/back2.png
deleted file mode 100644
index 64538ce..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/back2.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/back2_light.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/back2_light.png
deleted file mode 100644
index 23778ae..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/back2_light.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/cancel.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/cancel.png
deleted file mode 100644
index 094eea5..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/cancel.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/cancel_light.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/cancel_light.png
deleted file mode 100644
index cde36e1..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/cancel_light.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/forward2_light.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/forward2_light.png
deleted file mode 100644
index e6495b2..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/forward2_light.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/forward_light.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/forward_light.png
deleted file mode 100644
index 812b3aa..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/forward_light.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/triangle_down.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/triangle_down.png
deleted file mode 100644
index a7580bd..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/triangle_down.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/triangle_up.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/triangle_up.png
deleted file mode 100644
index f094aa2..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/triangle_up.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/up_light.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/up_light.png
deleted file mode 100644
index bd405ba..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/up_light.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/xlistview_arrow.png b/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/xlistview_arrow.png
deleted file mode 100644
index 511fa31..0000000
Binary files a/ZBLibrary(ADT)/ZBLibrary/res/drawable-hdpi/xlistview_arrow.png and /dev/null differ
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/alpha3.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/alpha3.xml
deleted file mode 100755
index 12e6779..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/alpha3.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/alpha_to_darker.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/alpha_to_darker.xml
deleted file mode 100755
index e19ad75..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/alpha_to_darker.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/black_to_white_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/black_to_white_alpha.xml
deleted file mode 100755
index 3e056fc..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/black_to_white_alpha.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_bg.xml
deleted file mode 100755
index 9ba563e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_bg.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg.xml
deleted file mode 100755
index 4852bbd..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg_normal.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg_normal.xml
deleted file mode 100755
index d534bae..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg_normal.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg_pressed.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg_pressed.xml
deleted file mode 100755
index 61d63fd..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_cancel_bg_pressed.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_item_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_item_bg.xml
deleted file mode 100755
index da1d95b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/bottom_menu_item_bg.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_bg.xml
deleted file mode 100755
index 8be148b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_normal_shape.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_normal_shape.xml
deleted file mode 100755
index a374337..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_normal_shape.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_pressed_shape.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_pressed_shape.xml
deleted file mode 100755
index 02cc4c1..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_pressed_shape.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg.xml
deleted file mode 100755
index ceb8dd9..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg_normal.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg_normal.xml
deleted file mode 100755
index f612005..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg_normal.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg_pressed.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg_pressed.xml
deleted file mode 100755
index ce7145c..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_bg_pressed.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_big_normal.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_big_normal.xml
deleted file mode 100755
index 1c827b0..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_big_normal.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_big_pressed.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_big_pressed.xml
deleted file mode 100755
index 1c827b0..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_round_big_pressed.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_selector.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_selector.xml
deleted file mode 100755
index d0de29d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_selector.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_sky_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_sky_bg.xml
deleted file mode 100755
index 2e58213..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_sky_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_small.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_small.xml
deleted file mode 100755
index 8c0184b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_blue_small.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_green_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_green_bg.xml
deleted file mode 100755
index 1a8811c..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_green_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_orange_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_orange_bg.xml
deleted file mode 100755
index f09465d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_orange_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg.xml
deleted file mode 100644
index f64f2b7..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg_normal.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg_normal.xml
deleted file mode 100644
index d7d1a6d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg_normal.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg_pressed.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg_pressed.xml
deleted file mode 100644
index b058756..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/btn_red_round_bg_pressed.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/cilcle_gray.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/cilcle_gray.xml
deleted file mode 100755
index 184eaa4..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/cilcle_gray.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/cilcle_gray_to_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/cilcle_gray_to_white.xml
deleted file mode 100755
index b90af4a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/cilcle_gray_to_white.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_blue.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_blue.xml
deleted file mode 100755
index c0fa8f8..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_blue.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_green.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_green.xml
deleted file mode 100755
index d59d4a4..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_green.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_pink.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_pink.xml
deleted file mode 100755
index bfd375d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_pink.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_white.xml
deleted file mode 100755
index d709e8b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_white.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_yellow.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_yellow.xml
deleted file mode 100755
index 5654918..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/circle_yellow.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg.xml
deleted file mode 100755
index 1f7eed1..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg_common.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg_common.xml
deleted file mode 100755
index 717cfc2..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg_common.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg_rec.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg_rec.xml
deleted file mode 100755
index 9f28ff7..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_bg_rec.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_btn_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_btn_bg.xml
deleted file mode 100755
index 720bd8c..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_btn_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_left_btn_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_left_btn_bg.xml
deleted file mode 100755
index a6c534a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_left_btn_bg.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_right_btn_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_right_btn_bg.xml
deleted file mode 100755
index 1ce4bed..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/dialog_right_btn_bg.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_cusor.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_cusor.xml
deleted file mode 100755
index 061f6a8..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_cusor.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_item_text_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_item_text_bg.xml
deleted file mode 100755
index 7828dc4..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_item_text_bg.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_text_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_text_bg.xml
deleted file mode 100755
index 8ef6f28..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/edit_text_bg.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/gray_to_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/gray_to_alpha.xml
deleted file mode 100755
index f59cfad..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/gray_to_alpha.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/green_to_darker.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/green_to_darker.xml
deleted file mode 100755
index 38fada5..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/green_to_darker.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/icon_gray_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/icon_gray_bg.xml
deleted file mode 100755
index 25f5b98..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/icon_gray_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/icon_white_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/icon_white_bg.xml
deleted file mode 100755
index 720bd8c..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/icon_white_bg.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/input_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/input_bg.xml
deleted file mode 100755
index 08e06b3..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/input_bg.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/input_bg_pressed.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/input_bg_pressed.xml
deleted file mode 100755
index d54f9b8..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/input_bg_pressed.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/list_item_bg.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/list_item_bg.xml
deleted file mode 100755
index 53467a2..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/list_item_bg.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/list_item_blank_divider.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/list_item_blank_divider.xml
deleted file mode 100755
index 16b1a8a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/list_item_blank_divider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/null_drawable.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/null_drawable.xml
deleted file mode 100755
index a8b409b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/null_drawable.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/oval_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/oval_alpha.xml
deleted file mode 100644
index f8681ae..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/oval_alpha.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/oval_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/oval_white.xml
deleted file mode 100755
index bf5740f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/oval_white.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/progress_horizontal.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/progress_horizontal.xml
deleted file mode 100755
index 900abda..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/progress_horizontal.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_alpha.xml
deleted file mode 100644
index cb0820a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_alpha.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_empty_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_empty_white.xml
deleted file mode 100755
index 4123425..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_empty_white.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_green.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_green.xml
deleted file mode 100755
index 9b0d8aa..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/round_green.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/square_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/square_alpha.xml
deleted file mode 100644
index eb11775..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/square_alpha.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_center_selector.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_center_selector.xml
deleted file mode 100755
index 887dea1..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_center_selector.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_left_full_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_left_full_white.xml
deleted file mode 100755
index d34ec69..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_left_full_white.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_left_selector.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_left_selector.xml
deleted file mode 100755
index c0298ef..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_left_selector.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_right_full_white.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_right_full_white.xml
deleted file mode 100755
index f1ffb11..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_right_full_white.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_right_selector.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_right_selector.xml
deleted file mode 100755
index 0c0b5ae..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/tab_bg_right_selector.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_alpha.xml
deleted file mode 100755
index dcb64ad..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_alpha.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_gray_slight.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_gray_slight.xml
deleted file mode 100755
index e3995c3..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_gray_slight.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_white_slight.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_white_slight.xml
deleted file mode 100755
index 4ecd385..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/to_white_slight.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/white_to_alpha.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/white_to_alpha.xml
deleted file mode 100755
index 510f7ed..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/white_to_alpha.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/drawable/white_to_gray.xml b/ZBLibrary(ADT)/ZBLibrary/res/drawable/white_to_gray.xml
deleted file mode 100755
index 761f188..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/drawable/white_to_gray.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/alert_dialog.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/alert_dialog.xml
deleted file mode 100755
index 84b36a4..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/alert_dialog.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_list_fragment.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/base_list_fragment.xml
deleted file mode 100755
index 61be175..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_list_fragment.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_recycler_fragment.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/base_recycler_fragment.xml
deleted file mode 100644
index e4a12b5..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_recycler_fragment.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_tab_activity.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/base_tab_activity.xml
deleted file mode 100755
index 2eee04d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_tab_activity.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_view_bottom_window.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/base_view_bottom_window.xml
deleted file mode 100755
index c984c55..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/base_view_bottom_window.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/blank_middle.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/blank_middle.xml
deleted file mode 100755
index 169d13f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/blank_middle.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_item.xml
deleted file mode 100755
index 723dc0b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_item.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_view.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_view.xml
deleted file mode 100755
index acf01d5..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_view.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_window.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_window.xml
deleted file mode 100755
index b3ece5d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/bottom_menu_window.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_horizontal.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_horizontal.xml
deleted file mode 100755
index 7d58096..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_horizontal.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_vertical_1dp.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_vertical_1dp.xml
deleted file mode 100755
index 7c18cc5..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_vertical_1dp.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_vertical_1px.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_vertical_1px.xml
deleted file mode 100755
index adf7f8f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/divider_vertical_1px.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/edit_text_info_activity.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/edit_text_info_activity.xml
deleted file mode 100755
index 02f8dec..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/edit_text_info_activity.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/edit_text_info_window.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/edit_text_info_window.xml
deleted file mode 100755
index c18b5c2..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/edit_text_info_window.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_item.xml
deleted file mode 100755
index 29b13ac..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_item.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_picker_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_picker_item.xml
deleted file mode 100755
index b089eb3..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_picker_item.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_picker_view.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_picker_view.xml
deleted file mode 100755
index be90908..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/grid_picker_view.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/icon_name_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/icon_name_item.xml
deleted file mode 100755
index edf1e66..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/icon_name_item.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/image_picker_activity.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/image_picker_activity.xml
deleted file mode 100755
index 05c74ce..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/image_picker_activity.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/image_picker_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/image_picker_item.xml
deleted file mode 100755
index 72a23ab..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/image_picker_item.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/item_dialog.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/item_dialog.xml
deleted file mode 100755
index 75681fb..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/item_dialog.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/item_dialog_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/item_dialog_item.xml
deleted file mode 100755
index bc35a4a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/item_dialog_item.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_divider.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_divider.xml
deleted file mode 100755
index e9e3959..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_divider.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_item.xml
deleted file mode 100755
index cdb02a0..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_item.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_item_2.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_item_2.xml
deleted file mode 100755
index 1f3de9e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/key_value_item_2.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/list_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/list_item.xml
deleted file mode 100755
index cfbe843..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/list_item.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/list_view.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/list_view.xml
deleted file mode 100755
index 9891d6f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/list_view.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/progress_circle_big.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/progress_circle_big.xml
deleted file mode 100755
index bb5d4f7..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/progress_circle_big.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/select_picture_activity.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/select_picture_activity.xml
deleted file mode 100755
index 4a2d759..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/select_picture_activity.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/server_setting_activity.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/server_setting_activity.xml
deleted file mode 100755
index b085718..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/server_setting_activity.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/square_menu.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/square_menu.xml
deleted file mode 100755
index 15e7487..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/square_menu.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_menu_list_item.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/top_menu_list_item.xml
deleted file mode 100755
index dbd18cb..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_menu_list_item.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_menu_window.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/top_menu_window.xml
deleted file mode 100755
index b195a24..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_menu_window.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_right_iv.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/top_right_iv.xml
deleted file mode 100755
index eb0c96a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_right_iv.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_right_tv.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/top_right_tv.xml
deleted file mode 100755
index 41f7883..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_right_tv.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_tab_tv_center.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/top_tab_tv_center.xml
deleted file mode 100755
index 0fe5a9f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_tab_tv_center.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_tab_view.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/top_tab_view.xml
deleted file mode 100755
index ec9cfdb..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/top_tab_view.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/web_view_activity.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/web_view_activity.xml
deleted file mode 100755
index 162329b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/web_view_activity.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/xlistview_footer.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/xlistview_footer.xml
deleted file mode 100755
index 97160e6..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/xlistview_footer.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/layout/xlistview_header.xml b/ZBLibrary(ADT)/ZBLibrary/res/layout/xlistview_header.xml
deleted file mode 100755
index 0d90a67..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/layout/xlistview_header.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/values/arrays.xml b/ZBLibrary(ADT)/ZBLibrary/res/values/arrays.xml
deleted file mode 100755
index 43a8f0e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/values/arrays.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
- - 不限
- - 男
- - 女
-
-
- - 不限
- - 20岁以下
- - 20-25岁
- - 25-30岁
- - 30-35岁
- - 35岁以上
-
-
- - 不限
- - 小于1千米
- - 1千米-5千米
- - 5千米-10千米
- - 10千米-20千米
- - 20千米以上
-
-
- - 不限
- - 白羊座
- - 金牛座
- - 双子座
- - 巨蟹座
- - 狮子座
- - 处女座
- - 天秤座
- - 天蝎座
- - 射手座
- - 摩羯座
- - 水瓶座
- - 双鱼座
-
-
- - 计算机/互联网/通信/电子
- - 会计/金融/银行/保险
- - 商业/服务业/个体经营
- - 贸易/消费/运营
- - 生产/工艺/制造
- - 医疗/护理/制药
- - 文化/广告/媒体
- - 娱乐/艺术/表演
- - 公务员/事业单位
- - 房地厂/建筑
- - 律师/法务
- - 教育/培训
- - 学生
- - 其它
- - 无
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/values/colors.xml b/ZBLibrary(ADT)/ZBLibrary/res/values/colors.xml
deleted file mode 100755
index 8152299..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/values/colors.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
- #f7f8f8
- #33cc99
- #ffffffff
- #272e2a
- #dddddd
- #999999
- #ee3b3b
- #ffffff
- #33cc66
- #33cc99
- #d2d2d2
- #999999
- #333333
- #666666
- #999999
- #b5b5b5
- #ee3b3b
- #ff6666
- #ffd400
-
- #0000
- #9000
- #6000
- #3000
- #1000
- #ffffff
- #eeeeee
- #ddffffff
- #bbdddddd
- #000000
- #666666
- #009ed3
- #2c6ed2
- #62c8f9
- #ff5900
- #999999
- #303133
- #666666
- #dcdcdc
- #ff3d01
- #ff3d01
- #c0c0c0
- #ffc05500
- #ff4b4b4b
- #9000
- #00000000
- #fff0f3f6
- #ff54acea
- #ff54acea
- #ff419de4
- #33b422
- #e87a22
-
- #009ed3
- #2c6ed2
- #c0c0c0
- #666667
- #ff3b3b
- #dd0000
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/values/dimens.xml b/ZBLibrary(ADT)/ZBLibrary/res/values/dimens.xml
deleted file mode 100755
index 67f030a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/values/dimens.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
- 24sp
- 21sp
- 19sp
- 16sp
- 14sp
- 12sp
-
-
-
-
-
-
- 24dp
- 15dp
- 9dp
- 6dp
- 4dp
- 2dp
-
-
-
-
-
-
- 24dp
- 15dp
- 9dp
- 6dp
- 4dp
- 2dp
-
-
-
-
-
-
- 50dp
- 50dp
- 40dp
- 48dp
- 80dp
- 100dp
- 78dp
-
-
-
-
-
-
- 25dp
- 25dp
-
-
-
-
-
-
- 150dp
- 300dp
- 240dp
- 45dp
- 150dp
- 150dp
-
-
-
-
-
-
- 60dp
- 60dp
- 24dp
- 120dp
-
-
-
-
- 30dp
- 45dp
- 42dp
- 12dp
- 15dp
- 15dp
- 15dp
- 15dp
- 78dp
- 15dp
-
-
-
- 15dp
-
-
- 15dp
- 15dp
-
-
-
-
-
- 10dp
- 24dp
-
-
-
-
-
- 36dp
-
-
-
- 300dp
- 3dp
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/values/ids.xml b/ZBLibrary(ADT)/ZBLibrary/res/values/ids.xml
deleted file mode 100644
index 889a7c5..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/values/ids.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
- - false
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/values/strings.xml b/ZBLibrary(ADT)/ZBLibrary/res/values/strings.xml
deleted file mode 100755
index 07b7005..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/values/strings.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
- 坐标标准库
- 15.3
- 我发现了一款很好用的Android快速开发框架,叫 Android-ZBLibrary ,快去GitHub上看看吧~
- 返回
- 提示
- 更新
- 正在初始化,请稍侯……
- 正在登录,请稍侯……
- 登录失败,请检查网络后重试
- 登录成功
- 正在退出,请稍侯……
- 正在加载,请稍后...
- 获取失败,请检查网络后重试
- 获取成功
- 正在添加,请稍后...
- 添加失败,请检查网络后重试
- 添加成功
- 正在保存,请稍后...
- 保存失败,请检查网络后重试
- 保存成功
- 正在删除,请稍后...
- 删除失败,请检查网络后重试
- 删除成功
- 正在修改,请稍后...
- 修改失败,请检查网络后重试
- 修改成功
- 下拉刷新…
- 放开以刷新…
- 正在载入…
- 这个功能即将推出^_^
- 网络异常,请稍后重试
- 没有更多了
- 请插入SD卡
- 正在开启,请稍后...
- 开启失败,请检查网络后重试
- 开启成功
- 正在关闭,请稍后...
- 关闭失败,请检查网络后重试
- 关闭成功
- 正在发送,请稍后...
- 发送失败,请检查网络后重试
- 发送成功
- 下拉刷新
- 松开刷新数据
- 正在刷新
- 上次更新时间:
- 上拉加载更多
- 松开加载更多
- 正在加载更多...
- 已加载完全部
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/res/values/styles.xml b/ZBLibrary(ADT)/ZBLibrary/res/values/styles.xml
deleted file mode 100755
index b30f09a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/res/values/styles.xml
+++ /dev/null
@@ -1,1148 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseActivity.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseActivity.java
deleted file mode 100755
index f8dd0dd..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseActivity.java
+++ /dev/null
@@ -1,683 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.ActivityPresenter;
-import zuo.biao.library.interfaces.OnBottomDragListener;
-import zuo.biao.library.manager.SystemBarTintManager;
-import zuo.biao.library.manager.ThreadManager;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.ScreenUtil;
-import zuo.biao.library.util.StringUtil;
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.app.ProgressDialog;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.support.annotation.Nullable;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.view.GestureDetector;
-import android.view.GestureDetector.OnGestureListener;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnTouchListener;
-import android.view.Window;
-import android.view.WindowManager;
-import android.widget.TextView;
-import android.widget.Toast;
-
-/**基础android.support.v4.app.FragmentActivity,通过继承可获取或使用 里面创建的 组件 和 方法
- * *onFling内控制左右滑动手势操作范围,可自定义
- * @author Lemon
- * @see ActivityPresenter#getActivity
- * @see #context
- * @see #view
- * @see #fragmentManager
- * @see #setContentView
- * @see #runUiThread
- * @see #runThread
- * @see #onDestroy
- * @use extends BaseActivity, 具体参考 .DemoActivity 和 .DemoFragmentActivity
- */
-public abstract class BaseActivity extends FragmentActivity implements ActivityPresenter, OnGestureListener {
- private static final String TAG = "BaseActivity";
-
- /**
- * 该Activity实例,命名为context是因为大部分方法都只需要context,写成context使用更方便
- * @warn 不能在子类中创建
- */
- protected BaseActivity context = null;
- /**
- * 该Activity的界面,即contentView
- * @warn 不能在子类中创建
- */
- protected View view = null;
- /**
- * 布局解释器
- * @warn 不能在子类中创建
- */
- protected LayoutInflater inflater = null;
- /**
- * Fragment管理器
- * @warn 不能在子类中创建
- */
- protected FragmentManager fragmentManager = null;
-
- private boolean isAlive = false;
- private boolean isRunning = false;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
-
- context = (BaseActivity) getActivity();
- isAlive = true;
- fragmentManager = getSupportFragmentManager();
-
- inflater = getLayoutInflater();
-
- threadNameList = new ArrayList();
-
- BaseBroadcastReceiver.register(context, receiver, ACTION_EXIT_APP);
- }
-
- /**
- * 默认标题TextView,layout.xml中用@id/tvBaseTitle绑定。子Activity内调用autoSetTitle方法 会优先使用INTENT_TITLE
- * @see #autoSetTitle
- * @warn 如果子Activity的layout中没有android:id="@id/tvBaseTitle"的TextView,使用前必须在子Activity中赋值
- */
- @Nullable
- protected TextView tvBaseTitle;
-
- @TargetApi(Build.VERSION_CODES.KITKAT)
- @Override
- public void setContentView(int layoutResID) {
- super.setContentView(layoutResID);
-
- // 状态栏沉浸,4.4+生效 <<<<<<<<<<<<<<<<<
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- getWindow().setFlags(
- WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
- WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- }
- SystemBarTintManager tintManager = new SystemBarTintManager(this);
- tintManager.setStatusBarTintEnabled(true);
- tintManager.setStatusBarTintResource(R.color.topbar_bg);//状态背景色,可传drawable资源
- // 状态栏沉浸,4.4+生效 >>>>>>>>>>>>>>>>>
-
- tvBaseTitle = findView(R.id.tvBaseTitle);//绑定默认标题TextView
- }
-
- //底部滑动实现同点击标题栏左右按钮效果<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private OnBottomDragListener onBottomDragListener;
- private GestureDetector gestureDetector;
- /**设置该Activity界面布局,并设置底部左右滑动手势监听
- * @param layoutResID
- * @param listener
- * @use 在子类中
- * *1.onCreate中super.onCreate后setContentView(layoutResID, this);
- * *2.重写onDragBottom方法并实现滑动事件处理
- * *3.在导航栏左右按钮的onClick事件中调用onDragBottom方法
- */
- public void setContentView(int layoutResID, OnBottomDragListener listener) {
- setContentView(layoutResID);
-
- onBottomDragListener = listener;
- gestureDetector = new GestureDetector(this, this);//初始化手势监听类
-
- view = inflater.inflate(layoutResID, null);
- view.setOnTouchListener(new OnTouchListener() {
-
- @SuppressLint("ClickableViewAccessibility")
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- return gestureDetector.onTouchEvent(event);
- }
- });
- }
-
- //底部滑动实现同点击标题栏左右按钮效果>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- /**
- * 用于 打开activity以及activity之间的通讯(传值)等;一些通讯相关基本操作(打电话、发短信等)
- */
- protected Intent intent = null;
-
- /**
- * 退出时之前的界面进入动画,可在finish();前通过改变它的值来改变动画效果
- */
- protected int enterAnim = R.anim.fade;
- /**
- * 退出时该界面动画,可在finish();前通过改变它的值来改变动画效果
- */
- protected int exitAnim = R.anim.right_push_out;
-
- /**通过id查找并获取控件,使用时不需要强转
- * @param id
- * @return
- */
- @SuppressWarnings("unchecked")
- public V findView(int id) {
- return (V) findViewById(id);
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param l
- * @return
- */
- public V findView(int id, OnClickListener l) {
- V v = findView(id);
- v.setOnClickListener(l);
- return v;
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param l
- * @return
- */
- public V findViewById(int id, OnClickListener l) {
- return findView(id, l);
- }
-
- //自动设置标题方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**自动把标题设置为上个Activity传入的INTENT_TITLE,建议在子类initView中使用
- * *这个方法没有return,tvTitle = tvBaseTitle,直接用tvBaseTitle
- * @must 在UI线程中调用
- */
- protected void autoSetTitle() {
- tvBaseTitle = autoSetTitle(tvBaseTitle);
- }
- /**自动把标题设置为上个Activity传入的INTENT_TITLE,建议在子类initView中使用
- * @param tvTitle
- * @return tvTitle 返回tvTitle是为了可以写成一行,如 tvTitle = autoSetTitle((TextView) findViewById(titleResId));
- * @must 在UI线程中调用
- */
- protected TextView autoSetTitle(TextView tvTitle) {
- if (tvTitle != null && StringUtil.isNotEmpty(getIntent().getStringExtra(INTENT_TITLE), false)) {
- tvTitle.setText(StringUtil.getCurrentString());
- }
- return tvTitle;
- }
-
- //自动设置标题方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- //显示与关闭进度弹窗方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**
- * 进度弹窗
- */
- protected ProgressDialog progressDialog = null;
-
- /**展示加载进度条,无标题
- * @param stringResId
- */
- public void showProgressDialog(int stringResId){
- try {
- showProgressDialog(null, context.getResources().getString(stringResId));
- } catch (Exception e) {
- Log.e(TAG, "showProgressDialog showProgressDialog(null, context.getResources().getString(stringResId));");
- }
- }
- /**展示加载进度条,无标题
- * @param message
- */
- public void showProgressDialog(String message){
- showProgressDialog(null, message);
- }
- /**展示加载进度条
- * @param title 标题
- * @param message 信息
- */
- public void showProgressDialog(final String title, final String message){
- runUiThread(new Runnable() {
- @Override
- public void run() {
- if (progressDialog == null) {
- progressDialog = new ProgressDialog(context);
- }
- if(progressDialog.isShowing()) {
- progressDialog.dismiss();
- }
- if (StringUtil.isNotEmpty(title, false)) {
- progressDialog.setTitle(title);
- }
- if (StringUtil.isNotEmpty(message, false)) {
- progressDialog.setMessage(message);
- }
- progressDialog.setCanceledOnTouchOutside(false);
- progressDialog.show();
- }
- });
- }
-
-
- /**隐藏加载进度
- */
- public void dismissProgressDialog() {
- runUiThread(new Runnable() {
- @Override
- public void run() {
- //把判断写在runOnUiThread外面导致有时dismiss无效,可能不同线程判断progressDialog.isShowing()结果不一致
- if(progressDialog == null || progressDialog.isShowing() == false){
- Log.w(TAG, "dismissProgressDialog progressDialog == null" +
- " || progressDialog.isShowing() == false >> return;");
- return;
- }
- progressDialog.dismiss();
- }
- });
- }
- //显示与关闭进度弹窗方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- //启动新Activity方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**打开新的Activity,向左滑入效果
- * @param intent
- */
- public void toActivity(Intent intent) {
- toActivity(intent, true);
- }
- /**打开新的Activity
- * @param intent
- * @param showAnimation
- */
- public void toActivity(Intent intent, boolean showAnimation) {
- toActivity(intent, -1, showAnimation);
- }
- /**打开新的Activity,向左滑入效果
- * @param intent
- * @param requestCode
- */
- public void toActivity(Intent intent, int requestCode) {
- toActivity(intent, requestCode, true);
- }
- /**打开新的Activity
- * @param intent
- * @param requestCode
- * @param showAnimation
- */
- public void toActivity(final Intent intent, final int requestCode, final boolean showAnimation) {
- runUiThread(new Runnable() {
- @Override
- public void run() {
- if (intent == null) {
- Log.w(TAG, "toActivity intent == null >> return;");
- return;
- }
- //fragment中使用context.startActivity会导致在fragment中不能正常接收onActivityResult
- if (requestCode < 0) {
- startActivity(intent);
- } else {
- startActivityForResult(intent, requestCode);
- }
- if (showAnimation) {
- overridePendingTransition(R.anim.right_push_in, R.anim.hold);
- } else {
- overridePendingTransition(R.anim.null_anim, R.anim.null_anim);
- }
- }
- });
- }
- //启动新Activity方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //show short toast 方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param stringResId
- */
- public void showShortToast(int stringResId) {
- try {
- showShortToast(context.getResources().getString(stringResId));
- } catch (Exception e) {
- Log.e(TAG, "showShortToast context.getResources().getString(resId)" +
- " >> catch (Exception e) {" + e.getMessage());
- }
- }
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param string
- */
- public void showShortToast(String string) {
- showShortToast(string, false);
- }
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param string
- * @param isForceDismissProgressDialog
- */
- public void showShortToast(final String string, final boolean isForceDismissProgressDialog) {
- runUiThread(new Runnable() {
- @Override
- public void run() {
- if (isForceDismissProgressDialog) {
- dismissProgressDialog();
- }
- Toast.makeText(context, "" + string, Toast.LENGTH_SHORT).show();
- }
- });
- }
- //show short toast 方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- //运行线程 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**在UI线程中运行,建议用这个方法代替runOnUiThread
- * @param action
- */
- public final void runUiThread(Runnable action) {
- if (isAlive() == false) {
- Log.w(TAG, "runUiThread isAlive() == false >> return;");
- return;
- }
- runOnUiThread(action);
- }
- /**
- * 线程名列表
- */
- protected List threadNameList;
- /**运行线程
- * @param name
- * @param runnable
- * @return
- */
- public final Handler runThread(String name, Runnable runnable) {
- if (isAlive() == false) {
- Log.w(TAG, "runThread isAlive() == false >> return null;");
- return null;
- }
- name = StringUtil.getTrimedString(name);
- Handler handler = ThreadManager.getInstance().runThread(name, runnable);
- if (handler == null) {
- Log.e(TAG, "runThread handler == null >> return null;");
- return null;
- }
-
- if (threadNameList.contains(name) == false) {
- threadNameList.add(name);
- }
- return handler;
- }
-
- //运行线程 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- //Activity的返回按钮和底部弹窗的取消按钮几乎是必备,正好原生支持反射;而其它比如Fragment极少用到,也不支持反射<<<<<<<<<
- /**返回按钮被点击,默认处理是onBottomDragListener.onDragBottom(false),重写可自定义事件处理
- * @param v
- * @use layout.xml中的组件添加android:onClick="onReturnClick"即可
- * @warn 只能在Activity对应的contentView layout中使用;
- * *给对应View setOnClickListener会导致android:onClick="onReturnClick"失效
- */
- @Override
- public void onReturnClick(View v) {
- Log.d(TAG, "onReturnClick >>>");
- if (onBottomDragListener != null) {
- onBottomDragListener.onDragBottom(false);
- } else {
- onBackPressed();//会从最外层子类调finish();BaseBottomWindow就是示例
- }
- }
- /**前进按钮被点击,默认处理是onBottomDragListener.onDragBottom(true),重写可自定义事件处理
- * @param v
- * @use layout.xml中的组件添加android:onClick="onForwardClick"即可
- * @warn 只能在Activity对应的contentView layout中使用;
- * *给对应View setOnClickListener会导致android:onClick="onForwardClick"失效
- */
- @Override
- public void onForwardClick(View v) {
- Log.d(TAG, "onForwardClick >>>");
- if (onBottomDragListener != null) {
- onBottomDragListener.onDragBottom(true);
- }
- }
- //Activity常用导航栏右边按钮,而且底部弹窗BottomWindow的确定按钮是必备;而其它比如Fragment极少用到,也不支持反射>>>>>
-
-
- @Override
- public final boolean isAlive() {
- return isAlive && context != null;// & ! isFinishing();导致finish,onDestroy内runUiThread不可用
- }
- @Override
- public final boolean isRunning() {
- return isRunning & isAlive();
- }
-
- /**一般用于对不支持的数据的处理,比如onCreate中获取到不能接受的id(id<=0)可以这样处理
- */
- public void finishWithError(String error) {
- showShortToast(error);
- enterAnim = exitAnim = R.anim.null_anim;
- finish();
- }
-
- @Override
- public void finish() {
- super.finish();//必须写在最前才能显示自定义动画
- runUiThread(new Runnable() {
- @Override
- public void run() {
- if (enterAnim > 0 && exitAnim > 0) {
- try {
- overridePendingTransition(enterAnim, exitAnim);
- } catch (Exception e) {
- Log.e(TAG, "finish overridePendingTransition(enterAnim, exitAnim);" +
- " >> catch (Exception e) { " + e.getMessage());
- }
- }
- }
- });
- }
-
- @Override
- protected void onResume() {
- Log.d(TAG, "\n onResume <<<<<<<<<<<<<<<<<<<<<<<");
- super.onResume();
- isRunning = true;
- Log.d(TAG, "onResume >>>>>>>>>>>>>>>>>>>>>>>>\n");
- }
-
- @Override
- protected void onPause() {
- Log.d(TAG, "\n onPause <<<<<<<<<<<<<<<<<<<<<<<");
- super.onPause();
- isRunning = false;
- Log.d(TAG, "onPause >>>>>>>>>>>>>>>>>>>>>>>>\n");
- }
-
- /**销毁并回收内存
- * @warn 子类如果要使用这个方法内用到的变量,应重写onDestroy方法并在super.onDestroy();前操作
- */
- @Override
- protected void onDestroy() {
- Log.d(TAG, "\n onDestroy <<<<<<<<<<<<<<<<<<<<<<<");
- dismissProgressDialog();
- BaseBroadcastReceiver.unregister(context, receiver);
- ThreadManager.getInstance().destroyThread(threadNameList);
- if (view != null) {
- try {
- view.destroyDrawingCache();
- } catch (Exception e) {
- Log.w(TAG, "onDestroy try { view.destroyDrawingCache();" +
- " >> } catch (Exception e) {\n" + e.getMessage());
- }
- }
-
- isAlive = false;
- isRunning = false;
- super.onDestroy();
-
- inflater = null;
- view = null;
- tvBaseTitle = null;
-
- fragmentManager = null;
- progressDialog = null;
- threadNameList = null;
-
- intent = null;
-
- context = null;
-
- Log.d(TAG, "onDestroy >>>>>>>>>>>>>>>>>>>>>>>>\n");
- }
-
-
-
- private BroadcastReceiver receiver = new BroadcastReceiver() {
-
- public void onReceive(Context context, Intent intent) {
- String action = intent == null ? null : intent.getAction();
- if (isAlive() == false || StringUtil.isNotEmpty(action, true) == false) {
- Log.e(TAG, "receiver.onReceive isAlive() == false" +
- " || StringUtil.isNotEmpty(action, true) == false >> return;");
- return;
- }
-
- if (ACTION_EXIT_APP.equals(action)) {
- finish();
- }
- }
- };
-
-
-
- //手机返回键和菜单键实现同点击标题栏左右按钮效果<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private boolean isOnKeyLongPress = false;
- @Override
- public boolean onKeyLongPress(int keyCode, KeyEvent event) {
- isOnKeyLongPress = true;
- return true;
- }
-
- @Override
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- if (isOnKeyLongPress) {
- isOnKeyLongPress = false;
- return true;
- }
-
- switch (keyCode) {
- case KeyEvent.KEYCODE_BACK:
- if (onBottomDragListener != null) {
- onBottomDragListener.onDragBottom(false);
- return true;
- }
- break;
- case KeyEvent.KEYCODE_MENU:
- if (onBottomDragListener != null) {
- onBottomDragListener.onDragBottom(true);
- return true;
- }
- break;
- default:
- break;
- }
-
- return super.onKeyUp(keyCode, event);
- }
-
- //手机返回键和菜单键实现同点击标题栏左右按钮效果>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- //底部滑动实现同点击标题栏左右按钮效果<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public boolean onDown(MotionEvent e) {
- return false;
- }
- @Override
- public void onShowPress(MotionEvent e) {
- }
- @Override
- public boolean onSingleTapUp(MotionEvent e) {
- return false;
- }
- @Override
- public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
- return false;
- }
- @Override
- public void onLongPress(MotionEvent e) {
- }
- @Override
- public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
-
- // /*原来实现全局滑动返回的代码,OnFinishListener已删除,可以自己写一个或者
- // * 用onBottomDragListener.onDragBottom(false);代替onFinishListener.finish();**/
- // if (onFinishListener != null) {
- //
- // float maxDragHeight = getResources().getDimension(R.dimen.page_drag_max_height);
- // float distanceY = e2.getRawY() - e1.getRawY();
- // if (distanceY < maxDragHeight && distanceY > - maxDragHeight) {
- //
- // float minDragWidth = getResources().getDimension(R.dimen.page_drag_min_width);
- // float distanceX = e2.getRawX() - e1.getRawX();
- // if (distanceX > minDragWidth) {
- // onFinishListener.finish();
- // return true;
- // }
- // }
- // }
-
-
- //底部滑动实现同点击标题栏左右按钮效果
- if (onBottomDragListener != null && e1.getRawY() > ScreenUtil.getScreenSize(this)[1]
- - ((int) getResources().getDimension(R.dimen.bottom_drag_height))) {
-
- float maxDragHeight = getResources().getDimension(R.dimen.bottom_drag_max_height);
- float distanceY = e2.getRawY() - e1.getRawY();
- if (distanceY < maxDragHeight && distanceY > - maxDragHeight) {
-
- float minDragWidth = getResources().getDimension(R.dimen.bottom_drag_min_width);
- float distanceX = e2.getRawX() - e1.getRawX();
- if (distanceX > minDragWidth) {
- onBottomDragListener.onDragBottom(false);
- return true;
- } else if (distanceX < - minDragWidth) {
- onBottomDragListener.onDragBottom(true);
- return true;
- }
- }
- }
-
- return false;
- }
- @Override
- public boolean dispatchTouchEvent(MotionEvent ev) {
- if (gestureDetector != null) {
- gestureDetector.onTouchEvent(ev);
- }
- return super.dispatchTouchEvent(ev);
- }
-
- //底部滑动实现同点击标题栏左右按钮效果>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseAdapter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseAdapter.java
deleted file mode 100755
index 021745c..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseAdapter.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.interfaces.OnReachViewBorderListener;
-import zuo.biao.library.util.CommonUtil;
-import zuo.biao.library.util.SettingUtil;
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-/**基础Adapter
- *
适用于ListView,GridView等AbsListView的子类
- * @author Lemon
- * @warn 出于性能考虑,里面很多方法对变量(比如list)都没有判断,应在adapter外判断
- * @param 数据模型(model/JavaBean)类
- * @use extends BaseAdapter, 具体参考.DemoAdapter
- *
预加载使用:
- *
1.在子类getView中最后 return super.getView(position, convertView, parent);//非必须,只在预加载用到
- *
2.在使用子类的类中调用子类setOnReachViewBorderListener方法(这个方法就在这个类)//非必须
- */
-public abstract class BaseAdapter extends android.widget.BaseAdapter {
- // private static final String TAG = "BaseAdapter";
-
-
- /**
- * 管理整个界面的Activity实例
- */
- public Activity context;
- /**
- * 布局解释器,用来实例化列表的item的界面
- */
- public LayoutInflater inflater;
- /**
- * 资源获取器,用于获取res目录下的文件及文件中的内容等
- */
- public Resources resources;
- public BaseAdapter(Activity context) {
- this.context = context;
-
- inflater = context.getLayoutInflater();
- resources = context.getResources();
- }
-
- /**
- * 传进来的数据列表
- */
- public List list;
- public List getList() {
- return list;
- }
- /**刷新列表
- */
- public synchronized void refresh(List list) {
- this.list = list == null ? null : new ArrayList(list);
- notifyDataSetChanged();
- }
-
- @Override
- public int getCount() {
- return list == null ? 0 : list.size();
- }
- /**获取item数据
- */
- @Override
- public T getItem(int position) {
- return list.get(position);
- }
- /**获取item的id,如果不能满足需求可在子类重写
- * @param position
- * @return position
- */
- @Override
- public long getItemId(int position) {
- return position;
- }
-
-
- //预加载,可不使用 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- protected OnReachViewBorderListener onReachViewBorderListener;
- /**设置到达parent的边界的监听
- * @param onReachViewBorderListener
- */
- public void setOnReachViewBorderListener(OnReachViewBorderListener onReachViewBorderListener) {
- this.onReachViewBorderListener = onReachViewBorderListener;
- }
-
- /**
- * 预加载提前数。
- *
= 0 - 列表滚到底部(最后一个Item View显示)时加载更多
- *
< 0 - 禁用加载更多
- *
> 0 - 列表滚到倒数第preloadCount个Item View显示时加载更多
- * @use 可在子类getView被调用前(可以是在构造器内)赋值
- */
- protected int preloadCount = 0;
-
- /**获取item对应View的方法,带item滑到底部等监听
- * @param position
- * @param convertView
- * @param parent
- * @return
- * @use 子类的getView中最后 return super.getView(position, convertView, parent);
- */
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- if (SettingUtil.preload && onReachViewBorderListener != null && position >= getCount() - 1 - preloadCount) {
- onReachViewBorderListener.onReach(OnReachViewBorderListener.TYPE_BOTTOM, parent);
- }
- return convertView;
- }
-
- //预加载,可不使用 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
- //show short toast 方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param stringResId
- */
- public void showShortToast(int stringResId) {
- CommonUtil.showShortToast(context, stringResId);
- }
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param string
- */
- public void showShortToast(String string) {
- CommonUtil.showShortToast(context, string);
- }
- //show short toast 方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //启动新Activity方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**打开新的Activity,向左滑入效果
- * @param intent
- */
- public void toActivity(final Intent intent) {
- CommonUtil.toActivity(context, intent);
- }
- /**打开新的Activity
- * @param intent
- * @param showAnimation
- */
- public void toActivity(final Intent intent, final boolean showAnimation) {
- CommonUtil.toActivity(context, intent, showAnimation);
- }
- /**打开新的Activity,向左滑入效果
- * @param intent
- * @param requestCode
- */
- public void toActivity(final Intent intent, final int requestCode) {
- CommonUtil.toActivity(context, intent, requestCode);
- }
- /**打开新的Activity
- * @param intent
- * @param requestCode
- * @param showAnimation
- */
- public void toActivity(final Intent intent, final int requestCode, final boolean showAnimation) {
- CommonUtil.toActivity(context, intent, requestCode, showAnimation);
- }
- //启动新Activity方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseApplication.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseApplication.java
deleted file mode 100644
index 2091f4f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseApplication.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package zuo.biao.library.base;
-
-import zuo.biao.library.R;
-import zuo.biao.library.util.DataKeeper;
-import zuo.biao.library.util.ImageLoaderUtil;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.SettingUtil;
-import android.app.Application;
-
-/**基础Application
- * @author Lemon
- * @see #init
- * @use extends BaseApplication 或 在你的Application的onCreate方法中BaseApplication.init(this);
- */
-public class BaseApplication extends Application {
- private static final String TAG = "BaseApplication";
-
- public BaseApplication() {
- }
-
- private static Application instance;
- public static Application getInstance() {
- return instance;
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- Log.d(TAG, "项目启动 >>>>>>>>>>>>>>>>>>>> \n\n");
-
- init(this);
- }
-
- /**初始化方法
- * @param application
- * @must 调用init方法且只能调用一次,如果extends BaseApplication会自动调用
- */
- public static void init(Application application) {
- instance = application;
- if (instance == null) {
- Log.e(TAG, "\n\n\n\n\n !!!!!! 调用BaseApplication中的init方法,instance不能为null !!!" +
- "\n <<<<<< init instance == null !!! >>>>>>>> \n\n\n\n");
- }
-
- DataKeeper.init(instance);
- SettingUtil.init(instance);
- ImageLoaderUtil.init(instance);
- }
-
- /**获取应用名
- * @return
- */
- public String getAppName() {
- return getResources().getString(R.string.app_name);
- }
- /**获取应用版本名(显示给用户看的)
- * @return
- */
- public String getAppVersion() {
- return getResources().getString(R.string.app_version);
- }
-
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBottomTabActivity.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBottomTabActivity.java
deleted file mode 100644
index 5181beb..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBottomTabActivity.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import zuo.biao.library.util.Log;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
-import android.view.View;
-import android.view.View.OnClickListener;
-
-/**基础底部标签Activity
- * @author Lemon
- * @use extends BaseBottomTabActivity
- */
-public abstract class BaseBottomTabActivity extends BaseActivity {
- private static final String TAG = "BaseBottomTabActivity";
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- protected static int[] tabClickIds;
-
- protected View[] vTabClickViews;
- protected View[][] vTabSelectViews;
- @Override
- public void initView() {// 必须调用
-
- tabClickIds = getTabClickIds();
-
- vTabClickViews = new View[getCount()];
- for (int i = 0; i < getCount(); i++) {
- vTabClickViews[i] = findView(tabClickIds[i]);
- }
-
- int[][] tabSelectIds = getTabSelectIds();
- if (tabSelectIds != null && tabSelectIds.length > 0) {
- vTabSelectViews = new View[tabSelectIds.length][getCount()];
- for (int i = 0; i < tabSelectIds.length; i++) {
- if (tabSelectIds[i] != null) {
- for (int j = 0; j < tabSelectIds[i].length; j++) {
- vTabSelectViews[i][j] = findView(tabSelectIds[i][j]);
- }
- }
- }
- }
- }
-
-
- /**选择tab,在selectFragment里被调用
- * @param position
- */
- protected abstract void selectTab(int position);
-
- /**设置选中状态
- * @param position
- */
- protected void setTabSelection(int position) {
- if (vTabSelectViews == null) {
- Log.e(TAG, "setTabSelection vTabSelectViews == null >> return;");
- return;
- }
- for (int i = 0; i < vTabSelectViews.length; i++) {
- if (vTabSelectViews[i] == null) {
- Log.w(TAG, "setTabSelection vTabSelectViews[" + i + "] == null >> continue;");
- continue;
- }
- for (int j = 0; j < vTabSelectViews[i].length; j++) {
- vTabSelectViews[i][j].setSelected(j == position);
- }
- }
- }
-
- /**
- * == true >> 每次点击相应tab都加载,调用getFragment方法重新对点击的tab对应的fragment赋值。
- * 如果不希望重载,可以重写selectFragment。
- */
- protected boolean needReload = false;
- /**
- * 当前显示的tab所在位置,对应fragment所在位置
- */
- protected int currentPosition = 0;
- /**选择并显示fragment
- * @param position
- */
- public void selectFragment(int position) {
- //tab,资源消耗很小<<<<<<
- setTabSelection(position);
- selectTab(position);
- //tab,资源消耗很小>>>>>>
-
- if (currentPosition == position) {
- if (needReload) {
- if (fragments[position] != null && fragments[position].isAdded()) {
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.remove(fragments[position]).commit();
- fragments[position] = null;
- }
- } else {
- if (fragments[position] != null && fragments[position].isVisible()) {
- Log.w(TAG, "selectFragment currentPosition == position" +
- " >> fragments[position] != null && fragments[position].isVisible()" +
- " >> return; ");
- return;
- }
- }
- }
-
-
- if (fragments[position] == null) {
- fragments[position] = getFragment(position);
- }
-
- //全局的fragmentTransaction因为already committed 崩溃
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.hide(fragments[currentPosition]);
- if (fragments[position].isAdded() == false) {
- ft.add(getFragmentContainerResId(), fragments[position]);
- }
- ft.show(fragments[position]).commit();
-
- this.currentPosition = position;
- }
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- protected Fragment[] fragments;
- @Override
- public void initData() {// 必须调用
-
- // fragmentActivity子界面初始化<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- fragments = new Fragment[getCount()];
- selectFragment(currentPosition);
-
- // fragmentActivity子界面初始化>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- }
-
-
- /**获取tab内设置点击事件的View的id
- * @param position
- * @return
- */
- protected abstract int[] getTabClickIds();
-
- /**获取tab内设置选择事件的View的id,setSelected(position == currentPositon)
- * @return
- * @warn 返回int[leghth0][leghth1]必须满足leghth0 >= 1 && leghth1 = getCount() = getTabClickIds().length
- */
- protected abstract int[][] getTabSelectIds();
-
- /**获取Fragment容器的id
- * @return
- */
- public abstract int getFragmentContainerResId();
-
- /**获取新的Fragment
- * @param position
- * @return
- */
- protected abstract Fragment getFragment(int position);
-
- /**获取Tab(或Fragment)的数量
- * @return
- */
- public int getCount() {
- return tabClickIds == null ? 0 :tabClickIds.length;
- }
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
-
- for (int i = 0; i < vTabClickViews.length; i++) {
- final int which = i;
- vTabClickViews[which].setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- selectFragment(which);
- }
- });
- }
- }
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBottomWindow.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBottomWindow.java
deleted file mode 100755
index a384d6e..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBottomWindow.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import zuo.biao.library.R;
-import zuo.biao.library.util.Log;
-import android.annotation.SuppressLint;
-import android.os.Handler;
-import android.os.Message;
-import android.view.View;
-import android.view.animation.AnimationUtils;
-
-/**基础底部弹出界面Activity
- * @author Lemon
- * @warn 不要在子类重复这个类中onCreate中的代码
- * @use extends BaseBottomWindow, 具体参考.DemoBottomWindow
- */
-public abstract class BaseBottomWindow extends BaseActivity {
- private static final String TAG = "BaseBottomWindow";
-
- public static final String INTENT_ITEMS = "INTENT_ITEMS";
- public static final String INTENT_ITEM_IDS = "INTENT_ITEM_IDS";
-
- public static final String RESULT_TITLE = "RESULT_TITLE";
- public static final String RESULT_ITEM = "RESULT_ITEM";
- public static final String RESULT_ITEM_ID = "RESULT_ITEM_ID";
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- protected View vBaseBottomWindowRoot;//子Activity全局背景View
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id(非@Nullable标记)且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
- enterAnim = exitAnim = R.anim.null_anim;
-
- vBaseBottomWindowRoot = findView(R.id.vBaseBottomWindowRoot);
-
- vBaseBottomWindowRoot.startAnimation(AnimationUtils.loadAnimation(context, R.anim.bottom_window_enter));
- }
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initData() {// 必须调用
-
- }
-
- /**
- * 设置需要返回的结果
- */
- protected abstract void setResult();
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
-
- // vBaseBottomWindowRoot.setOnClickListener(new OnClickListener() {
- //
- // @Override
- // public void onClick(View v) {
- // finish();
- // }
- // });
-
- }
-
-
- @Override
- public void onForwardClick(View v) {
- setResult();
- finish();
- }
-
-
- @SuppressLint("HandlerLeak")
- public Handler exitHandler = new Handler(){
- @Override
- public void handleMessage(Message msg) {
- super.handleMessage(msg);
- BaseBottomWindow.super.finish();
- }
- };
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private boolean isExit = false;
- /**带动画退出,并使退出事件只响应一次
- */
- @Override
- public void finish() {
- Log.d(TAG, "finish >>> isExit = " + isExit);
- if (isExit) {
- return;
- }
- isExit = true;
-
- vBaseBottomWindowRoot.startAnimation(AnimationUtils.loadAnimation(context, R.anim.bottom_window_exit));
- vBaseBottomWindowRoot.setVisibility(View.GONE);
-
- exitHandler.sendEmptyMessageDelayed(0, 200);
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
-
- vBaseBottomWindowRoot = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBroadcastReceiver.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBroadcastReceiver.java
deleted file mode 100644
index 91a5e1b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseBroadcastReceiver.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.Arrays;
-import java.util.List;
-
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.StringUtil;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.support.annotation.Nullable;
-
-/**基础广播接收器
- * @author Lemon
- * @use 自定义BroadcastReceiver - extends BaseBroadcastReceiver;其它 - 直接使用里面的静态方法
- * @must 调用register和unregister方法
- */
-public abstract class BaseBroadcastReceiver extends BroadcastReceiver {
- private static final String TAG = "BaseBroadcastReceiver";
-
- /**接收信息监听回调
- */
- public interface OnReceiveListener{
- void onReceive(Context context, Intent intent);
- }
- protected OnReceiveListener onReceiveListener = null;
- /**注册接收信息监听
- * @must 在register后,unregister前调用
- * @param onReceiveListener
- */
- public void setOnReceiveListener(OnReceiveListener onReceiveListener) {
- this.onReceiveListener = onReceiveListener;
- }
-
-
- protected Context context = null;
- public BaseBroadcastReceiver(Context context) {
- this.context = context;
- }
-
- /**接收信息监听回调方法
- */
- public void onReceive(Context context, Intent intent) {
- Log.i(TAG, "onReceive intent = " + intent);
- if (onReceiveListener != null) {
- onReceiveListener.onReceive(context, intent);
- }
- }
-
-
-
- /**
- * 注册广播接收器
- * @use 一般在Activity或Fragment的onCreate中调用
- */
- public abstract BaseBroadcastReceiver register();
- /**
- * 取消注册广播接收器
- * @use 一般在Activity或Fragment的onDestroy中调用
- */
- public abstract void unregister();
-
-
- /**注册广播接收器
- * @param context
- * @param receiver
- * @param action
- * @return
- */
- public static BroadcastReceiver register(Context context, @Nullable BroadcastReceiver receiver, String action) {
- return register(context, receiver, new String[] {action});
- }
- /**注册广播接收器
- * @param context
- * @param receiver
- * @param actions
- * @return
- */
- public static BroadcastReceiver register(Context context, @Nullable BroadcastReceiver receiver, String[] actions) {
- return register(context, receiver, actions == null ? null : Arrays.asList(actions));
- }
- /**注册广播接收器
- * @param context
- * @param receiver
- * @param actionList
- * @return
- */
- public static BroadcastReceiver register(Context context, @Nullable BroadcastReceiver receiver, List actionList) {
- IntentFilter filter = new IntentFilter();
- for (String action : actionList) {
- if (StringUtil.isNotEmpty(action, true)) {
- filter.addAction(StringUtil.getTrimedString(action));
- }
- }
- return register(context, receiver, filter);
- }
- /**注册广播接收器
- * @param context
- * @param receiver
- * @param filter
- * @return
- */
- public static BroadcastReceiver register(Context context, @Nullable BroadcastReceiver receiver, IntentFilter filter) {
- Log.i(TAG, "register >>>");
- if (context == null || filter == null) {
- Log.e(TAG, "register context == null || filter == null >> return;");
- return receiver;
- }
-
- context.registerReceiver(receiver, filter);
-
- return receiver;
- }
-
-
-
- /**取消注册广播接收器
- * @param context
- * @param receiver
- * @return
- */
- public static void unregister(Context context, BroadcastReceiver receiver) {
- Log.i(TAG, "unregister >>>");
- if (context == null || receiver == null) {
- Log.e(TAG, "unregister context == null || receiver == null >> return;");
- return;
- }
-
- try {
- context.unregisterReceiver(receiver);
- } catch (Exception e) {
- Log.e(TAG, "unregister try { context.unregisterReceiver(receiver);" +
- " } catch (Exception e) { \n" + e.getMessage());
- }
- }
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseFragment.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseFragment.java
deleted file mode 100755
index 36c200f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseFragment.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.FragmentPresenter;
-import zuo.biao.library.util.Log;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.Handler;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-
-/**基础android.support.v4.app.Fragment,通过继承可获取或使用 里面创建的 组件 和 方法
- * @author Lemon
- * @see #context
- * @see #view
- * @see #onCreateView
- * @see #setContentView
- * @see #runUiThread
- * @see #runThread
- * @see #onDestroy
- * @use extends BaseFragment, 具体参考.DemoFragment
- */
-public abstract class BaseFragment extends Fragment implements FragmentPresenter {
- private static final String TAG = "BaseFragment";
-
- /**
- * 添加该Fragment的Activity
- * @warn 不能在子类中创建
- */
- protected BaseActivity context = null;
- /**
- * 该Fragment全局视图
- * @must 非abstract子类的onCreateView中return view;
- * @warn 不能在子类中创建
- */
- protected View view = null;
- /**
- * 布局解释器
- * @warn 不能在子类中创建
- */
- protected LayoutInflater inflater = null;
- /**
- * 添加这个Fragment视图的布局
- * @warn 不能在子类中创建
- */
- @Nullable
- protected ViewGroup container = null;
-
- private boolean isAlive = false;
- private boolean isRunning = false;
- /**
- * @must 在非abstract子类的onCreateView中super.onCreateView且return view;
- */
- @Override
- @Nullable
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState){
- context = (BaseActivity) getActivity();
- isAlive = true;
-
- this.inflater = inflater;
- this.container = container;
-
- return view;
- }
-
- /**设置界面布局
- * @warn 最多调用一次
- * @param layoutResID
- * @use 在onCreateView后调用
- */
- public void setContentView(int layoutResID) {
- setContentView(inflater.inflate(layoutResID, container, false));
- }
- /**设置界面布局
- * @warn 最多调用一次
- * @param v
- * @use 在onCreateView后调用
- */
- public void setContentView(View v) {
- setContentView(v, null);
- }
- /**设置界面布局
- * @warn 最多调用一次
- * @param v
- * @param params
- * @use 在onCreateView后调用
- */
- public void setContentView(View v, ViewGroup.LayoutParams params) {
- view = v;
- }
-
-
- /**
- * 该Fragment在Activity添加的所有Fragment中的位置,通过ARGUMENT_POSITION设置
- * @must 只使用getPosition方法来获取position,保证position正确
- */
- private int position = -1;
- /**获取该Fragment在Activity添加的所有Fragment中的位置
- */
- public int getPosition() {
- if (position < 0) {
- argument = getArguments();
- if (argument != null) {
- position = argument.getInt(ARGUMENT_POSITION, position);
- }
- }
- return position;
- }
-
- /**
- * 可用于 打开activity与fragment,fragment与fragment之间的通讯(传值)等
- */
- protected Bundle argument = null;
- /**
- * 可用于 打开activity以及activity之间的通讯(传值)等;一些通讯相关基本操作(打电话、发短信等)
- */
- protected Intent intent = null;
-
- /**通过id查找并获取控件,使用时不需要强转
- * @param id
- * @return
- */
- @SuppressWarnings("unchecked")
- public V findView(int id) {
- return (V) view.findViewById(id);
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param l
- * @return
- */
- public V findView(int id, OnClickListener l) {
- V v = findView(id);
- v.setOnClickListener(l);
- return v;
- }
- /**通过id查找并获取控件,使用时不需要强转
- * @warn 调用前必须调用setContentView
- * @param id
- * @return
- */
- public V findViewById(int id) {
- return findView(id);
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param l
- * @return
- */
- public V findViewById(int id, OnClickListener l) {
- return findView(id, l);
- }
-
-
- public Intent getIntent() {
- return context.getIntent();
- }
-
- //运行线程<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**在UI线程中运行,建议用这个方法代替runOnUiThread
- * @param action
- */
- public final void runUiThread(Runnable action) {
- if (isAlive() == false) {
- Log.w(TAG, "runUiThread isAlive() == false >> return;");
- return;
- }
- context.runUiThread(action);
- }
- /**运行线程
- * @param name
- * @param runnable
- * @return
- */
- public final Handler runThread(String name, Runnable runnable) {
- if (isAlive() == false) {
- Log.w(TAG, "runThread isAlive() == false >> return null;");
- return null;
- }
- return context.runThread(name + getPosition(), runnable);//name, runnable);同一Activity出现多个同名Fragment可能会出错
- }
-
- //运行线程>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //进度弹窗<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- /**展示加载进度条,无标题
- * @param stringResId
- */
- public void showProgressDialog(int stringResId){
- if (isAlive() == false) {
- Log.w(TAG, "showProgressDialog isAlive() == false >> return;");
- return;
- }
- context.showProgressDialog(context.getResources().getString(stringResId));
- }
- /**展示加载进度条,无标题
- * @param dialogMessage
- */
- public void showProgressDialog(String dialogMessage){
- if (isAlive() == false) {
- Log.w(TAG, "showProgressDialog isAlive() == false >> return;");
- return;
- }
- context.showProgressDialog(dialogMessage);
- }
- /**展示加载进度条
- * @param dialogTitle 标题
- * @param dialogMessage 信息
- */
- public void showProgressDialog(String dialogTitle, String dialogMessage){
- if (isAlive() == false) {
- Log.w(TAG, "showProgressDialog isAlive() == false >> return;");
- return;
- }
- context.showProgressDialog(dialogTitle, dialogMessage);
- }
-
- /** 隐藏加载进度
- */
- public void dismissProgressDialog(){
- if (isAlive() == false) {
- Log.w(TAG, "dismissProgressDialog isAlive() == false >> return;");
- return;
- }
- context.dismissProgressDialog();
- }
- //进度弹窗>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- //启动Activity<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**打开新的Activity,向左滑入效果
- * @param intent
- */
- public void toActivity(Intent intent) {
- toActivity(intent, true);
- }
- /**打开新的Activity
- * @param intent
- * @param showAnimation
- */
- public void toActivity(Intent intent, boolean showAnimation) {
- toActivity(intent, -1, showAnimation);
- }
- /**打开新的Activity,向左滑入效果
- * @param intent
- * @param requestCode
- */
- public void toActivity(Intent intent, int requestCode) {
- toActivity(intent, requestCode, true);
- }
- /**打开新的Activity
- * @param intent
- * @param requestCode
- * @param showAnimation
- */
- public void toActivity(final Intent intent, final int requestCode, final boolean showAnimation) {
- runUiThread(new Runnable() {
- @Override
- public void run() {
- if (intent == null) {
- Log.w(TAG, "toActivity intent == null >> return;");
- return;
- }
- //fragment中使用context.startActivity会导致在fragment中不能正常接收onActivityResult
- if (requestCode < 0) {
- startActivity(intent);
- } else {
- startActivityForResult(intent, requestCode);
- }
- if (showAnimation) {
- context.overridePendingTransition(R.anim.right_push_in, R.anim.hold);
- } else {
- context.overridePendingTransition(R.anim.null_anim, R.anim.null_anim);
- }
- }
- });
- }
- //启动Activity>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //show short toast<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param stringResId
- */
- public void showShortToast(int stringResId) {
- if (isAlive() == false) {
- Log.w(TAG, "showProgressDialog isAlive() == false >> return;");
- return;
- }
- context.showShortToast(stringResId);
- }
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param string
- */
- public void showShortToast(String string) {
- if (isAlive() == false) {
- Log.w(TAG, "showProgressDialog isAlive() == false >> return;");
- return;
- }
- context.showShortToast(string);
- }
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param string
- * @param isForceDismissProgressDialog
- */
- public void showShortToast(String string, boolean isForceDismissProgressDialog) {
- if (isAlive() == false) {
- Log.w(TAG, "showProgressDialog isAlive() == false >> return;");
- return;
- }
- context.showShortToast(string, isForceDismissProgressDialog);
- }
- //show short toast>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- @Override
- public final boolean isAlive() {
- return isAlive && context != null;// & ! isRemoving();导致finish,onDestroy内runUiThread不可用
- }
- @Override
- public final boolean isRunning() {
- return isRunning & isAlive();
- }
-
- @Override
- public void onResume() {
- Log.d(TAG, "\n onResume <<<<<<<<<<<<<<<<<<<<<<<");
- super.onResume();
- isRunning = true;
- Log.d(TAG, "onResume >>>>>>>>>>>>>>>>>>>>>>>>\n");
- }
-
- @Override
- public void onPause() {
- Log.d(TAG, "\n onPause <<<<<<<<<<<<<<<<<<<<<<<");
- super.onPause();
- isRunning = false;
- Log.d(TAG, "onPause >>>>>>>>>>>>>>>>>>>>>>>>\n");
- }
-
- /**销毁并回收内存
- * @warn 子类如果要使用这个方法内用到的变量,应重写onDestroy方法并在super.onDestroy();前操作
- */
- @Override
- public void onDestroy() {
- Log.d(TAG, "\n onDestroy <<<<<<<<<<<<<<<<<<<<<<<");
- dismissProgressDialog();
- if (view != null) {
- try {
- view.destroyDrawingCache();
- } catch (Exception e) {
- Log.w(TAG, "onDestroy try { view.destroyDrawingCache();" +
- " >> } catch (Exception e) {\n" + e.getMessage());
- }
- }
-
- isAlive = false;
- isRunning = false;
- super.onDestroy();
-
- view = null;
- inflater = null;
- container = null;
-
- intent = null;
- argument = null;
-
- context = null;
-
- Log.d(TAG, "onDestroy >>>>>>>>>>>>>>>>>>>>>>>>\n");
- }
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseHttpListActivity.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseHttpListActivity.java
deleted file mode 100755
index 47779c8..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseHttpListActivity.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.List;
-
-import zuo.biao.library.interfaces.AdapterCallBack;
-import zuo.biao.library.interfaces.OnHttpResponseListener;
-import zuo.biao.library.interfaces.OnReachViewBorderListener;
-import zuo.biao.library.interfaces.OnStopLoadListener;
-import zuo.biao.library.ui.xlistview.XListView;
-import zuo.biao.library.ui.xlistview.XListView.IXListViewListener;
-import zuo.biao.library.util.Log;
-import android.view.View;
-import android.widget.BaseAdapter;
-
-/**基础http获取列表的Activity
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param 管理XListView的Adapter
- * @see #getListAsync(int)
- * @see #onHttpResponse(int, String, Exception)
- * @use extends BaseHttpListActivity 并在子类onCreate中lvBaseList.onRefresh();, 具体参考 .UserListFragment
- */
-public abstract class BaseHttpListActivity extends BaseListActivity
-implements OnHttpResponseListener, IXListViewListener, OnStopLoadListener {
- private static final String TAG = "BaseHttpListActivity";
-
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initView() {
- super.initView();
-
- setList((List) null);//ListView需要设置adapter才能显示header和footer; setAdapter调不到子类方法
- }
-
- /**设置列表适配器
- * @param callBack
- */
- @SuppressWarnings("unchecked")
- @Override
- public void setList(AdapterCallBack callBack) {
- super.setList(callBack);
- boolean empty = adapter == null || adapter.isEmpty();
- Log.d(TAG, "setList adapter empty = " + empty);
- lvBaseList.showFooter(! empty);//放setAdapter中不行,adapter!=null时没有调用setAdapter
-
- if (adapter != null && adapter instanceof zuo.biao.library.base.BaseAdapter) {
- ((zuo.biao.library.base.BaseAdapter) adapter).setOnReachViewBorderListener(
- empty || lvBaseList.isFooterShowing() == false ? null : new OnReachViewBorderListener(){
-
- @Override
- public void onReach(int type, View v) {
- if (type == TYPE_BOTTOM) {
- lvBaseList.onLoadMore();
- }
- }
- });
- }
- }
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initData() {
- super.initData();
-
- }
-
- /**
- * 将JSON串转为List(已在非UI线程中)
- * *直接JSON.parseArray(json, getCacheClass());可以省去这个方法,但由于可能json不完全符合parseArray条件,所以还是要保留。
- * *比如json只有其中一部分能作为parseArray的字符串时,必须先提取出这段字符串再parseArray
- */
- public abstract List parseArray(String json);
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
- super.initEvent();
- setOnStopLoadListener(this);
-
- lvBaseList.setXListViewListener(this);
- }
-
- /*
- * @param page 用-page作为requestCode
- */
- @Override
- public abstract void getListAsync(int page);
-
- @Override
- public void onStopRefresh() {
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- lvBaseList.stopRefresh();
- }
- });
- }
- @Override
- public void onStopLoadMore(final boolean isHaveMore) {
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- lvBaseList.stopLoadMore(isHaveMore);
- }
- });
- }
-
- /**
- * @param requestCode = -page {@link #getListAsync(int)}
- * @param resultJson
- * @param e
- */
- @Override
- public void onHttpResponse(final int requestCode, final String resultJson, final Exception e) {
- runThread(TAG + "onHttpResponse", new Runnable() {
-
- @Override
- public void run() {
- int page = 0;
- if (requestCode > 0) {
- Log.w(TAG, "requestCode > 0, 应该用BaseListFragment#getListAsync(int page)中的page的负数作为requestCode!");
- } else {
- page = - requestCode;
- }
- List array = parseArray(resultJson);
-
- if ((array == null || array.isEmpty()) && e != null) {
- onLoadFailed(page, e);
- } else {
- onLoadSucceed(page, array);
- }
- }
- });
- }
-
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseHttpListFragment.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseHttpListFragment.java
deleted file mode 100755
index 352075a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseHttpListFragment.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.List;
-
-import zuo.biao.library.interfaces.AdapterCallBack;
-import zuo.biao.library.interfaces.OnHttpResponseListener;
-import zuo.biao.library.interfaces.OnReachViewBorderListener;
-import zuo.biao.library.interfaces.OnStopLoadListener;
-import zuo.biao.library.ui.xlistview.XListView;
-import zuo.biao.library.ui.xlistview.XListView.IXListViewListener;
-import zuo.biao.library.util.Log;
-import android.view.View;
-import android.widget.BaseAdapter;
-
-/**基础http获取列表的Fragment
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param 管理XListView的Adapter
- * @see #getListAsync(int)
- * @see #onHttpResponse(int, String, Exception)
- * @use extends BaseHttpListFragment 并在子类onCreateView中lvBaseList.onRefresh();, 具体参考 .UserListFragment
- */
-public abstract class BaseHttpListFragment extends BaseListFragment
-implements OnHttpResponseListener, IXListViewListener, OnStopLoadListener {
- private static final String TAG = "BaseHttpListFragment";
-
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initView() {
- super.initView();
-
- setList((List) null);//ListView需要设置adapter才能显示header和footer; setAdapter调不到子类方法
- }
-
- /**设置列表适配器
- * @param callBack
- */
- @SuppressWarnings("unchecked")
- @Override
- public void setList(AdapterCallBack callBack) {
- super.setList(callBack);
- boolean empty = adapter == null || adapter.isEmpty();
- Log.d(TAG, "setList adapter empty = " + empty);
- lvBaseList.showFooter(! empty);//放setAdapter中不行,adapter!=null时没有调用setAdapter
-
- if (adapter != null && adapter instanceof zuo.biao.library.base.BaseAdapter) {
- ((zuo.biao.library.base.BaseAdapter) adapter).setOnReachViewBorderListener(
- empty || lvBaseList.isFooterShowing() == false ? null : new OnReachViewBorderListener(){
-
- @Override
- public void onReach(int type, View v) {
- if (type == TYPE_BOTTOM) {
- lvBaseList.onLoadMore();
- }
- }
- });
- }
- }
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initData() {
- super.initData();
-
- }
-
- /**
- * 将JSON串转为List(已在非UI线程中)
- * *直接JSON.parseArray(json, getCacheClass());可以省去这个方法,但由于可能json不完全符合parseArray条件,所以还是要保留。
- * *比如json只有其中一部分能作为parseArray的字符串时,必须先提取出这段字符串再parseArray
- */
- public abstract List parseArray(String json);
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
- super.initEvent();
- setOnStopLoadListener(this);
-
- lvBaseList.setXListViewListener(this);
- }
-
- /*
- * @param page 用-page作为requestCode
- */
- @Override
- public abstract void getListAsync(int page);
-
- @Override
- public void onStopRefresh() {
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- lvBaseList.stopRefresh();
- }
- });
- }
- @Override
- public void onStopLoadMore(final boolean isHaveMore) {
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- lvBaseList.stopLoadMore(isHaveMore);
- }
- });
- }
-
- /**
- * @param requestCode = -page {@link #getListAsync(int)}
- * @param resultJson
- * @param e
- */
- @Override
- public void onHttpResponse(final int requestCode, final String resultJson, final Exception e) {
- runThread(TAG + "onHttpResponse", new Runnable() {
-
- @Override
- public void run() {
- int page = 0;
- if (requestCode > 0) {
- Log.w(TAG, "requestCode > 0, 应该用BaseListFragment#getListAsync(int page)中的page的负数作为requestCode!");
- } else {
- page = - requestCode;
- }
- List array = parseArray(resultJson);
-
- if ((array == null || array.isEmpty()) && e != null) {
- onLoadFailed(page, e);
- } else {
- onLoadSucceed(page, array);
- }
- }
- });
- }
-
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseListActivity.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseListActivity.java
deleted file mode 100644
index 7b46113..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseListActivity.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.AdapterCallBack;
-import zuo.biao.library.interfaces.CacheCallBack;
-import zuo.biao.library.interfaces.OnStopLoadListener;
-import zuo.biao.library.manager.CacheManager;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.SettingUtil;
-import zuo.biao.library.util.StringUtil;
-import android.widget.AbsListView;
-import android.widget.BaseAdapter;
-
-/**基础列表Activity
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param AbsListView的子类(ListView,GridView等)
- * @param 管理LV的Adapter
- * @see #lvBaseList
- * @see #initCache
- * @see #initView
- * @see #getListAsync
- * @see #onRefresh
- * @use extends BaseListActivity 并在子类onCreate中调用onRefresh(...), 具体参考.DemoListActivity
- * *缓存使用:在initData前调用initCache(...), 具体参考 .DemoListActivity(onCreate方法内)
- */
-public abstract class BaseListActivity extends BaseActivity {
- private static final String TAG = "BaseListActivity";
-
- private OnStopLoadListener onStopLoadListener;
- /**设置停止加载监听
- * @param onStopLoadListener
- */
- protected void setOnStopLoadListener(OnStopLoadListener onStopLoadListener) {
- this.onStopLoadListener = onStopLoadListener;
- }
-
-
- private CacheCallBack cacheCallBack;
- /**初始化缓存
- * @warn 在initData前使用才有效
- * @param cacheCallBack
- */
- protected void initCache(CacheCallBack cacheCallBack) {
- this.cacheCallBack = cacheCallBack;
- }
-
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**
- * 显示列表的ListView
- * @warn 只使用lvBaseList为显示列表数据的AbsListView(ListView,GridView等),不要在子类中改变它
- */
- protected LV lvBaseList;
- /**
- * 管理LV的Item的Adapter
- */
- protected BA adapter;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
-
- lvBaseList = findView(R.id.lvBaseList);
- }
-
- /**设置adapter
- * @param adapter
- */
- public void setAdapter(BA adapter) {
- this.adapter = adapter;
- lvBaseList.setAdapter(adapter);
- }
-
- /**显示列表(已在UI线程中),一般需求建议直接调用setList(List l, AdapterCallBack callBack)
- * @param list
- */
- public abstract void setList(List list);
-
- /**显示列表(已在UI线程中)
- * @param list
- */
- public void setList(AdapterCallBack callBack) {
- if (adapter == null) {
- setAdapter(callBack.createAdapter());
- }
- callBack.refreshAdapter();
- }
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private boolean isToSaveCache;
- private boolean isToLoadCache;
- @Override
- public void initData() {// 必须调用
-
- isToSaveCache = SettingUtil.cache && cacheCallBack != null && cacheCallBack.getCacheClass() != null;
- isToLoadCache = isToSaveCache && StringUtil.isNotEmpty(cacheCallBack.getCacheGroup(), true);
- }
-
- /**
- * 获取列表,在非UI线程中
- * @must 获取成功后调用onLoadSucceed
- * @param page 在onLoadSucceed中传回来保证一致性
- */
- public abstract void getListAsync(int page);
-
-
-
- public void loadData(int page) {
- loadData(page, isToLoadCache);
- }
-
- /**
- * 列表首页页码。有些服务器设置为1,即列表页码从1开始
- */
- public static final int PAGE_NUM_0 = 0;
-
- /**
- * 数据列表
- */
- private List list;
- /**
- * 正在加载
- */
- protected boolean isLoading = false;
- /**
- * 还有更多可加载数据
- */
- protected boolean isHaveMore = true;
- /**
- * 加载页码,每页对应一定数量的数据
- */
- private int page;
- private int loadCacheStart;
- /**加载数据,用getListAsync方法发请求获取数据
- * @param page_
- * @param isCache
- */
- private void loadData(int page_, final boolean isCache) {
- if (isLoading) {
- Log.w(TAG, "loadData isLoading >> return;");
- return;
- }
- isLoading = true;
- isSucceed = false;
-
- if (page_ <= PAGE_NUM_0) {
- page_ = PAGE_NUM_0;
- isHaveMore = true;
- loadCacheStart = 0;//使用则可像网络正常情况下的重载,不使用则在网络异常情况下不重载(导致重载后加载数据下移)
- } else {
- if (isHaveMore == false) {
- stopLoadData(page_);
- return;
- }
- loadCacheStart = list == null ? 0 : list.size();
- }
- this.page = page_;
- Log.i(TAG, "loadData page_ = " + page_ + "; isCache = " + isCache
- + "; isHaveMore = " + isHaveMore + "; loadCacheStart = " + loadCacheStart);
-
- runThread(TAG + "loadData", new Runnable() {
-
- @Override
- public void run() {
- if (isCache == false) {//从网络获取数据
- getListAsync(page);
- } else {//从缓存获取数据
- onLoadSucceed(page, CacheManager.getInstance().getList(cacheCallBack.getCacheClass()
- , cacheCallBack.getCacheGroup(), loadCacheStart, cacheCallBack.getCacheCount()),
- true);
- if (page <= PAGE_NUM_0) {
- isLoading = false;//stopLoadeData在其它线程isLoading = false;后这个线程里还是true
- loadData(page, false);
- }
- }
- }
- });
- }
-
- /**停止加载数据
- * isCache = false;
- * @param page
- */
- public synchronized void stopLoadData(int page) {
- stopLoadData(page, false);
- }
- /**停止加载数据
- * @param page
- * @param isCache
- */
- private synchronized void stopLoadData(int page, boolean isCache) {
- Log.i(TAG, "stopLoadData isCache = " + isCache);
- isLoading = false;
- dismissProgressDialog();
-
- if (isCache) {
- Log.d(TAG, "stopLoadData isCache >> return;");
- return;
- }
-
- if (onStopLoadListener == null) {
- Log.w(TAG, "stopLoadData onStopLoadListener == null >> return;");
- return;
- }
- onStopLoadListener.onStopRefresh();
- if (page > PAGE_NUM_0) {
- onStopLoadListener.onStopLoadMore(isHaveMore);
- }
- }
-
-
-
- private boolean isSucceed = false;
- /**处理列表
- * @param page
- * @param newList 新数据列表
- * @param isCache
- * @return
- * @return
- */
- public synchronized void handleList(int page, List newList, boolean isCache) {
- if (newList == null) {
- newList = new ArrayList();
- }
- isSucceed = ! newList.isEmpty();
- Log.i(TAG, "\n\n<<<<<<<<<<<<<<<<<\n handleList newList.size = " + newList.size() + "; isCache = " + isCache
- + "; page = " + page + "; isSucceed = " + isSucceed);
-
- if (page <= PAGE_NUM_0) {
- Log.i(TAG, "handleList page <= PAGE_NUM_0 >>>> ");
- saveCacheStart = 0;
- list = new ArrayList(newList);
- if (isCache == false && list.isEmpty() == false) {
- Log.i(TAG, "handleList isCache == false && list.isEmpty() == false >> isToLoadCache = false;");
- isToLoadCache = false;
- }
- } else {
- Log.i(TAG, "handleList page > PAGE_NUM_0 >>>> ");
- if (list == null) {
- list = new ArrayList();
- }
- saveCacheStart = list.size();
- isHaveMore = ! newList.isEmpty();
- if (isHaveMore) {
- list.addAll(newList);
- }
- }
-
- Log.i(TAG, "handleList list.size = " + list.size() + "; isHaveMore = " + isHaveMore
- + "; isToLoadCache = " + isToLoadCache + "; saveCacheStart = " + saveCacheStart
- + "\n>>>>>>>>>>>>>>>>>>\n\n");
- }
-
-
-
- /**加载成功
- * isCache = false;
- * @param page
- * @param newList
- */
- public synchronized void onLoadSucceed(final int page, final List newList) {
- onLoadSucceed(page, newList, false);
- }
- /**加载成功
- * @param page
- * @param newList
- * @param isCache newList是否为缓存
- */
- private synchronized void onLoadSucceed(final int page, final List newList, final boolean isCache) {
- runThread(TAG + "onLoadSucceed", new Runnable() {
- @Override
- public void run() {
- Log.i(TAG, "onLoadSucceed page = " + page + "; isCache = " + isCache + " >> handleList...");
- handleList(page, newList, isCache);
-
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- stopLoadData(page, isCache);
- setList(list);
- }
- });
-
- if (isToSaveCache && isCache == false) {
- saveCache(newList);
- }
- }
- });
- }
-
- /**加载失败
- * @param page
- * @param e
- */
- public synchronized void onLoadFailed(int page, Exception e) {
- Log.e(TAG, "onLoadFailed page = " + page + "; e = " + (e == null ? null : e.getMessage()));
- stopLoadData(page);
- showShortToast(R.string.get_failed);
- }
-
-
-
-
- //缓存<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- // /**
- // * 获取缓存每页数量
- // * @return > 0 ?缓存 : 不缓存
- // */
- // public int getCacheCount() {
- // //让给服务器返回每页数量为count的数据,不行的话在子类重写 Math.max(10, newList == null ? 0 : newList.size());
- // return CacheManager.MAX_PAGE_SIZE;
- // }
-
- private int saveCacheStart;
- /**保存缓存
- * @param newList
- */
- public synchronized void saveCache(List newList) {
- if (cacheCallBack == null || newList == null || newList.isEmpty()) {
- Log.e(TAG, "saveCache cacheCallBack == null || newList == null || newList.isEmpty() >> return;");
- return;
- }
-
- LinkedHashMap map = new LinkedHashMap();
- for (T data : newList) {
- if (data != null) {
- map.put(cacheCallBack.getCacheId(data), data);//map.put(null, data);不会崩溃
- }
- }
-
- CacheManager.getInstance().saveList(cacheCallBack.getCacheClass(), cacheCallBack.getCacheGroup()
- , map, saveCacheStart, cacheCallBack.getCacheCount());
- }
- //缓存>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {
-
- }
-
-
- /**刷新(从头加载)
- * @must 在子类onCreate中调用,建议放在最后
- */
- public void onRefresh() {
- loadData(PAGE_NUM_0);
- }
- /**加载更多
- */
- public void onLoadMore() {
- if (isSucceed == false && page <= PAGE_NUM_0) {
- Log.w(TAG, "onLoadMore isSucceed == false && page <= PAGE_NUM_0 >> return;");
- return;
- }
- loadData(page + (isSucceed ? 1 : 0));
- }
-
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- protected void onDestroy() {
- isLoading = false;
- isHaveMore = false;
- isToSaveCache = false;
- isToLoadCache = false;
-
- super.onDestroy();
-
- lvBaseList = null;
- list = null;
-
- onStopLoadListener = null;
- cacheCallBack = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseListFragment.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseListFragment.java
deleted file mode 100644
index c34f019..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseListFragment.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.AdapterCallBack;
-import zuo.biao.library.interfaces.CacheCallBack;
-import zuo.biao.library.interfaces.OnStopLoadListener;
-import zuo.biao.library.manager.CacheManager;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.SettingUtil;
-import zuo.biao.library.util.StringUtil;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.AbsListView;
-import android.widget.BaseAdapter;
-
-/**基础列表Activity
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param AbsListView的子类(ListView,GridView等)
- * @param 管理LV的Adapter
- * @see #onCreateView
- * @see #setContentView
- * @see #lvBaseList
- * @see #initCache
- * @see #initView
- * @see #getListAsync
- * @see #onRefresh
- * @use extends BaseListFragment 并在子类onCreate中调用onRefresh(...), 具体参考.DemoListFragment
- * *缓存使用:在initData前调用initCache(...), 具体参考 .UserListFragment(onCreate方法内)
- */
-public abstract class BaseListFragment extends BaseFragment {
- private static final String TAG = "BaseListFragment";
-
- private OnStopLoadListener onStopLoadListener;
- /**设置停止加载监听
- * @param onStopLoadListener
- */
- protected void setOnStopLoadListener(OnStopLoadListener onStopLoadListener) {
- this.onStopLoadListener = onStopLoadListener;
- }
-
-
- private CacheCallBack cacheCallBack;
- /**初始化缓存
- * @warn 在initData前使用才有效
- * @param cacheCallBack
- */
- protected void initCache(CacheCallBack cacheCallBack) {
- this.cacheCallBack = cacheCallBack;
- }
-
-
- /**
- * @param inflater
- * @param container
- * @param savedInstanceState
- * @return
- * @must 1.不要在子类重复这个类中onCreateView中的代码;
- * 2.在子类onCreateView中super.onCreateView(inflater, container, savedInstanceState);
- * initView();initData();initEvent(); return view;
- */
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- return onCreateView(inflater, container, savedInstanceState, 0);
- }
- /**
- * @param inflater
- * @param container
- * @param savedInstanceState
- * @param layoutResID fragment全局视图view的布局资源id,默认值为R.layout.base_http_list_fragment
- * @return
- * @must 1.不要在子类重复这个类中onCreateView中的代码;
- * 2.在子类onCreateView中super.onCreateView(inflater, container, savedInstanceState, layoutResID);
- * initView();initData();initEvent(); return view;
- */
- public final View onCreateView(LayoutInflater inflater, ViewGroup container
- , Bundle savedInstanceState, int layoutResID) {
- //类相关初始化,必须使用<<<<<<<<<<<<<<<<<<
- super.onCreateView(inflater, container, savedInstanceState);
- //调用这个类的setContentView而崩溃 super.setContentView(layoutResID <= 0 ? R.layout.base_tab_activity : layoutResID);
- view = inflater.inflate(layoutResID <= 0 ? R.layout.base_list_fragment : layoutResID, container, false);
- //类相关初始化,必须使用>>>>>>>>>>>>>>>>
-
- return view;
- }
-
-
- //防止子类中setContentView <<<<<<<<<<<<<<<<<<<<<<<<
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public final void setContentView(int layoutResID) {
- setContentView(null);
- }
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public final void setContentView(View view) {
- setContentView(null, null);
- }
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public final void setContentView(View view, LayoutParams params) {
- throw new UnsupportedOperationException(TAG + "不支持setContentView,传界面布局请使用onCreateView(" +
- "LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, int layoutResID)等方法");
- }
- //防止子类中setContentView >>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**
- * 显示列表的ListView
- * @warn 只使用lvBaseList为显示列表数据的AbsListView(ListView,GridView等),不要在子类中改变它
- */
- protected LV lvBaseList;
- /**
- * 管理LV的Item的Adapter
- */
- protected BA adapter;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
-
- lvBaseList = findView(R.id.lvBaseList);
- }
-
- /**设置adapter
- * @param adapter
- */
- public void setAdapter(BA adapter) {
- this.adapter = adapter;
- lvBaseList.setAdapter(adapter);
- }
-
- /**显示列表(已在UI线程中),一般需求建议直接调用setList(List l, AdapterCallBack callBack)
- * @param list
- */
- public abstract void setList(List list);
-
- /**显示列表(已在UI线程中)
- * @param list
- */
- public void setList(AdapterCallBack callBack) {
- if (adapter == null) {
- setAdapter(callBack.createAdapter());
- }
- callBack.refreshAdapter();
- }
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private boolean isToSaveCache;
- private boolean isToLoadCache;
- @Override
- public void initData() {// 必须调用
-
- isToSaveCache = SettingUtil.cache && cacheCallBack != null && cacheCallBack.getCacheClass() != null;
- isToLoadCache = isToSaveCache && StringUtil.isNotEmpty(cacheCallBack.getCacheGroup(), true);
- }
-
- /**
- * 获取列表,在非UI线程中
- * @must 获取成功后调用onLoadSucceed
- * @param page 在onLoadSucceed中传回来保证一致性
- */
- public abstract void getListAsync(int page);
-
-
-
- public void loadData(int page) {
- loadData(page, isToLoadCache);
- }
-
- /**
- * 列表首页页码。有些服务器设置为1,即列表页码从1开始
- */
- public static final int PAGE_NUM_0 = 0;
-
- /**
- * 数据列表
- */
- private List list;
- /**
- * 正在加载
- */
- protected boolean isLoading = false;
- /**
- * 还有更多可加载数据
- */
- protected boolean isHaveMore = true;
- /**
- * 加载页码,每页对应一定数量的数据
- */
- private int page;
- private int loadCacheStart;
- /**加载数据,用getListAsync方法发请求获取数据
- * @param page_
- * @param isCache
- */
- private void loadData(int page_, final boolean isCache) {
- if (isLoading) {
- Log.w(TAG, "loadData isLoading >> return;");
- return;
- }
- isLoading = true;
- isSucceed = false;
-
- if (page_ <= PAGE_NUM_0) {
- page_ = PAGE_NUM_0;
- isHaveMore = true;
- loadCacheStart = 0;//使用则可像网络正常情况下的重载,不使用则在网络异常情况下不重载(导致重载后加载数据下移)
- } else {
- if (isHaveMore == false) {
- stopLoadData(page_);
- return;
- }
- loadCacheStart = list == null ? 0 : list.size();
- }
- this.page = page_;
- Log.i(TAG, "loadData page_ = " + page_ + "; isCache = " + isCache
- + "; isHaveMore = " + isHaveMore + "; loadCacheStart = " + loadCacheStart);
-
- runThread(TAG + "loadData", new Runnable() {
-
- @Override
- public void run() {
- if (isCache == false) {//从网络获取数据
- getListAsync(page);
- } else {//从缓存获取数据
- onLoadSucceed(page, CacheManager.getInstance().getList(cacheCallBack.getCacheClass()
- , cacheCallBack.getCacheGroup(), loadCacheStart, cacheCallBack.getCacheCount()),
- true);
- if (page <= PAGE_NUM_0) {
- isLoading = false;//stopLoadeData在其它线程isLoading = false;后这个线程里还是true
- loadData(page, false);
- }
- }
- }
- });
- }
-
- /**停止加载数据
- * isCache = false;
- * @param page
- */
- public synchronized void stopLoadData(int page) {
- stopLoadData(page, false);
- }
- /**停止加载数据
- * @param page
- * @param isCache
- */
- private synchronized void stopLoadData(int page, boolean isCache) {
- Log.i(TAG, "stopLoadData isCache = " + isCache);
- isLoading = false;
- dismissProgressDialog();
-
- if (isCache) {
- Log.d(TAG, "stopLoadData isCache >> return;");
- return;
- }
-
- if (onStopLoadListener == null) {
- Log.w(TAG, "stopLoadData onStopLoadListener == null >> return;");
- return;
- }
- onStopLoadListener.onStopRefresh();
- if (page > PAGE_NUM_0) {
- onStopLoadListener.onStopLoadMore(isHaveMore);
- }
- }
-
-
-
- private boolean isSucceed = false;
- /**处理列表
- * @param page
- * @param newList 新数据列表
- * @param isCache
- * @return
- * @return
- */
- public synchronized void handleList(int page, List newList, boolean isCache) {
- if (newList == null) {
- newList = new ArrayList();
- }
- isSucceed = ! newList.isEmpty();
- Log.i(TAG, "\n\n<<<<<<<<<<<<<<<<<\n handleList newList.size = " + newList.size() + "; isCache = " + isCache
- + "; page = " + page + "; isSucceed = " + isSucceed);
-
- if (page <= PAGE_NUM_0) {
- Log.i(TAG, "handleList page <= PAGE_NUM_0 >>>> ");
- saveCacheStart = 0;
- list = new ArrayList(newList);
- if (isCache == false && list.isEmpty() == false) {
- Log.i(TAG, "handleList isCache == false && list.isEmpty() == false >> isToLoadCache = false;");
- isToLoadCache = false;
- }
- } else {
- Log.i(TAG, "handleList page > PAGE_NUM_0 >>>> ");
- if (list == null) {
- list = new ArrayList();
- }
- saveCacheStart = list.size();
- isHaveMore = ! newList.isEmpty();
- if (isHaveMore) {
- list.addAll(newList);
- }
- }
-
- Log.i(TAG, "handleList list.size = " + list.size() + "; isHaveMore = " + isHaveMore
- + "; isToLoadCache = " + isToLoadCache + "; saveCacheStart = " + saveCacheStart
- + "\n>>>>>>>>>>>>>>>>>>\n\n");
- }
-
-
-
- /**加载成功
- * isCache = false;
- * @param page
- * @param newList
- */
- public synchronized void onLoadSucceed(final int page, final List newList) {
- onLoadSucceed(page, newList, false);
- }
- /**加载成功
- * @param page
- * @param newList
- * @param isCache newList是否为缓存
- */
- private synchronized void onLoadSucceed(final int page, final List newList, final boolean isCache) {
- runThread(TAG + "onLoadSucceed", new Runnable() {
- @Override
- public void run() {
- Log.i(TAG, "onLoadSucceed page = " + page + "; isCache = " + isCache + " >> handleList...");
- handleList(page, newList, isCache);
-
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- stopLoadData(page, isCache);
- setList(list);
- }
- });
-
- if (isToSaveCache && isCache == false) {
- saveCache(newList);
- }
- }
- });
- }
-
- /**加载失败
- * @param page
- * @param e
- */
- public synchronized void onLoadFailed(int page, Exception e) {
- Log.e(TAG, "onLoadFailed page = " + page + "; e = " + (e == null ? null : e.getMessage()));
- stopLoadData(page);
- showShortToast(R.string.get_failed);
- }
-
-
-
-
- //缓存<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- // /**
- // * 获取缓存每页数量
- // * @return > 0 ?缓存 : 不缓存
- // */
- // public int getCacheCount() {
- // //让给服务器返回每页数量为count的数据,不行的话在子类重写 Math.max(10, newList == null ? 0 : newList.size());
- // return CacheManager.MAX_PAGE_SIZE;
- // }
-
- private int saveCacheStart;
- /**保存缓存
- * @param newList
- */
- public synchronized void saveCache(List newList) {
- if (cacheCallBack == null || newList == null || newList.isEmpty()) {
- Log.e(TAG, "saveCache cacheCallBack == null || newList == null || newList.isEmpty() >> return;");
- return;
- }
-
- LinkedHashMap map = new LinkedHashMap();
- for (T data : newList) {
- if (data != null) {
- map.put(cacheCallBack.getCacheId(data), data);//map.put(null, data);不会崩溃
- }
- }
-
- CacheManager.getInstance().saveList(cacheCallBack.getCacheClass(), cacheCallBack.getCacheGroup()
- , map, saveCacheStart, cacheCallBack.getCacheCount());
- }
- //缓存>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {
-
- }
-
-
- /**刷新(从头加载)
- * @must 在子类onCreate中调用,建议放在最后
- */
- public void onRefresh() {
- loadData(PAGE_NUM_0);
- }
- /**加载更多
- */
- public void onLoadMore() {
- if (isSucceed == false && page <= PAGE_NUM_0) {
- Log.w(TAG, "onLoadMore isSucceed == false && page <= PAGE_NUM_0 >> return;");
- return;
- }
- loadData(page + (isSucceed ? 1 : 0));
- }
-
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void onDestroy() {
- isLoading = false;
- isHaveMore = false;
- isToSaveCache = false;
- isToLoadCache = false;
-
- super.onDestroy();
-
- lvBaseList = null;
- list = null;
-
- onStopLoadListener = null;
- cacheCallBack = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseModel.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseModel.java
deleted file mode 100644
index 2b82a0c..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseModel.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.io.Serializable;
-
-/**基础Model,继承它可以省去部分代码,也可以不继承
- * *isCorrect可以用于BaseModel子类的数据校验
- * *implements Serializable 是为了网络传输字节流转换
- * @author Lemon
- * @use extends BaseModel
- */
-@SuppressWarnings("serial")
-public abstract class BaseModel implements Serializable {
-
- public long id;
-
-
- public long getId() {
- return id;
- }
- public void setId(long id) {
- this.id = id;
- }
-
-
- /**数据正确性校验
- * @param data
- * @return
- */
- public static boolean isCorrect(BaseModel data) {
- return data != null && data.isCorrect();
- }
-
- /**数据正确性校验
- * @return
- */
- protected abstract boolean isCorrect();//public导致JSON.toJSONString会添加correct字段
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerActivity.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerActivity.java
deleted file mode 100644
index d13d5ab..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerActivity.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.CacheCallBack;
-import zuo.biao.library.interfaces.OnStopLoadListener;
-import zuo.biao.library.manager.CacheManager;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.StringUtil;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-
-/**基础RecyclerView Activity
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param ViewHolder或其子类
- * @param RecyclerView或其子类
- * @param 管理LV的Adapter
- * @see #rvBaseRecycler
- * @see #initCache
- * @see #initView
- * @see #getListAsync
- * @see #onRefresh
- * @use extends BaseRecyclerActivity 并在子类onCreate中调用onRefresh(...), 具体参考.DemoListActivity
- * *缓存使用:在initData前调用initCache(...), 具体参考 .DemoListActivity(onCreate方法内)
- */
-public abstract class BaseRecyclerActivity> extends BaseActivity {
- private static final String TAG = "BaseRecyclerActivity";
-
- public interface AdapterCallBack> {
- /**创建一个Adapter
- * @return new A();
- */
- A createAdapter();
-
- /**
- * BaseAdapter#notifyDataSetChanged()有时无效,有时因列表更新不及时而崩溃,所以需要在自定义adapter内自定义一个刷新方法。
- * 为什么不直接让自定义Adapter implement OnRefreshListener,从而直接 onRefreshListener.onRefresh(List list) ?
- * 因为这样的话会不兼容部分 Android SDK 或 第三方库的Adapter
- */
- void refreshAdapter();
- }
-
-
- private OnStopLoadListener onStopLoadListener;
- /**设置停止加载监听
- * @param onStopLoadListener
- */
- protected void setOnStopLoadListener(OnStopLoadListener onStopLoadListener) {
- this.onStopLoadListener = onStopLoadListener;
- }
-
- private CacheCallBack cacheCallBack;
- /**初始化缓存
- * @warn 在initData前使用才有效
- * @param cacheCallBack
- */
- protected void initCache(CacheCallBack cacheCallBack) {
- this.cacheCallBack = cacheCallBack;
- }
-
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**
- * 显示列表的RecyclerView
- * @warn 只使用rvBaseRecycler为显示列表数据的RecyclerView,不要在子类中改变它
- */
- protected RV rvBaseRecycler;
- /**
- * 管理LV的Item的Adapter
- */
- protected A adapter;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
-
- rvBaseRecycler = findView(R.id.rvBaseRecycler);
- rvBaseRecycler.setLayoutManager(new LinearLayoutManager(context));
- }
-
- /**设置adapter
- * @param adapter
- */
- public void setAdapter(A adapter) {
- this.adapter = adapter;
- rvBaseRecycler.setAdapter(adapter);
- }
-
- /**显示列表(已在UI线程中),一般需求建议直接调用setList(List l, AdapterCallBack callBack)
- * @param list
- */
- public abstract void setList(List list);
-
- /**显示列表(已在UI线程中)
- * @param callBack
- */
- public void setList(AdapterCallBack callBack) {
- if (adapter == null) {
- setAdapter(callBack.createAdapter());
- }
- callBack.refreshAdapter();
- }
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private boolean isToSaveCache;
- private boolean isToLoadCache;
- @Override
- public void initData() {// 必须调用
-
- isToSaveCache = cacheCallBack != null && cacheCallBack.getCacheClass() != null;
- isToLoadCache = isToSaveCache && StringUtil.isNotEmpty(cacheCallBack.getCacheGroup(), true);
- }
-
- /**
- * 获取列表,在非UI线程中
- * @must 获取成功后调用onLoadSucceed
- * @param page 在onLoadSucceed中传回来保证一致性
- */
- public abstract void getListAsync(int page);
-
-
-
- public void loadData(int page) {
- loadData(page, isToLoadCache);
- }
-
- /**
- * 起始页码
- */
- private static final int PAGE_NUM_0 = 1;
-
- /**
- * 数据列表
- */
- private List list;
- /**
- * 正在加载
- */
- protected boolean isLoading = false;
- /**
- * 还有更多可加载数据
- */
- protected boolean isHaveMore = true;
- /**
- * 加载页码,每页对应一定数量的数据
- */
- private int page;
- private int loadCacheStart;
- /**加载数据,用getListAsync方法发请求获取数据
- * @param page_
- * @param isCache
- */
- private void loadData(int page_, final boolean isCache) {
- if (isLoading) {
- Log.w(TAG, "loadData isLoading >> return;");
- return;
- }
- isLoading = true;
- isSucceed = false;
-
- if (page_ <= PAGE_NUM_0) {
- page_ = PAGE_NUM_0;
- isHaveMore = true;
- loadCacheStart = 0;//使用则可像网络正常情况下的重载,不使用则在网络异常情况下不重载(导致重载后加载数据下移)
- } else {
- if (isHaveMore == false) {
- stopLoadData(page_);
- return;
- }
- loadCacheStart = list == null ? 0 : list.size();
- }
- this.page = page_;
- Log.i(TAG, "loadData page_ = " + page_ + "; isCache = " + isCache
- + "; isHaveMore = " + isHaveMore + "; loadCacheStart = " + loadCacheStart);
-
- runThread(TAG + "loadData", new Runnable() {
-
- @Override
- public void run() {
- if (isCache == false) {//从网络获取数据
- getListAsync(page);
- } else {//从缓存获取数据
- onLoadSucceed(page, CacheManager.getInstance().getList(cacheCallBack.getCacheClass()
- , cacheCallBack.getCacheGroup(), loadCacheStart, cacheCallBack.getCacheCount()),
- true);
- if (page <= PAGE_NUM_0) {
- isLoading = false;//stopLoadeData在其它线程isLoading = false;后这个线程里还是true
- loadData(page, false);
- }
- }
- }
- });
- }
-
- /**停止加载数据
- * isCache = false;
- * @param page
- */
- public synchronized void stopLoadData(int page) {
- stopLoadData(page, false);
- }
- /**停止加载数据
- * @param page
- * @param isCache
- */
- private synchronized void stopLoadData(int page, boolean isCache) {
- Log.i(TAG, "stopLoadData isCache = " + isCache);
- isLoading = false;
- dismissProgressDialog();
-
- if (isCache) {
- Log.d(TAG, "stopLoadData isCache >> return;");
- return;
- }
-
- if (onStopLoadListener == null) {
- Log.w(TAG, "stopLoadData onStopLoadListener == null >> return;");
- return;
- }
- onStopLoadListener.onStopRefresh();
- if (page > PAGE_NUM_0) {
- onStopLoadListener.onStopLoadMore(isHaveMore);
- }
- }
-
-
-
- private boolean isSucceed = false;
- /**处理列表
- * @param page
- * @param newList 新数据列表
- * @param isCache
- * @return
- * @return
- */
- public synchronized void handleList(int page, List newList, boolean isCache) {
- if (newList == null) {
- newList = new ArrayList();
- }
- isSucceed = ! newList.isEmpty();
- Log.i(TAG, "\n\n<<<<<<<<<<<<<<<<<\n handleList newList.size = " + newList.size() + "; isCache = " + isCache
- + "; page = " + page + "; isSucceed = " + isSucceed);
-
- if (page <= PAGE_NUM_0) {
- Log.i(TAG, "handleList page <= PAGE_NUM_0 >>>> ");
- saveCacheStart = 0;
- list = new ArrayList(newList);
- if (isCache == false && list.isEmpty() == false) {
- Log.i(TAG, "handleList isCache == false && list.isEmpty() == false >> isToLoadCache = false;");
- isToLoadCache = false;
- }
- } else {
- Log.i(TAG, "handleList page > PAGE_NUM_0 >>>> ");
- if (list == null) {
- list = new ArrayList();
- }
- saveCacheStart = list.size();
- isHaveMore = ! newList.isEmpty();
- if (isHaveMore) {
- list.addAll(newList);
- }
- }
-
- Log.i(TAG, "handleList list.size = " + list.size() + "; isHaveMore = " + isHaveMore
- + "; isToLoadCache = " + isToLoadCache + "; saveCacheStart = " + saveCacheStart
- + "\n>>>>>>>>>>>>>>>>>>\n\n");
- }
-
-
-
- /**加载成功
- * isCache = false;
- * @param page
- * @param newList
- */
- public synchronized void onLoadSucceed(final int page, final List newList) {
- onLoadSucceed(page, newList, false);
- }
- /**加载成功
- * @param page
- * @param newList
- * @param isCache newList是否为缓存
- */
- private synchronized void onLoadSucceed(final int page, final List newList, final boolean isCache) {
- runThread(TAG + "onLoadSucceed", new Runnable() {
- @Override
- public void run() {
- Log.i(TAG, "onLoadSucceed page = " + page + "; isCache = " + isCache + " >> handleList...");
- handleList(page, newList, isCache);
-
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- stopLoadData(page, isCache);
- setList(list);
- }
- });
-
- if (isToSaveCache && isCache == false) {
- saveCache(newList);
- }
- }
- });
- }
-
- /**加载失败
- * @param page
- * @param e
- */
- public synchronized void onLoadFailed(int page, Exception e) {
- Log.e(TAG, "onLoadFailed page = " + page + "; e = " + (e == null ? null : e.getMessage()));
- stopLoadData(page);
- showShortToast(R.string.get_failed);
- }
-
-
-
-
- //缓存<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- // /**
- // * 获取缓存每页数量
- // * @return > 0 ?缓存 : 不缓存
- // */
- // public int getCacheCount() {
- // //让给服务器返回每页数量为count的数据,不行的话在子类重写 Math.max(10, newList == null ? 0 : newList.size());
- // return CacheManager.MAX_PAGE_SIZE;
- // }
-
- private int saveCacheStart;
- /**保存缓存
- * @param newList
- */
- public synchronized void saveCache(List newList) {
- if (cacheCallBack == null || newList == null || newList.isEmpty()) {
- Log.e(TAG, "saveCache cacheCallBack == null || newList == null || newList.isEmpty() >> return;");
- return;
- }
-
- LinkedHashMap map = new LinkedHashMap();
- for (T data : newList) {
- if (data != null) {
- map.put(cacheCallBack.getCacheId(data), data);//map.put(null, data);不会崩溃
- }
- }
-
- CacheManager.getInstance().saveList(cacheCallBack.getCacheClass(), cacheCallBack.getCacheGroup()
- , map, saveCacheStart, cacheCallBack.getCacheCount());
- }
- //缓存>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {
-
- }
-
-
- /**刷新(从头加载)
- * @must 在子类onCreate中调用,建议放在最后
- */
- public void onRefresh() {
- loadData(PAGE_NUM_0);
- }
- /**加载更多
- */
- public void onLoadMore() {
- if (isSucceed == false && page <= PAGE_NUM_0) {
- Log.w(TAG, "onLoadMore isSucceed == false && page <= PAGE_NUM_0 >> return;");
- return;
- }
- loadData(page + (isSucceed ? 1 : 0));
- }
-
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- protected void onDestroy() {
- isLoading = false;
- isHaveMore = false;
- isToSaveCache = false;
- isToLoadCache = false;
-
- super.onDestroy();
-
- rvBaseRecycler = null;
- list = null;
-
- onStopLoadListener = null;
- cacheCallBack = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerAdapter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerAdapter.java
deleted file mode 100644
index e8f2e89..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerAdapter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import android.app.Activity;
-import android.content.res.Resources;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.interfaces.AdapterViewPresenter;
-
-/**基础RecyclerView Adapter
- *
适用于RecyclerView及其子类
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param BaseRecyclerView的子类
- * @see #setOnViewClickListener
- * @use extends BaseRecyclerAdapter, 具体参考.DemoRecyclerAdapter
- */
-public abstract class BaseRecyclerAdapter> extends RecyclerView.Adapter
-implements AdapterViewPresenter {
-
- /**
- * 管理整个界面的Activity实例
- */
- public Activity context;
- /**
- * 布局解释器,用来实例化列表的item的界面
- */
- public LayoutInflater inflater;
- /**
- * 资源获取器,用于获取res目录下的文件及文件中的内容等
- */
- public Resources resources;
- public BaseRecyclerAdapter(Activity context) {
- super();
- this.context = context;
-
- inflater = context.getLayoutInflater();
- resources = context.getResources();
- }
-
- /**
- * 传进来的数据列表
- */
- public List list;
- public List getList() {
- return list;
- }
-
- /**刷新列表
- */
- public synchronized void refresh(List list) {
- this.list = list == null ? null : new ArrayList(list);
- notifyDataSetChanged();
- }
-
- @Override
- public int getItemCount() {
- return list.size();
- }
-
-
- public T getItem(int position) {
- return list.get(position);
- }
-
-
- @Override
- public BV onCreateViewHolder(ViewGroup parent, int position) {
- BV bv = createView(position, parent);
- bv.createView(inflater);
- return bv;
- }
-
-
- @Override
- public void onBindViewHolder(BV bv, int position) {
- bindView(position, bv);
- }
-
- @Override
- public void bindView(int position, BV bv) {
- bv.bindView(getItem(position));
- }
-
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerFragment.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerFragment.java
deleted file mode 100644
index c13c705..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerFragment.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.CacheCallBack;
-import zuo.biao.library.interfaces.OnStopLoadListener;
-import zuo.biao.library.manager.CacheManager;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.StringUtil;
-import android.os.Bundle;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
-
-/**基础RecyclerView Fragment
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param RecyclerView或其子类
- * @param ViewHolder或其子类
- * @param 管理LV的Adapter
- * @see #rvBaseRecycler
- * @see #initCache
- * @see #initView
- * @see #getListAsync
- * @see #onRefresh
- * @use extends BaseRecyclerFragment 并在子类onCreateView中调用onRefresh(...), 具体参考.DemoListFragment
- * *缓存使用:在initData前调用initCache(...), 具体参考 .DemoListActivity(onCreate方法内)
- */
-public abstract class BaseRecyclerFragment> extends BaseFragment {
- private static final String TAG = "BaseRecyclerActivity";
-
- public interface AdapterCallBack> {
- /**创建一个Adapter
- * @return new A();
- */
- A createAdapter();
-
- /**
- * BaseAdapter#notifyDataSetChanged()有时无效,有时因列表更新不及时而崩溃,所以需要在自定义adapter内自定义一个刷新方法。
- * 为什么不直接让自定义Adapter implement OnRefreshListener,从而直接 onRefreshListener.onRefresh(List list) ?
- * 因为这样的话会不兼容部分 Android SDK 或 第三方库的Adapter
- */
- void refreshAdapter();
- }
-
-
- private OnStopLoadListener onStopLoadListener;
- /**设置停止加载监听
- * @param onStopLoadListener
- */
- protected void setOnStopLoadListener(OnStopLoadListener onStopLoadListener) {
- this.onStopLoadListener = onStopLoadListener;
- }
-
- private CacheCallBack cacheCallBack;
- /**初始化缓存
- * @warn 在initData前使用才有效
- * @param cacheCallBack
- */
- protected void initCache(CacheCallBack cacheCallBack) {
- this.cacheCallBack = cacheCallBack;
- }
-
-
-
- /**
- * @param inflater
- * @param container
- * @param savedInstanceState
- * @return
- * @must 1.不要在子类重复这个类中onCreateView中的代码;
- * 2.在子类onCreateView中super.onCreateView(inflater, container, savedInstanceState);
- * initView();initData();initEvent(); return view;
- */
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- return onCreateView(inflater, container, savedInstanceState, 0);
- }
- /**
- * @param inflater
- * @param container
- * @param savedInstanceState
- * @param layoutResID fragment全局视图view的布局资源id,默认值为R.layout.base_http_list_fragment
- * @return
- * @must 1.不要在子类重复这个类中onCreateView中的代码;
- * 2.在子类onCreateView中super.onCreateView(inflater, container, savedInstanceState, layoutResID);
- * initView();initData();initEvent(); return view;
- */
- public final View onCreateView(LayoutInflater inflater, ViewGroup container
- , Bundle savedInstanceState, int layoutResID) {
- //类相关初始化,必须使用<<<<<<<<<<<<<<<<<<
- super.onCreateView(inflater, container, savedInstanceState);
- //调用这个类的setContentView而崩溃 super.setContentView(layoutResID <= 0 ? R.layout.base_recycler_fragment : layoutResID);
- view = inflater.inflate(layoutResID <= 0 ? R.layout.base_recycler_fragment : layoutResID, container, false);
- //类相关初始化,必须使用>>>>>>>>>>>>>>>>
-
- return view;
- }
-
-
- //防止子类中setContentView <<<<<<<<<<<<<<<<<<<<<<<<
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public final void setContentView(int layoutResID) {
- setContentView(null);
- }
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public final void setContentView(View view) {
- setContentView(null, null);
- }
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public final void setContentView(View view, LayoutParams params) {
- throw new UnsupportedOperationException(TAG + "不支持setContentView,传界面布局请使用onCreateView(" +
- "LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, int layoutResID)等方法");
- }
- //防止子类中setContentView >>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**
- * 显示列表的RecyclerView
- * @warn 只使用rvBaseRecycler为显示列表数据的RecyclerView,不要在子类中改变它
- */
- protected RV rvBaseRecycler;
- /**
- * 管理LV的Item的Adapter
- */
- protected A adapter;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
-
- rvBaseRecycler = findView(R.id.rvBaseRecycler);
- rvBaseRecycler.setLayoutManager(new LinearLayoutManager(context));
- }
-
- /**设置adapter
- * @param adapter
- */
- public void setAdapter(A adapter) {
- this.adapter = adapter;
- rvBaseRecycler.setAdapter(adapter);
- }
-
- /**显示列表(已在UI线程中),一般需求建议直接调用setList(List l, AdapterCallBack callBack)
- * @param list
- */
- public abstract void setList(List list);
-
- /**显示列表(已在UI线程中)
- * @param callBack
- */
- public void setList(AdapterCallBack callBack) {
- if (adapter == null) {
- setAdapter(callBack.createAdapter());
- }
- callBack.refreshAdapter();
- }
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private boolean isToSaveCache;
- private boolean isToLoadCache;
- @Override
- public void initData() {// 必须调用
-
- isToSaveCache = cacheCallBack != null && cacheCallBack.getCacheClass() != null;
- isToLoadCache = isToSaveCache && StringUtil.isNotEmpty(cacheCallBack.getCacheGroup(), true);
- }
-
- /**
- * 获取列表,在非UI线程中
- * @must 获取成功后调用onLoadSucceed
- * @param page 在onLoadSucceed中传回来保证一致性
- */
- public abstract void getListAsync(int page);
-
-
-
- public void loadData(int page) {
- loadData(page, isToLoadCache);
- }
-
- /**
- * 起始页码
- */
- private static final int PAGE_NUM_0 = 1;
-
- /**
- * 数据列表
- */
- private List list;
- /**
- * 正在加载
- */
- protected boolean isLoading = false;
- /**
- * 还有更多可加载数据
- */
- protected boolean isHaveMore = true;
- /**
- * 加载页码,每页对应一定数量的数据
- */
- private int page;
- private int loadCacheStart;
- /**加载数据,用getListAsync方法发请求获取数据
- * @param page_
- * @param isCache
- */
- private void loadData(int page_, final boolean isCache) {
- if (isLoading) {
- Log.w(TAG, "loadData isLoading >> return;");
- return;
- }
- isLoading = true;
- isSucceed = false;
-
- if (page_ <= PAGE_NUM_0) {
- page_ = PAGE_NUM_0;
- isHaveMore = true;
- loadCacheStart = 0;//使用则可像网络正常情况下的重载,不使用则在网络异常情况下不重载(导致重载后加载数据下移)
- } else {
- if (isHaveMore == false) {
- stopLoadData(page_);
- return;
- }
- loadCacheStart = list == null ? 0 : list.size();
- }
- this.page = page_;
- Log.i(TAG, "loadData page_ = " + page_ + "; isCache = " + isCache
- + "; isHaveMore = " + isHaveMore + "; loadCacheStart = " + loadCacheStart);
-
- runThread(TAG + "loadData", new Runnable() {
-
- @Override
- public void run() {
- if (isCache == false) {//从网络获取数据
- getListAsync(page);
- } else {//从缓存获取数据
- onLoadSucceed(page, CacheManager.getInstance().getList(cacheCallBack.getCacheClass()
- , cacheCallBack.getCacheGroup(), loadCacheStart, cacheCallBack.getCacheCount()),
- true);
- if (page <= PAGE_NUM_0) {
- isLoading = false;//stopLoadeData在其它线程isLoading = false;后这个线程里还是true
- loadData(page, false);
- }
- }
- }
- });
- }
-
- /**停止加载数据
- * isCache = false;
- * @param page
- */
- public synchronized void stopLoadData(int page) {
- stopLoadData(page, false);
- }
- /**停止加载数据
- * @param page
- * @param isCache
- */
- private synchronized void stopLoadData(int page, boolean isCache) {
- Log.i(TAG, "stopLoadData isCache = " + isCache);
- isLoading = false;
- dismissProgressDialog();
-
- if (isCache) {
- Log.d(TAG, "stopLoadData isCache >> return;");
- return;
- }
-
- if (onStopLoadListener == null) {
- Log.w(TAG, "stopLoadData onStopLoadListener == null >> return;");
- return;
- }
- onStopLoadListener.onStopRefresh();
- if (page > PAGE_NUM_0) {
- onStopLoadListener.onStopLoadMore(isHaveMore);
- }
- }
-
-
-
- private boolean isSucceed = false;
- /**处理列表
- * @param page
- * @param newList 新数据列表
- * @param isCache
- * @return
- * @return
- */
- public synchronized void handleList(int page, List newList, boolean isCache) {
- if (newList == null) {
- newList = new ArrayList();
- }
- isSucceed = ! newList.isEmpty();
- Log.i(TAG, "\n\n<<<<<<<<<<<<<<<<<\n handleList newList.size = " + newList.size() + "; isCache = " + isCache
- + "; page = " + page + "; isSucceed = " + isSucceed);
-
- if (page <= PAGE_NUM_0) {
- Log.i(TAG, "handleList page <= PAGE_NUM_0 >>>> ");
- saveCacheStart = 0;
- list = new ArrayList(newList);
- if (isCache == false && list.isEmpty() == false) {
- Log.i(TAG, "handleList isCache == false && list.isEmpty() == false >> isToLoadCache = false;");
- isToLoadCache = false;
- }
- } else {
- Log.i(TAG, "handleList page > PAGE_NUM_0 >>>> ");
- if (list == null) {
- list = new ArrayList();
- }
- saveCacheStart = list.size();
- isHaveMore = ! newList.isEmpty();
- if (isHaveMore) {
- list.addAll(newList);
- }
- }
-
- Log.i(TAG, "handleList list.size = " + list.size() + "; isHaveMore = " + isHaveMore
- + "; isToLoadCache = " + isToLoadCache + "; saveCacheStart = " + saveCacheStart
- + "\n>>>>>>>>>>>>>>>>>>\n\n");
- }
-
-
-
- /**加载成功
- * isCache = false;
- * @param page
- * @param newList
- */
- public synchronized void onLoadSucceed(final int page, final List newList) {
- onLoadSucceed(page, newList, false);
- }
- /**加载成功
- * @param page
- * @param newList
- * @param isCache newList是否为缓存
- */
- private synchronized void onLoadSucceed(final int page, final List newList, final boolean isCache) {
- runThread(TAG + "onLoadSucceed", new Runnable() {
- @Override
- public void run() {
- Log.i(TAG, "onLoadSucceed page = " + page + "; isCache = " + isCache + " >> handleList...");
- handleList(page, newList, isCache);
-
- runUiThread(new Runnable() {
-
- @Override
- public void run() {
- stopLoadData(page, isCache);
- setList(list);
- }
- });
-
- if (isToSaveCache && isCache == false) {
- saveCache(newList);
- }
- }
- });
- }
-
- /**加载失败
- * @param page
- * @param e
- */
- public synchronized void onLoadFailed(int page, Exception e) {
- Log.e(TAG, "onLoadFailed page = " + page + "; e = " + (e == null ? null : e.getMessage()));
- stopLoadData(page);
- showShortToast(R.string.get_failed);
- }
-
-
-
-
- //缓存<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- // /**
- // * 获取缓存每页数量
- // * @return > 0 ?缓存 : 不缓存
- // */
- // public int getCacheCount() {
- // //让给服务器返回每页数量为count的数据,不行的话在子类重写 Math.max(10, newList == null ? 0 : newList.size());
- // return CacheManager.MAX_PAGE_SIZE;
- // }
-
- private int saveCacheStart;
- /**保存缓存
- * @param newList
- */
- public synchronized void saveCache(List newList) {
- if (cacheCallBack == null || newList == null || newList.isEmpty()) {
- Log.e(TAG, "saveCache cacheCallBack == null || newList == null || newList.isEmpty() >> return;");
- return;
- }
-
- LinkedHashMap map = new LinkedHashMap();
- for (T data : newList) {
- if (data != null) {
- map.put(cacheCallBack.getCacheId(data), data);//map.put(null, data);不会崩溃
- }
- }
-
- CacheManager.getInstance().saveList(cacheCallBack.getCacheClass(), cacheCallBack.getCacheGroup()
- , map, saveCacheStart, cacheCallBack.getCacheCount());
- }
- //缓存>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {
-
- }
-
-
- /**刷新(从头加载)
- * @must 在子类onCreate中调用,建议放在最后
- */
- public void onRefresh() {
- loadData(PAGE_NUM_0);
- }
- /**加载更多
- */
- public void onLoadMore() {
- if (isSucceed == false && page <= PAGE_NUM_0) {
- Log.w(TAG, "onLoadMore isSucceed == false && page <= PAGE_NUM_0 >> return;");
- return;
- }
- loadData(page + (isSucceed ? 1 : 0));
- }
-
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void onDestroy() {
- isLoading = false;
- isHaveMore = false;
- isToSaveCache = false;
- isToLoadCache = false;
-
- super.onDestroy();
-
- rvBaseRecycler = null;
- list = null;
-
- onStopLoadListener = null;
- cacheCallBack = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerView.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerView.java
deleted file mode 100644
index 0cb584b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseRecyclerView.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import android.app.Activity;
-import android.support.annotation.LayoutRes;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.View;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.base.BaseView.OnViewClickListener;
-
-/**基础自定义RecyclerView
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @see OnViewClickListener
- * @use extends RecyclerView, 具体参考.DemoRecyclerView
- */
-public abstract class BaseRecyclerView extends RecyclerView.ViewHolder {
-
- public Activity context;
- public BaseRecyclerView(Activity context, @LayoutRes int layoutResId) {
- super(context.getLayoutInflater().inflate(layoutResId, null));
- this.context = context;
- }
-
- protected List onClickViewList;
- /**通过id查找并获取控件,使用时不需要强转
- * @param id
- * @return
- */
- @SuppressWarnings("unchecked")
- public V findView(int id) {
- return (V) itemView.findViewById(id);
- }
- /**通过id查找并获取控件,使用时不需要强转
- * @param id
- * @return
- */
- public V findViewById(int id) {
- return findView(id);
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param listener
- * @return
- */
- public V findView(int id, View.OnClickListener listener) {
- V v = findView(id);
- v.setOnClickListener(listener);
- if (onClickViewList == null) {
- onClickViewList = new ArrayList();
- }
- onClickViewList.add(v);
- return v;
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param listener
- * @return
- */
- public V findViewById(int id, View.OnClickListener listener) {
- return findView(id, listener);
- }
-
- protected T data = null;
- /**获取数据
- * @return
- */
- public T getData() {
- return data;
- }
-
-
- public abstract View createView(LayoutInflater inflater);
-
- public abstract void bindView(T data);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseTabActivity.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseTabActivity.java
deleted file mode 100755
index bac7888..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseTabActivity.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.OnBottomDragListener;
-import zuo.biao.library.interfaces.ViewPresenter;
-import zuo.biao.library.ui.TopTabView;
-import zuo.biao.library.ui.TopTabView.OnTabSelectedListener;
-import zuo.biao.library.util.StringUtil;
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-/**基础带标签的FragmentActivity
- * @author Lemon
- * @see #onCreate
- * @see #setContentView
- * @use extends BaseTabActivity, 具体参考.DemoTabActivity
- * @must 在子类onCreate中调用initView();initData();initEvent();
- */
-public abstract class BaseTabActivity extends BaseActivity implements ViewPresenter
-, OnClickListener, OnTabSelectedListener {
- private static final String TAG = "BaseTabActivity";
-
-
-
- /**
- * @param savedInstanceState
- * @return
- * @must 1.不要在子类重复这个类中onCreate中的代码;
- * 2.在子类onCreate中super.onCreate(savedInstanceState);
- * initView();initData();initEvent();
- */
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- onCreate(savedInstanceState, 0);
- }
- /**
- * @param savedInstanceState
- * @param layoutResID activity全局视图view的布局资源id,默认值为R.layout.base_tab_activity
- * @return
- * @must 1.不要在子类重复这个类中onCreate中的代码;
- * 2.在子类onCreate中super.onCreate(savedInstanceState, layoutResID);
- * initView();initData();initEvent();
- */
- protected final void onCreate(Bundle savedInstanceState, int layoutResID) {
- onCreate(savedInstanceState, layoutResID, null);
- }
- /**
- * @param savedInstanceState
- * @param listener this - 滑动返回 ; null - 没有滑动返回
- * @return
- * @must 1.不要在子类重复这个类中onCreate中的代码;
- * 2.在子类onCreate中super.onCreate(savedInstanceState, listener);
- * initView();initData();initEvent();
- */
- protected final void onCreate(Bundle savedInstanceState, OnBottomDragListener listener) {
- onCreate(savedInstanceState, 0, listener);
- }
- /**
- * @param savedInstanceState
- * @param layoutResID activity全局视图view的布局资源id。 <= 0 ? R.layout.base_tab_activity : layoutResID
- * @param listener == null ? 没有滑动返回 : 滑动返回
- * @return
- * @must 1.不要在子类重复这个类中onCreate中的代码;
- * 2.在子类onCreate中super.onCreate(savedInstanceState, layoutResID, listener);
- * initView();initData();initEvent();
- */
- protected final void onCreate(Bundle savedInstanceState, int layoutResID, OnBottomDragListener listener) {
- super.onCreate(savedInstanceState);
- super.setContentView(layoutResID <= 0 ? R.layout.base_tab_activity : layoutResID, listener);
- }
-
- // //BaseActivity重写setContentView后这个方法一定会被调用,final有无都会导致崩溃,去掉throw Exception也会导致contentView为null而崩溃
- // //防止子类中setContentView <<<<<<<<<<<<<<<<<<<<<<<<
- // /**
- // * @warn 不支持setContentView,传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法
- // */
- // @Override
- // public final void setContentView(int layoutResID) {
- // setContentView(null);
- // }
- // /**
- // * @warn 不支持setContentView,传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法
- // */
- // @Override
- // public final void setContentView(View view) {
- // setContentView(null, null);
- // }
- // /**
- // * @warn 不支持setContentView,传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法
- // */
- // @Override
- // public final void setContentView(View view, LayoutParams params) {
- // throw new UnsupportedOperationException(TAG + "不支持setContentView" +
- // ",传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法");
- // }
- // //防止子类中setContentView >>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- @Nullable
- private TextView tvBaseTabTitle;
-
- @Nullable
- private View ivBaseTabReturn;
- @Nullable
- private TextView tvBaseTabReturn;
- @Nullable
- private TextView tvBaseTabForward;
-
- @Nullable
- private ViewGroup llBaseTabTopRightButtonContainer;
-
- private ViewGroup llBaseTabTabContainer;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id(非@Nullable标记)且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
-
- tvBaseTabTitle = findView(R.id.tvBaseTabTitle);
-
- ivBaseTabReturn = findView(R.id.ivBaseTabReturn);
- tvBaseTabReturn = findView(R.id.tvBaseTabReturn);
-
- llBaseTabTopRightButtonContainer = findView(R.id.llBaseTabTopRightButtonContainer);
-
- llBaseTabTabContainer = findView(R.id.llBaseTabTabContainer);
-
- }
-
- /**
- * == true >> 每次点击相应tab都加载,调用getFragment方法重新对点击的tab对应的fragment赋值。
- * 如果不希望重载,可以setOnTabSelectedListener,然后在onTabSelected内重写点击tab事件。
- */
- protected boolean needReload = false;
- /**
- * 当前显示的tab所在位置,对应fragment所在位置
- */
- protected int currentPosition = 0;
-
- /**选择下一个tab和fragment
- */
- public void selectNext() {
- select((getCurrentPosition() + 1) % getCount());
- }
- /**选择tab和fragment
- * @param position
- */
- public void select(int position) {
- topTabView.select(position);
- }
-
- /**选择并显示fragment
- * @param position
- */
- public void selectFragment(int position) {
- if (currentPosition == position) {
- if (needReload) {
- if (fragments[position] != null && fragments[position].isAdded()) {
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.remove(fragments[position]).commit();
- fragments[position] = null;
- }
- } else {
- if (fragments[position] != null && fragments[position].isVisible()) {
- Log.w(TAG, "selectFragment currentPosition == position" +
- " >> fragments[position] != null && fragments[position].isVisible()" +
- " >> return; ");
- return;
- }
- }
- }
-
- if (fragments[position] == null) {
- fragments[position] = getFragment(position);
- }
-
- //全局的fragmentTransaction因为already committed 崩溃
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.hide(fragments[currentPosition]);
- if (fragments[position].isAdded() == false) {
- ft.add(R.id.flBaseTabFragmentContainer, fragments[position]);
- }
- ft.show(fragments[position]).commit();
-
- this.currentPosition = position;
- }
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- protected TopTabView topTabView;
- private Fragment[] fragments;
- @Override
- public void initData() {// 必须调用
-
- if (tvBaseTabTitle != null) {
- tvBaseTabTitle.setVisibility(StringUtil.isNotEmpty(getTitleName(), true) ? View.VISIBLE : View.GONE);
- tvBaseTabTitle.setText(StringUtil.getTrimedString(getTitleName()));
- }
-
- //返回按钮<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- String returnName = getReturnName();
-
- if (returnName == null) {
- if (ivBaseTabReturn != null) {
- ivBaseTabReturn.setVisibility(View.GONE);
- }
- if (tvBaseTabReturn != null) {
- tvBaseTabReturn.setVisibility(View.GONE);
- }
- } else {
- boolean isReturnButtonHasName = StringUtil.isNotEmpty(returnName, true);
- if (ivBaseTabReturn != null) {
- ivBaseTabReturn.setVisibility(isReturnButtonHasName ? View.GONE : View.VISIBLE);
- }
- if (tvBaseTabReturn != null) {
- tvBaseTabReturn.setVisibility(isReturnButtonHasName ? View.VISIBLE : View.GONE);
- tvBaseTabReturn.setText(StringUtil.getTrimedString(returnName));
- }
- }
- //返回按钮>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- //前进按钮<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- String forwardName = getForwardName();
- if (StringUtil.isNotEmpty(forwardName, true)) {
- tvBaseTabForward = addTopRightButton(newTopRightTextView(context, StringUtil.getTrimedString(forwardName)));
- }
-
- if (llBaseTabTopRightButtonContainer != null
- && topRightButtonList != null && topRightButtonList.size() > 0) {
-
- llBaseTabTopRightButtonContainer.removeAllViews();
- for (View btn : topRightButtonList) {
- llBaseTabTopRightButtonContainer.addView(btn);
- }
- }
- //前进按钮>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //tab<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- topTabView = new TopTabView(context, getResources());
- llBaseTabTabContainer.removeAllViews();
- llBaseTabTabContainer.addView(topTabView.createView(getLayoutInflater()));
- topTabView.setCurrentPosition(currentPosition);
- topTabView.bindView(getTabNames());
- //tab>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // fragmentActivity子界面初始化<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- fragments = new Fragment[getCount()];
- selectFragment(currentPosition);
-
- // fragmentActivity子界面初始化>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- }
-
- /**获取导航栏标题名
- * @return null - View.GONE; "" - <; "xxx" - "xxx"
- */
- @Override
- @Nullable
- public abstract String getTitleName();
-
- /**获取导航栏标题名
- * @return null - View.GONE; "" - <; "xxx" - "xxx"
- */
- @Override
- @Nullable
- public abstract String getReturnName();
-
- //top right button <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**获取导航栏标题名
- * @return null - View.GONE; "" - View.GONE; "xxx" - "xxx"
- */
- @Override
- @Nullable
- public abstract String getForwardName();
-
- @Nullable
- private List topRightButtonList = new ArrayList();
- /**添加右上方导航栏按钮
- * @warn 在initData前使用才有效
- * @param topRightButton 不会在这个类设置监听,需要自行设置
- */
- public V addTopRightButton(V topRightButton) {
- if (topRightButton != null) {
- topRightButtonList.add(topRightButton);
- }
- return topRightButton;
- }
- /**新建右上方导航栏按钮
- * @param context
- * @param drawable
- * @return
- */
- public ImageView newTopRightImageView(Context context, int drawable) {
- return newTopRightImageView(context, getResources().getDrawable(drawable));
- }
- /**新建右上方导航栏按钮
- * @param context
- * @param drawable
- * @return
- */
- @SuppressLint({ "NewApi", "InflateParams" })
- public ImageView newTopRightImageView(Context context, Drawable drawable) {
- ImageView topRightButton = (ImageView) LayoutInflater.from(context).inflate(R.layout.top_right_iv, null);
- topRightButton.setImageDrawable(drawable);
- return topRightButton;
- }
- /**新建右上方导航栏按钮
- * @param context
- * @param name
- * @return
- */
- @SuppressLint({ "NewApi", "InflateParams" })
- public TextView newTopRightTextView(Context context, String name) {
- TextView topRightButton = (TextView) LayoutInflater.from(context).inflate(R.layout.top_right_tv, null);
- topRightButton.setText(name);
- return topRightButton;
- }
-
- //top right button >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- /**获取标签名称数组
- * @return
- */
- protected abstract String[] getTabNames();
-
- /**获取新的Fragment
- * @param position
- * @return
- */
- protected abstract Fragment getFragment(int position);
-
-
- /**获取Tab(或Fragment)的数量
- * @return
- */
- public int getCount() {
- return topTabView == null ? 0 : topTabView.getCount();
- }
-
- /**获取当前Tab(或Fragment)的位置
- * @return
- */
- public int getCurrentPosition() {
- return currentPosition;
- }
-
- public TextView getCurrentTab() {
- return topTabView == null ? null : topTabView.getCurrentTab();
- };
-
- public Fragment getCurrentFragment() {
- return fragments[currentPosition];
- };
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
-
- if (ivBaseTabReturn != null) {
- ivBaseTabReturn.setOnClickListener(this);
- }
- if (tvBaseTabReturn != null) {
- tvBaseTabReturn.setOnClickListener(this);
- }
- if (tvBaseTabForward != null) {
- tvBaseTabForward.setOnClickListener(new OnClickListener() {//没有id
-
- @Override
- public void onClick(View v) {
- onForwardClick(v);
- }
- });
- }
-
- topTabView.setOnTabSelectedListener(this);
- }
-
- @Override
- public void onTabSelected(TextView tvTab, int position, int id) {
- selectFragment(position);
- }
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void onClick(View v) {
- if (v.getId() == R.id.ivBaseTabReturn || v.getId() == R.id.tvBaseTabReturn) {
- finish();
- }
- }
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- topTabView = null;
- fragments = null;
-
- ivBaseTabReturn = null;
- tvBaseTabReturn = null;
- llBaseTabTopRightButtonContainer = null;
- llBaseTabTabContainer = null;
-
- tvBaseTabTitle = null;
-
- currentPosition = 0;
- needReload = false;
-
- topRightButtonList = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseTabFragment.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseTabFragment.java
deleted file mode 100755
index 395397f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseTabFragment.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.ViewPresenter;
-import zuo.biao.library.ui.TopTabView;
-import zuo.biao.library.ui.TopTabView.OnTabSelectedListener;
-import zuo.biao.library.util.StringUtil;
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-/**基础带标签的Fragment
- * @author Lemon
- * @see #onCreateView
- * @see #setContentView
- * @use extends BaseTabFragment, 具体参考.DemoTabFragment
- * @must 在子类onCreateView中调用initView();initData();initEvent();
- */
-public abstract class BaseTabFragment extends BaseFragment implements ViewPresenter
-, OnClickListener, OnTabSelectedListener {
- private static final String TAG = "BaseTabFragment";
-
-
-
- /**
- * FragmentManager
- */
- protected FragmentManager fragmentManager = null;
- /**
- * @warn 如果在子类中super.initView();则view必须含有initView中初始化用到的id且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- * @param inflater
- * @param container
- * @param savedInstanceState
- * @return
- * @must 1.不要在子类重复这个类中onCreateView中的代码;
- * 2.在子类onCreateView中super.onCreateView(inflater, container, savedInstanceState);
- * initView();initData();initEvent(); return view;
- */
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- return onCreateView(inflater, container, savedInstanceState, 0);
- }
- /**
- * @param inflater
- * @param container
- * @param savedInstanceState
- * @param layoutResID fragment全局视图view的布局资源id。 <= 0 ? R.layout.base_tab_activity : layoutResID
- * @return
- * @must 1.不要在子类重复这个类中onCreateView中的代码;
- * 2.在子类onCreateView中super.onCreateView(inflater, container, savedInstanceState, layoutResID);
- * initView();initData();initEvent(); return view;
- */
- public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState
- , int layoutResID) {
- //类相关初始化,必须使用<<<<<<<<<<<<<<<<<<
- super.onCreateView(inflater, container, savedInstanceState);
- //调用这个类的setContentView而崩溃 super.setContentView(layoutResID <= 0 ? R.layout.base_tab_activity : layoutResID);
- view = inflater.inflate(layoutResID <= 0 ? R.layout.base_tab_activity : layoutResID, container, false);
- //类相关初始化,必须使用>>>>>>>>>>>>>>>>
-
- fragmentManager = context.getSupportFragmentManager();
-
- return view;
- }
-
-
- //防止子类中setContentView <<<<<<<<<<<<<<<<<<<<<<<<
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public void setContentView(int layoutResID) {
- setContentView(null);
- }
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public void setContentView(View view) {
- setContentView(null, null);
- }
- /**
- * @warn 不支持setContentView,传界面布局请使用onCreateView(Bundle savedInstanceState, int layoutResID)等方法
- */
- @Override
- public void setContentView(View view, LayoutParams params) {
- throw new UnsupportedOperationException(TAG + "不支持setContentView,传界面布局请使用onCreateView(" +
- "LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, int layoutResID)等方法");
- }
- //防止子类中setContentView >>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- @Nullable
- private TextView tvBaseTabTitle;
-
- @Nullable
- private View ivBaseTabReturn;
- @Nullable
- private TextView tvBaseTabReturn;
-
- @Nullable
- private ViewGroup llBaseTabTopRightButtonContainer;
-
- private ViewGroup llBaseTabTabContainer;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id(非@Nullable标记)且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
-
- tvBaseTabTitle = findView(R.id.tvBaseTabTitle);
-
- ivBaseTabReturn = findView(R.id.ivBaseTabReturn);
- tvBaseTabReturn = findView(R.id.tvBaseTabReturn);
-
- llBaseTabTopRightButtonContainer = findView(R.id.llBaseTabTopRightButtonContainer);
-
- llBaseTabTabContainer = findView(R.id.llBaseTabTabContainer);
-
- }
-
- /**
- * == true >> 每次点击相应tab都加载,调用getFragment方法重新对点击的tab对应的fragment赋值。
- * 如果不希望重载,可以setOnTabSelectedListener,然后在onTabSelected内重写点击tab事件。
- */
- protected boolean needReload = false;
- /**
- * 当前显示的tab所在位置,对应fragment所在位置
- */
- protected int currentPosition = 0;
-
- /**选择下一个tab和fragment
- */
- public void selectNext() {
- select((getCurrentPosition() + 1) % getCount());
- }
- /**选择tab和fragment
- * @param position
- */
- public void select(int position) {
- topTabView.select(position);
- }
-
- /**选择并显示fragment
- * @param position
- */
- public void selectFragment(int position) {
- if (currentPosition == position) {
- if (needReload) {
- if (fragments[position] != null && fragments[position].isAdded()) {
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.remove(fragments[position]).commit();
- fragments[position] = null;
- }
- } else {
- if (fragments[position] != null && fragments[position].isVisible()) {
- Log.w(TAG, "selectFragment currentPosition == position" +
- " >> fragments[position] != null && fragments[position].isVisible()" +
- " >> return; ");
- return;
- }
- }
- }
-
- if (fragments[position] == null) {
- fragments[position] = getFragment(position);
- }
-
- //全局的fragmentTransaction因为already committed 崩溃
- FragmentTransaction ft = fragmentManager.beginTransaction();
- ft.hide(fragments[currentPosition]);
- if (fragments[position].isAdded() == false) {
- ft.add(R.id.flBaseTabFragmentContainer, fragments[position]);
- }
- ft.show(fragments[position]).commit();
-
- this.currentPosition = position;
- }
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- private String topReturnButtonName;
-
- protected TopTabView topTabView;
- private Fragment[] fragments;
- @Override
- public void initData() {// 必须调用
-
- if (tvBaseTabTitle != null) {
- tvBaseTabTitle.setVisibility(StringUtil.isNotEmpty(getTitleName(), true) ? View.VISIBLE : View.GONE);
- tvBaseTabTitle.setText(StringUtil.getTrimedString(getTitleName()));
- }
-
- topReturnButtonName = getReturnName();
-
- if (topReturnButtonName == null) {
- if (ivBaseTabReturn != null) {
- ivBaseTabReturn.setVisibility(View.GONE);
- }
- if (tvBaseTabReturn != null) {
- tvBaseTabReturn.setVisibility(View.GONE);
- }
- } else {
- boolean isReturnButtonHasName = StringUtil.isNotEmpty(topReturnButtonName, true);
- if (ivBaseTabReturn != null) {
- ivBaseTabReturn.setVisibility(isReturnButtonHasName ? View.GONE : View.VISIBLE);
- }
- if (tvBaseTabReturn != null) {
- tvBaseTabReturn.setVisibility(isReturnButtonHasName ? View.VISIBLE : View.GONE);
- tvBaseTabReturn.setText(StringUtil.getTrimedString(topReturnButtonName));
- }
- }
-
- if (llBaseTabTopRightButtonContainer != null
- && topRightButtonList != null && topRightButtonList.size() > 0) {
-
- llBaseTabTopRightButtonContainer.removeAllViews();
- for (View btn : topRightButtonList) {
- llBaseTabTopRightButtonContainer.addView(btn);
- }
- }
-
- topTabView = new TopTabView(context, getResources());
- llBaseTabTabContainer.removeAllViews();
- llBaseTabTabContainer.addView(topTabView.createView(context.getLayoutInflater()));
- topTabView.setCurrentPosition(currentPosition);
- topTabView.bindView(getTabNames());
-
-
- // fragmentActivity子界面初始化<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- fragments = new Fragment[getCount()];
- selectFragment(currentPosition);
-
- // fragmentActivity子界面初始化>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- }
-
-
-
- //top right button <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- @Nullable
- public final String getForwardName() {
- return null;
- }
-
- @Nullable
- private List topRightButtonList = new ArrayList();
- /**添加右上方导航栏按钮
- * @warn 在initData前使用才有效
- * @param topRightButton 不会在这个类设置监听,需要自行设置
- */
- public V addTopRightButton(V topRightButton) {
- if (topRightButton != null) {
- topRightButtonList.add(topRightButton);
- }
- return topRightButton;
- }
- /**新建右上方导航栏按钮
- * @param context
- * @param drawable
- * @return
- */
- public ImageView newTopRightImageView(Context context, int drawable) {
- return newTopRightImageView(context, getResources().getDrawable(drawable));
- }
- /**新建右上方导航栏按钮
- * @param context
- * @param drawable
- * @return
- */
- @SuppressLint({ "NewApi", "InflateParams" })
- public ImageView newTopRightImageView(Context context, Drawable drawable) {
- ImageView topRightButton = (ImageView) LayoutInflater.from(context).inflate(R.layout.top_right_iv, null);
- topRightButton.setImageDrawable(drawable);
- return topRightButton;
- }
- /**新建右上方导航栏按钮
- * @param context
- * @param name
- * @return
- */
- @SuppressLint({ "NewApi", "InflateParams" })
- public TextView newTopRightTextView(Context context, String name) {
- TextView topRightButton = (TextView) LayoutInflater.from(context).inflate(R.layout.top_right_tv, null);
- topRightButton.setText(name);
- return topRightButton;
- }
-
- //top right button >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- /**获取标签名称数组
- * @return
- */
- protected abstract String[] getTabNames();
-
- /**获取新的Fragment
- * @param position
- * @return
- */
- protected abstract Fragment getFragment(int position);
-
-
- /**获取Tab(或Fragment)的数量
- * @return
- */
- public int getCount() {
- return topTabView == null ? 0 : topTabView.getCount();
- }
-
- /**获取当前Tab(或Fragment)的位置
- * @return
- */
- public int getCurrentPosition() {
- return currentPosition;
- }
-
- public TextView getCurrentTab() {
- return topTabView == null ? null : topTabView.getCurrentTab();
- };
-
- public Fragment getCurrentFragment() {
- return fragments[currentPosition];
- };
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
-
- if (ivBaseTabReturn != null) {
- ivBaseTabReturn.setOnClickListener(this);
- }
- if (tvBaseTabReturn != null) {
- tvBaseTabReturn.setOnClickListener(this);
- }
-
- topTabView.setOnTabSelectedListener(this);
- }
-
- @Override
- public void onTabSelected(TextView tvTab, int position, int id) {
- selectFragment(position);
- }
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void onClick(View v) {
- if (v.getId() == R.id.ivBaseTabReturn || v.getId() == R.id.tvBaseTabReturn) {
- context.finish();
- }
- }
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- topTabView = null;
- fragments = null;
-
- ivBaseTabReturn = null;
- tvBaseTabReturn = null;
- llBaseTabTopRightButtonContainer = null;
- llBaseTabTabContainer = null;
-
- tvBaseTabTitle = null;
- topReturnButtonName = null;
-
- currentPosition = 0;
- needReload = false;
-
- topRightButtonList = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseView.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseView.java
deleted file mode 100755
index 1724eca..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseView.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import zuo.biao.library.util.CommonUtil;
-import zuo.biao.library.util.Log;
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
-import android.view.View.OnTouchListener;
-
-/**基础自定义View
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @see OnViewClickListener
- * @see #onDestroy
- * @use extends BaseView, 具体参考.DemoView
- */
-public abstract class BaseView {
- private static final String TAG = "BaseView";
-
- /**
- * 传入的Activity,可在子类直接使用
- */
- public Activity context;
- public Resources resources;
- public BaseView(Activity context, Resources resources) {
- this.context = context;
- this.resources = resources;
- }
-
- /**点击View的事件监听回调,主要是为了activity或fragment间接通过adapter接管baseView的点击事件
- * @param
- * @param
- * @must 子类重写setOnClickListener方法且view.setOnClickListener(listener)事件统一写在这个方法里面
- */
- public interface OnViewClickListener> {
- /**onClick(v)事件由这个方法接管
- * @param v
- * @param bv
- */
- void onViewClick(View v, BV bv);
- }
-
- /**数据改变回调接口
- * (Object) getData() - 改变的数据
- */
- public interface OnDataChangedListener {
- void onDataChanged();
- }
-
- public OnDataChangedListener onDataChangedListener;//数据改变回调监听回调的实例
- /**设置数据改变事件监听回调
- * @param listener
- */
- public void setOnDataChangedListener(OnDataChangedListener listener) {
- onDataChangedListener = listener;
- }
-
- public OnTouchListener onTouchListener;//接触View回调监听回调的实例
- /**设置接触View事件监听回调
- * @param listener
- */
- public void setOnTouchListener(OnTouchListener listener) {
- onTouchListener = listener;
- }
-
- public OnClickListener onClickListener;//点击View回调监听回调的实例
- /**设置点击View事件监听回调
- * @param listener
- */
- public void setOnClickListener(OnClickListener listener) {
- onClickListener = listener;
- if (onClickViewList != null) {
- for (View v : onClickViewList) {
- if (v != null) {
- v.setOnClickListener(listener);
- }
- }
- }
- }
-
- public OnLongClickListener onLongClickListener;//长按View回调监听回调的实例
- /**设置长按View事件监听回调
- * @param listener
- */
- public void setOnLongClickListener(OnLongClickListener listener) {
- onLongClickListener = listener;
- }
-
-
- /**
- * 子类整个视图,可在子类直接使用
- * @must createView方法内对其赋值且不能为null
- */
- protected View convertView = null;
-
- protected List onClickViewList;
- /**通过id查找并获取控件,使用时不需要强转
- * @param id
- * @return
- */
- @SuppressWarnings("unchecked")
- public V findView(int id) {
- return (V) convertView.findViewById(id);
- }
- /**通过id查找并获取控件,使用时不需要强转
- * @param id
- * @return
- */
- public V findViewById(int id) {
- return findView(id);
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param listener
- * @return
- */
- public V findView(int id, OnClickListener listener) {
- V v = findView(id);
- v.setOnClickListener(listener);
- if (onClickViewList == null) {
- onClickViewList = new ArrayList();
- }
- onClickViewList.add(v);
- return v;
- }
- /**通过id查找并获取控件,并setOnClickListener
- * @param id
- * @param listener
- * @return
- */
- public V findViewById(int id, OnClickListener listener) {
- return findView(id, listener);
- }
-
- /**
- * 视图类型,部分情况下需要根据viewType使用不同layout,对应Adapter的itemViewType
- */
- protected int viewType = 0;
- /**
- * data在列表中的位置
- * @must 只使用bindView(int position, T data)方法来设置position,保证position与data对应正确
- */
- protected int position = 0;
- /**获取data在列表中的位置
- */
- public int getPosition() {
- return position;
- }
-
- /**创建一个新的View
- * @param inflater - @NonNull,布局解释器
- * @param viewType - 视图类型,部分情况下需要根据viewType使用不同layout
- * @return
- */
- public View createView(LayoutInflater inflater, int position, int viewType) {
- this.position = position;
- this.viewType = viewType;
- return createView(inflater);
- }
- /**创建一个新的View
- * @param inflater - @NonNull,布局解释器
- * @return
- */
- public abstract View createView(LayoutInflater inflater);
-
- /**获取convertView的宽度
- * @warn 只能在createView后使用
- * @return
- */
- public int getWidth() {
- return convertView.getWidth();
- }
- /**获取convertView的高度
- * @warn 只能在createView后使用
- * @return
- */
- public int getHeight() {
- return convertView.getHeight();
- }
-
-
-
- protected T data = null;
- /**获取数据
- * @return
- */
- public T getData() {
- return data;
- }
-
-
- /**设置并显示内容,建议在子类bindView内this.data = data;
- * @warn 只能在createView后使用
- * @param data - 传入的数据
- * @param position - data在列表中的位置
- * @param viewType - 视图类型,部分情况下需要根据viewType使用不同layout
- */
- public void bindView(T data, int position, int viewType) {
- this.position = position;
- this.viewType = viewType;
- bindView(data);
- }
- /**设置并显示内容,建议在子类bindView内this.data = data;
- * @warn 只能在createView后使用
- * @param data - 传入的数据
- */
- public abstract void bindView(T data);
-
- /**获取可见性
- * @warn 只能在createView后使用
- * @return 可见性 (View.VISIBLE, View.GONE, View.INVISIBLE);
- */
- public int getVisibility() {
- return convertView.getVisibility();
- }
- /**设置可见性
- * @warn 只能在createView后使用
- * @param visibility - 可见性 (View.VISIBLE, View.GONE, View.INVISIBLE);
- */
- public void setVisibility(int visibility) {
- convertView.setVisibility(visibility);
- }
-
-
- /**设置背景
- * @warn 只能在createView后使用
- * @param resId
- */
- public void setBackground(int resId) {
- if (resId > 0 && convertView != null) {
- try {
- convertView.setBackgroundResource(resId);
- } catch (Exception e) {
- Log.e(TAG, "setBackground try { convertView.setBackgroundResource(resId);" +
- " \n >> } catch (Exception e) { \n" + e.getMessage());
- }
- }
- }
-
-
- // /**性能不好
- // * @param id
- // * @param s
- // */
- // public void setText(int id, String s) {
- // TextView tv = (TextView) findViewById(id);
- // tv.setText(s);
- // }
-
-
-
- //resources方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- public final Resources getResources() {
- if(resources == null) {
- resources = context.getResources();
- }
- return resources;
- }
-
- public String getString(int id) {
- return getResources().getString(id);
- }
- public int getColor(int id) {
- return getResources().getColor(id);
- }
- public Drawable getDrawable(int id) {
- return getResources().getDrawable(id);
- }
- public float getDimension(int id) {
- return getResources().getDimension(id);
- }
- //resources方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //show short toast 方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param stringResId
- */
- public void showShortToast(int stringResId) {
- CommonUtil.showShortToast(context, stringResId);
- }
- /**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
- * @param string
- */
- public void showShortToast(String string) {
- CommonUtil.showShortToast(context, string);
- }
- //show short toast 方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- //启动新Activity方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- /**打开新的Activity,向左滑入效果
- * @param intent
- */
- public void toActivity(final Intent intent) {
- CommonUtil.toActivity(context, intent);
- }
- /**打开新的Activity
- * @param intent
- * @param showAnimation
- */
- public void toActivity(final Intent intent, final boolean showAnimation) {
- CommonUtil.toActivity(context, intent, showAnimation);
- }
- /**打开新的Activity,向左滑入效果
- * @param intent
- * @param requestCode
- */
- public void toActivity(final Intent intent, final int requestCode) {
- CommonUtil.toActivity(context, intent, requestCode);
- }
- /**打开新的Activity
- * @param intent
- * @param requestCode
- * @param showAnimation
- */
- public void toActivity(final Intent intent, final int requestCode, final boolean showAnimation) {
- CommonUtil.toActivity(context, intent, requestCode, showAnimation);
- }
- //启动新Activity方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- /**销毁并回收内存,建议在对应的View占用大量内存时使用
- * @warn 只能在UI线程中调用
- */
- public void onDestroy() {
- if (convertView != null) {
- try {
- convertView.destroyDrawingCache();
- } catch (Exception e) {
- Log.w(TAG, "onDestroy try { convertView.destroyDrawingCache();" +
- " >> } catch (Exception e) {\n" + e.getMessage());
- }
- convertView = null;
- }
-
- onDataChangedListener = null;
- onTouchListener = null;
- onClickListener = null;
- onLongClickListener = null;
- onClickViewList = null;
-
- data = null;
- position = 0;
-
- context = null;
- }
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseViewAdapter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseViewAdapter.java
deleted file mode 100755
index a3068f4..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseViewAdapter.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import zuo.biao.library.base.BaseView.OnViewClickListener;
-import zuo.biao.library.interfaces.AdapterViewPresenter;
-import android.app.Activity;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-
-/**基础Adapter,使用自定义View
- *
适用于ListView,GridView等AbsListView的子类
- * @author Lemon
- * @param 数据模型(model/JavaBean)类
- * @param BaseView的子类
- * @see #setOnViewClickListener
- * @use extends BaseViewAdapter, 具体参考 .DemoAdapter3
- */
-public abstract class BaseViewAdapter> extends BaseAdapter
-implements AdapterViewPresenter {
- // private static final String TAG = "BaseViewAdapter";
-
-
- public OnViewClickListener onViewClickListener;
- /**为ItemView设置点击View的事件监听
- * @param listener
- * @see BaseView.OnViewClickListener
- */
- public void setOnViewClickListener(OnViewClickListener listener) {
- onViewClickListener = listener;
- }
-
-
- private AdapterViewPresenter presenter;
- /**在子类构造方法内使用可重写AdapterViewPresenter里的方法
- * @param presenter
- */
- protected final void setPresenter(AdapterViewPresenter presenter) {
- this.presenter = presenter;
- }
- /**
- * @return presenter == null ? this : presenter;
- */
- protected final AdapterViewPresenter getPresenter() {
- return presenter == null ? this : presenter;
- }
-
-
- public BaseViewAdapter(Activity context) {
- super(context);
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- @SuppressWarnings("unchecked")
- BV bv = convertView == null ? null : (BV) convertView.getTag();
- if (bv == null) {
- bv = getPresenter().createView(position, parent);
- convertView = bv.createView(inflater, position, getItemViewType(position));
- setOnClickListener(bv);//比在bindView里调用效率高。像是小众需求,应该去掉直接在子类针对性地实现?
-
- convertView.setTag(bv);
- }
-
- getPresenter().bindView(position, bv);
-
- return super.getView(position, convertView, parent);
- }
-
- /**bv的显示方法
- * @param position
- * @param bv
- */
- @Override
- public void bindView(int position, BV bv) {
- bv.bindView(getItem(position), position, getItemViewType(position));
- }
-
-
- /**设置对ItemView点击事件的处理
- * @param bv
- */
- protected void setOnClickListener(final BV bv) {
- if (onViewClickListener != null) {
- bv.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- onViewClickListener.onViewClick(v, bv);
- }
- });
- }
- }
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseViewBottomWindow.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseViewBottomWindow.java
deleted file mode 100755
index bdb9e16..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/BaseViewBottomWindow.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.base;
-
-import zuo.biao.library.R;
-import zuo.biao.library.interfaces.ViewPresenter;
-import zuo.biao.library.util.StringUtil;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-/**基础带标签的FragmentActivity
- * @author Lemon
- * @see #onCreate
- * @see #setContentView
- * @use extends BaseViewBottomWindow, 具体参考.DemoTabActivity
- * @must 在子类onCreate中调用initView();initData();initEvent();
- */
-public abstract class BaseViewBottomWindow> extends BaseBottomWindow
-implements ViewPresenter {
- // private static final String TAG = "BaseViewBottomWindow";
-
-
- /**
- * @param savedInstanceState
- * @return
- * @must 1.不要在子类重复这个类中onCreate中的代码;
- * 2.在子类onCreate中super.onCreate(savedInstanceState);
- * initView();initData();initEvent();
- */
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- onCreate(savedInstanceState, 0);
- }
- /**
- * @param savedInstanceState
- * @param layoutResID activity全局视图view的布局资源id。 <= 0 ? R.layout.base_view_bottom_window : layoutResID
- * @return
- * @must 1.不要在子类重复这个类中onCreate中的代码;
- * 2.在子类onCreate中super.onCreate(savedInstanceState, layoutResID, listener);
- * initView();initData();initEvent();
- */
- protected final void onCreate(Bundle savedInstanceState, int layoutResID) {
- super.onCreate(savedInstanceState);
- super.setContentView(layoutResID <= 0 ? R.layout.base_view_bottom_window : layoutResID);
- }
-
- // //重写setContentView后这个方法一定会被调用,final有无都会导致崩溃,去掉throw Exception也会导致contentView为null而崩溃
- // //防止子类中setContentView <<<<<<<<<<<<<<<<<<<<<<<<
- // /**
- // * @warn 不支持setContentView,传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法
- // */
- // @Override
- // public final void setContentView(int layoutResID) {
- // setContentView(null);
- // }
- // /**
- // * @warn 不支持setContentView,传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法
- // */
- // @Override
- // public final void setContentView(View view) {
- // setContentView(null, null);
- // }
- // /**
- // * @warn 不支持setContentView,传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法
- // */
- // @Override
- // public final void setContentView(View view, LayoutParams params) {
- // throw new UnsupportedOperationException(TAG + "不支持setContentView" +
- // ",传界面布局请使用onCreate(Bundle savedInstanceState, int layoutResID)等方法");
- // }
- // //防止子类中setContentView >>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
-
- protected ViewGroup llBaseViewBottomWindowContainer;
-
- @Nullable
- protected TextView tvBaseViewBottomWindowReturn;
- @Nullable
- protected TextView tvBaseViewBottomWindowForward;
- /**
- * 如果在子类中调用(即super.initView());则view必须含有initView中初始化用到的id(非@Nullable标记)且id对应的View的类型全部相同;
- * 否则必须在子类initView中重写这个类中initView内的代码(所有id替换成可用id)
- */
- @Override
- public void initView() {// 必须调用
- super.initView();
- autoSetTitle();
-
- llBaseViewBottomWindowContainer = findView(R.id.llBaseViewBottomWindowContainer);
-
- tvBaseViewBottomWindowReturn = findView(R.id.tvBaseViewBottomWindowReturn);
- tvBaseViewBottomWindowForward = findView(R.id.tvBaseViewBottomWindowForward);
- }
-
-
- // UI显示区(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- protected T data;
- protected BV containerView;
- @Override
- public void initData() {// 必须调用
- super.initData();
-
- if (tvBaseTitle != null) {
- String title = getIntent().getStringExtra(INTENT_TITLE);
- if (StringUtil.isNotEmpty(title, true) == false) {
- title = getTitleName();
- }
- tvBaseTitle.setVisibility(StringUtil.isNotEmpty(title, true) ? View.VISIBLE : View.GONE);
- tvBaseTitle.setText(StringUtil.getTrimedString(title));
- }
-
- if (tvBaseViewBottomWindowReturn != null && StringUtil.isNotEmpty(getReturnName(), true)) {
- tvBaseViewBottomWindowReturn.setText(StringUtil.getCurrentString());
- }
- if (tvBaseViewBottomWindowForward != null && StringUtil.isNotEmpty(getForwardName(), true)) {
- tvBaseViewBottomWindowForward.setText(StringUtil.getCurrentString());
- }
-
-
- llBaseViewBottomWindowContainer.removeAllViews();
- if (containerView == null) {
- containerView = createView();
- llBaseViewBottomWindowContainer.addView(containerView.createView(inflater));
- }
- containerView.bindView(null);
- }
-
- /**
- * 创建新的内容View
- * @return
- */
- protected abstract BV createView();
-
- // Data数据区(存在数据获取或处理代码,但不存在事件监听代码)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
-
-
-
-
-
-
-
- // Event事件区(只要存在事件监听代码就是)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- @Override
- public void initEvent() {// 必须调用
- super.initEvent();
-
- }
-
- // 系统自带监听方法<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
- // 类相关监听<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
-
-
- @Override
- protected void onDestroy() {
- data = null;
- llBaseViewBottomWindowContainer.removeAllViews();
- if (containerView != null) {
- containerView.onDestroy();
- }
-
- super.onDestroy();
-
- llBaseViewBottomWindowContainer = null;
- containerView = null;
- }
-
- // 类相关监听>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
- // 系统自带监听方法>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
- // Event事件区(只要存在事件监听代码就是)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-
-
- // 内部类,尽量少用<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-
- // 内部类,尽量少用>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/package-info.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/package-info.java
deleted file mode 100755
index 0d88df6..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/base/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-/**
- * 基础类所在包
- */
-/**
- * @author Lemon
- * @use 通用使用方法:extends BaseXX
- */
-package zuo.biao.library.base;
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/ActivityPresenter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/ActivityPresenter.java
deleted file mode 100644
index ede8b87..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/ActivityPresenter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-import android.app.Activity;
-import android.view.View;
-
-/**Activity的逻辑接口
- * @author Lemon
- * @use implements ActivityPresenter
- * @warn 对象必须是Activity
- */
-public interface ActivityPresenter extends Presenter {
-
- /**获取Activity
- * @must 在非抽象Activity中 return this;
- */
- public Activity getActivity();//无public导致有时自动生成的getActivity方法会缺少public且对此报错
-
- /**返回按钮被点击
- * *Activity的返回按钮和底部弹窗的取消按钮几乎是必备,正好原生支持反射;而其它比如Fragment极少用到,也不支持反射
- * @param v
- */
- public void onReturnClick(View v);
-
- /**前进按钮被点击
- * *Activity常用导航栏右边按钮,而且底部弹窗BottomWindow的确定按钮是必备;而其它比如Fragment极少用到,也不支持反射
- * @param v
- */
- public void onForwardClick(View v);
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/AdapterCallBack.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/AdapterCallBack.java
deleted file mode 100644
index 4edce92..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/AdapterCallBack.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-import android.widget.BaseAdapter;
-
-/**Adapter使用回调
- * @author Lemon
- * @param adapter名称
- * @see #createAdapter
- * @see #refreshAdapter
- * @use implements AdapterCallBack,具体参考.DemoListActivity和.DemoListFragment
- */
-public interface AdapterCallBack {
-
- /**创建一个Adapter
- * @return new A();
- */
- A createAdapter();
-
- /**
- * BaseAdapter#notifyDataSetChanged()有时无效,有时因列表更新不及时而崩溃,所以需要在自定义adapter内自定义一个刷新方法。
- * 为什么不直接让自定义Adapter implement OnRefreshListener,从而直接 onRefreshListener.onRefresh(List list) ?
- * 因为这样的话会不兼容部分 Android SDK 或 第三方库的Adapter
- */
- void refreshAdapter();
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/AdapterViewPresenter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/AdapterViewPresenter.java
deleted file mode 100644
index 7ef8325..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/AdapterViewPresenter.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package zuo.biao.library.interfaces;
-
-import android.view.ViewGroup;
-
-public interface AdapterViewPresenter {
-
- /**生成新的BV
- * @param position
- * @param parent
- * @return
- */
- public abstract V createView(int position, ViewGroup parent);
-
- /**设置BV显示
- * @param position
- * @param bv
- * @return
- */
- public abstract void bindView(int position, V bv);
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/CacheCallBack.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/CacheCallBack.java
deleted file mode 100644
index d227577..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/CacheCallBack.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**缓存回调
- * @author Lemon
- * @param
- * @use 见 .DemoListActivity 和 .UserListFragment
- */
-public interface CacheCallBack {
- /**
- * 获取缓存的类,通常是数据模型(model/JavaBean)类
- * @warn Entry这种带类型(这里是K和V)的类不能作为返回值,应该用其它不带类型的类(比如.User)替换
- * @return null-不缓存
- */
- Class getCacheClass();
-
- /**
- * 获取缓存的分组
- * @return 含非空字符的String ?缓存至对应class的group中 : 至缓存至对应class中
- */
- String getCacheGroup();
-
- /**
- * 获取缓存单个数据的id
- * @param data
- * @return data == null ? null : "" + data.getId(); //不用long是因为某些数据(例如订单)的id超出long的最大值
- */
- String getCacheId(T data);
-
- /**
- * 获取缓存每页数量
- * @return > 0 ?缓存 : 不缓存
- */
- int getCacheCount();
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/FragmentPresenter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/FragmentPresenter.java
deleted file mode 100644
index d1b9bf9..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/FragmentPresenter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-import android.app.Activity;
-
-/**Fragment的逻辑接口
- * @author Lemon
- * @use implements FragmentPresenter
- * @warn 对象必须是Fragment
- */
-public interface FragmentPresenter extends Presenter {
-
- /**
- * 该Fragment在Activity添加的所有Fragment中的位置
- */
- static final String ARGUMENT_POSITION = "ARGUMENT_POSITION";
- static final String ARGUMENT_ID = "ARGUMENT_ID";
- static final String ARGUMENT_USER_ID = "ARGUMENT_USER_ID";
-
- static final int RESULT_OK = Activity.RESULT_OK;
- static final int RESULT_CANCELED = Activity.RESULT_CANCELED;
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnAddListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnAddListener.java
deleted file mode 100644
index 5e38878..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnAddListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**添加回调
- * @author Lemon
- * @param
- */
-public interface OnAddListener {
-
- void onAdd(T object);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnBottomDragListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnBottomDragListener.java
deleted file mode 100644
index 74ed32d..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnBottomDragListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**拖拽View底部的回调接口
- * @author Lemon
- * @use implements OnBottomDragListener
- */
-public interface OnBottomDragListener {
-
- /**
- * @param rightToLeft ?从右向左 : 从左向右
- */
- void onDragBottom(boolean rightToLeft);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnHttpResponseListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnHttpResponseListener.java
deleted file mode 100644
index 92cd686..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnHttpResponseListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**网络请求回调接口
- * @author Lemon
- */
-public interface OnHttpResponseListener {
- /**
- * @param requestCode 请求码,自定义,在发起请求的类中可以用requestCode来区分各个请求
- * @param resultJson 服务器返回的Json串
- * @param e 异常
- */
- void onHttpResponse(int requestCode, String resultJson, Exception e);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnProgressListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnProgressListener.java
deleted file mode 100644
index ff64c69..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnProgressListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**进度回调
- * @author Lemon
- * @param
- */
-public interface OnProgressListener {
-
- void onProgressUpdate(int progress);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnReachViewBorderListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnReachViewBorderListener.java
deleted file mode 100755
index e272118..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnReachViewBorderListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-import android.view.View;
-
-/**到达(接触到)View的某个边界的监听回调
- * 一般用于一个(ViewGroup)parent内的(View)child接触到parent的事件监听
- * @author Lemon
- * @use implements OnReachViewBorderListener
- */
-public interface OnReachViewBorderListener {
- static final int TYPE_TOP = 0;
- static final int TYPE_BOTTOM = 1;
- static final int TYPE_LEFT = 2;
- static final int TYPE_RIGHT = 3;
-
- /**到达(接触到)v的某个边界(type)
- * @param type 边界类型
- * @param v 目标View,一般为ViewGroup(ListView,GridView等)
- */
- void onReach(int type, View v);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnRemoveListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnRemoveListener.java
deleted file mode 100644
index 843f2a2..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnRemoveListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**移除回调
- * @author Lemon
- * @param
- */
-public interface OnRemoveListener {
-
- void onRemove(T object);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnResultListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnResultListener.java
deleted file mode 100644
index 8aec70b..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnResultListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**结果回调
- * @author Lemon
- * @param
- */
-public interface OnResultListener {
-
- void onResult(T result);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnStopLoadListener.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnStopLoadListener.java
deleted file mode 100644
index fd89684..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/OnStopLoadListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**停止加载监听回调
- * @author Lemon
- * @use implements OnStopLoadListener
- */
-public interface OnStopLoadListener {
- /**
- * 停止刷新
- */
- void onStopRefresh();
- /**
- * 停止加载更多
- * @param isHaveMore 还有未加载的数据
- */
- void onStopLoadMore(boolean isHaveMore);
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/Presenter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/Presenter.java
deleted file mode 100644
index 5b1f41f..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/Presenter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-/**Activity和Fragment的公共逻辑接口
- * @author Lemon
- * @use Activity或Fragment implements Presenter
- */
-public interface Presenter {
-
- static final String INTENT_TITLE = "INTENT_TITLE";
- static final String INTENT_ID = "INTENT_ID";
- static final String INTENT_TYPE = "INTENT_TYPE";
- static final String INTENT_PHONE = "INTENT_PHONE";
- static final String INTENT_PASSWORD = "INTENT_PASSWORD";
- static final String INTENT_VERIFY = "INTENT_VERIFY";
- static final String INTENT_USER_ID = "INTENT_USER_ID";
- static final String RESULT_DATA = "RESULT_DATA";
- static final String ACTION_EXIT_APP = "ACTION_EXIT_APP";
-
- /**
- * UI显示方法(操作UI,但不存在数据获取或处理代码,也不存在事件监听代码)
- * @must Activity-在子类onCreate方法内初始化View(setContentView)后调用;Fragment-在子类onCreateView方法内初始化View后调用
- */
- void initView();
- /**
- * Data数据方法(存在数据获取或处理代码,但不存在事件监听代码)
- * @must Activity-在子类onCreate方法内初始化View(setContentView)后调用;Fragment-在子类onCreateView方法内初始化View后调用
- */
- void initData();
- /**
- * Event事件方法(只要存在事件监听代码就是)
- * @must Activity-在子类onCreate方法内初始化View(setContentView)后调用;Fragment-在子类onCreateView方法内初始化View后调用
- */
- void initEvent();
-
-
- /**
- * 是否存活(已启动且未被销毁)
- */
- boolean isAlive();
- /**
- * 是否在运行
- */
- boolean isRunning();
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/ViewPresenter.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/ViewPresenter.java
deleted file mode 100644
index 3e59e63..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/ViewPresenter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.interfaces;
-
-import android.support.annotation.Nullable;
-
-/**View的逻辑接口
- * @author Lemon
- * @use implements ViewPresenter
- */
-public interface ViewPresenter {
-
- /**获取导航栏标题名
- * @return null - View.GONE; "" - View.GONE; "xxx" - "xxx"
- */
- @Nullable
- public String getTitleName();
-
- /**获取导航栏返回按钮名
- * @return null - default; "" - default; "xxx" - "xxx"
- */
- @Nullable
- public String getReturnName();
-
- /**获取导航栏前进按钮名
- * @return null - default; "" - default; "xxx" - "xxx"
- */
- @Nullable
- public String getForwardName();
-
-}
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/package-info.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/package-info.java
deleted file mode 100755
index d08b02a..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/interfaces/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-/**
- * 回调接口类所在包
- */
-/**
- * @author Lemon
- * @use 通用使用方法:implements XXInterface
- */
-package zuo.biao.library.interfaces;
\ No newline at end of file
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/manager/Cache.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/manager/Cache.java
deleted file mode 100755
index 9810121..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/manager/Cache.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.manager;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import zuo.biao.library.util.JSON;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.StringUtil;
-import android.content.Context;
-import android.content.SharedPreferences;
-
-/**磁盘缓存类
- * @author Lemon
- * @param 缓存的数据类
- * @use new Cache(context, clazz, path).xxxMethod(...);具体参考.CacheManager
- */
-public class Cache {
- public static final String TAG = "Cache";
-
- private Class clazz;
- private SharedPreferences sp;
- public Cache(Class clazz, Context context, String name) {
- this(clazz, context.getSharedPreferences(name, Context.MODE_PRIVATE));
- }
- public Cache(Class clazz, SharedPreferences sp) {
- this.clazz = clazz;
- this.sp = sp;
- }
-
-
-
- /**获取列表大小
- * @return
- */
- public int getSize() {
- Map map = sp.getAll();
- return map == null ? 0 : map.size();
- }
-
-
- /**保存
- * @param map
- */
- public void saveList(Map map) {
- if (map == null) {
- Log.e(TAG, "saveList map == null >> return;");
- return;
- }
- Set keySet = map.keySet();
- if (keySet != null) {
- for (String id: keySet) {
- save(id, map.get(id));
- }
- }
- }
-
- /**保存
- * @param key
- * @param value
- */
- public void save(String key, T value) {
- if (StringUtil.isNotEmpty(key, true) == false || value == null) {
- Log.e(TAG, "save StringUtil.isNotEmpty(key, true) == false || value == null >> return;");
- return;
- }
- key = StringUtil.getTrimedString(key);
-
- sp.edit().remove(key).putString(key, JSON.toJSONString(value)).commit();
- }
-
- /**判断是否已存
- * @param key
- * @return
- */
- public boolean isContain(String key) {
- if (StringUtil.isNotEmpty(key, true) == false) {
- Log.e(TAG, "isContain StringUtil.isNotEmpty(key, true) == false >> return false;");
- return false;
- }
-
- return sp.contains(StringUtil.getTrimedString(key));
- }
-
- /**获取
- * @param key
- * @return
- */
- public T get(String key) {
- if (StringUtil.isNotEmpty(key, true) == false) {
- Log.e(TAG, "get (sp == null" +
- " || StringUtil.isNotEmpty(key, true) == false >> return null; ");
- return null;
- }
-
- return JSON.parseObject(sp.getString(StringUtil.getTrimedString(key), null), clazz);
- }
-
-
- /**ROOT
- * 获取列表
- * @return
- */
- @SuppressWarnings("unchecked")
- public Map getMap() {
- try {
- return (Map) sp.getAll();
- } catch (Exception e) {
- Log.e(TAG, "getMap try { return (Map) sp.getAll();" +
- "}catch(Exception e) {\n " + e.getMessage());
- }
- return null;
- }
-
- /**ROOT
- * 获取列表
- * @return
- */
- public Set getKeySet() {
- Map map = getMap();
- return map == null ? null : map.keySet();
- }
-
- /**ROOT
- * 获取列表
- * @param start < 0 ? all : [start, end]
- * @param end
- * @return
- */
- public List getValueList(int start, int end) {
- List list = getAllValueList();
- return start < 0 || start > end || list == null || end >= list.size() ? list : list.subList(start, end);
- }
- /**ROOT
- * 获取列表,顺序由keyList指定
- * @param keyList
- * @return
- */
- public List getValueList(List keyList) {
- if (keyList != null) {
- List list = new ArrayList();
- T data;
- for (String key : keyList) {
- data = get(key);
- if (data != null) {
- list.add(data);
- }
- }
- return list;
- }
- return null;
- }
- /**ROOT
- * 获取列表
- * @return
- */
- public List getAllValueList() {
- Map map = getMap();
- if (map != null) {
- List list = new ArrayList();
- T data;
- for (String value : map.values()) {
- data = JSON.parseObject(value, clazz);
- if (data != null) {
- list.add(data);
- }
- }
- return list;
- }
- return null;
- }
-
- /**删除
- * @param key
- */
- public void remove(String key) {
- if (StringUtil.isNotEmpty(key, true) == false) {
- Log.e(TAG, "deleteGroup context == null " +
- " || StringUtil.isNotEmpty(groupName, true) == fal >> return;");
- return;
- }
-
- sp.edit().remove(StringUtil.getTrimedString(key)).commit();
- }
-
-
-}
diff --git a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/manager/CacheManager.java b/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/manager/CacheManager.java
deleted file mode 100755
index bedbdd3..0000000
--- a/ZBLibrary(ADT)/ZBLibrary/src/zuo/biao/library/manager/CacheManager.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.*/
-
-package zuo.biao.library.manager;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import zuo.biao.library.base.BaseApplication;
-import zuo.biao.library.util.DataKeeper;
-import zuo.biao.library.util.JSON;
-import zuo.biao.library.util.Log;
-import zuo.biao.library.util.StringUtil;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-
-/**磁盘缓存管理类
- * @author Lemon
- * @use CacheManager.getInstance().xxxMethod(...);具体参考.BaseListActivity
- */
-public class CacheManager {
- private static final String TAG = "CacheManager";
-
- public static final String CACHE_PATH = DataKeeper.ROOT_SHARE_PREFS_ + "CACHE_PATH";
-
- private Context context;
- private CacheManager(Context context) {
- this.context = context;
- }
-
- private static CacheManager instance;
- public static CacheManager getInstance() {
- if (instance == null) {
- synchronized (CacheManager.class) {
- if (instance == null) {
- instance = new CacheManager(BaseApplication.getInstance());
- }
- }
- }
- return instance;
- }
-
-
- /**
- * @param clazz
- * @return
- */
- public String getClassPath(Class clazz) {
- return clazz == null ? null : CACHE_PATH + clazz.getName();
- }
- /**
- * @param clazz
- * @return
- */
- public String getListPath(Class clazz) {
- String classPath = getClassPath(clazz);
- return StringUtil.isNotEmpty(classPath, true) ? classPath + KEY_LIST : null;
- }
- /**
- * @param clazz
- * @param group
- * @return
- */
- public String getGroupPath(Class clazz) {
- String classPath = getClassPath(clazz);
- return StringUtil.isNotEmpty(classPath, true) == false ? null : classPath + KEY_GROUP;
- }
-
- private SharedPreferences getSharedPreferences(String path) {
- return StringUtil.isNotEmpty(path, true) == false
- ? null : context.getSharedPreferences(StringUtil.getTrimedString(path), Context.MODE_PRIVATE);
- }
-
-
- /**
- * 数据列表
- */
- public static final String KEY_LIST = "LIST";
-
- /**
- * 数据分组,自定义
- */
- public static final String KEY_GROUP = "GROUP";
- /**
- * 分组中列表每页最大数量
- */
- public static final int MAX_PAGE_SIZE = 10;
-
- /**获取列表
- * @param clazz
- * @return
- */
- public List getAllList(Class clazz) {
- return getList(clazz, -1, 0);
- }
- /**获取列表
- * @param clazz
- * @param start
- * @return
- */
- public List getList(Class