├── .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 |
5 |
6 |
7 |
8 |
9 |
10 |
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 |
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_floating_window.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_gesture.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_glsurface.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_horizontal_rv.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_intent_two.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_lambda.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_launchmode.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_main2.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_media.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_periscope.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
16 |
17 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_reval.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
17 |
18 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_rvdemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_sb_sample.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_scheme.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
23 |
24 |
25 |
26 |
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_show_case.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_swipe_back.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_swipe_dismiss.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_text_input.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
16 |
17 |
21 |
22 |
23 |
28 |
29 |
33 |
34 |
35 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
23 |
24 |
25 |
26 |
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_twitter.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_view_pager.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_wave.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
13 |
18 |
19 |
20 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_web_view.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/activity_welcome.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
29 |
30 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/appbar_cons_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_affinity_activity_c.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_affinity_activity_d.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
24 |
25 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_clip.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_facebook.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_floating_window.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_glsurface.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_horizontal_rv.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_launchmode.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_rvdemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_scrolling.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
30 |
31 |
39 |
40 |
48 |
49 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
22 |
23 |
29 |
30 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/content_twitter.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
29 |
30 |
35 |
36 |
43 |
44 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/fragment_custom_view.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/fragment_grid.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/fragment_list.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/fragment_media.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/fragment_single_rv.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/item_img.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
15 |
16 |
17 |
18 |
28 |
29 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/material_grid_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/material_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/mooc_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/nav_header_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
18 |
19 |
28 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/sample_bezier_view.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/simple_rv.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/teststtt.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_config.xml:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_customview.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_device_info_activty.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_gauss_blur.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_gesture.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_go_to_reval.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_intent_one.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_intent_two.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_lambda.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
49 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_main2.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_material.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_media.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_message.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_reval.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_sb_sample.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_scheme.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_scrolling.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_show_case.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_swipe_back.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_swipe_dismiss.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_text_input.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_toolbar.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_view_drager.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_wave.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_web_view.xml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/menu/menu_welcome.xml:
--------------------------------------------------------------------------------
1 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-hdpi/github_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-hdpi/github_circle.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-hdpi/ic_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-hdpi/ic_dashboard.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-hdpi/ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-hdpi/ic_done.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xhdpi/github_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xhdpi/github_circle.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xhdpi/ic_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xhdpi/ic_dashboard.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xhdpi/ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xhdpi/ic_done.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_duanxin_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_duanxin_n.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_duanxin_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_duanxin_p.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_pyq_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_pyq_n.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_pyq_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_pyq_p.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qq_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qq_n.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qq_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qq_p.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qzone_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qzone_n.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qzone_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_qzone_p.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weibo_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weibo_n.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weibo_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weibo_p.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weixin_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weixin_n.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weixin_p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/bg_share_weixin_p.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/blue.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/btn_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/btn_share.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/btn_share_close_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/btn_share_close_press.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/btn_share_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/btn_share_press.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/github_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/github_circle.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/ic_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/ic_dashboard.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/ic_done.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/luo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/luo.jpg
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/pic.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/red.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/mipmap-xxhdpi/yellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/app/src/main/res/mipmap-xxhdpi/yellow.png
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values-v21/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 16dp
11 | 16dp
12 |
13 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values/attrs_bezier_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values/attrs_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #3346ff4d
6 |
7 |
8 | #673AB7
9 | #512DA8
10 | #D1C4E9
11 | #536DFE
12 | #212121
13 | #727272
14 | #FFFFFF
15 | #B6B6B6
16 |
17 |
18 | #ffffff
19 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
7 |
8 | 0.1dp
9 | 0.1dp
10 | 180dp
11 | 16dp
12 | 16dp
13 |
14 |
15 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
18 |
19 |
20 |
21 |
25 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/xml/pref_data_sync.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
14 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/xml/pref_general.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
20 |
21 |
23 |
24 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/xml/pref_headers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/PracticeDemos/app/src/main/res/xml/pref_notification.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
10 |
11 |
12 |
13 |
19 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/PracticeDemos/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | mavenCentral()
7 |
8 | maven { url "https://jitpack.io" }
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:1.2.3'
12 | classpath 'me.tatarka:gradle-retrolambda:3.2.2'
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | jcenter()
22 | mavenCentral()
23 | maven { url "https://jitpack.io" }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PracticeDemos/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/PracticeDemos/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlanCheen/PracticeDemo/797b54a5b9b581c27201f68ae72573daf59b3935/PracticeDemos/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/PracticeDemos/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Jun 22 22:06:10 CST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 |
3 | //java {
4 | //
5 | // compileOptions {
6 | // sourceCompatibility JavaVersion.VERSION_1_8
7 | // targetCompatibility JavaVersion.VERSION_1_8
8 | // }
9 | //}
10 | dependencies {
11 | compile fileTree(dir: 'libs', include: ['*.jar'])
12 | // compile 'io.reactivex:rxjava:1.0.12'
13 | compile 'io.reactivex:rxjava:1.0.13'
14 | }
15 |
16 | //compileOptions {
17 | // sourceCompatibility JavaVersion.VERSION_1_8
18 | // targetCompatibility JavaVersion.VERSION_1_8
19 | //}
20 | //
21 | //apply plugin: 'me.tatarka.retrolambda'
22 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/Formatnum.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 |
4 | /**
5 | * Created by 程序亦非猿 on 15/11/10.
6 | * aaaaa
7 | */
8 | public class Formatnum {
9 |
10 | public static void main(String[]args){
11 |
12 |
13 | System.out.println(getString(120102102030L));
14 | }
15 |
16 | public static final String getString(long num) {
17 |
18 | String result = "";
19 |
20 | if (num >= 1000000000) {
21 | result = String.format("%.2f",num*1.00f/1000000000);
22 | };
23 |
24 | return result;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/MyClass.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | public class MyClass {
4 |
5 | public static void main(String[] args) {
6 | double a = 1;
7 | double b = Math.PI;
8 | double result = a / b;
9 | // System.out.println(":"+result);
10 | // System.out.println(calNum(123131));
11 | // System.out.println(calNum(234234));
12 | // System.out.println(calNum(4234));
13 | // System.out.println(calNum(555));
14 | // System.out.println("" + System.currentTimeMillis());
15 |
16 | // new Thread(()-> System.out.printf("")).start();
17 | // for (int i = 0; i < 50; i++) {
18 | // new Thread(new Runnable() {
19 | // @Override
20 | // public void run() {
21 | // HttpTest.hehe();
22 | // }
23 | // }).start();
24 | // }
25 |
26 |
27 | String baseUrk = "https://api.twitter.com/1.1/users/show.json?screen_name=%1$s&user_id=%2$s";
28 | String result111 = String.format(baseUrk, "aaa", "2323");
29 |
30 | System.out.println(result111);
31 | }
32 |
33 |
34 | private static String calNum(int mTotalZan) {
35 | String content = "";
36 | if (mTotalZan > 9999) {
37 | int a = mTotalZan / 10000;//10 11
38 | int b = mTotalZan / 1000 - a * 10;
39 | content = a + "." + b + "W";
40 | } else if (mTotalZan > 999) {
41 | int a = mTotalZan / 1000;//10 11
42 | int b = mTotalZan / 100 - a * 10;
43 | content = a + "." + b + "K";
44 | }
45 | return content;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/Regex.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 |
4 | import java.util.regex.Matcher;
5 | import java.util.regex.Pattern;
6 |
7 | /**
8 | * Created by 程序亦非猿 on 15/10/30.
9 | * aaaaa
10 | */
11 | public class Regex {
12 |
13 | public static void main(String[]args) {
14 |
15 | String text = "爱的f 123130.33CNY";//16
16 |
17 | // Pattern pattern = Pattern.compile("\\d[A-Za-z]");//一个数字一个字母
18 |
19 | Pattern pattern = Pattern.compile("\\d");
20 | Matcher matcher = pattern.matcher(text);
21 | matcher.regionEnd();//16
22 | while (matcher.find()) {
23 | System.out.println(""+matcher.end());
24 | }
25 | // System.out.println(""+matcher.end());
26 | // matcher.regionEnd();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/StringBufferP.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | /**
4 | * Created by 程序亦非猿 on 15/10/23.
5 | */
6 | public class StringBufferP {
7 |
8 | public static void main(String[] args) {
9 | String a = "String";
10 | StringBuffer b = new StringBuffer("StringBuffer");
11 |
12 | methodA(a);
13 | methodB(b);
14 |
15 | System.out.println(a);
16 | System.out.println(b);
17 | }
18 |
19 | public static void methodA(String c){
20 | c = new String("newString");
21 | System.out.println(c);
22 | }
23 | public static void methodB(StringBuffer c){
24 | c = new StringBuffer("newStringBuffer");
25 | System.out.println(c);
26 | }
27 |
28 | /**
29 | 输出:why?
30 | newString
31 | newStringBuffer
32 | String
33 | StringBuffer
34 | */
35 | }
36 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/StringPar.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import java.util.regex.Matcher;
4 | import java.util.regex.Pattern;
5 |
6 | /**
7 | * Created by alanchen on 15/9/9.
8 | */
9 | public class StringPar {
10 |
11 |
12 | public static void main(String[] args) {
13 |
14 |
15 | // String content = "aole734c433198fd6b30://sourceapp=TaoLe.DouDiZhu&sourceappname=碰碰车&sourcescheme=taoledoudizhu&pic=http://s.5dktv.com/public/image/ddz_logo.png";
16 | String content = "aole734c433198fd6b30://sourceapp=TaoLe.DouDiZhu&sourceappname=碰碰车&sourcescheme=taoledoudizhu&pic=http://s.5dktv.com/public/image/ddz_logo.png";
17 |
18 | String regex = "=[*]+^&";
19 | // String regex = "(?<=\\=(.+?)(?=\\&)";
20 | // String regex = "=[*]+&";
21 | // String regex = "app";
22 | Pattern p = Pattern.compile(regex);
23 | Matcher matcher = p.matcher(content);
24 | boolean ma = matcher.matches();
25 | String[] results = p.split(content);
26 | for (String result : results) {
27 | System.out.println(result);
28 | }
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/Test.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 |
4 | import java.text.ParseException;
5 | import java.text.SimpleDateFormat;
6 | import java.util.Calendar;
7 | import java.util.Date;
8 |
9 | /**
10 | * Created by 程序亦非猿 on 15/11/24.
11 | * aaaaa
12 | */
13 | public class Test {
14 |
15 | public static void main(String[]args) {
16 |
17 | String time = "2015-03-18T01:29:48.821Z";
18 | Calendar calendar = Calendar.getInstance();
19 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
20 | try {
21 | Date date = format.parse(time);
22 | calendar.setTime(date);
23 | int year = calendar.get(Calendar.YEAR);
24 | int month = calendar.get(Calendar.MONTH)+1;
25 | int day = calendar.get(Calendar.DAY_OF_MONTH);
26 | System.out.println("year:" + year + "\r\n month: " + month + "\r\nday:" + day);
27 | } catch (ParseException e) {
28 | e.printStackTrace();
29 | }
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/ThreadPoolPratice.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import java.util.concurrent.BlockingDeque;
4 | import java.util.concurrent.LinkedBlockingDeque;
5 | import java.util.concurrent.ThreadFactory;
6 | import java.util.concurrent.ThreadPoolExecutor;
7 | import java.util.concurrent.TimeUnit;
8 |
9 | /**
10 | * Created by alanchen on 15/8/20.
11 | */
12 | public class ThreadPoolPratice {
13 |
14 | static BlockingDeque working = new LinkedBlockingDeque<>(1);
15 | static ThreadFactory factory = new ThreadFactory() {
16 | @Override
17 | public Thread newThread(Runnable r) {
18 |
19 | return new Thread(r, "factory:" + System.currentTimeMillis());
20 | }
21 | };
22 |
23 | // RejectedExecutionHandler rejectedExecutionHandler = new RejectedExecutionHandler() {
24 | // @Override
25 | // public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
26 | // executor.
27 | // }
28 | // };
29 | static ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 10, 10, TimeUnit.SECONDS, working, factory);
30 |
31 |
32 | public static void main(String[] args) {
33 |
34 |
35 | for (int i = 0; i < 50; i++) {
36 | executor.submit(new Runnable() {
37 | @Override
38 | public void run() {
39 | System.out.println("name:"+Thread.currentThread().getName());
40 | }
41 | });
42 | }
43 |
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/concurrent/ConcurrentMain.java:
--------------------------------------------------------------------------------
1 | package com.example.concurrent;
2 |
3 | /**
4 | * Created by 程序亦非猿 on 15/10/20.
5 | */
6 | public class ConcurrentMain {
7 | }
8 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/concurrent/synchronize/SyncPratice.java:
--------------------------------------------------------------------------------
1 | package com.example.concurrent.synchronize;
2 |
3 | /**
4 | * Created by alanchen on 15/9/23.
5 | *
6 | */
7 | public class SyncPratice {
8 |
9 | public static void main(String[]args){
10 |
11 | // SyncClass.test();
12 | // SyncObject.test();
13 |
14 |
15 | new SyncThis().test();
16 |
17 | }
18 |
19 |
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/concurrent/synchronize/SyncThis.java:
--------------------------------------------------------------------------------
1 | package com.example.concurrent.synchronize;
2 |
3 | /**
4 | * Created by alanchen on 15/9/23.
5 | *
6 | * 练习 synchronized (String.class){}这种写法
7 | */
8 | public class SyncThis {
9 |
10 | void prtb() throws InterruptedException {
11 | synchronized (this){
12 | System.out.println("SyncThis:这个是B");
13 | Thread.sleep(2000);
14 | }
15 | }
16 | void prta() throws InterruptedException {
17 | synchronized (this) {
18 | System.out.println("SyncThis:这个是A");
19 | Thread.sleep(2000);
20 | }
21 | }
22 |
23 | void prtc() {
24 | System.out.println("SyncThis:这个是C");
25 | }
26 |
27 | /**
28 | * 结果:
29 | * SyncClass:这个是A
30 | SyncClass:这个是C
31 | 过两秒后
32 | SyncClass:这个是B
33 | */
34 | public void test() {
35 | new Thread(new Runnable() {
36 | @Override
37 | public void run() {
38 | try {
39 | prta();
40 | } catch (InterruptedException e) {
41 | e.printStackTrace();
42 | }
43 | }
44 | }).start();
45 | new Thread(new Runnable() {
46 | @Override
47 | public void run() {
48 | try {
49 | prtb();
50 | } catch (InterruptedException e) {
51 | e.printStackTrace();
52 | }
53 | }
54 | }).start();
55 |
56 | new Thread(new Runnable() {
57 | @Override
58 | public void run() {
59 | prtc();
60 | }
61 | }).start();
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/concurrent/threadrunnable/WorkerRunnable.java:
--------------------------------------------------------------------------------
1 | package com.example.concurrent.threadrunnable;
2 |
3 | /**
4 | * Created by 程序亦非猿 on 15/10/20.
5 | */
6 | public class WorkerRunnable implements Runnable{
7 | @Override
8 | public void run() {
9 |
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/concurrent/threadrunnable/WorkerThread.java:
--------------------------------------------------------------------------------
1 | package com.example.concurrent.threadrunnable;
2 |
3 | /**
4 | * Created by 程序亦非猿 on 15/10/20.
5 | */
6 | public class WorkerThread extends Thread{
7 |
8 | @Override
9 | public void run() {
10 | super.run();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/designpattern/Singleton.java:
--------------------------------------------------------------------------------
1 | package com.example.designpattern;
2 |
3 | /**
4 | * Created by alanchen on 15/9/10.
5 | */
6 | public class Singleton {
7 |
8 | private static Singleton ins;
9 | public static synchronized Singleton getIns() {
10 | if (null == ins) {
11 | ins = new Singleton();
12 | }
13 | return ins;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/http/HttpTest.java:
--------------------------------------------------------------------------------
1 | package com.example.http;
2 |
3 | import java.io.IOException;
4 | import java.net.HttpURLConnection;
5 | import java.net.MalformedURLException;
6 | import java.net.URL;
7 | import java.net.URLConnection;
8 |
9 | /**
10 | * Created by alanchen on 15/8/24.
11 | */
12 | public class HttpTest {
13 |
14 |
15 | public static void hehe() {
16 | String u = "http://www.jianshu.com/p/36e089be8f38";
17 | try {
18 | URL url = new URL(u);
19 | URLConnection conn = url.openConnection();
20 | HttpURLConnection httpURLConnection = (HttpURLConnection)conn;
21 | httpURLConnection.connect();
22 | httpURLConnection.getInputStream();
23 | System.out.printf(httpURLConnection.getResponseCode()+"");
24 | } catch (MalformedURLException e) {
25 | e.printStackTrace();
26 | } catch (IOException e) {
27 | e.printStackTrace();
28 | }
29 |
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/rx/ConvertListener.java:
--------------------------------------------------------------------------------
1 | package com.example.rx;
2 |
3 | import rx.Observable;
4 | import rx.Subscriber;
5 |
6 | /**
7 | * Created by alanchen on 15/9/14.
8 | */
9 | public class ConvertListener {
10 |
11 | interface ValueUpdateListener {
12 | void onValueChanged(String value);
13 | }
14 |
15 | //这里就不写list保存了
16 | ValueUpdateListener mValueUpdateListener;
17 |
18 | public void setValue(String value) {
19 | if (null != mValueUpdateListener) {
20 | mValueUpdateListener.onValueChanged(value);
21 | }
22 | }
23 |
24 | public void registerListener(ValueUpdateListener listener) {
25 | mValueUpdateListener = listener;
26 | }
27 |
28 | public void unregisterListener(ValueUpdateListener listener) {
29 | mValueUpdateListener = null;
30 | }
31 |
32 | public Observable observableListenerWrapper() {
33 |
34 | return Observable.create(new Observable.OnSubscribe() {
35 |
36 | @Override
37 | public void call(final Subscriber super String> subscriber) {
38 | ValueUpdateListener listener = new ValueUpdateListener() {
39 |
40 | @Override
41 | public void onValueChanged(String value) {
42 | if (subscriber.isUnsubscribed()) {
43 | unregisterListener(this);
44 | } else {
45 | subscriber.onNext(value);
46 | }
47 | }
48 | };
49 | registerListener(listener);
50 | }
51 | });
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/rx/RxMain.java:
--------------------------------------------------------------------------------
1 | package com.example.rx;
2 |
3 | import rx.functions.Action1;
4 |
5 | /**
6 | * Created by alanchen on 15/9/14.
7 | * 一般我的练习都会配有文章,可以去看看
8 | * http://yifeiyuan.me/tags/RxJava/
9 | */
10 | public class RxMain {
11 |
12 | public static void main(String[]args){
13 |
14 | ConvertListener convertListener = new ConvertListener();
15 | convertListener.observableListenerWrapper().subscribe(new Action1() {
16 | @Override
17 | public void call(String s) {
18 | System.out.println(s);
19 | }
20 | });
21 | convertListener.setValue("第一次调用");
22 | convertListener.setValue("第二次调用");
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/PracticeDemos/lib/src/main/java/com/example/rx/RxSubscription.java:
--------------------------------------------------------------------------------
1 | package com.example.rx;
2 |
3 | import rx.Observable;
4 | import rx.Subscription;
5 | import rx.functions.Action1;
6 | import rx.schedulers.Schedulers;
7 |
8 | /**
9 | * Created by alanchen on 15/9/24.
10 | */
11 | public class RxSubscription {
12 | public static void main(String[] args) {
13 |
14 | // Subscription subscription = Observable.just("Hello subscription")
15 | // .subscribe(new Action1() {
16 | // @Override
17 | // public void call(String s) {
18 | // System.out.println(s);
19 | // }
20 | // });
21 | // System.out.println(subscription.isUnsubscribed());
22 | // subscription.unsubscribe();
23 | // System.out.println(subscription.isUnsubscribed());
24 |
25 |
26 | Subscription subscription = Observable.just("Hello subscription")
27 | .subscribeOn(Schedulers.newThread())
28 | .subscribe(new Action1() {
29 | @Override
30 | public void call(String s) {
31 | try {
32 | Thread.sleep(5000);
33 | } catch (InterruptedException e) {
34 | e.printStackTrace();
35 | }
36 | System.out.println(s);
37 | }
38 | });
39 |
40 | //默认subscription 调用完
41 | System.out.println(subscription.isUnsubscribed());
42 | subscription.unsubscribe();
43 | System.out.println(subscription.isUnsubscribed());
44 |
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/PracticeDemos/proguard-com.digits.sdk.android.digits.txt:
--------------------------------------------------------------------------------
1 | # Twitter Core proguard configuration
2 | # '-include' this file in your proguard config
3 | # Autogenerated file -- Do not modify
4 |
5 | #Proguard Config for when AppCompat is not a dependency
6 | -dontwarn com.digits.sdk.android.*ActionBarActivity
7 |
8 | # retrofit specific
9 | -dontwarn com.squareup.okhttp.**
10 | -dontwarn com.google.appengine.api.urlfetch.**
11 | -dontwarn rx.**
12 | -dontwarn retrofit.**
13 | -keepattributes Signature
14 | -keepattributes *Annotation*
15 | -keep class com.squareup.okhttp.** { *; }
16 | -keep interface com.squareup.okhttp.** { *; }
17 | -keep class retrofit.** { *; }
18 | -keepclasseswithmembers class * {
19 | @retrofit.http.* ;
20 | }
--------------------------------------------------------------------------------
/PracticeDemos/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':lib', ':yutils'
2 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "22.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 22
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 |
20 | // compileOptions {
21 | // sourceCompatibility JavaVersion.VERSION_1_8
22 | // targetCompatibility JavaVersion.VERSION_1_8
23 | // }
24 | }
25 |
26 | dependencies {
27 | compile fileTree(dir: 'libs', include: ['*.jar'])
28 | compile 'com.android.support:appcompat-v7:22.2.0'
29 | }
30 |
31 |
32 | // This is the actual solution, as in http://stackoverflow.com/a/19037807/1002054
33 | task clearJar(type: Delete) {
34 | delete 'build/libs/yutils.jar'
35 | }
36 |
37 | task makeJar(type: Copy) {
38 | from('build/intermediates/bundles/release/')
39 | into('build/libs/')
40 | include('classes.jar')
41 | rename ('classes.jar', 'yutils.jar')
42 | }
43 |
44 | makeJar.dependsOn(clearJar, build)
45 |
46 |
47 | //apply plugin: 'me.tatarka.retrolambda'
48 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/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 name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/androidTest/java/yifeiyuan/practice/yutils/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
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/yutils/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/java/yifeiyuan/practice/yutils/AppUtils.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
2 |
3 | import android.content.Context;
4 | import android.content.pm.PackageInfo;
5 | import android.content.pm.PackageManager;
6 |
7 | /**
8 | * Created by alanchen on 15/8/12.
9 | *
10 | * 用于获取应用的信息
11 | */
12 | public class AppUtils {
13 |
14 | /**
15 | * 获取app版本名称
16 | * @param context
17 | * @return
18 | */
19 | public static String getVersionName(Context context){
20 | PackageManager pm = context.getPackageManager();
21 | String versionName = "";
22 | try {
23 | PackageInfo info = pm.getPackageInfo(context.getPackageName(), PackageManager.COMPONENT_ENABLED_STATE_DEFAULT);
24 | if (null!=info) {
25 | versionName = info.versionName;
26 | }
27 | } catch (PackageManager.NameNotFoundException e) {
28 | e.printStackTrace();
29 | }
30 | return versionName;
31 |
32 | }
33 |
34 | /**
35 | * 获取app code版本号
36 | * @param context
37 | * @return
38 | */
39 | public static int getVersionCode(Context context){
40 |
41 | PackageManager pm = context.getPackageManager();
42 | int versionCode = 1;
43 | try {
44 | PackageInfo info = pm.getPackageInfo(context.getPackageName(), PackageManager.COMPONENT_ENABLED_STATE_DEFAULT);
45 | if (null!=info) {
46 | versionCode = info.versionCode;
47 | }
48 | } catch (PackageManager.NameNotFoundException e) {
49 | e.printStackTrace();
50 | }
51 |
52 | return versionCode;
53 |
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/java/yifeiyuan/practice/yutils/BitmapUtils.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Canvas;
5 | import android.graphics.ColorFilter;
6 | import android.graphics.LightingColorFilter;
7 | import android.graphics.Paint;
8 | import android.support.annotation.IntegerRes;
9 | import android.support.annotation.NonNull;
10 |
11 | /**
12 | * Created by 程序亦非猿 on 15/10/30.
13 | */
14 | public class BitmapUtils {
15 |
16 |
17 | /**
18 | * 给bitmap着色
19 | * @param sourceBitmap
20 | * @param color rgb
21 | * @return
22 | */
23 | public static Bitmap changeBitmapColor(@NonNull Bitmap sourceBitmap, @IntegerRes int color) {
24 |
25 | Bitmap resultBitmap = Bitmap.createBitmap(sourceBitmap, 0, 0,
26 | sourceBitmap.getWidth() - 1, sourceBitmap.getHeight() - 1);
27 | Paint p = new Paint();
28 | ColorFilter filter = new LightingColorFilter(color, 1);
29 | p.setColorFilter(filter);
30 |
31 | Canvas canvas = new Canvas(resultBitmap);
32 | canvas.drawBitmap(resultBitmap, 0, 0, p);
33 | return resultBitmap;
34 | }
35 |
36 |
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/java/yifeiyuan/practice/yutils/DeviceUtils.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
2 |
3 | import android.net.TrafficStats;
4 |
5 | /**
6 | * Created by alanchen on 15/8/12.
7 | */
8 | public class DeviceUtils {
9 |
10 | //todo
11 | public static long getTotalRxBytes(){
12 |
13 | return TrafficStats.getTotalRxBytes();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/java/yifeiyuan/practice/yutils/HttpUtils.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
2 |
3 | import org.apache.http.HttpResponse;
4 | import org.apache.http.client.HttpClient;
5 | import org.apache.http.client.methods.HttpHead;
6 | import org.apache.http.impl.client.DefaultHttpClient;
7 |
8 | import java.io.IOException;
9 |
10 | /**
11 | * Created by yifeiyuan on 15/7/23.
12 | */
13 | public class HttpUtils {
14 |
15 | /**
16 | * 可以提前获取网页的 statusCode 如200 404
17 | * Notice 需要异步
18 | * @param url 网页的url
19 | * @return statusCode 默认-1
20 | */
21 | public static int getPageStatusCode(String url) {
22 | int status = -1;
23 | try {
24 | HttpHead head = new HttpHead(url);
25 | HttpClient client = new DefaultHttpClient();
26 | HttpResponse resp = client.execute(head);
27 | status = resp.getStatusLine().getStatusCode();
28 | } catch (IOException e) {
29 | e.printStackTrace();
30 | }
31 | return status;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/java/yifeiyuan/practice/yutils/L.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
2 |
3 | /**
4 | * Created by alanchen on 15/9/6.
5 | */
6 | public class L {
7 | }
8 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/java/yifeiyuan/practice/yutils/PixelUtils.java:
--------------------------------------------------------------------------------
1 | package yifeiyuan.practice.yutils;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Created by alanchen on 15/8/12.
7 | */
8 | public class PixelUtils {
9 |
10 | /**
11 | * 根据手机的分辨率从dp 的单位 转成为px(像素)
12 | */
13 | public static int dip2px(Context context, float dpValue)
14 | {
15 | final float scale = context.getResources().getDisplayMetrics().density;
16 | return (int) (dpValue * scale + 0.5f);
17 | }
18 |
19 | /**
20 | * 根据手机的分辨率从px(像素) 的单位 转成为dp
21 | */
22 | public static int px2dip(Context context, float pxValue)
23 | {
24 | final float scale = context.getResources().getDisplayMetrics().density;
25 | return (int) (pxValue / scale + 0.5f);
26 | }
27 |
28 | /**
29 | * 将px值转换为sp值,保证文字大小不变
30 | */
31 | public static int px2sp(Context context,float pxValue)
32 | {
33 | final float scale = context.getResources().getDisplayMetrics().scaledDensity;
34 | return (int)(pxValue / scale + 0.5f);
35 | }
36 |
37 | /**
38 | * 将sp值转换为px值,保证文字大小不变
39 | */
40 | public static int sp2px(Context context,float spValue)
41 | {
42 | final float scale = context.getResources().getDisplayMetrics().scaledDensity;
43 | return (int)(spValue * scale + 0.5f);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/PracticeDemos/yutils/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | YUtils
3 |
4 |
--------------------------------------------------------------------------------