├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── libraries │ ├── android_async_http_1_1_4_3.xml │ ├── appcompat_v7_19_1_0.xml │ ├── gson_2_2_4.xml │ ├── guice_3_0_no_aop.xml │ ├── httpmime_4_1_3.xml │ ├── javax_inject_1.xml │ ├── jsr305_1_3_9.xml │ ├── library_1_0_1.xml │ ├── roboguice_2_0.xml │ ├── support_v4_18_0_0.xml │ ├── support_v4_19_1_0.xml │ ├── umeng_sdk.xml │ └── universal_image_loader_1_8_6.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── AndroidCacheFoundation.iml ├── CacheFoundation ├── .gitignore ├── CacheFoundation.iml ├── build.gradle ├── libs │ ├── android-async-http-1-1.4.3.jar │ ├── httpmime-4.1.3.jar │ ├── umeng_sdk.jar │ └── universal-image-loader-1.8.6.jar ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── info │ │ └── jackrex │ │ └── androidcachefoundation │ │ └── cachefoundation │ │ ├── cache │ │ ├── DataCache.java │ │ └── SharePreferenceStorageService.java │ │ ├── http │ │ ├── GsonRequest.java │ │ ├── HttpService.java │ │ └── VolleyHttpClient.java │ │ └── utils │ │ ├── Date │ │ └── DateUtil.java │ │ ├── Image │ │ └── ImageUtils.java │ │ ├── NetWork │ │ └── NetWorkUtils.java │ │ ├── Screen │ │ └── DesityUtil.java │ │ └── Text │ │ └── StringUtils.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ └── values │ └── strings.xml ├── LICENSE ├── README.md ├── UiLibs ├── Android-ViewPagerIndicator │ ├── Android-ViewPagerIndicator.iml │ ├── AndroidManifest.xml │ ├── build.gradle │ ├── build │ │ ├── bundles │ │ │ └── debug │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── R.txt │ │ │ │ ├── classes.jar │ │ │ │ └── res │ │ │ │ ├── color │ │ │ │ ├── vpi__dark_theme.xml │ │ │ │ └── vpi__light_theme.xml │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── vpi__tab_selected_focused_holo.9.png │ │ │ │ ├── vpi__tab_selected_holo.9.png │ │ │ │ ├── vpi__tab_selected_pressed_holo.9.png │ │ │ │ ├── vpi__tab_unselected_focused_holo.9.png │ │ │ │ ├── vpi__tab_unselected_holo.9.png │ │ │ │ └── vpi__tab_unselected_pressed_holo.9.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── vpi__tab_selected_focused_holo.9.png │ │ │ │ ├── vpi__tab_selected_holo.9.png │ │ │ │ ├── vpi__tab_selected_pressed_holo.9.png │ │ │ │ ├── vpi__tab_unselected_focused_holo.9.png │ │ │ │ ├── vpi__tab_unselected_holo.9.png │ │ │ │ └── vpi__tab_unselected_pressed_holo.9.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── vpi__tab_selected_focused_holo.9.png │ │ │ │ ├── vpi__tab_selected_holo.9.png │ │ │ │ ├── vpi__tab_selected_pressed_holo.9.png │ │ │ │ ├── vpi__tab_unselected_focused_holo.9.png │ │ │ │ ├── vpi__tab_unselected_holo.9.png │ │ │ │ └── vpi__tab_unselected_pressed_holo.9.png │ │ │ │ ├── drawable │ │ │ │ └── vpi__tab_indicator.xml │ │ │ │ └── values │ │ │ │ └── values.xml │ │ ├── classes │ │ │ └── debug │ │ │ │ └── com │ │ │ │ └── viewpagerindicator │ │ │ │ ├── BuildConfig.class │ │ │ │ ├── CirclePageIndicator$1.class │ │ │ │ ├── CirclePageIndicator$SavedState$1.class │ │ │ │ ├── CirclePageIndicator$SavedState.class │ │ │ │ ├── CirclePageIndicator.class │ │ │ │ ├── IconPageIndicator$1.class │ │ │ │ ├── IconPageIndicator.class │ │ │ │ ├── IconPagerAdapter.class │ │ │ │ ├── IcsLinearLayout.class │ │ │ │ ├── LinePageIndicator$1.class │ │ │ │ ├── LinePageIndicator$SavedState$1.class │ │ │ │ ├── LinePageIndicator$SavedState.class │ │ │ │ ├── LinePageIndicator.class │ │ │ │ ├── PageIndicator.class │ │ │ │ ├── R$attr.class │ │ │ │ ├── R$bool.class │ │ │ │ ├── R$color.class │ │ │ │ ├── R$dimen.class │ │ │ │ ├── R$drawable.class │ │ │ │ ├── R$id.class │ │ │ │ ├── R$integer.class │ │ │ │ ├── R$style.class │ │ │ │ ├── R$styleable.class │ │ │ │ ├── R.class │ │ │ │ ├── TabPageIndicator$1.class │ │ │ │ ├── TabPageIndicator$2.class │ │ │ │ ├── TabPageIndicator$OnTabReselectedListener.class │ │ │ │ ├── TabPageIndicator$TabView.class │ │ │ │ ├── TabPageIndicator.class │ │ │ │ ├── TitlePageIndicator$1.class │ │ │ │ ├── TitlePageIndicator$IndicatorStyle.class │ │ │ │ ├── TitlePageIndicator$LinePosition.class │ │ │ │ ├── TitlePageIndicator$OnCenterItemClickListener.class │ │ │ │ ├── TitlePageIndicator$SavedState$1.class │ │ │ │ ├── TitlePageIndicator$SavedState.class │ │ │ │ ├── TitlePageIndicator.class │ │ │ │ ├── UnderlinePageIndicator$1.class │ │ │ │ ├── UnderlinePageIndicator$2.class │ │ │ │ ├── UnderlinePageIndicator$SavedState$1.class │ │ │ │ ├── UnderlinePageIndicator$SavedState.class │ │ │ │ └── UnderlinePageIndicator.class │ │ ├── incremental │ │ │ ├── aidl │ │ │ │ └── debug │ │ │ │ │ └── dependency.store │ │ │ ├── mergeAssets │ │ │ │ └── debug │ │ │ │ │ └── merger.xml │ │ │ └── packageResources │ │ │ │ └── debug │ │ │ │ └── merger.xml │ │ ├── libs │ │ │ └── Android-ViewPagerIndicator-debug.aar │ │ ├── source │ │ │ ├── buildConfig │ │ │ │ ├── debug │ │ │ │ │ └── com │ │ │ │ │ │ └── viewpagerindicator │ │ │ │ │ │ └── BuildConfig.java │ │ │ │ └── release │ │ │ │ │ └── com │ │ │ │ │ └── viewpagerindicator │ │ │ │ │ └── BuildConfig.java │ │ │ └── r │ │ │ │ ├── debug │ │ │ │ └── com │ │ │ │ │ └── viewpagerindicator │ │ │ │ │ └── R.java │ │ │ │ └── release │ │ │ │ └── com │ │ │ │ └── viewpagerindicator │ │ │ │ └── R.java │ │ └── tmp │ │ │ └── packageDebugJar │ │ │ └── MANIFEST.MF │ ├── pom.xml │ ├── res │ │ ├── color │ │ │ ├── vpi__dark_theme.xml │ │ │ └── vpi__light_theme.xml │ │ ├── drawable-hdpi │ │ │ ├── vpi__tab_selected_focused_holo.9.png │ │ │ ├── vpi__tab_selected_holo.9.png │ │ │ ├── vpi__tab_selected_pressed_holo.9.png │ │ │ ├── vpi__tab_unselected_focused_holo.9.png │ │ │ ├── vpi__tab_unselected_holo.9.png │ │ │ └── vpi__tab_unselected_pressed_holo.9.png │ │ ├── drawable-mdpi │ │ │ ├── vpi__tab_selected_focused_holo.9.png │ │ │ ├── vpi__tab_selected_holo.9.png │ │ │ ├── vpi__tab_selected_pressed_holo.9.png │ │ │ ├── vpi__tab_unselected_focused_holo.9.png │ │ │ ├── vpi__tab_unselected_holo.9.png │ │ │ └── vpi__tab_unselected_pressed_holo.9.png │ │ ├── drawable-xhdpi │ │ │ ├── vpi__tab_selected_focused_holo.9.png │ │ │ ├── vpi__tab_selected_holo.9.png │ │ │ ├── vpi__tab_selected_pressed_holo.9.png │ │ │ ├── vpi__tab_unselected_focused_holo.9.png │ │ │ ├── vpi__tab_unselected_holo.9.png │ │ │ └── vpi__tab_unselected_pressed_holo.9.png │ │ ├── drawable │ │ │ └── vpi__tab_indicator.xml │ │ └── values │ │ │ ├── vpi__attrs.xml │ │ │ ├── vpi__colors.xml │ │ │ ├── vpi__defaults.xml │ │ │ └── vpi__styles.xml │ └── src │ │ └── com │ │ └── viewpagerindicator │ │ ├── CirclePageIndicator.java │ │ ├── IconPageIndicator.java │ │ ├── IconPagerAdapter.java │ │ ├── IcsLinearLayout.java │ │ ├── LinePageIndicator.java │ │ ├── PageIndicator.java │ │ ├── TabPageIndicator.java │ │ ├── TitlePageIndicator.java │ │ └── UnderlinePageIndicator.java └── XListView │ ├── .gitignore │ ├── XListView.iml │ ├── build.gradle │ ├── proguard-rules.txt │ └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── info │ │ └── jackrex │ │ └── xlistview │ │ ├── XListView.java │ │ ├── XListViewFooter.java │ │ └── XListViewHeader.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ ├── ic_launcher.png │ └── xlistview_arrow.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ ├── xlistview_footer.xml │ └── xlistview_header.xml │ └── values │ └── strings.xml ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── info │ │ └── jackrex │ │ └── androidcachefoundation │ │ └── app │ │ ├── Fragment1.java │ │ ├── MainActivity.java │ │ ├── MyViewPager.java │ │ ├── TabAdapter.java │ │ ├── TabInfo.java │ │ ├── adapter │ │ ├── CarNewsAdapter.java │ │ └── PopWindowAdapter.java │ │ ├── entity │ │ ├── News.java │ │ ├── NewsContent.java │ │ └── NewsEntity.java │ │ ├── popwindow │ │ ├── AddPopWindow.java │ │ ├── ListPopMenu.java │ │ └── SettingsPopWindow.java │ │ └── view │ │ └── HeaderView.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ ├── abc_ab_bottom_solid_dark_holo.9.png │ ├── abc_ab_stacked_transparent_dark_holo.9.png │ ├── actionbar_add_icon.png │ ├── actionbar_camera_icon.png │ ├── actionbar_loud_icon.png │ ├── actionbar_more_icon.png │ ├── actionbar_search_icon.png │ ├── bind_mcontact_reco_friends.png │ ├── bind_qq_icon.png │ ├── brand_default_head.png │ ├── headshow1.png │ ├── headshow2.png │ ├── headshow3.png │ ├── headshow4.png │ ├── headshow5.png │ ├── headshow6.png │ ├── ic_launcher.png │ ├── icon_talk2x.png │ ├── icon_time2x.png │ ├── tabbar_icon_home.png │ └── tabbar_icon_home_focus.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable │ ├── tabicons_index.xml │ └── tabicons_index_text.xml │ ├── layout │ ├── activity_main.xml │ ├── addmenu.xml │ ├── fragment1.xml │ ├── fragment_list.xml │ ├── homeheader.xml │ ├── indexadapter.xml │ ├── item_index_dialog_addcar.xml │ ├── item_index_dialog_editcar.xml │ ├── item_news.xml │ ├── popdialog.xml │ ├── settingdialog.xml │ └── tab1.xml │ ├── menu │ └── main.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── application ├── .gitignore ├── application.iml ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── info │ │ └── jackrex │ │ └── androidcachefoundation │ │ └── application │ │ └── MyApplication.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ └── values │ └── strings.xml ├── build.gradle ├── framework ├── .gitignore ├── build.gradle ├── framework.iml ├── libs │ ├── guice-3.0-no_aop.jar │ ├── javax.inject-1.jar │ ├── jsr305-1.3.9.jar │ └── roboguice-2.0.jar ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── info │ │ └── jackrex │ │ └── androidcachefoundation │ │ └── framework │ │ ├── BaseActivity.java │ │ └── BaseFragment.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ └── values │ └── strings.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | AndroidCacheFoundation -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/libraries/android_async_http_1_1_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_19_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/gson_2_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/guice_3_0_no_aop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/httpmime_4_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/javax_inject_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/jsr305_1_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/library_1_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/roboguice_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_18_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_19_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/umeng_sdk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/universal_image_loader_1_8_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/1.png -------------------------------------------------------------------------------- /2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/2.png -------------------------------------------------------------------------------- /3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/3.png -------------------------------------------------------------------------------- /4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/4.png -------------------------------------------------------------------------------- /AndroidCacheFoundation.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CacheFoundation/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /CacheFoundation/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | 3 | android { 4 | compileSdkVersion 18 5 | buildToolsVersion "19.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 8 9 | targetSdkVersion 16 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | buildTypes { 15 | release { 16 | runProguard false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.android.support:appcompat-v7:+' 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | compile 'com.mcxiaoke.volley:library:1.0.1@jar' 26 | compile 'com.google.code.gson:gson:2.2.+' 27 | compile fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 28 | } 29 | -------------------------------------------------------------------------------- /CacheFoundation/libs/android-async-http-1-1.4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/libs/android-async-http-1-1.4.3.jar -------------------------------------------------------------------------------- /CacheFoundation/libs/httpmime-4.1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/libs/httpmime-4.1.3.jar -------------------------------------------------------------------------------- /CacheFoundation/libs/umeng_sdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/libs/umeng_sdk.jar -------------------------------------------------------------------------------- /CacheFoundation/libs/universal-image-loader-1.8.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/libs/universal-image-loader-1.8.6.jar -------------------------------------------------------------------------------- /CacheFoundation/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Jackrex/Developer/Dev/adt-bundle-mac-x86_64-20130917/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 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 | #} -------------------------------------------------------------------------------- /CacheFoundation/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/cache/DataCache.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.cachefoundation.cache; 2 | 3 | import android.content.ContentValues; 4 | import android.content.Context; 5 | import android.database.Cursor; 6 | import android.database.sqlite.SQLiteDatabase; 7 | import android.util.Log; 8 | 9 | import java.io.File; 10 | import java.text.SimpleDateFormat; 11 | 12 | /** 13 | * Created by Jackrex on 2/24/14. 14 | */ 15 | public class DataCache { 16 | 17 | private static final String dbName = "cache.db"; 18 | private static final String TABLE = "cache"; 19 | private static final String ID = "id"; 20 | private static final String URL = "url"; 21 | private static final String DATA = "data"; 22 | private static final String TIMESTAMP = "timestamp"; 23 | private static final String INPUT_BYTES = "input_bytes";//size 大小 24 | private static SQLiteDatabase database; 25 | private File dbFile; 26 | private static DataCache dataCache; 27 | private Context context; 28 | 29 | public DataCache(Context context) { 30 | if (init(context)) { 31 | initTable(); 32 | 33 | } 34 | 35 | } 36 | 37 | public static DataCache newInstance(Context context) { 38 | 39 | if (dataCache == null) { 40 | dataCache = new DataCache(context); 41 | } 42 | return dataCache; 43 | } 44 | 45 | 46 | public static DataCache getDataCache() { 47 | 48 | return dataCache; 49 | } 50 | 51 | 52 | private boolean init(Context context) { 53 | 54 | try { 55 | dbFile = new File(context.getCacheDir() + File.separator + dbName); 56 | database = SQLiteDatabase.openOrCreateDatabase(dbFile, null); 57 | return dbFile != null; 58 | } catch (Exception e) { 59 | e.printStackTrace(); 60 | } 61 | return false; 62 | } 63 | 64 | 65 | private void initTable() { 66 | 67 | if (database != null) { 68 | try { 69 | 70 | database.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE + " (" + 71 | ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + 72 | URL + " TEXT UNIQUE NOT NULL, " + 73 | DATA + " TEXT UNIQUE NOT NULL," + 74 | TIMESTAMP + " INTEGER NOT NULL DEFAULT 0 " + 75 | " );"); 76 | 77 | } catch (Exception e) { 78 | 79 | e.printStackTrace(); 80 | 81 | } 82 | } 83 | 84 | } 85 | 86 | 87 | public synchronized void saveToCache(String url, String jsontext) { 88 | 89 | 90 | SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 91 | String date = sDateFormat.format(new java.util.Date()); 92 | if (database == null) { 93 | return; 94 | } 95 | 96 | try { 97 | ContentValues contentValues = new ContentValues(); 98 | contentValues.put(URL, url); 99 | contentValues.put(DATA, jsontext); 100 | contentValues.put(TIMESTAMP, date); 101 | 102 | long id= database.insertWithOnConflict(TABLE,DATA,contentValues,SQLiteDatabase.CONFLICT_REPLACE); 103 | Log.e("id is a ",id+""); 104 | 105 | } catch (Exception e) { 106 | 107 | } finally { 108 | 109 | } 110 | 111 | 112 | } 113 | 114 | 115 | public synchronized String queryCache(String url) { 116 | if (database == null) { 117 | return null; 118 | } 119 | 120 | try { 121 | 122 | Cursor cursor = database.rawQuery("SELECT * FROM Cache WHERE url == ?", new String[]{url}); 123 | while (cursor.moveToNext()) { 124 | return cursor.getString(cursor.getColumnIndex("data")); 125 | } 126 | 127 | 128 | } catch (Exception e) { 129 | 130 | } finally { 131 | 132 | } 133 | 134 | return null; 135 | } 136 | 137 | 138 | public void clearCache() { 139 | if (database != null) { 140 | try { 141 | database.delete(TABLE, null, null); 142 | database.setTransactionSuccessful(); 143 | } catch (Exception e) { 144 | 145 | } finally { 146 | database.endTransaction(); 147 | } 148 | } 149 | } 150 | 151 | 152 | @Override 153 | protected void finalize() throws Throwable { 154 | super.finalize(); 155 | if (database != null) { 156 | try { 157 | database.close(); 158 | } catch (Exception e) { 159 | 160 | } 161 | 162 | } 163 | } 164 | 165 | 166 | } 167 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/cache/SharePreferenceStorageService.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.cachefoundation.cache; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | import android.content.SharedPreferences.Editor; 7 | import android.preference.PreferenceManager; 8 | 9 | import java.io.FileInputStream; 10 | import java.io.FileOutputStream; 11 | import java.io.IOException; 12 | import java.io.ObjectInputStream; 13 | import java.io.ObjectOutputStream; 14 | 15 | /** 16 | * Created by Jackrex on 2/24/14. 17 | */ 18 | public class SharePreferenceStorageService { 19 | 20 | private static SharePreferenceStorageService preferenceStorageService; 21 | private Context context; 22 | 23 | public SharePreferenceStorageService(Context context) { 24 | this.context=context; 25 | } 26 | 27 | 28 | public static SharePreferenceStorageService newInstance(Context context){ 29 | 30 | if(preferenceStorageService == null){ 31 | preferenceStorageService = new SharePreferenceStorageService(context); 32 | } 33 | 34 | return preferenceStorageService; 35 | } 36 | 37 | 38 | /** 39 | * 第一次启动的flag 40 | * @return 41 | */ 42 | public boolean isFirstLaunch(){ 43 | 44 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 45 | return preferences.getBoolean("isfirstlaunch",true); 46 | } 47 | 48 | 49 | public void setFirstLaunch(){ 50 | 51 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 52 | Editor editor = preferences.edit(); 53 | editor.putBoolean("isfirstlaunch", false); 54 | editor.commit(); 55 | } 56 | 57 | 58 | /** 59 | * 设置某些仅仅使用一次的flag 60 | * @return 61 | */ 62 | public boolean isFirst(){ 63 | 64 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 65 | return preferences.getBoolean("isfirst",true); 66 | } 67 | 68 | 69 | public void setFirst(){ 70 | 71 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 72 | Editor editor = preferences.edit(); 73 | editor.putBoolean("isfirst", false); 74 | editor.commit(); 75 | } 76 | 77 | 78 | /** 79 | * 序列化写入文件 80 | * @param filename 81 | * @param data 82 | * @param 83 | */ 84 | public void writeToFile(String filename,T... data) { 85 | // TODO Auto-generated method stub 86 | try { 87 | ObjectOutputStream out = new ObjectOutputStream( 88 | new FileOutputStream(context.getFilesDir().toString()+"/" + filename)); 89 | 90 | for(T list:data){ 91 | out.writeObject(list); 92 | } 93 | 94 | out.close(); 95 | } catch (IOException e) { 96 | e.printStackTrace(); 97 | } 98 | } 99 | 100 | 101 | /** 102 | * 从文件中读取 103 | * @param filename 104 | * @param 105 | * @return 106 | */ 107 | public Object getFromFile(String filename){ 108 | 109 | 110 | try { 111 | ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(context.getFilesDir().toString()+"/" + filename)); 112 | Object data = inputStream.readObject(); 113 | return data; 114 | 115 | } catch (IOException e) { 116 | e.printStackTrace(); 117 | } catch (ClassNotFoundException e) { 118 | e.printStackTrace(); 119 | } 120 | 121 | return null; 122 | 123 | } 124 | 125 | 126 | 127 | } 128 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/http/GsonRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014. 3 | * Jackrex 4 | */ 5 | 6 | package info.jackrex.androidcachefoundation.cachefoundation.http; 7 | 8 | import com.android.volley.AuthFailureError; 9 | import com.android.volley.NetworkResponse; 10 | import com.android.volley.ParseError; 11 | import com.android.volley.Request; 12 | import com.android.volley.Response; 13 | import com.android.volley.toolbox.HttpHeaderParser; 14 | import com.google.gson.Gson; 15 | import com.google.gson.JsonSyntaxException; 16 | 17 | import java.io.UnsupportedEncodingException; 18 | import java.util.Map; 19 | 20 | import info.jackrex.androidcachefoundation.cachefoundation.cache.DataCache; 21 | 22 | 23 | //region Description 24 | // 25 | 26 | /** 27 | * Created by Jackrex on 2/18/14. 28 | */ 29 | public class GsonRequest extends Request { 30 | 31 | 32 | private final Gson gson = new Gson(); 33 | private final Class clazz; 34 | private final Map headers; 35 | private final Response.Listener listener; 36 | private String url; 37 | private Map params; 38 | 39 | 40 | /** 41 | * 带参数 带头(Header)的 GET POST 请求 42 | * @param method 43 | * @param url 44 | * @param clazz 45 | * @param headers 46 | * @param params 47 | * @param listener 48 | * @param errorListener 49 | */ 50 | public GsonRequest(int method,String url, Class clazz, Map headers, Map params, 51 | Response.Listener listener, Response.ErrorListener errorListener) { 52 | super(method, url, errorListener); 53 | this.clazz = clazz; 54 | this.headers = headers; 55 | this.listener = listener; 56 | this.url = url; 57 | this.params = params; 58 | } 59 | 60 | /** 61 | * 不带参数的请求 GET POST 62 | * @param method 63 | * @param url 64 | * @param clazz 65 | * @param listener 66 | * @param errorListener 67 | */ 68 | public GsonRequest(int method,String url, Class clazz, 69 | Response.Listener listener, Response.ErrorListener errorListener) { 70 | this(method, url, null, null,listener ,errorListener); 71 | } 72 | 73 | /** 74 | * 带参数的请求 GET POST 75 | * 76 | * @param method GET POST 77 | * @param url 78 | * @param clazz 79 | * @param params 带参数的请求 80 | * @param listener 81 | * @param errorListener 82 | */ 83 | public GsonRequest(int method,String url, Class clazz, Map params, Response.Listener listener, Response.ErrorListener errorListener) { 84 | this(method, url, clazz, null, params, listener, errorListener); 85 | 86 | } 87 | 88 | 89 | 90 | 91 | /** 92 | * 不带参数默认GET 请求方法 93 | * @param url 传入url http://.... 格式错误可能报NULLPointer 94 | * @param clazz 需要转化的实体类 95 | * @param listener 传入成功监听listener 96 | * @param errorListener 失败listener 97 | */ 98 | public GsonRequest(String url, Class clazz, Response.Listener listener, Response.ErrorListener errorListener){ 99 | this(Method.GET, url, clazz, null, null, listener, errorListener); 100 | } 101 | 102 | 103 | 104 | //default for POST PUT 105 | @Override 106 | protected Map getParams() throws AuthFailureError { 107 | return params != null ? params :super.getParams(); 108 | } 109 | 110 | 111 | 112 | @Override 113 | public Map getHeaders() throws AuthFailureError { 114 | return headers != null ? headers : super.getHeaders(); 115 | } 116 | 117 | @Override 118 | protected void deliverResponse(T response) { 119 | listener.onResponse(response); 120 | } 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | /** 129 | * 处理网络返回 130 | * @param response 131 | * @return 132 | */ 133 | @Override 134 | protected Response parseNetworkResponse(NetworkResponse response) { 135 | try { 136 | String json = new String( 137 | response.data, HttpHeaderParser.parseCharset(response.headers)); 138 | 139 | DataCache.getDataCache().saveToCache(url,json); 140 | 141 | return Response.success( 142 | gson.fromJson(json, clazz), HttpHeaderParser.parseCacheHeaders(response)); 143 | } catch (UnsupportedEncodingException e) { 144 | return Response.error(new ParseError(e)); 145 | } catch (JsonSyntaxException e) { 146 | return Response.error(new ParseError(e)); 147 | } 148 | } 149 | 150 | 151 | } 152 | 153 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/http/HttpService.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.cachefoundation.http; 2 | 3 | import android.content.Context; 4 | import android.text.TextUtils; 5 | import android.util.Log; 6 | 7 | import com.android.volley.Request; 8 | import com.android.volley.RequestQueue; 9 | import com.android.volley.VolleyLog; 10 | import com.android.volley.toolbox.Volley; 11 | 12 | public class HttpService { 13 | public static String TAG = HttpService.class.getName(); 14 | public static String DEFAULT_HTTP_TAG = "DEFAULT HTTP REQUEST"; 15 | public static RequestQueue httpQueue; 16 | private static HttpService httpService; 17 | 18 | public Context context; 19 | 20 | private HttpService(Context context) { 21 | // TODO Auto-generated constructor stub 22 | this.context = context; 23 | this.httpQueue = Volley.newRequestQueue(context); 24 | } 25 | 26 | 27 | public static HttpService newInstance (Context context){ 28 | 29 | 30 | 31 | if(httpService == null){ 32 | httpService = new HttpService(context); 33 | } 34 | return httpService; 35 | } 36 | 37 | 38 | public Context getContext() { 39 | 40 | return context; 41 | 42 | } 43 | 44 | /** 45 | * 往全局队列里加入一个新的http请求 46 | * 47 | * @param request 48 | */ 49 | public void addToRequestQueue(Request request) { 50 | this.addToRequestQueue(request, DEFAULT_HTTP_TAG); 51 | } 52 | 53 | /** 54 | * 往全局队列里加入一个新的http请求 55 | * 56 | * @param request 57 | * @param tag 请求tag, 可以通过tag取消请求 58 | */ 59 | public void addToRequestQueue(Request request, String tag) { 60 | request.setTag(TextUtils.isEmpty(tag) ? DEFAULT_HTTP_TAG : tag); 61 | VolleyLog.d("Adding request to queue: %s", request.getUrl()); 62 | if (this.httpQueue != null) { 63 | this.httpQueue.add(request); 64 | 65 | } else { 66 | Log.d(TAG, "http queue null"); 67 | } 68 | 69 | 70 | } 71 | 72 | /** 73 | * 取消指定tag的请求 74 | * 75 | * @param tag 76 | */ 77 | public void cancelRequests(Object tag) { 78 | if (this.httpQueue != null) { 79 | this.httpQueue.cancelAll(tag); 80 | } 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/utils/Date/DateUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014. 3 | * Jackrex 4 | */ 5 | 6 | package info.jackrex.androidcachefoundation.cachefoundation.utils.Date; 7 | 8 | import java.text.ParseException; 9 | import java.text.SimpleDateFormat; 10 | import java.util.Calendar; 11 | import java.util.Date; 12 | 13 | /** 14 | * Created by Jackrex on 2/18/14. 15 | */ 16 | public class DateUtil { 17 | 18 | private final static ThreadLocal dateFormater = new ThreadLocal() { 19 | @Override 20 | protected SimpleDateFormat initialValue() { 21 | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 22 | } 23 | }; 24 | 25 | private final static ThreadLocal dateFormater2 = new ThreadLocal() { 26 | @Override 27 | protected SimpleDateFormat initialValue() { 28 | return new SimpleDateFormat("yyyy-MM-dd"); 29 | } 30 | }; 31 | 32 | /** 33 | * 返回 format 格式 34 | * 35 | * @param date 36 | * @return 37 | */ 38 | public static String format(Date date, String format) { 39 | try { 40 | SimpleDateFormat sdf = new SimpleDateFormat(format); 41 | return sdf.format(date);//添加的时间操作的时间 42 | } catch (Exception e) { 43 | return null; 44 | } 45 | 46 | } 47 | 48 | 49 | /** 50 | * 返回 yyyy年MM月dd日 51 | * 52 | * @param date 53 | * @return 54 | */ 55 | public static String format(Date date) { 56 | try { 57 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); 58 | return sdf.format(date);//添加的时间操作的时间 59 | } catch (Exception e) { 60 | return null; 61 | } 62 | 63 | } 64 | 65 | 66 | /** 67 | * 返回 yyyy年MM月dd日 68 | * 69 | * @param date 70 | * @return 71 | */ 72 | public static String format(String date) { 73 | try { 74 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); 75 | return sdf.format(date);//添加的时间操作的时间 76 | } catch (Exception e) { 77 | return null; 78 | } 79 | 80 | } 81 | 82 | /** 83 | * 将字符串转位日期类型 84 | * 85 | * @param sdate 86 | * @return 87 | */ 88 | public static Date toDate(String sdate) { 89 | try { 90 | return dateFormater.get().parse(sdate); 91 | } catch (ParseException e) { 92 | return null; 93 | } 94 | } 95 | 96 | /** 97 | * 以友好的方式显示时间 98 | * 99 | * @param sdate 100 | * @return 101 | */ 102 | public static String friendly_time(String sdate) { 103 | Date time = toDate(sdate); 104 | if (time == null) { 105 | return "Unknown"; 106 | } 107 | String ftime = ""; 108 | Calendar cal = Calendar.getInstance(); 109 | //判断是否是同一天 110 | String curDate = dateFormater2.get().format(cal.getTime()); 111 | String paramDate = dateFormater2.get().format(time); 112 | if (curDate.equals(paramDate)) { 113 | int hour = (int) ((cal.getTimeInMillis() - time.getTime()) / 3600000); 114 | if (hour == 0) 115 | ftime = Math.max((cal.getTimeInMillis() - time.getTime()) / 60000, 1) + "分钟前"; 116 | else 117 | ftime = hour + "小时前"; 118 | return ftime; 119 | } 120 | 121 | long lt = time.getTime() / 86400000; 122 | long ct = cal.getTimeInMillis() / 86400000; 123 | int days = (int) (ct - lt); 124 | if (days == 0) { 125 | int hour = (int) ((cal.getTimeInMillis() - time.getTime()) / 3600000); 126 | if (hour == 0) 127 | ftime = Math.max((cal.getTimeInMillis() - time.getTime()) / 60000, 1) + "分钟前"; 128 | else 129 | ftime = hour + "小时前"; 130 | } else if (days == 1) { 131 | ftime = "昨天"; 132 | } else if (days == 2) { 133 | ftime = "前天"; 134 | } else if (days > 2 && days <= 10) { 135 | ftime = days + "天前"; 136 | } else if (days > 10) { 137 | ftime = dateFormater2.get().format(time); 138 | } 139 | return ftime; 140 | } 141 | 142 | /** 143 | * 判断给定字符串时间是否为今日 144 | * 145 | * @param sdate 146 | * @return boolean 147 | */ 148 | public static boolean isToday(String sdate) { 149 | boolean b = false; 150 | Date time = toDate(sdate); 151 | Date today = new Date(); 152 | if (time != null) { 153 | String nowDate = dateFormater2.get().format(today); 154 | String timeDate = dateFormater2.get().format(time); 155 | if (nowDate.equals(timeDate)) { 156 | b = true; 157 | } 158 | } 159 | return b; 160 | } 161 | 162 | 163 | // 比较两个date类型的数据的大小 164 | public static int compare_Date(Date date1, Date date2) { 165 | 166 | if (date1.getTime() > date2.getTime()) { 167 | return 1; 168 | } else if (date1.getTime() < date2.getTime()) { 169 | return -1; 170 | } else { 171 | return 0; 172 | } 173 | 174 | } 175 | 176 | } 177 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/utils/NetWork/NetWorkUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014. 3 | * Jackrex 4 | */ 5 | 6 | /** 7 | * 8 | */ 9 | package info.jackrex.androidcachefoundation.cachefoundation.utils.NetWork; 10 | 11 | import android.content.Context; 12 | import android.net.ConnectivityManager; 13 | import android.net.NetworkInfo; 14 | import android.telephony.TelephonyManager; 15 | import android.util.Log; 16 | 17 | /* 18 | * 判断网络连接情况 19 | * */ 20 | public class NetWorkUtils { 21 | 22 | private static final String LOG_TAG = NetWorkUtils.class.getCanonicalName(); 23 | // 24 | public static boolean detect(Context context) { 25 | 26 | ConnectivityManager manager = (ConnectivityManager) context 27 | .getApplicationContext().getSystemService( 28 | Context.CONNECTIVITY_SERVICE); 29 | 30 | if (manager == null) { 31 | return false; 32 | } 33 | NetworkInfo networkinfo = manager.getActiveNetworkInfo(); 34 | 35 | if (networkinfo == null || !networkinfo.isAvailable()) { 36 | return false; 37 | } 38 | 39 | return true; 40 | } 41 | 42 | 43 | /** 44 | * 判断是否有网络连接 45 | */ 46 | public static boolean isNetworkAvailable(Context context) { 47 | 48 | ConnectivityManager manager = (ConnectivityManager) context 49 | .getApplicationContext().getSystemService( 50 | Context.CONNECTIVITY_SERVICE); 51 | 52 | if (manager == null) { 53 | return false; 54 | } 55 | 56 | NetworkInfo networkinfo = manager.getActiveNetworkInfo(); 57 | 58 | if (networkinfo == null || !networkinfo.isAvailable()) { 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | 65 | /** 66 | * 判断网络是否为漫游 67 | */ 68 | public static boolean isNetworkRoaming(Context context) { 69 | ConnectivityManager connectivity = (ConnectivityManager) context 70 | .getSystemService(Context.CONNECTIVITY_SERVICE); 71 | if (connectivity == null) { 72 | Log.w(LOG_TAG, "couldn't get connectivity manager"); 73 | } else { 74 | NetworkInfo info = connectivity.getActiveNetworkInfo(); 75 | if (info != null 76 | && info.getType() == ConnectivityManager.TYPE_MOBILE) { 77 | TelephonyManager tm = (TelephonyManager) context 78 | .getSystemService(Context.TELEPHONY_SERVICE); 79 | if (tm != null && tm.isNetworkRoaming()) { 80 | Log.d(LOG_TAG, "network is roaming"); 81 | return true; 82 | } else { 83 | Log.d(LOG_TAG, "network is not roaming"); 84 | } 85 | } else { 86 | Log.d(LOG_TAG, "not using mobile network"); 87 | } 88 | } 89 | return false; 90 | } 91 | 92 | /** 93 | * 判断MOBILE网络是否可用 94 | * 95 | * @param context 96 | * @return 97 | * @throws Exception 98 | */ 99 | public static boolean isMobileDataEnable(Context context) throws Exception { 100 | ConnectivityManager connectivityManager = (ConnectivityManager) context 101 | .getSystemService(Context.CONNECTIVITY_SERVICE); 102 | boolean isMobileDataEnable = false; 103 | 104 | isMobileDataEnable = connectivityManager.getNetworkInfo( 105 | ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting(); 106 | 107 | return isMobileDataEnable; 108 | } 109 | 110 | 111 | /** 112 | * 判断wifi 是否可用 113 | * @param context 114 | * @return 115 | * @throws Exception 116 | */ 117 | public static boolean isWifiDataEnable(Context context) throws Exception { 118 | ConnectivityManager connectivityManager = (ConnectivityManager) context 119 | .getSystemService(Context.CONNECTIVITY_SERVICE); 120 | boolean isWifiDataEnable = false; 121 | isWifiDataEnable = connectivityManager.getNetworkInfo( 122 | ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting(); 123 | return isWifiDataEnable; 124 | } 125 | 126 | 127 | } 128 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/java/info/jackrex/androidcachefoundation/cachefoundation/utils/Screen/DesityUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014. 3 | * Jackrex 4 | */ 5 | 6 | package info.jackrex.androidcachefoundation.cachefoundation.utils.Screen; 7 | 8 | import android.content.Context; 9 | import android.util.Log; 10 | 11 | /* 12 | * 获取屏幕分辨率 13 | *

dp 和 px 之间的 转换

14 | * */ 15 | public class DesityUtil { 16 | 17 | /** 18 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素) 19 | */ 20 | public static int dip2px(Context context, float dpValue) { 21 | final float scale = context.getResources().getDisplayMetrics().density; 22 | Log.e("desitiny", scale +""); 23 | return (int) (dpValue * scale /1.5 + 0.5f); 24 | } 25 | 26 | /** 27 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp 28 | */ 29 | public static int px2dip(Context context, float pxValue) { 30 | final float scale = context.getResources().getDisplayMetrics().density; 31 | return (int) (pxValue / scale + 0.5f); 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /CacheFoundation/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /CacheFoundation/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /CacheFoundation/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CacheFoundation/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/CacheFoundation/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /CacheFoundation/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AndroidCacheFoundation 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AndroidCacheFoundation 2 | ====================== 3 | 4 | AndroidCacheFoundation 5 | 6 | ### Function 7 | This is a Base Library for android http request via Google Volley and easy Cache them. 8 | 9 | ### Intro 10 | Provides Volley Base GET & POST Method and transform them by using GOOGLE GSON. It's very easy to use this 11 | Foundation Parse JSON to entity and Cache them , You just care about the app work request network via VolleyHttpClient get post 12 | method etc. All Cache will done.(include pics). We cache picture by using ImageLoader, which you should not worry about that,the foundation 13 | has already provide that. 14 | 15 | ### USE Extra Libs 16 | 17 | If you are using android studio and with gradle works well,you won't care about this, all this done by android studio. 18 | 19 | OtherWise ,if you are using eclispe or other.this CacheFoundataion use these extras libs: 20 | 21 | 1. Volley http request & cache 22 | 2. ViewPagerIndicator show Tabs 23 | 3. XListView show pull to refresh and load more 24 | 4. universal image loader (UIL) cache image 25 | 5. umeng sdk to analy your user data 26 | 6. roboguice to make your application more easy and clear. use @InjectView 27 | 7. Gson googel gson to parse json more easy and quick 28 | 29 | ### More 30 | 31 | The Foundation also provide common UI like pull to refresh ,lovely toast ,base activity with swipeback and useful utility Class. 32 | this help you easy and quick to build a app. 33 | ddd 34 | ### The DEMO 35 | 36 | Demo provide Tab + ViewPager Style. 37 | 38 | 39 | 40 | ### Pics 41 | 42 | Pic1 43 | ![Alt text](1.png "Optional title") 44 | 45 | - - - 46 | 47 | Pic2 48 | ![Alt text](2.png "Optional title") 49 | 50 | - - - 51 | 52 | Pic3 53 | ![Alt text](3.png "Optional title") 54 | 55 | - - - 56 | 57 | Pic4 58 | ![Alt text](4.png "Optional title") -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | 3 | dependencies { 4 | compile 'com.android.support:support-v4:18.0.+' 5 | 6 | } 7 | 8 | android { 9 | compileSdkVersion 18 10 | buildToolsVersion '19.0.1' 11 | 12 | sourceSets { 13 | main { 14 | manifest.srcFile 'AndroidManifest.xml' 15 | java.srcDirs = ['src'] 16 | res.srcDirs = ['res'] 17 | } 18 | 19 | } 20 | defaultConfig { 21 | minSdkVersion 9 22 | targetSdkVersion 18 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/classes.jar -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/color/vpi__dark_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/color/vpi__light_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_selected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_selected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_unselected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_unselected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_selected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_selected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_unselected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_unselected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_selected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_selected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/bundles/debug/res/drawable/vpi__tab_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/BuildConfig.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator$SavedState$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator$SavedState$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator$SavedState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator$SavedState.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/CirclePageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IconPageIndicator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IconPageIndicator$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IconPageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IconPageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IconPagerAdapter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IconPagerAdapter.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IcsLinearLayout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/IcsLinearLayout.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator$SavedState$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator$SavedState$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator$SavedState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator$SavedState.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/LinePageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/PageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/PageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$attr.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$bool.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$bool.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$color.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$color.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$dimen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$dimen.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$drawable.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$id.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$integer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$integer.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$style.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$styleable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R$styleable.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/R.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$2.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$OnTabReselectedListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$OnTabReselectedListener.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$TabView.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator$TabView.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TabPageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$IndicatorStyle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$IndicatorStyle.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$LinePosition.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$LinePosition.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$OnCenterItemClickListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$OnCenterItemClickListener.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$SavedState$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$SavedState$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$SavedState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator$SavedState.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/TitlePageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$2.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$SavedState$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$SavedState$1.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$SavedState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator$SavedState.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/classes/debug/com/viewpagerindicator/UnderlinePageIndicator.class -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/incremental/aidl/debug/dependency.store: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/incremental/mergeAssets/debug/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/libs/Android-ViewPagerIndicator-debug.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/build/libs/Android-ViewPagerIndicator-debug.aar -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/source/buildConfig/debug/com/viewpagerindicator/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Automatically generated file. DO NOT MODIFY 3 | */ 4 | package com.viewpagerindicator; 5 | 6 | public final class BuildConfig { 7 | public static final boolean DEBUG = Boolean.parseBoolean("true"); 8 | public static final String PACKAGE_NAME = "com.viewpagerindicator"; 9 | public static final String BUILD_TYPE = "debug"; 10 | public static final String FLAVOR = ""; 11 | public static final int VERSION_CODE = 65; 12 | } 13 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/source/buildConfig/release/com/viewpagerindicator/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Automatically generated file. DO NOT MODIFY 3 | */ 4 | package com.viewpagerindicator; 5 | 6 | public final class BuildConfig { 7 | public static final boolean DEBUG = false; 8 | public static final String PACKAGE_NAME = "com.viewpagerindicator"; 9 | public static final String BUILD_TYPE = "release"; 10 | public static final String FLAVOR = ""; 11 | public static final int VERSION_CODE = 65; 12 | } 13 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/build/tmp/packageDebugJar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | library 7 | Android-ViewPagerIndicator 8 | apklib 9 | 10 | 11 | com.viewpagerindicator 12 | parent 13 | 2.4.1 14 | ../pom.xml 15 | 16 | 17 | 18 | 19 | com.google.android 20 | android 21 | provided 22 | 23 | 24 | 25 | com.google.android 26 | support-v4 27 | 28 | 29 | 30 | 31 | src 32 | 33 | 34 | 35 | com.jayway.maven.plugins.android.generation2 36 | android-maven-plugin 37 | true 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-checkstyle-plugin 43 | 44 | ../checkstyle.xml 45 | 46 | 47 | 48 | verify 49 | 50 | checkstyle 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/color/vpi__dark_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/color/vpi__light_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_selected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_selected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_unselected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_unselected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_selected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_selected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_unselected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_unselected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_selected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_selected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/Android-ViewPagerIndicator/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/drawable/vpi__tab_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/values/vpi__colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | #ff000000 19 | #fff3f3f3 20 | @color/vpi__background_holo_light 21 | @color/vpi__background_holo_dark 22 | #ff4c4c4c 23 | #ffb2b2b2 24 | @color/vpi__bright_foreground_holo_light 25 | @color/vpi__bright_foreground_holo_dark 26 | 27 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/values/vpi__defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | true 19 | #FFFFFFFF 20 | #00000000 21 | 0 22 | 3dp 23 | false 24 | #FFDDDDDD 25 | 1dp 26 | 27 | 12dp 28 | 4dp 29 | 1dp 30 | #FF33B5E5 31 | #FFBBBBBB 32 | true 33 | 34 | 4dp 35 | #FF33B5E5 36 | 2dp 37 | 2 38 | 4dp 39 | 20dp 40 | 7dp 41 | 0 42 | #FFFFFFFF 43 | true 44 | #BBFFFFFF 45 | 15dp 46 | 5dp 47 | 7dp 48 | 49 | true 50 | 300 51 | 400 52 | #FF33B5E5 53 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/res/values/vpi__styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 22 | 23 | 25 | 26 | 37 | 38 | 42 | 43 | 47 | 48 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/src/com/viewpagerindicator/IconPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.viewpagerindicator; 2 | 3 | public interface IconPagerAdapter { 4 | /** 5 | * Get icon representing the page at {@code index} in the adapter. 6 | */ 7 | int getIconResId(int index); 8 | 9 | // From PagerAdapter 10 | int getCount(); 11 | } 12 | -------------------------------------------------------------------------------- /UiLibs/Android-ViewPagerIndicator/src/com/viewpagerindicator/PageIndicator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Patrik Akerfeldt 3 | * Copyright (C) 2011 Jake Wharton 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.viewpagerindicator; 19 | 20 | import android.support.v4.view.ViewPager; 21 | 22 | /** 23 | * A PageIndicator is responsible to show an visual indicator on the total views 24 | * number and the current visible view. 25 | */ 26 | public interface PageIndicator extends ViewPager.OnPageChangeListener { 27 | /** 28 | * Bind the indicator to a ViewPager. 29 | * 30 | * @param view 31 | */ 32 | void setViewPager(ViewPager view); 33 | 34 | /** 35 | * Bind the indicator to a ViewPager. 36 | * 37 | * @param view 38 | * @param initialPosition 39 | */ 40 | void setViewPager(ViewPager view, int initialPosition); 41 | 42 | /** 43 | *

Set the current page of both the ViewPager and indicator.

44 | * 45 | *

This must be used if you need to set the page before 46 | * the views are drawn on screen (e.g., default start page).

47 | * 48 | * @param item 49 | */ 50 | void setCurrentItem(int item); 51 | 52 | /** 53 | * Set a page change listener which will receive forwarded events. 54 | * 55 | * @param listener 56 | */ 57 | void setOnPageChangeListener(ViewPager.OnPageChangeListener listener); 58 | 59 | /** 60 | * Notify the indicator that the fragment list has changed. 61 | */ 62 | void notifyDataSetChanged(); 63 | } 64 | -------------------------------------------------------------------------------- /UiLibs/XListView/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /UiLibs/XListView/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | 3 | android { 4 | compileSdkVersion 18 5 | buildToolsVersion "19.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 9 9 | targetSdkVersion 18 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | runProguard false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:support-v4:18.0.+' 23 | compile fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 24 | } 25 | -------------------------------------------------------------------------------- /UiLibs/XListView/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Jackrex/Developer/Dev/adt-bundle-mac-x86_64-20130917/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 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 | #} -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/java/info/jackrex/xlistview/XListViewFooter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014. 3 | * Jackrex 4 | */ 5 | 6 | /** 7 | * @file XFooterView.java 8 | * @create Mar 31, 2012 9:33:43 PM 9 | * @author Maxwin 10 | * @description XListView's footer 11 | */ 12 | package info.jackrex.xlistview; 13 | 14 | import android.content.Context; 15 | import android.util.AttributeSet; 16 | import android.view.LayoutInflater; 17 | import android.view.View; 18 | import android.widget.LinearLayout; 19 | import android.widget.TextView; 20 | 21 | import cn.cafecar.android.xlistview.R; 22 | 23 | 24 | public class XListViewFooter extends LinearLayout { 25 | public final static int STATE_NORMAL = 0; 26 | public final static int STATE_READY = 1; 27 | public final static int STATE_LOADING = 2; 28 | 29 | private Context mContext; 30 | 31 | private View mContentView; 32 | private View mProgressBar; 33 | private TextView mHintView; 34 | 35 | public XListViewFooter(Context context) { 36 | super(context); 37 | initView(context); 38 | } 39 | 40 | public XListViewFooter(Context context, AttributeSet attrs) { 41 | super(context, attrs); 42 | initView(context); 43 | } 44 | 45 | 46 | public void setState(int state) { 47 | mHintView.setVisibility(View.INVISIBLE); 48 | mProgressBar.setVisibility(View.INVISIBLE); 49 | mHintView.setVisibility(View.INVISIBLE); 50 | if (state == STATE_READY) { 51 | mHintView.setVisibility(View.VISIBLE); 52 | mHintView.setText(R.string.xlistview_footer_hint_ready); 53 | } else if (state == STATE_LOADING) { 54 | mProgressBar.setVisibility(View.VISIBLE); 55 | } else { 56 | mHintView.setVisibility(View.VISIBLE); 57 | mHintView.setText(R.string.xlistview_footer_hint_normal); 58 | } 59 | } 60 | 61 | 62 | 63 | public void setVisiable(int v){ 64 | 65 | mHintView.setVisibility(v); 66 | mProgressBar.setVisibility(v); 67 | 68 | } 69 | 70 | 71 | 72 | 73 | 74 | 75 | public void setBottomMargin(int height) { 76 | if (height < 0) return ; 77 | LayoutParams lp = (LayoutParams)mContentView.getLayoutParams(); 78 | lp.bottomMargin = height; 79 | mContentView.setLayoutParams(lp); 80 | } 81 | 82 | public int getBottomMargin() { 83 | LayoutParams lp = (LayoutParams)mContentView.getLayoutParams(); 84 | return lp.bottomMargin; 85 | } 86 | 87 | /** 88 | * normal status 89 | */ 90 | public void normal() { 91 | mHintView.setVisibility(View.VISIBLE); 92 | mProgressBar.setVisibility(View.GONE); 93 | } 94 | 95 | 96 | /** 97 | * loading status 98 | */ 99 | public void loading() { 100 | mHintView.setVisibility(View.GONE); 101 | mProgressBar.setVisibility(View.VISIBLE); 102 | } 103 | 104 | /** 105 | * hide footer when disable pull load more 106 | */ 107 | public void hide() { 108 | LayoutParams lp = (LayoutParams)mContentView.getLayoutParams(); 109 | lp.height = 0; 110 | mContentView.setLayoutParams(lp); 111 | } 112 | 113 | /** 114 | * show footer 115 | */ 116 | public void show() { 117 | LayoutParams lp = (LayoutParams)mContentView.getLayoutParams(); 118 | lp.height = LayoutParams.WRAP_CONTENT; 119 | mContentView.setLayoutParams(lp); 120 | } 121 | 122 | private void initView(Context context) { 123 | mContext = context; 124 | LinearLayout moreView = (LinearLayout)LayoutInflater.from(mContext).inflate(R.layout.xlistview_footer, null); 125 | addView(moreView); 126 | moreView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); 127 | 128 | mContentView = moreView.findViewById(R.id.xlistview_footer_content); 129 | mProgressBar = moreView.findViewById(R.id.xlistview_footer_progressbar); 130 | mHintView = (TextView)moreView.findViewById(R.id.xlistview_footer_hint_textview); 131 | } 132 | 133 | 134 | } 135 | -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/java/info/jackrex/xlistview/XListViewHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014. 3 | * Jackrex 4 | */ 5 | 6 | /** 7 | * @file XListViewHeader.java 8 | * @create Apr 18, 2012 5:22:27 PM 9 | * @author Maxwin 10 | * @description XListView's header 11 | */ 12 | package info.jackrex.xlistview; 13 | 14 | import android.content.Context; 15 | import android.util.AttributeSet; 16 | import android.view.Gravity; 17 | import android.view.LayoutInflater; 18 | import android.view.View; 19 | import android.view.animation.Animation; 20 | import android.view.animation.RotateAnimation; 21 | import android.widget.ImageView; 22 | import android.widget.LinearLayout; 23 | import android.widget.ProgressBar; 24 | import android.widget.TextView; 25 | 26 | import cn.cafecar.android.xlistview.R; 27 | 28 | 29 | public class XListViewHeader extends LinearLayout { 30 | private LinearLayout mContainer; 31 | private ImageView mArrowImageView; 32 | private ProgressBar mProgressBar; 33 | private TextView mHintTextView; 34 | private int mState = STATE_NORMAL; 35 | 36 | private Animation mRotateUpAnim; 37 | private Animation mRotateDownAnim; 38 | 39 | private final int ROTATE_ANIM_DURATION = 180; 40 | 41 | public final static int STATE_NORMAL = 0; 42 | public final static int STATE_READY = 1; 43 | public final static int STATE_REFRESHING = 2; 44 | 45 | public XListViewHeader(Context context) { 46 | super(context); 47 | initView(context); 48 | } 49 | 50 | /** 51 | * @param context 52 | * @param attrs 53 | */ 54 | public XListViewHeader(Context context, AttributeSet attrs) { 55 | super(context, attrs); 56 | initView(context); 57 | } 58 | 59 | private void initView(Context context) { 60 | // 初始情况,设置下拉刷新view高度为0 61 | LayoutParams lp = new LayoutParams( 62 | LayoutParams.FILL_PARENT, 0); 63 | mContainer = (LinearLayout) LayoutInflater.from(context).inflate( 64 | R.layout.xlistview_header, null); 65 | addView(mContainer, lp); 66 | setGravity(Gravity.BOTTOM); 67 | 68 | mArrowImageView = (ImageView)findViewById(R.id.xlistview_header_arrow); 69 | mHintTextView = (TextView)findViewById(R.id.xlistview_header_hint_textview); 70 | mProgressBar = (ProgressBar)findViewById(R.id.xlistview_header_progressbar); 71 | 72 | mRotateUpAnim = new RotateAnimation(0.0f, -180.0f, 73 | Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 74 | 0.5f); 75 | mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION); 76 | mRotateUpAnim.setFillAfter(true); 77 | mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f, 78 | Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 79 | 0.5f); 80 | mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION); 81 | mRotateDownAnim.setFillAfter(true); 82 | } 83 | 84 | public void setState(int state) { 85 | if (state == mState) return ; 86 | 87 | if (state == STATE_REFRESHING) { // 显示进度 88 | mArrowImageView.clearAnimation(); 89 | mArrowImageView.setVisibility(View.INVISIBLE); 90 | mProgressBar.setVisibility(View.VISIBLE); 91 | } else { // 显示箭头图片 92 | mArrowImageView.setVisibility(View.VISIBLE); 93 | mProgressBar.setVisibility(View.INVISIBLE); 94 | } 95 | 96 | switch(state){ 97 | case STATE_NORMAL: 98 | if (mState == STATE_READY) { 99 | mArrowImageView.startAnimation(mRotateDownAnim); 100 | } 101 | if (mState == STATE_REFRESHING) { 102 | mArrowImageView.clearAnimation(); 103 | } 104 | mHintTextView.setText(R.string.xlistview_header_hint_normal); 105 | break; 106 | case STATE_READY: 107 | if (mState != STATE_READY) { 108 | mArrowImageView.clearAnimation(); 109 | mArrowImageView.startAnimation(mRotateUpAnim); 110 | mHintTextView.setText(R.string.xlistview_header_hint_ready); 111 | } 112 | break; 113 | case STATE_REFRESHING: 114 | mHintTextView.setText(R.string.xlistview_header_hint_loading); 115 | break; 116 | default: 117 | } 118 | 119 | mState = state; 120 | } 121 | 122 | public void setVisiableHeight(int height) { 123 | if (height < 0) 124 | height = 0; 125 | 126 | 127 | if(height>=400){ 128 | height=400; 129 | } 130 | 131 | LayoutParams lp = (LayoutParams) mContainer 132 | .getLayoutParams(); 133 | lp.height = height; 134 | mContainer.setLayoutParams(lp); 135 | } 136 | 137 | public int getVisiableHeight() { 138 | return mContainer.getHeight(); 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/XListView/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/XListView/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/XListView/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/drawable-xhdpi/xlistview_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/XListView/src/main/res/drawable-xhdpi/xlistview_arrow.png -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/UiLibs/XListView/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/layout/xlistview_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 19 | 20 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/layout/xlistview_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 27 | 28 | 34 | 35 | 40 | 41 | 46 | 47 | 48 | 49 | 57 | 58 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /UiLibs/XListView/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | WorkCafecar 3 | 4 | 5 | 下拉刷新 6 | 松开刷新数据 7 | 正在加载... 8 | 上次更新时间: 9 | 上拉显示更多 10 | 松开载入更多 11 | 12 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "19.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 9 9 | targetSdkVersion 19 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | runProguard false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:appcompat-v7:+' 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile project(':CacheFoundation') 25 | compile project(':application') 26 | compile project(':UiLibs:XListView') 27 | compile project(':framework') 28 | } 29 | -------------------------------------------------------------------------------- /app/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Jackrex/Developer/Dev/adt-bundle-mac-x86_64-20130917/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 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 | #} -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/MainActivity.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.os.Message; 6 | import android.util.Log; 7 | import android.view.KeyEvent; 8 | import android.view.LayoutInflater; 9 | import android.view.Menu; 10 | import android.view.MenuItem; 11 | import android.view.View; 12 | import android.widget.TabHost; 13 | import android.widget.Toast; 14 | 15 | import java.util.ArrayList; 16 | 17 | import roboguice.activity.RoboFragmentActivity; 18 | 19 | public class MainActivity extends RoboFragmentActivity implements TabHost.OnTabChangeListener { 20 | 21 | private TabHost tabHost; 22 | private MyViewPager viewPager; 23 | private ArrayList tabInfos; 24 | 25 | private LayoutInflater inflater; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_main); 31 | inflater = LayoutInflater.from(getApplicationContext()); 32 | showTabs(); 33 | } 34 | 35 | 36 | private void showTabs() { 37 | initTabInfo(); 38 | tabHost = (TabHost) findViewById(android.R.id.tabhost); 39 | tabHost.setOnTabChangedListener(this); 40 | tabHost.setup(); 41 | 42 | viewPager = (MyViewPager) findViewById(R.id.viewpager); 43 | viewPager.setOffscreenPageLimit(5); 44 | viewPager.setAdapter(new TabAdapter(this, viewPager, tabInfos)); 45 | viewPager.setSwipeEnabled(false); 46 | 47 | for (TabInfo tabInfo : tabInfos) { 48 | TabHost.TabSpec tabSpec = tabHost.newTabSpec(tabInfo.getId()); 49 | tabSpec.setIndicator(tabInfo.getIndicatorView()); 50 | tabSpec.setContent(new TabHost.TabContentFactory() { 51 | 52 | @Override 53 | public View createTabContent(String arg0) { 54 | View v = new View(MainActivity.this); 55 | v.setMinimumWidth(0); 56 | v.setMinimumHeight(0); 57 | return v; 58 | } 59 | }); 60 | tabHost.addTab(tabSpec); 61 | } 62 | 63 | } 64 | 65 | private void initTabInfo() { 66 | tabInfos = new ArrayList(); 67 | View indexIndicator = inflater.inflate(R.layout.tab1, null); 68 | View indexIndicator2 = inflater.inflate(R.layout.tab1, null); 69 | View indexIndicator3 = inflater.inflate(R.layout.tab1, null); 70 | View indexIndicator4 = inflater.inflate(R.layout.tab1, null); 71 | View indexIndicator5 = inflater.inflate(R.layout.tab1, null); 72 | tabInfos.add(new TabInfo("index1", Fragment1.class.getName(), indexIndicator)); 73 | tabInfos.add(new TabInfo("index2", Fragment1.class.getName(), indexIndicator2)); 74 | tabInfos.add(new TabInfo("index3", Fragment1.class.getName(), indexIndicator3)); 75 | tabInfos.add(new TabInfo("index4", Fragment1.class.getName(), indexIndicator4)); 76 | tabInfos.add(new TabInfo("index5", Fragment1.class.getName(), indexIndicator5)); 77 | } 78 | 79 | 80 | @Override 81 | public boolean onCreateOptionsMenu(Menu menu) { 82 | 83 | // Inflate the menu; this adds items to the action bar if it is present. 84 | getMenuInflater().inflate(R.menu.main, menu); 85 | return true; 86 | } 87 | 88 | @Override 89 | public boolean onOptionsItemSelected(MenuItem item) { 90 | // Handle action bar item clicks here. The action bar will 91 | // automatically handle clicks on the Home/Up button, so long 92 | // as you specify a parent activity in AndroidManifest.xml. 93 | int id = item.getItemId(); 94 | if (id == R.id.action_settings) { 95 | return true; 96 | } 97 | return super.onOptionsItemSelected(item); 98 | } 99 | 100 | 101 | 102 | private boolean isExit; 103 | 104 | Handler mHandler = new Handler(){ 105 | @Override 106 | public void handleMessage(Message msg) { 107 | super.handleMessage(msg); 108 | isExit=false; 109 | } 110 | 111 | }; 112 | @Override 113 | public boolean onKeyDown(int keyCode, KeyEvent event) { 114 | // TODO Auto-generated method stub 115 | if(keyCode == KeyEvent.KEYCODE_BACK){ 116 | if(!isExit){ 117 | isExit=true; 118 | Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show(); 119 | //利用handler延迟发送更改状态信息 120 | mHandler.sendEmptyMessageDelayed(0, 2000); 121 | } 122 | else{ 123 | finish(); 124 | // System.exit(0); 125 | } 126 | } 127 | return false; 128 | } 129 | 130 | @Override 131 | public void onTabChanged(String tabId) { 132 | 133 | Log.e(tabId,tabId); 134 | 135 | 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/MyViewPager.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | /** 9 | * Created by Jackrex on 3/30/14. 10 | */ 11 | public class MyViewPager extends ViewPager { 12 | 13 | private boolean mSwipeEnabled; 14 | 15 | public MyViewPager(Context context, AttributeSet attrs) { 16 | super(context, attrs); 17 | } 18 | 19 | public MyViewPager(Context context) { 20 | this(context,null); 21 | } 22 | 23 | 24 | public boolean isSwipeEnabled() { 25 | return mSwipeEnabled; 26 | } 27 | 28 | @Override 29 | public boolean onInterceptTouchEvent(MotionEvent ev) { 30 | if (!mSwipeEnabled) { 31 | return false; 32 | } 33 | return super.onInterceptTouchEvent(ev); 34 | } 35 | 36 | @Override 37 | public boolean onTouchEvent(MotionEvent ev) { 38 | if (!mSwipeEnabled) { 39 | return false; 40 | } 41 | return super.onTouchEvent(ev); 42 | } 43 | 44 | public void setSwipeEnabled(boolean swipeEnabled) { 45 | if (mSwipeEnabled == swipeEnabled) { 46 | return; 47 | } 48 | mSwipeEnabled = swipeEnabled; 49 | if (!swipeEnabled) { 50 | MotionEvent event = MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0); 51 | super.onTouchEvent(event); 52 | event.recycle(); 53 | } 54 | } 55 | 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/TabAdapter.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app; 2 | 3 | import android.content.Context; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentActivity; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | import android.support.v4.view.ViewPager; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Jackrex on 3/30/14. 14 | */ 15 | public class TabAdapter extends FragmentPagerAdapter implements 16 | ViewPager.OnPageChangeListener { 17 | private final Context mContext; 18 | private final List mTabs; 19 | private ArrayList fragments; 20 | 21 | public TabAdapter(FragmentActivity activity, ViewPager pager, List tabs) { 22 | super(activity.getSupportFragmentManager()); 23 | mContext = activity; 24 | mTabs = tabs; 25 | fragments = new ArrayList(); 26 | } 27 | 28 | @Override 29 | public int getCount() { 30 | return mTabs.size(); 31 | } 32 | 33 | @Override 34 | public Fragment getItem(int position) { 35 | TabInfo info = mTabs.get(position); 36 | return Fragment.instantiate(mContext, info.getFragmentClazz()); 37 | } 38 | 39 | @Override 40 | public void onPageScrolled(int position, float positionOffset, 41 | int positionOffsetPixels) { 42 | } 43 | 44 | @Override 45 | public void onPageSelected(int position) { 46 | 47 | } 48 | 49 | @Override 50 | public void onPageScrollStateChanged(int state) { 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/TabInfo.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by Jackrex on 3/30/14. 7 | */ 8 | public class TabInfo { 9 | 10 | private final String id; 11 | private final String fragmentClazz; 12 | private final View indicatorView; 13 | 14 | public TabInfo(String id, String fragmentClazz, View indicatorView) { 15 | this.id = id; 16 | this.fragmentClazz = fragmentClazz; 17 | this.indicatorView = indicatorView; 18 | } 19 | 20 | public String getId() { 21 | return id; 22 | } 23 | 24 | public String getFragmentClazz() { 25 | return fragmentClazz; 26 | } 27 | 28 | public View getIndicatorView() { 29 | return indicatorView; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/adapter/CarNewsAdapter.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.adapter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.BaseAdapter; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.nostra13.universalimageloader.core.ImageLoader; 13 | import com.nostra13.universalimageloader.core.assist.FailReason; 14 | import com.nostra13.universalimageloader.core.assist.ImageLoadingListener; 15 | 16 | import java.util.List; 17 | 18 | import info.jackrex.androidcachefoundation.app.R; 19 | import info.jackrex.androidcachefoundation.app.entity.News; 20 | import info.jackrex.androidcachefoundation.cachefoundation.utils.Date.DateUtil; 21 | 22 | 23 | /** 24 | * Created by Jackrex on 3/13/14. 25 | */ 26 | public class CarNewsAdapter extends BaseAdapter { 27 | 28 | private Context context = null; 29 | private LayoutInflater inflater = null; 30 | private ImageView imageView; 31 | private List newsList; 32 | 33 | 34 | public CarNewsAdapter(Context context, List newsList) { 35 | this.context = context; 36 | this.newsList = newsList; 37 | inflater = LayoutInflater.from(context); 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return newsList.size(); 43 | } 44 | 45 | @Override 46 | public Object getItem(int i) { 47 | return newsList.get(i); 48 | } 49 | 50 | @Override 51 | public long getItemId(int i) { 52 | return i; 53 | } 54 | 55 | @Override 56 | public View getView(int i, View view, ViewGroup viewGroup) { 57 | 58 | 59 | ViewHolder holder; 60 | if(view == null){ 61 | view = inflater.inflate(R.layout.item_news,null); 62 | holder = new ViewHolder(); 63 | holder.iv_pic = (ImageView) view.findViewById(R.id.iv_pic); 64 | holder.tv_comment = (TextView) view.findViewById(R.id.tv_comment); 65 | holder.tv_time = (TextView) view.findViewById(R.id.tv_time); 66 | holder.tv_content = (TextView) view.findViewById(R.id.tv_content); 67 | 68 | view.setTag(holder); 69 | 70 | }else{ 71 | 72 | holder = (ViewHolder) view.getTag(); 73 | } 74 | 75 | imageView = holder.iv_pic; 76 | 77 | News news = newsList.get(i); 78 | 79 | holder.tv_content.setText(news.getTitle()); 80 | holder.tv_time.setText(DateUtil.friendly_time(news.getPublish_time())); 81 | holder.tv_comment.setText(news.getRead_time()+"评论"); 82 | 83 | 84 | ImageLoader.getInstance().displayImage(news.getImage(),holder.iv_pic ,new ImageLoadingListener(){ 85 | @Override 86 | public void onLoadingStarted(String s, View view) { 87 | 88 | } 89 | 90 | @Override 91 | public void onLoadingFailed(String s, View view, FailReason failReason) { 92 | 93 | imageView.setVisibility(View.GONE); 94 | 95 | } 96 | 97 | @Override 98 | public void onLoadingComplete(String s, View view, Bitmap bitmap) { 99 | 100 | if(bitmap!=null){ 101 | ((ImageView)view).setImageBitmap(bitmap); 102 | }else{ 103 | imageView.setVisibility(View.GONE); 104 | } 105 | 106 | } 107 | 108 | @Override 109 | public void onLoadingCancelled(String s, View view) { 110 | 111 | imageView.setVisibility(View.GONE); 112 | 113 | } 114 | }); 115 | 116 | 117 | return view; 118 | } 119 | 120 | 121 | 122 | class ViewHolder { 123 | 124 | ImageView iv_pic; 125 | TextView tv_content, tv_time,tv_comment; 126 | 127 | 128 | 129 | 130 | } 131 | 132 | public void setNewsList(List newsList) { 133 | this.newsList = newsList; 134 | notifyDataSetChanged(); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/adapter/PopWindowAdapter.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.BaseAdapter; 8 | import android.widget.ImageView; 9 | import android.widget.RelativeLayout; 10 | import android.widget.TextView; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | import info.jackrex.androidcachefoundation.app.R; 16 | 17 | /** 18 | * Created by Jackrex on 4/2/14. 19 | */ 20 | public class PopWindowAdapter extends BaseAdapter { 21 | 22 | List itemList = new ArrayList(); 23 | final Context context; 24 | 25 | 26 | public PopWindowAdapter(Context context, List itemList) { 27 | this.context = context; 28 | this.itemList = itemList; 29 | } 30 | 31 | @Override 32 | public int getCount() { 33 | return itemList.size()+1; 34 | } 35 | 36 | @Override 37 | public Object getItem(int position) { 38 | return itemList.get(position); 39 | } 40 | 41 | @Override 42 | public long getItemId(int position) { 43 | return 0; 44 | } 45 | 46 | @Override 47 | public View getView(int position, View convertView, ViewGroup parent) { 48 | 49 | ViewHolder holder; 50 | if (convertView == null) { 51 | holder = new ViewHolder(); 52 | if (position >= itemList.size()){ 53 | //add 54 | convertView = LayoutInflater.from(context).inflate(R.layout.item_index_dialog_addcar, null); 55 | convertView.setOnClickListener(new View.OnClickListener() { 56 | 57 | @Override 58 | public void onClick(View v) { 59 | // TODO Auto-generated method stub 60 | 61 | 62 | 63 | 64 | 65 | 66 | } 67 | }); 68 | }else{ 69 | //edit 70 | convertView = LayoutInflater.from(context).inflate(R.layout.item_index_dialog_editcar, null); 71 | holder = new ViewHolder(); 72 | holder.ivCarImage = (ImageView)convertView.findViewById(R.id.ivCarImage); 73 | holder.tvCarBrand = (TextView)convertView.findViewById(R.id.tvCarBrand); 74 | holder.tvCarSeries=(TextView)convertView.findViewById(R.id.tvCarSeri); 75 | holder.editcar_divider=(RelativeLayout) convertView.findViewById(R.id.editcar_divider); 76 | 77 | if(position==itemList.size()-1){ 78 | holder.editcar_divider.setVisibility(View.INVISIBLE); 79 | } 80 | } 81 | convertView.setTag(holder); 82 | } else { 83 | holder = (ViewHolder) convertView.getTag(); 84 | } 85 | 86 | 87 | 88 | return convertView; 89 | 90 | } 91 | 92 | 93 | private final class ViewHolder { 94 | ImageView ivCarImage; 95 | TextView tvCarBrand,tvCarSeries; 96 | private RelativeLayout editcar_divider; 97 | 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/entity/News.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by Jackrex on 3/13/14. 7 | */ 8 | public class News implements Serializable { 9 | 10 | private int id; 11 | private String title; 12 | private String publish_time; 13 | private String summary; 14 | private String image; 15 | private String press; 16 | private String read_time; 17 | 18 | public int getId() { 19 | return id; 20 | } 21 | 22 | public void setId(int id) { 23 | this.id = id; 24 | } 25 | 26 | public String getTitle() { 27 | return title; 28 | } 29 | 30 | public void setTitle(String title) { 31 | this.title = title; 32 | } 33 | 34 | public String getPublish_time() { 35 | return publish_time; 36 | } 37 | 38 | public void setPublish_time(String publish_time) { 39 | this.publish_time = publish_time; 40 | } 41 | 42 | public String getSummary() { 43 | return summary; 44 | } 45 | 46 | public void setSummary(String summary) { 47 | this.summary = summary; 48 | } 49 | 50 | public String getImage() { 51 | return image; 52 | } 53 | 54 | public void setImage(String image) { 55 | this.image = image; 56 | } 57 | 58 | public String getPress() { 59 | return press; 60 | } 61 | 62 | public void setPress(String press) { 63 | this.press = press; 64 | } 65 | 66 | public String getRead_time() { 67 | return read_time; 68 | } 69 | 70 | public void setRead_time(String read_time) { 71 | this.read_time = read_time; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/entity/NewsContent.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.entity; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Jackrex on 3/13/14. 7 | */ 8 | public class NewsContent { 9 | 10 | private boolean has_next; 11 | private int total_count; 12 | private int next_page; 13 | private List list; 14 | 15 | public boolean isHas_next() { 16 | return has_next; 17 | } 18 | 19 | public void setHas_next(boolean has_next) { 20 | this.has_next = has_next; 21 | } 22 | 23 | public int getTotal_count() { 24 | return total_count; 25 | } 26 | 27 | public void setTotal_count(int total_count) { 28 | this.total_count = total_count; 29 | } 30 | 31 | public int getNext_page() { 32 | return next_page; 33 | } 34 | 35 | public void setNext_page(int next_page) { 36 | this.next_page = next_page; 37 | } 38 | 39 | public List getList() { 40 | return list; 41 | } 42 | 43 | public void setList(List list) { 44 | this.list = list; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/entity/NewsEntity.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by Jackrex on 3/13/14. 7 | */ 8 | public class NewsEntity implements Serializable { 9 | 10 | 11 | private NewsContent content; 12 | private String message; 13 | private int code; 14 | private boolean error; 15 | 16 | 17 | public NewsContent getContent() { 18 | return content; 19 | } 20 | 21 | public void setContent(NewsContent content) { 22 | this.content = content; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | 33 | public int getCode() { 34 | return code; 35 | } 36 | 37 | public void setCode(int code) { 38 | this.code = code; 39 | } 40 | 41 | public boolean isError() { 42 | return error; 43 | } 44 | 45 | public void setError(boolean error) { 46 | this.error = error; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/popwindow/AddPopWindow.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.popwindow; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.drawable.ColorDrawable; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.PopupWindow; 10 | 11 | import info.jackrex.androidcachefoundation.app.R; 12 | 13 | /** 14 | * Created by Jackrex on 4/1/14. 15 | */ 16 | public class AddPopWindow extends PopupWindow { 17 | 18 | 19 | public AddPopWindow(final Activity context,View.OnClickListener itemsOnClick) { 20 | super(context); 21 | LayoutInflater inflater = (LayoutInflater) context 22 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 23 | View mMenuView = inflater.inflate(R.layout.addmenu, null); 24 | 25 | int h = context.getWindowManager().getDefaultDisplay().getHeight(); 26 | int w = context.getWindowManager().getDefaultDisplay().getWidth(); 27 | //设置按钮监听 28 | //设置SelectPicPopupWindow的View 29 | this.setContentView(mMenuView); 30 | //设置SelectPicPopupWindow弹出窗体的宽 31 | this.setWidth(w/2+50); 32 | //设置SelectPicPopupWindow弹出窗体的高 33 | this.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); 34 | //设置SelectPicPopupWindow弹出窗体可点击 35 | this.setFocusable(true); 36 | //设置SelectPicPopupWindow弹出窗体动画效果 37 | 38 | //实例化一个ColorDrawable颜色为半透明 39 | ColorDrawable dw = new ColorDrawable(0000000000); 40 | //设置SelectPicPopupWindow弹出窗体的背景 41 | this.setBackgroundDrawable(dw); 42 | //mMenuView添加OnTouchListener监听判断获取触屏位置如果在选择框外面则销毁弹出框 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/popwindow/ListPopMenu.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.popwindow; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.BitmapDrawable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.AdapterView; 9 | import android.widget.BaseAdapter; 10 | import android.widget.ListView; 11 | import android.widget.PopupWindow; 12 | 13 | import info.jackrex.androidcachefoundation.app.R; 14 | 15 | /** 16 | * Created by Jackrex on 4/2/14. 17 | */ 18 | public class ListPopMenu { 19 | 20 | 21 | private Context context; 22 | private PopupWindow popupWindow; 23 | private ListView listView; 24 | 25 | public ListPopMenu(Context context, PopupWindow popupWindow) { 26 | this.context = context; 27 | this.popupWindow = popupWindow; 28 | } 29 | 30 | 31 | public ListPopMenu(Context context,BaseAdapter listAdapter,AdapterView.OnItemClickListener listener,PopupWindow.OnDismissListener dismissListener) { 32 | // TODO Auto-generated constructor stub 33 | this(context,R.layout.popdialog,listAdapter,listener,dismissListener,-1); 34 | } 35 | 36 | public ListPopMenu(Context context,int layout,BaseAdapter listAdapter,AdapterView.OnItemClickListener listener,PopupWindow.OnDismissListener dismissListener,int width) { 37 | // TODO Auto-generated constructor stub 38 | this.context = context; 39 | View view = LayoutInflater.from(context).inflate(layout, null); 40 | listView = (ListView)view.findViewById(R.id.lvlistview); 41 | listView.setAdapter(listAdapter); 42 | listView.setFocusableInTouchMode(true); 43 | listView.setFocusable(true); 44 | listView.setOnItemClickListener(listener); 45 | if (width == 0){ 46 | popupWindow = new PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); 47 | }else if (width == -1){ 48 | popupWindow = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); 49 | }else{ 50 | popupWindow = new PopupWindow(view, width, ViewGroup.LayoutParams.WRAP_CONTENT); 51 | } 52 | 53 | popupWindow.setBackgroundDrawable(new BitmapDrawable()); 54 | popupWindow.setOutsideTouchable(true); 55 | popupWindow.setOnDismissListener(dismissListener); 56 | 57 | } 58 | 59 | 60 | 61 | public void showAsDropDown(View parent) { 62 | popupWindow.showAsDropDown(parent); 63 | popupWindow.setFocusable(true); 64 | popupWindow.setOutsideTouchable(true); 65 | popupWindow.update(); 66 | } 67 | 68 | public void dismiss() { 69 | popupWindow.dismiss(); 70 | } 71 | 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/popwindow/SettingsPopWindow.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.popwindow; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.drawable.ColorDrawable; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.Button; 11 | import android.widget.LinearLayout; 12 | import android.widget.PopupWindow; 13 | 14 | import info.jackrex.androidcachefoundation.app.R; 15 | 16 | 17 | /** 18 | * Created by Jackrex on 4/1/14. 19 | */ 20 | public class SettingsPopWindow extends PopupWindow { 21 | 22 | 23 | private Activity activity; 24 | private View.OnClickListener listener; 25 | private Context context; 26 | 27 | public SettingsPopWindow(Context context, Activity activity, View.OnClickListener listener) { 28 | super(context); 29 | this.context = context; 30 | this.activity = activity; 31 | this.listener = listener; 32 | initView(); 33 | } 34 | 35 | private void initView() { 36 | 37 | LayoutInflater inflater = (LayoutInflater) context 38 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 39 | View mMenuView = inflater.inflate(R.layout.settingdialog, null); 40 | 41 | int h = activity.getWindowManager().getDefaultDisplay().getHeight(); 42 | int w = activity.getWindowManager().getDefaultDisplay().getWidth(); 43 | Button btn_cancel = (Button) mMenuView.findViewById(R.id.btn_cancel); 44 | //取消按钮 45 | btn_cancel.setOnClickListener(new View.OnClickListener() { 46 | 47 | public void onClick(View v) { 48 | 49 | 50 | } 51 | }); 52 | LinearLayout my_photo = (LinearLayout) mMenuView.findViewById(R.id.my_photo); 53 | my_photo.setOnClickListener(new View.OnClickListener() { 54 | public void onClick(View v) { 55 | Log.i("SelectPicPopupWindow", "我的相册"); 56 | dismiss(); 57 | } 58 | }); 59 | LinearLayout my_bank = (LinearLayout) mMenuView.findViewById(R.id.my_bank); 60 | //设置按钮监听 61 | //设置SelectPicPopupWindow的View 62 | this.setContentView(mMenuView); 63 | //设置SelectPicPopupWindow弹出窗体的宽 64 | this.setWidth(w/2+50); 65 | //设置SelectPicPopupWindow弹出窗体的高 66 | this.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); 67 | //设置SelectPicPopupWindow弹出窗体可点击 68 | this.setFocusable(true); 69 | //实例化一个ColorDrawable颜色为半透明 70 | ColorDrawable dw = new ColorDrawable(000000); 71 | //设置SelectPicPopupWindow弹出窗体的背景 72 | this.setBackgroundDrawable(dw); 73 | 74 | 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/info/jackrex/androidcachefoundation/app/view/HeaderView.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.app.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.LinearLayout; 9 | import android.widget.RelativeLayout; 10 | 11 | import info.jackrex.androidcachefoundation.app.R; 12 | 13 | /** 14 | * Created by Jackrex on 4/1/14. 15 | */ 16 | public class HeaderView extends RelativeLayout { 17 | 18 | public RelativeLayout middleRe; 19 | public ImageView add; 20 | public ImageView set; 21 | public View headerView; 22 | public LinearLayout setadd; 23 | 24 | 25 | 26 | public HeaderView(Context context) { 27 | super(context); 28 | initView(); 29 | } 30 | 31 | 32 | public HeaderView(Context context, AttributeSet attrs) { 33 | super(context, attrs); 34 | initView(); 35 | } 36 | 37 | 38 | public HeaderView(Context context, AttributeSet attrs, int defStyle) { 39 | super(context, attrs, defStyle); 40 | } 41 | 42 | private void initView() { 43 | 44 | headerView = LayoutInflater.from(getContext()).inflate(R.layout.homeheader, this); 45 | add = (ImageView) headerView.findViewById(R.id.add); 46 | set = (ImageView) headerView.findViewById(R.id.set); 47 | middleRe = (RelativeLayout) headerView.findViewById(R.id.middleRe); 48 | setadd = (LinearLayout)headerView.findViewById(R.id.setadd); 49 | 50 | 51 | 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/abc_ab_bottom_solid_dark_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/abc_ab_bottom_solid_dark_holo.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/abc_ab_stacked_transparent_dark_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/abc_ab_stacked_transparent_dark_holo.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_add_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/actionbar_add_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_camera_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/actionbar_camera_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_loud_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/actionbar_loud_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_more_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/actionbar_more_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/actionbar_search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/actionbar_search_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/bind_mcontact_reco_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/bind_mcontact_reco_friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/bind_qq_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/bind_qq_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/brand_default_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/brand_default_head.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/headshow1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/headshow1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/headshow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/headshow2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/headshow3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/headshow3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/headshow4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/headshow4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/headshow5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/headshow5.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/headshow6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/headshow6.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_talk2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/icon_talk2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_time2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/icon_time2x.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/tabbar_icon_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/tabbar_icon_home.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/tabbar_icon_home_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xhdpi/tabbar_icon_home_focus.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/tabicons_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tabicons_index_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 20 | 21 | 26 | 27 | 32 | 33 | 36 | 37 | 38 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 14 | 15 | 16 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/homeheader.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 12 | 13 | 20 | 21 | 25 | 26 | 33 | 34 | 35 | 36 | 42 | 43 | 53 | 54 | 64 | 65 | 66 | 67 | 68 | 75 | 76 | 77 | 78 | 79 | 85 | 86 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /app/src/main/res/layout/indexadapter.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 23 | 24 | 30 | 31 | 42 | 43 | 44 | 54 | 55 | 56 | 66 | 67 | 73 | 74 | 75 | 76 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_index_dialog_addcar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 10 | 11 | 16 | 17 | 18 | 19 | 28 | 29 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_index_dialog_editcar.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 23 | 24 | 30 | 31 | 42 | 43 | 44 | 54 | 55 | 56 | 65 | 66 | 72 | 73 | 74 | 75 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 26 | 27 | 34 | 35 | 46 | 47 | 48 | 49 | 50 | 60 | 61 | 70 | 71 | 82 | 83 | 93 | 94 | 104 | 105 | 106 | 107 | 111 | 112 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /app/src/main/res/layout/popdialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 14 | 15 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/tab1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 15 | 16 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AndroidCacheFoundation 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /application/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /application/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | 3 | android { 4 | compileSdkVersion 18 5 | buildToolsVersion "19.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 8 9 | targetSdkVersion 16 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | buildTypes { 15 | release { 16 | runProguard false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.android.support:appcompat-v7:+' 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | compile project (':CacheFoundation') 26 | } 27 | -------------------------------------------------------------------------------- /application/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Jackrex/Developer/Dev/adt-bundle-mac-x86_64-20130917/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 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 | #} -------------------------------------------------------------------------------- /application/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/src/main/java/info/jackrex/androidcachefoundation/application/MyApplication.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.application; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.nostra13.universalimageloader.cache.disc.DiscCacheAware; 7 | import com.nostra13.universalimageloader.cache.disc.impl.TotalSizeLimitedDiscCache; 8 | import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator; 9 | import com.nostra13.universalimageloader.cache.memory.impl.UsingFreqLimitedMemoryCache; 10 | import com.nostra13.universalimageloader.core.DisplayImageOptions; 11 | import com.nostra13.universalimageloader.core.ImageLoader; 12 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; 13 | import com.nostra13.universalimageloader.utils.StorageUtils; 14 | 15 | import java.io.File; 16 | 17 | import info.jackrex.androidcachefoundation.cachefoundation.cache.DataCache; 18 | import info.jackrex.androidcachefoundation.cachefoundation.cache.SharePreferenceStorageService; 19 | import info.jackrex.androidcachefoundation.cachefoundation.http.HttpService; 20 | import info.jackrex.androidcachefoundation.cachefoundation.http.VolleyHttpClient; 21 | 22 | /** 23 | * Created by Jackrex on 3/30/14. 24 | */ 25 | public class MyApplication extends Application { 26 | 27 | public static HttpService httpService; 28 | public static SharePreferenceStorageService preferenceStorageService; 29 | public static VolleyHttpClient volleyHttpClient; 30 | 31 | public static DiscCacheAware cache; 32 | public static DisplayImageOptions options; 33 | 34 | private static Context context; 35 | @Override 36 | public void onCreate() { 37 | super.onCreate(); 38 | 39 | httpService = HttpService.newInstance(getApplicationContext()); 40 | preferenceStorageService = SharePreferenceStorageService.newInstance(getApplicationContext()); 41 | DataCache.newInstance(getApplicationContext()); 42 | volleyHttpClient = VolleyHttpClient.newInstance(httpService); 43 | context = this.getApplicationContext(); 44 | setupUIL(); 45 | 46 | } 47 | 48 | 49 | public static Context getContext() { 50 | return context; 51 | } 52 | 53 | /** 54 | * Universal Image Loader Setup 55 | */ 56 | private void setupUIL() { 57 | File cacheDir = StorageUtils.getOwnCacheDirectory( 58 | getApplicationContext(), "CafeCar/cache"); 59 | options = new DisplayImageOptions.Builder() 60 | .cacheOnDisc(true).cacheInMemory(true).build(); 61 | cache = new TotalSizeLimitedDiscCache(cacheDir, 50 * 1024 * 1024); 62 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder( 63 | getApplicationContext()).threadPoolSize(3) 64 | .threadPriority(Thread.NORM_PRIORITY - 1) 65 | .denyCacheImageMultipleSizesInMemory() 66 | .memoryCache(new UsingFreqLimitedMemoryCache(2 * 1024 * 1024)) 67 | // You can pass your own memory cache implementation 68 | .discCache(cache) 69 | // You can pass your own disc cache implementation 70 | .discCacheFileNameGenerator(new HashCodeFileNameGenerator()) 71 | .defaultDisplayImageOptions(options).build(); 72 | ImageLoader.getInstance().init(config); 73 | } 74 | 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /application/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/application/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /application/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/application/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /application/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/application/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /application/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/application/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /application/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AndroidCacheFoundation 3 | 4 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:0.9.+' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | mavenCentral() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /framework/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /framework/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | 3 | android { 4 | compileSdkVersion 18 5 | buildToolsVersion "19.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 8 9 | targetSdkVersion 16 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | buildTypes { 15 | release { 16 | runProguard false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.android.support:appcompat-v7:+' 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | } 26 | -------------------------------------------------------------------------------- /framework/libs/guice-3.0-no_aop.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/libs/guice-3.0-no_aop.jar -------------------------------------------------------------------------------- /framework/libs/javax.inject-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/libs/javax.inject-1.jar -------------------------------------------------------------------------------- /framework/libs/jsr305-1.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/libs/jsr305-1.3.9.jar -------------------------------------------------------------------------------- /framework/libs/roboguice-2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/libs/roboguice-2.0.jar -------------------------------------------------------------------------------- /framework/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/Jackrex/Developer/Dev/adt-bundle-mac-x86_64-20130917/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 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 | #} -------------------------------------------------------------------------------- /framework/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /framework/src/main/java/info/jackrex/androidcachefoundation/framework/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.framework; 2 | 3 | import android.os.Bundle; 4 | 5 | import roboguice.activity.RoboActivity; 6 | 7 | /** 8 | * Created by Jackrex on 4/1/14. 9 | */ 10 | public class BaseActivity extends RoboActivity { 11 | 12 | 13 | 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /framework/src/main/java/info/jackrex/androidcachefoundation/framework/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package info.jackrex.androidcachefoundation.framework; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.os.Handler; 7 | import android.os.Message; 8 | import android.util.Log; 9 | import android.view.Gravity; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | import android.widget.Toast; 14 | 15 | import roboguice.fragment.RoboFragment; 16 | 17 | /** 18 | * Created by Jackrex on 2/25/14. 19 | * 在使用Fragment 时候一定要记住 Fragment 的生命周期是委托在Activity 上 20 | * 使用getActivity() 要判断null 21 | * 22 | */ 23 | public abstract class BaseFragment extends RoboFragment { 24 | 25 | public static final String TAG = BaseFragment.class.getName(); 26 | public ProgressDialog progressDialog; 27 | 28 | protected LayoutInflater inflater; 29 | protected View currentView; 30 | protected ViewGroup container; 31 | 32 | private static final String BUNDLE = "bundle"; 33 | 34 | 35 | 36 | public void onCreate(final Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | } 39 | 40 | @Override 41 | public void onActivityCreated(Bundle savedInstanceState) { 42 | super.onActivityCreated(savedInstanceState); 43 | init(); 44 | } 45 | 46 | @Override 47 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 48 | this.inflater = inflater; 49 | this.container = container; 50 | currentView = createView(); 51 | return currentView; 52 | } 53 | 54 | public abstract void init(); 55 | public abstract View createView(); 56 | @Override 57 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 58 | // TODO Auto-generated method stub 59 | super.onActivityResult(requestCode, resultCode, data); 60 | } 61 | 62 | /** 63 | * 显示一条toast 64 | * @param message toast内容 65 | */ 66 | public void showToast(String message) { 67 | 68 | if(getActivity() != null){ 69 | Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show(); 70 | } 71 | } 72 | 73 | 74 | 75 | /** 76 | * 居中显示toast 77 | * @param message toast内容 78 | */ 79 | public void showCenterToast(String message) { 80 | 81 | 82 | if(getActivity() != null){ 83 | Toast toast = Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT); 84 | toast.setGravity(Gravity.CENTER, 0, 0); 85 | toast.show(); 86 | 87 | } 88 | } 89 | 90 | 91 | public void dismissProgress(){ 92 | if (progressDialog != null){ 93 | progressDialog.dismiss(); 94 | } 95 | } 96 | 97 | //abstract 98 | /** 99 | * fragment被选中时调用的方法 100 | */ 101 | public void onSelected(){ 102 | Log.d(TAG, "selected"); 103 | } 104 | 105 | //abstract 106 | /** 107 | * fragment由选中变成未选中调用的方法 108 | */ 109 | public void onUnSelected(){ 110 | Log.d(TAG, "unselected"); 111 | } 112 | 113 | /* (non-Javadoc) 114 | * @see android.support.v4.app.Fragment#onDestroy() 115 | */ 116 | @Override 117 | public void onDestroy() { 118 | // TODO Auto-generated method stub 119 | super.onDestroy(); 120 | } 121 | 122 | /* (non-Javadoc) 123 | * @see android.support.v4.app.Fragment#onPause() 124 | */ 125 | @Override 126 | public void onPause() { 127 | // TODO Auto-generated method stub 128 | super.onPause(); 129 | 130 | 131 | 132 | } 133 | 134 | /* (non-Javadoc) 135 | * @see android.support.v4.app.Fragment#onResume() 136 | */ 137 | @Override 138 | public void onResume() { 139 | // TODO Auto-generated method stub 140 | super.onResume(); 141 | } 142 | 143 | /* (non-Javadoc) 144 | * @see android.support.v4.app.Fragment#onStart() 145 | */ 146 | @Override 147 | public void onStart() { 148 | // TODO Auto-generated method stub 149 | super.onStart(); 150 | } 151 | 152 | /* (non-Javadoc) 153 | * @see android.support.v4.app.Fragment#onStop() 154 | */ 155 | @Override 156 | public void onStop() { 157 | // TODO Auto-generated method stub 158 | super.onStop(); 159 | } 160 | 161 | 162 | protected void openActivity( Class clazz){ 163 | 164 | if (getActivity()==null) 165 | return; 166 | 167 | Intent intent = new Intent(); 168 | intent.setClass(getActivity(),clazz); 169 | getActivity().startActivity(intent); 170 | 171 | } 172 | 173 | 174 | protected void openActivity( Class clazz,Bundle bundle){ 175 | 176 | if (getActivity()==null) 177 | return; 178 | 179 | Intent intent = new Intent(); 180 | intent.setClass(getActivity(),clazz); 181 | intent.putExtra(BUNDLE,bundle); 182 | getActivity().startActivity(intent); 183 | 184 | } 185 | 186 | protected void sendErrorMessage(final Handler handler,int what){ 187 | Message msg = new Message(); 188 | msg.what = what; 189 | handler.sendMessage(msg); 190 | } 191 | 192 | } 193 | -------------------------------------------------------------------------------- /framework/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /framework/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /framework/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /framework/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/framework/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /framework/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AndroidCacheFoundation 3 | 4 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 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 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackrex/AndroidCacheFoundation/3a44df13d3fddde02a29f4c0878600c7a28646a0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':CacheFoundation', ':application', ':framework' 2 | include ':UiLibs:Android-ViewPagerIndicator' 3 | include ':UiLibs:XListView' --------------------------------------------------------------------------------