├── .idea
├── .name
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── runConfigurations.xml
├── modules.xml
├── compiler.xml
└── gradle.xml
├── AndroidBase
├── .gitignore
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── android
│ │ │ │ └── base
│ │ │ │ ├── db
│ │ │ │ ├── impl
│ │ │ │ │ ├── DbCallBack.java
│ │ │ │ │ └── DaoOperation.java
│ │ │ │ ├── CollectionUtil.java
│ │ │ │ └── ColumnStruct.java
│ │ │ │ ├── frame
│ │ │ │ ├── presenter
│ │ │ │ │ ├── factory
│ │ │ │ │ │ ├── PresenterFactory.java
│ │ │ │ │ │ ├── RequiresPresenter.java
│ │ │ │ │ │ ├── ReflectionPresenterFactory.java
│ │ │ │ │ │ └── PresenterStorage.java
│ │ │ │ │ ├── impl
│ │ │ │ │ │ └── PresenterLifecycleImpl.java
│ │ │ │ │ ├── XPresenter.java
│ │ │ │ │ └── BasePresenter.java
│ │ │ │ ├── ViewWithPresenter.java
│ │ │ │ ├── Base.java
│ │ │ │ └── fragment
│ │ │ │ │ └── BaseFragment.java
│ │ │ │ ├── util
│ │ │ │ ├── adapter
│ │ │ │ │ ├── MultiItemTypeSupport.java
│ │ │ │ │ ├── CommonViewHolder.java
│ │ │ │ │ └── WrapperUtils.java
│ │ │ │ ├── ParcelFn.java
│ │ │ │ ├── thread
│ │ │ │ │ ├── SchedulePolicy.java
│ │ │ │ │ ├── OverloadPolicy.java
│ │ │ │ │ └── PriorityRunnable.java
│ │ │ │ └── rxjava
│ │ │ │ │ └── RxManager.java
│ │ │ │ ├── http
│ │ │ │ ├── impl
│ │ │ │ │ └── IRetrofit.java
│ │ │ │ └── BaseRestClient.java
│ │ │ │ └── widget
│ │ │ │ ├── pullloadmorerecyclerview
│ │ │ │ └── SwipeRefreshLayoutOnRefresh.java
│ │ │ │ ├── NoScrollGridView.java
│ │ │ │ └── NoScrollListview.java
│ │ ├── res
│ │ │ ├── layout
│ │ │ │ ├── empty_layout.xml
│ │ │ │ └── pull_loadmore_layout.xml
│ │ │ └── values
│ │ │ │ └── strings.xml
│ │ └── AndroidManifest.xml
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── android
│ │ └── base
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── AndroidTest
├── .gitignore
├── assets
│ └── test.jpg
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── guide_1.png
│ │ │ │ ├── guide_2.png
│ │ │ │ ├── guide_3.png
│ │ │ │ ├── guide_4.png
│ │ │ │ ├── login_fanhui.png
│ │ │ │ ├── login_miam.png
│ │ │ │ ├── login_dengluhao.png
│ │ │ │ ├── login_yanzhengma.png
│ │ │ │ └── login_zaicishurumima.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_delete.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_game_detail.png
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── error_photo.png
│ │ │ │ ├── go_top_icon.png
│ │ │ │ ├── login_miam.png
│ │ │ │ ├── daili_yuanquan.png
│ │ │ │ ├── login_fanhui.png
│ │ │ │ ├── point_focused.png
│ │ │ │ ├── daili_xuanzhong.png
│ │ │ │ ├── default_head_pic.jpg
│ │ │ │ ├── login_dengluhao.png
│ │ │ │ ├── login_yanzhengma.png
│ │ │ │ ├── point_unfocused.png
│ │ │ │ ├── wode_weixinzhifu.png
│ │ │ │ ├── wode_zijin_dise.png
│ │ │ │ ├── widget_bar_me_nor.png
│ │ │ │ ├── widget_bar_me_over.png
│ │ │ │ ├── widget_bar_news_nor.png
│ │ │ │ ├── wode_zhifubaozhifu.png
│ │ │ │ ├── yidengl_jjtx_icon.png
│ │ │ │ ├── yidengl_liszj_icon.png
│ │ │ │ ├── yidengl_shez_icon.png
│ │ │ │ ├── yidengl_shouc_icon.png
│ │ │ │ ├── yidengl_yijfk_icon.png
│ │ │ │ ├── yidengl_yonghm_bg.png
│ │ │ │ ├── yidengl_yonghm_icon.png
│ │ │ │ ├── default_viewpager_pic.png
│ │ │ │ ├── login_zaicishurumima.png
│ │ │ │ ├── widget_bar_news_over.png
│ │ │ │ ├── widget_bar_tweet_nor.png
│ │ │ │ ├── widget_bar_tweet_over.png
│ │ │ │ ├── yidengl_lianxwm_icon.png
│ │ │ │ ├── item_waterfall_icon_good.png
│ │ │ │ ├── item_waterfall_icon_star.png
│ │ │ │ ├── widget_bar_explore_nor.png
│ │ │ │ ├── widget_bar_explore_over.png
│ │ │ │ ├── drawer_menu_icon_blog_nor.png
│ │ │ │ ├── drawer_menu_icon_quest_nor.png
│ │ │ │ ├── drawer_menu_icon_gitapp_nor.png
│ │ │ │ ├── drawer_menu_icon_opensoft_nor.png
│ │ │ │ └── item_waterfall_icon_comments.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── login_miam.png
│ │ │ │ ├── login_dengluhao.png
│ │ │ │ ├── login_yanzhengma.png
│ │ │ │ ├── tuijian_rexiaopin.png
│ │ │ │ ├── tuijian_touxiang6.png
│ │ │ │ ├── btn_quickoption_nor.png
│ │ │ │ ├── login_zaicishurumima.png
│ │ │ │ ├── tuijian_xinpintuijia.png
│ │ │ │ ├── btn_quickoption_pressed.png
│ │ │ │ ├── tuijian_pinpaituijian.png
│ │ │ │ └── tuijian_dailishangpaihangbang.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── layout
│ │ │ │ ├── activity_test_zhihu_main.xml
│ │ │ │ ├── item_recyclerview_list.xml
│ │ │ │ ├── activity_test_recyclerview.xml
│ │ │ │ ├── layout_loading.xml
│ │ │ │ ├── layout_empty.xml
│ │ │ │ ├── item_default_loading.xml
│ │ │ │ ├── activity_test_ormlite.xml
│ │ │ │ ├── layout_error.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── fragment_test_retrofit.xml
│ │ │ │ ├── activity_test_retrofit.xml
│ │ │ │ └── base_nav_content.xml
│ │ │ ├── drawable
│ │ │ │ ├── selector_banner_point2.xml
│ │ │ │ ├── selector_btn_stroke_orange.xml
│ │ │ │ ├── shape_edit_stroke.xml
│ │ │ │ ├── btn_quickoption_selector.xml
│ │ │ │ ├── shape_btn_edge_orange.xml
│ │ │ │ ├── shape_btn_edge_orange_pre.xml
│ │ │ │ ├── divider_bg.xml
│ │ │ │ ├── tab_icon_me.xml
│ │ │ │ ├── tab_icon_new.xml
│ │ │ │ ├── tab_icon_tweet.xml
│ │ │ │ ├── tab_icon_explore.xml
│ │ │ │ ├── selector_banner_point1.xml
│ │ │ │ ├── selector_btn_orange.xml
│ │ │ │ └── selector_pay_radio.xml
│ │ │ ├── color
│ │ │ │ └── tab_primarybar_txt.xml
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-v21
│ │ │ │ └── styles.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ └── menu
│ │ │ │ ├── menu_main.xml
│ │ │ │ ├── menu_sample.xml
│ │ │ │ └── menu_zhihu_nav.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── hwm
│ │ │ │ └── test
│ │ │ │ ├── http
│ │ │ │ ├── model
│ │ │ │ │ ├── entity
│ │ │ │ │ │ ├── ThemeDetail.java
│ │ │ │ │ │ ├── AllThemes.java
│ │ │ │ │ │ ├── ThemeItem.java
│ │ │ │ │ │ ├── StartInfo.java
│ │ │ │ │ │ ├── NewsDetail.java
│ │ │ │ │ │ ├── News.java
│ │ │ │ │ │ └── TopStories.java
│ │ │ │ │ ├── http
│ │ │ │ │ │ ├── ApiConstant.java
│ │ │ │ │ │ ├── GeyeService.java
│ │ │ │ │ │ ├── GeyeClient.java
│ │ │ │ │ │ ├── ZhihuClient.java
│ │ │ │ │ │ ├── RetrofitServiceFactory.java
│ │ │ │ │ │ └── ZhihuService.java
│ │ │ │ │ └── RetrofitModel.java
│ │ │ │ └── presenter
│ │ │ │ │ ├── RetrofitContract.java
│ │ │ │ │ └── RetrofitPresenter.java
│ │ │ │ ├── db
│ │ │ │ ├── model
│ │ │ │ │ ├── dao
│ │ │ │ │ │ ├── CityDao.java
│ │ │ │ │ │ ├── DeptDao.java
│ │ │ │ │ │ └── UserDao.java
│ │ │ │ │ ├── IOrmLiteTask.java
│ │ │ │ │ ├── entity
│ │ │ │ │ │ ├── Dept.java
│ │ │ │ │ │ ├── User.java
│ │ │ │ │ │ └── City.java
│ │ │ │ │ └── DatabaseHelper.java
│ │ │ │ ├── presenter
│ │ │ │ │ ├── OrmLiteContract.java
│ │ │ │ │ └── OrmLitePresenter.java
│ │ │ │ ├── view
│ │ │ │ │ └── OrmLiteFragment.java
│ │ │ │ └── OrmLiteActivity.java
│ │ │ │ ├── recyclerview
│ │ │ │ ├── adapter
│ │ │ │ │ └── RecyclerViewAdapter.java
│ │ │ │ ├── HeaderWrapper.java
│ │ │ │ └── LoadMoreFooter.java
│ │ │ │ ├── MyApplication.java
│ │ │ │ └── MainActivity.java
│ │ └── AndroidManifest.xml
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── android
│ │ └── test
│ │ └── ApplicationTest.java
├── proguard-rules.pro
└── build.gradle
├── AndroidWidget
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── banner_ids.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── pull_refresh_ids.xml
│ │ │ │ ├── pull_refresh_dimens.xml
│ │ │ │ ├── pull_refresh_strings.xml
│ │ │ │ ├── attrs.xml
│ │ │ │ └── banner_attrs.xml
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── default_ptr_flip.png
│ │ │ │ ├── indicator_arrow.png
│ │ │ │ └── default_ptr_rotate.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── default_ptr_flip.png
│ │ │ │ ├── indicator_arrow.png
│ │ │ │ └── default_ptr_rotate.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── default_ptr_flip.png
│ │ │ │ ├── indicator_arrow.png
│ │ │ │ └── default_ptr_rotate.png
│ │ │ ├── drawable
│ │ │ │ ├── background_tab.xml
│ │ │ │ ├── selector_basebanner_point.xml
│ │ │ │ ├── indicator_bg_top.xml
│ │ │ │ └── indicator_bg_bottom.xml
│ │ │ ├── anim
│ │ │ │ ├── slide_in_from_bottom.xml
│ │ │ │ ├── slide_in_from_top.xml
│ │ │ │ ├── slide_out_to_bottom.xml
│ │ │ │ └── slide_out_to_top.xml
│ │ │ └── layout
│ │ │ │ ├── pull_to_refresh_header_horizontal.xml
│ │ │ │ └── pull_to_refresh_header_vertical.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── android
│ │ │ └── base
│ │ │ └── widget
│ │ │ ├── pulltorefresh
│ │ │ ├── internal
│ │ │ │ ├── Utils.java
│ │ │ │ ├── EmptyViewMethodAccessor.java
│ │ │ │ └── ViewCompat.java
│ │ │ ├── ILoadingLayout.java
│ │ │ ├── LoadingLayoutProxy.java
│ │ │ ├── PullToRefreshViewPager.java
│ │ │ └── PullToRefreshRecyclerView.java
│ │ │ ├── banner
│ │ │ ├── transformer
│ │ │ │ ├── DefaultPageTransformer.java
│ │ │ │ ├── StackPageTransformer.java
│ │ │ │ ├── AccordionPageTransformer.java
│ │ │ │ ├── FadePageTransformer.java
│ │ │ │ ├── AlphaPageTransformer.java
│ │ │ │ ├── BGAPageTransformer.java
│ │ │ │ ├── ZoomFadePageTransformer.java
│ │ │ │ ├── FlipPageTransformer.java
│ │ │ │ ├── RotatePageTransformer.java
│ │ │ │ ├── DepthPageTransformer.java
│ │ │ │ ├── CubePageTransformer.java
│ │ │ │ ├── ZoomCenterPageTransformer.java
│ │ │ │ ├── ZoomStackPageTransformer.java
│ │ │ │ └── ZoomPageTransformer.java
│ │ │ └── PageChangeDurationScroller.java
│ │ │ ├── recyclerview
│ │ │ ├── HeaderSpanSizeLookup.java
│ │ │ └── layoutmanager
│ │ │ │ └── ExStaggeredGridLayoutManager.java
│ │ │ └── DynamicHeightImageView.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── android
│ │ └── base
│ │ └── widget
│ │ └── ApplicationTest.java
├── build.gradle
└── proguard-rules.pro
├── settings.gradle
├── huangwm.keystore
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── README.md
├── gradle.properties
├── MyAndroidBase.iml
├── .gitignore
└── gradlew.bat
/.idea/.name:
--------------------------------------------------------------------------------
1 | AndroidBase
--------------------------------------------------------------------------------
/AndroidBase/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/AndroidTest/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/AndroidWidget/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':AndroidBase', ':AndroidWidget', ':AndroidTest'
2 |
--------------------------------------------------------------------------------
/huangwm.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/huangwm.keystore
--------------------------------------------------------------------------------
/AndroidTest/assets/test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/assets/test.jpg
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/guide_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/guide_1.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/guide_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/guide_2.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/guide_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/guide_3.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/guide_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/guide_4.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-xxhdpi/ic_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-xxhdpi/ic_delete.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/error_photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/error_photo.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/go_top_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/go_top_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/login_miam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/login_miam.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/login_miam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/login_miam.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/daili_yuanquan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/daili_yuanquan.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/login_fanhui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/login_fanhui.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/point_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/point_focused.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/login_fanhui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/login_fanhui.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/login_miam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/login_miam.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-xxhdpi/ic_game_detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-xxhdpi/ic_game_detail.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/daili_xuanzhong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/daili_xuanzhong.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/default_head_pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/default_head_pic.jpg
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/login_dengluhao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/login_dengluhao.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/login_yanzhengma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/login_yanzhengma.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/point_unfocused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/point_unfocused.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/wode_weixinzhifu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/wode_weixinzhifu.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/wode_zijin_dise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/wode_zijin_dise.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/login_dengluhao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/login_dengluhao.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/banner_ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6633B5E5
4 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_me_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_me_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_me_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_me_over.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_news_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_news_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/wode_zhifubaozhifu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/wode_zhifubaozhifu.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_jjtx_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_jjtx_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_liszj_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_liszj_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_shez_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_shez_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_shouc_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_shouc_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_yijfk_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_yijfk_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_yonghm_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_yonghm_bg.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_yonghm_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_yonghm_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/login_yanzhengma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/login_yanzhengma.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/tuijian_rexiaopin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/tuijian_rexiaopin.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/tuijian_touxiang6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/tuijian_touxiang6.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/login_dengluhao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/login_dengluhao.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/login_yanzhengma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/login_yanzhengma.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-hdpi/default_ptr_flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-hdpi/default_ptr_flip.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-hdpi/indicator_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-hdpi/indicator_arrow.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-mdpi/default_ptr_flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-mdpi/default_ptr_flip.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-mdpi/indicator_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-mdpi/indicator_arrow.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-xhdpi/default_ptr_flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-xhdpi/default_ptr_flip.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-xhdpi/indicator_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-xhdpi/indicator_arrow.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/default_viewpager_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/default_viewpager_pic.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/login_zaicishurumima.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/login_zaicishurumima.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_news_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_news_over.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_tweet_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_tweet_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_tweet_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_tweet_over.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/yidengl_lianxwm_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/yidengl_lianxwm_icon.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/btn_quickoption_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/btn_quickoption_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/login_zaicishurumima.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/login_zaicishurumima.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/tuijian_xinpintuijia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/tuijian_xinpintuijia.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-hdpi/default_ptr_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-hdpi/default_ptr_rotate.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-mdpi/default_ptr_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-mdpi/default_ptr_rotate.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable-xhdpi/default_ptr_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidWidget/src/main/res/drawable-xhdpi/default_ptr_rotate.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/item_waterfall_icon_good.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/item_waterfall_icon_good.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/item_waterfall_icon_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/item_waterfall_icon_star.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_explore_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_explore_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/widget_bar_explore_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/widget_bar_explore_over.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/btn_quickoption_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/btn_quickoption_pressed.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/tuijian_pinpaituijian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/tuijian_pinpaituijian.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xxhdpi/login_zaicishurumima.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xxhdpi/login_zaicishurumima.png
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidWidget
3 | Unknown error
4 |
5 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_blog_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_blog_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_quest_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_quest_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_gitapp_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_gitapp_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_opensoft_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/drawer_menu_icon_opensoft_nor.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-hdpi/item_waterfall_icon_comments.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-hdpi/item_waterfall_icon_comments.png
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable-xhdpi/tuijian_dailishangpaihangbang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huangwm1984/AndroidBase/HEAD/AndroidTest/src/main/res/drawable-xhdpi/tuijian_dailishangpaihangbang.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/ThemeDetail.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | /**
4 | * Created by Administrator on 2016/5/23.
5 | */
6 | public class ThemeDetail {
7 |
8 |
9 |
10 |
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/db/impl/DbCallBack.java:
--------------------------------------------------------------------------------
1 | package com.android.base.db.impl;
2 |
3 | /**
4 | * 数据库操作回调
5 | */
6 | public interface DbCallBack {
7 |
8 | void onComplete(Object data);
9 |
10 | void onError(Object errorMsg);
11 | }
12 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Sep 20 15:32:18 CST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/factory/PresenterFactory.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter.factory;
2 |
3 |
4 | import com.android.base.frame.presenter.XPresenter;
5 |
6 | public interface PresenterFactory
{
7 | P createPresenter();
8 | }
9 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/res/layout/empty_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/activity_test_zhihu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/selector_banner_point2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/db/impl/DaoOperation.java:
--------------------------------------------------------------------------------
1 | package com.android.base.db.impl;
2 |
3 |
4 | public interface DaoOperation {
5 |
6 | int INSERT = 1;
7 | int DELETE = 2;
8 | int UPDATE = 3;
9 | int SELECT = 4;
10 | int INSERT_BATCH = 5;
11 | int DELETE_BATCH = 6;
12 | int UPDATE_BATCH = 7;
13 | }
14 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/adapter/MultiItemTypeSupport.java:
--------------------------------------------------------------------------------
1 | package com.android.base.util.adapter;
2 |
3 | /**
4 | * Created by Administrator on 2016/9/22.
5 | */
6 | public interface MultiItemTypeSupport {
7 |
8 | int getLayoutId(int viewType);
9 |
10 | int getItemViewType(int position, T t);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/color/tab_primarybar_txt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 10dp
7 |
8 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/pull_refresh_ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/selector_btn_stroke_orange.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 | >
2 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/http/ApiConstant.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.http;
2 |
3 | /**
4 | * Created by Administrator on 2016/4/27.
5 | */
6 | public class ApiConstant {
7 |
8 | public static final String BASE_ZHIHU_URL = "http://news-at.zhihu.com/";
9 |
10 | public static final String BASE_GEYE_URL = "http://110.84.128.74:8081/geyeapi/";
11 | }
12 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/shape_edit_stroke.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/http/impl/IRetrofit.java:
--------------------------------------------------------------------------------
1 | package com.android.base.http.impl;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Created by Administrator on 2016/4/29.
7 | */
8 | public interface IRetrofit {
9 |
10 | void attachBaseUrl(Context context, String baseUrl);
11 |
12 | T createService(Class clz);
13 |
14 | void destory();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/btn_quickoption_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/shape_btn_edge_orange.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 采用谷歌官方MVP架构以及RxJava对项目进行封装重构,持续更新中...
2 |
3 | 1.网络请求框架:Retrofit
4 |
5 | 2.View依赖注入框架:ButterKnife
6 |
7 | 3.数据库框架:Ormlite
8 |
9 | 4.图片异步加载类库:Glide
10 |
11 | 5.事件总线:RxEventbus
12 |
13 | 6.Json解析工具:FastJson
14 |
15 | 7.ListView、GridView、RecyclerView快速开发适配器
16 |
17 | 8.GooleSamples 对 Android 6.0 Permission 封装 EasyPermissions
18 |
19 | 9.收集的各种便捷开发的工具类
20 |
21 | 最后感谢 github 上大神的开源框架和开源精神 (●'◡'●)ノ♥
22 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/shape_btn_edge_orange_pre.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/item_recyclerview_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/divider_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/pull_refresh_dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 10dp
5 | 12dp
6 | 4dp
7 | 24dp
8 | 12dp
9 |
10 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/impl/PresenterLifecycleImpl.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter.impl;
2 |
3 | /**
4 | * Created by Administrator on 2016/9/19.
5 | */
6 | public interface PresenterLifecycleImpl {
7 |
8 | void onCreated(Object view);
9 |
10 | void onStart();
11 |
12 | void onResume();
13 |
14 | void onPause();
15 |
16 | void onStop();
17 |
18 | void onDestroy();
19 | }
20 |
--------------------------------------------------------------------------------
/AndroidBase/src/androidTest/java/com/android/base/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.android.base;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/AndroidTest/src/androidTest/java/com/android/test/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.android.test;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/AndroidWidget/src/androidTest/java/com/android/base/widget/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/internal/Utils.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.pulltorefresh.internal;
2 |
3 | import android.util.Log;
4 |
5 | public class Utils {
6 |
7 | static final String LOG_TAG = "PullToRefresh";
8 |
9 | public static void warnDeprecation(String depreacted, String replacement) {
10 | Log.w(LOG_TAG, "You're using the deprecated " + depreacted + " attr, please switch over to " + replacement);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable/background_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/tab_icon_me.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/tab_icon_new.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/tab_icon_tweet.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/tab_icon_explore.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/activity_test_recyclerview.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/http/GeyeService.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.http;
2 |
3 | import com.hwm.test.http.model.entity.Geye;
4 |
5 | import retrofit2.http.Field;
6 | import retrofit2.http.FormUrlEncoded;
7 | import retrofit2.http.POST;
8 | import rx.Observable;
9 |
10 | /**
11 | * Created by huangwm on 2016/4/30.
12 | */
13 | public interface GeyeService {
14 |
15 | @FormUrlEncoded
16 | @POST("geye/getRtsp")
17 | Observable getGeyeData(@Field("geyeId") String geyeId, @Field("isNeedff") String isNeedff);
18 | }
19 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/layout_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/selector_banner_point1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/selector_btn_orange.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AndroidWidget/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 15
9 | targetSdkVersion 23
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(include: ['*.jar'], dir: 'libs')
23 | compile project(':AndroidBase')
24 | }
25 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable/selector_basebanner_point.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/db/CollectionUtil.java:
--------------------------------------------------------------------------------
1 | package com.android.base.db;
2 |
3 | import java.util.List;
4 |
5 | public class CollectionUtil {
6 |
7 | /**
8 | * 集合中是否存在指定元素
9 | *
10 | * @param value 指定字符
11 | * @param list 集合
12 | * @return
13 | */
14 | public static boolean existValue(String value, List list) {
15 | if (list == null || value == null) {
16 | return false;
17 | }
18 | for (String str : list) {
19 | if (value.equals(str)) {
20 | return true;
21 | }
22 | }
23 | return false;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/DefaultPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * 作者:王浩 邮件:bingoogolapple@gmail.com
7 | * 创建时间:15/6/19 上午8:41
8 | * 描述:
9 | */
10 | public class DefaultPageTransformer extends BGAPageTransformer {
11 |
12 | @Override
13 | public void handleInvisiblePage(View view, float position) {
14 | }
15 |
16 | @Override
17 | public void handleLeftPage(View view, float position) {
18 | }
19 |
20 | @Override
21 | public void handleRightPage(View view, float position) {
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/AllThemes.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | import java.util.Arrays;
4 |
5 | /**
6 | * Created by Administrator on 2016/5/23.
7 | */
8 | public class AllThemes {
9 |
10 | public int limit;
11 |
12 | public Object[] subscribed;
13 |
14 | public ThemeItem[] others;
15 |
16 | public String toString() {
17 | return "GetAllThemesResponse{" +
18 | "limit=" + limit +
19 | ", subscribed=" + Arrays.toString(subscribed) +
20 | ", others=" + Arrays.toString(others) +
21 | "} " + super.toString();
22 | }
23 |
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable/indicator_bg_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
17 |
18 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/drawable/indicator_bg_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/ThemeItem.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | /**
4 | * Created by Administrator on 2016/5/23.
5 | */
6 | public class ThemeItem {
7 |
8 | public int id;
9 |
10 | public String name;
11 |
12 | public String thumbnail;
13 |
14 | public String description;
15 |
16 | public int color;
17 |
18 | public String toString() {
19 | return "ThemeItem{" +
20 | "id=" + id +
21 | ", name='" + name + '\'' +
22 | ", thumbnail='" + thumbnail + '\'' +
23 | ", description='" + description + '\'' +
24 | ", color=" + color +
25 | '}';
26 | }
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/dao/CityDao.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db.model.dao;
3 |
4 | import android.content.Context;
5 |
6 | import com.android.base.db.BaseRxDao;
7 | import com.hwm.test.db.model.DatabaseHelper;
8 | import com.hwm.test.db.model.entity.City;
9 | import com.j256.ormlite.dao.Dao;
10 |
11 | */
12 | /**
13 | * Created by Administrator on 2016/5/5.
14 | *//*
15 |
16 | public class CityDao extends BaseRxDao {
17 |
18 | public CityDao(Context context, Class cls) {
19 | super(context, cls);
20 | }
21 |
22 | @Override
23 | public Dao getOrmLiteDao(Context context) {
24 | return DatabaseHelper.getInstance(context).getDao(City.class);
25 | }
26 | }
27 | */
28 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/dao/DeptDao.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db.model.dao;
3 |
4 | import android.content.Context;
5 |
6 | import com.android.base.db.BaseRxDao;
7 | import com.hwm.test.db.model.DatabaseHelper;
8 | import com.hwm.test.db.model.entity.Dept;
9 | import com.j256.ormlite.dao.Dao;
10 |
11 | */
12 | /**
13 | * Created by Administrator on 2016/5/5.
14 | *//*
15 |
16 | public class DeptDao extends BaseRxDao {
17 |
18 | public DeptDao(Context context, Class cls) {
19 | super(context, cls);
20 | }
21 |
22 | @Override
23 | public Dao getOrmLiteDao(Context context) {
24 | return DatabaseHelper.getInstance(context).getDao(Dept.class);
25 | }
26 | }
27 | */
28 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/dao/UserDao.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db.model.dao;
3 |
4 | import android.content.Context;
5 |
6 | import com.android.base.db.BaseRxDao;
7 | import com.hwm.test.db.model.DatabaseHelper;
8 | import com.hwm.test.db.model.entity.User;
9 | import com.j256.ormlite.dao.Dao;
10 |
11 | */
12 | /**
13 | * Created by Administrator on 2016/5/5.
14 | *//*
15 |
16 | public class UserDao extends BaseRxDao{
17 |
18 |
19 | public UserDao(Context context, Class cls) {
20 | super(context, cls);
21 | }
22 |
23 | @Override
24 | public Dao getOrmLiteDao(Context context) {
25 | return DatabaseHelper.getInstance(context).getDao(User.class);
26 | }
27 | }
28 | */
29 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/layout_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/pull_refresh_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 下拉刷新…
4 | 放开以刷新…
5 | 正在载入…
6 |
7 |
8 | @string/pull_to_refresh_pull_label
9 | @string/pull_to_refresh_release_label
10 | @string/pull_to_refresh_refreshing_label
11 |
12 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/item_default_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
21 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/IOrmLiteTask.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.db.model;
2 |
3 | /**
4 | * Created by Administrator on 2016/5/5.
5 | */
6 | public interface IOrmLiteTask {
7 |
8 | void testSave();
9 |
10 | void testInsert();
11 |
12 | void testUpdate();
13 |
14 | void testUpdateColumn();
15 |
16 | void testQueryAll();
17 |
18 | void testQueryByWhere();
19 |
20 | void testQueryByID();
21 |
22 | void testQueryAnyUwant();
23 |
24 | void testMapping();
25 |
26 | void testDelete();
27 |
28 | void testDeleteByIndex();
29 |
30 | void testDeleteByWhereBuilder();
31 |
32 | void testDeleteAll();
33 |
34 | void testLargeScaleUseLite();
35 |
36 | void testLargeScaleUseSystem();
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/StackPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class StackPageTransformer extends BGAPageTransformer {
13 |
14 | @Override
15 | public void handleInvisiblePage(View view, float position) {
16 | }
17 |
18 | @Override
19 | public void handleLeftPage(View view, float position) {
20 | }
21 |
22 | @Override
23 | public void handleRightPage(View view, float position) {
24 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/AndroidBase/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 D:\Development\adt-bundle-windows-x86-20140702\adt-bundle-windows-x86-20140702\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 |
--------------------------------------------------------------------------------
/AndroidTest/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 D:\Development\adt-bundle-windows-x86-20140702\adt-bundle-windows-x86-20140702\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 |
--------------------------------------------------------------------------------
/AndroidWidget/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 D:\Development\adt-bundle-windows-x86-20140702\adt-bundle-windows-x86-20140702\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 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/activity_test_ormlite.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/drawable/selector_pay_radio.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/ParcelFn.java:
--------------------------------------------------------------------------------
1 | package com.android.base.util;
2 |
3 | import android.os.Parcel;
4 |
5 | public class ParcelFn {
6 |
7 | private static final ClassLoader CLASS_LOADER = ParcelFn.class.getClassLoader();
8 |
9 | public static T unmarshall(byte[] array) {
10 | Parcel parcel = Parcel.obtain();
11 | parcel.unmarshall(array, 0, array.length);
12 | parcel.setDataPosition(0);
13 | Object value = parcel.readValue(CLASS_LOADER);
14 | parcel.recycle();
15 | return (T)value;
16 | }
17 |
18 | public static byte[] marshall(Object o) {
19 | Parcel parcel = Parcel.obtain();
20 | parcel.writeValue(o);
21 | byte[] result = parcel.marshall();
22 | parcel.recycle();
23 | return result;
24 | }
25 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/StartInfo.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | /**
4 | * Created by Administrator on 2016/5/20.
5 | */
6 | public class StartInfo {
7 |
8 | public String text;
9 |
10 | public String img;
11 |
12 | public String getText() {
13 | return text;
14 | }
15 |
16 | public String getImg() {
17 | return img;
18 | }
19 |
20 | public void setText(String text) {
21 | this.text = text;
22 | }
23 |
24 | public void setImg(String img) {
25 | this.img = img;
26 | }
27 |
28 | public String toString() {
29 | return "StartInfoResponse{" +
30 | "text='" + text + '\'' +
31 | ", img='" + img + '\'' +
32 | "} " + super.toString();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/layout_error.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/http/GeyeClient.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.http;
2 |
3 | import com.android.base.frame.Base;
4 | import com.android.base.http.BaseRestClient;
5 |
6 | /**
7 | * Created by huangwm on 2016/4/30.
8 | */
9 | public class GeyeClient extends BaseRestClient{
10 |
11 | private static GeyeClient mInstance;
12 |
13 | public static GeyeClient getInstance(String baseUrl) {
14 | if (mInstance == null) {
15 | synchronized (ZhihuClient.class) {
16 | if (mInstance == null) {
17 | mInstance = new GeyeClient(baseUrl);
18 | }
19 | }
20 | }
21 | return mInstance;
22 | }
23 |
24 | public GeyeClient(String baseUrl){
25 | attachBaseUrl(Base.getContext(), baseUrl);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/PageChangeDurationScroller.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner;
2 |
3 | import android.content.Context;
4 | import android.widget.Scroller;
5 |
6 | /**
7 | * 作者:王浩 邮件:bingoogolapple@gmail.com
8 | * 创建时间:15/6/19 下午11:59
9 | * 描述:
10 | */
11 | public class PageChangeDurationScroller extends Scroller {
12 | private int mDuration = 1000;
13 |
14 | public PageChangeDurationScroller(Context context) {
15 | super(context);
16 | }
17 |
18 | public PageChangeDurationScroller(Context context, int duration) {
19 | super(context);
20 | mDuration = duration;
21 | }
22 |
23 | @Override
24 | public void startScroll(int startX, int startY, int dx, int dy, int duration) {
25 | super.startScroll(startX, startY, dx, dy, mDuration);
26 | }
27 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/http/ZhihuClient.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.http;
2 |
3 |
4 | import com.android.base.frame.Base;
5 | import com.android.base.http.BaseRestClient;
6 |
7 | /**
8 | * Created by Administrator on 2016/4/29.
9 | */
10 | public class ZhihuClient extends BaseRestClient {
11 |
12 | private static ZhihuClient mInstance;
13 |
14 | public static ZhihuClient getInstance(String baseUrl) {
15 | if (mInstance == null) {
16 | synchronized (ZhihuClient.class) {
17 | if (mInstance == null) {
18 | mInstance = new ZhihuClient(baseUrl);
19 | }
20 | }
21 | }
22 | return mInstance;
23 | }
24 |
25 | public ZhihuClient(String baseUrl){
26 | attachBaseUrl(Base.getContext(), baseUrl);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/recyclerview/adapter/RecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.recyclerview.adapter;
2 |
3 | import android.content.Context;
4 | import android.widget.TextView;
5 |
6 | import com.android.base.util.adapter.CommonRcvAdapter;
7 | import com.android.base.util.adapter.CommonViewHolder;
8 | import com.hwm.test.R;
9 |
10 | /**
11 | * Created by Administrator on 2016/9/23.
12 | */
13 |
14 | public class RecyclerViewAdapter extends CommonRcvAdapter {
15 |
16 | public RecyclerViewAdapter(Context context, int layoutResId) {
17 | super(context, layoutResId);
18 | }
19 |
20 | @Override
21 | protected void convert(CommonViewHolder viewHolder, String item, int position) {
22 | TextView textView = viewHolder.findView(R.id.id_item_list_title);
23 | textView.setText(item);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/widget/pullloadmorerecyclerview/SwipeRefreshLayoutOnRefresh.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.pullloadmorerecyclerview;
2 |
3 | import android.support.v4.widget.SwipeRefreshLayout;
4 |
5 | /**
6 | * Created by Administrator on 2016/9/23.
7 | */
8 | public class SwipeRefreshLayoutOnRefresh implements SwipeRefreshLayout.OnRefreshListener {
9 | private PullLoadMoreRecyclerView mPullLoadMoreRecyclerView;
10 |
11 | public SwipeRefreshLayoutOnRefresh(PullLoadMoreRecyclerView pullLoadMoreRecyclerView) {
12 | this.mPullLoadMoreRecyclerView = pullLoadMoreRecyclerView;
13 | }
14 |
15 | @Override
16 | public void onRefresh() {
17 | if (!mPullLoadMoreRecyclerView.isRefresh()) {
18 | mPullLoadMoreRecyclerView.setIsRefresh(true);
19 | mPullLoadMoreRecyclerView.refresh();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test;
2 |
3 | import android.app.Application;
4 |
5 | import com.android.base.frame.Base;
6 | import com.apkfuns.logutils.LogLevel;
7 | import com.apkfuns.logutils.LogUtils;
8 |
9 | /**
10 | * Created by Administrator on 2016/4/27.
11 | */
12 | public class MyApplication extends Application {
13 |
14 | @Override
15 | public void onCreate() {
16 | super.onCreate();
17 | Base.initialize(this);
18 | initLogUtils();
19 | }
20 |
21 | private void initLogUtils() {
22 | LogUtils.getLogConfig()
23 | .configAllowLog(true) //是否允许日志输出
24 | .configTagPrefix("AndroidTest") //日志log的前缀
25 | .configShowBorders(true) //是否显示边界
26 | .configLevel(LogLevel.TYPE_VERBOSE); //日志显示等级
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/thread/SchedulePolicy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 litesuits.com
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 | package com.android.base.util.thread;
17 |
18 | /**
19 | * @author MaTianyu
20 | * @date 2015-04-23
21 | */
22 | public enum SchedulePolicy {
23 | LastInFirstRun,
24 | FirstInFistRun
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/AccordionPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class AccordionPageTransformer extends BGAPageTransformer {
13 |
14 | @Override
15 | public void handleInvisiblePage(View view, float position) {
16 | }
17 |
18 | @Override
19 | public void handleLeftPage(View view, float position) {
20 | ViewHelper.setPivotX(view, view.getWidth());
21 | ViewHelper.setScaleX(view, 1.0f + position);
22 | }
23 |
24 | @Override
25 | public void handleRightPage(View view, float position) {
26 | ViewHelper.setPivotX(view, 0);
27 | ViewHelper.setScaleX(view, 1.0f - position);
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/menu/menu_sample.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
9 |
10 |
14 |
15 |
19 |
20 |
24 |
25 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/recyclerview/HeaderSpanSizeLookup.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.recyclerview;
2 |
3 | import android.support.v7.widget.GridLayoutManager;
4 |
5 | /**
6 | * Created by cundong on 2015/10/23.
7 | *
8 | * RecyclerView为GridLayoutManager时,设置了HeaderView,就会用到这个SpanSizeLookup
9 | */
10 | public class HeaderSpanSizeLookup extends GridLayoutManager.SpanSizeLookup {
11 |
12 | private HeaderAndFooterRecyclerViewAdapter adapter;
13 | private int mSpanSize = 1;
14 |
15 | public HeaderSpanSizeLookup(HeaderAndFooterRecyclerViewAdapter adapter, int spanSize) {
16 | this.adapter = adapter;
17 | this.mSpanSize = spanSize;
18 | }
19 |
20 | @Override
21 | public int getSpanSize(int position) {
22 | boolean isHeaderOrFooter = adapter.isHeader(position) || adapter.isFooter(position);
23 | return isHeaderOrFooter ? mSpanSize : 1;
24 | }
25 | }
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/FadePageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class FadePageTransformer extends BGAPageTransformer {
13 |
14 | @Override
15 | public void handleInvisiblePage(View view, float position) {
16 | }
17 |
18 | @Override
19 | public void handleLeftPage(View view, float position) {
20 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
21 | ViewHelper.setAlpha(view, 1 + position);
22 | }
23 |
24 | @Override
25 | public void handleRightPage(View view, float position) {
26 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
27 | ViewHelper.setAlpha(view, 1 - position);
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/widget/NoScrollGridView.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.GridView;
6 |
7 | /**
8 | * GridView嵌套在SrcollView中会出现显示不全的情况
9 | *
10 | * 这个类通过设置不滚动来避免
11 | *
12 | */
13 |
14 | public class NoScrollGridView extends GridView {
15 | public NoScrollGridView(Context context) {
16 | super(context);
17 | }
18 |
19 | public NoScrollGridView(Context context, AttributeSet attrs) {
20 | super(context, attrs);
21 | }
22 |
23 | public NoScrollGridView(Context context, AttributeSet attrs, int defStyle) {
24 | super(context, attrs, defStyle);
25 | }
26 |
27 | /**
28 | * 设置不滚动
29 | */
30 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
31 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
32 | MeasureSpec.AT_MOST);
33 | super.onMeasure(widthMeasureSpec, expandSpec);
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/anim/slide_in_from_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/anim/slide_in_from_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/anim/slide_out_to_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/anim/slide_out_to_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/MyAndroidBase.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/thread/OverloadPolicy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 litesuits.com
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 | package com.android.base.util.thread;
17 |
18 | /**
19 | * Policy of thread-pool-executor overload.
20 | *
21 | * @author MaTianyu
22 | * @date 2015-04-23
23 | */
24 | public enum OverloadPolicy {
25 | DiscardNewTaskInQueue,
26 | DiscardOldTaskInQueue,
27 | DiscardCurrentTask,
28 | CallerRuns,
29 | ThrowExecption
30 | }
31 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/presenter/RetrofitContract.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.presenter;
2 |
3 | import com.android.base.frame.presenter.XPresenter;
4 | import com.hwm.test.http.model.entity.Geye;
5 | import com.hwm.test.http.model.entity.News;
6 |
7 | import rx.Observable;
8 |
9 | /**
10 | * Created by Administrator on 2016/4/27.
11 | */
12 | public interface RetrofitContract {
13 |
14 | interface Model{
15 | Observable loadLastestNewsData();
16 | Observable loadGeyeData(String geyeId, String isNeedff);
17 | }
18 |
19 | interface View {
20 |
21 | void showLoadingView();
22 |
23 | void showEmptyView();
24 |
25 | void showErrorView();
26 |
27 | void showContentView();
28 |
29 | void loadSuccessMessage(Object o);
30 |
31 | }
32 |
33 | abstract class Presenter extends XPresenter {
34 |
35 | public abstract void loadLastestNewsData();
36 |
37 | public abstract void loadGeyeData(String geyeId, String isNeedff);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/widget/NoScrollListview.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ListView;
6 |
7 |
8 | /**
9 | * Listview嵌套在SrcollView中会出现显示不全的情况
10 | *
11 | * 这个类通过设置不滚动来避免
12 | *
13 | */
14 | public class NoScrollListview extends ListView {
15 |
16 | public NoScrollListview(Context context) {
17 | super(context);
18 | }
19 |
20 | public NoScrollListview(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | public NoScrollListview(Context context, AttributeSet attrs, int defStyle) {
25 | super(context, attrs, defStyle);
26 | }
27 |
28 | @Override
29 | /**
30 | * 重写该方法,达到使ListView适应ScrollView的效果
31 | */
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
34 | MeasureSpec.AT_MOST);
35 | super.onMeasure(widthMeasureSpec, expandSpec);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/.idea/gradle.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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # [Android] ========================
2 | # Built application files
3 | *.apk
4 | *.ap_
5 |
6 | # Files for the Dalvik VM
7 | *.dex
8 |
9 | # Java class files
10 | *.class
11 |
12 | # Generated files
13 | bin/
14 | gen/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 | /*/build/
20 |
21 | # Cache of project
22 | .gradletasknamecache
23 |
24 | # Ignore Gradle GUI config
25 | gradle-app.setting
26 |
27 | # Local configuration file (sdk path, etc)
28 | local.properties
29 |
30 | # Proguard folder generated by Eclipse
31 | proguard/
32 |
33 | # Log Files
34 | *.log
35 |
36 | ## Directory-based project format:
37 | .idea/
38 |
39 | ## Plugin-specific files:
40 |
41 | # IntelliJ
42 | out/
43 |
44 | # mpeltonen/sbt-idea plugin
45 | .idea_modules/
46 |
47 | # JIRA plugin
48 | atlassian-ide-plugin.xml
49 |
50 |
51 | # [Maven] ========================
52 | target/
53 | pom.xml.tag
54 | pom.xml.releaseBackup
55 | pom.xml.versionsBackup
56 | pom.xml.next
57 | #release.properties
58 |
59 |
60 | # Misc
61 | /.idea/workspace.xml
62 | /.idea/libraries
63 | .DS_Store
64 | /captures
65 | **/*.iml
66 | *.class
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/db/ColumnStruct.java:
--------------------------------------------------------------------------------
1 | package com.android.base.db;
2 |
3 | /**
4 | * 数据库表中列的结构
5 | */
6 | public class ColumnStruct {
7 |
8 | public String columnName;
9 | public String columnLimit;
10 |
11 | public ColumnStruct() {
12 | }
13 |
14 | public ColumnStruct(String columnName, String columnLimit) {
15 | this.columnName = columnName;
16 | this.columnLimit = columnLimit;
17 | }
18 |
19 | public String getColumnName() {
20 | return columnName;
21 | }
22 |
23 | public void setColumnName(String columnName) {
24 | this.columnName = columnName;
25 | }
26 |
27 | public String getColumnLimit() {
28 | return columnLimit;
29 | }
30 |
31 | public void setColumnLimit(String columnLimit) {
32 | this.columnLimit = columnLimit;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return "ColumnStruct{" +
38 | "columnName='" + columnName + '\'' +
39 | ", columnLimit='" + columnLimit + '\'' +
40 | '}';
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/XPresenter.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter;
2 |
3 | import com.android.base.util.rxjava.RxManager;
4 | import com.android.base.util.rxjava.RxUtil;
5 |
6 | import rx.subscriptions.CompositeSubscription;
7 |
8 | /**
9 | * Created by Administrator on 2016/9/19.
10 | */
11 | public class XPresenter extends BasePresenter {
12 |
13 | public V view;
14 | public CompositeSubscription compositeSubscription;
15 | public RxManager rxManager = new RxManager();
16 |
17 | /**
18 | * Presenter初始化
19 | */
20 | public void onCreated() {
21 | this.compositeSubscription = RxUtil.getNewCompositeSubIfUnsubscribed(compositeSubscription);
22 | view = getView();
23 | }
24 |
25 | /**
26 | * Presenter开始工作
27 | */
28 | public void start(){}
29 |
30 | @Override
31 | public void onDestroy() {
32 | super.onDestroy();
33 | if(rxManager!=null){
34 | rxManager.clear();
35 | }
36 | RxUtil.unsubscribeIfNotNull(compositeSubscription);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/entity/Dept.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.db.model.entity;
2 |
3 |
4 | import com.j256.ormlite.dao.ForeignCollection;
5 | import com.j256.ormlite.field.DatabaseField;
6 | import com.j256.ormlite.field.ForeignCollectionField;
7 | import com.j256.ormlite.table.DatabaseTable;
8 |
9 | /**
10 | * 部门(这里假设一个用户只对应一个部门,而一个部门对应着多个用户,即一对多的关系)
11 | * Created by Administrator on 2016/5/5.
12 | */
13 | @DatabaseTable(tableName="tb_dept")
14 | public class Dept {
15 | //部门编号
16 | @DatabaseField(generatedId=true)
17 | private int deptId;
18 | //部门名称
19 | @DatabaseField
20 | private String deptName;
21 |
22 | /**
23 | * 这里需要注意的是:属性类型只能是ForeignCollection或者Collection
24 | * 如果需要懒加载(延迟加载)可以在@ForeignCollectionField加上参数eager=false
25 | * 这个属性也就说明一个部门对应着多个用户
26 | */
27 | //用户信息集合
28 | @ForeignCollectionField
29 | private ForeignCollection users;
30 |
31 | public Dept(){
32 |
33 | }
34 |
35 | public Dept(int deptId,String deptName){
36 | this.deptId = deptId;
37 | this.deptName = deptName;
38 | }
39 |
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/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 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/presenter/OrmLiteContract.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db.presenter;
3 |
4 | import com.android.base.basic.IBasePresenter;
5 | import com.android.base.basic.BaseView;
6 |
7 | */
8 | /**
9 | * Created by Administrator on 2016/5/5.
10 | *//*
11 |
12 | public interface OrmLiteContract {
13 |
14 | interface View extends BaseView {
15 |
16 | void loadErrorMessage(Object o);
17 |
18 | void loadSuccessMessage(Object o);
19 |
20 | boolean isActive();
21 |
22 | }
23 |
24 | interface Presenter extends IBasePresenter {
25 |
26 | void Save();
27 |
28 | void Insert();
29 |
30 | void Update();
31 |
32 | void UpdateColumn();
33 |
34 | void QueryAll();
35 |
36 | void QueryByWhere();
37 |
38 | void QueryByID();
39 |
40 | void QueryAnyUwant();
41 |
42 | void Mapping();
43 |
44 | void Delete();
45 |
46 | void DeleteByIndex();
47 |
48 | void DeleteByWhereBuilder();
49 |
50 | void DeleteAll();
51 |
52 | void LargeScaleUseLite();
53 |
54 | void LargeScaleUseSystem();
55 | }
56 | }
57 | */
58 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/res/layout/pull_loadmore_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
24 |
25 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/entity/User.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.db.model.entity;
2 |
3 | import com.j256.ormlite.field.DatabaseField;
4 | import com.j256.ormlite.table.DatabaseTable;
5 |
6 | import java.util.Date;
7 |
8 | /**
9 | * 用户类
10 | * Created by Administrator on 2016/5/5.
11 | */
12 | @DatabaseTable(tableName = "tb_user")
13 | public class User {
14 | //用户编号
15 | @DatabaseField(generatedId=true)
16 | private int userId;
17 | //用户名
18 | @DatabaseField
19 | private String userName;
20 | //密码
21 | @DatabaseField
22 | private int age;
23 | //入职时间
24 | @DatabaseField(format="DATE_STRING")
25 | private Date date;
26 | //用户所属部门
27 | /**
28 | * foreign = true:说明这是一个外部引用关系
29 | * foreignAutoRefresh = true:当对象被查询时,外部属性自动刷新(暂时我也没看懂其作用)
30 | *
31 | */
32 | @DatabaseField(foreign = true,foreignAutoRefresh = true)
33 | private Dept dept;
34 |
35 | public User() {
36 | //提供无参构造函数,这样查询的时候可以返回查询出来的对象
37 | }
38 |
39 | public User( int userId,String userName, int age) {
40 | this.userId = userId;
41 | this.userName = userName;
42 | this.age = age;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/ViewWithPresenter.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame;
2 |
3 | import com.android.base.frame.presenter.XPresenter;
4 | import com.android.base.frame.presenter.factory.PresenterFactory;
5 |
6 | /**
7 | * Created by Administrator on 2016/9/19.
8 | */
9 | public interface ViewWithPresenter {
10 |
11 | /**
12 | * Returns a current presenter factory.
13 | */
14 | PresenterFactory
getPresenterFactory();
15 |
16 | /**
17 | * Sets a presenter factory.
18 | * Call this method before onCreate/onFinishInflate to override default {#@link ReflectionPresenterFactory} presenter factory.
19 | * Use this method for presenter dependency injection.
20 | */
21 | void setPresenterFactory(PresenterFactory
presenterFactory);
22 |
23 | /**
24 | * Returns a current attached presenter.
25 | * This method is guaranteed to return a non-null value between
26 | * onResume/onPause and onAttachedToWindow/onDetachedFromWindow calls
27 | * if the presenter factory returns a non-null value.
28 | *
29 | * @return a currently attached presenter or null.
30 | */
31 | P getPresenter();
32 | }
33 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter;
2 |
3 | import java.util.concurrent.CopyOnWriteArrayList;
4 |
5 | /**
6 | * Created by Administrator on 2016/9/19.
7 | */
8 | public class BasePresenter{
9 |
10 | private V view;
11 |
12 | private CopyOnWriteArrayList onDestroyListeners = new CopyOnWriteArrayList<>();
13 |
14 | public void onAttachView(V view) {}
15 |
16 | public void onResume() {}
17 |
18 | public void onPause() {}
19 |
20 | public void onDestroy() {
21 | destroy();
22 | }
23 |
24 | public V getView() {
25 | return view;
26 | }
27 |
28 | public void attachView(V view) {
29 | this.view = view;
30 | onAttachView(view);
31 | }
32 |
33 | public interface OnDestroyListener {
34 | void onDestroy();
35 | }
36 |
37 | public void addOnDestroyListener(OnDestroyListener listener) {
38 | onDestroyListeners.add(listener);
39 | }
40 |
41 | public void destroy() {
42 | for (OnDestroyListener listener : onDestroyListeners) {
43 | listener.onDestroy();
44 | }
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/thread/PriorityRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 litesuits.com
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 | package com.android.base.util.thread;
17 |
18 | /**
19 | * @author MaTianyu
20 | * @date 2015-04-23
21 | */
22 | public abstract class PriorityRunnable implements Runnable {
23 |
24 | int priority;
25 |
26 | protected PriorityRunnable(int priority) {
27 | this.priority = priority;
28 | }
29 |
30 | public int getPriority() {
31 | return priority;
32 | }
33 |
34 | public void setPriority(int priority) {
35 | this.priority = priority;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/NewsDetail.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | import java.util.Arrays;
4 |
5 | /**
6 | * Created by Administrator on 2016/5/23.
7 | */
8 | public class NewsDetail {
9 |
10 | public int id;
11 |
12 | public int type;
13 |
14 | public String title;
15 |
16 | public String image;
17 |
18 | public String imageSource;
19 |
20 | public String body;
21 |
22 | public String shareUrl;
23 |
24 | public String[] css;
25 |
26 | public String[] js;
27 |
28 | public String gaPrefix;
29 |
30 | public String toString() {
31 | return "GetNewsResponse{" +
32 | "id=" + id +
33 | ", type=" + type +
34 | ", title='" + title + '\'' +
35 | ", image='" + image + '\'' +
36 | ", imageSource='" + imageSource + '\'' +
37 | ", body='" + body + '\'' +
38 | ", shareUrl='" + shareUrl + '\'' +
39 | ", css=" + Arrays.toString(css) +
40 | ", js=" + Arrays.toString(js) +
41 | ", gaPrefix='" + gaPrefix + '\'' +
42 | "} " + super.toString();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 | #999999
8 | #000000
9 | #FFFFFF
10 |
11 | #009688
12 | #00796B
13 | #FD87A9
14 |
15 | #f44336
16 | #d32f2f
17 | #4caf50
18 | #388e3c
19 |
20 | @color/colorPrimary
21 |
22 | #ff6600
23 | #c8580d
24 | #d7d7d7
25 | #c9c9c9
26 | #c3c3c3
27 | #666666
28 | #f31216
29 | #f3f3f3
30 |
31 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidBase
3 |
4 |
5 | - %d 秒前
6 | - %d 秒前
7 |
8 |
9 | - %d 分钟前
10 | - %d 分钟前
11 |
12 |
13 | - %d 小时前
14 | - %d 小时前
15 |
16 |
17 | - %d 天前
18 | - %d 天前
19 |
20 |
21 | - %d 周前
22 | - %d 周前
23 |
24 |
25 | - %d 月前
26 | - %d 月前
27 |
28 |
29 | - %d 年前
30 | - %d 年前
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/AlphaPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class AlphaPageTransformer extends BGAPageTransformer {
13 | private float mMinScale = 0.4f;
14 |
15 | public AlphaPageTransformer() {
16 | }
17 |
18 | public AlphaPageTransformer(float minScale) {
19 | setMinScale(minScale);
20 | }
21 |
22 | @Override
23 | public void handleInvisiblePage(View view, float position) {
24 | ViewHelper.setAlpha(view, 0);
25 | }
26 |
27 | @Override
28 | public void handleLeftPage(View view, float position) {
29 | ViewHelper.setAlpha(view, mMinScale + (1 - mMinScale) * (1 + position));
30 | }
31 |
32 | @Override
33 | public void handleRightPage(View view, float position) {
34 | ViewHelper.setAlpha(view, mMinScale + (1 - mMinScale) * (1 - position));
35 | }
36 |
37 | public void setMinScale(float minScale) {
38 | if (minScale >= 0.0f && minScale <= 1.0f) {
39 | mMinScale = minScale;
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/view/OrmLiteFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db.view;
3 |
4 | import android.os.Bundle;
5 | import android.view.View;
6 |
7 | import com.android.base.basic.BaseFragment;
8 | import com.hwm.test.db.presenter.OrmLiteContract;
9 |
10 | */
11 | /**
12 | * Created by Administrator on 2016/5/5.
13 | *//*
14 |
15 | public class OrmLiteFragment extends BaseFragment implements OrmLiteContract.View {
16 |
17 | public static OrmLiteFragment newInstance() {
18 | return new OrmLiteFragment();
19 | }
20 |
21 | @Override
22 | protected int setContentViewId() {
23 | return 0;
24 | }
25 |
26 | @Override
27 | protected void onFragmentViewCreated(View view, Bundle savedInstanceState) {
28 |
29 | }
30 |
31 | @Override
32 | protected void onFragmentActivityCreated(Bundle savedInstanceState) {
33 |
34 | }
35 |
36 | @Override
37 | public void loadErrorMessage(Object o) {
38 |
39 | }
40 |
41 | @Override
42 | public void loadSuccessMessage(Object o) {
43 |
44 | }
45 |
46 | @Override
47 | public boolean isActive() {
48 | return false;
49 | }
50 |
51 | @Override
52 | public void setPresenter(OrmLiteContract.Presenter presenter) {
53 |
54 | }
55 | }
56 | */
57 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/layout/pull_to_refresh_header_horizontal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
18 |
19 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/factory/RequiresPresenter.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter.factory;
2 |
3 | import com.android.base.frame.presenter.XPresenter;
4 |
5 | import java.lang.annotation.Inherited;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /*
10 | @Target 说明了Annotation所修饰的对象范围。
11 | @Retention 定义了该Annotation被保留的时间长短
12 | @Documented 用于描述该注解将被包含在javadoc中
13 | @Inherited 用于描述子类可以继承父类中的该注解
14 | */
15 |
16 | /*
17 | @Target(ElementType.TYPE) //接口、类、枚举、注解
18 | @Target(ElementType.FIELD) //字段、枚举的常量
19 | @Target(ElementType.METHOD) //方法
20 | @Target(ElementType.PARAMETER) //方法参数
21 | @Target(ElementType.CONSTRUCTOR) //构造函数
22 | @Target(ElementType.LOCAL_VARIABLE)//局部变量
23 | @Target(ElementType.ANNOTATION_TYPE)//注解
24 | @Target(ElementType.PACKAGE) ///包
25 | */
26 |
27 | /*
28 | @Retention(RetentionPolicy.SOURCE) //注解仅存在于源码中,在class字节码文件中不包含
29 | @Retention(RetentionPolicy.CLASS) // 默认的保留策略,注解会在class字节码文件中存在,但运行时无法获得,
30 | @Retention(RetentionPolicy.RUNTIME) // 注解会在class字节码文件中存在,在运行时可以通过反射获取到
31 | */
32 |
33 | @Inherited
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface RequiresPresenter {
36 | Class extends XPresenter> value();
37 | }
38 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/http/RetrofitServiceFactory.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.http;
2 |
3 |
4 | import java.util.concurrent.ConcurrentHashMap;
5 |
6 | /**
7 | * Created by Administrator on 2016/4/27.
8 | */
9 | public class RetrofitServiceFactory {
10 |
11 | private static ConcurrentHashMap mService = new ConcurrentHashMap();
12 |
13 |
14 | public static ZhihuService provideZhihuService() {
15 | return provideService(ApiConstant.BASE_ZHIHU_URL, ZhihuService.class);
16 | }
17 |
18 | public static GeyeService provideGeyeService() {
19 | return provideService(ApiConstant.BASE_GEYE_URL, GeyeService.class);
20 | }
21 |
22 | public static T provideService(String baseUrl, Class cls) {
23 | Object o = mService.get(cls);
24 | if (o == null) {
25 | o = mService.get(cls);
26 | if (o == null) {
27 | if(baseUrl.equals(ApiConstant.BASE_ZHIHU_URL)){
28 | o = ZhihuClient.getInstance(baseUrl).createService(cls);
29 | }else if(baseUrl.equals(ApiConstant.BASE_GEYE_URL)){
30 | o = GeyeClient.getInstance(baseUrl).createService(cls);
31 | }
32 | mService.put(cls, o);
33 | }
34 | }
35 | return (T) o;
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/BGAPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.support.v4.view.ViewPager;
4 | import android.view.View;
5 |
6 | /**
7 | * 作者:王浩 邮件:bingoogolapple@gmail.com
8 | * 创建时间:15/6/19 14:35
9 | * 描述:
10 | */
11 | public abstract class BGAPageTransformer implements ViewPager.PageTransformer {
12 |
13 | public void transformPage(View view, float position) {
14 | if (position < -1.0f) {
15 | // [-Infinity,-1)
16 | // This page is way off-screen to the left.
17 | handleInvisiblePage(view, position);
18 | } else if (position <= 0.0f) {
19 | // [-1,0]
20 | // Use the default slide transition when moving to the left page
21 | handleLeftPage(view, position);
22 | } else if (position <= 1.0f) {
23 | // (0,1]
24 | handleRightPage(view, position);
25 | } else {
26 | // (1,+Infinity]
27 | // This page is way off-screen to the right.
28 | handleInvisiblePage(view, position);
29 | }
30 | }
31 |
32 | public abstract void handleInvisiblePage(View view, float position);
33 |
34 | public abstract void handleLeftPage(View view, float position);
35 |
36 | public abstract void handleRightPage(View view, float position);
37 |
38 | }
--------------------------------------------------------------------------------
/AndroidTest/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.hwm.test"
9 | minSdkVersion 15
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | //配置keystore签名
15 | signingConfigs {
16 | release {
17 | storeFile file('../huangwm.keystore')
18 | storePassword "123456"
19 | keyAlias "huangwm"
20 | keyPassword "123456"
21 | }
22 | }
23 | buildTypes {
24 | debug {
25 | signingConfig signingConfigs.release
26 | }
27 | release {
28 | minifyEnabled false
29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
30 | signingConfig signingConfigs.release
31 | }
32 | }
33 | sourceSets {
34 | main {
35 | assets.srcDirs = ['assets']
36 | jniLibs.srcDirs = ['libs']
37 | }
38 | }
39 | }
40 |
41 | dependencies {
42 | compile fileTree(include: ['*.jar'], dir: 'libs')
43 | compile project(':AndroidBase')
44 | compile project(':AndroidWidget')
45 | //debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
46 | //releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
47 | }
48 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/ZoomFadePageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class ZoomFadePageTransformer extends BGAPageTransformer {
13 |
14 | @Override
15 | public void handleInvisiblePage(View view, float position) {
16 | }
17 |
18 | @Override
19 | public void handleLeftPage(View view, float position) {
20 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
21 |
22 | ViewHelper.setPivotX(view,view.getWidth() * 0.5f);
23 | ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
24 | ViewHelper.setScaleX(view, 1 + position);
25 | ViewHelper.setScaleY(view, 1 + position);
26 |
27 | ViewHelper.setAlpha(view, 1 + position);
28 | }
29 |
30 | @Override
31 | public void handleRightPage(View view, float position) {
32 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
33 |
34 | ViewHelper.setPivotX(view,view.getWidth() * 0.5f);
35 | ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
36 | ViewHelper.setScaleX(view, 1 - position);
37 | ViewHelper.setScaleY(view, 1 - position);
38 | ViewHelper.setAlpha(view, 1 - position);
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/DatabaseHelper.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.db.model;
2 |
3 | import android.content.Context;
4 |
5 | import com.android.base.db.BaseOrmLiteDatabaseHelper;
6 | import com.hwm.test.db.model.entity.City;
7 | import com.hwm.test.db.model.entity.Dept;
8 | import com.hwm.test.db.model.entity.User;
9 |
10 | /**
11 | * ormlite操作数据库Helper
12 | */
13 | public class DatabaseHelper extends BaseOrmLiteDatabaseHelper {
14 |
15 | /**
16 | * 数据库名称
17 | */
18 | private static final String DATABASE_NAME = "TestDB.db";
19 |
20 | /**
21 | * 数据库版本号
22 | */
23 | private static final int DATABASE_VERSION = 1;
24 |
25 | private static DatabaseHelper sInstance;
26 |
27 | private DatabaseHelper(Context context) {
28 | super(context, DATABASE_NAME, null, DATABASE_VERSION);
29 | addTable();
30 | }
31 |
32 | public static DatabaseHelper getInstance(Context context) {
33 | if (sInstance == null) {
34 | synchronized (DatabaseHelper.class) {
35 | if (sInstance == null) {
36 | sInstance = new DatabaseHelper(context);
37 | }
38 | }
39 | }
40 | return sInstance;
41 | }
42 |
43 | /**
44 | * 注册数据表
45 | */
46 | private void addTable() {
47 | registerTable(User.class);
48 | registerTable(Dept.class);
49 | registerTable(City.class);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/FlipPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class FlipPageTransformer extends BGAPageTransformer {
13 | private static final float ROTATION = 180.0f;
14 |
15 | @Override
16 | public void handleInvisiblePage(View view, float position) {
17 | }
18 |
19 | @Override
20 | public void handleLeftPage(View view, float position) {
21 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
22 | float rotation = (ROTATION * position);
23 | ViewHelper.setRotationY(view, rotation);
24 |
25 | if (position > -0.5) {
26 | view.setVisibility(View.VISIBLE);
27 | } else {
28 | view.setVisibility(View.INVISIBLE);
29 | }
30 | }
31 |
32 | @Override
33 | public void handleRightPage(View view, float position) {
34 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
35 | float rotation = (ROTATION * position);
36 | ViewHelper.setRotationY(view, rotation);
37 |
38 | if (position < 0.5) {
39 | view.setVisibility(View.VISIBLE);
40 | } else {
41 | view.setVisibility(View.INVISIBLE);
42 | }
43 | }
44 |
45 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/fragment_test_retrofit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
20 |
21 |
26 |
27 |
28 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/adapter/CommonViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.android.base.util.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.SparseArray;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | /**
11 | * Created by Administrator on 2016/9/22.
12 | */
13 | public class CommonViewHolder extends RecyclerView.ViewHolder {
14 |
15 | private SparseArray views;
16 |
17 | public CommonViewHolder(View itemView) {
18 | super(itemView);
19 | this.views = new SparseArray<>();
20 | }
21 |
22 | public static CommonViewHolder createViewHolder(View itemView) {
23 | CommonViewHolder holder = new CommonViewHolder(itemView);
24 | return holder;
25 | }
26 |
27 | public static CommonViewHolder createViewHolder(Context context, ViewGroup parent, int layoutId) {
28 | View itemView = LayoutInflater.from(context).inflate(layoutId, parent, false);
29 | CommonViewHolder holder = new CommonViewHolder(itemView);
30 | return holder;
31 | }
32 |
33 | @SuppressWarnings("unchecked")
34 | public T findView(int viewId) {
35 | View view = views.get(viewId);
36 | if (view == null) {
37 | view = itemView.findViewById(viewId);
38 | views.put(viewId, view);
39 | }
40 | return (T) view;
41 | }
42 |
43 | public View getRootView() {
44 | return itemView;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/RotatePageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class RotatePageTransformer extends BGAPageTransformer {
13 | private float mMaxRotation = 15.0f;
14 |
15 | public RotatePageTransformer() {
16 | }
17 |
18 | public RotatePageTransformer(float maxRotation) {
19 | setMaxRotation(maxRotation);
20 | }
21 |
22 | @Override
23 | public void handleInvisiblePage(View view, float position) {
24 | ViewHelper.setPivotX(view, view.getMeasuredWidth() * 0.5f);
25 | ViewHelper.setPivotY(view, view.getMeasuredHeight());
26 | ViewHelper.setRotation(view, 0);
27 | }
28 |
29 | @Override
30 | public void handleLeftPage(View view, float position) {
31 | float rotation = (mMaxRotation * position);
32 | ViewHelper.setPivotX(view, view.getMeasuredWidth() * 0.5f);
33 | ViewHelper.setPivotY(view, view.getMeasuredHeight());
34 | ViewHelper.setRotation(view, rotation);
35 | }
36 |
37 | @Override
38 | public void handleRightPage(View view, float position) {
39 | handleLeftPage(view, position);
40 | }
41 |
42 | public void setMaxRotation(float maxRotation) {
43 | if (maxRotation >= 0.0f && maxRotation <= 40.0f) {
44 | mMaxRotation = maxRotation;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/recyclerview/HeaderWrapper.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.recyclerview;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.AttributeSet;
6 | import android.view.Gravity;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.LinearLayout;
10 |
11 | /**
12 | * Created by Administrator on 2016/9/27.
13 | */
14 |
15 | public class HeaderWrapper extends LinearLayout {
16 |
17 | private LinearLayout mContainer;
18 |
19 |
20 | public HeaderWrapper(Context context) {
21 | super(context);
22 | initView();
23 | }
24 |
25 | public HeaderWrapper(Context context, AttributeSet attrs) {
26 | super(context, attrs);
27 | initView();
28 | }
29 |
30 | private void initView() {
31 | setGravity(Gravity.CENTER);
32 | setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
33 |
34 | mContainer = new LinearLayout(getContext());
35 | mContainer.setGravity(Gravity.CENTER);
36 | mContainer.setOrientation(VERTICAL);
37 | addView(mContainer, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
38 | }
39 |
40 | public void addView(View view){
41 | mContainer.addView(view);
42 | }
43 |
44 | public void setVisibility(int visiblity){
45 | super.setVisibility(visiblity);
46 | mContainer.setVisibility(visiblity);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/DepthPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class DepthPageTransformer extends BGAPageTransformer {
13 | private float mMinScale = 0.8f;
14 |
15 | public DepthPageTransformer() {
16 | }
17 |
18 | public DepthPageTransformer(float minScale) {
19 | setMinScale(minScale);
20 | }
21 |
22 | @Override
23 | public void handleInvisiblePage(View view, float position) {
24 | ViewHelper.setAlpha(view, 0);
25 | }
26 |
27 | @Override
28 | public void handleLeftPage(View view, float position) {
29 | ViewHelper.setAlpha(view, 1);
30 | ViewHelper.setTranslationX(view, 0);
31 | ViewHelper.setScaleX(view, 1);
32 | ViewHelper.setScaleY(view, 1);
33 | }
34 |
35 | @Override
36 | public void handleRightPage(View view, float position) {
37 | ViewHelper.setAlpha(view, 1 - position);
38 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
39 | float scale = mMinScale + (1 - mMinScale) * (1 - position);
40 | ViewHelper.setScaleX(view, scale);
41 | ViewHelper.setScaleY(view, scale);
42 | }
43 |
44 | public void setMinScale(float minScale) {
45 | if (minScale >= 0.6f && minScale <= 1.0f) {
46 | mMinScale = minScale;
47 | }
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/OrmLiteActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db;
3 |
4 | import android.os.Bundle;
5 | import android.view.MenuItem;
6 |
7 | import com.android.base.basic.Base;
8 | import com.android.base.basic.BaseActivity;
9 | import com.hwm.test.R;
10 | import com.hwm.test.db.model.OrmLiteTask;
11 | import com.hwm.test.db.presenter.OrmLitePresenter;
12 | import com.hwm.test.db.view.OrmLiteFragment;
13 |
14 | */
15 | /**
16 | * Created by Administrator on 2016/5/5.
17 | *//*
18 |
19 | public class OrmLiteActivity extends BaseActivity {
20 |
21 | @Override
22 | public int setContentViewId() {
23 | return R.layout.activity_test_ormlite;
24 | }
25 |
26 | @Override
27 | public void onActivityCreated(Bundle savedInstanceState) {
28 |
29 | getSupportActionBar().setTitle("OrmLite测试");
30 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
31 |
32 | if (savedInstanceState == null) {
33 | OrmLiteFragment ormLiteFragment = OrmLiteFragment.newInstance();
34 | start(ormLiteFragment);
35 | new OrmLitePresenter(OrmLiteTask.getInstance(Base.getContext()), ormLiteFragment);
36 | }
37 |
38 | }
39 |
40 | @Override
41 | protected int setContainerId() {
42 | return 0;
43 | }
44 |
45 | @Override
46 | public boolean onOptionsItemSelected(MenuItem item) {
47 | if (item.getItemId() == android.R.id.home) {
48 | finish();
49 | return true;
50 | }
51 | return super.onOptionsItemSelected(item);
52 | }
53 | }
54 | */
55 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/internal/EmptyViewMethodAccessor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2011, 2012 Chris Banes.
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 | package com.android.base.widget.pulltorefresh.internal;
17 |
18 | import android.view.View;
19 |
20 | /**
21 | * Interface that allows PullToRefreshBase to hijack the call to
22 | * AdapterView.setEmptyView()
23 | *
24 | * @author chris
25 | */
26 | public interface EmptyViewMethodAccessor {
27 |
28 | /**
29 | * Calls upto AdapterView.setEmptyView()
30 | *
31 | * @param emptyView - to set as Empty View
32 | */
33 | public void setEmptyViewInternal(View emptyView);
34 |
35 | /**
36 | * Should call PullToRefreshBase.setEmptyView() which will then
37 | * automatically call through to setEmptyViewInternal()
38 | *
39 | * @param emptyView - to set as Empty View
40 | */
41 | public void setEmptyView(View emptyView);
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/menu/menu_zhihu_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
13 |
17 |
18 |
19 |
20 | -
21 |
22 |
26 |
27 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
41 |
42 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/CubePageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 17:39
10 | * 描述:
11 | */
12 | public class CubePageTransformer extends BGAPageTransformer {
13 | private float mMaxRotation = 90.0f;
14 |
15 | public CubePageTransformer() {
16 | }
17 |
18 | public CubePageTransformer(float maxRotation) {
19 | setMaxRotation(maxRotation);
20 | }
21 |
22 | @Override
23 | public void handleInvisiblePage(View view, float position) {
24 | ViewHelper.setPivotX(view, view.getMeasuredWidth());
25 | ViewHelper.setPivotY(view, view.getMeasuredHeight() * 0.5f);
26 | ViewHelper.setRotationY(view, 0);
27 | }
28 |
29 | @Override
30 | public void handleLeftPage(View view, float position) {
31 | ViewHelper.setPivotX(view, view.getMeasuredWidth());
32 | ViewHelper.setPivotY(view, view.getMeasuredHeight() * 0.5f);
33 | ViewHelper.setRotationY(view, mMaxRotation * position);
34 | }
35 |
36 | @Override
37 | public void handleRightPage(View view, float position) {
38 | ViewHelper.setPivotX(view, 0);
39 | ViewHelper.setPivotY(view, view.getMeasuredHeight() * 0.5f);
40 | ViewHelper.setRotationY(view, mMaxRotation * position);
41 | }
42 |
43 | public void setMaxRotation(float maxRotation) {
44 | if (maxRotation >= 0.0f && maxRotation <= 90.0f) {
45 | mMaxRotation = maxRotation;
46 | }
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/RetrofitModel.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model;
2 |
3 | import com.android.base.util.rxjava.RxUtil;
4 | import com.hwm.test.http.model.entity.Geye;
5 | import com.hwm.test.http.model.entity.News;
6 | import com.hwm.test.http.model.http.GeyeService;
7 | import com.hwm.test.http.model.http.RetrofitServiceFactory;
8 | import com.hwm.test.http.model.http.ZhihuService;
9 | import com.hwm.test.http.presenter.RetrofitContract;
10 |
11 | import rx.Observable;
12 |
13 | /**
14 | * Created by Administrator on 2016/4/27.
15 | */
16 | public class RetrofitModel implements RetrofitContract.Model {
17 |
18 | private static RetrofitModel sInstance;
19 | private ZhihuService mZhihuService;
20 | private GeyeService mGeyeService;
21 |
22 | public static RetrofitModel getInstance() {
23 | if (sInstance == null) {
24 | synchronized (RetrofitModel.class) {
25 | if (sInstance == null) {
26 | sInstance = new RetrofitModel();
27 | }
28 | }
29 | }
30 | return sInstance;
31 | }
32 |
33 | @Override
34 | public Observable loadLastestNewsData() {
35 | mZhihuService = RetrofitServiceFactory.provideZhihuService();
36 | return mZhihuService.getLastestNews().compose(RxUtil.applySchedulersForRetrofit());
37 | }
38 |
39 | @Override
40 | public Observable loadGeyeData(String geyeId, String isNeedff) {
41 | mGeyeService = RetrofitServiceFactory.provideGeyeService();
42 | return mGeyeService.getGeyeData(geyeId, isNeedff).compose(RxUtil.applySchedulersForRetrofit());
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/ZoomCenterPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class ZoomCenterPageTransformer extends BGAPageTransformer {
13 |
14 | @Override
15 | public void handleInvisiblePage(View view, float position) {
16 | }
17 |
18 | @Override
19 | public void handleLeftPage(View view, float position) {
20 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
21 |
22 | ViewHelper.setPivotX(view, view.getWidth() * 0.5f);
23 | ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
24 | ViewHelper.setScaleX(view, 1 + position);
25 | ViewHelper.setScaleY(view, 1 + position);
26 |
27 | if (position < -0.95f) {
28 | ViewHelper.setAlpha(view, 0);
29 | } else {
30 | ViewHelper.setAlpha(view, 1);
31 | }
32 | }
33 |
34 | @Override
35 | public void handleRightPage(View view, float position) {
36 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
37 |
38 | ViewHelper.setPivotX(view, view.getWidth() * 0.5f);
39 | ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
40 | ViewHelper.setScaleX(view, 1 - position);
41 | ViewHelper.setScaleY(view, 1 - position);
42 |
43 | if (position > 0.95f) {
44 | ViewHelper.setAlpha(view, 0);
45 | } else {
46 | ViewHelper.setAlpha(view, 1);
47 | }
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/ZoomStackPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class ZoomStackPageTransformer extends BGAPageTransformer {
13 |
14 | @Override
15 | public void handleInvisiblePage(View view, float position) {
16 | }
17 |
18 | @Override
19 | public void handleLeftPage(View view, float position) {
20 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
21 |
22 | ViewHelper.setPivotX(view, view.getWidth() * 0.5f);
23 | ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
24 | ViewHelper.setScaleX(view, 1 + position);
25 | ViewHelper.setScaleY(view, 1 + position);
26 |
27 | if (position < -0.95f) {
28 | ViewHelper.setAlpha(view, 0);
29 | } else {
30 | ViewHelper.setAlpha(view, 1);
31 | }
32 | }
33 |
34 | @Override
35 | public void handleRightPage(View view, float position) {
36 | ViewHelper.setTranslationX(view, -view.getWidth() * position);
37 |
38 | ViewHelper.setPivotX(view, view.getWidth() * 0.5f);
39 | ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
40 | ViewHelper.setScaleX(view, 1 + position);
41 | ViewHelper.setScaleY(view, 1 + position);
42 |
43 | if (position > 0.95f) {
44 | ViewHelper.setAlpha(view, 0);
45 | } else {
46 | ViewHelper.setAlpha(view, 1);
47 | }
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/DynamicHeightImageView.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ImageView;
6 |
7 | /**
8 | * Created by Administrator on 2015/11/16 0016.
9 | */
10 | public class DynamicHeightImageView extends ImageView {
11 |
12 | private double mHeightRatio;
13 |
14 | public DynamicHeightImageView(Context context) {
15 | super(context);
16 | }
17 |
18 | public DynamicHeightImageView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | }
21 |
22 | public DynamicHeightImageView(Context context, AttributeSet attrs, int defStyleAttr) {
23 | super(context, attrs, defStyleAttr);
24 | }
25 |
26 | public DynamicHeightImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
27 | super(context, attrs, defStyleAttr, defStyleRes);
28 | }
29 |
30 | public void setHeightRatio(double ratio) {
31 | if (ratio != mHeightRatio) {
32 | mHeightRatio = ratio;
33 | requestLayout();
34 | }
35 | }
36 |
37 | public double getHeightRatio() {
38 | return mHeightRatio;
39 | }
40 |
41 | @Override
42 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
43 | if (mHeightRatio > 0.0) {
44 | // set the image views size
45 | int width = MeasureSpec.getSize(widthMeasureSpec);
46 | int height = (int) (width * mHeightRatio);
47 | setMeasuredDimension(width, height);
48 | } else {
49 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/factory/ReflectionPresenterFactory.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter.factory;
2 |
3 | import android.support.annotation.Nullable;
4 |
5 | import com.android.base.frame.presenter.XPresenter;
6 |
7 | /**
8 | * This class represents a {@link PresenterFactory} that creates a presenter using {@link Class#newInstance()} method.
9 | *
10 | * @param the type of the presenter.
11 | */
12 | public class ReflectionPresenterFactory
implements PresenterFactory
{
13 |
14 | private Class
presenterClass;
15 |
16 | /**
17 | * This method returns a {@link ReflectionPresenterFactory} instance if a given view class has
18 | * a {@link RequiresPresenter} annotation, or null otherwise.
19 | *
20 | * @param viewClass a class of the view
21 | * @param
a type of the presenter
22 | * @return a {@link ReflectionPresenterFactory} instance that is supposed to create a presenter from {@link RequiresPresenter} annotation.
23 | */
24 | @Nullable
25 | public static
ReflectionPresenterFactory
fromViewClass(Class> viewClass) {
26 | RequiresPresenter annotation = viewClass.getAnnotation(RequiresPresenter.class);
27 | //noinspection unchecked
28 | Class
presenterClass = annotation == null ? null : (Class
)annotation.value();
29 | return presenterClass == null ? null : new ReflectionPresenterFactory<>(presenterClass);
30 | }
31 |
32 | public ReflectionPresenterFactory(Class
presenterClass) {
33 | this.presenterClass = presenterClass;
34 | }
35 |
36 | @Override
37 | public P createPresenter() {
38 | try {
39 | return presenterClass.newInstance();
40 | }
41 | catch (Exception e) {
42 | throw new RuntimeException(e);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/ILoadingLayout.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.pulltorefresh;
2 |
3 | import android.graphics.Typeface;
4 | import android.graphics.drawable.Drawable;
5 |
6 | public interface ILoadingLayout {
7 |
8 | /**
9 | * Set the Last Updated Text. This displayed under the main label when
10 | * Pulling
11 | *
12 | * @param label - Label to set
13 | */
14 | public void setLastUpdatedLabel(CharSequence label);
15 |
16 | /**
17 | * Set the drawable used in the loading layout. This is the same as calling
18 | * setLoadingDrawable(drawable, Mode.BOTH)
19 | *
20 | * @param drawable - Drawable to display
21 | */
22 | public void setLoadingDrawable(Drawable drawable);
23 |
24 | /**
25 | * Set Text to show when the Widget is being Pulled
26 | * setPullLabel(releaseLabel, Mode.BOTH)
27 | *
28 | * @param pullLabel - CharSequence to display
29 | */
30 | public void setPullLabel(CharSequence pullLabel);
31 |
32 | /**
33 | * Set Text to show when the Widget is refreshing
34 | * setRefreshingLabel(releaseLabel, Mode.BOTH)
35 | *
36 | * @param refreshingLabel - CharSequence to display
37 | */
38 | public void setRefreshingLabel(CharSequence refreshingLabel);
39 |
40 | /**
41 | * Set Text to show when the Widget is being pulled, and will refresh when
42 | * released. This is the same as calling
43 | * setReleaseLabel(releaseLabel, Mode.BOTH)
44 | *
45 | * @param releaseLabel - CharSequence to display
46 | */
47 | public void setReleaseLabel(CharSequence releaseLabel);
48 |
49 | /**
50 | * Set's the Sets the typeface and style in which the text should be
51 | * displayed. Please see
52 | * {@link android.widget.TextView#setTypeface(Typeface)
53 | * TextView#setTypeface(Typeface)}.
54 | */
55 | public void setTextTypeface(Typeface tf);
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/Base.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame;
2 |
3 | import android.content.Context;
4 | import android.content.res.AssetManager;
5 | import android.content.res.Configuration;
6 | import android.content.res.Resources;
7 | import android.support.annotation.NonNull;
8 | import android.util.DisplayMetrics;
9 |
10 | /**
11 | * Base helps to get {@link Context}, {@link Resources}, {@link AssetManager}, {@link Configuration} and {@link DisplayMetrics} in any class.
12 | *
13 | * @author Leonardo Taehwan Kim
14 | */
15 | public class Base {
16 |
17 | private static Context context;
18 |
19 | public static void initialize(@NonNull Context context) {
20 | Base.context = context;
21 | }
22 |
23 | public static Context getContext() {
24 | synchronized (Base.class) {
25 | if (Base.context == null)
26 | throw new NullPointerException("Call Base.initialize(context) within your Application onCreate() method.");
27 |
28 | return Base.context.getApplicationContext();
29 | }
30 | }
31 |
32 | public static Resources getResources() {
33 | return Base.getContext().getResources();
34 | }
35 |
36 | public static Resources.Theme getTheme() {
37 | return Base.getContext().getTheme();
38 | }
39 |
40 | public static AssetManager getAssets() {
41 | return Base.getContext().getAssets();
42 | }
43 |
44 | public static Configuration getConfiguration() {
45 | return Base.getResources().getConfiguration();
46 | }
47 |
48 | public static DisplayMetrics getDisplayMetrics() {
49 | return Base.getResources().getDisplayMetrics();
50 | }
51 | }
52 | // TODO: Thread safety
53 | // TODO: ripple, bitmap, time, contact list, picture list, video list, connectivity, wake lock, screen lock/off/on, get attributes, cookie, audio
54 | // TODO: keystore
55 | // TODO: http://jo.centis1504.net/?p=1189
56 | // TODO: Test codes
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/rxjava/RxManager.java:
--------------------------------------------------------------------------------
1 | package com.android.base.util.rxjava;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import rx.Observable;
7 | import rx.Subscription;
8 | import rx.android.schedulers.AndroidSchedulers;
9 | import rx.functions.Action1;
10 | import rx.subscriptions.CompositeSubscription;
11 |
12 | /**
13 | * 用于管理RxBus的事件和Rxjava相关代码的生命周期处理
14 | */
15 | public class RxManager {
16 |
17 | public RxBus mRxBus = RxBus.$();
18 | private Map> mObservables;// 管理观察源
19 | private CompositeSubscription mCompositeSubscription;// 管理订阅者者
20 |
21 | public RxManager(){
22 | mObservables = new HashMap<>();
23 | mCompositeSubscription = RxUtil.getNewCompositeSubIfUnsubscribed(mCompositeSubscription);
24 | }
25 |
26 |
27 | public void on(String eventName, Action1 action1) {
28 | Observable> mObservable = mRxBus.register(eventName);
29 | mObservables.put(eventName, mObservable);
30 | RxUtil.getNewCompositeSubIfUnsubscribed(mCompositeSubscription).add(mObservable.observeOn(AndroidSchedulers.mainThread())
31 | .subscribe(action1, new Action1() {
32 | @Override
33 | public void call(Throwable throwable) {
34 | throwable.printStackTrace();
35 | }
36 | }));
37 | }
38 |
39 | public void add(Subscription subscription) {
40 | RxUtil.getNewCompositeSubIfUnsubscribed(mCompositeSubscription).add(subscription);
41 | }
42 |
43 | public void clear() {
44 | RxUtil.unsubscribeIfNotNull(mCompositeSubscription);// 取消订阅
45 | for (Map.Entry> entry : mObservables.entrySet())
46 | mRxBus.unregister(entry.getKey(), entry.getValue());// 移除观察
47 | }
48 |
49 | public void post(Object tag, Object content) {
50 | mRxBus.post(tag, content);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/util/adapter/WrapperUtils.java:
--------------------------------------------------------------------------------
1 | package com.android.base.util.adapter;
2 |
3 | import android.support.v7.widget.GridLayoutManager;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.support.v7.widget.StaggeredGridLayoutManager;
6 | import android.view.ViewGroup;
7 |
8 | /**
9 | * Created by zhy on 16/6/28.
10 | */
11 | public class WrapperUtils {
12 | public interface SpanSizeCallback {
13 | int getSpanSize(GridLayoutManager layoutManager, GridLayoutManager.SpanSizeLookup oldLookup, int position);
14 | }
15 |
16 | public static void onAttachedToRecyclerView(RecyclerView.Adapter innerAdapter, RecyclerView recyclerView, final SpanSizeCallback callback) {
17 | innerAdapter.onAttachedToRecyclerView(recyclerView);
18 |
19 | RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
20 | if (layoutManager instanceof GridLayoutManager) {
21 | final GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
22 | final GridLayoutManager.SpanSizeLookup spanSizeLookup = gridLayoutManager.getSpanSizeLookup();
23 |
24 | gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
25 | @Override
26 | public int getSpanSize(int position) {
27 | return callback.getSpanSize(gridLayoutManager, spanSizeLookup, position);
28 | }
29 | });
30 | gridLayoutManager.setSpanCount(gridLayoutManager.getSpanCount());
31 | }
32 | }
33 |
34 | public static void setFullSpan(RecyclerView.ViewHolder holder) {
35 | ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();
36 |
37 | if (lp != null
38 | && lp instanceof StaggeredGridLayoutManager.LayoutParams) {
39 |
40 | StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;
41 |
42 | p.setFullSpan(true);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/model/entity/City.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.db.model.entity;
2 |
3 | import com.j256.ormlite.field.DatabaseField;
4 | import com.j256.ormlite.table.DatabaseTable;
5 |
6 | /**
7 | * 市信息数据表
8 | */
9 | @DatabaseTable(tableName = "city")
10 | public class City {
11 |
12 | @DatabaseField(generatedId = true)
13 | private Integer id;
14 |
15 | @DatabaseField(unique = true)
16 | private String cityNo;
17 |
18 | @DatabaseField
19 | private String cityName;
20 |
21 | @DatabaseField(defaultValue = "-1")
22 | private Integer index;
23 |
24 | @DatabaseField
25 | private String test;
26 |
27 | @DatabaseField
28 | private String provinceName;
29 |
30 | @Override
31 | public String toString() {
32 | return "City{" +
33 | "id=" + id +
34 | ", cityNo='" + cityNo + '\'' +
35 | ", cityName='" + cityName + '\'' +
36 | ", index=" + index +
37 | ", test='" + test + '\'' +
38 | ", provinceName='" + provinceName + '\'' +
39 | '}';
40 | }
41 |
42 | public Integer getId() {
43 | return id;
44 | }
45 |
46 | public void setId(Integer id) {
47 | this.id = id;
48 | }
49 |
50 | public String getCityNo() {
51 | return cityNo;
52 | }
53 |
54 | public void setCityNo(String cityNo) {
55 | this.cityNo = cityNo;
56 | }
57 |
58 | public String getCityName() {
59 | return cityName;
60 | }
61 |
62 | public void setCityName(String cityName) {
63 | this.cityName = cityName;
64 | }
65 |
66 | public Integer getIndex() {
67 | return index;
68 | }
69 |
70 | public void setIndex(Integer index) {
71 | this.index = index;
72 | }
73 |
74 | public String getProvinceName() {
75 | return provinceName;
76 | }
77 |
78 | public void setProvinceName(String provinceName) {
79 | this.provinceName = provinceName;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/AndroidBase/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 15
9 | targetSdkVersion 23
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | sourceSets {
20 | main {
21 | jniLibs.srcDirs = ['libs']
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | compile fileTree(include: ['*.jar'], dir: 'libs')
28 | compile 'com.android.support:appcompat-v7:23.3.0'
29 | compile 'com.android.support:support-v4:23.3.0'
30 | compile 'com.android.support:design:23.3.0'
31 | compile 'com.android.support:recyclerview-v7:23.3.0'
32 |
33 | //Rxjava
34 | compile 'io.reactivex:rxandroid:1.2.1'
35 | compile 'io.reactivex:rxjava:1.1.6'
36 | //Json解析库
37 | compile 'com.alibaba:fastjson:1.1.54.android'
38 | //图片加载、缓存库
39 | compile 'com.github.bumptech.glide:glide:3.7.0'
40 | compile 'jp.wasabeef:glide-transformations:2.0.1'
41 | //6.0权限处理库
42 | compile 'pub.devrel:easypermissions:0.2.0'
43 | //Retrofit网络请求
44 | compile 'com.squareup.retrofit2:retrofit:2.1.0'
45 | compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
46 | compile 'org.ligboy.retrofit2:converter-fastjson-android:2.1.0'
47 | compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
48 | compile 'com.github.franmontiel:PersistentCookieJar:v1.0.0'
49 | //Fragment解决库
50 | compile 'me.yokeyword:fragmentation:0.7.10'
51 | //Log工具类
52 | compile 'com.apkfuns.logutils:library:1.4.2'
53 | //db数据库
54 | compile 'com.j256.ormlite:ormlite-core:4.48'
55 | compile 'com.j256.ormlite:ormlite-android:4.48'
56 | //Recyclerview分割线
57 | compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
58 | compile 'com.nineoldandroids:library:2.4.0'
59 | //butterknife
60 | compile 'com.jakewharton:butterknife:7.0.1'
61 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/http/ZhihuService.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.http;
2 |
3 | import com.hwm.test.http.model.entity.AllThemes;
4 | import com.hwm.test.http.model.entity.News;
5 | import com.hwm.test.http.model.entity.NewsDetail;
6 | import com.hwm.test.http.model.entity.StartInfo;
7 | import com.hwm.test.http.model.entity.ThemeDetail;
8 |
9 | import retrofit2.http.GET;
10 | import retrofit2.http.Path;
11 | import rx.Observable;
12 |
13 | /**
14 | * Created by Administrator on 2016/4/27.
15 | */
16 | public interface ZhihuService {
17 |
18 | /**
19 | *
20 | * 启动界面图像获取
21 | * @param width
22 | * @param height
23 | * @return
24 | */
25 | @GET("api/4/start-image/{width}*{height}")
26 | Observable getStartInfo(@Path("width") int width, @Path("height") int height);
27 |
28 | /*
29 | * 主题日报列表查看
30 | * @return
31 | */
32 | @GET("api/4/themes")
33 | Observable getAllThemes();
34 |
35 | /*
36 | * 最新消息
37 | * @return
38 | */
39 | @GET("api/4/news/latest")
40 | Observable getLastestNews();
41 |
42 | /*
43 | * 消息内容获取与离线下载
44 | * @param id
45 | * @return
46 | */
47 | @GET("api/4/news/{id}")
48 | Observable getNewsDetail(@Path("id") int id);
49 |
50 | /*
51 | * 主题日报内容查看
52 | * @param id
53 | * @return
54 | */
55 | @GET("api/4/theme/{id}")
56 | Observable getThemeDetail(@Path("id") int id);
57 |
58 | /*
59 | * 新闻额外信息
60 | * @param id
61 | * @return
62 | */
63 | /*@GET("api/4/story-extra/{id}")
64 | Call getStoryExtraResponse(@Path("id") int id);*/
65 |
66 | /*
67 | * 新闻对应短评论查看
68 | * @param id
69 | * @return
70 | */
71 | /*@GET("api/4/story/{id}/short-comments")
72 | Call getShortComments(@Path("id") int id);*/
73 |
74 | /*
75 | * 新闻对应长评论查看
76 | * @param id
77 | * @return
78 | */
79 | /*@GET("api/4/story/{id}/long-comments")
80 | Call getLongComments(@Path("id") int id);*/
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test;
2 |
3 | import android.view.View;
4 | import android.widget.Button;
5 | import android.widget.LinearLayout;
6 | import android.widget.TextView;
7 |
8 | import com.android.base.frame.activity.BaseActivity;
9 | import com.hwm.test.http.view.RetrofitActivity;
10 | import com.hwm.test.recyclerview.RecyclerViewActivity;
11 |
12 | import butterknife.Bind;
13 |
14 |
15 | /**
16 | * Created by Administrator on 2015/10/8 0008.
17 | */
18 | public class MainActivity extends BaseActivity implements View.OnClickListener{
19 |
20 | @Bind(R.id.title) TextView mTitle;
21 | @Bind(R.id.container) LinearLayout mContainer;
22 |
23 |
24 | @Override
25 | protected int getContentViewId() {
26 | return R.layout.activity_main;
27 | }
28 |
29 | @Override
30 | protected void initData() {
31 | mTitle.setText("huangwm test");
32 | String[] bttxt = getResources().getStringArray(R.array.test_list);
33 | if (bttxt != null) {
34 | for (int i = 0; i < bttxt.length; i++) {
35 | Button bt = new Button(this);
36 | LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
37 | int margin = getResources().getDimensionPixelSize(R.dimen.common_marin);
38 | lp.setMargins(margin, margin, margin, margin);
39 | bt.setId(i);
40 | bt.setText(bttxt[i]);
41 | bt.setOnClickListener(this);
42 | bt.setLayoutParams(lp);
43 | mContainer.addView(bt);
44 | }
45 | }
46 |
47 | }
48 |
49 | @Override
50 | public void onClick(View v) {
51 | switch (v.getId()) {
52 | case 0:
53 | gotoActivity(RetrofitActivity.class, false);
54 | break;
55 | case 1:
56 | gotoActivity(RecyclerViewActivity.class, false);
57 | break;
58 | default:
59 | //showShortToast("还在开发中...");
60 | break;
61 | }
62 |
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/presenter/factory/PresenterStorage.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.presenter.factory;
2 |
3 | import com.android.base.frame.presenter.XPresenter;
4 |
5 | import java.util.HashMap;
6 |
7 | /**
8 | * This is the singleton where all presenters are stored.
9 | */
10 | public enum PresenterStorage {
11 |
12 | INSTANCE;
13 |
14 | private HashMap idToPresenter = new HashMap<>();
15 | private HashMap presenterToId = new HashMap<>();
16 |
17 | /**
18 | * Adds a presenter to the storage
19 | *
20 | * @param presenter a presenter to add
21 | */
22 | public void add(final XPresenter presenter) {
23 | String id = presenter.getClass().getSimpleName() + "/" + System.nanoTime() + "/" + (int)(Math.random() * Integer.MAX_VALUE);
24 | idToPresenter.put(id, presenter);
25 | presenterToId.put(presenter, id);
26 | presenter.addOnDestroyListener(new XPresenter.OnDestroyListener() {
27 | @Override
28 | public void onDestroy() {
29 | idToPresenter.remove(presenterToId.remove(presenter));
30 | }
31 | });
32 | }
33 |
34 | /**
35 | * Returns a presenter by id or null if such presenter does not exist.
36 | *
37 | * @param id id of a presenter that has been received by calling {@link #getId(XPresenter)}
38 | * @param a type of presenter
39 | * @return a presenter or null
40 | */
41 | public
P getPresenter(String id) {
42 | //noinspection unchecked
43 | return (P)idToPresenter.get(id);
44 | }
45 |
46 | /**
47 | * Returns id of a given presenter.
48 | *
49 | * @param presenter a presenter to get id for.
50 | * @return if of the presenter.
51 | */
52 | public String getId(XPresenter presenter) {
53 | return presenterToId.get(presenter);
54 | }
55 |
56 | /**
57 | * Removes all presenters from the storage.
58 | * Use this method for testing purposes only.
59 | */
60 | public void clear() {
61 | idToPresenter.clear();
62 | presenterToId.clear();
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/LoadingLayoutProxy.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.pulltorefresh;
2 |
3 | import java.util.HashSet;
4 |
5 | import android.graphics.Typeface;
6 | import android.graphics.drawable.Drawable;
7 |
8 | import com.android.base.widget.pulltorefresh.internal.LoadingLayout;
9 |
10 | public class LoadingLayoutProxy implements ILoadingLayout {
11 |
12 | private final HashSet mLoadingLayouts;
13 |
14 | LoadingLayoutProxy() {
15 | mLoadingLayouts = new HashSet();
16 | }
17 |
18 | /**
19 | * This allows you to add extra LoadingLayout instances to this proxy. This
20 | * is only necessary if you keep your own instances, and want to have them
21 | * included in any
22 | * {@link PullToRefreshBase#createLoadingLayoutProxy(boolean, boolean)
23 | * createLoadingLayoutProxy(...)} calls.
24 | *
25 | * @param layout - LoadingLayout to have included.
26 | */
27 | public void addLayout(LoadingLayout layout) {
28 | if (null != layout) {
29 | mLoadingLayouts.add(layout);
30 | }
31 | }
32 |
33 | @Override
34 | public void setLastUpdatedLabel(CharSequence label) {
35 | for (LoadingLayout layout : mLoadingLayouts) {
36 | layout.setLastUpdatedLabel(label);
37 | }
38 | }
39 |
40 | @Override
41 | public void setLoadingDrawable(Drawable drawable) {
42 | for (LoadingLayout layout : mLoadingLayouts) {
43 | layout.setLoadingDrawable(drawable);
44 | }
45 | }
46 |
47 | @Override
48 | public void setRefreshingLabel(CharSequence refreshingLabel) {
49 | for (LoadingLayout layout : mLoadingLayouts) {
50 | layout.setRefreshingLabel(refreshingLabel);
51 | }
52 | }
53 |
54 | @Override
55 | public void setPullLabel(CharSequence label) {
56 | for (LoadingLayout layout : mLoadingLayouts) {
57 | layout.setPullLabel(label);
58 | }
59 | }
60 |
61 | @Override
62 | public void setReleaseLabel(CharSequence label) {
63 | for (LoadingLayout layout : mLoadingLayouts) {
64 | layout.setReleaseLabel(label);
65 | }
66 | }
67 |
68 | public void setTextTypeface(Typeface tf) {
69 | for (LoadingLayout layout : mLoadingLayouts) {
70 | layout.setTextTypeface(tf);
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/http/BaseRestClient.java:
--------------------------------------------------------------------------------
1 | package com.android.base.http;
2 |
3 | import android.content.Context;
4 |
5 | import com.android.base.http.impl.IRetrofit;
6 | import com.franmontiel.persistentcookiejar.ClearableCookieJar;
7 | import com.franmontiel.persistentcookiejar.PersistentCookieJar;
8 | import com.franmontiel.persistentcookiejar.cache.SetCookieCache;
9 | import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor;
10 |
11 | import java.util.concurrent.TimeUnit;
12 |
13 | import okhttp3.OkHttpClient;
14 | import okhttp3.logging.HttpLoggingInterceptor;
15 | import retrofit2.Retrofit;
16 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
17 | import retrofit2.converter.fastjson.FastJsonConverterFactory;
18 |
19 | /**
20 | * Created by Administrator on 2016/4/29.
21 | */
22 | public class BaseRestClient implements IRetrofit {
23 |
24 | private Retrofit mRetrofit;
25 |
26 | @Override
27 | public void attachBaseUrl(Context context, String baseUrl) {
28 |
29 | //okhttp3 cookie 持久化
30 | ClearableCookieJar cookieJar = new PersistentCookieJar(new SetCookieCache(), new SharedPrefsCookiePersistor(context));
31 |
32 | //okhttp3 提供的日志系统
33 | HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
34 | logging.setLevel(HttpLoggingInterceptor.Level.BODY);
35 |
36 | OkHttpClient okHttpClient = new OkHttpClient.Builder()
37 | .readTimeout(7676, TimeUnit.MILLISECONDS)
38 | .connectTimeout(7676, TimeUnit.MILLISECONDS)
39 | .addInterceptor(logging)
40 | .cookieJar(cookieJar)
41 | .build();
42 |
43 | mRetrofit = new Retrofit.Builder()
44 | .baseUrl(baseUrl)
45 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
46 | .addConverterFactory(FastJsonConverterFactory.create())
47 | .client(okHttpClient)
48 | .build();
49 | }
50 |
51 | @Override
52 | public T createService(Class clz) {
53 | return mRetrofit.create(clz);
54 | }
55 |
56 | @Override
57 | public void destory() {
58 | mRetrofit = null;
59 | }
60 |
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/db/presenter/OrmLitePresenter.java:
--------------------------------------------------------------------------------
1 | /*
2 | package com.hwm.test.db.presenter;
3 |
4 | import android.support.annotation.NonNull;
5 |
6 | import com.hwm.test.db.model.OrmLiteTask;
7 | import com.hwm.test.db.view.OrmLiteFragment;
8 |
9 | */
10 | /**
11 | * Created by Administrator on 2016/5/5.
12 | *//*
13 |
14 | public class OrmLitePresenter implements OrmLiteContract.Presenter {
15 |
16 | private final OrmLiteTask mOrmLiteTaskModel;
17 | private final OrmLiteContract.View mView;
18 | private OrmLiteFragment mOrmLiteFragment;
19 |
20 | public OrmLitePresenter(@NonNull OrmLiteTask ormLiteTaskModel, @NonNull OrmLiteContract.View view){
21 | this.mView = view;
22 | this.mOrmLiteTaskModel = ormLiteTaskModel;
23 | if(mView!=null){
24 | mView.setPresenter(this);
25 | mOrmLiteFragment = (OrmLiteFragment) mView;
26 | }
27 | }
28 |
29 | @Override
30 | public void start() {
31 |
32 | }
33 |
34 | @Override
35 | public void Save() {
36 |
37 | }
38 |
39 | @Override
40 | public void Insert() {
41 |
42 | }
43 |
44 | @Override
45 | public void Update() {
46 |
47 | }
48 |
49 | @Override
50 | public void UpdateColumn() {
51 |
52 | }
53 |
54 | @Override
55 | public void QueryAll() {
56 |
57 | }
58 |
59 | @Override
60 | public void QueryByWhere() {
61 |
62 | }
63 |
64 | @Override
65 | public void QueryByID() {
66 |
67 | }
68 |
69 | @Override
70 | public void QueryAnyUwant() {
71 |
72 | }
73 |
74 | @Override
75 | public void Mapping() {
76 |
77 | }
78 |
79 | @Override
80 | public void Delete() {
81 |
82 | }
83 |
84 | @Override
85 | public void DeleteByIndex() {
86 |
87 | }
88 |
89 | @Override
90 | public void DeleteByWhereBuilder() {
91 |
92 | }
93 |
94 | @Override
95 | public void DeleteAll() {
96 |
97 | }
98 |
99 | @Override
100 | public void LargeScaleUseLite() {
101 |
102 | }
103 |
104 | @Override
105 | public void LargeScaleUseSystem() {
106 |
107 | }
108 | }
109 | */
110 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/activity_test_retrofit.xml:
--------------------------------------------------------------------------------
1 |
2 |
21 |
26 |
27 |
30 |
31 |
39 |
40 |
45 |
46 |
47 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/recyclerview/LoadMoreFooter.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.recyclerview;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.AttributeSet;
6 | import android.view.Gravity;
7 | import android.view.ViewGroup;
8 | import android.widget.LinearLayout;
9 | import android.widget.ProgressBar;
10 | import android.widget.TextView;
11 |
12 | import com.hwm.test.R;
13 |
14 | public class LoadMoreFooter extends LinearLayout {
15 |
16 | private LinearLayout mContainer;
17 | private ProgressBar progressBar;
18 | private TextView mText;
19 |
20 |
21 | public LoadMoreFooter(Context context) {
22 | super(context);
23 | initView();
24 | }
25 |
26 | /**
27 | * @param context
28 | * @param attrs
29 | */
30 | public LoadMoreFooter(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | initView();
33 | }
34 | public void initView(){
35 | setGravity(Gravity.CENTER);
36 | setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
37 |
38 | mContainer = new LinearLayout(getContext());
39 | mContainer.setGravity(Gravity.CENTER);
40 | mContainer.setOrientation(HORIZONTAL);
41 | addView(mContainer, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
42 |
43 | progressBar = new ProgressBar(getContext());
44 | progressBar.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
45 | mContainer.addView(progressBar);
46 |
47 | mText = new TextView(getContext());
48 | mText.setText("正在加载...");
49 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
50 | layoutParams.setMargins( (int)getResources().getDimension(R.dimen.common_marin),0,0,0 );
51 | mText.setLayoutParams(layoutParams);
52 | mContainer.addView(mText);
53 | }
54 |
55 | public void setNoLoadMore(int visibility){
56 | mContainer.setVisibility(visibility);
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/banner/transformer/ZoomPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.banner.transformer;
2 |
3 | import android.view.View;
4 |
5 | import com.nineoldandroids.view.ViewHelper;
6 |
7 | /**
8 | * 作者:王浩 邮件:bingoogolapple@gmail.com
9 | * 创建时间:15/6/19 上午8:41
10 | * 描述:
11 | */
12 | public class ZoomPageTransformer extends BGAPageTransformer {
13 | private float mMinScale = 0.85f;
14 | private float mMinAlpha = 0.65f;
15 |
16 | public ZoomPageTransformer() {
17 | }
18 |
19 | public ZoomPageTransformer(float minAlpha, float minScale) {
20 | setMinAlpha(minAlpha);
21 | setMinScale(minScale);
22 | }
23 |
24 | @Override
25 | public void handleInvisiblePage(View view, float position) {
26 | ViewHelper.setAlpha(view, 0);
27 | }
28 |
29 | @Override
30 | public void handleLeftPage(View view, float position) {
31 | float scale = Math.max(mMinScale, 1 + position);
32 | float vertMargin = view.getHeight() * (1 - scale) / 2;
33 | float horzMargin = view.getWidth() * (1 - scale) / 2;
34 | ViewHelper.setTranslationX(view, horzMargin - vertMargin / 2);
35 | ViewHelper.setScaleX(view, scale);
36 | ViewHelper.setScaleY(view, scale);
37 | ViewHelper.setAlpha(view, mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
38 | }
39 |
40 | @Override
41 | public void handleRightPage(View view, float position) {
42 | float scale = Math.max(mMinScale, 1 - position);
43 | float vertMargin = view.getHeight() * (1 - scale) / 2;
44 | float horzMargin = view.getWidth() * (1 - scale) / 2;
45 | ViewHelper.setTranslationX(view, -horzMargin + vertMargin / 2);
46 | ViewHelper.setScaleX(view, scale);
47 | ViewHelper.setScaleY(view, scale);
48 | ViewHelper.setAlpha(view, mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
49 | }
50 |
51 | public void setMinAlpha(float minAlpha) {
52 | if (minAlpha >= 0.6f && minAlpha <= 1.0f) {
53 | mMinAlpha = minAlpha;
54 | }
55 | }
56 |
57 | public void setMinScale(float minScale) {
58 | if (minScale >= 0.6f && minScale <= 1.0f) {
59 | mMinScale = minScale;
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/layout/base_nav_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
19 |
26 |
27 |
33 |
34 |
35 |
36 |
41 |
42 |
50 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/News.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * Created by diff on 2016/2/3.
11 | */
12 | public class News implements Parcelable {
13 |
14 | private String date;
15 |
16 | private ArrayList stories;
17 |
18 | private List top_stories;
19 |
20 |
21 | public void setDate(String date) {
22 | this.date = date;
23 | }
24 |
25 | public void setStories(ArrayList stories) {
26 | this.stories = stories;
27 | }
28 |
29 | public void setTop_stories(List top_stories) {
30 | this.top_stories = top_stories;
31 | }
32 |
33 | public String getDate() {
34 | return date;
35 | }
36 |
37 | public ArrayList getStories() {
38 | return stories;
39 | }
40 |
41 | public List getTop_stories() {
42 | return top_stories;
43 | }
44 |
45 |
46 | @Override
47 | public int describeContents() {
48 | return 0;
49 | }
50 |
51 | @Override
52 | public void writeToParcel(Parcel dest, int flags) {
53 | dest.writeString(this.date);
54 | dest.writeList(this.stories);
55 | dest.writeList(this.top_stories);
56 | }
57 |
58 | public News() {
59 | }
60 |
61 | protected News(Parcel in) {
62 | this.date = in.readString();
63 | this.stories = new ArrayList();
64 | in.readList(this.stories, List.class.getClassLoader());
65 | this.top_stories = new ArrayList();
66 | in.readList(this.top_stories, List.class.getClassLoader());
67 | }
68 |
69 | public static final Creator CREATOR = new Creator() {
70 | public News createFromParcel(Parcel source) {
71 | return new News(source);
72 | }
73 |
74 | public News[] newArray(int size) {
75 | return new News[size];
76 | }
77 | };
78 |
79 | @Override
80 | public String toString() {
81 | return "NewsEntity{" +
82 | "date='" + date + '\'' +
83 | ", stories=" + stories +
84 | ", top_stories=" + top_stories +
85 | '}';
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/internal/ViewCompat.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2011, 2012 Chris Banes.
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 | package com.android.base.widget.pulltorefresh.internal;
17 |
18 | import android.annotation.TargetApi;
19 | import android.graphics.drawable.Drawable;
20 | import android.os.Build.VERSION;
21 | import android.os.Build.VERSION_CODES;
22 | import android.view.View;
23 |
24 | @SuppressWarnings("deprecation")
25 | public class ViewCompat {
26 |
27 | public static void postOnAnimation(View view, Runnable runnable) {
28 | if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
29 | SDK16.postOnAnimation(view, runnable);
30 | } else {
31 | view.postDelayed(runnable, 16);
32 | }
33 | }
34 |
35 | public static void setBackground(View view, Drawable background) {
36 | if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
37 | SDK16.setBackground(view, background);
38 | } else {
39 | view.setBackgroundDrawable(background);
40 | }
41 | }
42 |
43 | public static void setLayerType(View view, int layerType) {
44 | if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
45 | SDK11.setLayerType(view, layerType);
46 | }
47 | }
48 |
49 | @TargetApi(11)
50 | static class SDK11 {
51 |
52 | public static void setLayerType(View view, int layerType) {
53 | view.setLayerType(layerType, null);
54 | }
55 | }
56 |
57 | @TargetApi(16)
58 | static class SDK16 {
59 |
60 | public static void postOnAnimation(View view, Runnable runnable) {
61 | view.postOnAnimation(runnable);
62 | }
63 |
64 | public static void setBackground(View view, Drawable background) {
65 | view.setBackground(background);
66 | }
67 |
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/values/banner_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 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/PullToRefreshViewPager.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2011, 2012 Chris Banes.
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 | package com.android.base.widget.pulltorefresh;
17 |
18 | import android.content.Context;
19 | import android.support.v4.view.PagerAdapter;
20 | import android.support.v4.view.ViewPager;
21 | import android.util.AttributeSet;
22 |
23 | import com.android.base.widget.R;
24 | import com.android.base.widget.pulltorefresh.PullToRefreshBase;
25 |
26 | public class PullToRefreshViewPager extends PullToRefreshBase {
27 |
28 | public PullToRefreshViewPager(Context context) {
29 | super(context);
30 | }
31 |
32 | public PullToRefreshViewPager(Context context, AttributeSet attrs) {
33 | super(context, attrs);
34 | }
35 |
36 | @Override
37 | public final Orientation getPullToRefreshScrollDirection() {
38 | return Orientation.HORIZONTAL;
39 | }
40 |
41 | @Override
42 | protected ViewPager createRefreshableView(Context context, AttributeSet attrs) {
43 | ViewPager viewPager = new ViewPager(context, attrs);
44 | viewPager.setId(R.id.viewpager);
45 | return viewPager;
46 | }
47 |
48 | @Override
49 | protected boolean isReadyForPullStart() {
50 | ViewPager refreshableView = getRefreshableView();
51 |
52 | PagerAdapter adapter = refreshableView.getAdapter();
53 | if (null != adapter) {
54 | return refreshableView.getCurrentItem() == 0;
55 | }
56 |
57 | return false;
58 | }
59 |
60 | @Override
61 | protected boolean isReadyForPullEnd() {
62 | ViewPager refreshableView = getRefreshableView();
63 |
64 | PagerAdapter adapter = refreshableView.getAdapter();
65 | if (null != adapter) {
66 | return refreshableView.getCurrentItem() == adapter.getCount() - 1;
67 | }
68 |
69 | return false;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/AndroidBase/src/main/java/com/android/base/frame/fragment/BaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.android.base.frame.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.apkfuns.logutils.LogUtils;
11 |
12 | import java.util.List;
13 |
14 | import butterknife.ButterKnife;
15 | import pub.devrel.easypermissions.EasyPermissions;
16 |
17 | /**
18 | * Created by Administrator on 2016/9/21.
19 | */
20 | public abstract class BaseFragment extends Fragment implements EasyPermissions.PermissionCallbacks {
21 |
22 | @Nullable
23 | @Override
24 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
25 | View view = inflater.inflate(getContentViewId(), container, false);
26 | return view;
27 | }
28 |
29 | @Override
30 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
31 | super.onViewCreated(view, savedInstanceState);
32 | ButterKnife.bind(this, view);
33 | }
34 |
35 | @Override
36 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
37 | super.onActivityCreated(savedInstanceState);
38 | initData();
39 | }
40 |
41 | @Override
42 | public void onDestroyView() {
43 | super.onDestroyView();
44 | ButterKnife.unbind(this);
45 | }
46 |
47 | @Override
48 | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
49 | super.onRequestPermissionsResult(requestCode, permissions, grantResults);
50 |
51 | // Forward results to EasyPermissions
52 | EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
53 | }
54 |
55 | @Override
56 | public void onPermissionsGranted(int requestCode, List list) {
57 | // Some permissions have been granted
58 | // ...
59 | LogUtils.d("onPermissionsGranted:" + requestCode + ":" + list.size());
60 | }
61 |
62 | @Override
63 | public void onPermissionsDenied(int requestCode, List list) {
64 | // Some permissions have been denied
65 | // ...
66 | LogUtils.d("onPermissionsDenied:" + requestCode + ":" + list.size());
67 | }
68 |
69 | public abstract int getContentViewId();
70 |
71 | protected abstract void initData();
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/res/layout/pull_to_refresh_header_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
17 |
18 |
23 |
24 |
32 |
33 |
34 |
40 |
41 |
48 |
49 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/model/entity/TopStories.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.model.entity;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | public class TopStories implements Parcelable {
7 | private String image;
8 | private int type;
9 | private int id;
10 | private String ga_prefix;
11 | private String title;
12 |
13 | public void setImage(String image) {
14 | this.image = image;
15 | }
16 |
17 | public void setType(int type) {
18 | this.type = type;
19 | }
20 |
21 | public void setId(int id) {
22 | this.id = id;
23 | }
24 |
25 | public void setGa_prefix(String ga_prefix) {
26 | this.ga_prefix = ga_prefix;
27 | }
28 |
29 | public void setTitle(String title) {
30 | this.title = title;
31 | }
32 |
33 | public String getImage() {
34 | return image;
35 | }
36 |
37 | public int getType() {
38 | return type;
39 | }
40 |
41 | public int getId() {
42 | return id;
43 | }
44 |
45 | public String getGa_prefix() {
46 | return ga_prefix;
47 | }
48 |
49 | public String getTitle() {
50 | return title;
51 | }
52 |
53 | @Override
54 | public String toString() {
55 | return "TopStoriesEntity{" +
56 | "ga_prefix='" + ga_prefix + '\'' +
57 | ", image='" + image + '\'' +
58 | ", type=" + type +
59 | ", id=" + id +
60 | ", title='" + title + '\'' +
61 | '}';
62 | }
63 |
64 | @Override
65 | public int describeContents() {
66 | return 0;
67 | }
68 |
69 | @Override
70 | public void writeToParcel(Parcel dest, int flags) {
71 | dest.writeString(this.image);
72 | dest.writeInt(this.type);
73 | dest.writeInt(this.id);
74 | dest.writeString(this.ga_prefix);
75 | dest.writeString(this.title);
76 | }
77 |
78 | public TopStories() {
79 | }
80 |
81 | protected TopStories(Parcel in) {
82 | this.image = in.readString();
83 | this.type = in.readInt();
84 | this.id = in.readInt();
85 | this.ga_prefix = in.readString();
86 | this.title = in.readString();
87 | }
88 |
89 | public static final Creator CREATOR = new Creator() {
90 | public TopStories createFromParcel(Parcel source) {
91 | return new TopStories(source);
92 | }
93 |
94 | public TopStories[] newArray(int size) {
95 | return new TopStories[size];
96 | }
97 | };
98 | }
99 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/pulltorefresh/PullToRefreshRecyclerView.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.pulltorefresh;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.util.AttributeSet;
6 |
7 | import com.android.base.widget.R;
8 |
9 | /**
10 | * Created by Administrator on 2015/11/24 0024.
11 | */
12 | public class PullToRefreshRecyclerView extends PullToRefreshBase {
13 |
14 | public PullToRefreshRecyclerView(Context context) {
15 | super(context);
16 | }
17 |
18 | public PullToRefreshRecyclerView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | }
21 |
22 | public PullToRefreshRecyclerView(Context context, Mode mode) {
23 | super(context, mode);
24 | }
25 |
26 | public PullToRefreshRecyclerView(Context context, Mode mode, AnimationStyle animStyle) {
27 | super(context, mode, animStyle);
28 | }
29 |
30 | @Override public Orientation getPullToRefreshScrollDirection() {
31 | return Orientation.VERTICAL;
32 | }
33 |
34 | @Override protected RecyclerView createRefreshableView(Context context, AttributeSet attrs) {
35 | RecyclerView recyclerView = new RecyclerView(context, attrs);
36 | recyclerView.setId(R.id.recyclerview);
37 | return recyclerView;
38 | }
39 |
40 | public void setAdapter(RecyclerView.Adapter adapter){
41 | mRefreshableView.setAdapter(adapter);
42 | }
43 |
44 | public void setLayoutManager(RecyclerView.LayoutManager layoutManager){
45 | mRefreshableView.setLayoutManager(layoutManager);
46 | }
47 |
48 | @Override protected boolean isReadyForPullEnd() {
49 | int lastVisiblePostion =
50 | mRefreshableView.getChildAdapterPosition(mRefreshableView.getChildAt(mRefreshableView.getChildCount() - 1));
51 | if (lastVisiblePostion >= mRefreshableView.getAdapter().getItemCount() - 1) {
52 | return mRefreshableView.getChildAt(mRefreshableView.getChildCount() - 1).getBottom()
53 | <= mRefreshableView.getBottom();
54 | }
55 | return false;
56 | }
57 |
58 | @Override protected boolean isReadyForPullStart() {
59 | if (mRefreshableView.getChildCount() <= 0) return true;
60 | int firstVisiblePosition = mRefreshableView.getChildAdapterPosition(mRefreshableView.getChildAt(0));
61 | if (firstVisiblePosition == 0) {
62 | return mRefreshableView.getChildAt(0).getTop() == mRefreshableView.getPaddingTop();
63 | } else {
64 | return false;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/java/com/hwm/test/http/presenter/RetrofitPresenter.java:
--------------------------------------------------------------------------------
1 | package com.hwm.test.http.presenter;
2 |
3 | import android.util.Log;
4 |
5 | import com.hwm.test.http.model.RetrofitModel;
6 | import com.hwm.test.http.model.entity.Geye;
7 | import com.hwm.test.http.model.entity.News;
8 |
9 | import rx.Observable;
10 | import rx.Subscriber;
11 |
12 | /**
13 | * Created by Administrator on 2016/4/27.
14 | */
15 | public class RetrofitPresenter extends RetrofitContract.Presenter {
16 |
17 | private final String TAG = RetrofitPresenter.class.getSimpleName();
18 | private RetrofitModel model;
19 |
20 | @Override
21 | public void start() {
22 | super.start();
23 | if(model == null){
24 | model = new RetrofitModel();
25 | }
26 | loadLastestNewsData();
27 | }
28 |
29 | @Override
30 | public void loadLastestNewsData() {
31 | view.showLoadingView();
32 | compositeSubscription.add(Observable.mergeDelayError(model.loadLastestNewsData(), model.loadGeyeData("1590", "1")).subscribe(new Subscriber() {
33 | @Override
34 | public void onCompleted() {
35 | view.showContentView();
36 | }
37 |
38 | @Override
39 | public void onError(Throwable e) {
40 | view.showErrorView();
41 | }
42 |
43 | @Override
44 | public void onNext(Object o) {
45 | view.loadSuccessMessage(o);
46 | }
47 | }));
48 |
49 | /*rxManager.add(model.loadLastestNewsData().subscribe(new Subscriber() {
50 | @Override
51 | public void onCompleted() {
52 | loadGeyeData("1590", "1");
53 | }
54 |
55 | @Override
56 | public void onError(Throwable e) {
57 | view.showErrorView();
58 | }
59 |
60 | @Override
61 | public void onNext(News news) {
62 | view.loadSuccessMessage(news);
63 | }
64 | }));*/
65 |
66 | }
67 |
68 | @Override
69 | public void loadGeyeData(String geyeId, String isNeedff) {
70 | /*rxManager.add(model.loadGeyeData(geyeId, isNeedff).subscribe(new Subscriber() {
71 | @Override
72 | public void onCompleted() {
73 | view.showContentView();
74 | }
75 |
76 | @Override
77 | public void onError(Throwable e) {
78 | view.showErrorView();
79 | }
80 |
81 | @Override
82 | public void onNext(Geye geye) {
83 | view.loadSuccessMessage(geye);
84 | }
85 | }));*/
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/AndroidWidget/src/main/java/com/android/base/widget/recyclerview/layoutmanager/ExStaggeredGridLayoutManager.java:
--------------------------------------------------------------------------------
1 | package com.android.base.widget.recyclerview.layoutmanager;
2 |
3 | import android.support.v7.widget.GridLayoutManager;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.support.v7.widget.StaggeredGridLayoutManager;
6 | import android.view.View;
7 |
8 | /**
9 | * @author Jack Tony
10 | * @brief 不规则排列(类似于瀑布流)的布局管理器
11 | * @date 2015/4/6
12 | */
13 | public class ExStaggeredGridLayoutManager extends StaggeredGridLayoutManager {
14 |
15 | private final String TAG = getClass().getSimpleName();
16 |
17 | GridLayoutManager.SpanSizeLookup mSpanSizeLookup;
18 |
19 | public ExStaggeredGridLayoutManager(int spanCount, int orientation) {
20 | super(spanCount, orientation);
21 | }
22 |
23 | /**
24 | * Returns the current used by the GridLayoutManager.
25 | *
26 | * @return The current used by the GridLayoutManager.
27 | */
28 | public GridLayoutManager.SpanSizeLookup getSpanSizeLookup() {
29 | return mSpanSizeLookup;
30 | }
31 |
32 | /**
33 | * 设置某个位置的item的跨列程度,这里和GridLayoutManager有点不一样,
34 | * 如果你设置某个位置的item的span>1了,那么这个item会占据所有列
35 | *
36 | * @param spanSizeLookup instance to be used to query number of spans
37 | * occupied by each item
38 | */
39 | public void setSpanSizeLookup(GridLayoutManager.SpanSizeLookup spanSizeLookup) {
40 | mSpanSizeLookup = spanSizeLookup;
41 | }
42 |
43 | @Override
44 | public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) {
45 | //Log.d(TAG, "item count = " + getItemCount());
46 | for (int i = 0; i < getItemCount(); i++) {
47 |
48 | if (mSpanSizeLookup.getSpanSize(i) > 1) {
49 | //Log.d(TAG, "lookup > 1 = " + i);
50 | try {
51 | //fix 动态添加时报IndexOutOfBoundsException
52 | View view = recycler.getViewForPosition(i);
53 | if (view != null) {
54 | /**
55 | *占用所有的列
56 | * @see https://plus.google.com/+EtienneLawlor/posts/c5T7fu9ujqi
57 | */
58 | LayoutParams lp = (LayoutParams) view.getLayoutParams();
59 | lp.setFullSpan(true);
60 | }
61 | // recycler.recycleView(view);
62 | } catch (Exception e) {
63 | e.printStackTrace();
64 | }
65 | }
66 | }
67 | super.onMeasure(recycler, state, widthSpec, heightSpec);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidTest
3 | Settings
4 |
5 |
6 | - Retrofit
7 | - RecyclerView
8 | - ............
9 | - ............
10 | - ............
11 | - ............
12 | - ............
13 | - ............
14 | - ............
15 | - ............
16 | - ............
17 | - ............
18 | - ............
19 |
20 |
21 |
22 | - Normal RecyclerView
23 | - MultiItem RecyclerView
24 | - HeaderAndFooter RecyclerView
25 | - RecyclerView Inside ScrollView
26 | - 主流布局5
27 | - 主流布局6
28 | - 主流布局7
29 | - 主流布局8
30 | - 主流布局9
31 | - 主流布局10
32 | - 主流布局11
33 | - 主流布局12
34 | - 未完待续...
35 |
36 |
37 |
38 | - Banner
39 | - Splash
40 |
41 |
42 |
43 | - PullToRefreshRecyclerView
44 | - LoadMoreRecyclerView
45 |
46 |
47 |
48 | - AutoLayout-1
49 | - AutoLayout-2
50 | - AutoLayout-3
51 |
52 |
53 | 打开
54 | 关闭
55 |
56 | 综合
57 | 动弹
58 | 快速
59 | 我
60 | 发现
61 |
62 | LinearLayoutManager_vertical
63 | LinearLayoutManager_horizontal
64 | GridLayoutManager
65 | StaggeredGridLayoutManager
66 |
67 | Start new AsyncTask
68 | Start the async task, rotate the screen and wait for a bit. A
69 | wild notification appears.
70 |
71 |
72 | 正在加载...
73 | 没有更多数据了
74 |
75 |
76 |
--------------------------------------------------------------------------------
/AndroidTest/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
30 |
31 |
37 |
38 |
45 |
46 |
53 |
54 |
60 |
61 |
62 |
--------------------------------------------------------------------------------