├── libs
├── core.jar
├── volley.jar
├── eventbus.jar
├── gson-2.2.1.jar
├── pagerindicator.jar
├── picasso-2.3.1.jar
├── xUtils-2.6.14.jar
├── android-support-v4.jar
├── butterknife-4.0.1.jar
├── commons-codec-1.3.jar
├── nineoldandroids-2.4.0.jar
├── android-async-http-1.4.6.jar
├── fastjson-1.1.43.android.jar
├── androidannotations-api-3.1.jar
├── viewpagertransformslibrary.jar
├── universal-image-loader-1.9.3.jar
└── com.haarman.listviewanimations-2.6.0.jar
├── res
├── raw
│ └── qrcode_found.wav
├── drawable-hdpi
│ ├── ic_launcher.png
│ ├── s_search_bg.png
│ ├── slip_ball.png
│ ├── slip_left.png
│ ├── slip_right.png
│ ├── scan_icon_nor.png
│ ├── scan_top_bg2.png
│ ├── home_img_ratio.png
│ ├── menu_btn_normal.png
│ ├── menu_btn_pressed.png
│ ├── v1_7_back_hover.png
│ ├── xsearch_loading.png
│ ├── topbar_right_press.png
│ ├── v1_7_back_blue_nor.png
│ ├── me_share_return_press.png
│ ├── topbar_right_normal.png
│ ├── home_img_ratio_selected.png
│ ├── news_tab_item_bg_select.9.png
│ ├── xsearch_msg_pull_arrow_down.png
│ └── emotionstore_progresscancelbtn.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── drawable
│ ├── me_share_return_normal.png
│ ├── text_blue.xml
│ ├── toast_bg.xml
│ ├── share_return.xml
│ ├── top_right_selector.xml
│ ├── back_seletor.xml
│ ├── progress_style.xml
│ ├── progress_bar_states.xml
│ ├── btn_bind_cancel_.xml
│ ├── btn_bind_cancel.xml
│ └── tab_indicator.xml
├── values
│ ├── dimen.xml
│ ├── drawables.xml
│ ├── strings.xml
│ ├── colors.xml
│ ├── attrs.xml
│ ├── ids.xml
│ ├── pull_picture_dimens.xml
│ ├── styles.xml
│ ├── pull_refresh_strings.xml
│ └── vpi__styles.xml
├── anim
│ ├── in_from_bottom.xml
│ ├── in_from_left.xml
│ ├── in_from_right.xml
│ ├── in_from_top.xml
│ ├── out_to_bottom.xml
│ ├── out_to_left.xml
│ ├── out_to_right.xml
│ ├── out_to_top.xml
│ ├── update_loading_progressbar_anim.xml
│ ├── pop_enter.xml
│ └── pop_exit.xml
├── layout
│ ├── progressdialog.xml
│ ├── viewpager_item.xml
│ ├── activity_baseweb.xml
│ ├── view_custom_toast.xml
│ ├── ad_cycle_view.xml
│ ├── pull_to_load_footer.xml
│ ├── view_top_bar.xml
│ ├── popu_get_photo.xml
│ ├── pull_to_refresh_header.xml
│ └── camera.xml
└── color
│ └── tab_theme.xml
├── .gitignore
├── src
└── com
│ ├── finddreams
│ └── baselib
│ │ ├── activity
│ │ └── DemoActivity.java
│ │ ├── utils
│ │ ├── ConstantsValue.java
│ │ ├── MD5Util.java
│ │ ├── BroadcastHelper.java
│ │ ├── GsonUtil.java
│ │ ├── PlaySoundUtil.java
│ │ ├── Screenshot.java
│ │ ├── InstallManager.java
│ │ ├── ToastManager.java
│ │ ├── DateUtil.java
│ │ ├── FileUtil.java
│ │ ├── AppHelper.java
│ │ ├── InputMethodUtil.java
│ │ ├── AppManager.java
│ │ ├── DisplayUtil.java
│ │ ├── CacheUtil.java
│ │ ├── LogManager.java
│ │ └── ActivityUtil.java
│ │ ├── view
│ │ ├── NoScrollGridView.java
│ │ ├── CustomToast.java
│ │ ├── CustomProgressDialog.java
│ │ ├── CustomViewPager.java
│ │ ├── NoScrollListView.java
│ │ ├── ScrollListView.java
│ │ ├── RotateAnimation.java
│ │ ├── ImageTextView.java
│ │ ├── ProgressWebView.java
│ │ ├── TopBarView.java
│ │ ├── FlippingImageView.java
│ │ ├── ModelPopup.java
│ │ ├── BounceScrollView.java
│ │ ├── ClearEditText.java
│ │ ├── SendValidateButton.java
│ │ └── ScaleImageView.java
│ │ ├── base
│ │ ├── BaseViewHolder.java
│ │ ├── BaseActivity.java
│ │ ├── MyBaseAdapter.java
│ │ ├── BaseWebActivity.java
│ │ ├── BasePage.java
│ │ └── BaseFragment.java
│ │ ├── http
│ │ ├── MyHttpClient.java
│ │ ├── URLUtils.java
│ │ ├── MyHttpUtils.java
│ │ └── NetStateUtil.java
│ │ ├── app
│ │ ├── MyApplication.java
│ │ └── CrashHandler.java
│ │ └── service
│ │ └── ServiceManager.java
│ ├── zxing
│ └── barcode
│ │ ├── ViewfinderResultPointCallback.java
│ │ ├── FinishListener.java
│ │ ├── AutoFocusCallback.java
│ │ ├── PreviewCallback.java
│ │ ├── InactivityTimer.java
│ │ ├── DecodeThread.java
│ │ ├── EncodingHandler.java
│ │ ├── DecodeHandler.java
│ │ ├── DecodeFormatManager.java
│ │ ├── PlanarYUVLuminanceSource.java
│ │ ├── CaptureActivityHandler.java
│ │ └── FlashlightManager.java
│ └── android
│ └── pulltorefreshview
│ ├── ILoadingLayout.java
│ ├── IPullToRefresh.java
│ └── FooterLoadingLayout.java
├── AndroidManifest.xml
├── .project
└── README.md
/libs/core.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/core.jar
--------------------------------------------------------------------------------
/libs/volley.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/volley.jar
--------------------------------------------------------------------------------
/libs/eventbus.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/eventbus.jar
--------------------------------------------------------------------------------
/libs/gson-2.2.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/gson-2.2.1.jar
--------------------------------------------------------------------------------
/libs/pagerindicator.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/pagerindicator.jar
--------------------------------------------------------------------------------
/libs/picasso-2.3.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/picasso-2.3.1.jar
--------------------------------------------------------------------------------
/libs/xUtils-2.6.14.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/xUtils-2.6.14.jar
--------------------------------------------------------------------------------
/res/raw/qrcode_found.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/raw/qrcode_found.wav
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/butterknife-4.0.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/butterknife-4.0.1.jar
--------------------------------------------------------------------------------
/libs/commons-codec-1.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/commons-codec-1.3.jar
--------------------------------------------------------------------------------
/libs/nineoldandroids-2.4.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/nineoldandroids-2.4.0.jar
--------------------------------------------------------------------------------
/libs/android-async-http-1.4.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/android-async-http-1.4.6.jar
--------------------------------------------------------------------------------
/libs/fastjson-1.1.43.android.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/fastjson-1.1.43.android.jar
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/s_search_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/s_search_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/slip_ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/slip_ball.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/slip_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/slip_left.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/slip_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/slip_right.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/libs/androidannotations-api-3.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/androidannotations-api-3.1.jar
--------------------------------------------------------------------------------
/libs/viewpagertransformslibrary.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/viewpagertransformslibrary.jar
--------------------------------------------------------------------------------
/res/drawable-hdpi/scan_icon_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/scan_icon_nor.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/scan_top_bg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/scan_top_bg2.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/libs/universal-image-loader-1.9.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/universal-image-loader-1.9.3.jar
--------------------------------------------------------------------------------
/res/drawable-hdpi/home_img_ratio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/home_img_ratio.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/menu_btn_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/menu_btn_normal.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/menu_btn_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/menu_btn_pressed.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/v1_7_back_hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/v1_7_back_hover.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/xsearch_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/xsearch_loading.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/topbar_right_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/topbar_right_press.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/v1_7_back_blue_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/v1_7_back_blue_nor.png
--------------------------------------------------------------------------------
/res/drawable/me_share_return_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable/me_share_return_normal.png
--------------------------------------------------------------------------------
/res/values/dimen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16sp
4 |
5 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/me_share_return_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/me_share_return_press.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/topbar_right_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/topbar_right_normal.png
--------------------------------------------------------------------------------
/libs/com.haarman.listviewanimations-2.6.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/libs/com.haarman.listviewanimations-2.6.0.jar
--------------------------------------------------------------------------------
/res/drawable-hdpi/home_img_ratio_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/home_img_ratio_selected.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/news_tab_item_bg_select.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/news_tab_item_bg_select.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/xsearch_msg_pull_arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/xsearch_msg_pull_arrow_down.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/emotionstore_progresscancelbtn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finddreams/Android_BaseLib/HEAD/res/drawable-hdpi/emotionstore_progresscancelbtn.png
--------------------------------------------------------------------------------
/res/values/drawables.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | - #00000000
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/in_from_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/in_from_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/in_from_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/in_from_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/out_to_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/out_to_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/out_to_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/out_to_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/res/layout/progressdialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/res/drawable/text_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | /gen
3 | # Local configuration file (sdk path, etc)
4 | local.properties
5 |
6 | # Eclipse project files
7 | .classpath
8 | .project
9 |
10 | # Proguard folder generated by Eclipse
11 | proguard/
12 | /ic_launcher-web.png
13 | /.classpath
14 | /.settings
15 | /.classpath
16 | /proguard-project.txt
17 | /project.properties
18 |
--------------------------------------------------------------------------------
/res/anim/update_loading_progressbar_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/drawable/toast_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/res/anim/pop_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/res/anim/pop_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/res/drawable/share_return.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/top_right_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/layout/viewpager_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/activity/DemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.activity;
2 |
3 | import com.finddreams.baselib.base.BaseActivity;
4 | /**
5 | * @Description: 例子,如何使用的实例
6 | * @author finddreams
7 | * @address https://github.com/finddreams
8 | */
9 | public class DemoActivity extends BaseActivity {
10 |
11 | @Override
12 | protected void initView() {
13 |
14 | }
15 |
16 | @Override
17 | protected void initData() {
18 |
19 |
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/res/drawable/back_seletor.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | BaseLib
4 | 返回
5 | 拍照
6 | 从手机相册选取
7 | 取消
8 | 模特
9 | 将二维码放入框内, 即可自动扫描
10 | 更多
11 | 扫描二维码
12 | 沒有网络
13 |
14 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/res/drawable/progress_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/layout/activity_baseweb.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/res/layout/view_custom_toast.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffffff
4 |
5 | #ffd65284
6 | #ff7a7979
7 | #ff999999
8 | #ffef71a1
9 | #000000
10 | #60000000
11 | #b0000000
12 | #c0ffff00
13 | #aeff39
14 | #E60200
15 |
16 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/utils/ConstantsValue.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.utils;
2 |
3 | import android.os.Environment;
4 |
5 | public class ConstantsValue {
6 |
7 | public static final String COMMON_ACTION = "finddreams";
8 | private static final String IMAGE_PATH_DIR = "/.finddreams/img/";
9 | private static final String IMAGE_APP_PATH_DIR = "/.finddreams/app_img/";
10 | private static final String APP_LOG_PATH_DIR = "/.finddreams/log/";
11 | public static final String IMAGE_APP_PATH = Environment.getExternalStorageDirectory() + IMAGE_APP_PATH_DIR;
12 |
13 | public static final boolean DEBUG = true;
14 | public static final String INTENT_URL = "url";
15 | public static final String INTENT_TITLE = "title";
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/NoScrollGridView.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.GridView;
6 | /**
7 | * @Description:没有滚动条的gridview
8 | * @author http://blog.csdn.net/finddreams
9 | */
10 | public class NoScrollGridView extends GridView {
11 | public NoScrollGridView(Context context) {
12 | super(context);
13 | }
14 |
15 | public NoScrollGridView(Context context, AttributeSet attrs) {
16 | super(context, attrs);
17 | }
18 |
19 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
20 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
21 | MeasureSpec.AT_MOST);
22 | super.onMeasure(widthMeasureSpec, expandSpec);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/res/layout/ad_cycle_view.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/base/BaseViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.base;
2 |
3 | import android.util.SparseArray;
4 | import android.view.View;
5 | /**
6 | * @Description:万能的viewHolder
7 | * @author http://blog.csdn.net/finddreams
8 | */
9 | public class BaseViewHolder {
10 | @SuppressWarnings("unchecked")
11 | public static T get(View view, int id) {
12 | SparseArray viewHolder = (SparseArray) view.getTag();
13 | if (viewHolder == null) {
14 | viewHolder = new SparseArray();
15 | view.setTag(viewHolder);
16 | }
17 | View childView = viewHolder.get(id);
18 | if (childView == null) {
19 | childView = view.findViewById(id);
20 | viewHolder.put(id, childView);
21 | }
22 | return (T) childView;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/utils/MD5Util.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.utils;
2 |
3 | import java.security.MessageDigest;
4 |
5 | /**
6 | * @Description:md5的加密
7 | * @author http://blog.csdn.net/finddreams
8 | */
9 | public class MD5Util {
10 |
11 | public static String getMD5(String content) {
12 | try {
13 | MessageDigest digest = MessageDigest.getInstance("MD5");
14 | digest.update(content.getBytes());
15 | return getHashString(digest);
16 |
17 | } catch (Exception e) {
18 | e.printStackTrace();
19 | }
20 | return null;
21 | }
22 |
23 | private static String getHashString(MessageDigest digest) {
24 | StringBuilder builder = new StringBuilder();
25 | for (byte b : digest.digest()) {
26 | builder.append(Integer.toHexString((b >> 4) & 0xf));
27 | builder.append(Integer.toHexString(b & 0xf));
28 | }
29 | return builder.toString();
30 | }
31 | }
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | BaseLib
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/drawable/progress_bar_states.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
14 |
15 |
16 | -
17 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/drawable/btn_bind_cancel_.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 | -
17 |
18 |
19 |
20 |
21 |
22 | -
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/drawable/btn_bind_cancel.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 | -
17 |
18 |
19 |
20 |
21 |
22 | -
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/CustomToast.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 |
4 |
5 |
6 |
7 | import com.finddreams.baselib.R;
8 |
9 | import android.content.Context;
10 | import android.view.Gravity;
11 | import android.view.View;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | public class CustomToast extends Toast {
16 |
17 | private TextView textView;
18 | private String text;
19 | private View view;
20 | private int time;
21 | private Context context;
22 |
23 | public CustomToast(Context context,String text,int time) {
24 | super(context);
25 | this.context = context;
26 | this.text = text;
27 | this.time = time;
28 | init();
29 | }
30 |
31 | private void init() {
32 | view = View.inflate(context, R.layout.view_custom_toast, null);
33 | setView(view);
34 | textView = (TextView) view.findViewById(R.id.textView);
35 | textView.setText(text);
36 | setGravity(Gravity.CENTER_HORIZONTAL, 0, 0);
37 | setDuration(time);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/CustomProgressDialog.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.view.Gravity;
6 |
7 | import com.finddreams.baselib.R;
8 |
9 | public class CustomProgressDialog extends Dialog {
10 |
11 | public CustomProgressDialog(Context context, String strMessage) {
12 | this(context, R.style.CustomProgressDialog, strMessage);
13 | }
14 |
15 | public CustomProgressDialog(Context context, int theme, String strMessage) {
16 | super(context, theme);
17 | this.setContentView(R.layout.progressdialog);
18 | this.getWindow().getAttributes().gravity = Gravity.CENTER;
19 | // TextView tvMsg = (TextView) this.findViewById(R.id.id_tv_loadingmsg);
20 | // if (tvMsg != null) {
21 | // tvMsg.setText(strMessage);
22 | // }
23 | }
24 |
25 | @Override
26 | public void onWindowFocusChanged(boolean hasFocus) {
27 |
28 | if (!hasFocus) {
29 | dismiss();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/CustomViewPager.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 |
4 |
5 | import android.content.Context;
6 | import android.util.AttributeSet;
7 | import android.view.MotionEvent;
8 |
9 | public class CustomViewPager extends LazyViewPager {
10 | private boolean isScrollable;
11 |
12 | public CustomViewPager(Context context) {
13 | super(context);
14 | }
15 |
16 | public CustomViewPager(Context context, AttributeSet attrs) {
17 | super(context, attrs);
18 | }
19 |
20 | @Override
21 | public boolean onTouchEvent(MotionEvent ev) {
22 | if (isScrollable == false) {
23 | return false;
24 | } else {
25 | return super.onTouchEvent(ev);
26 | }
27 |
28 | }
29 |
30 | @Override
31 | public boolean onInterceptTouchEvent(MotionEvent ev) {
32 | if (isScrollable == false) {
33 | return false;
34 | } else {
35 | return super.onInterceptTouchEvent(ev);
36 | }
37 |
38 | }
39 |
40 | public boolean isScrollable() {
41 | return isScrollable;
42 | }
43 |
44 | public void setScrollable(boolean isScrollable) {
45 | this.isScrollable = isScrollable;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/NoScrollListView.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ListView;
6 |
7 | /**
8 | * @Description:自定义无滚动条的ListView
9 | * @author http://blog.csdn.net/finddreams
10 | */
11 | public class NoScrollListView extends ListView {
12 |
13 | public NoScrollListView(Context context)
14 | {
15 | super(context);
16 | }
17 |
18 | public NoScrollListView(Context context, AttributeSet attrs)
19 | {
20 | super(context, attrs);
21 | }
22 |
23 | public NoScrollListView(Context context, AttributeSet attrs, int defStyle)
24 | {
25 | super(context, attrs, defStyle);
26 | }
27 | @Override
28 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
29 |
30 | int expandSpec = MeasureSpec.makeMeasureSpec(
31 | Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
32 | super.onMeasure(widthMeasureSpec, expandSpec);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/utils/BroadcastHelper.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.utils;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 |
6 | public class BroadcastHelper {
7 |
8 | public static void sendCommonBroadCast(Context context,String content) {
9 | Intent intent = new Intent();
10 | intent.setAction(ConstantsValue.COMMON_ACTION);
11 | intent.addCategory(Intent.CATEGORY_DEFAULT);
12 | intent.putExtra(ConstantsValue.COMMON_ACTION, content);
13 | context.sendBroadcast(intent);
14 | }
15 |
16 | public static void sendBroadCast(Context context,String action,String key,String value) {
17 | Intent intent = new Intent();
18 | intent.setAction(action);
19 | intent.addCategory(Intent.CATEGORY_DEFAULT);
20 | intent.putExtra(key, value);
21 | context.sendBroadcast(intent);
22 | }
23 |
24 | public static void sendBroadCast(Context context,String action,String key,int value) {
25 | Intent intent = new Intent();
26 | intent.setAction(action);
27 | intent.addCategory(Intent.CATEGORY_DEFAULT);
28 | intent.putExtra(key, value);
29 | context.sendBroadcast(intent);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/res/color/tab_theme.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/com/zxing/barcode/ViewfinderResultPointCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2009 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zxing.barcode;
18 |
19 | import com.google.zxing.ResultPoint;
20 | import com.google.zxing.ResultPointCallback;
21 |
22 | public final class ViewfinderResultPointCallback implements ResultPointCallback {
23 |
24 | private final ViewfinderView viewfinderView;
25 |
26 | public ViewfinderResultPointCallback(ViewfinderView viewfinderView) {
27 | this.viewfinderView = viewfinderView;
28 | }
29 |
30 | public void foundPossibleResultPoint(ResultPoint point) {
31 | viewfinderView.addPossibleResultPoint(point);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/base/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.base;
2 |
3 |
4 | import com.finddreams.baselib.http.MyHttpClient;
5 | import com.finddreams.baselib.utils.AppManager;
6 | import com.loopj.android.http.AsyncHttpClient;
7 |
8 | import android.content.Context;
9 | import android.os.Bundle;
10 | import android.support.v4.app.FragmentActivity;
11 | import android.view.Window;
12 | /**
13 | * @Description:所有Activity的基类,是个抽象类,把整个项目中都需要用到的东西封装起来
14 | * @author http://blog.csdn.net/finddreams
15 | */
16 | public abstract class BaseActivity extends FragmentActivity {
17 |
18 | protected Context context;
19 | protected AsyncHttpClient httpClient;
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | this.requestWindowFeature(Window.FEATURE_NO_TITLE);
25 | AppManager.getAppManager().addActivity(this);
26 | context = this;
27 | httpClient = MyHttpClient.getHttpClient();
28 | initView();
29 | initData();
30 | }
31 | /**
32 | * 抽象方法子类必须实现
33 | */
34 | protected abstract void initView();
35 |
36 | protected abstract void initData();
37 |
38 | @Override
39 | protected void onDestroy() {
40 | super.onDestroy();
41 | AppManager.getAppManager().finishActivity(this);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/ScrollListView.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ListView;
6 |
7 | /**
8 | * @Description:ScrollView中嵌套ListView的解决方案,
9 | * 解决在scrollview中只显示Listview中一行的问题
10 | * @author http://blog.csdn.net/finddreams
11 | */
12 |
13 | public class ScrollListView extends ListView {
14 | private boolean haveScrollbar = false;
15 |
16 | public ScrollListView(Context context) {
17 | super(context);
18 | }
19 |
20 | public ScrollListView(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | public ScrollListView(Context context, AttributeSet attrs, int defStyle) {
25 | super(context, attrs, defStyle);
26 | }
27 |
28 |
29 | public void setHaveScrollbar(boolean haveScrollbar) {
30 | this.haveScrollbar = haveScrollbar;
31 | }
32 |
33 | @Override
34 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
35 | if(haveScrollbar){
36 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
37 | }else{
38 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
39 | super.onMeasure(widthMeasureSpec, expandSpec);
40 | }
41 | }
42 |
43 |
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/base/MyBaseAdapter.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.base;
2 |
3 | import java.util.List;
4 |
5 |
6 | import android.content.Context;
7 | import android.os.Bundle;
8 | import android.widget.BaseAdapter;
9 |
10 | /**
11 | * @Description:自定义的BaseAdapter,所有adapter的父类。
12 | * @author http://blog.csdn.net/finddreams
13 | */
14 | public abstract class MyBaseAdapter extends BaseAdapter {
15 |
16 | public Context context;
17 | public List list;//
18 | public Q view; // 这里不一定是ListView,比如GridView,CustomListView
19 |
20 |
21 | public MyBaseAdapter(Context context, List list, Q view) {
22 | this.context = context;
23 | this.list = list;
24 | this.view = view;
25 | }
26 |
27 | public MyBaseAdapter(Context context, List list) {
28 | this.context = context;
29 | this.list = list;
30 |
31 | }
32 | /**
33 | * update
34 | * @param list
35 | */
36 | public void updateListView(List list){
37 | this.list = list;
38 | notifyDataSetChanged();
39 | }
40 |
41 | @Override
42 | public int getCount() {
43 | return list.size();
44 | }
45 |
46 | @Override
47 | public Object getItem(int position) {
48 | return list.get(position);
49 | }
50 |
51 | @Override
52 | public long getItemId(int position) {
53 | return position;
54 | }
55 |
56 |
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/res/layout/pull_to_load_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
22 |
23 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/http/MyHttpClient.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.http;
2 |
3 | import java.util.HashMap;
4 |
5 | import com.loopj.android.http.AsyncHttpClient;
6 | import com.loopj.android.http.AsyncHttpResponseHandler;
7 | import com.loopj.android.http.RequestParams;
8 |
9 | /**
10 | * @Description:使用了android-async-http的网络帮助类
11 | * @author http://blog.csdn.net/finddreams
12 | */
13 | public class MyHttpClient {
14 |
15 | private static int CONNECTTIMEOUT = 15 * 1000; // 连接超时
16 | private static AsyncHttpClient client;
17 | private MyHttpClient(){
18 | }
19 | public static AsyncHttpClient getHttpClient(){
20 | if(client==null){
21 | client=new AsyncHttpClient();
22 | client.setTimeout(CONNECTTIMEOUT);
23 | }
24 | return client;
25 | }
26 | /**
27 | * 带参数的get请求
28 | * @param urlString
29 | * @param params
30 | * @param res
31 | */
32 | public void sendGet(String urlString, RequestParams params,
33 | AsyncHttpResponseHandler res){
34 |
35 | client.get(urlString, params, res);
36 |
37 | }
38 | public void sendGet(String url,AsyncHttpResponseHandler responseHandler){
39 | client.get(url, responseHandler);
40 | }
41 |
42 | public void sendPost(String url,RequestParams params,HashMap vaules,AsyncHttpResponseHandler responseHandler){
43 |
44 | client.post(url, params, responseHandler);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/RotateAnimation.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 | import android.graphics.Camera;
4 | import android.graphics.Matrix;
5 | import android.view.animation.Animation;
6 | import android.view.animation.Transformation;
7 |
8 | public class RotateAnimation extends Animation {
9 |
10 | private Camera mCamera;
11 | private float mCenterX;
12 | private float mCenterY;
13 | private Mode mMode;
14 |
15 | public RotateAnimation(float centerX, float centerY, Mode mode) {
16 | mCenterX = centerX;
17 | mCenterY = centerY;
18 | mMode = mode;
19 | }
20 |
21 | @Override
22 | public void initialize(int width, int height, int parentWidth,
23 | int parentHeight) {
24 | super.initialize(width, height, parentWidth, parentHeight);
25 | mCamera = new Camera();
26 | }
27 |
28 | @Override
29 | protected void applyTransformation(float interpolatedTime, Transformation t) {
30 | float deg = 0.0F + 360.0F * interpolatedTime;
31 | Matrix matrix = t.getMatrix();
32 | mCamera.save();
33 | if (mMode == Mode.X)
34 | mCamera.rotateX(deg);
35 | if (mMode == Mode.Y)
36 | mCamera.rotateY(deg);
37 | if (mMode == Mode.Z)
38 | mCamera.rotateZ(deg);
39 |
40 | mCamera.getMatrix(matrix);
41 | mCamera.restore();
42 | matrix.preTranslate(-mCenterX, -mCenterY);
43 | matrix.postTranslate(mCenterX, mCenterY);
44 |
45 | }
46 |
47 | public enum Mode {
48 | X, Y, Z;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/zxing/barcode/FinishListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zxing.barcode;
18 |
19 | import android.app.Activity;
20 | import android.content.DialogInterface;
21 |
22 | /**
23 | * Simple listener used to exit the app in a few cases.
24 | *
25 | */
26 | public final class FinishListener
27 | implements DialogInterface.OnClickListener, DialogInterface.OnCancelListener, Runnable {
28 |
29 | private final Activity activityToFinish;
30 |
31 | public FinishListener(Activity activityToFinish) {
32 | this.activityToFinish = activityToFinish;
33 | }
34 |
35 | public void onCancel(DialogInterface dialogInterface) {
36 | run();
37 | }
38 |
39 | public void onClick(DialogInterface dialogInterface, int i) {
40 | run();
41 | }
42 |
43 | public void run() {
44 | activityToFinish.finish();
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/base/BaseWebActivity.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.base;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.widget.ProgressBar;
6 |
7 | import com.finddreams.baselib.R;
8 | import com.finddreams.baselib.utils.ConstantsValue;
9 | import com.finddreams.baselib.view.ProgressWebView;
10 | /**
11 | * WebView
12 | * @author liuxiang
13 | * @date 2015-1-30 下午6:07:05
14 | * @version V1.0
15 | */
16 | public class BaseWebActivity extends BaseActivity {
17 |
18 | // private View mLoadingView;
19 | protected ProgressWebView mWebView;
20 | private ProgressBar web_progressbar;
21 | @Override
22 | protected void initView() {
23 | setContentView(R.layout.activity_baseweb);
24 | // mLoadingView = findViewById(R.id.baseweb_loading_indicator);
25 | mWebView = (ProgressWebView) findViewById(R.id.baseweb_webview);
26 | mWebView.getSettings().setJavaScriptEnabled(true);
27 | }
28 |
29 | @Override
30 | protected void initData() {
31 | Intent intent = getIntent();
32 | Bundle bundle = intent.getExtras();
33 | String url = bundle.getString(ConstantsValue.INTENT_URL);
34 | String title = bundle.getString(ConstantsValue.INTENT_TITLE);
35 | // if(!TextUtils.isEmpty(url)&&TextUtils.isEmpty(title)){
36 | mWebView.loadUrl(url);
37 |
38 | // }
39 |
40 | }
41 | @Override
42 | protected void onDestroy() {
43 | // TODO Auto-generated method stub
44 | super.onDestroy();
45 | mWebView=null;
46 |
47 | }
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/view/ImageTextView.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.view;
2 |
3 | import com.finddreams.baselib.utils.BitmapUtil;
4 |
5 | import android.content.Context;
6 | import android.graphics.Bitmap;
7 | import android.graphics.drawable.Drawable;
8 | import android.util.AttributeSet;
9 | import android.widget.TextView;
10 | /**
11 | * @Description: 文字图片,这个相信大家都知道,比如QQ底部导航上的未读消息数
12 | *
13 | * @author http://blog.csdn.net/finddreams
14 | */
15 | public class ImageTextView extends TextView {
16 | private Bitmap bitmap;
17 | private String text;
18 | Drawable d;
19 |
20 | public ImageTextView(Context context) {
21 | super(context);
22 | text = this.getText().toString().substring(0, 1);
23 | bitmap = BitmapUtil.getIndustry(context, text);
24 | d = BitmapUtil.bitmapTodrawable(bitmap);
25 | this.setCompoundDrawables(d, null, null, null);
26 | }
27 |
28 | public ImageTextView(Context context, AttributeSet attrs, int defStyle) {
29 | super(context, attrs, defStyle);
30 | text = this.getText().toString().substring(0, 1);
31 | bitmap = BitmapUtil.getIndustry(context, text);
32 | d = BitmapUtil.bitmapTodrawable(bitmap);
33 | this.setCompoundDrawables(d, null, null, null);
34 | }
35 |
36 | public ImageTextView(Context context, AttributeSet attrs) {
37 | super(context, attrs);
38 | text = this.getText().toString().substring(0, 1);
39 | bitmap = BitmapUtil.getIndustry(context, text);
40 | d = BitmapUtil.bitmapTodrawable(bitmap);
41 | this.setCompoundDrawables(d, null, null, null);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/base/BasePage.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.base;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.View.OnClickListener;
9 |
10 | import com.finddreams.baselib.http.MyHttpClient;
11 | import com.lidroid.xutils.ViewUtils;
12 | import com.loopj.android.http.AsyncHttpClient;
13 |
14 | /**
15 | * @Description:所有页面view的基类。
16 | * @author http://blog.csdn.net/finddreams
17 | */
18 | public abstract class BasePage implements OnClickListener {
19 |
20 | protected Context context;
21 | protected View contentView;
22 | protected AsyncHttpClient httpClient;
23 |
24 | public boolean isLoadSuccess=false;
25 |
26 | public BasePage(Context context) {
27 | this.context = context;
28 | contentView = initView((LayoutInflater) context
29 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE));
30 | ViewUtils.inject(contentView);
31 | httpClient = MyHttpClient.getHttpClient();
32 |
33 | }
34 | protected abstract View initView(LayoutInflater inflater);
35 |
36 | public abstract void initData();
37 |
38 | public View getContentView() {
39 | return contentView;
40 | }
41 | @Override
42 | public void onClick(View v) {
43 | }
44 |
45 | protected void startActivity(Activity activity) {
46 | Intent intent = new Intent(context, activity.getClass());
47 | context.startActivity(intent);
48 |
49 | // AppManager.getAppManager().finishActivity();
50 |
51 | }
52 |
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/res/values/pull_picture_dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 80dp
4 |
5 | 0dp
6 | 48dp
7 |
8 | 16dp
9 |
10 | 12dp
11 |
12 | 12dp
13 |
14 | 8dp
15 | 9dp
16 | 6dp
17 | 5dp
18 | 10dp
19 | 30dp
20 |
21 | 18dp
22 |
23 | 8dp
24 |
25 | 12dp
26 |
27 | 14dp
28 | 10dp
29 | 6dp
30 | 40dp
31 |
32 |
--------------------------------------------------------------------------------
/src/com/finddreams/baselib/utils/GsonUtil.java:
--------------------------------------------------------------------------------
1 | package com.finddreams.baselib.utils;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | import com.google.gson.Gson;
7 | import com.google.gson.reflect.TypeToken;
8 | /**
9 | * @Description:谷歌的Gson解析工具类,官方推荐
10 | * @author http://blog.csdn.net/finddreams
11 | */
12 | public class GsonUtil {
13 |
14 | public GsonUtil() {
15 | // TODO Auto-generated constructor stub
16 | }
17 |
18 | public static String createGsonString(Object object) {
19 | Gson gson = new Gson();
20 | String gsonString = gson.toJson(object);
21 | return gsonString;
22 | }
23 |
24 | public static T changeGsonToBean(String gsonString, Class cls) {
25 | Gson gson = new Gson();
26 | T t = gson.fromJson(gsonString, cls);
27 | return t;
28 | }
29 |
30 | public static List changeGsonToList(String gsonString, Class cls) {
31 | Gson gson = new Gson();
32 | List list = gson.fromJson(gsonString, new TypeToken>() {}.getType());
33 | return list;
34 | }
35 |
36 |
37 |
38 | public static List