├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── LICENSE ├── PracticeDemos ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── PracticeDemos.iml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── keystore │ │ └── debug.jks │ ├── libs │ │ └── umeng-analytics-v5.6.1.jar │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── yifeiyuan │ │ │ └── practice │ │ │ └── practicedemos │ │ │ └── ApplicationTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── aidl │ │ └── yifeiyuan │ │ │ └── practice │ │ │ └── practicedemos │ │ │ └── IBook.aidl │ │ ├── java │ │ └── yifeiyuan │ │ │ └── practice │ │ │ └── practicedemos │ │ │ ├── App.java │ │ │ ├── Const.java │ │ │ ├── DownloadService.java │ │ │ ├── HeadView.java │ │ │ ├── LaunchActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── RVDemo.java │ │ │ ├── base │ │ │ ├── AboutMeActivity.java │ │ │ ├── BaseActivity.java │ │ │ ├── BaseFragment.java │ │ │ ├── Practice.java │ │ │ └── ToolbarActivity.java │ │ │ ├── broadcast │ │ │ └── AppReceiver.java │ │ │ ├── camera │ │ │ └── CameraActivity.java │ │ │ ├── customview │ │ │ ├── CanvasActivity.java │ │ │ ├── CircleImgView.java │ │ │ ├── ClipActivity.java │ │ │ ├── CustomViewAndGroupActivity.java │ │ │ ├── CustomViewFragment.java │ │ │ ├── CustomViewGroupFragment.java │ │ │ ├── FaceView.java │ │ │ ├── HappyWorryView.java │ │ │ ├── MyView.java │ │ │ ├── MyViewGroup.java │ │ │ ├── PathActivity.java │ │ │ ├── PathView.java │ │ │ ├── ShareMenu.java │ │ │ └── SwitchActivity.java │ │ │ ├── dp │ │ │ ├── Boss.java │ │ │ └── Worker.java │ │ │ ├── fastblur │ │ │ ├── FastBlur.java │ │ │ └── FastBlurActivity.java │ │ │ ├── fir │ │ │ └── Fir.java │ │ │ ├── info │ │ │ └── DeviceInfoActivty.java │ │ │ ├── intent │ │ │ ├── AffinityActivityC.java │ │ │ ├── AffinityActivityD.java │ │ │ ├── IntentActivity.java │ │ │ ├── LaunchmodeActivity.java │ │ │ ├── SchemeActivity.java │ │ │ └── SchemeHPActivity.java │ │ │ ├── ipc │ │ │ ├── Book.java │ │ │ ├── IUser.java │ │ │ └── User.java │ │ │ ├── itemtouchhelper │ │ │ ├── SimpleSwipeDismissCallback.java │ │ │ ├── SimpleSwipedismissFragment.java │ │ │ ├── SwipeDismissAdapter.java │ │ │ ├── SwipeDismissListFragment.java │ │ │ └── TouchHelperActivity.java │ │ │ ├── jni │ │ │ └── HelloJni.java │ │ │ ├── materialsupport │ │ │ ├── GridFragment.java │ │ │ ├── InfoFragment.java │ │ │ ├── ListFragment.java │ │ │ ├── MaterialActivity.java │ │ │ ├── StaggeredGridFragment.java │ │ │ └── TextInputActivity.java │ │ │ ├── periscope │ │ │ ├── BezierActivity.java │ │ │ ├── BezierEvaluator.java │ │ │ └── FavorLayout.java │ │ │ ├── recyclerview │ │ │ ├── HoriListFragment.java │ │ │ ├── HorizontalRvActivity.java │ │ │ └── LM.java │ │ │ ├── reveal │ │ │ ├── GoToRevealActivity.java │ │ │ ├── RevealActivity.java │ │ │ ├── RevealBackgroundView.java │ │ │ └── RevealView.java │ │ │ ├── screenorientation │ │ │ └── OrientationActivity.java │ │ │ ├── service │ │ │ ├── MyService.java │ │ │ └── ServiceActivity.java │ │ │ ├── surfaceview │ │ │ └── GlsurfaceActivity.java │ │ │ ├── thirdparty │ │ │ ├── FacebookActivity.java │ │ │ └── TwitterActivity.java │ │ │ ├── touch │ │ │ ├── MiddleViewGroup.java │ │ │ ├── SimpleView.java │ │ │ ├── TopViewGroup.java │ │ │ ├── TouchActivity.java │ │ │ └── TouchUtil.java │ │ │ ├── ui │ │ │ ├── AppCompatPreferenceActivity.java │ │ │ ├── ScrollingActivity.java │ │ │ ├── SettingsActivity.java │ │ │ ├── UIOneActivity.java │ │ │ └── ViewPagerActivity.java │ │ │ ├── viewdrager │ │ │ ├── DragerView.java │ │ │ ├── SwipeBackActivity.java │ │ │ ├── SwipeBackFrameLayout.java │ │ │ └── ViewDragerActivity.java │ │ │ ├── wave │ │ │ ├── HeartView.java │ │ │ ├── WaveActivity.java │ │ │ ├── WaveView.java │ │ │ └── WaveView2.java │ │ │ ├── webview │ │ │ ├── WebViewActivity.java │ │ │ └── YWebView.java │ │ │ └── window │ │ │ └── FloatingWindowActivity.java │ │ ├── jni │ │ ├── yifeiyuan_practice_practicedemos_jni_HelloJni.cpp │ │ └── yifeiyuan_practice_practicedemos_jni_HelloJni.h │ │ └── res │ │ ├── anim │ │ ├── no_anim.xml │ │ └── out_to_right.xml │ │ ├── drawable-hdpi │ │ ├── ic_info_black_24dp.png │ │ ├── ic_notifications_black_24dp.png │ │ └── ic_sync_black_24dp.png │ │ ├── drawable-mdpi │ │ ├── ic_info_black_24dp.png │ │ ├── ic_notifications_black_24dp.png │ │ └── ic_sync_black_24dp.png │ │ ├── drawable-v21 │ │ ├── ic_info_black_24dp.xml │ │ ├── ic_notifications_black_24dp.xml │ │ └── ic_sync_black_24dp.xml │ │ ├── drawable-xhdpi │ │ ├── ic_info_black_24dp.png │ │ ├── ic_notifications_black_24dp.png │ │ └── ic_sync_black_24dp.png │ │ ├── drawable-xxhdpi │ │ ├── ic_info_black_24dp.png │ │ ├── ic_notifications_black_24dp.png │ │ └── ic_sync_black_24dp.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_info_black_24dp.png │ │ ├── ic_notifications_black_24dp.png │ │ └── ic_sync_black_24dp.png │ │ ├── drawable │ │ ├── bg_share_duanxin.xml │ │ ├── bg_share_open.xml │ │ ├── bg_share_pyq.xml │ │ ├── bg_share_qq.xml │ │ ├── bg_share_qzone.xml │ │ ├── bg_share_weibo.xml │ │ └── bg_share_weixin.xml │ │ ├── layout-land │ │ └── activity_config.xml │ │ ├── layout-port │ │ └── activity_config.xml │ │ ├── layout │ │ ├── activity_affinity_activity_c.xml │ │ ├── activity_affinity_activity_d.xml │ │ ├── activity_camera.xml │ │ ├── activity_config.xml │ │ ├── activity_custom_view.xml │ │ ├── activity_device_info_activty.xml │ │ ├── activity_facebook.xml │ │ ├── activity_fast_blur.xml │ │ ├── activity_floating_window.xml │ │ ├── activity_gesture.xml │ │ ├── activity_glsurface.xml │ │ ├── activity_go_to_reval.xml │ │ ├── activity_horizontal_rv.xml │ │ ├── activity_intent_one.xml │ │ ├── activity_intent_two.xml │ │ ├── activity_lambda.xml │ │ ├── activity_launchmode.xml │ │ ├── activity_main.xml │ │ ├── activity_main2.xml │ │ ├── activity_media.xml │ │ ├── activity_path.xml │ │ ├── activity_periscope.xml │ │ ├── activity_reval.xml │ │ ├── activity_rvdemo.xml │ │ ├── activity_sb_sample.xml │ │ ├── activity_scheme.xml │ │ ├── activity_scrolling.xml │ │ ├── activity_service.xml │ │ ├── activity_show_case.xml │ │ ├── activity_swipe_back.xml │ │ ├── activity_swipe_dismiss.xml │ │ ├── activity_switch.xml │ │ ├── activity_text_input.xml │ │ ├── activity_touch.xml │ │ ├── activity_twitter.xml │ │ ├── activity_uione.xml │ │ ├── activity_view_drager.xml │ │ ├── activity_view_pager.xml │ │ ├── activity_wave.xml │ │ ├── activity_web_view.xml │ │ ├── activity_welcome.xml │ │ ├── appbar_cons_toolbar.xml │ │ ├── content_affinity_activity_c.xml │ │ ├── content_affinity_activity_d.xml │ │ ├── content_camera.xml │ │ ├── content_clip.xml │ │ ├── content_facebook.xml │ │ ├── content_floating_window.xml │ │ ├── content_glsurface.xml │ │ ├── content_horizontal_rv.xml │ │ ├── content_launchmode.xml │ │ ├── content_layout.xml │ │ ├── content_path.xml │ │ ├── content_rvdemo.xml │ │ ├── content_scrolling.xml │ │ ├── content_service.xml │ │ ├── content_switch.xml │ │ ├── content_touch.xml │ │ ├── content_twitter.xml │ │ ├── fragment_custom_view.xml │ │ ├── fragment_custom_view_group.xml │ │ ├── fragment_grid.xml │ │ ├── fragment_info.xml │ │ ├── fragment_list.xml │ │ ├── fragment_media.xml │ │ ├── fragment_single_rv.xml │ │ ├── head_view.xml │ │ ├── item_img.xml │ │ ├── material_grid_item.xml │ │ ├── material_list_item.xml │ │ ├── material_support.xml │ │ ├── mooc_item.xml │ │ ├── nav_header_layout.xml │ │ ├── recycler_view.xml │ │ ├── sample_bezier_view.xml │ │ ├── simple_rv.xml │ │ ├── teststtt.xml │ │ └── toolbar.xml │ │ ├── menu │ │ ├── menu_config.xml │ │ ├── menu_customview.xml │ │ ├── menu_device_info_activty.xml │ │ ├── menu_gauss_blur.xml │ │ ├── menu_gesture.xml │ │ ├── menu_go_to_reval.xml │ │ ├── menu_intent_one.xml │ │ ├── menu_intent_two.xml │ │ ├── menu_lambda.xml │ │ ├── menu_main.xml │ │ ├── menu_main2.xml │ │ ├── menu_material.xml │ │ ├── menu_media.xml │ │ ├── menu_message.xml │ │ ├── menu_reval.xml │ │ ├── menu_sb_sample.xml │ │ ├── menu_scheme.xml │ │ ├── menu_scrolling.xml │ │ ├── menu_show_case.xml │ │ ├── menu_swipe_back.xml │ │ ├── menu_swipe_dismiss.xml │ │ ├── menu_text_input.xml │ │ ├── menu_toolbar.xml │ │ ├── menu_view_drager.xml │ │ ├── menu_wave.xml │ │ ├── menu_web_view.xml │ │ └── menu_welcome.xml │ │ ├── mipmap-hdpi │ │ ├── github_circle.png │ │ ├── ic_dashboard.png │ │ ├── ic_done.png │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ ├── github_circle.png │ │ ├── ic_dashboard.png │ │ ├── ic_done.png │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ ├── bg_share_duanxin_n.png │ │ ├── bg_share_duanxin_p.png │ │ ├── bg_share_pyq_n.png │ │ ├── bg_share_pyq_p.png │ │ ├── bg_share_qq_n.png │ │ ├── bg_share_qq_p.png │ │ ├── bg_share_qzone_n.png │ │ ├── bg_share_qzone_p.png │ │ ├── bg_share_weibo_n.png │ │ ├── bg_share_weibo_p.png │ │ ├── bg_share_weixin_n.png │ │ ├── bg_share_weixin_p.png │ │ ├── blue.png │ │ ├── btn_share.png │ │ ├── btn_share_close_press.png │ │ ├── btn_share_press.png │ │ ├── github_circle.png │ │ ├── ic_dashboard.png │ │ ├── ic_done.png │ │ ├── ic_launcher.png │ │ ├── luo.jpg │ │ ├── pic.png │ │ ├── red.png │ │ └── yellow.png │ │ ├── values-v21 │ │ ├── dimens.xml │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── attrs_bezier_view.xml │ │ ├── attrs_circle.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── pref_data_sync.xml │ │ ├── pref_general.xml │ │ ├── pref_headers.xml │ │ └── pref_notification.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib │ ├── .gitignore │ ├── build.gradle │ ├── lib.iml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── example │ │ ├── Formatnum.java │ │ ├── MyClass.java │ │ ├── Regex.java │ │ ├── StringBufferP.java │ │ ├── StringPar.java │ │ ├── Test.java │ │ ├── ThreadPoolPratice.java │ │ ├── concurrent │ │ ├── ConcurrentMain.java │ │ ├── WaitNotify.java │ │ ├── exector │ │ │ └── ExectorMain.java │ │ ├── synchronize │ │ │ ├── SyncClass.java │ │ │ ├── SyncObject.java │ │ │ ├── SyncPratice.java │ │ │ └── SyncThis.java │ │ └── threadrunnable │ │ │ ├── WorkerRunnable.java │ │ │ └── WorkerThread.java │ │ ├── designpattern │ │ └── Singleton.java │ │ ├── http │ │ └── HttpTest.java │ │ └── rx │ │ ├── ConvertListener.java │ │ ├── RxBase.java │ │ ├── RxMain.java │ │ ├── RxOperators.java │ │ ├── RxScheduler.java │ │ └── RxSubscription.java ├── proguard-com.digits.sdk.android.digits.txt ├── settings.gradle └── yutils │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ ├── src │ ├── androidTest │ │ └── java │ │ │ └── yifeiyuan │ │ │ └── practice │ │ │ └── yutils │ │ │ └── ApplicationTest.java │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── yifeiyuan │ │ │ └── practice │ │ │ └── yutils │ │ │ ├── AppUtils.java │ │ │ ├── BitmapUtils.java │ │ │ ├── DeviceUtils.java │ │ │ ├── HttpUtils.java │ │ │ ├── L.java │ │ │ ├── PixelUtils.java │ │ │ └── ViewUtils.java │ │ └── res │ │ └── values │ │ └── strings.xml │ └── yutils.iml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | /*/build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PracticeDemos/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | /fabric.properties 9 | .idea 10 | /.idea 11 | *.iml -------------------------------------------------------------------------------- /PracticeDemos/.idea/.name: -------------------------------------------------------------------------------- 1 | PracticeDemos -------------------------------------------------------------------------------- /PracticeDemos/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /PracticeDemos/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /PracticeDemos/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /PracticeDemos/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PracticeDemos/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /PracticeDemos/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PracticeDemos/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /fabric.properties -------------------------------------------------------------------------------- /PracticeDemos/app/keystore/debug.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/keystore/debug.jks -------------------------------------------------------------------------------- /PracticeDemos/app/libs/umeng-analytics-v5.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/libs/umeng-analytics-v5.6.1.jar -------------------------------------------------------------------------------- /PracticeDemos/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 /Users/alanchen/Library/Android/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 bookName to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | 20 | -dontwarn java.lang.invoke.* 21 | 22 | 23 | 24 | 25 | -dontwarn com.squareup.okhttp.** 26 | -dontwarn com.google.appengine.api.urlfetch.** 27 | -dontwarn rx.** 28 | -dontwarn retrofit.** 29 | -keepattributes Signature 30 | -keepattributes *Annotation* 31 | -keep class com.squareup.okhttp.** { *; } 32 | -keep interface com.squareup.okhttp.** { *; } 33 | -keep class retrofit.** { *; } 34 | -keepclasseswithmembers class * { 35 | @retrofit.http.* ; 36 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/androidTest/java/yifeiyuan/practice/practicedemos/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/aidl/yifeiyuan/practice/practicedemos/IBook.aidl: -------------------------------------------------------------------------------- 1 | // IBook.aidl 2 | package yifeiyuan.practice.practicedemos; 3 | 4 | // Declare any non-default types here with import statements 5 | 6 | interface IBook { 7 | /** 8 | * Demonstrates some basic types that you can use as parameters 9 | * and return values in AIDL. 10 | */ 11 | void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, 12 | double aDouble, String aString); 13 | } 14 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/App.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos; 2 | 3 | import android.app.Application; 4 | 5 | import com.twitter.sdk.android.core.TwitterAuthConfig; 6 | import com.twitter.sdk.android.core.TwitterCore; 7 | import com.twitter.sdk.android.tweetcomposer.TweetComposer; 8 | 9 | import io.fabric.sdk.android.Fabric; 10 | 11 | /** 12 | * Created by alanchen on 15/9/6. 13 | */ 14 | public class App extends Application { 15 | 16 | // Note: Your consumer key and secret should be obfuscated in your source code before shipping. 17 | private static final String TWITTER_KEY = "RJjbqTVS5kIseg9q4jsRecf7u"; 18 | private static final String TWITTER_SECRET = "dbBgVZYA4oBkmSr5jKaInMzijO2mt3uB82SHviTJ1tgK2Z5P8E"; 19 | 20 | @Override 21 | public void onCreate() { 22 | super.onCreate(); 23 | TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET); 24 | // Fabric.with(this, new TwitterCore(authConfig), new Digits()); 25 | Fabric.with(this, new TwitterCore(authConfig),new TweetComposer()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/Const.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos; 2 | 3 | /** 4 | * Created by alanchen on 15/7/29. 5 | */ 6 | public class Const { 7 | 8 | public static final String URL_GITHUB = "https://github.com/AlanCheen"; 9 | public static final String URL_JIANSHU = "http://www.jianshu.com/users/ec59bd61433a/latest_articles"; 10 | public static final String URL_SINA = "http://weibo.com/2559577095"; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/HeadView.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.FrameLayout; 6 | 7 | /** 8 | * Created by 程序亦非猿 on 15/12/1. 9 | * aaaaa 10 | */ 11 | public class HeadView extends FrameLayout { 12 | 13 | public static final String TAG = HeadView.class.getSimpleName(); 14 | 15 | public HeadView(Context context) { 16 | this(context, null); 17 | } 18 | 19 | public HeadView(Context context, AttributeSet attrs) { 20 | this(context, attrs, 0); 21 | } 22 | 23 | public HeadView(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | init(); 26 | } 27 | 28 | private void init() { 29 | 30 | } 31 | 32 | @Override 33 | protected void onFinishInflate() { 34 | super.onFinishInflate(); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/RVDemo.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos; 2 | 3 | import android.os.Bundle; 4 | import android.os.RemoteException; 5 | import android.support.design.widget.FloatingActionButton; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.support.v7.widget.Toolbar; 9 | 10 | import butterknife.ButterKnife; 11 | import butterknife.InjectView; 12 | 13 | public class RVDemo extends AppCompatActivity { 14 | 15 | @InjectView(R.id.toolbar) 16 | Toolbar mToolbar; 17 | @InjectView(R.id.rv_demo) 18 | RecyclerView mRvDemo; 19 | @InjectView(R.id.fab) 20 | FloatingActionButton mFab; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_rvdemo); 26 | ButterKnife.inject(this); 27 | String ss = ""; 28 | 29 | 30 | 31 | class XXX extends IBook.Stub{ 32 | 33 | @Override 34 | public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException { 35 | 36 | } 37 | } 38 | 39 | abstract class YYY implements IBook{ 40 | 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/base/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.base; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | import butterknife.ButterKnife; 8 | 9 | public abstract class BaseActivity extends AppCompatActivity { 10 | 11 | protected final String TAG = this.getClass().getSimpleName(); 12 | protected Context mContext; 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | mContext = this; 17 | setContentView(getLayoutId()); 18 | ButterKnife.inject(this); 19 | init(savedInstanceState); 20 | } 21 | 22 | 23 | protected abstract int getLayoutId(); 24 | protected abstract void init(Bundle savedInstanceState); 25 | } 26 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/base/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.base; 2 | 3 | 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.view.View; 7 | 8 | /** 9 | */ 10 | public abstract class BaseFragment extends Fragment { 11 | 12 | protected View mRootView; 13 | protected final String TAG = this.getClass().getSimpleName(); 14 | 15 | @Override 16 | public void onActivityCreated(Bundle savedInstanceState) { 17 | super.onActivityCreated(savedInstanceState); 18 | init(savedInstanceState); 19 | } 20 | protected abstract void init(Bundle savedInstanceState); 21 | } 22 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/base/Practice.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.base; 2 | 3 | import android.content.Intent; 4 | 5 | /** 6 | * Created by yifeiyuan on 15/6/22. 7 | */ 8 | public class Practice { 9 | 10 | public Practice(String title, Intent intent){ 11 | this.title = title; 12 | this.intent = intent; 13 | } 14 | public String title; 15 | public Intent intent; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/broadcast/AppReceiver.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.broadcast; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.util.Log; 7 | 8 | /** 9 | * Created by alanchen on 15/9/14. 10 | * 11 | * 监听别的应用的安装和卸载 12 | */ 13 | public class AppReceiver extends BroadcastReceiver{ 14 | 15 | public static final String TAG = "AppReceiver"; 16 | @Override 17 | public void onReceive(Context context, Intent intent) { 18 | String action = intent.getAction(); 19 | 20 | if (action.equals(Intent.ACTION_PACKAGE_ADDED)) { 21 | String packageName = intent.getData().getSchemeSpecificPart(); 22 | Log.d(TAG, "ACTION_PACKAGE_ADDED:" + packageName); 23 | } 24 | if (action.equals(Intent.ACTION_PACKAGE_REMOVED)) { 25 | String packageName = intent.getData().getSchemeSpecificPart(); 26 | Log.d(TAG,"ACTION_PACKAGE_REMOVED:"+packageName); 27 | } 28 | if (action.equals(Intent.ACTION_PACKAGE_REPLACED)) { 29 | String packageName = intent.getData().getSchemeSpecificPart(); 30 | Log.d(TAG,"ACTION_PACKAGE_REPLACED:"+packageName); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/CustomViewFragment.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | 10 | import yifeiyuan.practice.practicedemos.R; 11 | import yifeiyuan.practice.practicedemos.base.BaseFragment; 12 | 13 | /** 14 | * A simple {@link Fragment} subclass. 15 | * Use the {@link CustomViewFragment#newInstance} factory method to 16 | * create an instance of this fragment. 17 | */ 18 | public class CustomViewFragment extends BaseFragment { 19 | 20 | public CustomViewFragment() { 21 | // Required empty public constructor 22 | } 23 | 24 | public static CustomViewFragment newInstance() { 25 | CustomViewFragment fragment = new CustomViewFragment(); 26 | return fragment; 27 | } 28 | 29 | @Override 30 | public void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | } 33 | 34 | @Override 35 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 36 | Bundle savedInstanceState) { 37 | // Inflate the layout for this fragment 38 | return inflater.inflate(R.layout.fragment_custom_view, container, false); 39 | } 40 | 41 | @Override 42 | protected void init(Bundle savedInstanceState) { 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/CustomViewGroupFragment.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.Toast; 8 | 9 | import yifeiyuan.practice.practicedemos.R; 10 | import yifeiyuan.practice.practicedemos.base.BaseFragment; 11 | 12 | public class CustomViewGroupFragment extends BaseFragment { 13 | 14 | public CustomViewGroupFragment() { 15 | } 16 | 17 | public static CustomViewGroupFragment newInstance() { 18 | CustomViewGroupFragment fragment = new CustomViewGroupFragment(); 19 | return fragment; 20 | } 21 | 22 | @Override 23 | public void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | } 26 | 27 | @Override 28 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 29 | Bundle savedInstanceState) { 30 | // Inflate the layout for this fragment 31 | View view = inflater.inflate(R.layout.fragment_custom_view_group, container, false); 32 | view.findViewById(R.id.tv1).setOnClickListener(v-> Toast.makeText(getActivity(),"TV1111",Toast.LENGTH_SHORT).show()); 33 | view.findViewById(R.id.tv2).setOnClickListener(v-> Toast.makeText(getActivity(),"TV2222",Toast.LENGTH_SHORT).show()); 34 | view.findViewById(R.id.tv3).setOnClickListener(v-> Toast.makeText(getActivity(),"TV3333",Toast.LENGTH_SHORT).show()); 35 | return view; 36 | } 37 | 38 | @Override 39 | protected void init(Bundle savedInstanceState) { 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/HappyWorryView.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.util.AttributeSet; 6 | import android.widget.CheckBox; 7 | 8 | /** 9 | * Created by 程序亦非猿 on 15/11/18. 10 | */ 11 | public class HappyWorryView extends CheckBox { 12 | 13 | public static final String TAG = "HappyWorryView"; 14 | 15 | public HappyWorryView(Context context) { 16 | this(context, null); 17 | } 18 | 19 | public HappyWorryView(Context context, AttributeSet attrs) { 20 | this(context, attrs, 0); 21 | } 22 | 23 | public HappyWorryView(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | init(); 26 | } 27 | 28 | //自己的宽高 29 | private int mWidth; 30 | private int mHeight; 31 | 32 | private void init() { 33 | 34 | } 35 | 36 | @Override 37 | protected void onDraw(Canvas canvas) { 38 | super.onDraw(canvas); 39 | 40 | 41 | } 42 | 43 | @Override 44 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) { 45 | super.onLayout(changed, left, top, right, bottom); 46 | mWidth = getWidth(); 47 | mHeight = getHeight(); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/MyView.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by alanchen on 15/10/15. 9 | */ 10 | public class MyView extends View { 11 | 12 | public static final String TAG = MyView.class.getSimpleName(); 13 | 14 | public MyView(Context context) { 15 | this(context, null); 16 | } 17 | 18 | public MyView(Context context, AttributeSet attrs) { 19 | this(context, attrs, 0); 20 | } 21 | 22 | public MyView(Context context, AttributeSet attrs, int defStyleAttr) { 23 | super(context, attrs, defStyleAttr); 24 | init(); 25 | } 26 | 27 | private void init() { 28 | 29 | } 30 | 31 | @Override 32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 33 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 34 | } 35 | 36 | @Override 37 | protected void onFinishInflate() { 38 | super.onFinishInflate(); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/PathActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.FloatingActionButton; 5 | import android.support.design.widget.Snackbar; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.View; 9 | 10 | import yifeiyuan.practice.practicedemos.R; 11 | 12 | public class PathActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_path); 18 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 19 | setSupportActionBar(toolbar); 20 | 21 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 22 | fab.setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View view) { 25 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) 26 | .setAction("Action", null).show(); 27 | } 28 | }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/PathView.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.graphics.Path; 7 | import android.util.AttributeSet; 8 | import android.view.View; 9 | 10 | /** 11 | * Created by 程序亦非猿 on 15/11/19. 12 | * aaaaa 13 | */ 14 | public class PathView extends View { 15 | 16 | public static final String TAG = PathView.class.getSimpleName(); 17 | private Paint mPaint; 18 | 19 | public PathView(Context context) { 20 | this(context, null); 21 | } 22 | 23 | public PathView(Context context, AttributeSet attrs) { 24 | this(context, attrs, 0); 25 | } 26 | 27 | public PathView(Context context, AttributeSet attrs, int defStyleAttr) { 28 | super(context, attrs, defStyleAttr); 29 | init(); 30 | } 31 | 32 | private void init() { 33 | 34 | mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 35 | mPaint.setColor(0xff00ff); 36 | mPaint.setStrokeWidth(3); 37 | 38 | } 39 | 40 | @Override 41 | protected void onDraw(Canvas canvas) { 42 | super.onDraw(canvas); 43 | drawPath(canvas); 44 | } 45 | 46 | private void drawPath(Canvas canvas) { 47 | 48 | int width = getWidth(); 49 | int height = getHeight(); 50 | 51 | Path path = new Path(); 52 | 53 | path.moveTo(0, 0); 54 | path.lineTo(20, 20); 55 | path.lineTo(30, 30); 56 | path.rLineTo(50,50); 57 | path.quadTo(100,100,200,200); 58 | 59 | canvas.drawPath(path,mPaint); 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/customview/SwitchActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.customview; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.FloatingActionButton; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.support.v7.widget.Toolbar; 7 | import android.util.Log; 8 | import android.view.View; 9 | 10 | import butterknife.ButterKnife; 11 | import butterknife.InjectView; 12 | import yifeiyuan.practice.practicedemos.R; 13 | 14 | public class SwitchActivity extends AppCompatActivity { 15 | 16 | @InjectView(R.id.toolbar) 17 | Toolbar mToolbar; 18 | @InjectView(R.id.face_view) 19 | FaceView mFaceView; 20 | @InjectView(R.id.fab) 21 | FloatingActionButton mFab; 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_switch); 27 | ButterKnife.inject(this); 28 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 29 | setSupportActionBar(toolbar); 30 | 31 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 32 | fab.setOnClickListener(new View.OnClickListener() { 33 | @Override 34 | public void onClick(View view) { 35 | mFaceView.toogle(); 36 | // Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) 37 | // .setAction("Action", null).show(); 38 | } 39 | }); 40 | } 41 | 42 | @Override 43 | protected void onResume() { 44 | super.onResume(); 45 | Log.d("MainActivity", " SwitchActivity onResume: "); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/dp/Boss.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, 程序亦非猿 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package yifeiyuan.practice.practicedemos.dp; 18 | 19 | /** 20 | * Created by 程序亦非猿 on 16/1/18. 21 | */ 22 | public class Boss { 23 | 24 | Worker mWorker; 25 | 26 | public int plus(int a, int b) { 27 | return mWorker.plus(a, b); 28 | } 29 | 30 | public void plus(int a, int b, Callback callback) { 31 | 32 | new Thread(new Runnable() { 33 | @Override 34 | public void run() { 35 | if (null != callback) { 36 | callback.onFinished(mWorker.plus(a, b)); 37 | } 38 | } 39 | }).start(); 40 | 41 | } 42 | 43 | 44 | public interface Callback { 45 | void onFinished(int result); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/dp/Worker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, 程序亦非猿 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package yifeiyuan.practice.practicedemos.dp; 18 | 19 | /** 20 | * Created by 程序亦非猿 on 16/1/18. 21 | */ 22 | public class Worker { 23 | 24 | 25 | 26 | public int plus(int a, int b){ 27 | // int result; 28 | return a+b; 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/fir/Fir.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.fir; 2 | 3 | /** 4 | * Created by alanchen on 15/9/17. 5 | */ 6 | public class Fir { 7 | public static final String FID_API = "http://api.fir.im/apps/latest/"; 8 | public static final String APP_ID = "55b1b666692d39020f00003d"; 9 | public static final String FIR_URL = FID_API + APP_ID; 10 | } 11 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/intent/SchemeActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.intent; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.Menu; 6 | import android.view.MenuItem; 7 | 8 | import yifeiyuan.practice.practicedemos.R; 9 | 10 | public class SchemeActivity extends AppCompatActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_scheme); 16 | 17 | findViewById(R.id.id_tv_scheme).setOnClickListener(v->{ 18 | 19 | 20 | }); 21 | } 22 | 23 | @Override 24 | public boolean onCreateOptionsMenu(Menu menu) { 25 | // Inflate the menu; this adds items to the action bar if it is present. 26 | getMenuInflater().inflate(R.menu.menu_scheme, menu); 27 | return true; 28 | } 29 | 30 | @Override 31 | public boolean onOptionsItemSelected(MenuItem item) { 32 | // Handle action bar item clicks here. The action bar will 33 | // automatically handle clicks on the Home/Up button, so long 34 | // as you specify a parent activity in AndroidManifest.xml. 35 | int id = item.getItemId(); 36 | 37 | //noinspection SimplifiableIfStatement 38 | if (id == R.id.action_settings) { 39 | return true; 40 | } 41 | 42 | return super.onOptionsItemSelected(item); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/intent/SchemeHPActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.intent; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.Menu; 6 | import android.view.MenuItem; 7 | import android.widget.TextView; 8 | 9 | import butterknife.ButterKnife; 10 | import butterknife.InjectView; 11 | import yifeiyuan.practice.practicedemos.R; 12 | 13 | public class SchemeHPActivity extends AppCompatActivity { 14 | 15 | @InjectView(R.id.tv_show) 16 | TextView mTvShow; 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_intent_two); 22 | ButterKnife.inject(this); 23 | 24 | mTvShow.setText(getIntent().getStringExtra("data")); 25 | } 26 | 27 | @Override 28 | public boolean onCreateOptionsMenu(Menu menu) { 29 | // Inflate the menu; this adds items to the action bar if it is present. 30 | getMenuInflater().inflate(R.menu.menu_intent_two, menu); 31 | return true; 32 | } 33 | 34 | @Override 35 | public boolean onOptionsItemSelected(MenuItem item) { 36 | // Handle action bar item clicks here. The action bar will 37 | // automatically handle clicks on the Home/Up button, so long 38 | // as you specify a parent activity in AndroidManifest.xml. 39 | int id = item.getItemId(); 40 | 41 | //noinspection SimplifiableIfStatement 42 | if (id == R.id.action_settings) { 43 | return true; 44 | } 45 | 46 | return super.onOptionsItemSelected(item); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/ipc/Book.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.ipc; 2 | 3 | 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | 7 | /** 8 | * Created by 程序亦非猿 on 15/12/3. 9 | */ 10 | public class Book implements Parcelable{ 11 | 12 | 13 | public String bookName; 14 | public int bookId; 15 | 16 | protected Book(Parcel in) { 17 | bookId = in.readInt(); 18 | bookName = in.readString(); 19 | } 20 | 21 | public static final Creator CREATOR = new Creator() { 22 | @Override 23 | public Book createFromParcel(Parcel in) { 24 | return new Book(in); 25 | } 26 | 27 | @Override 28 | public Book[] newArray(int size) { 29 | return new Book[size]; 30 | } 31 | }; 32 | 33 | @Override 34 | public int describeContents() { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public void writeToParcel(Parcel dest, int flags) { 40 | dest.writeInt(bookId); 41 | dest.writeString(bookName); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/ipc/IUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, 程序亦非猿 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package yifeiyuan.practice.practicedemos.ipc; 18 | 19 | import android.os.Binder; 20 | import android.os.IBinder; 21 | import android.os.IInterface; 22 | 23 | /** 24 | * Created by 程序亦非猿 on 16/1/15. 25 | */ 26 | public interface IUser extends IInterface{ 27 | 28 | public static abstract class Stub extends Binder implements IUser{ 29 | 30 | public Stub() { 31 | } 32 | 33 | @Override 34 | public IBinder asBinder() { 35 | return this; 36 | } 37 | 38 | } 39 | 40 | int plus(int a, int b); 41 | } 42 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/ipc/User.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.ipc; 2 | 3 | 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | 7 | /** 8 | * Created by 程序亦非猿 on 15/12/3. 9 | */ 10 | public class User implements Parcelable { 11 | private String userName; 12 | private int classId; 13 | private Book mBook; 14 | 15 | protected User(Parcel in) { 16 | userName = in.readString(); 17 | classId = in.readInt(); 18 | mBook = in.readParcelable(Book.class.getClassLoader()); 19 | } 20 | 21 | public static final Creator CREATOR = new Creator() { 22 | @Override 23 | public User createFromParcel(Parcel in) { 24 | return new User(in); 25 | } 26 | 27 | @Override 28 | public User[] newArray(int size) { 29 | return new User[size]; 30 | } 31 | }; 32 | 33 | @Override 34 | public int describeContents() { 35 | return 0; 36 | } 37 | 38 | @Override 39 | public void writeToParcel(Parcel dest, int flags) { 40 | dest.writeString(userName); 41 | dest.writeInt(classId); 42 | dest.writeParcelable(mBook, flags); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/itemtouchhelper/SimpleSwipeDismissCallback.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.itemtouchhelper; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.support.v7.widget.helper.ItemTouchHelper; 5 | 6 | /** 7 | * Created by alanchen on 15/8/20. 8 | * 9 | * //todo 10 | * 11 | */ 12 | public class SimpleSwipeDismissCallback extends ItemTouchHelper.SimpleCallback{ 13 | 14 | 15 | public SimpleSwipeDismissCallback(){ 16 | this(0,1); 17 | } 18 | 19 | public SimpleSwipeDismissCallback(int dragDirs, int swipeDirs) { 20 | super(dragDirs, swipeDirs); 21 | } 22 | 23 | @Override 24 | public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { 25 | return false; 26 | } 27 | 28 | @Override 29 | public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/itemtouchhelper/TouchHelperActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.itemtouchhelper; 2 | 3 | import android.os.Bundle; 4 | import android.view.Menu; 5 | import android.view.MenuItem; 6 | 7 | import yifeiyuan.practice.practicedemos.R; 8 | import yifeiyuan.practice.practicedemos.base.ToolbarActivity; 9 | 10 | 11 | /** 12 | * 13 | * todo 排序 拖动 14 | * 15 | */ 16 | public class TouchHelperActivity extends ToolbarActivity { 17 | 18 | SimpleSwipedismissFragment simpleSwipedismissFragment; 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | setContentView(R.layout.activity_swipe_dismiss); 23 | simpleSwipedismissFragment = new SimpleSwipedismissFragment(); 24 | 25 | getSupportFragmentManager().beginTransaction().add(R.id.container,simpleSwipedismissFragment).commit(); 26 | } 27 | 28 | @Override 29 | public boolean onCreateOptionsMenu(Menu menu) { 30 | getMenuInflater().inflate(R.menu.menu_swipe_dismiss, menu); 31 | return true; 32 | } 33 | 34 | @Override 35 | public boolean onOptionsItemSelected(MenuItem item) { 36 | 37 | //todo 38 | int id = item.getItemId(); 39 | if (id == R.id.action_settings) { 40 | return true; 41 | } 42 | return super.onOptionsItemSelected(item); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/jni/HelloJni.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.jni; 2 | 3 | /** 4 | * Created by alanchen on 15/9/2. 5 | */ 6 | public class HelloJni { 7 | 8 | static { 9 | System.loadLibrary("Practice"); 10 | } 11 | 12 | public static native String helloJni(); 13 | } 14 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/materialsupport/TextInputActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.materialsupport; 2 | 3 | import android.os.Bundle; 4 | import android.view.Menu; 5 | import android.view.MenuItem; 6 | 7 | import yifeiyuan.practice.practicedemos.R; 8 | import yifeiyuan.practice.practicedemos.base.ToolbarActivity; 9 | 10 | public class TextInputActivity extends ToolbarActivity { 11 | 12 | 13 | //java.lang.IllegalArgumentException: We already have an EditText, can only have one 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_text_input); 18 | 19 | new Thread(()-> System.out.printf("")).start(); 20 | 21 | } 22 | 23 | @Override 24 | public boolean onCreateOptionsMenu(Menu menu) { 25 | // Inflate the menu; this adds items to the action bar if it is present. 26 | getMenuInflater().inflate(R.menu.menu_text_input, menu); 27 | return true; 28 | } 29 | 30 | @Override 31 | public boolean onOptionsItemSelected(MenuItem item) { 32 | // Handle action bar item clicks here. The action bar will 33 | // automatically handle clicks on the Home/Up button, so long 34 | // as you specify a parent activity in AndroidManifest.xml. 35 | int id = item.getItemId(); 36 | 37 | //noinspection SimplifiableIfStatement 38 | if (id == R.id.action_settings) { 39 | return true; 40 | } 41 | 42 | return super.onOptionsItemSelected(item); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/periscope/BezierActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.periscope; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.widget.Button; 6 | 7 | import butterknife.InjectView; 8 | import yifeiyuan.practice.practicedemos.R; 9 | import yifeiyuan.practice.practicedemos.base.ToolbarActivity; 10 | 11 | public class BezierActivity extends ToolbarActivity { 12 | 13 | @InjectView(R.id.btn_start_anim) 14 | Button mBtnStartAnim; 15 | @InjectView(R.id.zan) 16 | FavorLayout mFavorLayout; 17 | 18 | @Override 19 | public void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_periscope); 22 | mBtnStartAnim.setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View v) { 25 | 26 | mFavorLayout.addFavor(); 27 | } 28 | }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/periscope/BezierEvaluator.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.periscope; 2 | 3 | import android.animation.TypeEvaluator; 4 | import android.graphics.PointF; 5 | 6 | /** 7 | * Created by yifeiyuan on 15/6/18. 8 | */ 9 | public class BezierEvaluator implements TypeEvaluator { 10 | 11 | 12 | private PointF pointF1; 13 | private PointF pointF2; 14 | public BezierEvaluator(PointF pointF1,PointF pointF2){ 15 | this.pointF1 = pointF1; 16 | this.pointF2 = pointF2; 17 | } 18 | @Override 19 | public PointF evaluate(float time, PointF startValue, 20 | PointF endValue) { 21 | 22 | float timeLeft = 1.0f - time; 23 | PointF point = new PointF();//结果 24 | 25 | point.x = timeLeft * timeLeft * timeLeft * (startValue.x) 26 | + 3 * timeLeft * timeLeft * time * (pointF1.x) 27 | + 3 * timeLeft * time * time * (pointF2.x) 28 | + time * time * time * (endValue.x); 29 | 30 | point.y = timeLeft * timeLeft * timeLeft * (startValue.y) 31 | + 3 * timeLeft * timeLeft * time * (pointF1.y) 32 | + 3 * timeLeft * time * time * (pointF2.y) 33 | + time * time * time * (endValue.y); 34 | return point; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/recyclerview/HorizontalRvActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.recyclerview; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.FloatingActionButton; 5 | import android.support.design.widget.Snackbar; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | 9 | import butterknife.ButterKnife; 10 | import butterknife.InjectView; 11 | import yifeiyuan.practice.practicedemos.R; 12 | 13 | public class HorizontalRvActivity extends AppCompatActivity { 14 | 15 | @InjectView(R.id.toolbar) 16 | Toolbar mToolbar; 17 | @InjectView(R.id.fab) 18 | FloatingActionButton mFab; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_horizontal_rv); 24 | ButterKnife.inject(this); 25 | mToolbar = (Toolbar) findViewById(R.id.toolbar); 26 | setSupportActionBar(mToolbar); 27 | 28 | mFab = (FloatingActionButton) findViewById(R.id.fab); 29 | mFab.setOnClickListener(view -> Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) 30 | .setAction("Action", null).show()); 31 | 32 | getSupportFragmentManager().beginTransaction().add(R.id.fl_container, new HoriListFragment(), "Horizen").commit(); 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/recyclerview/LM.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, 程序亦非猿 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package yifeiyuan.practice.practicedemos.recyclerview; 18 | 19 | import android.support.v7.widget.RecyclerView; 20 | 21 | /** 22 | * Created by 程序亦非猿 on 16/1/18. 23 | */ 24 | public class LM extends RecyclerView.LayoutManager{ 25 | @Override 26 | public RecyclerView.LayoutParams generateDefaultLayoutParams() { 27 | return null; 28 | } 29 | 30 | @Override 31 | public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { 32 | super.onLayoutChildren(recycler, state); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/touch/SimpleView.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.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 | /** 10 | * Created by 程序亦非猿 on 15/10/29. 11 | * aaaaa 12 | */ 13 | public class SimpleView extends View { 14 | 15 | public static final String TAG = SimpleView.class.getSimpleName(); 16 | 17 | public SimpleView(Context context) { 18 | this(context, null); 19 | } 20 | 21 | public SimpleView(Context context, AttributeSet attrs) { 22 | this(context, attrs, 0); 23 | } 24 | 25 | public SimpleView(Context context, AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | init(); 28 | } 29 | 30 | @Override 31 | public boolean dispatchTouchEvent(MotionEvent ev) { 32 | // Log.d(TouchActivity.TAG, "SimpleView dispatchTouchEvent() "+super.dispatchTouchEvent(ev)+" called with: " + "ev = [" + TouchUtil.getAction(ev) + "]"); 33 | Log.d(TouchActivity.TAG, "SimpleView dispatchTouchEvent() false called with: " + "ev = [" + TouchUtil.getAction(ev) + "]"); 34 | return super.dispatchTouchEvent(ev); 35 | } 36 | 37 | @Override 38 | public boolean onTouchEvent(MotionEvent event) { 39 | Log.d(TouchActivity.TAG, "SimpleView onTouchEvent() false called with: " + "ev = [" + TouchUtil.getAction(event) + "]"); 40 | return super.onTouchEvent(event); 41 | } 42 | 43 | private void init() { 44 | 45 | } 46 | 47 | @Override 48 | protected void onFinishInflate() { 49 | super.onFinishInflate(); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/touch/TouchUtil.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.touch; 2 | 3 | import android.view.MotionEvent; 4 | 5 | /** 6 | * Created by 程序亦非猿 on 15/10/29. 7 | */ 8 | public class TouchUtil { 9 | 10 | public static String getAction(MotionEvent ev) { 11 | int action = ev.getAction(); 12 | String result = "action_unknow"; 13 | switch (action) { 14 | case MotionEvent.ACTION_DOWN: 15 | result = " action_down"; 16 | break; 17 | 18 | case MotionEvent.ACTION_UP: 19 | result = " action_up"; 20 | break; 21 | case MotionEvent.ACTION_CANCEL: 22 | result = " action_cancel"; 23 | break; 24 | case MotionEvent.ACTION_MOVE: 25 | result = " action_move"; 26 | break; 27 | } 28 | return result; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/ui/ScrollingActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.ui; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.FloatingActionButton; 5 | import android.support.design.widget.Snackbar; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.View; 9 | 10 | import yifeiyuan.practice.practicedemos.R; 11 | 12 | public class ScrollingActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_scrolling); 18 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 19 | setSupportActionBar(toolbar); 20 | 21 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 22 | fab.setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View view) { 25 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) 26 | .setAction("Action", null).show(); 27 | } 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/viewdrager/ViewDragerActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.viewdrager; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.AppBarLayout; 5 | import android.support.v7.widget.Toolbar; 6 | import android.widget.TextView; 7 | import android.widget.Toast; 8 | 9 | import butterknife.InjectView; 10 | import butterknife.OnClick; 11 | import yifeiyuan.practice.practicedemos.R; 12 | import yifeiyuan.practice.practicedemos.base.ToolbarActivity; 13 | 14 | public class ViewDragerActivity extends ToolbarActivity { 15 | 16 | @InjectView(R.id.tv_one) 17 | TextView mTvOne; 18 | @InjectView(R.id.tv_two) 19 | TextView mTvTwo; 20 | @InjectView(R.id.tv_three) 21 | TextView mTvThree; 22 | @InjectView(R.id.drager) 23 | DragerView mDrager; 24 | @InjectView(R.id.tv_four) 25 | TextView mTvFour; 26 | @InjectView(R.id.tv_five) 27 | TextView mTvFive; 28 | @InjectView(R.id.toolbar) 29 | Toolbar mToolbar; 30 | @InjectView(R.id.appbar) 31 | AppBarLayout mAppbar; 32 | 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.activity_view_drager); 37 | } 38 | 39 | @OnClick((R.id.tv_five)) 40 | public void five() { 41 | Toast.makeText(mContext, "onclick", Toast.LENGTH_SHORT).show(); 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/wave/HeartView.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.wave; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.Path; 8 | import android.util.AttributeSet; 9 | import android.view.View; 10 | 11 | /** 12 | * Created by alanchen on 15/7/5. 13 | */ 14 | public class HeartView extends View{ 15 | public HeartView(Context context) { 16 | super(context); 17 | } 18 | 19 | public HeartView(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | init(); 22 | } 23 | 24 | private void init() { 25 | mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 26 | mPaint.setColor(Color.parseColor("#ff0000")); 27 | mPaint.setStyle(Paint.Style.STROKE); 28 | 29 | } 30 | 31 | private Paint mPaint; 32 | 33 | @Override 34 | protected void onDraw(Canvas canvas) { 35 | super.onDraw(canvas); 36 | canvas.drawPath(p, mPaint); 37 | } 38 | 39 | 40 | private int w; 41 | private int h; 42 | Path p; 43 | @Override 44 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) { 45 | super.onLayout(changed, left, top, right, bottom); 46 | w = getWidth(); 47 | h = getHeight(); 48 | p = new Path(); 49 | p.moveTo(w / 2, 4 * h / 7); 50 | p.quadTo(2*w, 0, w / 2, h/1.5f); 51 | p.quadTo(-w, 0, w / 2, 4*h / 7); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/java/yifeiyuan/practice/practicedemos/wave/WaveActivity.java: -------------------------------------------------------------------------------- 1 | package yifeiyuan.practice.practicedemos.wave; 2 | 3 | import android.os.Bundle; 4 | import android.widget.Button; 5 | 6 | import butterknife.ButterKnife; 7 | import butterknife.InjectView; 8 | import butterknife.OnClick; 9 | import yifeiyuan.practice.practicedemos.R; 10 | import yifeiyuan.practice.practicedemos.base.BaseActivity; 11 | 12 | public class WaveActivity extends BaseActivity { 13 | 14 | 15 | @InjectView(R.id.btn_wave) 16 | Button mBtnWave; 17 | @InjectView(R.id.wave_view) 18 | WaveView mWaveView; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_wave); 24 | ButterKnife.inject(this); 25 | 26 | } 27 | 28 | @Override 29 | protected int getLayoutId() { 30 | return R.layout.activity_wave; 31 | } 32 | 33 | @Override 34 | protected void init(Bundle savedInstanceState) { 35 | 36 | } 37 | 38 | @OnClick(R.id.btn_wave) 39 | public void onClick(){ 40 | mWaveView.startWave(10000); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/jni/yifeiyuan_practice_practicedemos_jni_HelloJni.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by alanchen on 15/9/2. 3 | // 4 | 5 | #include "yifeiyuan_practice_practicedemos_jni_HelloJni.h" 6 | JNIEXPORT jstring JNICALL Java_yifeiyuan_practice_practicedemos_jni_HelloJni_helloJni 7 | (JNIEnv* env, jclass){ 8 | 9 | jstring str = env->NewStringUTF("Hello World ! I am from Jni,Where do you come from?"); 10 | return str; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/jni/yifeiyuan_practice_practicedemos_jni_HelloJni.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class yifeiyuan_practice_practicedemos_jni_HelloJni */ 4 | 5 | #ifndef _Included_yifeiyuan_practice_practicedemos_jni_HelloJni 6 | #define _Included_yifeiyuan_practice_practicedemos_jni_HelloJni 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: yifeiyuan_practice_practicedemos_jni_HelloJni 12 | * Method: helloJni 13 | * Signature: ()Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_yifeiyuan_practice_practicedemos_jni_HelloJni_helloJni 16 | (JNIEnv *, jclass); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/anim/no_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/anim/out_to_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-v21/ic_info_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-v21/ic_sync_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_duanxin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_open.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_pyq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_qq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_qzone.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_weibo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/drawable/bg_share_weixin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout-land/activity_config.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout-port/activity_config.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_affinity_activity_c.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_affinity_activity_d.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_config.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_custom_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_device_info_activty.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_facebook.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /PracticeDemos/app/src/main/res/layout/activity_fast_blur.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 |