(animator);
15 | }
16 |
17 | @Override
18 | public boolean isNativeAnimator() {
19 | return false;
20 | }
21 |
22 | @Override
23 | public Object get() {
24 | return mSupportFramework.get();
25 | }
26 |
27 | @Override
28 | public void start() {
29 | Animator a = mSupportFramework.get();
30 | if(a != null) {
31 | a.start();
32 | }
33 | }
34 |
35 | @Override
36 | public void setDuration(int duration) {
37 | Animator a = mSupportFramework.get();
38 | if(a != null) {
39 | a.setDuration(duration);
40 | }
41 | }
42 |
43 | @Override
44 | public void setInterpolator(Interpolator value) {
45 | Animator a = mSupportFramework.get();
46 | if(a != null) {
47 | a.setInterpolator(value);
48 | }
49 | }
50 |
51 | @Override
52 | public void addListener(final AnimatorListener listener) {
53 | Animator a = mSupportFramework.get();
54 | if(a == null) {
55 | return;
56 | }
57 |
58 | if(listener == null){
59 | a.addListener(null);
60 | return;
61 | }
62 |
63 | a.addListener(new Animator.AnimatorListener() {
64 | @Override
65 | public void onAnimationStart(Animator animation) {
66 | listener.onAnimationStart();
67 | }
68 |
69 | @Override
70 | public void onAnimationEnd(Animator animation) {
71 | listener.onAnimationEnd();
72 | }
73 |
74 | @Override
75 | public void onAnimationCancel(Animator animation) {
76 | listener.onAnimationCancel();
77 | }
78 |
79 | @Override
80 | public void onAnimationRepeat(Animator animation) {
81 | listener.onAnimationRepeat();
82 | }
83 | });
84 | }
85 |
86 | @Override
87 | public boolean isRunning() {
88 | Animator a = mSupportFramework.get();
89 | return a != null && a.isRunning();
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/libraries/PersistentSearch/src/io/codetail/widget/RevealFrameLayout.java:
--------------------------------------------------------------------------------
1 | package io.codetail.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Path;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.FrameLayout;
9 |
10 | import io.codetail.animation.RevealAnimator;
11 |
12 | public class RevealFrameLayout extends FrameLayout implements RevealAnimator{
13 |
14 | Path mRevealPath;
15 |
16 | boolean mClipOutlines;
17 |
18 | float mCenterX;
19 | float mCenterY;
20 | float mRadius;
21 |
22 | View mTarget;
23 |
24 | public RevealFrameLayout(Context context) {
25 | this(context, null);
26 | }
27 |
28 | public RevealFrameLayout(Context context, AttributeSet attrs) {
29 | this(context, attrs, 0);
30 | }
31 |
32 | public RevealFrameLayout(Context context, AttributeSet attrs, int defStyle) {
33 | super(context, attrs, defStyle);
34 | mRevealPath = new Path();
35 | }
36 |
37 | /**
38 | * Animation target
39 | *
40 | * @hide
41 | */
42 | @Override
43 | public void setTarget(View view){
44 | mTarget = view;
45 | }
46 |
47 | /**
48 | * Epicenter of animation circle reveal
49 | *
50 | * @hide
51 | */
52 | @Override
53 | public void setCenter(float centerX, float centerY){
54 | mCenterX = centerX;
55 | mCenterY = centerY;
56 | }
57 |
58 | /**
59 | * Flag that animation is enabled
60 | *
61 | * @hide
62 | */
63 | @Override
64 | public void setClipOutlines(boolean clip){
65 | mClipOutlines = clip;
66 | }
67 |
68 | /**
69 | * Circle radius size
70 | *
71 | * @hide
72 | */
73 | @Override
74 | public void setRevealRadius(float radius){
75 | mRadius = radius;
76 | invalidate();
77 | }
78 |
79 | /**
80 | * Circle radius size
81 | *
82 | * @hide
83 | */
84 | @Override
85 | public float getRevealRadius(){
86 | return mRadius;
87 | }
88 |
89 |
90 | @Override
91 | protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
92 | if(!mClipOutlines && child != mTarget)
93 | return super.drawChild(canvas, child, drawingTime);
94 |
95 | final int state = canvas.save();
96 |
97 | mRevealPath.reset();
98 | mRevealPath.addCircle(mCenterX, mCenterY, mRadius, Path.Direction.CW);
99 |
100 | canvas.clipPath(mRevealPath);
101 |
102 | boolean isInvalided = super.drawChild(canvas, child, drawingTime);
103 |
104 | canvas.restoreToCount(state);
105 |
106 | return isInvalided;
107 | }
108 |
109 | }
110 |
--------------------------------------------------------------------------------
/libraries/PersistentSearch/src/io/codetail/widget/RevealLinearLayout.java:
--------------------------------------------------------------------------------
1 | package io.codetail.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Path;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.LinearLayout;
9 |
10 | import io.codetail.animation.RevealAnimator;
11 |
12 | public class RevealLinearLayout extends LinearLayout implements RevealAnimator{
13 |
14 | Path mRevealPath;
15 |
16 | boolean mClipOutlines;
17 |
18 | float mCenterX;
19 | float mCenterY;
20 | float mRadius;
21 |
22 | View mTarget;
23 |
24 | public RevealLinearLayout(Context context) {
25 | this(context, null);
26 | }
27 |
28 | public RevealLinearLayout(Context context, AttributeSet attrs) {
29 | this(context, attrs, 0);
30 | }
31 |
32 | public RevealLinearLayout(Context context, AttributeSet attrs, int defStyle) {
33 | super(context, attrs);
34 | mRevealPath = new Path();
35 | }
36 |
37 | /**
38 | * @hide
39 | */
40 | @Override
41 | public void setTarget(View view){
42 | mTarget = view;
43 | }
44 |
45 | /**
46 | * @hide
47 | */
48 | @Override
49 | public void setCenter(float centerX, float centerY){
50 | mCenterX = centerX;
51 | mCenterY = centerY;
52 | }
53 |
54 | /**
55 | * @hide
56 | */
57 | @Override
58 | public void setClipOutlines(boolean clip){
59 | mClipOutlines = clip;
60 | }
61 |
62 | /**
63 | * @hide
64 | */
65 | @Override
66 | public void setRevealRadius(float radius){
67 | mRadius = radius;
68 | invalidate();
69 | }
70 |
71 | /**
72 | * @hide
73 | */
74 | @Override
75 | public float getRevealRadius(){
76 | return mRadius;
77 | }
78 |
79 |
80 | @Override
81 | protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
82 | if (!mClipOutlines && child != mTarget)
83 | return super.drawChild(canvas, child, drawingTime);
84 |
85 | final int state = canvas.save();
86 |
87 | mRevealPath.reset();
88 | mRevealPath.addCircle(mCenterX, mCenterY, mRadius, Path.Direction.CW);
89 |
90 | canvas.clipPath(mRevealPath);
91 |
92 | boolean isInvalided = super.drawChild(canvas, child, drawingTime);
93 |
94 | canvas.restoreToCount(state);
95 |
96 | return isInvalided;
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | repositories {
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 |
9 | }
10 |
11 | android {
12 | compileSdkVersion 21
13 | buildToolsVersion "21.1.2"
14 |
15 | defaultConfig {
16 | minSdkVersion 7
17 | targetSdkVersion 21
18 | }
19 | }
20 |
21 |
22 | dependencies {
23 | compile 'com.android.support:appcompat-v7:22.+'
24 | }
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/java/me/imid/swipebacklayout/lib/Utils.java:
--------------------------------------------------------------------------------
1 |
2 | package me.imid.swipebacklayout.lib;
3 |
4 | import android.app.Activity;
5 |
6 | import java.lang.reflect.Method;
7 |
8 | /**
9 | * Created by Chaojun Wang on 6/9/14.
10 | */
11 | public class Utils {
12 | private Utils() {
13 | }
14 |
15 | /**
16 | * Convert a translucent themed Activity
17 | * {@link android.R.attr#windowIsTranslucent} to a fullscreen opaque
18 | * Activity.
19 | *
20 | * Call this whenever the background of a translucent Activity has changed
21 | * to become opaque. Doing so will allow the {@link android.view.Surface} of
22 | * the Activity behind to be released.
23 | *
24 | * This call has no effect on non-translucent activities or on activities
25 | * with the {@link android.R.attr#windowIsFloating} attribute.
26 | */
27 | public static void convertActivityFromTranslucent(Activity activity) {
28 | /*try {
29 | Method method = Activity.class.getDeclaredMethod("convertFromTranslucent");
30 | method.setAccessible(true);
31 | method.invoke(activity);
32 | } catch (Throwable t) {
33 | }*/
34 | }
35 |
36 | /**
37 | * Convert a translucent themed Activity
38 | * {@link android.R.attr#windowIsTranslucent} back from opaque to
39 | * translucent following a call to
40 | * {@link #convertActivityFromTranslucent(android.app.Activity)} .
41 | *
42 | * Calling this allows the Activity behind this one to be seen again. Once
43 | * all such Activities have been redrawn
44 | *
45 | * This call has no effect on non-translucent activities or on activities
46 | * with the {@link android.R.attr#windowIsFloating} attribute.
47 | */
48 | public static void convertActivityToTranslucent(Activity activity) {
49 | /*try {
50 | Class>[] classes = Activity.class.getDeclaredClasses();
51 | Class> translucentConversionListenerClazz = null;
52 | for (Class clazz : classes) {
53 | if (clazz.getSimpleName().contains("TranslucentConversionListener")) {
54 | translucentConversionListenerClazz = clazz;
55 | }
56 | }
57 | Method method = Activity.class.getDeclaredMethod("convertToTranslucent",
58 | translucentConversionListenerClazz);
59 | method.setAccessible(true);
60 | method.invoke(activity, new Object[] {
61 | null
62 | });
63 | } catch (Throwable t) {
64 | }*/
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/java/me/imid/swipebacklayout/lib/app/SwipeBackActivity.java:
--------------------------------------------------------------------------------
1 |
2 | package me.imid.swipebacklayout.lib.app;
3 |
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import me.imid.swipebacklayout.lib.SwipeBackLayout;
9 | import me.imid.swipebacklayout.lib.Utils;
10 |
11 | public class SwipeBackActivity extends AppCompatActivity implements SwipeBackActivityBase {
12 | private SwipeBackActivityHelper mHelper;
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | mHelper = new SwipeBackActivityHelper(this);
18 | mHelper.onActivityCreate();
19 | }
20 |
21 | @Override
22 | protected void onPostCreate(Bundle savedInstanceState) {
23 | super.onPostCreate(savedInstanceState);
24 | mHelper.onPostCreate();
25 | }
26 |
27 | @Override
28 | public View findViewById(int id) {
29 | View v = super.findViewById(id);
30 | if (v == null && mHelper != null)
31 | return mHelper.findViewById(id);
32 | return v;
33 | }
34 |
35 | @Override
36 | public SwipeBackLayout getSwipeBackLayout() {
37 | return mHelper.getSwipeBackLayout();
38 | }
39 |
40 | @Override
41 | public void setSwipeBackEnable(boolean enable) {
42 | getSwipeBackLayout().setEnableGesture(enable);
43 | }
44 |
45 | @Override
46 | public void scrollToFinishActivity() {
47 | Utils.convertActivityToTranslucent(this);
48 | getSwipeBackLayout().scrollToFinishActivity();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/java/me/imid/swipebacklayout/lib/app/SwipeBackActivityBase.java:
--------------------------------------------------------------------------------
1 | package me.imid.swipebacklayout.lib.app;
2 |
3 | import me.imid.swipebacklayout.lib.SwipeBackLayout;
4 | /**
5 | * @author Yrom
6 | */
7 | public interface SwipeBackActivityBase {
8 | /**
9 | * @return the SwipeBackLayout associated with this activity.
10 | */
11 | public abstract SwipeBackLayout getSwipeBackLayout();
12 |
13 | public abstract void setSwipeBackEnable(boolean enable);
14 |
15 | /**
16 | * Scroll out contentView and finish the activity
17 | */
18 | public abstract void scrollToFinishActivity();
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/java/me/imid/swipebacklayout/lib/app/SwipeBackActivityHelper.java:
--------------------------------------------------------------------------------
1 | package me.imid.swipebacklayout.lib.app;
2 |
3 | import android.content.Context;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.view.View;
6 |
7 | import me.imid.swipebacklayout.lib.SwipeBackLayout;
8 |
9 | /**
10 | * @author Yrom
11 | * @author PeterCxy
12 | */
13 | public class SwipeBackActivityHelper {
14 | protected AppCompatActivity mActivity;
15 |
16 | private SwipeBackLayout mSwipeBackLayout;
17 |
18 | public SwipeBackActivityHelper(AppCompatActivity activity) {
19 | mActivity = activity;
20 | }
21 |
22 | @SuppressWarnings("deprecation")
23 | public void onActivityCreate() {
24 | mSwipeBackLayout = new SwipeBackLayout(mActivity, getGlobalContext());
25 | }
26 |
27 | public void onPostCreate() {
28 | mSwipeBackLayout.attachToActivity(mActivity);
29 | }
30 |
31 | public View findViewById(int id) {
32 | if (mSwipeBackLayout != null) {
33 | return mSwipeBackLayout.findViewById(id);
34 | }
35 | return null;
36 | }
37 |
38 | public SwipeBackLayout getSwipeBackLayout() {
39 | return mSwipeBackLayout;
40 | }
41 |
42 | protected Context getGlobalContext() {
43 | return mActivity;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/res/drawable-xhdpi/shadow_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fython/ExpressHelper/a0cb853df60e3e1c9cc076ac457e2918c5f9177c/libraries/SwipeBackLayout/src/main/res/drawable-xhdpi/shadow_bottom.png
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/res/drawable-xhdpi/shadow_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fython/ExpressHelper/a0cb853df60e3e1c9cc076ac457e2918c5f9177c/libraries/SwipeBackLayout/src/main/res/drawable-xhdpi/shadow_left.png
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/res/drawable-xhdpi/shadow_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fython/ExpressHelper/a0cb853df60e3e1c9cc076ac457e2918c5f9177c/libraries/SwipeBackLayout/src/main/res/drawable-xhdpi/shadow_right.png
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/libraries/SwipeBackLayout/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/port/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/port/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "22.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 1
9 | targetSdkVersion 22
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 |
14 | compileOptions {
15 | sourceCompatibility JavaVersion.VERSION_1_7
16 | targetCompatibility JavaVersion.VERSION_1_7
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | compile fileTree(dir: 'libs', include: ['*.jar'])
28 | }
29 |
--------------------------------------------------------------------------------
/port/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in E:/Feng/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/port/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/port/src/main/java/info/papdt/express/helper/port/support/Express.java:
--------------------------------------------------------------------------------
1 | package info.papdt.express.helper.port.support;
2 |
3 | import org.json.JSONException;
4 | import org.json.JSONObject;
5 |
6 | public class Express {
7 |
8 | public String companyCode, mailNumber;
9 | private String jsonData = null;
10 | public int status = STATUS_UNKNOWN_ERROR;
11 |
12 | /** 查询状态:
13 | * -1 未知错误
14 | * 0 查询成功
15 | * 1 服务器错误
16 | * 2 快递公司找不到或不被支持
17 | * 3 传入参数错误
18 | * */
19 | public static final int STATUS_UNKNOWN_ERROR = -1, STATUS_NORMAL = 0, STATUS_SERVER_ERROR = 1,
20 | STATUS_COMPANY_UNSUPPORTED = 2, STATUS_INPUT_ERROR = 3;
21 |
22 | public Express(String companyCode, String mailNumber){
23 | this(companyCode, mailNumber, mailNumber);
24 | }
25 |
26 | public Express(String companyCode, String mailNumber, String name){
27 | this.companyCode = companyCode;
28 | this.mailNumber = mailNumber;
29 | }
30 |
31 | public String getDataStr() {
32 | return jsonData;
33 | }
34 |
35 | public void setData(String jsonStr) {
36 | this.jsonData = jsonStr;
37 | }
38 |
39 | public ExpressResult getData() {
40 | return ExpressResult.buildFromJSON(jsonData);
41 | }
42 |
43 | public JSONObject toJSONObject() {
44 | JSONObject obj0 = new JSONObject();
45 | try {
46 | obj0.put("companyCode", companyCode);
47 | obj0.put("mailNumber", mailNumber);
48 | obj0.put("cache", getDataStr());
49 | } catch (JSONException e) {
50 | e.printStackTrace();
51 | }
52 | return obj0;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/port/src/main/java/info/papdt/express/helper/port/support/ExpressResult.java:
--------------------------------------------------------------------------------
1 | package info.papdt.express.helper.port.support;
2 |
3 | import org.json.JSONArray;
4 | import org.json.JSONException;
5 | import org.json.JSONObject;
6 | import org.json.JSONTokener;
7 |
8 | import java.util.ArrayList;
9 | import java.util.HashMap;
10 | import java.util.Map;
11 |
12 | public class ExpressResult {
13 |
14 | public int status, errCode, update, cache;
15 | public String message, html, mailNo, expSpellName, expTextName, ord;
16 | public ArrayList