├── .gitignore ├── README.md ├── app ├── build.gradle ├── proguard-rules.pro └── src │ ├── debug │ └── java │ │ └── cn │ │ └── dong │ │ └── demo │ │ └── StethoHelper.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── index.html │ ├── java │ │ └── cn │ │ │ └── dong │ │ │ └── demo │ │ │ ├── AndroidBus.java │ │ │ ├── AndroidUtilities.java │ │ │ ├── BusProvider.java │ │ │ ├── MyApp.java │ │ │ ├── OkHttpHelper.java │ │ │ ├── PicassoHelper.java │ │ │ ├── RealmHelper.java │ │ │ ├── config │ │ │ ├── Constants.java │ │ │ └── Extra.java │ │ │ ├── model │ │ │ ├── CalendarInfo.java │ │ │ ├── DuitangBlog.java │ │ │ ├── DuitangDataInfo.java │ │ │ ├── DuitangResponseInfo.java │ │ │ ├── GeoResponse.java │ │ │ ├── GeoResult.java │ │ │ ├── TestInfo.java │ │ │ ├── event │ │ │ │ ├── BaseEvent.java │ │ │ │ ├── Test1Event.java │ │ │ │ └── Test2Event.java │ │ │ └── realm │ │ │ │ ├── Cat.java │ │ │ │ ├── Dog.java │ │ │ │ └── Person.java │ │ │ ├── provider │ │ │ └── MyProvider.java │ │ │ ├── service │ │ │ └── MyService.java │ │ │ ├── ui │ │ │ ├── animation │ │ │ │ ├── AnimationActivity.java │ │ │ │ └── MarkAnimationActivity.java │ │ │ ├── common │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── BaseFragment.java │ │ │ │ └── MyBaseAdapter.java │ │ │ ├── component │ │ │ │ ├── ChildFragment.java │ │ │ │ ├── FragmentManageActivity.java │ │ │ │ ├── IntentsActivity.java │ │ │ │ ├── NotificationActivity.java │ │ │ │ ├── PowerManagerActivity.java │ │ │ │ ├── SendDataOneActivity.java │ │ │ │ ├── SendDataTwoActivity.java │ │ │ │ ├── ServiceActivity.java │ │ │ │ └── TestFragment.java │ │ │ ├── library │ │ │ │ ├── ImageLoaderActivity.java │ │ │ │ ├── OttoActivity.java │ │ │ │ ├── RealmActivity.java │ │ │ │ ├── RxJavaActivity.java │ │ │ │ └── XListViewActivity.java │ │ │ ├── main │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainContentFragment.java │ │ │ ├── original │ │ │ │ ├── FadeoutHeaderRecyclerViewActivity.java │ │ │ │ ├── FlexibleHeaderRecyclerViewActivity.java │ │ │ │ ├── FlowLayoutActivity.java │ │ │ │ ├── NumberedAdapter.java │ │ │ │ ├── audio │ │ │ │ │ └── AudioRecorderActivity.java │ │ │ │ └── calendar │ │ │ │ │ ├── CalendarActivity.java │ │ │ │ │ ├── CalendarAdapter.java │ │ │ │ │ └── CalendarFragment.java │ │ │ ├── other │ │ │ │ ├── ImageSelectorActivity.java │ │ │ │ ├── Md5Activity.java │ │ │ │ ├── PackageManageActivity.java │ │ │ │ ├── ScreenshotActivity.java │ │ │ │ └── WebViewActivity.java │ │ │ ├── sensor │ │ │ │ └── GeocoderActivity.java │ │ │ ├── storage │ │ │ │ ├── BitmapSaveLocalActivity.java │ │ │ │ └── ContentProviderActivity.java │ │ │ ├── text │ │ │ │ ├── AutoCompleteActivity.java │ │ │ │ ├── EditTextActivity.java │ │ │ │ ├── ReplacementDrawableSpan.java │ │ │ │ ├── TextAdvanceActivity.java │ │ │ │ ├── TextSizeActivity.java │ │ │ │ └── TextViewSpanActivity.java │ │ │ └── ui │ │ │ │ ├── ColorFragment.java │ │ │ │ ├── CustomViewFragment.java │ │ │ │ ├── DialogActivity.java │ │ │ │ ├── DrawableStateActivity.java │ │ │ │ ├── DrawableTintActivity.java │ │ │ │ ├── FragmentTabHostActivity.java │ │ │ │ ├── MyDialogFragment.java │ │ │ │ ├── PopupWindowActivity.java │ │ │ │ ├── RecyclerViewActivity.java │ │ │ │ ├── SwipeRefreshLayoutActivity.java │ │ │ │ ├── ViewPagerActivity.java │ │ │ │ └── touch │ │ │ │ ├── TouchButton.java │ │ │ │ ├── TouchEventActivity.java │ │ │ │ ├── TouchEventHelper.java │ │ │ │ ├── TouchLayout.java │ │ │ │ └── TouchView.java │ │ │ ├── util │ │ │ ├── AppHelper.java │ │ │ ├── AudioRecorderManager.java │ │ │ ├── BlurUtils.java │ │ │ ├── CommonUtils.java │ │ │ ├── DateUtil.java │ │ │ ├── FileUtil.java │ │ │ ├── FragmentUtil.java │ │ │ ├── ImageUtils.java │ │ │ ├── L.java │ │ │ ├── MeasureUtil.java │ │ │ ├── MediaPlayerManager.java │ │ │ ├── NotificationHelper.java │ │ │ ├── PixelUtils.java │ │ │ ├── RingManager.java │ │ │ ├── ScrollUtils.java │ │ │ ├── StrUtil.java │ │ │ ├── T.java │ │ │ ├── TextViewClickMovement.java │ │ │ ├── VibratorManager.java │ │ │ ├── ViewHolder.java │ │ │ └── inputfilter │ │ │ │ ├── EmojiInputFilter.java │ │ │ │ ├── EmsLenghtFilter.java │ │ │ │ ├── InputLengthFilter.java │ │ │ │ └── LinebreakInputFilter.java │ │ │ └── view │ │ │ ├── AudioRecorderButton.java │ │ │ ├── CustomLayout.java │ │ │ ├── CustomView.java │ │ │ ├── DRecyclerView.java │ │ │ ├── DRecyclerViewPrompt.java │ │ │ ├── EmailAutoCompleteTextView.java │ │ │ ├── FlowLayout.java │ │ │ ├── LargeTouchAreaText.java │ │ │ ├── MarkView.java │ │ │ ├── MultiDoneEditText.java │ │ │ ├── XListView.java │ │ │ ├── XListViewFooter.java │ │ │ └── XListViewHeader.java │ └── res │ │ ├── anim │ │ ├── activity_close_enter.xml │ │ ├── activity_close_exit.xml │ │ ├── activity_open_enter.xml │ │ ├── activity_open_exit.xml │ │ ├── fade_in.xml │ │ ├── fade_out.xml │ │ ├── fragment_in.xml │ │ ├── popup_enter.xml │ │ ├── popup_exit.xml │ │ ├── settingswindow_in_anim.xml │ │ ├── settingswindow_out_anim.xml │ │ ├── top_enter.xml │ │ ├── top_exit.xml │ │ └── zoom.xml │ │ ├── color │ │ └── text_enable_test.xml │ │ ├── drawable-hdpi │ │ ├── adj.png │ │ ├── cancel.png │ │ ├── dialog_full_holo_light.9.png │ │ ├── dialog_loading_bg.9.png │ │ ├── drawer_shadow.9.png │ │ ├── empty_photo.png │ │ ├── ic_build_white_24dp.png │ │ ├── ic_explore_white_24dp.png │ │ ├── ic_extension_white_24dp.png │ │ ├── ic_flare_white_24dp.png │ │ ├── ic_more_horiz_white_24dp.png │ │ ├── ic_phone_android_white_24dp.png │ │ ├── ic_public_white_24dp.png │ │ ├── ic_settings_white_24dp.png │ │ ├── ic_star_white_24dp.png │ │ ├── ic_storage_white_24dp.png │ │ ├── ic_text_format_white_24dp.png │ │ ├── list_focused_holo.9.png │ │ ├── list_longpressed_holo_light.9.png │ │ ├── list_pressed_holo_light.9.png │ │ ├── list_selector_disabled_holo_light.9.png │ │ ├── recorder.png │ │ ├── v_anim1.png │ │ ├── v_anim2.png │ │ ├── v_anim3.png │ │ ├── voice_to_short.png │ │ └── xlistview_arrow.png │ │ ├── drawable-xhdpi │ │ ├── chatto_bg_focused.9.png │ │ ├── drawer_shadow.9.png │ │ ├── ic_build_white_24dp.png │ │ ├── ic_explore_white_24dp.png │ │ ├── ic_extension_white_24dp.png │ │ ├── ic_flare_white_24dp.png │ │ ├── ic_more_horiz_white_24dp.png │ │ ├── ic_phone_android_white_24dp.png │ │ ├── ic_public_white_24dp.png │ │ ├── ic_settings_white_24dp.png │ │ ├── ic_star_white_24dp.png │ │ ├── ic_storage_white_24dp.png │ │ ├── ic_text_format_white_24dp.png │ │ ├── logo_email.png │ │ ├── logo_more.png │ │ └── logo_qq.png │ │ ├── drawable-xxhdpi │ │ ├── example.jpeg │ │ ├── ic_build_white_24dp.png │ │ ├── ic_demo_mark_default.png │ │ ├── ic_drawer.png │ │ ├── ic_explore_white_24dp.png │ │ ├── ic_extension_white_24dp.png │ │ ├── ic_flare_white_24dp.png │ │ ├── ic_mark_up.png │ │ ├── ic_mic_voice_001.png │ │ ├── ic_mic_voice_002.png │ │ ├── ic_mic_voice_003.png │ │ ├── ic_mic_voice_004.png │ │ ├── ic_mic_voice_005.png │ │ ├── ic_mic_voice_006.png │ │ ├── ic_mic_voice_007.png │ │ ├── ic_mic_voice_008.png │ │ ├── ic_more_horiz_white_24dp.png │ │ ├── ic_phone_android_white_24dp.png │ │ ├── ic_public_white_24dp.png │ │ ├── ic_record_warn.png │ │ ├── ic_settings_white_24dp.png │ │ ├── ic_star_white_24dp.png │ │ ├── ic_storage_white_24dp.png │ │ └── ic_text_format_white_24dp.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_build_white_24dp.png │ │ ├── ic_explore_white_24dp.png │ │ ├── ic_extension_white_24dp.png │ │ ├── ic_flare_white_24dp.png │ │ ├── ic_more_horiz_white_24dp.png │ │ ├── ic_phone_android_white_24dp.png │ │ ├── ic_public_white_24dp.png │ │ ├── ic_settings_white_24dp.png │ │ ├── ic_star_white_24dp.png │ │ ├── ic_storage_white_24dp.png │ │ └── ic_text_format_white_24dp.png │ │ ├── drawable │ │ ├── bg_list_selector.xml │ │ ├── bg_recorder_normal.xml │ │ ├── bg_recorder_recording.xml │ │ ├── bg_window.xml │ │ ├── drawable_state.xml │ │ ├── ic_divider.xml │ │ ├── item_background_holo_light.xml │ │ ├── list_selector_background_transition_holo_light.xml │ │ ├── main_list_selector.xml │ │ └── play_audio_anim.xml │ │ ├── layout │ │ ├── activity_anime.xml │ │ ├── activity_audiorecording.xml │ │ ├── activity_audiorecoring_item.xml │ │ ├── activity_auto_complete.xml │ │ ├── activity_calendar.xml │ │ ├── activity_content_provider.xml │ │ ├── activity_dialog.xml │ │ ├── activity_drawable_tint.xml │ │ ├── activity_edittext.xml │ │ ├── activity_fadeoutheader.xml │ │ ├── activity_flexibleheader.xml │ │ ├── activity_flexibleheader_item.xml │ │ ├── activity_flexibleheader_spacing.xml │ │ ├── activity_flowlayout.xml │ │ ├── activity_fragment_test.xml │ │ ├── activity_geocoder.xml │ │ ├── activity_image.xml │ │ ├── activity_imageloader_item.xml │ │ ├── activity_input.xml │ │ ├── activity_intents.xml │ │ ├── activity_main.xml │ │ ├── activity_main_drawer_header.xml │ │ ├── activity_mark_up_demo.xml │ │ ├── activity_notification.xml │ │ ├── activity_otto.xml │ │ ├── activity_packagemanager.xml │ │ ├── activity_packagemanager_item.xml │ │ ├── activity_powermanager.xml │ │ ├── activity_realm.xml │ │ ├── activity_recyclerview.xml │ │ ├── activity_recyclerview_item.xml │ │ ├── activity_rxjava.xml │ │ ├── activity_screenshot.xml │ │ ├── activity_screenshot_item.xml │ │ ├── activity_scroll_header.xml │ │ ├── activity_selected_image.xml │ │ ├── activity_senddata_one.xml │ │ ├── activity_senddata_two.xml │ │ ├── activity_service.xml │ │ ├── activity_swiperefreshlayout.xml │ │ ├── activity_tabhost.xml │ │ ├── activity_text.xml │ │ ├── activity_text_advance.xml │ │ ├── activity_text_size.xml │ │ ├── activity_viewpager.xml │ │ ├── activity_webview.xml │ │ ├── activity_xlist.xml │ │ ├── activity_xlist_item.xml │ │ ├── calendar_item.xml │ │ ├── d_recycler_footer_layout.xml │ │ ├── d_recycler_layout.xml │ │ ├── dialog_recorder.xml │ │ ├── drawable_state_activity.xml │ │ ├── fragment_calendar.xml │ │ ├── fragment_child.xml │ │ ├── fragment_color.xml │ │ ├── fragment_customview.xml │ │ ├── fragment_dialog.xml │ │ ├── fragment_main_content.xml │ │ ├── fragment_main_content_item.xml │ │ ├── fragment_test.xml │ │ ├── imageloader_activity.xml │ │ ├── numbered_item.xml │ │ ├── popup_window_activity.xml │ │ ├── popup_window_layout.xml │ │ ├── toolbar_actionbar.xml │ │ ├── touch_activity.xml │ │ ├── xlistview_footer.xml │ │ └── xlistview_header.xml │ │ ├── menu │ │ ├── activity_customview.xml │ │ ├── activity_flowlayout_menu.xml │ │ ├── activity_main_drawer.xml │ │ └── activity_packagemanager.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── ids.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── release │ └── java │ └── cn │ └── dong │ └── demo │ └── StethoHelper.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac 2 | .DS_Store 3 | 4 | # Built application files 5 | *.apk 6 | *.ap_ 7 | 8 | # Files for the Dalvik VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # Generated files 15 | bin/ 16 | gen/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Eclipse project files 32 | .classpath 33 | .project 34 | .settings/ 35 | 36 | # Intellij project files 37 | .idea/ 38 | *.iml 39 | *.ipr 40 | *.iws -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 个人Demo合集 2 | 3 | ## 更新日志 4 | 2014.10.24 调整工程结构到Android Studio 5 | 2015.5.24 合并之前因为环境不同而分裂的两个Demo工程,并整理分类,首页通过导航抽屉切换分类 6 | 7 | ![Home](http://upload-images.jianshu.io/upload_images/111373-8d56767100cd785c.png) 8 | Tip:导航菜单中的图标全部来自Google的[Material icons](https://www.google.com/design/icons/)项目,提供了非常多的图片供我们选择,好顶赞 9 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'realm-android' 3 | 4 | android { 5 | compileSdkVersion rootProject.ext["compileSdkVersion"] 6 | buildToolsVersion rootProject.ext["buildToolsVersion"] 7 | 8 | defaultConfig { 9 | applicationId "cn.dong.demo" 10 | minSdkVersion rootProject.ext["minSdkVersion"] 11 | targetSdkVersion rootProject.ext["targetSdkVersion"] 12 | versionCode 1 13 | versionName "1.0" 14 | renderscriptTargetApi 23 15 | renderscriptSupportModeEnabled true 16 | } 17 | 18 | packagingOptions { 19 | exclude 'META-INF/services/javax.annotation.processing.Processor' 20 | exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties' 21 | exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml' 22 | exclude 'META-INF/LICENSE.txt' 23 | exclude 'META-INF/NOTICE.txt' 24 | } 25 | 26 | signingConfigs { 27 | release { 28 | if (project.hasProperty('STOREFILE')) { 29 | storeFile file(STOREFILE) 30 | storePassword STOREPASSWORD 31 | keyAlias KEYALIAS 32 | keyPassword KEYPASSWORD 33 | } 34 | } 35 | } 36 | 37 | buildTypes { 38 | release { 39 | signingConfig signingConfigs.release 40 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 41 | } 42 | } 43 | } 44 | 45 | dependencies { 46 | compile fileTree(dir: 'libs', include: '*.jar') 47 | compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion" 48 | compile "com.android.support:design:$rootProject.ext.supportLibraryVersion" 49 | compile "com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion" 50 | compile "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion" 51 | compile 'io.reactivex:rxjava:1.1.0' 52 | compile 'io.reactivex:rxandroid:1.1.0' 53 | compile 'com.jakewharton.rxbinding:rxbinding:0.3.0' 54 | compile 'com.google.code.gson:gson:2.4' 55 | compile 'com.squareup:otto:1.3.8' 56 | compile 'com.squareup.okhttp3:okhttp:3.2.0' 57 | compile 'com.squareup.picasso:picasso:2.5.2' 58 | compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2' 59 | compile 'com.jakewharton:butterknife:6.1.0' 60 | compile 'com.jakewharton.timber:timber:4.1.1' 61 | compile 'com.loopj.android:android-async-http:1.4.9' 62 | compile 'me.grantland:autofittextview:0.2.1' 63 | debugCompile "com.facebook.stetho:stetho:$rootProject.ext.stethoVersion" 64 | debugCompile "com.facebook.stetho:stetho-okhttp3:$rootProject.ext.stethoVersion" 65 | } 66 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Program Files\adt-bundle-windows\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/debug/java/cn/dong/demo/StethoHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import android.content.Context; 4 | 5 | import com.facebook.stetho.Stetho; 6 | import com.facebook.stetho.okhttp3.StethoInterceptor; 7 | 8 | import okhttp3.OkHttpClient; 9 | 10 | /** 11 | * @author dong on 16/5/12. 12 | */ 13 | public class StethoHelper { 14 | public static void init(Context context) { 15 | Stetho.initializeWithDefaults(context); 16 | } 17 | 18 | public static OkHttpClient.Builder setupInterceptor(OkHttpClient.Builder builder) { 19 | return builder.addNetworkInterceptor(new StethoInterceptor()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | index 4 | 9 | 10 | 11 | 12 | 13 |

Launch My Activity

14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/AndroidBus.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import android.os.Handler; 4 | import android.os.Looper; 5 | 6 | import com.squareup.otto.Bus; 7 | 8 | /** 9 | * @author dong on 15/9/10. 10 | */ 11 | public class AndroidBus extends Bus { 12 | private final Handler mainHandler = new Handler(Looper.getMainLooper()); 13 | 14 | @Override 15 | public void post(final Object event) { 16 | if (Looper.myLooper() == Looper.getMainLooper()) { 17 | super.post(event); 18 | } else { 19 | mainHandler.post(new Runnable() { 20 | @Override 21 | public void run() { 22 | AndroidBus.super.post(event); 23 | } 24 | }); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/AndroidUtilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This is the source code of Telegram for Android v. 1.4.x. 3 | * It is licensed under GNU GPL v. 2 or later. 4 | * You should have received a copy of the license in this archive (see LICENSE). 5 | * 6 | * Copyright Nikolai Kudashov, 2013-2014. 7 | */ 8 | 9 | package cn.dong.demo; 10 | 11 | import android.annotation.SuppressLint; 12 | import android.content.Context; 13 | import android.content.pm.PackageManager; 14 | import android.os.Build; 15 | 16 | public class AndroidUtilities { 17 | 18 | public static void runOnUIThread(Runnable runnable) { 19 | runOnUIThread(runnable, 0); 20 | } 21 | 22 | public static void runOnUIThread(Runnable runnable, long delay) { 23 | if (delay == 0) { 24 | MyApp.applicationHandler.post(runnable); 25 | } else { 26 | MyApp.applicationHandler.postDelayed(runnable, delay); 27 | } 28 | } 29 | 30 | public static void cancelRunOnUIThread(Runnable runnable) { 31 | MyApp.applicationHandler.removeCallbacks(runnable); 32 | } 33 | 34 | @SuppressLint("NewApi") 35 | public static boolean checkPermission(Context context, String permission) { 36 | boolean result = false; 37 | if (Build.VERSION.SDK_INT >= 23) { 38 | if (context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) { 39 | result = true; 40 | } 41 | } else { 42 | PackageManager pm = context.getPackageManager(); 43 | if (pm.checkPermission(permission, context.getPackageName()) == PackageManager.PERMISSION_GRANTED) { 44 | result = true; 45 | } 46 | } 47 | return result; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/BusProvider.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import com.squareup.otto.Bus; 4 | 5 | /** 6 | * @author dong on 15/9/10. 7 | */ 8 | public final class BusProvider { 9 | private static final Bus sBus = new AndroidBus(); 10 | 11 | public static Bus getInstance() { 12 | return sBus; 13 | } 14 | 15 | private BusProvider() { 16 | // No instances. 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/MyApp.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import android.app.Application; 4 | import android.os.Handler; 5 | import android.os.StrictMode; 6 | import android.util.Log; 7 | 8 | import timber.log.Timber; 9 | 10 | public class MyApp extends Application { 11 | 12 | private static MyApp instance; 13 | public static volatile Handler applicationHandler; 14 | 15 | public static MyApp getInstance() { 16 | return instance; 17 | } 18 | 19 | @Override 20 | public void onCreate() { 21 | super.onCreate(); 22 | instance = this; 23 | applicationHandler = new Handler(instance.getMainLooper()); 24 | initStrictMode(); 25 | initLogger(); 26 | RealmHelper.init(this); 27 | PicassoHelper.init(this); 28 | StethoHelper.init(this); 29 | } 30 | 31 | /** 32 | * 初始化StrictMode 33 | */ 34 | private void initStrictMode() { 35 | if (BuildConfig.DEBUG) { 36 | StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() 37 | .detectAll() 38 | .penaltyLog() 39 | // .penaltyDeath() 40 | .build()); 41 | StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() 42 | .detectAll() 43 | .penaltyLog() 44 | // .penaltyDeath() 45 | .build()); 46 | } 47 | } 48 | 49 | private void initLogger() { 50 | if (BuildConfig.DEBUG) { 51 | Timber.plant(new Timber.DebugTree()); 52 | } else { 53 | Timber.plant(new LogReportingTree()); 54 | } 55 | } 56 | 57 | private static class LogReportingTree extends Timber.Tree { 58 | @Override 59 | protected void log(int priority, String tag, String message, Throwable t) { 60 | if (priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO) { 61 | return; 62 | } 63 | // 将部分日志报告服务器 64 | } 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/OkHttpHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import okhttp3.OkHttpClient; 4 | 5 | /** 6 | * @author dong on 16/5/12. 7 | */ 8 | public enum OkHttpHelper { 9 | INSTANCE; 10 | 11 | private final OkHttpClient okHttpClient; 12 | 13 | OkHttpHelper() { 14 | OkHttpClient.Builder builder = new OkHttpClient.Builder(); 15 | okHttpClient = StethoHelper.setupInterceptor(builder).build(); 16 | } 17 | 18 | public OkHttpClient getOkHttpClient() { 19 | return okHttpClient; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/PicassoHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import android.content.Context; 4 | 5 | import com.jakewharton.picasso.OkHttp3Downloader; 6 | import com.squareup.picasso.Picasso; 7 | 8 | import timber.log.Timber; 9 | 10 | /** 11 | * @author dong on 16/5/11. 12 | */ 13 | public final class PicassoHelper { 14 | public static void init(Context context) { 15 | Picasso picasso = new Picasso.Builder(context) 16 | .downloader(new OkHttp3Downloader(OkHttpHelper.INSTANCE.getOkHttpClient())) 17 | .build(); 18 | try { 19 | Picasso.setSingletonInstance(picasso); 20 | } catch (IllegalStateException e) { 21 | Timber.d(e, ""); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/RealmHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo; 2 | 3 | import android.content.Context; 4 | import android.os.Looper; 5 | 6 | import io.realm.Realm; 7 | import io.realm.RealmConfiguration; 8 | 9 | /** 10 | * @author dong on 16/2/25. 11 | */ 12 | public class RealmHelper { 13 | 14 | public static void init(Context context) { 15 | Realm.init(context); 16 | RealmConfiguration config = new RealmConfiguration.Builder() 17 | .deleteRealmIfMigrationNeeded() 18 | .build(); 19 | Realm.setDefaultConfiguration(config); 20 | } 21 | 22 | /** 23 | * 延时更新,以期望主线程数据自动更新到了最新 24 | * 25 | * @param runnable 在数据更新后期望做的操作,操作会运行在主线程 26 | */ 27 | public static void delayUpdate(final Realm realm, final Runnable runnable) { 28 | if (Looper.myLooper() != Looper.getMainLooper()) { 29 | throw new IllegalStateException("only work on main thread"); 30 | } 31 | AndroidUtilities.runOnUIThread(new Runnable() { 32 | @Override 33 | public void run() { 34 | if (!realm.isClosed()) { 35 | runnable.run(); 36 | } 37 | } 38 | }, 500); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/config/Constants.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.config; 2 | 3 | import android.os.Environment; 4 | 5 | /** 6 | * 常量 7 | * 8 | * @author dong 2014-7-28 9 | */ 10 | public class Constants { 11 | public static class Path { 12 | public static final String BASE_DIR = Environment.getExternalStorageDirectory().getPath(); 13 | } 14 | 15 | public static class Extra { 16 | public static final String IMAGES = "cn.dong.demo.IMAGES"; 17 | public static final String IMAGE_POSITION = "cn.dong.demo.IMAGE_POSITION"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/config/Extra.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.config; 2 | 3 | /** 4 | * @author dong on 15/4/1. 5 | */ 6 | public class Extra { 7 | public static final String POSITION = "position"; 8 | public static final String TITLE = "title"; 9 | public static final String COLOR = "color"; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/CalendarInfo.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | public class CalendarInfo { 4 | private int year; 5 | private int month; 6 | private int date; 7 | 8 | public CalendarInfo(int year, int month, int date) { 9 | this.year = year; 10 | this.month = month; 11 | this.date = date; 12 | } 13 | 14 | public int getYear() { 15 | return year; 16 | } 17 | 18 | public void setYear(int year) { 19 | this.year = year; 20 | } 21 | 22 | public int getMonth() { 23 | return month; 24 | } 25 | 26 | public void setMonth(int month) { 27 | this.month = month; 28 | } 29 | 30 | public int getDate() { 31 | return date; 32 | } 33 | 34 | public void setDate(int date) { 35 | this.date = date; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/DuitangBlog.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | /** 4 | * @author dong on 15/6/10. 5 | */ 6 | public class DuitangBlog { 7 | public int id; 8 | public String isrc; 9 | public String msg; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/DuitangDataInfo.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author dong on 15/6/10. 9 | */ 10 | public class DuitangDataInfo { 11 | @SerializedName("blogs") 12 | public List duitangBlogs; 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/DuitangResponseInfo.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * @author dong on 15/6/10. 7 | */ 8 | public class DuitangResponseInfo { 9 | @SerializedName("data") 10 | public DuitangDataInfo data; 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/GeoResponse.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | import java.util.List; 4 | 5 | public class GeoResponse { 6 | private String status; 7 | private List results; 8 | 9 | public String getStatus() { 10 | return status; 11 | } 12 | 13 | public void setStatus(String status) { 14 | this.status = status; 15 | } 16 | 17 | public List getResults() { 18 | return results; 19 | } 20 | 21 | public void setResults(List results) { 22 | this.results = results; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/GeoResult.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | public class GeoResult { 4 | private String formatted_address; 5 | private Geometry geometry; 6 | 7 | public static class Geometry { 8 | private Location location; 9 | 10 | public Location getLocation() { 11 | return location; 12 | } 13 | 14 | public void setLocation(Location location) { 15 | this.location = location; 16 | } 17 | 18 | } 19 | 20 | public static class Location { 21 | private double lat; 22 | private double lng; 23 | 24 | public double getLat() { 25 | return lat; 26 | } 27 | 28 | public void setLat(double lat) { 29 | this.lat = lat; 30 | } 31 | 32 | public double getLng() { 33 | return lng; 34 | } 35 | 36 | public void setLng(double lng) { 37 | this.lng = lng; 38 | } 39 | 40 | } 41 | 42 | public String getFormatted_address() { 43 | return formatted_address; 44 | } 45 | 46 | public void setFormatted_address(String formatted_address) { 47 | this.formatted_address = formatted_address; 48 | } 49 | 50 | public Geometry getGeometry() { 51 | return geometry; 52 | } 53 | 54 | public void setGeometry(Geometry geometry) { 55 | this.geometry = geometry; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/TestInfo.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | /** 7 | * Activity传值测试,实现Parcelable接口 8 | * 9 | * @author dong on 15/6/11. 10 | */ 11 | public class TestInfo implements Parcelable { 12 | public int one; 13 | public int two; 14 | public String three; 15 | 16 | public TestInfo(int one, int two, String three) { 17 | this.one = one; 18 | this.two = two; 19 | this.three = three; 20 | } 21 | 22 | public TestInfo(Parcel source) { 23 | one = source.readInt(); 24 | two = source.readInt(); 25 | three = source.readString(); 26 | } 27 | 28 | @Override 29 | public int describeContents() { 30 | return 0; 31 | } 32 | 33 | @Override 34 | public void writeToParcel(Parcel dest, int flags) { 35 | dest.writeInt(one); 36 | dest.writeInt(two); 37 | dest.writeString(three); 38 | } 39 | 40 | public static final Creator CREATOR = new Creator() { 41 | @Override 42 | public TestInfo createFromParcel(Parcel source) { 43 | return new TestInfo(source); 44 | } 45 | 46 | @Override 47 | public TestInfo[] newArray(int size) { 48 | return new TestInfo[size]; 49 | } 50 | }; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/event/BaseEvent.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model.event; 2 | 3 | /** 4 | * @author dong on 2017/1/5. 5 | */ 6 | public class BaseEvent { 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/event/Test1Event.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model.event; 2 | 3 | /** 4 | * @author dong on 15/9/11. 5 | */ 6 | public class Test1Event extends BaseEvent { 7 | public String name; 8 | 9 | public Test1Event(String name) { 10 | this.name = name; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/event/Test2Event.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model.event; 2 | 3 | /** 4 | * @author dong on 2017/1/5. 5 | */ 6 | public class Test2Event extends BaseEvent { 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/realm/Cat.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model.realm; 2 | 3 | import io.realm.RealmObject; 4 | 5 | /** 6 | * @author dong on 2016/11/21. 7 | */ 8 | public class Cat extends RealmObject { 9 | private String name; 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | 15 | public void setName(String name) { 16 | this.name = name; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/realm/Dog.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model.realm; 2 | 3 | import io.realm.RealmObject; 4 | import io.realm.annotations.PrimaryKey; 5 | 6 | /** 7 | * @author dong on 16/1/7. 8 | */ 9 | public class Dog extends RealmObject { 10 | @PrimaryKey 11 | private String name; 12 | private int age; 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | 22 | public int getAge() { 23 | return age; 24 | } 25 | 26 | public void setAge(int age) { 27 | this.age = age; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/model/realm/Person.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.model.realm; 2 | 3 | import io.realm.RealmObject; 4 | 5 | /** 6 | * @author dong on 16/1/7. 7 | */ 8 | public class Person extends RealmObject { 9 | private String name; 10 | private Dog dog; 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | 20 | public Dog getDog() { 21 | return dog; 22 | } 23 | 24 | public void setDog(Dog dog) { 25 | this.dog = dog; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/provider/MyProvider.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.provider; 2 | 3 | import android.content.ContentProvider; 4 | import android.content.ContentValues; 5 | import android.database.Cursor; 6 | import android.net.Uri; 7 | import android.util.Log; 8 | 9 | public class MyProvider extends ContentProvider { 10 | 11 | @Override 12 | public boolean onCreate() { 13 | Log.i("MyProvider", "onCreate"); 14 | // TODO Auto-generated method stub 15 | return false; 16 | } 17 | 18 | @Override 19 | public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, 20 | String sortOrder) { 21 | // TODO Auto-generated method stub 22 | return null; 23 | } 24 | 25 | @Override 26 | public String getType(Uri uri) { 27 | // TODO Auto-generated method stub 28 | return null; 29 | } 30 | 31 | @Override 32 | public Uri insert(Uri uri, ContentValues values) { 33 | // TODO Auto-generated method stub 34 | return null; 35 | } 36 | 37 | @Override 38 | public int delete(Uri uri, String selection, String[] selectionArgs) { 39 | // TODO Auto-generated method stub 40 | return 0; 41 | } 42 | 43 | @Override 44 | public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { 45 | // TODO Auto-generated method stub 46 | return 0; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/service/MyService.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.service; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.os.Binder; 6 | import android.os.IBinder; 7 | 8 | import cn.dong.demo.util.L; 9 | import timber.log.Timber; 10 | 11 | public class MyService extends Service { 12 | private static final String TAG = MyService.class.getSimpleName(); 13 | 14 | public MyService() { 15 | } 16 | 17 | @Override 18 | public void onCreate() { 19 | L.d(TAG, "onCreate"); 20 | super.onCreate(); 21 | } 22 | 23 | @Override 24 | public void onDestroy() { 25 | L.d(TAG, "onDestroy"); 26 | super.onDestroy(); 27 | } 28 | 29 | @Override 30 | public IBinder onBind(Intent intent) { 31 | L.d(TAG, "onBind"); 32 | return new Binder(); 33 | } 34 | 35 | @Override 36 | public int onStartCommand(Intent intent, int flags, int startId) { 37 | Timber.d("onStartCommand flags=%d startId=%d", flags, startId); 38 | return START_REDELIVER_INTENT; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/common/MyBaseAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.common; 2 | 3 | import java.util.List; 4 | 5 | import android.content.Context; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.BaseAdapter; 10 | 11 | /** 12 | * Adapter 基类 13 | * 14 | * @param 数据实体类 15 | * @author dong 2014-7-25 16 | */ 17 | public abstract class MyBaseAdapter extends BaseAdapter { 18 | protected Context mContext; 19 | protected List mData; 20 | protected LayoutInflater mInflater; 21 | 22 | public MyBaseAdapter(Context context, List data) { 23 | this.mContext = context; 24 | this.mData = data; 25 | mInflater = LayoutInflater.from(context); 26 | } 27 | 28 | @Override 29 | public int getCount() { 30 | if (mData != null) { 31 | return mData.size(); 32 | } else { 33 | return 0; 34 | } 35 | } 36 | 37 | @Override 38 | public E getItem(int position) { 39 | if (mData != null && mData.size() > 0) { 40 | return mData.get(position); 41 | } else { 42 | return null; 43 | } 44 | } 45 | 46 | @Override 47 | public long getItemId(int position) { 48 | return position; 49 | } 50 | 51 | public List getData() { 52 | return mData; 53 | } 54 | 55 | public void setData(List data) { 56 | this.mData = data; 57 | } 58 | 59 | @Override 60 | public abstract View getView(int position, View convertView, ViewGroup parent); 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/component/ChildFragment.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.component; 2 | 3 | import cn.dong.demo.R; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | public class ChildFragment extends Fragment { 12 | private static final String TAG = "ChildFragment"; 13 | 14 | @Override 15 | public void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | Log.d(TAG, getFragmentManager().toString()); 18 | Log.d(TAG, getChildFragmentManager().toString()); 19 | } 20 | 21 | @Override 22 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 23 | Bundle savedInstanceState) { 24 | return inflater.inflate(R.layout.fragment_child, container, false); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/component/NotificationActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.component; 2 | 3 | import android.app.PendingIntent; 4 | import android.content.Intent; 5 | import android.support.v4.app.NotificationCompat; 6 | import android.support.v4.app.NotificationManagerCompat; 7 | import android.widget.Button; 8 | 9 | import butterknife.InjectView; 10 | import butterknife.OnClick; 11 | import cn.dong.demo.MyApp; 12 | import cn.dong.demo.R; 13 | import cn.dong.demo.ui.common.BaseActivity; 14 | import cn.dong.demo.ui.main.MainActivity; 15 | import cn.dong.demo.util.NotificationHelper; 16 | 17 | /** 18 | * 通知栏 19 | * 20 | * @author dong on 15/11/10. 21 | */ 22 | public class NotificationActivity extends BaseActivity { 23 | @InjectView(R.id.button_create) 24 | Button createButton; 25 | 26 | private int mCount; 27 | private NotificationManagerCompat mNotificationManager; 28 | private NotificationCompat.Builder mBuilder; 29 | 30 | @Override 31 | protected int initPageLayoutID() { 32 | return R.layout.activity_notification; 33 | } 34 | 35 | @Override 36 | protected void init() { 37 | super.init(); 38 | mNotificationManager = NotificationManagerCompat.from(MyApp.getInstance()); 39 | } 40 | 41 | @OnClick(R.id.button_create) 42 | public void create() { 43 | Intent intent = new Intent(this, MainActivity.class); 44 | PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); 45 | mBuilder = new NotificationCompat.Builder(this) 46 | .setSmallIcon(R.mipmap.ic_launcher) 47 | .setContentTitle("title") 48 | .setContentText("content") 49 | .setContentIntent(pendingIntent) 50 | .setAutoCancel(true); 51 | 52 | mNotificationManager.notify("1", R.id.notification, mBuilder.build()); 53 | NotificationHelper.INSTANCE.vibrateAndSound(); 54 | } 55 | 56 | @OnClick(R.id.button_modify) 57 | public void modify() { 58 | mBuilder.setNumber(mCount++); 59 | mNotificationManager.notify("2", R.id.notification, mBuilder.build()); 60 | } 61 | 62 | @OnClick(R.id.button_remove) 63 | public void remove() { 64 | mNotificationManager.cancel("1", R.id.notification); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/component/PowerManagerActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.component; 2 | 3 | import android.support.v7.widget.SwitchCompat; 4 | import android.view.View; 5 | import android.widget.CompoundButton; 6 | import android.widget.TextView; 7 | 8 | import butterknife.InjectView; 9 | import cn.dong.demo.R; 10 | import cn.dong.demo.ui.common.BaseActivity; 11 | 12 | /** 13 | * @author dong on 16/5/3. 14 | */ 15 | public class PowerManagerActivity extends BaseActivity { 16 | @InjectView(R.id.text_keep) TextView keepText; 17 | @InjectView(R.id.switch_keep) SwitchCompat keepSwitch; 18 | 19 | @Override 20 | protected int initPageLayoutID() { 21 | return R.layout.activity_powermanager; 22 | } 23 | 24 | @Override 25 | protected void initPageView() { 26 | super.initPageView(); 27 | keepSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 28 | @Override 29 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 30 | keepText.setVisibility(isChecked ? View.VISIBLE : View.GONE); 31 | } 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/component/SendDataOneActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.component; 2 | 3 | import android.content.Intent; 4 | import android.view.View; 5 | 6 | import java.util.ArrayList; 7 | 8 | import cn.dong.demo.R; 9 | import cn.dong.demo.model.TestInfo; 10 | import cn.dong.demo.ui.common.BaseActivity; 11 | 12 | /** 13 | * Activity传值测试 14 | * 15 | * @author dong on 15/6/11. 16 | */ 17 | public class SendDataOneActivity extends BaseActivity { 18 | private TestInfo mData; 19 | private ArrayList mDataList = new ArrayList<>(); 20 | 21 | @Override 22 | protected void init() { 23 | super.init(); 24 | mData = new TestInfo(10, 100, "test0"); 25 | mDataList.add(new TestInfo(11, 111, "test1")); 26 | mDataList.add(new TestInfo(12, 222, "test2")); 27 | mDataList.add(new TestInfo(13, 333, "test3")); 28 | mDataList.add(new TestInfo(14, 444, "test4")); 29 | } 30 | 31 | @Override 32 | protected int initPageLayoutID() { 33 | return R.layout.activity_senddata_one; 34 | } 35 | 36 | public void jump(View v) { 37 | Intent intent = new Intent(mContext, SendDataTwoActivity.class); 38 | intent.putExtra(SendDataTwoActivity.EXTRA_INT, 4); 39 | intent.putExtra(SendDataTwoActivity.EXTRA_STRING, "test"); 40 | intent.putExtra(SendDataTwoActivity.EXTRA_OBJECT, mData); 41 | intent.putParcelableArrayListExtra(SendDataTwoActivity.EXTRA_OBJECT_LIST, mDataList); 42 | startActivityForResult(intent, 1); 43 | } 44 | 45 | @Override 46 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 47 | super.onActivityResult(requestCode, resultCode, data); 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/component/SendDataTwoActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.component; 2 | 3 | import android.content.Intent; 4 | 5 | import java.util.ArrayList; 6 | 7 | import cn.dong.demo.R; 8 | import cn.dong.demo.model.TestInfo; 9 | import cn.dong.demo.ui.common.BaseActivity; 10 | 11 | /** 12 | * @author dong on 15/6/11. 13 | */ 14 | public class SendDataTwoActivity extends BaseActivity { 15 | public static final String EXTRA_INT = "int"; 16 | public static final String EXTRA_STRING = "string"; 17 | public static final String EXTRA_OBJECT = "object"; 18 | public static final String EXTRA_OBJECT_LIST = "object_list"; 19 | 20 | private int mInt; 21 | private String mString; 22 | private TestInfo mData; 23 | private ArrayList mDataList = new ArrayList<>(); 24 | 25 | @Override 26 | protected void init() { 27 | super.init(); 28 | Intent intent = getIntent(); 29 | mInt = intent.getIntExtra(EXTRA_INT, 0); 30 | mString = intent.getStringExtra(EXTRA_STRING); 31 | mData = intent.getParcelableExtra(EXTRA_OBJECT); 32 | mDataList = intent.getParcelableArrayListExtra(EXTRA_OBJECT_LIST); 33 | 34 | mData.one = 20; 35 | mData.two = 200; 36 | mData.three = "test"; 37 | 38 | 39 | } 40 | 41 | private void changeData() { 42 | mData.one = 20; 43 | mData.two = 200; 44 | mData.three = "test"; 45 | } 46 | 47 | @Override 48 | protected int initPageLayoutID() { 49 | return R.layout.activity_senddata_two; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/component/ServiceActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.component; 2 | 3 | import android.content.ComponentName; 4 | import android.content.Intent; 5 | import android.content.ServiceConnection; 6 | import android.os.IBinder; 7 | 8 | import butterknife.OnClick; 9 | import cn.dong.demo.R; 10 | import cn.dong.demo.service.MyService; 11 | import cn.dong.demo.ui.common.BaseActivity; 12 | 13 | /** 14 | * author DONG 2015/5/28. 15 | */ 16 | public class ServiceActivity extends BaseActivity implements ServiceConnection { 17 | 18 | private Intent mServiceIntent; 19 | 20 | @Override 21 | protected void init() { 22 | super.init(); 23 | mServiceIntent = new Intent(mContext, MyService.class); 24 | } 25 | 26 | @Override 27 | protected int initPageLayoutID() { 28 | return R.layout.activity_service; 29 | } 30 | 31 | @OnClick(R.id.btn_start_service) 32 | void start() { 33 | startService(mServiceIntent); 34 | } 35 | 36 | @OnClick(R.id.btn_stop_service) 37 | void stop() { 38 | stopService(mServiceIntent); 39 | } 40 | 41 | @OnClick(R.id.btn_bind_service) 42 | void bind() { 43 | bindService(mServiceIntent, this, BIND_AUTO_CREATE); 44 | } 45 | 46 | @OnClick(R.id.btn_unbind_service) 47 | void unbind() { 48 | unbindService(this); 49 | } 50 | 51 | @Override 52 | public void onServiceConnected(ComponentName name, IBinder service) { 53 | 54 | } 55 | 56 | @Override 57 | public void onServiceDisconnected(ComponentName name) { 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/library/RxJavaActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.library; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | import android.os.Bundle; 6 | import android.widget.Button; 7 | import android.widget.ImageView; 8 | 9 | import java.util.concurrent.TimeUnit; 10 | 11 | import butterknife.InjectView; 12 | import butterknife.OnClick; 13 | import cn.dong.demo.R; 14 | import cn.dong.demo.ui.common.BaseActivity; 15 | import rx.Observable; 16 | import rx.android.schedulers.AndroidSchedulers; 17 | import rx.functions.Action1; 18 | import rx.functions.Func1; 19 | import rx.schedulers.Schedulers; 20 | import rx.subjects.PublishSubject; 21 | import timber.log.Timber; 22 | 23 | /** 24 | * RxJava测试 25 | *

26 | * author DONG 2015/11/15. 27 | */ 28 | public class RxJavaActivity extends BaseActivity { 29 | @InjectView(R.id.image) 30 | ImageView mImageView; 31 | @InjectView(R.id.click) 32 | Button mButton; 33 | 34 | private PublishSubject actionPublishSubject; 35 | 36 | @Override 37 | protected int initPageLayoutID() { 38 | return R.layout.activity_rxjava; 39 | } 40 | 41 | @Override 42 | protected void process(Bundle savedInstanceState) { 43 | super.process(savedInstanceState); 44 | 45 | Observable.just(R.mipmap.ic_launcher) // io线程,subscribeOn指定 46 | .subscribeOn(Schedulers.io()) 47 | .observeOn(Schedulers.io()) 48 | .map(new Func1() { // io线程,observeOn指定 49 | @Override 50 | public Bitmap call(Integer resId) { 51 | return BitmapFactory.decodeResource(getResources(), resId); 52 | } 53 | }) 54 | .observeOn(AndroidSchedulers.mainThread()) 55 | .subscribe(new Action1() { // main线程,observeOn指定 56 | @Override 57 | public void call(Bitmap bitmap) { 58 | mImageView.setImageBitmap(bitmap); 59 | } 60 | }); 61 | 62 | actionPublishSubject = PublishSubject.create(); 63 | actionPublishSubject 64 | .throttleFirst(1, TimeUnit.SECONDS) 65 | .subscribe(new Action1() { 66 | @Override 67 | public void call(Void aVoid) { 68 | Timber.d("click"); 69 | } 70 | }); 71 | 72 | } 73 | 74 | @OnClick(R.id.click) 75 | void click() { 76 | actionPublishSubject.onNext(null); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/original/calendar/CalendarAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.original.calendar; 2 | 3 | import java.util.List; 4 | 5 | import android.content.Context; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | import cn.dong.demo.R; 10 | import cn.dong.demo.ui.common.MyBaseAdapter; 11 | import cn.dong.demo.model.CalendarInfo; 12 | 13 | public class CalendarAdapter extends MyBaseAdapter { 14 | private int space; 15 | 16 | public CalendarAdapter(Context context, List data, int space) { 17 | super(context, data); 18 | this.space = space; 19 | } 20 | 21 | @Override 22 | public int getCount() { 23 | if (mData != null) { 24 | return mData.size() + space; 25 | } else { 26 | return 0; 27 | } 28 | } 29 | 30 | @Override 31 | public CalendarInfo getItem(int position) { 32 | return super.getItem(position - space); 33 | } 34 | 35 | @Override 36 | public boolean areAllItemsEnabled() { 37 | return false; 38 | } 39 | 40 | @Override 41 | public boolean isEnabled(int position) { 42 | return position >= space; 43 | } 44 | 45 | @Override 46 | public View getView(int position, View convertView, ViewGroup parent) { 47 | if (convertView == null) { 48 | convertView = mInflater.inflate(R.layout.calendar_item, parent, false); 49 | } 50 | if (isEnabled(position)) { 51 | CalendarInfo item = getItem(position); 52 | ((TextView) convertView).setText(String.valueOf(item.getDate())); 53 | } else { 54 | ((TextView) convertView).setText(""); 55 | } 56 | return convertView; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/original/calendar/CalendarFragment.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.original.calendar; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Calendar; 5 | import java.util.List; 6 | 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.AdapterView; 10 | import android.widget.AdapterView.OnItemClickListener; 11 | import android.widget.GridView; 12 | import cn.dong.demo.R; 13 | import cn.dong.demo.ui.common.BaseFragment; 14 | import cn.dong.demo.model.CalendarInfo; 15 | 16 | /** 17 | * 日历Fragment,根据传入的Calendar绘制日历 18 | * 19 | * @author dong 2014-10-19 20 | */ 21 | public class CalendarFragment extends BaseFragment { 22 | public static final String EXTRA_CALENDAR = "calendar"; 23 | 24 | private GridView mCalendarGrid; 25 | 26 | private Calendar mCalendar; 27 | private List mData; 28 | private CalendarAdapter mAdapter; 29 | 30 | @Override 31 | protected void init() { 32 | super.init(); 33 | mData = new ArrayList(); 34 | mCalendar = (Calendar) getArguments().getSerializable(EXTRA_CALENDAR); 35 | int space = mCalendar.get(Calendar.DAY_OF_WEEK) - 1; 36 | int daysOfMonth = mCalendar.getActualMaximum(Calendar.DAY_OF_MONTH); 37 | for (int i = 1; i <= daysOfMonth; i++) { 38 | mData.add(new CalendarInfo(mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), 39 | i)); 40 | } 41 | 42 | mAdapter = new CalendarAdapter(mContext, mData, space); 43 | } 44 | 45 | @Override 46 | protected int initPageLayoutId() { 47 | return R.layout.fragment_calendar; 48 | } 49 | 50 | @Override 51 | protected void initPageView(View rootView) { 52 | mCalendarGrid = (GridView) rootView.findViewById(R.id.calendar); 53 | } 54 | 55 | @Override 56 | protected void initPageViewListener() { 57 | mCalendarGrid.setOnItemClickListener(new OnItemClickListener() { 58 | @Override 59 | public void onItemClick(AdapterView parent, View view, int position, long id) { 60 | // TODO Auto-generated method stub 61 | 62 | } 63 | }); 64 | } 65 | 66 | @Override 67 | protected void process(Bundle savedInstanceState) { 68 | mCalendarGrid.setAdapter(mAdapter); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/other/ImageSelectorActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.other; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import butterknife.InjectView; 9 | import butterknife.OnClick; 10 | import cn.dong.demo.R; 11 | import cn.dong.demo.ui.common.BaseActivity; 12 | 13 | /** 14 | * Created by dong on 14/12/24. 15 | */ 16 | public class ImageSelectorActivity extends BaseActivity { 17 | @InjectView(R.id.uri) 18 | TextView uriView; 19 | @InjectView(R.id.path) 20 | TextView pathView; 21 | @InjectView(R.id.image) 22 | ImageView imageview; 23 | 24 | @Override 25 | protected int initPageLayoutID() { 26 | return R.layout.activity_selected_image; 27 | } 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | 33 | } 34 | 35 | @OnClick(R.id.button) 36 | void selectImage() { 37 | Intent imageIntent = new Intent(Intent.ACTION_GET_CONTENT); 38 | imageIntent.setType("image/*"); 39 | startActivityForResult(imageIntent, 0); 40 | } 41 | 42 | @OnClick(R.id.button2) 43 | void selectImage2() { 44 | Intent imageIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT); 45 | imageIntent.setType("image/*"); 46 | startActivityForResult(imageIntent, 0); 47 | } 48 | 49 | @Override 50 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 51 | super.onActivityResult(requestCode, resultCode, data); 52 | if (resultCode == RESULT_OK && data != null) { 53 | 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/storage/ContentProviderActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.storage; 2 | 3 | import java.util.ArrayList; 4 | 5 | import android.content.ContentResolver; 6 | import android.content.ContentUris; 7 | import android.database.Cursor; 8 | import android.net.Uri; 9 | import android.os.Bundle; 10 | import android.provider.ContactsContract; 11 | import android.widget.TextView; 12 | import cn.dong.demo.R; 13 | import cn.dong.demo.ui.common.BaseActivity; 14 | 15 | public class ContentProviderActivity extends BaseActivity { 16 | private ArrayList names = new ArrayList(); 17 | 18 | private TextView text; 19 | 20 | @Override 21 | protected int initPageLayoutID() { 22 | return R.layout.activity_content_provider; 23 | } 24 | 25 | @Override 26 | protected void initPageView() { 27 | text = (TextView) findViewById(R.id.text); 28 | } 29 | 30 | @Override 31 | protected void initPageViewListener() { 32 | 33 | } 34 | 35 | @Override 36 | protected void process(Bundle savedInstanceState) { 37 | // 系统Provider测试 38 | names = getNames(); 39 | StringBuilder sb = new StringBuilder(); 40 | for (String name : names) { 41 | sb.append(name).append(", "); 42 | } 43 | text.setText(sb.toString()); 44 | 45 | // 自定义Provider测试 46 | Uri uri = Uri.parse("content://cn.dong.demo.provider/"); 47 | ContentUris.withAppendedId(uri, 1); 48 | System.out.println(uri.toString()); 49 | } 50 | 51 | private ArrayList getNames() { 52 | ArrayList names = new ArrayList(); 53 | ContentResolver resolver = getContentResolver(); 54 | Uri uri = ContactsContract.Contacts.CONTENT_URI; 55 | Cursor cursor = resolver.query(uri, null, null, null, null); 56 | while (cursor.moveToNext()) { 57 | int nameIndex = cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME); 58 | String name = cursor.getString(nameIndex); 59 | names.add(name); 60 | } 61 | return names; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/text/AutoCompleteActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.text; 2 | 3 | import android.os.Bundle; 4 | import android.widget.ArrayAdapter; 5 | import android.widget.AutoCompleteTextView; 6 | import cn.dong.demo.R; 7 | import cn.dong.demo.ui.common.BaseActivity; 8 | import cn.dong.demo.view.EmailAutoCompleteTextView; 9 | 10 | public class AutoCompleteActivity extends BaseActivity { 11 | private EmailAutoCompleteTextView emailAutoText; 12 | private AutoCompleteTextView autoText; 13 | 14 | @Override 15 | protected int initPageLayoutID() { 16 | return R.layout.activity_auto_complete; 17 | } 18 | 19 | @Override 20 | protected void initPageView() { 21 | emailAutoText = (EmailAutoCompleteTextView) findViewById(R.id.email_auto_text); 22 | autoText = (AutoCompleteTextView) findViewById(R.id.autoText); 23 | } 24 | 25 | @Override 26 | protected void initPageViewListener() { 27 | 28 | } 29 | 30 | @Override 31 | protected void process(Bundle savedInstanceState) { 32 | String[] countries = getResources().getStringArray(R.array.countries_array); 33 | ArrayAdapter adapter = 34 | new ArrayAdapter(this, android.R.layout.simple_list_item_1, countries); 35 | autoText.setAdapter(adapter); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/text/ReplacementDrawableSpan.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.text; 2 | 3 | import android.graphics.Canvas; 4 | import android.graphics.Paint; 5 | import android.graphics.Rect; 6 | import android.graphics.drawable.Drawable; 7 | import android.text.style.ReplacementSpan; 8 | 9 | /** 10 | * ReplacementSpan that properly draws the drawable that is centered around the text 11 | * without changing the default text size or layout. 12 | */ 13 | public class ReplacementDrawableSpan extends ReplacementSpan { 14 | protected Drawable mDrawable; 15 | private final Paint mWorkPaint = new Paint(); 16 | private float mExtraMargin; 17 | 18 | public ReplacementDrawableSpan(Drawable drawable) { 19 | super(); 20 | mDrawable = drawable; 21 | } 22 | 23 | public void setExtraMargin(float margin) { 24 | mExtraMargin = margin; 25 | } 26 | 27 | private void setupFontMetrics(Paint.FontMetricsInt fm, Paint paint) { 28 | mWorkPaint.set(paint); 29 | if (fm != null) { 30 | mWorkPaint.getFontMetricsInt(fm); 31 | 32 | final Rect bounds = getBounds(); 33 | final int textHeight = fm.descent - fm.ascent; 34 | final int halfMargin = (int) mExtraMargin / 2; 35 | fm.ascent = Math.min(fm.top, fm.top + (textHeight - bounds.bottom) / 2) - halfMargin; 36 | fm.descent = Math.max(fm.bottom, fm.bottom + (bounds.bottom - textHeight) / 2) 37 | + halfMargin; 38 | fm.top = fm.ascent; 39 | fm.bottom = fm.descent; 40 | } 41 | } 42 | 43 | @Override 44 | public int getSize(Paint paint, CharSequence text, int i, int i2, Paint.FontMetricsInt fm) { 45 | setupFontMetrics(fm, paint); 46 | return getBounds().right; 47 | } 48 | 49 | @Override 50 | public void draw(Canvas canvas, CharSequence charSequence, int start, int end, float x, int top, 51 | int y, int bottom, Paint paint) { 52 | canvas.save(); 53 | int transY = (bottom - mDrawable.getBounds().bottom + top) / 2; 54 | canvas.translate(x, transY); 55 | mDrawable.draw(canvas); 56 | canvas.restore(); 57 | } 58 | 59 | protected Rect getBounds() { 60 | return mDrawable.getBounds(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/text/TextAdvanceActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.text; 2 | 3 | import android.view.KeyEvent; 4 | import android.widget.EditText; 5 | import android.widget.TextView; 6 | 7 | import butterknife.InjectView; 8 | import cn.dong.demo.R; 9 | import cn.dong.demo.ui.common.BaseActivity; 10 | import cn.dong.demo.util.CommonUtils; 11 | import cn.dong.demo.util.PixelUtils; 12 | 13 | /** 14 | * @author dong on 15/7/14. 15 | */ 16 | public class TextAdvanceActivity extends BaseActivity { 17 | @InjectView(R.id.tv_1) 18 | TextView mOneTextView; 19 | @InjectView(R.id.tv_2) 20 | TextView mTwoTextView; 21 | @InjectView(R.id.size_edit) 22 | EditText mSizeEdit; 23 | @InjectView(R.id.line_edit) 24 | EditText mLineEdit; 25 | @InjectView(R.id.padding_edit) 26 | EditText mPaddingEdit; 27 | 28 | @Override 29 | protected int initPageLayoutID() { 30 | return R.layout.activity_text_advance; 31 | } 32 | 33 | @Override 34 | protected void initPageView() { 35 | mPaddingEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() { 36 | @Override 37 | public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { 38 | int size = Integer.parseInt(mSizeEdit.getText() != null ? mSizeEdit.getText().toString() : "20"); 39 | float mult = Float.parseFloat(mLineEdit.getText() != null ? mLineEdit.getText().toString() : "1.3"); 40 | int padding = Integer.parseInt(mPaddingEdit.getText() != null ? mPaddingEdit.getText().toString() : "25"); 41 | int dp25 = PixelUtils.dp2px(25); 42 | padding = PixelUtils.dp2px(padding); 43 | 44 | mOneTextView.setTextSize(size); 45 | mOneTextView.setLineSpacing(mOneTextView.getLineSpacingExtra(), mult); 46 | mOneTextView.setPadding(padding, dp25, padding, dp25); 47 | 48 | mTwoTextView.setTextSize(size); 49 | mTwoTextView.setLineSpacing(mTwoTextView.getLineSpacingExtra(), mult); 50 | mTwoTextView.setPadding(padding, dp25, padding, dp25); 51 | 52 | CommonUtils.hideSoftInput(mContext, mPaddingEdit); 53 | return true; 54 | } 55 | }); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/CustomViewFragment.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.os.Bundle; 4 | 5 | import butterknife.InjectView; 6 | import cn.dong.demo.R; 7 | import cn.dong.demo.ui.common.BaseFragment; 8 | import cn.dong.demo.view.CustomView; 9 | 10 | /** 11 | * @author dong on 15/4/20. 12 | */ 13 | public class CustomViewFragment extends BaseFragment { 14 | @InjectView(R.id.custom) 15 | CustomView customView; 16 | 17 | @Override 18 | protected int initPageLayoutId() { 19 | return R.layout.fragment_customview; 20 | } 21 | 22 | @Override 23 | public void onPageFirstVisible() { 24 | customView.setState(4); 25 | } 26 | 27 | @Override 28 | public void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/DialogActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.os.Message; 6 | import android.support.v4.app.DialogFragment; 7 | import android.view.View; 8 | import android.view.View.OnClickListener; 9 | import android.widget.Button; 10 | import android.widget.TextView; 11 | 12 | import java.lang.ref.WeakReference; 13 | 14 | import cn.dong.demo.R; 15 | import cn.dong.demo.ui.common.BaseActivity; 16 | 17 | public class DialogActivity extends BaseActivity { 18 | private MyHandler handler; 19 | private TextView text; 20 | private Button button; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | initData(); 26 | initView(); 27 | } 28 | 29 | @Override 30 | protected int initPageLayoutID() { 31 | return R.layout.activity_dialog; 32 | } 33 | 34 | private void initData() { 35 | handler = new MyHandler(this); 36 | } 37 | 38 | private void initView() { 39 | text = (TextView) findViewById(R.id.text); 40 | button = (Button) findViewById(R.id.button); 41 | 42 | button.setOnClickListener(new OnClickListener() { 43 | @Override 44 | public void onClick(View v) { 45 | DialogFragment fragment = new MyDialogFragment(); 46 | fragment.show(getSupportFragmentManager(), "dialog"); 47 | } 48 | }); 49 | } 50 | 51 | private static class MyHandler extends Handler { 52 | private WeakReference mActivity; 53 | 54 | public MyHandler(DialogActivity activity) { 55 | mActivity = new WeakReference(activity); 56 | } 57 | 58 | @Override 59 | public void dispatchMessage(Message msg) { 60 | DialogActivity theActivity = mActivity.get(); 61 | if (theActivity == null) { 62 | return; 63 | } 64 | switch (msg.what) { 65 | case 0: 66 | theActivity.text.setText("handler!"); 67 | break; 68 | case 1: 69 | break; 70 | } 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/DrawableStateActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.os.Bundle; 5 | import android.util.Log; 6 | import android.view.View; 7 | import android.view.View.OnClickListener; 8 | import android.widget.TextView; 9 | import cn.dong.demo.R; 10 | import cn.dong.demo.ui.common.BaseActivity; 11 | 12 | public class DrawableStateActivity extends BaseActivity implements OnClickListener { 13 | boolean isSelected; 14 | boolean isCustom; 15 | 16 | private TextView textView; 17 | 18 | @Override 19 | protected int initPageLayoutID() { 20 | return R.layout.drawable_state_activity; 21 | } 22 | 23 | @Override 24 | protected void initPageView() { 25 | textView = (TextView) findViewById(R.id.image); 26 | } 27 | 28 | @Override 29 | protected void initPageViewListener() {} 30 | 31 | @Override 32 | protected void process(Bundle savedInstanceState) { 33 | 34 | } 35 | 36 | @Override 37 | public void onClick(View v) { 38 | Drawable drawable = textView.getCompoundDrawables()[2]; 39 | switch (v.getId()) { 40 | case R.id.selected: 41 | if (isSelected) { 42 | isSelected = false; 43 | } else { 44 | isSelected = true; 45 | } 46 | textView.setSelected(isSelected); 47 | printState(drawable); 48 | break; 49 | case R.id.custom: 50 | printState(drawable); 51 | if (isCustom) { 52 | isCustom = false; 53 | drawable.setState(new int[] {0}); 54 | } else { 55 | isCustom = true; 56 | drawable.setState(new int[] {R.attr.state_custom}); 57 | } 58 | printState(drawable); 59 | break; 60 | } 61 | } 62 | 63 | private void printState(Drawable drawable) { 64 | int[] ints = drawable.getState(); 65 | StringBuilder sb = new StringBuilder(); 66 | for (int i = 0; i < ints.length; i++) { 67 | sb.append("i:").append(ints[i]).append(" "); 68 | } 69 | Log.d("drawable", sb.toString()); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/DrawableTintActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import cn.dong.demo.R; 4 | import cn.dong.demo.ui.common.BaseActivity; 5 | 6 | /** 7 | * 8 | * 9 | * @author dong on 15/6/4. 10 | */ 11 | public class DrawableTintActivity extends BaseActivity { 12 | 13 | @Override 14 | protected int initPageLayoutID() { 15 | return R.layout.activity_drawable_tint; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/FragmentTabHostActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.FragmentTabHost; 5 | import android.view.Menu; 6 | import android.view.MenuItem; 7 | import android.widget.TabHost; 8 | 9 | import butterknife.InjectView; 10 | import cn.dong.demo.R; 11 | import cn.dong.demo.config.Extra; 12 | import cn.dong.demo.ui.common.BaseActivity; 13 | import cn.dong.demo.util.L; 14 | 15 | /** 16 | * @author dong on 15/4/17. 17 | */ 18 | public class FragmentTabHostActivity extends BaseActivity { 19 | @InjectView(android.R.id.tabhost) 20 | FragmentTabHost mTabHost; 21 | 22 | @Override 23 | protected int initPageLayoutID() { 24 | return R.layout.activity_tabhost; 25 | } 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | 31 | mTabHost.setup(mContext, getSupportFragmentManager(), R.id.realtabcontent); 32 | mTabHost.addTab(getTabSpec("tab1"), ColorFragment.class, getArgs(0)); 33 | mTabHost.addTab(getTabSpec("tab2"), ColorFragment.class, getArgs(1)); 34 | mTabHost.addTab(getTabSpec("tab3"), CustomViewFragment.class, null); 35 | } 36 | 37 | private TabHost.TabSpec getTabSpec(String tab) { 38 | return mTabHost.newTabSpec(tab).setIndicator(tab); 39 | } 40 | 41 | private Bundle getArgs(int position) { 42 | Bundle args = new Bundle(); 43 | args.putInt(Extra.POSITION, position); 44 | return args; 45 | } 46 | 47 | @Override 48 | public boolean onCreateOptionsMenu(Menu menu) { 49 | getMenuInflater().inflate(R.menu.activity_customview, menu); 50 | return true; 51 | } 52 | 53 | @Override 54 | public boolean onOptionsItemSelected(MenuItem item) { 55 | switch (item.getItemId()) { 56 | case R.id.action_settings: 57 | return true; 58 | default: 59 | return super.onOptionsItemSelected(item); 60 | } 61 | } 62 | 63 | @Override 64 | protected void onSaveInstanceState(Bundle outState) { 65 | L.d(TAG, "onSaveInstanceState"); 66 | super.onSaveInstanceState(outState); 67 | 68 | } 69 | 70 | @Override 71 | protected void onRestoreInstanceState(Bundle savedInstanceState) { 72 | L.d(TAG, "onRestoreInstanceState"); 73 | super.onRestoreInstanceState(savedInstanceState); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/MyDialogFragment.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import android.support.v4.app.DialogFragment; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.View.OnClickListener; 10 | import android.view.ViewGroup; 11 | import android.widget.Button; 12 | import android.widget.TextView; 13 | 14 | import cn.dong.demo.R; 15 | 16 | public class MyDialogFragment extends DialogFragment { 17 | private static final String TAG = "DialogFragment"; 18 | private TextView title_tv; 19 | private Button cancel_bn; 20 | private Button confirm_bn; 21 | 22 | private String title; 23 | private OnClickListener listener; 24 | 25 | public MyDialogFragment() { 26 | super(); 27 | } 28 | 29 | @Override 30 | public void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | setStyle(STYLE_NORMAL, R.style.DialogNoBackground); 33 | } 34 | 35 | @Override 36 | public Dialog onCreateDialog(Bundle savedInstanceState) { 37 | Log.d(TAG, "onCreateDialog"); 38 | return super.onCreateDialog(savedInstanceState); 39 | } 40 | 41 | @Override 42 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 43 | Log.d(TAG, "onCreateView"); 44 | View view = inflater.inflate(R.layout.fragment_dialog, container); 45 | title_tv = (TextView) view.findViewById(R.id.title); 46 | title_tv.setText(title); 47 | cancel_bn = (Button) view.findViewById(R.id.cancel); 48 | cancel_bn.setOnClickListener(new OnClickListener() { 49 | @Override 50 | public void onClick(View v) { 51 | dismiss(); 52 | } 53 | }); 54 | confirm_bn = (Button) view.findViewById(R.id.confirm); 55 | confirm_bn.setOnClickListener(listener); 56 | return view; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/SwipeRefreshLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.os.Bundle; 4 | import android.os.Message; 5 | import android.support.v4.widget.SwipeRefreshLayout; 6 | import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener; 7 | import cn.dong.demo.R; 8 | import cn.dong.demo.ui.common.BaseActivity; 9 | 10 | public class SwipeRefreshLayoutActivity extends BaseActivity { 11 | private SwipeRefreshLayout swipeLayout; 12 | 13 | @Override 14 | protected int initPageLayoutID() { 15 | return R.layout.activity_swiperefreshlayout; 16 | } 17 | 18 | @Override 19 | protected void initPageView() { 20 | swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout); 21 | } 22 | 23 | @Override 24 | protected void initPageViewListener() { 25 | swipeLayout.setOnRefreshListener(new OnRefreshListener() { 26 | 27 | @Override 28 | public void onRefresh() { 29 | mHandler.sendEmptyMessageDelayed(1, 2000); 30 | } 31 | }); 32 | } 33 | 34 | @Override 35 | protected void process(Bundle savedInstanceState) { 36 | // TODO Auto-generated method stub 37 | 38 | } 39 | 40 | @Override 41 | public boolean handleMessage(Message msg) { 42 | switch (msg.what) { 43 | case 1: 44 | swipeLayout.setRefreshing(false); 45 | break; 46 | default: 47 | break; 48 | } 49 | return true; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/ViewPagerActivity.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentStatePagerAdapter; 7 | import android.support.v4.view.ViewPager; 8 | import android.util.Log; 9 | 10 | import butterknife.InjectView; 11 | import cn.dong.demo.R; 12 | import cn.dong.demo.config.Extra; 13 | import cn.dong.demo.ui.common.BaseActivity; 14 | 15 | /** 16 | * @author dong on 15/3/27. 17 | */ 18 | public class ViewPagerActivity extends BaseActivity { 19 | @InjectView(R.id.pager) 20 | ViewPager viewPager; 21 | 22 | @Override 23 | protected int initPageLayoutID() { 24 | return R.layout.activity_viewpager; 25 | } 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | 31 | viewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager())); 32 | } 33 | 34 | private static class MyPagerAdapter extends FragmentStatePagerAdapter { 35 | 36 | public MyPagerAdapter(FragmentManager fm) { 37 | super(fm); 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return 5; 43 | } 44 | 45 | @Override 46 | public Fragment getItem(int position) { 47 | Log.d("PagerAdapter", "getItem " + position); 48 | Fragment fragment = new ColorFragment(); 49 | Bundle args = new Bundle(); 50 | args.putInt(Extra.POSITION, position); 51 | fragment.setArguments(args); 52 | return fragment; 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/touch/TouchButton.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui.touch; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.util.Log; 6 | import android.view.MotionEvent; 7 | import android.widget.Button; 8 | 9 | public class TouchButton extends Button { 10 | private static final String TAG = "button"; 11 | 12 | public TouchButton(Context context, AttributeSet attrs) { 13 | super(context, attrs); 14 | } 15 | 16 | @Override 17 | public boolean dispatchTouchEvent(MotionEvent event) { 18 | TouchEventHelper.displayAction(event, TAG, "dispatchTouchEvent"); 19 | boolean result = super.dispatchTouchEvent(event); 20 | Log.i(TAG, "dispatchTouchEvent return " + result); 21 | return result; 22 | } 23 | 24 | @Override 25 | public boolean onTouchEvent(MotionEvent event) { 26 | TouchEventHelper.displayAction(event, TAG, "onTouchEvent"); 27 | boolean result = super.onTouchEvent(event); 28 | Log.i(TAG, "onTouchEvent return " + result); 29 | return result; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/touch/TouchEventHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui.touch; 2 | 3 | import android.util.Log; 4 | import android.view.MotionEvent; 5 | 6 | public class TouchEventHelper { 7 | public static void displayAction(MotionEvent event, String tag, String msg) { 8 | String action = ""; 9 | switch (event.getAction()) { 10 | case MotionEvent.ACTION_DOWN: 11 | action = "DOWN"; 12 | break; 13 | case MotionEvent.ACTION_MOVE: 14 | action = "MOVE"; 15 | break; 16 | case MotionEvent.ACTION_UP: 17 | action = "UP"; 18 | break; 19 | } 20 | Log.i(tag, msg + "---" + action); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/touch/TouchLayout.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui.touch; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.util.Log; 6 | import android.view.MotionEvent; 7 | import android.widget.RelativeLayout; 8 | 9 | public class TouchLayout extends RelativeLayout { 10 | private static final String TAG = "RelativeLayout"; 11 | 12 | public TouchLayout(Context context, AttributeSet attrs) { 13 | super(context, attrs); 14 | } 15 | 16 | @Override 17 | public boolean dispatchTouchEvent(MotionEvent event) { 18 | TouchEventHelper.displayAction(event, TAG, "dispatchTouchEvent"); 19 | boolean result = super.dispatchTouchEvent(event); 20 | Log.i(TAG, "dispatchTouchEvent return " + result); 21 | return result; 22 | } 23 | 24 | @Override 25 | public boolean onInterceptTouchEvent(MotionEvent ev) { 26 | // TouchEventHelper.displayAction(ev, TAG, "onInterceptTouchEvent"); 27 | return super.onInterceptTouchEvent(ev); 28 | } 29 | 30 | @Override 31 | public boolean onTouchEvent(MotionEvent event) { 32 | TouchEventHelper.displayAction(event, TAG, "onTouchEvent"); 33 | boolean result = super.onTouchEvent(event); 34 | Log.i(TAG, "onTouchEvent return " + result); 35 | return result; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/ui/ui/touch/TouchView.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.ui.ui.touch; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.util.Log; 6 | import android.view.MotionEvent; 7 | import android.view.View; 8 | 9 | public class TouchView extends View { 10 | private static final String TAG = "View"; 11 | 12 | public TouchView(Context context, AttributeSet attrs) { 13 | super(context, attrs); 14 | } 15 | 16 | @Override 17 | public boolean dispatchTouchEvent(MotionEvent event) { 18 | TouchEventHelper.displayAction(event, TAG, "dispatchTouchEvent"); 19 | boolean result = super.dispatchTouchEvent(event); 20 | Log.i(TAG, "dispatchTouchEvent return " + result); 21 | return result; 22 | } 23 | 24 | @Override 25 | public boolean onTouchEvent(MotionEvent event) { 26 | TouchEventHelper.displayAction(event, TAG, "onTouchEvent"); 27 | boolean result = super.onTouchEvent(event); 28 | Log.i(TAG, "onTouchEvent return " + result); 29 | return result; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/AppHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.content.Context; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager.NameNotFoundException; 6 | 7 | public class AppHelper { 8 | 9 | public static PackageInfo getPackageInfo(Context context) { 10 | try { 11 | return context.getPackageManager().getPackageInfo(context.getPackageName(), 0); 12 | } catch (NameNotFoundException e) { 13 | return null; 14 | } 15 | } 16 | 17 | public static int getVersionCode(Context context) { 18 | PackageInfo info = getPackageInfo(context); 19 | if (info != null) { 20 | return info.versionCode; 21 | } else { 22 | return 0; 23 | } 24 | } 25 | 26 | public static String getVersionName(Context context) { 27 | PackageInfo info = getPackageInfo(context); 28 | if (info != null) { 29 | return info.versionName; 30 | } else { 31 | return ""; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | /** 7 | * Date工具类 8 | * 9 | * @author dong 2014-8-10 10 | */ 11 | public class DateUtil { 12 | 13 | /** 14 | * 将一个java.util.Date对象转换成特定格式的字符串 15 | * 16 | * @param date 日期对象 17 | * @param format 指定格式 18 | */ 19 | public static String formatDate(Date date, String format) { 20 | String result = ""; 21 | if (date == null) { 22 | return result; 23 | } 24 | SimpleDateFormat formatter = new SimpleDateFormat(format); 25 | try { 26 | result = formatter.format(date.getTime()); 27 | return result; 28 | } catch (Exception e) { 29 | e.printStackTrace(); 30 | return result; 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/FileUtil.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | 4 | public class FileUtil { 5 | 6 | /** 7 | * 获取文件后缀 8 | * 9 | * @param filePath 10 | * @return 11 | */ 12 | public static String getSuffix(String filePath) { 13 | if (StrUtil.isEmpty(filePath)) { 14 | return ""; 15 | } else if (filePath.lastIndexOf("") <= -1) { 16 | return ""; 17 | } else { 18 | return filePath.substring(filePath.lastIndexOf("")); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/L.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.content.Context; 4 | import android.util.Log; 5 | 6 | import cn.dong.demo.BuildConfig; 7 | import cn.dong.demo.MyApp; 8 | 9 | /** 10 | * 日志工具类 11 | * 12 | * @author dong 2014-11-18 13 | */ 14 | public class L { 15 | private static final String TAG = "log"; 16 | private static Context sContext = MyApp.getInstance(); 17 | 18 | public static String getCurrentMethodName() { 19 | return Thread.currentThread().getStackTrace()[3].getMethodName(); 20 | } 21 | 22 | public static void v(String tag, int id) { 23 | log(Log.VERBOSE, tag, sContext.getResources().getString(id)); 24 | } 25 | 26 | public static void v(String tag, String msg) { 27 | log(Log.VERBOSE, tag, msg); 28 | } 29 | 30 | public static void v(String tag, String format, Object... args) { 31 | log(Log.VERBOSE, tag, format, args); 32 | } 33 | 34 | public static void d(String tag, int id) { 35 | log(Log.DEBUG, tag, sContext.getResources().getString(id)); 36 | } 37 | 38 | public static void d(String tag, String msg) { 39 | log(Log.DEBUG, tag, msg); 40 | } 41 | 42 | public static void d(String tag, String format, Object... args) { 43 | log(Log.DEBUG, tag, format, args); 44 | } 45 | 46 | public static void i(String tag, int id) { 47 | log(Log.INFO, tag, sContext.getResources().getString(id)); 48 | } 49 | 50 | public static void i(String tag, String msg) { 51 | log(Log.INFO, tag, msg); 52 | } 53 | 54 | public static void i(String tag, String format, Object... args) { 55 | log(Log.INFO, tag, format, args); 56 | } 57 | 58 | public static void w(String tag, int id) { 59 | log(Log.WARN, tag, sContext.getResources().getString(id)); 60 | } 61 | 62 | public static void w(String tag, String msg) { 63 | log(Log.WARN, tag, msg); 64 | } 65 | 66 | public static void e(String tag, int id) { 67 | log(Log.ERROR, tag, sContext.getResources().getString(id)); 68 | } 69 | 70 | public static void e(String tag, String msg) { 71 | log(Log.ERROR, tag, msg); 72 | } 73 | 74 | private static void log(int priority, String tag, String format, Object... args) { 75 | log(priority, tag, String.format(format, args)); 76 | } 77 | 78 | private static void log(int priority, String tag, String msg) { 79 | if (BuildConfig.DEBUG) { 80 | // debug模式默认打印log,release包不打印log 81 | Log.println(priority, tag, msg); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/MeasureUtil.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | import android.util.TypedValue; 6 | 7 | public class MeasureUtil { 8 | 9 | public static int px2Dip(Context context, float px) { 10 | Resources r; 11 | if (context == null) { 12 | r = Resources.getSystem(); 13 | } else { 14 | r = context.getResources(); 15 | } 16 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, px, 17 | r.getDisplayMetrics()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/MediaPlayerManager.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.media.AudioManager; 4 | import android.media.MediaPlayer; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * 多媒体播放管理 10 | * 11 | * @author dong on 15/10/22. 12 | */ 13 | public class MediaPlayerManager { 14 | 15 | private static MediaPlayer sMediaPlayer; 16 | 17 | private static void initMediaPlayer() { 18 | if (sMediaPlayer == null) { 19 | sMediaPlayer = new MediaPlayer(); 20 | sMediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() { 21 | @Override 22 | public boolean onError(MediaPlayer mp, int what, int extra) { 23 | sMediaPlayer.reset(); 24 | return false; 25 | } 26 | }); 27 | } else { 28 | sMediaPlayer.reset(); 29 | } 30 | } 31 | 32 | public static void playAudio(String audioPath, MediaPlayer.OnCompletionListener listener) { 33 | initMediaPlayer(); 34 | try { 35 | sMediaPlayer.setDataSource(audioPath); 36 | sMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 37 | sMediaPlayer.setOnCompletionListener(listener); 38 | sMediaPlayer.prepare(); 39 | sMediaPlayer.start(); 40 | } catch (IOException e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | 45 | public static void release() { 46 | if (sMediaPlayer != null) { 47 | sMediaPlayer.release(); 48 | sMediaPlayer = null; 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/NotificationHelper.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.content.Context; 4 | import android.media.AudioManager; 5 | import android.support.v4.app.NotificationManagerCompat; 6 | 7 | import cn.dong.demo.MyApp; 8 | import timber.log.Timber; 9 | 10 | /** 11 | * @author dong on 16/1/21. 12 | */ 13 | public enum NotificationHelper { 14 | INSTANCE; // 单例 15 | 16 | private static final long VIBRATE_INTERVAL = 4000; // 震动间隔 17 | 18 | private final NotificationManagerCompat mNotificationManager; 19 | private final AudioManager audioManager; 20 | 21 | private long lastVibrateTime = 0; // 上次震动的时间 22 | 23 | NotificationHelper() { 24 | mNotificationManager = NotificationManagerCompat.from(MyApp.getInstance()); 25 | audioManager = (AudioManager) MyApp.getInstance().getSystemService(Context.AUDIO_SERVICE); 26 | } 27 | 28 | public void vibrateAndSound() { 29 | Timber.d("RingerMode %d", audioManager.getRingerMode()); 30 | long now = System.currentTimeMillis(); 31 | if (lastVibrateTime == 0 || now - lastVibrateTime >= VIBRATE_INTERVAL) { 32 | lastVibrateTime = now; 33 | VibratorManager.INSTANCE.vibrate(); 34 | RingManager.INSTANCE.play(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/PixelUtils.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.content.res.Resources; 4 | 5 | /** 6 | * 像素转换工具类. 7 | */ 8 | public class PixelUtils { 9 | private static Resources resources = Resources.getSystem(); 10 | private static int densityDpi = resources.getDisplayMetrics().densityDpi; 11 | private static float scaledDensity = resources.getDisplayMetrics().scaledDensity; 12 | 13 | public static int dp2px(float value) { 14 | final float scale = densityDpi; 15 | return (int) (value * (scale / 160) + 0.5f); 16 | } 17 | 18 | public static int px2dp(float value) { 19 | final float scale = densityDpi; 20 | return (int) ((value * 160) / scale + 0.5f); 21 | } 22 | 23 | public static int sp2px(float value) { 24 | float spvalue = value * scaledDensity; 25 | return (int) (spvalue + 0.5f); 26 | } 27 | 28 | public static int px2sp(float value) { 29 | final float scale = scaledDensity; 30 | return (int) (value / scale + 0.5f); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/RingManager.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.media.MediaPlayer; 4 | import android.media.RingtoneManager; 5 | import android.net.Uri; 6 | 7 | import cn.dong.demo.MyApp; 8 | 9 | /** 10 | * @author dong on 16/1/21. 11 | */ 12 | public enum RingManager { 13 | INSTANCE; // 单例 14 | 15 | private MediaPlayer mediaPlayer; 16 | 17 | RingManager() { 18 | Uri notificationUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); 19 | mediaPlayer = MediaPlayer.create(MyApp.getInstance(), notificationUri); 20 | } 21 | 22 | public void play() { 23 | if (mediaPlayer != null) { 24 | mediaPlayer.start(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/StrUtil.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | 4 | /** 5 | * 字符串辅助类 6 | * 7 | * @author dong 2014-8-10 8 | */ 9 | public class StrUtil { 10 | public static boolean isEmpty(String str) { 11 | if (str == null || str.trim().length() == 0) { 12 | return true; 13 | } else { 14 | return false; 15 | } 16 | } 17 | 18 | /** 19 | * 返回以某个符号分隔的字符串的第几项 从0开始 20 | * 21 | * @param str 原字符串 22 | * @param num 要取得的字符在字符串中的序号,以0开始 23 | * @param character 分隔符 24 | * @return String 返回类型 25 | */ 26 | public static String getSingleSplitStr(String str, int num, String character) { 27 | if (isEmpty(str) || !str.contains(character)) { 28 | return str; 29 | } 30 | String[] strs = str.split(character); 31 | if (strs.length < num + 1) { 32 | return ""; 33 | } 34 | try { 35 | return strs[num]; 36 | } catch (Exception e) { 37 | return ""; 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/T.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | /** 7 | * 简易Toast
8 | * 保持只有一个实例,防止多次调用时长时间依次显示问题 9 | * 10 | * @author dong 2014-8-9 11 | */ 12 | public class T { 13 | private static Toast sToast; 14 | 15 | public static void shortT(Context context, int msgResId) { 16 | shortT(context, context.getResources().getString(msgResId)); 17 | } 18 | 19 | public static void shortT(Context context, String msg) { 20 | if (sToast == null) { 21 | sToast = Toast.makeText(context.getApplicationContext(), msg, Toast.LENGTH_SHORT); 22 | sToast.show(); 23 | } else { 24 | sToast.setText(msg); 25 | sToast.setDuration(Toast.LENGTH_SHORT); 26 | sToast.show(); 27 | } 28 | } 29 | 30 | public static void longT(Context context, int msgResId) { 31 | longT(context, context.getResources().getString(msgResId)); 32 | } 33 | 34 | public static void longT(Context context, String msg) { 35 | if (sToast == null) { 36 | sToast = Toast.makeText(context.getApplicationContext(), msg, Toast.LENGTH_LONG); 37 | sToast.show(); 38 | } else { 39 | sToast.setText(msg); 40 | sToast.setDuration(Toast.LENGTH_LONG); 41 | sToast.show(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/VibratorManager.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.app.Service; 4 | import android.os.Vibrator; 5 | 6 | import cn.dong.demo.MyApp; 7 | 8 | /** 9 | * 振动器管理 10 | * 11 | * @author dong on 16/1/4. 12 | */ 13 | public enum VibratorManager { 14 | INSTANCE; // 单例 15 | 16 | public static final int VIBRATION_TIME = 250; 17 | 18 | private final Vibrator vibrator; 19 | 20 | VibratorManager() { 21 | vibrator = (Vibrator) MyApp.getInstance().getSystemService(Service.VIBRATOR_SERVICE); 22 | } 23 | 24 | public void vibrate() { 25 | vibrator.vibrate(new long[]{0, VIBRATION_TIME, VIBRATION_TIME, VIBRATION_TIME}, -1); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/ViewHolder.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util; 2 | 3 | import android.util.SparseArray; 4 | import android.view.View; 5 | 6 | public class ViewHolder { 7 | @SuppressWarnings({ "unchecked", "hiding" }) 8 | public static T get(View view, int id) { 9 | SparseArray viewHolder = (SparseArray) view.getTag(); 10 | if (viewHolder == null) { 11 | viewHolder = new SparseArray(); 12 | view.setTag(viewHolder); 13 | } 14 | View childView = viewHolder.get(id); 15 | if (childView == null) { 16 | childView = view.findViewById(id); 17 | viewHolder.put(id, childView); 18 | } 19 | return (T) childView; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/inputfilter/EmojiInputFilter.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util.inputfilter; 2 | 3 | import android.text.InputFilter; 4 | import android.text.Spanned; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | import cn.dong.demo.util.L; 10 | 11 | /** 12 | * Emoji输入过滤 13 | * 在全面兼容Emoji前暂时禁止Emji的使用 14 | * 15 | * @author dong on 15/3/11. 16 | */ 17 | public class EmojiInputFilter implements InputFilter { 18 | private static final String TAG = EmojiInputFilter.class.getSimpleName(); 19 | 20 | private Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]", Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); 21 | 22 | @Override 23 | public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { 24 | L.d(TAG, "filter source=%s start=%d end=%d dest=%s dstart=%d dend=%d", source, start, end, dest, dstart, dend); 25 | Matcher emojiMatcher = emoji.matcher(source); 26 | if (emojiMatcher.find()) { 27 | return ""; 28 | } else { 29 | return source; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/inputfilter/EmsLenghtFilter.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util.inputfilter; 2 | 3 | import android.text.InputFilter; 4 | import android.text.Spanned; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | /** 10 | * 输入长度限制,半角字符算一个,全角字符算两个 11 | * 12 | * @author dong on 15/4/24. 13 | */ 14 | public class EmsLenghtFilter implements InputFilter { 15 | private static final Pattern chinesePattern = Pattern.compile("[\\u4e00-\\u9fa5]"); // unicode编码,判断是否为汉字 16 | 17 | private int mMax; 18 | 19 | public EmsLenghtFilter(int max) { 20 | this.mMax = max; 21 | } 22 | 23 | @Override 24 | public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { 25 | int destCount = dest.toString().length() + getChineseCount(dest.toString()); 26 | int sourceCount = source.toString().length() + getChineseCount(source.toString()); 27 | if (destCount + sourceCount > mMax) { 28 | return ""; 29 | } else { 30 | return source; 31 | } 32 | } 33 | 34 | private int getChineseCount(String str) { 35 | int count = 0; 36 | Matcher m = chinesePattern.matcher(str); 37 | while (m.find()) { 38 | for (int i = 0; i <= m.groupCount(); i++) { 39 | count = count + 1; 40 | } 41 | } 42 | return count; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/inputfilter/InputLengthFilter.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util.inputfilter; 2 | 3 | import android.text.InputFilter; 4 | import android.text.Spanned; 5 | 6 | /** 7 | * 文字长度过滤器,2半角字符=1全角字符=1字长 8 | * 9 | * @author dong on 16/3/16. 10 | */ 11 | public class InputLengthFilter implements InputFilter { 12 | private int max; 13 | 14 | public InputLengthFilter(int max) { 15 | this.max = max; 16 | } 17 | 18 | @Override 19 | public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { 20 | int inputLength = (int) Math.ceil(getInputLength(dest.toString())); 21 | int keep = max - inputLength; 22 | if (keep <= 0) { 23 | return ""; 24 | } else { 25 | if (keep >= getInputLength(source.toString())) { 26 | return null; // keep original 27 | } else { 28 | return source.subSequence(start, keep / 2); 29 | } 30 | } 31 | } 32 | 33 | public static double getInputLength(String str) { 34 | String tmp = str.replaceAll("[^\\x00-\\xff]", "**"); 35 | return tmp.length() / 2.0; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/util/inputfilter/LinebreakInputFilter.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.util.inputfilter; 2 | 3 | import android.text.InputFilter; 4 | import android.text.Spanned; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | import cn.dong.demo.util.L; 10 | 11 | /** 12 | * @author dong on 15/5/29. 13 | */ 14 | public class LinebreakInputFilter implements InputFilter { 15 | private static final String TAG = LinebreakInputFilter.class.getSimpleName(); 16 | private static final String PATTERN = "\\n"; 17 | 18 | @Override 19 | public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { 20 | L.d(TAG, "filter source=%s start=%d end=%d dest=%s dstart=%d dend=%d", source, start, end, dest, dstart, dend); 21 | Pattern pattern = Pattern.compile(PATTERN); 22 | Matcher matcher = pattern.matcher(source); 23 | if (matcher.find()) { 24 | return ""; 25 | } else { 26 | return source; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/view/CustomLayout.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.view; 2 | 3 | import android.content.Context; 4 | import android.graphics.Rect; 5 | import android.util.AttributeSet; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | /** 10 | * author DONG 2015/5/7. 11 | */ 12 | public class CustomLayout extends ViewGroup { 13 | 14 | private int mLeftWidth; 15 | private int mRightWidth; 16 | 17 | private final Rect mTmpContainerRect = new Rect(); 18 | private final Rect mTmpChildRect = new Rect(); 19 | 20 | public CustomLayout(Context context) { 21 | super(context); 22 | } 23 | 24 | public CustomLayout(Context context, AttributeSet attrs) { 25 | this(context, attrs, 0); 26 | } 27 | 28 | public CustomLayout(Context context, AttributeSet attrs, int defStyleAttr) { 29 | super(context, attrs, defStyleAttr); 30 | } 31 | 32 | @Override 33 | public boolean shouldDelayChildPressedState() { 34 | return false; 35 | } 36 | 37 | @Override 38 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 39 | final int count = getChildCount(); 40 | 41 | mLeftWidth = 0; 42 | mRightWidth = 0; 43 | 44 | int maxHeight = 0; 45 | int maxWidth = 0; 46 | int childState = 0; 47 | 48 | for (int i = 0; i < count; i++) { 49 | final View child = getChildAt(i); 50 | if (child.getVisibility() != GONE) { 51 | // Measure the child 52 | measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0); 53 | 54 | // Update size information 55 | 56 | } 57 | } 58 | 59 | 60 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 61 | } 62 | 63 | @Override 64 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 65 | 66 | } 67 | 68 | 69 | 70 | @Override 71 | public LayoutParams generateLayoutParams(AttributeSet attrs) { 72 | return super.generateLayoutParams(attrs); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/cn/dong/demo/view/MultiDoneEditText.java: -------------------------------------------------------------------------------- 1 | package cn.dong.demo.view; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.AppCompatEditText; 5 | import android.util.AttributeSet; 6 | import android.view.inputmethod.EditorInfo; 7 | import android.view.inputmethod.InputConnection; 8 | 9 | /** 10 | * 多行输入同时可以支持ActionDone的EditText 11 | * 12 | * @author DONG 2015/5/30. 13 | */ 14 | public class MultiDoneEditText extends AppCompatEditText { 15 | public MultiDoneEditText(Context context) { 16 | super(context); 17 | } 18 | 19 | public MultiDoneEditText(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | } 22 | 23 | public MultiDoneEditText(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | } 26 | 27 | @Override 28 | public InputConnection onCreateInputConnection(EditorInfo outAttrs) { 29 | InputConnection connection = super.onCreateInputConnection(outAttrs); 30 | int imeActions = outAttrs.imeOptions & EditorInfo.IME_MASK_ACTION; 31 | if ((imeActions & EditorInfo.IME_ACTION_DONE) != 0) { 32 | // clear the existing action 33 | outAttrs.imeOptions ^= imeActions; 34 | // set the DONE action 35 | outAttrs.imeOptions |= EditorInfo.IME_ACTION_DONE; 36 | } 37 | if ((outAttrs.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) { 38 | outAttrs.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION; 39 | } 40 | return connection; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/res/anim/activity_close_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/activity_close_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/activity_open_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/activity_open_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fragment_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/popup_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/anim/popup_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/settingswindow_in_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/settingswindow_out_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/top_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/top_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/zoom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/color/text_enable_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/adj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/adj.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/cancel.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/dialog_full_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/dialog_full_holo_light.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/dialog_loading_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/dialog_loading_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/empty_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/empty_photo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_build_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_build_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_explore_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_explore_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_extension_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_extension_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_flare_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_flare_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_more_horiz_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_more_horiz_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_phone_android_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_phone_android_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_public_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_public_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_settings_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_settings_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_star_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_star_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_storage_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_storage_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_text_format_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/ic_text_format_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/list_focused_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/list_focused_holo.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/list_longpressed_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/list_longpressed_holo_light.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/list_pressed_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/list_pressed_holo_light.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/list_selector_disabled_holo_light.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/list_selector_disabled_holo_light.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/recorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/recorder.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/v_anim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/v_anim1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/v_anim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/v_anim2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/v_anim3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/v_anim3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/voice_to_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/voice_to_short.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/xlistview_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-hdpi/xlistview_arrow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/chatto_bg_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/chatto_bg_focused.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_build_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_build_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_explore_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_explore_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_extension_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_extension_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_flare_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_flare_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_more_horiz_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_more_horiz_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_phone_android_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_phone_android_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_public_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_public_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_settings_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_settings_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_star_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_star_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_storage_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_storage_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_text_format_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/ic_text_format_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/logo_email.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/logo_more.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xhdpi/logo_qq.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/example.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/example.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_build_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_build_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_demo_mark_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_demo_mark_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_explore_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_explore_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_extension_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_extension_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_flare_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_flare_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mark_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mark_up.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_001.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_002.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_003.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_004.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_005.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_006.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_007.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mic_voice_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_mic_voice_008.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_more_horiz_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_more_horiz_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_phone_android_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_phone_android_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_public_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_public_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_record_warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_record_warn.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_settings_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_settings_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_star_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_star_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_storage_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_storage_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_text_format_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxhdpi/ic_text_format_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_build_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_build_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_explore_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_explore_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_extension_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_extension_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_flare_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_flare_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_more_horiz_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_more_horiz_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_phone_android_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_phone_android_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_public_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_public_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_settings_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_settings_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_star_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_star_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_storage_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_storage_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_text_format_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongorigin/AndroidDemo/ac55c4191687327c048878154487f9355ef2c9fa/app/src/main/res/drawable-xxxhdpi/ic_text_format_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_list_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_recorder_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_recorder_recording.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_window.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_state.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_background_holo_light.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/list_selector_background_transition_holo_light.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_list_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/play_audio_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 10 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_anime.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | 27 | 28 | 34 | 35 |