());// 那么重新创建一个list放到复用池中
- if (cell.getReuseIdentifier() != null)// 存在复用标识
- reuseCellPool.get(cell.getReuseIdentifier()).add(frontCellPool.get(pathInfo));// 把cell放到复用池中
- }
- frontCellPool.remove(pathInfo);// 从控件存储池中移除
- }
- }
-
- /**
- * 关闭当前已经侧滑的cell侧滑
- */
- public void closeCurrentSlide() {
- if (slidedCell != null)
- cellScrollContainerPool.get(slidedCell).smoothScrollTo(0, 0);
- }
-
- /**
- * 通过路径信息字符串得到LKIndexPath
- *
- * @param pathInfo 路径信息字符串
- * @return 路径信息字符串对应的IndexPath
- */
- public LKIndexPath getIndexPathWithPathInfoString(String pathInfo) {
- String[] pathItems = pathInfo.split("_");
- if (pathItems[0].equals("c")) {// 是cell
- return LKIndexPath.make(Integer.parseInt(pathItems[1]), Integer.parseInt(pathItems[2]));
- }
- return null;// 不是cell
- }
-
- /**
- * 根据LKIndexPath计算PathInfo字符串
- *
- * @param indexPath indexPath路径信息
- * @return PathInfo字符串
- */
- public String getCellPathInfoStringWithIndexPath(LKIndexPath indexPath) {
- return String.format("c_%d_%d", indexPath.section, indexPath.row);
- }
-
- /**
- * 获取当前屏幕正在显示的所有项目
- */
- public void getScreenRangeItems() {
- Integer startLocation = spaceOfLocation(0);
- Integer endLocation = spaceOfLocation(getHeight());
- for (int i = startLocation; i <= endLocation; i++) {
- initLineWithRecorderItemIndex(i);
- }
- }
-
- /**
- * 初始化行通过pathInfo字符串
- *
- * @param recorderItemIndex 记录索引
- */
- public void initLineWithRecorderItemIndex(Integer recorderItemIndex) {
- String pathInfo = typeRecorder.get(recorderItemIndex);
- String[] items = pathInfo.split("_");
- switch (items[0]) {
- case "h":
-
- break;
- case "f":
-
- break;
- default:
- LKIndexPath indexPath = getIndexPathWithPathInfoString(pathInfo);
- initCell(indexPath,
- delegate.heightForRowAtIndexPath(this, indexPath),
- startLocationRecorder.get(recorderItemIndex));// 初始化cell行控件
- }
- }
-
-
- //// 复用机制方法 - 开始
-
- /**
- * 根据复用标识从复用池中取cell
- *
- * @param identifier 复用标识字符串
- * @return 复用池中存储的对应cell
- */
- public LKUITableViewCell dequeueReusableCellWithIdentifier(String identifier) {
- System.out.println(" ---> time from : " + System.currentTimeMillis());
- if (reuseCellPool.containsKey(identifier) &&
- reuseCellPool.get(identifier) != null &&
- reuseCellPool.get(identifier).size() > 0) {
- LKUITableViewCell cell = reuseCellPool.get(identifier).get(0);
- reuseCellPool.remove(identifier).remove(0);// 从复用池中移除
- System.out.println(" ---> time to : " + System.currentTimeMillis());
- return cell;
- }
- System.out.println(" ERRRR: " + identifier);
- System.out.println(" ---> time to : " + System.currentTimeMillis());
- return null;
- }
-
- //// 复用机制方法 - 结束
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/baseView/LKUITableViewCell.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/baseView/LKUITableViewCell.java
deleted file mode 100644
index f4219f8..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/baseView/LKUITableViewCell.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package net.lemonsoft.lemonkit.ui.view.baseView;
-
-import android.content.Context;
-import android.graphics.Color;
-import android.view.View;
-import android.widget.RelativeLayout;
-
-/**
- * LKUITableViewCell的行元素
- * Created by LiuRi on 16/8/3.
- */
-public class LKUITableViewCell extends RelativeLayout {
-
- /**
- * 服用标识
- */
- private String reuseIdentifier = null;
-
- public LKUITableViewCell(Context context) {
- super(context);
- initCell();
-
- }
-
- public LKUITableViewCell(Context context, String reuseIdentifier) {
- super(context);
- this.reuseIdentifier = reuseIdentifier;
- initCell();
- }
-
- public void initCell() {
- this.setBackgroundColor(Color.WHITE);
- }
-
- public String getReuseIdentifier() {
- return reuseIdentifier;
- }
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/baseView/LKUIView.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/baseView/LKUIView.java
deleted file mode 100644
index 864b989..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/baseView/LKUIView.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package net.lemonsoft.lemonkit.ui.view.baseView;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.drawable.shapes.RoundRectShape;
-import android.graphics.drawable.shapes.Shape;
-import android.util.AttributeSet;
-import android.view.View;
-
-/**
- * LKUIView,扩展View的属性
- * Created by LiuRi on 16/8/3.
- */
-public class LKUIView extends View {
-
- /**
- * 边框线颜色
- */
- private int borderColor = Color.TRANSPARENT;
- /**
- * 边框线的宽度
- */
- private int borderWidth = 0;
- /**
- * 控件边框圆角的半径
- */
- private int cornerRadius = 0;
-
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- System.out.println("ON DRAW LA!!!!");
- }
-
- public LKUIView(Context context) {
- super(context);
- }
-
- public LKUIView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public LKUIView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- // setters and getters
- public int getBorderColor() {
- return borderColor;
- }
-
- public void setBorderColor(int borderColor) {
- this.borderColor = borderColor;
- this.invalidate();
- }
-
- public int getBorderWidth() {
- return borderWidth;
- }
-
- public void setBorderWidth(int borderWidth) {
- this.borderWidth = borderWidth;
- this.invalidate();
- }
-
- public int getCornerRadius() {
- return cornerRadius;
- }
-
- public void setCornerRadius(int cornerRadius) {
- this.cornerRadius = cornerRadius;
- this.invalidate();
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/container/LKHorizontalScrollView.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/container/LKHorizontalScrollView.java
deleted file mode 100644
index a6de489..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/container/LKHorizontalScrollView.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package net.lemonsoft.lemonkit.ui.view.container;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.widget.HorizontalScrollView;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * 自定义水平滚动视图
- * Created by lemonsoft on 16-9-28.
- */
-public class LKHorizontalScrollView extends HorizontalScrollView {
-
- private ScrollListener onScrollListener;
-
- public LKHorizontalScrollView(Context context) {
- super(context);
- }
-
- public LKHorizontalScrollView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public LKHorizontalScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- @Override
- protected void onScrollChanged(int l, int t, int oldl, int oldt) {
- super.onScrollChanged(l, t, oldl, oldt);
- if (this.onScrollListener != null)
- onScrollListener.onScroll(l, t, oldl, oldt);
- }
-
- public void animateScrollTo(final int x, final int duration) {
- final Timer timer = new Timer("animateScroll");
- int interval = Math.abs(x - getScrollX()) / duration;
- if (x != getScrollX()) {
- final double sub = getScrollX() / (duration + 0.0);
- timer.schedule(new TimerTask() {
- @Override
- public void run() {
- if (getScrollX() == x)
- timer.cancel();
- scrollTo((int) (getScrollX() + sub), getScrollY());
- }
- }, 0, 1);
- }
- }
-
- @Override
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- return super.onKeyUp(keyCode, event);
- }
-
- public ScrollListener getOnScrollListener() {
- return onScrollListener;
- }
-
- public void setOnScrollListener(ScrollListener onScrollListener) {
- this.onScrollListener = onScrollListener;
- }
-
- public interface ScrollListener {
- void onScroll(int l, int t, int oldl, int oldt);
-
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/container/LKUIScrollView.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/container/LKUIScrollView.java
deleted file mode 100644
index 09e531a..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/container/LKUIScrollView.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package net.lemonsoft.lemonkit.ui.view.container;
-
-/**
- * Created by LiuRi on 16/8/3.
- */
-public class LKUIScrollView {
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/layout/LKRelativeLayout.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/layout/LKRelativeLayout.java
deleted file mode 100644
index fd91a22..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/view/layout/LKRelativeLayout.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package net.lemonsoft.lemonkit.ui.view.layout;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.widget.RelativeLayout;
-
-/**
- * Created by lemonsoft on 16-9-22.
- */
-
-public class LKRelativeLayout extends RelativeLayout {
-
- /**
- * 事件向父控件拦截属性
- */
- private boolean eventParentInterception = false;
- /**
- * 事件向子控件拦截属性
- */
- private boolean eventChildrenInterception = false;
-
- public LKRelativeLayout(Context context) {
- super(context);
- }
-
- public LKRelativeLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public LKRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- public boolean isEventParentInterception() {
- return eventParentInterception;
- }
-
- public void setEventParentInterception(boolean eventParentInterception) {
- this.eventParentInterception = eventParentInterception;
- }
-
- public boolean isEventChildrenInterception() {
- return eventChildrenInterception;
- }
-
- public void setEventChildrenInterception(boolean eventChildrenInterception) {
- this.eventChildrenInterception = eventChildrenInterception;
- }
-
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- return this.eventChildrenInterception;// 根据设置属性返回值
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- return this.eventParentInterception;// 根据设置属性返回值
- }
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUINavigationController.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUINavigationController.java
deleted file mode 100644
index 5aa003d..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUINavigationController.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package net.lemonsoft.lemonkit.ui.viewController;
-
-/**
- * Created by LiuRi on 16/8/3.
- */
-public class LKUINavigationController extends LKUIViewController {
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUITabBarController.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUITabBarController.java
deleted file mode 100644
index 874a3f7..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUITabBarController.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package net.lemonsoft.lemonkit.ui.viewController;
-
-/**
- * Created by LiuRi on 16/8/3.
- */
-public class LKUITabBarController extends LKUIViewController {
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUITableViewController.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUITableViewController.java
deleted file mode 100644
index 6f3a5e4..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUITableViewController.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package net.lemonsoft.lemonkit.ui.viewController;
-
-/**
- * Created by LiuRi on 16/8/3.
- */
-public class LKUITableViewController extends LKUIViewController{
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUIViewController.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUIViewController.java
deleted file mode 100644
index 03379f5..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/ui/viewController/LKUIViewController.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package net.lemonsoft.lemonkit.ui.viewController;
-
-import android.app.Fragment;
-
-import net.lemonsoft.lemonkit.ui.view.baseView.LKUIView;
-
-/**
- * Created by LiuRi on 16/8/3.
- */
-public class LKUIViewController extends Fragment {
-
- public LKUIView view;
-
- public void viewDidLoad(){
-
- }
-
- public void viewDidUnload(){
-
- }
-
- public void viewWillAppear(boolean animated){
-
- }
-
- public void viewDidAppear(boolean animated){
-
- }
-
- public void viewWillDisappear(boolean animated){
-
- }
-
- public void viewDidDisappear(boolean animated){
-
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ActivityUtil.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ActivityUtil.java
deleted file mode 100644
index 9e6e7d3..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ActivityUtil.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package net.lemonsoft.lemonkit.util;
-
-import android.app.Activity;
-import android.os.Build;
-import android.view.WindowManager;
-
-/**
- * Created by lemonsoft on 16-9-22.
- */
-
-public class ActivityUtil {
-
- public static boolean isTranslucentStatusBar(Activity activity){
- return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
- (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS &
- activity.getWindow().getAttributes().flags) ==
- WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ByteUtil.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ByteUtil.java
deleted file mode 100644
index c8fc321..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ByteUtil.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package net.lemonsoft.lemonkit.util;
-
-import android.graphics.Bitmap;
-
-import java.io.ByteArrayOutputStream;
-
-/**
- * Created by 1em0nsOft on 2016/9/18.
- */
-public class ByteUtil {
-
- public static byte[] bitmapToByteArray(Bitmap bitmap) {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
- bitmap.recycle();
- byte[] result = outputStream.toByteArray();
- try {
- outputStream.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ColorUtil.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ColorUtil.java
deleted file mode 100644
index cdd1537..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/ColorUtil.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.lemonsoft.lemonkit.util;
-
-import android.graphics.Color;
-
-/**
- * Created by lemonsoft on 16-10-23.
- */
-
-public class ColorUtil {
-
- /**
- * 根据颜色的比例来生成颜色
- *
- * @param alpha 透明度
- * @param red 红色的比例
- * @param green 绿色的比例
- * @param blue 蓝色的比例
- * @return 生成的颜色值
- */
- public static int argbWithProportion(double alpha, double red, double green, double blue) {
- return Color.argb((int) (alpha * 255), (int) (red * 255), (int) (green * 255), (int) (blue * 255));
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/EncodeUtil.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/EncodeUtil.java
deleted file mode 100644
index f419fa1..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/EncodeUtil.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package net.lemonsoft.lemonkit.util;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import javax.crypto.Mac;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
-import javax.xml.transform.TransformerException;
-
-/**
- * Created by 1em0nsOft on 2016/9/18.
- */
-public class EncodeUtil {
-
- /**
- * MAC算法可选以下多种算法
- *
- *
- * HmacMD5
- * HmacSHA1
- * HmacSHA256
- * HmacSHA384
- * HmacSHA512
- *
- */
- public static final String KEY_MAC = "HmacMD5";
-
- /**
- * HMAC加密
- *
- * @param data
- * @param key
- * @return
- * @throws Exception
- */
- public static byte[] encodeHmacMD5(byte[] data, String key) throws Exception {
-
- SecretKey secretKey = new SecretKeySpec(key.getBytes(), KEY_MAC);
- Mac mac = Mac.getInstance(secretKey.getAlgorithm());
- mac.init(secretKey);
-
- return mac.doFinal(data);
-
- }
-
- /*byte数组转换为HexString*/
- public static String byteArrayToHexString(byte[] b) {
- StringBuffer sb = new StringBuffer(b.length * 2);
- for (int i = 0; i < b.length; i++) {
- int v = b[i] & 0xff;
- if (v < 16) {
- sb.append('0');
- }
- sb.append(Integer.toHexString(v));
- }
- return sb.toString();
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/NetUtil.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/NetUtil.java
deleted file mode 100644
index 843ed6a..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/NetUtil.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package net.lemonsoft.lemonkit.util;
-
-import com.google.gson.Gson;
-import com.squareup.okhttp.Call;
-import com.squareup.okhttp.Callback;
-import com.squareup.okhttp.MediaType;
-import com.squareup.okhttp.MultipartBuilder;
-import com.squareup.okhttp.OkHttpClient;
-import com.squareup.okhttp.Request;
-import com.squareup.okhttp.RequestBody;
-import com.squareup.okhttp.Response;
-
-import net.lemonsoft.lemonkit.delegate.NetUtilResultDelegate;
-
-import org.json.JSONObject;
-
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * Created by 1em0nsOft on 2016/9/18.
- */
-public class NetUtil {
-
- private static final MediaType MEDIA_TYPE_URL_ENCODED = MediaType.parse("application/x-www-form-urlencoded; charset=utf-8");
-
- private static OkHttpClient client = new OkHttpClient();
-
- /**
- * 异步进行httpGet请求
- *
- * @param url 要请求的URL
- * @param delegate 请求的结果代理
- */
- public static void aGet(String url, final NetUtilResultDelegate delegate) {
- Request request = new Request.Builder().url(url).build();
- Call call = client.newCall(request);
- call.enqueue(new Callback() {
- @Override
- public void onFailure(Request request, IOException e) {
- delegate.onFailed(e);
- }
-
- @Override
- public void onResponse(Response response) throws IOException {
- delegate.onSuccess(response.body().string());
- }
- });
- }
-
- /**
- * 异步执行httpPost请求
- *
- * @param url 要请求的URL
- * @param params 要请求携带的参数
- * @param delegate 请求的结果代理
- */
- public static void aPost(String url, HashMap params, final NetUtilResultDelegate delegate) {
- try {
- StringBuilder paramsBuilder = new StringBuilder();
- for (String key : params.keySet()) {
- if (paramsBuilder.length() > 0) {
- paramsBuilder.append("&");
- }
- paramsBuilder.append(String.format("%s=%s", key, URLEncoder.encode(params.get(key), "UTF-8")));
- }
- RequestBody requestBody = RequestBody.create(MEDIA_TYPE_URL_ENCODED, paramsBuilder.toString());
- Request request = new Request.Builder().url(url).post(requestBody).build();
- final Call call = client.newCall(request);
- call.enqueue(new Callback() {
- @Override
- public void onFailure(Request request, IOException e) {
- delegate.onFailed(e);
- }
-
- @Override
- public void onResponse(Response response) throws IOException {
- delegate.onSuccess(response.body().string());
- }
- });
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * 异步进行httpPost请求表单
- *
- * @param url 要请求的url
- * @param params 要请求的普通参数
- * @param type 请求的类型键值对map
- * @param data 请求的数据键值对map
- * @param delegate 请求的代理
- */
- public static void aPost(String url, HashMap params, HashMap type,
- HashMap data, final NetUtilResultDelegate delegate) {
- try {
- MultipartBuilder builder = new MultipartBuilder();
- builder.type(MultipartBuilder.FORM);
- for (String key : params.keySet()) {
- builder.addFormDataPart(key, params.get(key));
- }
- for (String key : data.keySet()) {
- builder.addFormDataPart(key, key, RequestBody.create(MediaType.parse(type.get(key)), data.get(key)));
- }
- RequestBody body = builder.build();
- final Request request = new Request.Builder().url(url).post(body).build();
- Call call = client.newCall(request);
- call.enqueue(new Callback() {
- @Override
- public void onFailure(Request request, IOException e) {
- delegate.onFailed(e);
- }
-
- @Override
- public void onResponse(Response response) throws IOException {
- delegate.onSuccess(response.body().string());
- }
- });
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * 异步进行httpPost请求表单
- *
- * @param url 要请求的url
- * @param params 要请求的普通参数
- * @param type 请求的类型键值对map
- * @param data 请求的数据键值对map
- * @param delegate 请求的代理
- */
- public static void aPost(String url, HashMap params, String type,
- HashMap data, final NetUtilResultDelegate delegate) {
- HashMap types = new HashMap<>();
- for (String key : data.keySet()) {
- types.put(key, type);
- }
- aPost(url, params, types, data, delegate);
- }
-
- /**
- * 异步执行httpPost请求
- *
- * @param url 要请求的URL
- * @param delegate 请求的结果代理
- */
- public static void aPost(String url, final NetUtilResultDelegate delegate) {
- aPost(url, new HashMap(), delegate);
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/SizeUtil.java b/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/SizeUtil.java
deleted file mode 100644
index ab645c5..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/java/net/lemonsoft/lemonkit/util/SizeUtil.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package net.lemonsoft.lemonkit.util;
-
-import android.content.Context;
-import android.util.DisplayMetrics;
-import android.view.WindowManager;
-
-/**
- * 工具类 - 尺寸相关
- * Created by 1em0nsOft on 16/9/7.
- */
-public class SizeUtil {
-
- private static WindowManager manager;
- private static DisplayMetrics displayMetrics;
-
- private static void initManager(Context context) {
- if (manager == null)
- manager = (WindowManager) context.getSystemService(context.WINDOW_SERVICE);
- if (displayMetrics == null) {
- displayMetrics = new DisplayMetrics();
- manager.getDefaultDisplay().getMetrics(displayMetrics);
- }
- }
-
- /**
- * 获取屏幕的宽度
- *
- * @param context 上下文对象
- * @return 当前手机的屏幕宽度
- */
- public static Integer getScreenWidth(Context context) {
- initManager(context);
- return displayMetrics.widthPixels;
- }
-
- /**
- * 获取屏幕的高度
- *
- * @param context 上下文对象
- * @return 当前手机的屏幕高度
- */
- public static Integer getScreenHeight(Context context) {
- initManager(context);
- return displayMetrics.heightPixels;
- }
-
- /**
- * 获取当前手机的状态栏的高度
- *
- * @param context 上下文对象
- * @return 当前手机的状态栏的高度
- */
- public static Integer getStatusBarHeight(Context context) {
- Integer height = 0;
- Integer resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
- if (resourceId > 0)
- height = context.getResources().getDimensionPixelSize(resourceId);
- return height;
- }
-
- /**
- * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
- */
- public static int dipToPx(Context context, float dpValue) {
- final float scale = context.getResources().getDisplayMetrics().density;
- return (int) (dpValue * scale + 0.5f);
- }
-
- /**
- * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
- */
- public static int pxToDip(Context context, float pxValue) {
- final float scale = context.getResources().getDisplayMetrics().density;
- return (int) (pxValue / scale + 0.5f);
- }
-
-}
diff --git a/LemonKit4Android-old/lemonkit/src/main/res/values/strings.xml b/LemonKit4Android-old/lemonkit/src/main/res/values/strings.xml
deleted file mode 100644
index 4e3d2b4..0000000
--- a/LemonKit4Android-old/lemonkit/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- LemonKit
-
diff --git a/LemonKit4Android-old/lemonkit/src/test/java/net/lemonsoft/lemonkit/ExampleUnitTest.java b/LemonKit4Android-old/lemonkit/src/test/java/net/lemonsoft/lemonkit/ExampleUnitTest.java
deleted file mode 100644
index dbf652f..0000000
--- a/LemonKit4Android-old/lemonkit/src/test/java/net/lemonsoft/lemonkit/ExampleUnitTest.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package net.lemonsoft.lemonkit;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * To work on unit tests, switch the Test Artifact in the Build Variants view.
- */
-public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-}
\ No newline at end of file
diff --git a/LemonKit4Android-old/settings.gradle b/LemonKit4Android-old/settings.gradle
deleted file mode 100644
index 0841d44..0000000
--- a/LemonKit4Android-old/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':app', ':lemonkit'