├── .gitignore ├── IPay ├── .gitignore ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── zhou │ └── ipay │ └── IPay.java ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── libs │ ├── BASE64Encoder.jar │ ├── BaiduLBS_Android.jar │ └── libyuv-release.aar ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── android │ │ └── content │ │ └── pm │ │ ├── IPackageDataObserver.aidl │ │ ├── IPackageStatsObserver.aidl │ │ └── PackageStats.aidl │ ├── assets │ ├── child.apk │ ├── skin_res.apk │ └── world.jpg │ ├── java │ └── com │ │ └── zhou │ │ └── android │ │ ├── MainActivity.java │ │ ├── ZApplication.java │ │ ├── adapter │ │ ├── GridViewAdapter.java │ │ ├── PhotoRecyclerAdapter.java │ │ ├── PictureAdapter.java │ │ ├── RecyclerListener.java │ │ └── SimpleRecyclerAdapter.java │ │ ├── bluetooth │ │ ├── BluetoothActivity.java │ │ ├── BluetoothChatActivity.java │ │ ├── BluetoothChatFragment.java │ │ ├── BluetoothChatService.java │ │ ├── BluetoothListFragment.java │ │ ├── BluetoothMainActivity.java │ │ └── MessageType.java │ │ ├── camera2 │ │ ├── CameraConfig.java │ │ ├── CameraUtil.java │ │ ├── ICamera.java │ │ └── OnImageAvailableListener.java │ │ ├── common │ │ ├── AppQueryUtil.java │ │ ├── BaseActivity.java │ │ ├── CardStackBehavior.java │ │ ├── CommonAdapter.java │ │ ├── CommonRecyclerAdapter.kt │ │ ├── GV.java │ │ ├── KtUtil.kt │ │ ├── LocationUtil.java │ │ ├── LogInterceptor.java │ │ ├── PaddingItemDecoration.kt │ │ ├── ScrollableViewCompat.java │ │ ├── StorageQueryUtil.java │ │ ├── ToastUtils.java │ │ ├── Tools.java │ │ ├── Utils.java │ │ └── ViewHolder.java │ │ ├── h264 │ │ └── AvcEncoder.kt │ │ ├── item │ │ └── GridViewItem.java │ │ ├── kotlin │ │ ├── ActivityMonitor.kt │ │ ├── AnalysisDecorActivity.kt │ │ ├── AnimRecyclerActivity.kt │ │ ├── AppDetail.kt │ │ ├── ExceptionReceiver.kt │ │ ├── KtUtils.kt │ │ ├── LargeImageActivity.kt │ │ ├── MonitorCalback.kt │ │ ├── NtpTimeActivity.kt │ │ ├── OrderFragmentActivity.kt │ │ ├── RecyclerSwipeActivity.kt │ │ ├── SimpleListKotlinActivity.kt │ │ ├── StorageCleanActivity.kt │ │ ├── StorageUtil.kt │ │ ├── TextFragment.kt │ │ ├── ThrowExceptionActivity.kt │ │ ├── UndoTestActivity.kt │ │ ├── WindowCallbackInvocation.kt │ │ └── album │ │ │ ├── AlbumAdapter.kt │ │ │ ├── AlbumPagerAdapter.kt │ │ │ ├── AlbumScrollListener.kt │ │ │ └── AsViewPagerActivity.kt │ │ ├── livedata │ │ ├── Article.kt │ │ ├── ArticleActivity.kt │ │ ├── ArticleDetailActivity.kt │ │ ├── ArticleModel.kt │ │ ├── LDBusActivity.kt │ │ ├── LiveEvent.kt │ │ └── LiveEventBus.kt │ │ ├── main │ │ ├── AppSizeActivity.java │ │ ├── BroadcastReceiverActivity.java │ │ ├── CallLogActivity.java │ │ ├── CameraH264Activity.java │ │ ├── CameraImageActivity.java │ │ ├── CameraUtilTestActivity.java │ │ ├── ContactActivity.java │ │ ├── DexClassLoaderActivity.java │ │ ├── DoubleCameraActivity.java │ │ ├── FingerPrintActivity.java │ │ ├── FloatBallActivity.java │ │ ├── FocusAnimActivity.kt │ │ ├── FocusDrawActivity.kt │ │ ├── ForbidScreenshotActivity.java │ │ ├── FunctionGuideActivity.kt │ │ ├── ImageActivity.kt │ │ ├── LocalNetActivity.java │ │ ├── NestedBehaviorActivity.java │ │ ├── NestedScrollActivity.java │ │ ├── PhotoPickerActivity.java │ │ ├── PointZoomActivity.java │ │ ├── PreviewWithCamera2Activity.kt │ │ ├── RecyclerViewScrollActivity.java │ │ ├── RippleActivity.kt │ │ ├── RoundViewActivity.kt │ │ ├── ScrollTestActivity.java │ │ ├── SkinActivity.kt │ │ ├── SkinExternalResActivity.kt │ │ ├── SkinListActivity.kt │ │ ├── SkinPageActivity.kt │ │ ├── SlideMenuActivity.kt │ │ ├── StorageActivity.java │ │ ├── SurfaceActivity.java │ │ ├── TestRvActivity.kt │ │ ├── TimeLineActivity.kt │ │ ├── UdpReceiverActivity.java │ │ ├── UdpSend.java │ │ ├── VerifyCodeActivity.kt │ │ └── VideoActivity.java │ │ ├── model │ │ ├── presenter │ │ │ ├── OkHttpPresenter.java │ │ │ ├── PicturePresenter.java │ │ │ └── WeatherPresenter.java │ │ ├── ui │ │ │ ├── OkHttpActivity.java │ │ │ ├── PicassoActivity.java │ │ │ └── WeatherActivity.java │ │ └── view │ │ │ ├── IOkHttpView.java │ │ │ ├── IPictureView.java │ │ │ └── IWeatherView.java │ │ ├── net │ │ ├── BaseNetwork.java │ │ ├── Callback.java │ │ ├── ClientNetwork.java │ │ ├── Constant.java │ │ ├── LocalNetwork.java │ │ ├── Packet.java │ │ ├── ResponseCode.java │ │ ├── ServerHandler.java │ │ └── ServerNetwork.java │ │ ├── opengl │ │ ├── GLFrameRenderer.java │ │ └── GLProgram.java │ │ ├── provider │ │ └── KidWidgetProvider.kt │ │ ├── retrofit │ │ ├── Blog.java │ │ ├── BlogServer.java │ │ ├── CustomConverterFactory.java │ │ ├── CustomRequestConverter.java │ │ ├── CustomResponseConverter.java │ │ ├── Result.java │ │ └── RetrofitActivity.java │ │ ├── service │ │ └── FloatBallService.java │ │ ├── share │ │ ├── ShareActivity.java │ │ └── ShareListActivity.java │ │ ├── skin │ │ ├── AttrFactory.kt │ │ ├── SkinAttr.kt │ │ ├── SkinBean.kt │ │ ├── SkinFactory.kt │ │ └── SkinManager.kt │ │ └── ui │ │ ├── AutoFixTextureView.kt │ │ ├── CardNestedLayout.java │ │ ├── CardStackLayout.java │ │ ├── CircleImageView.java │ │ ├── CircleShapeView.kt │ │ ├── CircleView.java │ │ ├── DividerItemDecoration.java │ │ ├── FloatView.java │ │ ├── FocusCircleView.kt │ │ ├── FocusDrawView.kt │ │ ├── LargeImageView.kt │ │ ├── NestedListView.java │ │ ├── PhotoPicker.java │ │ ├── PointZoomView.java │ │ ├── PwdEditText.java │ │ ├── RecyclerSwipeDeleteView.kt │ │ ├── RippleView.kt │ │ ├── RoundImageView.kt │ │ ├── SlideMenuLayout.kt │ │ ├── SquaredImageView.java │ │ ├── VerifyCodeText.java │ │ └── XfermodeView.kt │ ├── jniLibs │ └── armeabi │ │ ├── libindoor.so │ │ └── liblocSDK7b.so │ └── res │ ├── anim │ ├── slide_bottom_in.xml │ ├── slide_bottom_out.xml │ ├── slide_in_right.xml │ └── slide_out_left.xml │ ├── color │ └── bg_tab_text.xml │ ├── drawable-hdpi │ ├── ic_3.png │ ├── ic_camera.png │ ├── ic_close.png │ ├── ic_folder.png │ ├── ic_friend.png │ ├── ic_link.png │ ├── ic_open.png │ ├── ic_place.png │ ├── ic_smile.png │ ├── ic_video_record.png │ ├── ic_viewgroup.png │ ├── ic_wx.png │ ├── icon_close.png │ └── pic_head.png │ ├── drawable-xhdpi │ ├── bg_welcome.png │ ├── cover.png │ ├── create.png │ ├── ic_add.png │ ├── ic_block_tab_checked.png │ ├── ic_block_tab_unchecked.png │ ├── ic_camera.png │ ├── ic_chat_left.9.png │ ├── ic_chat_right.9.png │ ├── ic_failed.png │ ├── ic_focus.png │ ├── ic_like.png │ ├── pic_wifi_00.png │ ├── pic_wifi_01.png │ └── pic_wifi_02.png │ ├── drawable │ ├── bg_block_tab.xml │ ├── bg_camera_record.xml │ ├── bg_camera_shot.xml │ ├── bg_divider.xml │ ├── bg_gray.xml │ ├── bg_round_card.xml │ ├── bg_white.xml │ ├── btn_green.xml │ ├── btn_status.xml │ ├── selector_griditem.xml │ ├── selector_round_kid.xml │ ├── shape_button_day.xml │ ├── shape_button_night.xml │ ├── shape_divider_v.xml │ ├── shape_linear_day.xml │ ├── shape_linear_night.xml │ ├── shape_rectangle.xml │ ├── shape_round_black.xml │ ├── shape_round_blue.xml │ ├── shape_round_rect.xml │ ├── shape_skin_item_day.xml │ ├── shape_skin_item_night.xml │ ├── shape_skin_uni.xml │ └── wifi_anim.xml │ ├── layout │ ├── accc.xml │ ├── activity_app_size.xml │ ├── activity_article.xml │ ├── activity_article_detail.xml │ ├── activity_as_vp.xml │ ├── activity_behavior.xml │ ├── activity_bluetooth.xml │ ├── activity_bluetooth_main.xml │ ├── activity_broadcast.xml │ ├── activity_bus.xml │ ├── activity_camera_h264.xml │ ├── activity_camera_image.xml │ ├── activity_camera_preview.xml │ ├── activity_camera_util.xml │ ├── activity_contact.xml │ ├── activity_decor.xml │ ├── activity_dex_class_loader.xml │ ├── activity_double_camera.xml │ ├── activity_fingerprint.xml │ ├── activity_floatball.xml │ ├── activity_forbid_screenshot.xml │ ├── activity_function_guide.xml │ ├── activity_image.xml │ ├── activity_kotin.xml │ ├── activity_large_image.xml │ ├── activity_local_net.xml │ ├── activity_main.xml │ ├── activity_nestedscroll.xml │ ├── activity_ntp_time.xml │ ├── activity_okhttp.xml │ ├── activity_order_fragemnt.xml │ ├── activity_photo_picker.xml │ ├── activity_picture_view.xml │ ├── activity_point_zoom.xml │ ├── activity_recycler_scroll.xml │ ├── activity_recycler_swipe.xml │ ├── activity_recycler_view.xml │ ├── activity_retrofit.xml │ ├── activity_ripple.xml │ ├── activity_round_view.xml │ ├── activity_scroll.xml │ ├── activity_share.xml │ ├── activity_share_list.xml │ ├── activity_skin.xml │ ├── activity_skin_external.xml │ ├── activity_skin_list.xml │ ├── activity_skin_page.xml │ ├── activity_slide_menu.xml │ ├── activity_storage.xml │ ├── activity_storage_clean.xml │ ├── activity_surface.xml │ ├── activity_test_rv.xml │ ├── activity_throw_exception.xml │ ├── activity_timeline.xml │ ├── activity_udp.xml │ ├── activity_undo.xml │ ├── activity_verify_code.xml │ ├── activity_video.xml │ ├── activity_weather.xml │ ├── fragment_bluetooth_chat.xml │ ├── fragment_bluetooth_list.xml │ ├── fragment_text.xml │ ├── horizontal_line.xml │ ├── layout_app.xml │ ├── layout_focus_draw.xml │ ├── layout_kid_widget_provider.xml │ ├── layout_picture.xml │ ├── layout_shape_text.xml │ ├── layout_shared.xml │ ├── layout_simple_text.xml │ ├── layout_skin_item.xml │ ├── layout_small_text.xml │ ├── layout_storage_item.xml │ ├── layout_undo_dialog.xml │ ├── layout_undo_pop.xml │ ├── listformat_article_item.xml │ ├── listformat_bluetooth_chat.xml │ ├── listformat_dialog_finger.xml │ ├── listformat_dialog_usepwd.xml │ ├── listformat_gridviewitem.xml │ ├── listformat_image_item.xml │ ├── listformat_photo_item.xml │ └── listformat_photo_picker.xml │ ├── menu │ ├── menu_bluetooth.xml │ ├── menu_photo.xml │ ├── menu_picasso.xml │ ├── menu_recycler.xml │ └── menu_skin.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── raw │ └── test_2.mp4 │ ├── values-w820dp │ └── dimens.xml │ ├── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── file_paths_public.xml │ └── kid_provider.xml ├── build.gradle ├── child ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── at │ │ └── zhou │ │ └── child │ │ ├── MainActivity.java │ │ └── PayImpl.java │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── group_qr_code.png ├── home.html ├── settings.gradle └── test.html /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | gradlew 11 | gradlew.bat 12 | gradle/ 13 | app/src/test/ 14 | app/src/androidTest/ 15 | /.idea/ 16 | /app/build.gradle 17 | -------------------------------------------------------------------------------- /IPay/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /IPay/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | 3 | dependencies { 4 | implementation fileTree(dir: 'libs', include: ['*.jar']) 5 | 6 | } 7 | 8 | sourceCompatibility = "8" 9 | targetCompatibility = "8" 10 | -------------------------------------------------------------------------------- /IPay/src/main/java/com/zhou/ipay/IPay.java: -------------------------------------------------------------------------------- 1 | package com.zhou.ipay; 2 | 3 | public interface IPay { 4 | int getMoney(); 5 | 6 | void pay(int money); 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 maxiaozhou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AndroidDemo 2 | 3 | 这个项目仅仅是一些代码测试,如果在项目中使用,请尽量多测试,不保证稳定性 4 | 5 | android 涉及知识很多,自己也在不断学习,如果你也在学习过程希望与人交流,欢迎加入下面群组 :point_down: 6 | 7 | ## :tada::tada::tada: QQ 群 8 | 9 | ![QQ Group](https://developer.android.google.cn/images/kotlin/hero.svg) 10 | 11 | ## 如何在 github 使用 emoji 12 | 13 | 在提交中加入 'emoji' 对应的符号即可,如 笑脸 `:smile:` -> :smile: 14 | 15 | emoji 符号对应表 :point_right: [emoji 对照表](https://www.webfx.com/tools/emoji-cheat-sheet/) 16 | 17 | gemoji github 地址 :point_right: [gemoji](https://github.com/github/gemoji) 18 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/libs/BASE64Encoder.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/libs/BASE64Encoder.jar -------------------------------------------------------------------------------- /app/libs/BaiduLBS_Android.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/libs/BaiduLBS_Android.jar -------------------------------------------------------------------------------- /app/libs/libyuv-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/libs/libyuv-release.aar -------------------------------------------------------------------------------- /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 E:\ApplicationSoftware\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 | -------------------------------------------------------------------------------- /app/src/main/aidl/android/content/pm/IPackageDataObserver.aidl: -------------------------------------------------------------------------------- 1 | // IPackageDataObserver.aidl 2 | package android.content.pm; 3 | 4 | // Declare any non-default types here with import statements 5 | 6 | interface IPackageDataObserver { 7 | /** 8 | * Demonstrates some basic types that you can use as parameters 9 | * and return values in AIDL. 10 | */ 11 | void onRemoveCompleted(in String packageName , boolean successed); 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/aidl/android/content/pm/IPackageStatsObserver.aidl: -------------------------------------------------------------------------------- 1 | // IPackageStatsObserver.aidl 2 | package android.content.pm; 3 | 4 | // Declare any non-default types here with import statements 5 | import android.content.pm.PackageStats; 6 | 7 | interface IPackageStatsObserver { 8 | /** 9 | * Demonstrates some basic types that you can use as parameters 10 | * and return values in AIDL. 11 | */ 12 | void onGetStatsCompleted(in PackageStats pStats, boolean succeeded); 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/aidl/android/content/pm/PackageStats.aidl: -------------------------------------------------------------------------------- 1 | // PackageStats.aidl 2 | package android.content.pm; 3 | 4 | // Declare any non-default types here with import statements 5 | 6 | //interface PackageStats { 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 | parcelable PackageStats; -------------------------------------------------------------------------------- /app/src/main/assets/child.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/assets/child.apk -------------------------------------------------------------------------------- /app/src/main/assets/skin_res.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/assets/skin_res.apk -------------------------------------------------------------------------------- /app/src/main/assets/world.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/assets/world.jpg -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ZApplication.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | import android.support.multidex.MultiDex; 7 | 8 | import com.zhou.android.common.GV; 9 | import com.zhou.android.kotlin.ActivityMonitor; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * Created by ZhOu on 2017/2/9. 16 | */ 17 | public class ZApplication extends Application { 18 | 19 | public static Context context; 20 | 21 | @Override 22 | public void onCreate() { 23 | super.onCreate(); 24 | SharedPreferences sp = getSharedPreferences(GV.Config, 0); 25 | if (sp.contains(GV.HasFingerPrintApi)) 26 | return; 27 | try { 28 | //判断是否有指纹Api 29 | Class.forName("android.hardware.fingerprint.FingerprintManager"); 30 | sp.edit().putBoolean(GV.HasFingerPrintApi, true).apply(); 31 | } catch (ClassNotFoundException e) { 32 | e.printStackTrace(); 33 | sp.edit().putBoolean(GV.HasFingerPrintApi, false).apply(); 34 | } 35 | 36 | } 37 | 38 | @Override 39 | protected void attachBaseContext(Context base) { 40 | super.attachBaseContext(base); 41 | context = base; 42 | MultiDex.install(base); 43 | ArrayList uncheck = new ArrayList(); 44 | uncheck.add(MainActivity.class); 45 | ActivityMonitor.get().attach(base,uncheck); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/adapter/RecyclerListener.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.adapter; 2 | 3 | /** 4 | * 点击监听器 5 | * Created by ZhOu on 2017/8/4. 6 | */ 7 | 8 | public interface RecyclerListener { 9 | void onItemClick(int position); 10 | 11 | void onItemLongClick(int position); 12 | 13 | void onItemAdd(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/adapter/SimpleRecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.zhou.android.R; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | * 简单测试适配器 17 | * Created by ZhOu on 2018/2/17. 18 | */ 19 | 20 | public class SimpleRecyclerAdapter extends RecyclerView.Adapter { 21 | 22 | private List data = new ArrayList<>(); 23 | private LayoutInflater inflater; 24 | 25 | public SimpleRecyclerAdapter(Context context, List data) { 26 | inflater = LayoutInflater.from(context); 27 | if (data != null) 28 | this.data = data; 29 | } 30 | 31 | @Override 32 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 33 | return new ViewHolder(inflater.inflate(R.layout.layout_simple_text, parent, false)); 34 | } 35 | 36 | @Override 37 | public void onBindViewHolder(ViewHolder holder, int position) { 38 | holder.text.setText(data.get(position)); 39 | } 40 | 41 | @Override 42 | public int getItemCount() { 43 | return data.size(); 44 | } 45 | 46 | static class ViewHolder extends RecyclerView.ViewHolder { 47 | 48 | TextView text; 49 | 50 | ViewHolder(View itemView) { 51 | super(itemView); 52 | text = (TextView) itemView.findViewById(R.id.text); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/bluetooth/MessageType.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.bluetooth; 2 | 3 | /** 4 | * Bluetooth 通信数据类型 5 | * Created by ZhOu on 2017/6/14. 6 | */ 7 | 8 | public interface MessageType { 9 | int MESSAGE_STATE_CHANGE = 0; 10 | int MESSAGE_READ = 1; 11 | int MESSAGE_WRITE = 2; 12 | int MESSAGE_DEVICE = 3; 13 | int MESSAGE_FAILED = 4; 14 | int MESSAGE_LOST = 5; 15 | int MESSAGE_REFRESH_STARTED = 6; 16 | int MESSAGE_REFRESH_FINISHED = 7; 17 | String MESSAGE_DEVICE_NAME = "deviceName"; 18 | String MESSAGE_DISCONNECT_DEVICE = "disconnectDevice"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/camera2/ICamera.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.camera2; 2 | 3 | /** 4 | * camera 接口 5 | * Created by Administrator on 2018/11/22. 6 | */ 7 | 8 | public interface ICamera { 9 | 10 | void openCamera(); 11 | 12 | void closeCamera(); 13 | 14 | void swtchCamera(); 15 | 16 | void takePhoto(); 17 | 18 | void startRecord(); 19 | 20 | void stopRecord(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/camera2/OnImageAvailableListener.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.camera2; 2 | 3 | import android.media.ImageReader; 4 | import android.os.Build; 5 | import android.support.annotation.RequiresApi; 6 | 7 | /** 8 | * ImageAvailableListener 9 | * Created by Administrator on 2018/10/31. 10 | */ 11 | 12 | @RequiresApi(api = Build.VERSION_CODES.KITKAT) 13 | public class OnImageAvailableListener implements ImageReader.OnImageAvailableListener { 14 | 15 | private int orientation = 0; 16 | 17 | @Override 18 | public void onImageAvailable(ImageReader reader) { 19 | 20 | } 21 | 22 | public void setOrientation(int orientation) { 23 | this.orientation = orientation; 24 | } 25 | 26 | public int getOrientation() { 27 | return orientation; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.ActivityCompat; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.MenuItem; 8 | 9 | /** 10 | * Created by ZhOu on 2017/2/9. 11 | */ 12 | public abstract class BaseActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(@Nullable Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(); 18 | getSupportActionBar().setTitle(getClass().getSimpleName().replace("Activity", "")); 19 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 20 | init(); 21 | addListener(); 22 | } 23 | 24 | @Override 25 | public boolean onOptionsItemSelected(MenuItem item) { 26 | if (android.R.id.home == item.getItemId()) { 27 | back(); 28 | return true; 29 | } else 30 | return super.onOptionsItemSelected(item); 31 | } 32 | 33 | public void back() { 34 | ActivityCompat.finishAfterTransition(this); 35 | } 36 | 37 | protected abstract void setContentView(); 38 | 39 | protected abstract void init(); 40 | 41 | protected abstract void addListener(); 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/CommonAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.BaseAdapter; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * 通用适配器 13 | *

14 | * Created by ZhOu on 2017/5/23. 15 | */ 16 | 17 | public abstract class CommonAdapter extends BaseAdapter { 18 | 19 | private List data = new ArrayList<>(); 20 | private Context context; 21 | private int layoutId; 22 | 23 | public CommonAdapter(Context context, List data, int layoutId) { 24 | this.context = context; 25 | this.data = data; 26 | this.layoutId = layoutId; 27 | } 28 | 29 | @Override 30 | public int getCount() { 31 | return data == null ? 0 : data.size(); 32 | } 33 | 34 | @Override 35 | public Object getItem(int position) { 36 | return data.get(position); 37 | } 38 | 39 | @Override 40 | public long getItemId(int position) { 41 | return position; 42 | } 43 | 44 | @Override 45 | public View getView(int position, View convertView, ViewGroup parent) { 46 | ViewHolder holder = ViewHolder.getViewHolder(context, convertView, layoutId); 47 | fillData(holder, position); 48 | return holder.getContentView(); 49 | } 50 | 51 | protected abstract void fillData(ViewHolder holder, int position); 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/CommonRecyclerAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common 2 | 3 | import android.content.Context 4 | import android.support.v7.widget.RecyclerView 5 | import android.util.SparseArray 6 | import android.view.View 7 | import android.view.ViewGroup 8 | 9 | /** 10 | * Created by mxz on 2020/5/22. 11 | */ 12 | abstract class CommonRecyclerAdapter(val context: Context, val data: List) 13 | : RecyclerView.Adapter() { 14 | 15 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): R { 16 | return getViewHolder(context, parent, viewType) 17 | } 18 | 19 | override fun getItemCount(): Int = data.size 20 | 21 | override fun onBindViewHolder(holder: R, position: Int) { 22 | onBind(holder, data[position], position) 23 | } 24 | 25 | abstract fun onBind(holder: R, item: T, pos: Int) 26 | 27 | abstract fun getViewHolder(context: Context, parent: ViewGroup, viewType: Int): R 28 | 29 | open class ViewHolder(private val layout: View) : RecyclerView.ViewHolder(layout) { 30 | 31 | private val cache = SparseArray() 32 | 33 | @Suppress("UNCHECKED_CAST") 34 | fun getView(id: Int): T { 35 | var view = cache[id] 36 | if (view == null) { 37 | view = layout.findViewById(id) 38 | cache.put(id, view) 39 | } 40 | return view as T 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/GV.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common; 2 | 3 | /** 4 | * 5 | * Created by ZhOu on 2017/2/9. 6 | */ 7 | 8 | public class GV { 9 | 10 | public final static String Config = "sp_config"; 11 | public final static String HasFingerPrintApi = "has_fingerprint_api"; 12 | 13 | public final static String MONITOR_TIMEOUT = "monitor timeout"; 14 | public final static String MONITOR_TIME_COUNT = "monitor_time_count"; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/KtUtil.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common 2 | 3 | import android.app.Activity 4 | import android.text.Editable 5 | import android.widget.Toast 6 | import io.reactivex.disposables.CompositeDisposable 7 | import io.reactivex.disposables.Disposable 8 | 9 | /** 10 | * Created by mxz on 2019/10/31. 11 | */ 12 | 13 | fun Disposable.addToComposite(composite: CompositeDisposable) = composite.add(this) 14 | 15 | fun Activity.toast(text: CharSequence, duration: Int = Toast.LENGTH_LONG) = Toast.makeText(this, text, duration).show() 16 | 17 | fun String.text() = Editable.Factory.getInstance().newEditable(this)!! 18 | fun String.editable() = Editable.Factory.getInstance().newEditable(this)!! -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/LogInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.IOException; 6 | 7 | import okhttp3.FormBody; 8 | import okhttp3.Interceptor; 9 | import okhttp3.Request; 10 | import okhttp3.RequestBody; 11 | import okhttp3.Response; 12 | import okhttp3.ResponseBody; 13 | 14 | /** 15 | * Created by ZhOu on 2018/7/23. 16 | */ 17 | 18 | public class LogInterceptor implements Interceptor { 19 | private static final String TAG = "LogInterceptor"; 20 | 21 | @Override 22 | public Response intercept(Chain chain) throws IOException { 23 | Request request = chain.request(); 24 | Response response = chain.proceed(request); 25 | String method = request.method(); 26 | Log.d(TAG, "\r\n"); 27 | Log.d(TAG, "----------START----------"); 28 | Log.d(TAG, "| url: " + request.url().toString()); 29 | String content = response.body().string(); 30 | if ("POST".equals(method)) { 31 | RequestBody body = request.body(); 32 | if (body instanceof FormBody) { 33 | StringBuilder builder = new StringBuilder(); 34 | FormBody formBody = (FormBody) body; 35 | for (int i = 0; i < formBody.size(); i++) { 36 | builder.append(formBody.encodedName(i) + "=" + formBody.encodedValue(i) + ","); 37 | } 38 | builder.delete(builder.length() - 1, builder.length()); 39 | Log.d(TAG, "| params: {" + builder.toString() + "}"); 40 | } 41 | } 42 | Log.d(TAG, "-----------END-----------"); 43 | return response.newBuilder() 44 | .body(ResponseBody.create(response.body().contentType(), content)) 45 | .build(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/PaddingItemDecoration.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common 2 | 3 | import android.content.Context 4 | import android.graphics.Rect 5 | import android.support.v7.widget.RecyclerView 6 | import android.view.View 7 | 8 | /** 9 | * 边距设置 10 | * Created by mxz on 2020/3/23. 11 | */ 12 | class PaddingItemDecoration(context: Context, left: Int = 0, top: Int = 0, right: Int = 0, bottom: Int = 0) 13 | : RecyclerView.ItemDecoration() { 14 | private var leftPadding = 0 15 | private var topPadding = 0 16 | private var rightPadding = 0 17 | private var bottomPadding = 0 18 | 19 | init { 20 | val density = context.resources.displayMetrics.density 21 | leftPadding = (density * left).toInt() 22 | topPadding = (density * top).toInt() 23 | rightPadding = (density * right).toInt() 24 | bottomPadding = (density * bottom).toInt() 25 | } 26 | 27 | override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) { 28 | outRect.set(leftPadding, topPadding, rightPadding, bottomPadding) 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/ToastUtils.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | /** 7 | * Created by ZhOu on 2017/10/8. 8 | */ 9 | 10 | public class ToastUtils { 11 | 12 | public static void show(Context context, CharSequence text) { 13 | Toast.makeText(context, text, Toast.LENGTH_SHORT).show(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/common/ViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.common; 2 | 3 | import android.content.Context; 4 | import android.util.SparseArray; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | 8 | /** 9 | * 通用适配器Holder 10 | *

11 | * Created by ZhOu on 2017/5/23. 12 | */ 13 | 14 | @SuppressWarnings("unchecked") 15 | public class ViewHolder { 16 | 17 | private SparseArray views; 18 | private View contentView; 19 | 20 | public ViewHolder(Context context, int layoutId) { 21 | this.views = new SparseArray<>(); 22 | contentView = LayoutInflater.from(context).inflate(layoutId, null); 23 | contentView.setTag(this); 24 | } 25 | 26 | public static ViewHolder getViewHolder(Context context, View convertView,int layoutId) { 27 | if (convertView == null) 28 | return new ViewHolder(context, layoutId); 29 | else 30 | return (ViewHolder) convertView.getTag(); 31 | 32 | } 33 | 34 | public T getView(int id) { 35 | View view = views.get(id); 36 | if (view == null) { 37 | view = contentView.findViewById(id); 38 | views.put(id, view); 39 | } 40 | return (T) view; 41 | } 42 | 43 | public View getContentView() { 44 | return contentView; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/item/GridViewItem.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.item; 2 | 3 | /** 4 | * Created by ZhOu on 2017/2/8. 5 | */ 6 | 7 | public class GridViewItem { 8 | public String targetClass; 9 | public String zhName; 10 | public Class clz; 11 | 12 | public GridViewItem(String targetClass, String zhName) { 13 | this.targetClass = targetClass; 14 | this.zhName = zhName; 15 | try { 16 | this.clz = Class.forName(targetClass); 17 | } catch (Exception e) { 18 | this.clz = null; 19 | } 20 | } 21 | 22 | public GridViewItem(Class clz, String zhName) { 23 | this.clz = clz; 24 | this.targetClass = clz.getName(); 25 | this.zhName = zhName; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/AnalysisDecorActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.content.Intent 4 | import android.util.Log 5 | import android.view.View 6 | import com.zhou.android.R 7 | import com.zhou.android.common.BaseActivity 8 | import java.lang.reflect.Field 9 | 10 | /** 11 | * @author Administrator_Zhou 12 | * created on 2019/6/9 13 | */ 14 | class AnalysisDecorActivity : BaseActivity() { 15 | 16 | override fun setContentView() { 17 | setContentView(R.layout.activity_decor) 18 | } 19 | 20 | override fun init() { 21 | } 22 | 23 | override fun addListener() { 24 | findViewById(R.id.jump).setOnClickListener { 25 | startActivity(Intent(this@AnalysisDecorActivity, AnalysisDecorActivity::class.java)) 26 | } 27 | 28 | findViewById(R.id.btnThrow).setOnClickListener { 29 | startActivity(Intent(this@AnalysisDecorActivity, ThrowExceptionActivity::class.java)) 30 | } 31 | } 32 | 33 | override fun onResume() { 34 | super.onResume() 35 | val view = window.decorView 36 | try { 37 | val field: Field = view::class.java.getDeclaredField("mFeatureId") 38 | field.isAccessible = true 39 | val mFeatureId = field.getInt(view) 40 | Log.e("zhou", "onResume >> mFeatureId = $mFeatureId") 41 | } catch (e: Exception) { 42 | e.printStackTrace() 43 | } 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/AppDetail.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.graphics.drawable.Drawable 4 | 5 | data class AppDetail(val packageName: String, var code: Long, var data: Long, var cache: Long, val icon: Drawable) { 6 | 7 | fun getAppString(): String { 8 | return "Code:${StorageUtil.getUnit(code)} Data:${StorageUtil.getUnit(data)} Cache:${StorageUtil.getUnit(cache)}" 9 | } 10 | 11 | fun getApp(): Long { 12 | return code + data + cache 13 | } 14 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/ExceptionReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.media.RingtoneManager 7 | import android.os.Process 8 | import android.util.Log 9 | 10 | /** 11 | * Created by mxz on 2019/7/25. 12 | */ 13 | class ExceptionReceiver : BroadcastReceiver() { 14 | override fun onReceive(context: Context, intent: Intent?) { 15 | if (intent?.action.equals("playSound")) { 16 | Log.d("zhou", "playSound ${Process.myPid()} ${ExceptionReceiver@ this.toString()}") 17 | val uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION) 18 | RingtoneManager.getRingtone(context, uri).play() 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/KtUtils.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.text.Editable 4 | 5 | /** 6 | * @author Administrator_Zhou 7 | * created on 2019/6/8 8 | */ 9 | 10 | fun string(text:CharSequence):Editable = Editable.Factory.getInstance().newEditable(text) -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/LargeImageActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import com.zhou.android.R 4 | import com.zhou.android.common.BaseActivity 5 | import kotlinx.android.synthetic.main.activity_large_image.* 6 | 7 | /** 8 | * Created by zhou on 2020/5/30. 9 | */ 10 | class LargeImageActivity : BaseActivity() { 11 | 12 | override fun setContentView() { 13 | setContentView(R.layout.activity_large_image) 14 | 15 | } 16 | 17 | override fun init() { 18 | val input = assets.open("world.jpg") 19 | largeImage.setImageStream(input) 20 | } 21 | 22 | override fun addListener() { 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/RecyclerSwipeActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import com.zhou.android.R 4 | import com.zhou.android.common.BaseActivity 5 | import kotlinx.android.synthetic.main.activity_recycler_swipe.* 6 | 7 | /** 8 | * Created by zhou on 2020/8/13. 9 | */ 10 | class RecyclerSwipeActivity : BaseActivity() { 11 | 12 | override fun setContentView() { 13 | setContentView(R.layout.activity_recycler_swipe) 14 | } 15 | 16 | override fun init() { 17 | } 18 | 19 | override fun addListener() { 20 | btnReset.setOnClickListener { 21 | recyclerSwipe.reset() 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/SimpleListKotlinActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import android.view.MenuItem 6 | import android.widget.ArrayAdapter 7 | import android.widget.ListView 8 | import com.zhou.android.R 9 | 10 | class SimpleListKotlinActivity : AppCompatActivity() { 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | setContentView(R.layout.activity_kotin) 15 | val actionBar = supportActionBar 16 | actionBar?.title = "Kotlin" 17 | actionBar?.setDisplayHomeAsUpEnabled(true) 18 | var listView = findViewById(R.id.listView) 19 | var data: ArrayList = ArrayList() 20 | for (i in 0..20) { 21 | data.add("测试示例:" + i) 22 | } 23 | var adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, android.R.id.text1, data) 24 | listView.adapter = adapter 25 | } 26 | 27 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 28 | if (android.R.id.home == item.itemId) { 29 | finish() 30 | return true 31 | } else 32 | return super.onOptionsItemSelected(item) 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/TextFragment.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.graphics.Color 4 | import android.os.Bundle 5 | import android.support.annotation.ColorInt 6 | import android.support.annotation.ColorRes 7 | import android.support.v4.app.Fragment 8 | import android.view.LayoutInflater 9 | import android.view.View 10 | import android.view.ViewGroup 11 | import android.widget.TextView 12 | import com.zhou.android.R 13 | 14 | /** 15 | * Created by mxz on 2019/7/25. 16 | */ 17 | class TextFragment : Fragment() { 18 | 19 | private var text: TextView? = null 20 | private var str = "" 21 | private var color = Color.WHITE 22 | 23 | var mark = 0 24 | 25 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 26 | 27 | text = inflater.inflate(R.layout.fragment_text, container, false) as TextView 28 | return text 29 | } 30 | 31 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 32 | super.onViewCreated(view, savedInstanceState) 33 | text?.text = str 34 | text?.setBackgroundColor(color) 35 | } 36 | 37 | fun setText(_str: String) { 38 | if (text == null) { 39 | str = _str 40 | } else { 41 | text?.text = _str 42 | } 43 | } 44 | 45 | fun bg(@ColorInt c: Int) { 46 | if (text == null) { 47 | color = c 48 | } else { 49 | text?.setBackgroundColor(c) 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/WindowCallbackInvocation.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin 2 | 3 | import android.util.Log 4 | import android.view.MotionEvent 5 | import java.lang.reflect.InvocationHandler 6 | import java.lang.reflect.Method 7 | 8 | /** 9 | * Created by mxz on 2019/6/5. 10 | */ 11 | class WindowCallbackInvocation(val callback: Any) : InvocationHandler { 12 | 13 | override fun invoke(proxy: Any?, method: Method?, args: Array?): Any? { 14 | if ("dispatchTouchEvent" == method?.name) { 15 | Log.i("zhou", "WindowCallbackInvocation") 16 | val event: MotionEvent = args?.get(0) as MotionEvent 17 | if (MotionEvent.ACTION_UP == event.action) { 18 | ActivityMonitor.get().update() 19 | } 20 | } 21 | return method?.invoke(callback, *(args ?: arrayOfNulls(0))) 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/album/AlbumAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin.album 2 | 3 | import android.content.Context 4 | import android.support.v7.widget.RecyclerView 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import android.widget.ImageView 9 | import com.squareup.picasso.Picasso 10 | import com.zhou.android.R 11 | 12 | class AlbumAdapter : RecyclerView.Adapter { 13 | 14 | val data: List 15 | val context: Context 16 | 17 | constructor (context: Context, data: List) { 18 | 19 | this@AlbumAdapter.context = context 20 | 21 | this@AlbumAdapter.data = data 22 | } 23 | 24 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { 25 | return ViewHolder(LayoutInflater.from(context).inflate(R.layout.layout_picture, parent, false)) 26 | } 27 | 28 | override fun getItemCount(): Int { 29 | return data.size 30 | } 31 | 32 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { 33 | Picasso.with(context) 34 | .load(data[position]) 35 | .error(R.drawable.ic_place) 36 | .placeholder(R.drawable.ic_place) 37 | .into(holder?.image) 38 | } 39 | 40 | 41 | class ViewHolder : RecyclerView.ViewHolder { 42 | 43 | val image: ImageView 44 | 45 | constructor(view: View) : super(view) { 46 | image = view.findViewById(R.id.imageView) 47 | } 48 | 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/kotlin/album/AlbumScrollListener.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.kotlin.album 2 | 3 | import android.support.v7.widget.RecyclerView 4 | import android.support.v7.widget.SnapHelper 5 | 6 | open class AlbumScrollListener : RecyclerView.OnScrollListener { 7 | 8 | private var helper: SnapHelper 9 | private var currentPosition = RecyclerView.NO_POSITION 10 | 11 | constructor(helper: SnapHelper) { 12 | this@AlbumScrollListener.helper = helper 13 | } 14 | 15 | override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) { 16 | super.onScrolled(recyclerView, dx, dy) 17 | 18 | val layoutManager = recyclerView?.layoutManager 19 | var position = 0 20 | layoutManager?.also { 21 | val view = helper.findSnapView(it) 22 | view?.apply { 23 | position = it.getPosition(this) 24 | } 25 | } 26 | if (position == RecyclerView.NO_POSITION) { 27 | return 28 | } 29 | if (position != currentPosition) { 30 | currentPosition = position 31 | onPageSelected(position) 32 | } 33 | } 34 | 35 | override fun onScrollStateChanged(recyclerView: RecyclerView?, newState: Int) { 36 | super.onScrollStateChanged(recyclerView, newState) 37 | if (currentPosition == RecyclerView.NO_POSITION) 38 | return 39 | if (newState == RecyclerView.SCROLL_STATE_IDLE) { 40 | onPageScrolled(currentPosition, 0f, 0) 41 | } 42 | } 43 | 44 | public fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { 45 | 46 | } 47 | 48 | open fun onPageSelected(position: Int) { 49 | 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/livedata/Article.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.livedata 2 | 3 | import android.os.Parcel 4 | import android.os.Parcelable 5 | 6 | /** 7 | * Created by mxz on 2020/5/22. 8 | */ 9 | data class Article(var title: String, var content: String, var image: String? = null) : Parcelable { 10 | constructor(parcel: Parcel) : this( 11 | parcel.readString()?:"", 12 | parcel.readString()?:"", 13 | parcel.readString()?:"") { 14 | } 15 | 16 | override fun writeToParcel(parcel: Parcel, flags: Int) { 17 | parcel.writeString(title) 18 | parcel.writeString(content) 19 | parcel.writeString(image) 20 | } 21 | 22 | override fun describeContents(): Int { 23 | return 0 24 | } 25 | 26 | companion object CREATOR : Parcelable.Creator

{ 27 | override fun createFromParcel(parcel: Parcel): Article { 28 | return Article(parcel) 29 | } 30 | 31 | override fun newArray(size: Int): Array { 32 | return arrayOfNulls(size) 33 | } 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/livedata/ArticleDetailActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.livedata 2 | 3 | import android.content.Intent 4 | import com.zhou.android.R 5 | import com.zhou.android.common.BaseActivity 6 | import com.zhou.android.common.Tools 7 | import com.zhou.android.common.text 8 | import kotlinx.android.synthetic.main.activity_article_detail.* 9 | 10 | /** 11 | * Created by mxz on 2020/5/22. 12 | */ 13 | class ArticleDetailActivity : BaseActivity() { 14 | 15 | // private lateinit var model: ArticleModel 16 | private var article: Article? = null 17 | private var pos = -1 18 | 19 | override fun setContentView() { 20 | setContentView(R.layout.activity_article_detail) 21 | } 22 | 23 | override fun addListener() { 24 | 25 | btnClean.setOnClickListener { 26 | etImage.setText("") 27 | } 28 | 29 | btnSave.setOnClickListener { 30 | 31 | Tools.hideSoftInput(this, it.windowToken) 32 | 33 | val title = etTitle.text.toString() 34 | val content = etContent.text.toString() 35 | val image = etImage.text.toString() 36 | if (title.isEmpty() && content.isEmpty() && image.isEmpty()) { 37 | article = null 38 | } else { 39 | article?.apply { 40 | this.title = title 41 | this.content = content 42 | this.image = if (image.isEmpty()) null else image 43 | } 44 | } 45 | setResult(RESULT_OK, Intent().apply { 46 | putExtra("Article", article) 47 | putExtra("index", pos) 48 | }) 49 | finish() 50 | } 51 | } 52 | 53 | override fun init() { 54 | 55 | // model = ViewModelProviders.of(this).get(ArticleModel::class.java) 56 | 57 | article = intent.getParcelableExtra
("Article") 58 | pos = intent.getIntExtra("index", -1) 59 | if (article != null) { 60 | etTitle.text = article!!.title.text() 61 | etContent.text = article!!.content.text() 62 | etImage.text = (article!!.image ?: "").text() 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/livedata/LDBusActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.livedata 2 | 3 | import android.arch.lifecycle.Observer 4 | import android.util.Log 5 | import android.view.View 6 | import android.widget.Button 7 | import com.zhou.android.R 8 | import com.zhou.android.common.BaseActivity 9 | import com.zhou.android.common.toast 10 | 11 | /** 12 | * Created by mxz on 2020/5/25. 13 | */ 14 | class LDBusActivity : BaseActivity() { 15 | override fun setContentView() { 16 | setContentView(R.layout.activity_bus) 17 | } 18 | 19 | override fun addListener() { 20 | 21 | } 22 | 23 | override fun init() { 24 | LiveEventBus.getChannel("test").observe(this, Observer { value -> 25 | Log.d("liveBus", "onChange -- $value") 26 | }) 27 | } 28 | 29 | fun onClick(view: View) { 30 | if (R.id.btn5 == view.id) { 31 | LiveEventBus.getChannel("test", String::class.java).observe(this, Observer { v -> 32 | toast(v!!) 33 | }) 34 | } else { 35 | LiveEventBus.getChannel("test").postValue((view as Button).text) 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/livedata/LiveEventBus.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.livedata 2 | 3 | /** 4 | * Created by mxz on 2020/5/25. 5 | */ 6 | object LiveEventBus { 7 | 8 | private val map = HashMap>() 9 | 10 | @Suppress("UNCHECKED_CAST") 11 | fun getChannel(target: String, clz: Class): LiveEvent { 12 | if (!map.containsKey(target)) { 13 | map[target] = LiveEvent() 14 | } 15 | return map[target]!! as LiveEvent 16 | } 17 | 18 | @Suppress("UNCHECKED_CAST") 19 | fun getChannel(target: String): LiveEvent { 20 | if (!map.containsKey(target)) { 21 | map[target] = LiveEvent() 22 | } 23 | return map[target]!! 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/FocusAnimActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import android.view.ViewGroup 4 | import android.widget.LinearLayout 5 | import com.zhou.android.R 6 | import com.zhou.android.common.BaseActivity 7 | import com.zhou.android.ui.FocusCircleView 8 | 9 | /** 10 | * Created by mxz on 2019/8/26. 11 | */ 12 | class FocusAnimActivity : BaseActivity() { 13 | 14 | override fun setContentView() { 15 | 16 | val layout = LinearLayout(this) 17 | layout.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) 18 | layout.setBackgroundColor(resources.getColor(R.color.MediumTurquoise)) 19 | 20 | val focus = FocusCircleView(this) 21 | focus.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT) 22 | 23 | layout.addView(focus) 24 | 25 | setContentView(layout) 26 | } 27 | 28 | override fun init() { 29 | } 30 | 31 | override fun addListener() { 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/FocusDrawActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import android.graphics.Bitmap 4 | import android.graphics.BitmapFactory 5 | import android.view.ViewGroup 6 | import android.widget.Button 7 | import android.widget.RelativeLayout 8 | import com.zhou.android.R 9 | import com.zhou.android.common.BaseActivity 10 | import com.zhou.android.ui.FocusDrawView 11 | import kotlinx.android.synthetic.main.layout_app.view.* 12 | 13 | /** 14 | * Created by mxz on 2019/9/3. 15 | */ 16 | class FocusDrawActivity : BaseActivity() { 17 | 18 | private lateinit var focus: FocusDrawView 19 | private lateinit var b: Bitmap 20 | 21 | override fun setContentView() { 22 | 23 | b = BitmapFactory.decodeResource(resources, R.drawable.pic_head) 24 | 25 | val layout = RelativeLayout(this).apply { 26 | layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) 27 | } 28 | focus = FocusDrawView(this) 29 | layout.addView(focus) 30 | 31 | val btn = Button(this).apply { 32 | text = "加载位图" 33 | layoutParams = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT).apply { 34 | addRule(RelativeLayout.ALIGN_PARENT_BOTTOM) 35 | addRule(RelativeLayout.CENTER_HORIZONTAL) 36 | bottomMargin = 20 37 | } 38 | setOnClickListener { 39 | focus.setBitmap(b) 40 | } 41 | } 42 | layout.addView(btn) 43 | 44 | setContentView(layout) 45 | } 46 | 47 | override fun init() { 48 | } 49 | 50 | override fun addListener() { 51 | } 52 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/ImageActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import android.graphics.Bitmap 4 | import android.net.Uri 5 | import android.os.Build 6 | import android.os.Bundle 7 | import android.support.v7.app.AppCompatActivity 8 | import android.transition.Fade 9 | import com.squareup.picasso.Picasso 10 | import com.zhou.android.R 11 | import kotlinx.android.synthetic.main.activity_image.* 12 | import java.io.File 13 | 14 | /** 15 | * Created by mxz on 2019/11/3 16 | */ 17 | class ImageActivity : AppCompatActivity() { 18 | 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | 21 | super.onCreate(savedInstanceState) 22 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 23 | window.apply { 24 | exitTransition = Fade().apply { 25 | duration = 500 26 | } 27 | allowEnterTransitionOverlap = false 28 | allowReturnTransitionOverlap = false 29 | } 30 | } 31 | 32 | setContentView(R.layout.activity_image) 33 | 34 | val file = intent.getStringExtra("image") 35 | Picasso.with(this) 36 | .load(Uri.fromFile(File(file))) 37 | .config(Bitmap.Config.RGB_565) 38 | .error(R.mipmap.ic_launcher) 39 | .into(imageView) 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/NestedBehaviorActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main; 2 | 3 | import android.support.design.widget.BottomSheetBehavior; 4 | import android.support.v7.widget.DividerItemDecoration; 5 | import android.support.v7.widget.LinearLayoutManager; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.widget.TextView; 8 | 9 | import com.zhou.android.R; 10 | import com.zhou.android.adapter.SimpleRecyclerAdapter; 11 | import com.zhou.android.common.BaseActivity; 12 | 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | /** 17 | * 使用 Behavior 来实现堆叠效果 18 | */ 19 | public class NestedBehaviorActivity extends BaseActivity { 20 | 21 | private TextView text; 22 | private RecyclerView recyclerView; 23 | 24 | private BottomSheetBehavior bottomSheetBehavior; 25 | 26 | @Override 27 | protected void setContentView() { 28 | setContentView(R.layout.activity_behavior); 29 | } 30 | 31 | @Override 32 | protected void init() { 33 | // text = findViewById(R.id.text); 34 | recyclerView = findViewById(R.id.recyclerView); 35 | 36 | recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); 37 | recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL)); 38 | List data = new ArrayList<>(); 39 | for (int i = 0; i < 30; i++) { 40 | data.add("behavior data " + i); 41 | } 42 | SimpleRecyclerAdapter simpleRecyclerAdapter = new SimpleRecyclerAdapter(this, data); 43 | recyclerView.setAdapter(simpleRecyclerAdapter); 44 | 45 | // bottomSheetBehavior = BottomSheetBehavior.from(text); 46 | // bottomSheetBehavior.setHideable(true); 47 | } 48 | 49 | @Override 50 | protected void addListener() { 51 | // findViewById(R.id.button).setOnClickListener(v -> { 52 | // if (bottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) { 53 | // bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); 54 | // } else { 55 | // bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); 56 | // } 57 | // }); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/NestedScrollActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main; 2 | 3 | import android.util.Log; 4 | import android.widget.ArrayAdapter; 5 | import android.widget.ListView; 6 | 7 | import com.zhou.android.R; 8 | import com.zhou.android.common.BaseActivity; 9 | import com.zhou.android.ui.CardStackLayout; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * 嵌套滑动测试 16 | */ 17 | public class NestedScrollActivity extends BaseActivity { 18 | 19 | private final static String TAG = "scroll"; 20 | 21 | private CardStackLayout cardStack; 22 | private ListView listView; 23 | 24 | @Override 25 | protected void setContentView() { 26 | setContentView(R.layout.activity_nestedscroll); 27 | } 28 | 29 | @Override 30 | protected void init() { 31 | 32 | cardStack = findViewById(R.id.cardStack); 33 | listView = findViewById(R.id.listView); 34 | 35 | List data = new ArrayList<>(); 36 | for (int i = 0; i < 50; i++) { 37 | data.add("simple test " + i); 38 | } 39 | ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, android.R.id.text1, data); 40 | listView.setAdapter(adapter); 41 | 42 | } 43 | 44 | @Override 45 | protected void addListener() { 46 | } 47 | 48 | @Override 49 | protected void onResume() { 50 | super.onResume(); 51 | cardStack.post(() -> { 52 | Log.d("scroll", "w h = " + cardStack.getWidth() + " , " + cardStack.getHeight()); 53 | }); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/PointZoomActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main; 2 | 3 | import android.graphics.BitmapFactory; 4 | import android.widget.ScrollView; 5 | import android.widget.TextView; 6 | import android.widget.Toast; 7 | 8 | import com.zhou.android.R; 9 | import com.zhou.android.common.BaseActivity; 10 | import com.zhou.android.ui.PointZoomView; 11 | 12 | import java.util.Locale; 13 | 14 | /** 15 | * 记录点击点及点在图片相对位置 16 | * Created by ZhOu on 2017/7/9. 17 | */ 18 | 19 | public class PointZoomActivity extends BaseActivity { 20 | 21 | PointZoomView point; 22 | ScrollView scrollView; 23 | TextView tv; 24 | 25 | @Override 26 | protected void setContentView() { 27 | setContentView(R.layout.activity_point_zoom); 28 | } 29 | 30 | @Override 31 | protected void init() { 32 | point = (PointZoomView) findViewById(R.id.point); 33 | scrollView = (ScrollView) findViewById(R.id.scrollView); 34 | tv = (TextView) findViewById(R.id.tv); 35 | } 36 | 37 | @Override 38 | protected void addListener() { 39 | point.setListener(new PointZoomView.PercentListener() { 40 | @Override 41 | public void getPercent(float x, float y) { 42 | String text = String.format(Locale.getDefault(), "x(%s): %.2f, y(%s): %.2f\n", "%", x, "%", y); 43 | tv.append(text); 44 | scrollView.fullScroll(ScrollView.FOCUS_DOWN); 45 | } 46 | 47 | @Override 48 | public void outRoom() { 49 | Toast.makeText(PointZoomActivity.this, "超出图片位置", Toast.LENGTH_SHORT).show(); 50 | } 51 | }); 52 | } 53 | 54 | @Override 55 | public void onWindowFocusChanged(boolean hasFocus) { 56 | super.onWindowFocusChanged(hasFocus); 57 | if (hasFocus) { 58 | point.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.create)); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/RippleActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import com.zhou.android.R 4 | import com.zhou.android.common.BaseActivity 5 | 6 | /** 7 | * Created by mxz on 2020/9/21. 8 | */ 9 | class RippleActivity:BaseActivity() { 10 | override fun setContentView() { 11 | setContentView(R.layout.activity_ripple) 12 | } 13 | 14 | override fun addListener() { 15 | } 16 | 17 | override fun init() { 18 | } 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/SkinActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.support.v4.view.LayoutInflaterCompat 6 | import android.support.v7.app.AppCompatActivity 7 | import android.text.Editable 8 | import android.view.MenuItem 9 | import com.zhou.android.R 10 | import com.zhou.android.skin.SkinFactory 11 | import com.zhou.android.skin.SkinManager 12 | import kotlinx.android.synthetic.main.activity_skin.* 13 | 14 | /** 15 | * 换肤 白天/黑暗 模式 16 | * Android主题换肤 无缝切换 17 | * 仓库 ThemeSkinning 18 | * Created by mxz on 2021/3/17. 19 | */ 20 | class SkinActivity : AppCompatActivity() { 21 | 22 | private val factory = SkinFactory() 23 | 24 | override fun onCreate(savedInstanceState: Bundle?) { 25 | 26 | LayoutInflaterCompat.setFactory(layoutInflater, factory) 27 | 28 | super.onCreate(savedInstanceState) 29 | setContentView(R.layout.activity_skin) 30 | 31 | supportActionBar?.title = javaClass.simpleName.replace("Activity", "") 32 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 33 | 34 | btnSwitch.setOnClickListener { 35 | 36 | SkinManager.switchMode(!SkinManager.isDayMode()) 37 | 38 | val text = "tv 颜色显示更换 [${if (SkinManager.isDayMode()) "白天" else "夜晚"}]" 39 | tvMode.text = Editable.Factory.getInstance().newEditable(text) 40 | } 41 | 42 | btnOpen.setOnClickListener { 43 | startActivity(Intent(this, SkinPageActivity::class.java)) 44 | } 45 | 46 | btnExternal.setOnClickListener { 47 | startActivity(Intent(this, SkinExternalResActivity::class.java)) 48 | } 49 | } 50 | 51 | override fun onResume() { 52 | super.onResume() 53 | val text = "tv 颜色显示更换 [${if (SkinManager.isDayMode()) "白天" else "夜晚"}]" 54 | tvMode.text = Editable.Factory.getInstance().newEditable(text) 55 | } 56 | 57 | override fun onDestroy() { 58 | factory.destroy() 59 | super.onDestroy() 60 | } 61 | 62 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 63 | if (item.itemId == android.R.id.home) { 64 | finish() 65 | return true 66 | } 67 | return super.onOptionsItemSelected(item) 68 | } 69 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/SkinPageActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.support.v4.view.LayoutInflaterCompat 6 | import android.support.v7.app.AppCompatActivity 7 | import android.text.Editable 8 | import android.view.MenuItem 9 | import com.zhou.android.R 10 | import com.zhou.android.skin.SkinFactory 11 | import com.zhou.android.skin.SkinManager 12 | import kotlinx.android.synthetic.main.activity_skin_page.* 13 | 14 | /** 15 | * Created by mxz on 2021/3/18. 16 | */ 17 | class SkinPageActivity : AppCompatActivity() { 18 | 19 | private val skinFactory = SkinFactory() 20 | 21 | override fun onCreate(savedInstanceState: Bundle?) { 22 | LayoutInflaterCompat.setFactory(layoutInflater, skinFactory) 23 | 24 | super.onCreate(savedInstanceState) 25 | setContentView(R.layout.activity_skin_page) 26 | 27 | supportActionBar?.title = javaClass.simpleName.replace("Activity", "") 28 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 29 | 30 | btnSwitch.setOnClickListener { 31 | SkinManager.switchMode(!SkinManager.isDayMode()) 32 | 33 | val tt = if (SkinManager.isDayMode()) "白天" else "夜晚" 34 | tvMode.text = Editable.Factory.getInstance().newEditable(tt) 35 | } 36 | btnList.setOnClickListener { 37 | startActivity(Intent(this, SkinListActivity::class.java)) 38 | } 39 | } 40 | 41 | override fun onResume() { 42 | super.onResume() 43 | val t = if (SkinManager.isDayMode()) "白天" else "夜晚" 44 | tvMode.text = Editable.Factory.getInstance().newEditable(t) 45 | } 46 | 47 | override fun onDestroy() { 48 | skinFactory.destroy() 49 | super.onDestroy() 50 | } 51 | 52 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 53 | if (item.itemId == android.R.id.home) { 54 | finish() 55 | return true 56 | } 57 | return super.onOptionsItemSelected(item) 58 | } 59 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/SlideMenuActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main 2 | 3 | import com.zhou.android.R 4 | import com.zhou.android.common.BaseActivity 5 | import com.zhou.android.common.editable 6 | import kotlinx.android.synthetic.main.activity_slide_menu.* 7 | 8 | /** 9 | * 滑动显示更多菜单练习 10 | * 项目使用,建议 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.3.0' 11 | * Created by mxz on 2020/10/15. 12 | */ 13 | class SlideMenuActivity : BaseActivity() { 14 | 15 | override fun setContentView() { 16 | setContentView(R.layout.activity_slide_menu) 17 | } 18 | 19 | override fun addListener() { 20 | 21 | //---------------------------------------------- 22 | tv3.setOnClickListener { 23 | tvLog.text = "cover 左滑模式".editable() 24 | } 25 | btn6.setOnClickListener { 26 | tvLog.text = "置顶 cover".editable() 27 | } 28 | btn7.setOnClickListener { 29 | tvLog.text = "删除 cover".editable() 30 | } 31 | 32 | //---------------------------------------------- 33 | tv4.setOnClickListener { 34 | tvLog.text = "cover 右滑模式".editable() 35 | } 36 | btn8.setOnClickListener { 37 | tvLog.text = "取消置顶".editable() 38 | } 39 | btn9.setOnClickListener { 40 | tvLog.text = "清空".editable() 41 | } 42 | //---------------------------------------------- 43 | tv5.setOnClickListener { 44 | tvLog.text = "expand 左滑模式".editable() 45 | } 46 | btn10.setOnClickListener { 47 | tvLog.text = "expand 打开".editable() 48 | } 49 | btn11.setOnClickListener { 50 | tvLog.text = "expand 关闭".editable() 51 | } 52 | //---------------------------------------------- 53 | tv6.setOnClickListener { 54 | tvLog.text = "expand 右滑模式".editable() 55 | } 56 | btn12.setOnClickListener { 57 | tvLog.text = "右滑打开".editable() 58 | } 59 | btn13.setOnClickListener { 60 | tvLog.text = "右滑关闭".editable() 61 | } 62 | } 63 | 64 | override fun init() { 65 | 66 | // ViewDragHelper 67 | } 68 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/SurfaceActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main; 2 | 3 | import com.zhou.android.R; 4 | import com.zhou.android.common.BaseActivity; 5 | 6 | /** 7 | * 8 | * Created by ZhOu on 2017/2/8. 9 | */ 10 | 11 | public class SurfaceActivity extends BaseActivity { 12 | 13 | @Override 14 | protected void setContentView() { 15 | setContentView(R.layout.activity_surface); 16 | } 17 | 18 | @Override 19 | protected void init() { 20 | 21 | } 22 | 23 | @Override 24 | protected void addListener() { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/UdpSend.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main; 2 | 3 | import java.io.IOException; 4 | import java.net.DatagramPacket; 5 | import java.net.DatagramSocket; 6 | import java.net.InetAddress; 7 | 8 | /** 9 | * udp 发送端 10 | * Created by ZhOu on 2018/5/22. 11 | */ 12 | 13 | public class UdpSend { 14 | 15 | // private static DatagramSocket sendSocket; 16 | 17 | private static int count = 0; 18 | 19 | public static void main(String[] args) { 20 | new Send().start(); 21 | } 22 | 23 | /** 24 | * 广播域 { 25 | * 26 | * @link https://blog.csdn.net/qq_26075861/article/details/78361363 27 | *

28 | * 255.255.255.255是受限广播地址 29 | */ 30 | private static class Send extends Thread { 31 | @Override 32 | public void run() { 33 | do { 34 | try { 35 | DatagramSocket sendSocket = new DatagramSocket(); 36 | String msg = "Message from udp:" + String.valueOf((char) ('A' + count)); 37 | byte[] buf = msg.getBytes(); 38 | DatagramPacket packet = new DatagramPacket(buf, 0, buf.length, InetAddress.getByName("192.168.0.255"), 2000); 39 | sendSocket.setBroadcast(true); 40 | sendSocket.send(packet); 41 | sendSocket.close(); 42 | System.out.println(msg); 43 | count++; 44 | if (count > 30) { 45 | count = -1; 46 | } 47 | Thread.sleep(2000); 48 | } catch (IOException | InterruptedException e) { 49 | e.printStackTrace(); 50 | System.out.println("Error exit"); 51 | break; 52 | } 53 | } while (true); 54 | 55 | System.exit(0); 56 | 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/main/VideoActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.main; 2 | 3 | import android.media.MediaPlayer; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.os.Environment; 7 | import android.support.annotation.Nullable; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.Window; 10 | import android.view.WindowManager; 11 | import android.widget.VideoView; 12 | 13 | import com.zhou.android.R; 14 | import com.zhou.android.common.BaseActivity; 15 | 16 | import java.io.File; 17 | 18 | /** 19 | * Created by ZhOu on 2018/4/18. 20 | */ 21 | 22 | public class VideoActivity extends BaseActivity { 23 | 24 | private VideoView videoView; 25 | private boolean stop = false; 26 | 27 | @Override 28 | protected void setContentView() { 29 | setContentView(R.layout.activity_video); 30 | } 31 | 32 | @Override 33 | protected void init() { 34 | videoView = (VideoView) findViewById(R.id.videoView); 35 | 36 | String path = Environment.getExternalStorageDirectory() + "/Pictures/test.mp4"; 37 | File file = new File(path); 38 | if (!file.exists()) { 39 | path = "android.resource://" + getPackageName() + "/" + R.raw.test_2; 40 | } 41 | videoView.setVideoURI(Uri.parse(path)); 42 | videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { 43 | @Override 44 | public void onPrepared(MediaPlayer mp) { 45 | mp.setVolume(0f, 0f); 46 | } 47 | }); 48 | videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 49 | @Override 50 | public void onCompletion(MediaPlayer mp) { 51 | if (stop) return; 52 | videoView.start(); 53 | } 54 | }); 55 | videoView.start(); 56 | 57 | } 58 | 59 | @Override 60 | protected void addListener() { 61 | 62 | } 63 | 64 | @Override 65 | public void back() { 66 | if (videoView != null) { 67 | stop = true; 68 | try { 69 | videoView.stopPlayback(); 70 | videoView = null; 71 | } catch (Exception e) { 72 | e.printStackTrace(); 73 | } 74 | } 75 | super.back(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/model/view/IOkHttpView.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.model.view; 2 | 3 | import okhttp3.Response; 4 | 5 | /** 6 | * Created by ZhOu on 2018/4/19. 7 | */ 8 | 9 | public interface IOkHttpView { 10 | void showResponse(Response response); 11 | 12 | void showResponse(String response); 13 | 14 | void updateProgress(long progress); 15 | 16 | void showToast(String message); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/model/view/IPictureView.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.model.view; 2 | 3 | import android.widget.ImageView; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by ZhOu on 2018/4/14. 9 | */ 10 | 11 | public interface IPictureView { 12 | 13 | void requestPermission(); 14 | 15 | void onShow(List pictures); 16 | 17 | void showToast(String message); 18 | 19 | boolean getCache(); 20 | 21 | boolean getDisk(); 22 | 23 | boolean getTransformation(); 24 | 25 | ImageView getTarget(); 26 | 27 | void clearImageView(); 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/model/view/IWeatherView.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.model.view; 2 | 3 | /** 4 | * Created by ZhOu on 2018/7/23. 5 | */ 6 | 7 | public interface IWeatherView { 8 | 9 | void setLocation(String address); 10 | 11 | String getLocation(); 12 | 13 | void setWeather(String data); 14 | 15 | void showRequestWindow(); 16 | 17 | void hideRequestWindow(); 18 | 19 | void toast(String msg); 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/net/Callback.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.net; 2 | 3 | import org.json.JSONObject; 4 | 5 | public interface Callback { 6 | boolean handleMessage(JSONObject json); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/net/Constant.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.net; 2 | 3 | public class Constant { 4 | 5 | public final static String SEARCH = "search"; 6 | public final static String CONNECT = "connect"; 7 | public final static String SEND = "send"; 8 | public final static String CLOSE = "close"; 9 | 10 | //request {cmd:xx,packageId:1,content:{} } 11 | //response {cmd:xx,code:xx,packageId:1,content:{xxx,result:xxx},reason:xxx } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/net/LocalNetwork.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.net; 2 | 3 | import android.content.Context; 4 | import android.net.wifi.WifiManager; 5 | import android.support.annotation.Nullable; 6 | import android.text.format.Formatter; 7 | 8 | import org.json.JSONObject; 9 | 10 | public class LocalNetwork { 11 | 12 | private static LocalNetwork instance = null; 13 | private BaseNetwork baseNetwork; 14 | 15 | private LocalNetwork(BaseNetwork network) { 16 | instance = this; 17 | this.baseNetwork = network; 18 | } 19 | 20 | public static LocalNetwork getInstance() { 21 | if (instance == null) { 22 | throw new NullPointerException("LocalNetwork is null,you must call createServer or createClient before you use this."); 23 | } 24 | return instance; 25 | } 26 | 27 | /** 28 | * 服务端:发给所有建立连接的客户端 29 | *
30 | * 客户端:发给唯一服务端 31 | */ 32 | public void send(JSONObject json, @Nullable Callback callback) { 33 | baseNetwork.send(json, callback); 34 | } 35 | 36 | /** 37 | * 销毁 38 | */ 39 | public void destroy() { 40 | baseNetwork.destroy(); 41 | } 42 | 43 | /** 44 | * 创建服务端 45 | * 46 | * @param context 上下文 47 | * @param handler 处理来自客户端的请求 48 | * @return LocalNetwork 49 | */ 50 | public static LocalNetwork createServer(Context context, ServerHandler handler) { 51 | ServerNetwork network = new ServerNetwork(handler); 52 | WifiManager wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE); 53 | String address = Formatter.formatIpAddress(wifi.getConnectionInfo().getIpAddress()); 54 | network.setSelfIp(address); 55 | return new LocalNetwork(network); 56 | } 57 | 58 | /** 59 | * 创建客户端 60 | * 61 | * @param context 上下文 62 | * @param callback 用于处理服务端的回复 63 | * @return LocalNetwork 64 | */ 65 | public static LocalNetwork createClient(Context context, Callback callback) { 66 | ClientNetwork network = new ClientNetwork(callback); 67 | WifiManager wifi = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE); 68 | String address = Formatter.formatIpAddress(wifi.getConnectionInfo().getIpAddress()); 69 | network.setSelfIp(address); 70 | return new LocalNetwork(network); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/net/Packet.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.net; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class Packet { 7 | public JSONObject json; 8 | public Callback callback; 9 | 10 | public Packet(int packageId, JSONObject json, final Callback callback) { 11 | this.json = json; 12 | this.callback = callback; 13 | try { 14 | this.json.put("packageId", packageId); 15 | } catch (JSONException e) { 16 | // 17 | } 18 | } 19 | 20 | public byte[] getBytes() { 21 | return json.toString().getBytes(); 22 | } 23 | 24 | public String getContent() { 25 | return json.toString(); 26 | } 27 | 28 | public JSONObject getRequest() { 29 | 30 | try { 31 | return new JSONObject(json.toString()); 32 | } catch (JSONException e) { 33 | // 34 | } 35 | return new JSONObject(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/net/ResponseCode.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.net; 2 | 3 | public class ResponseCode { 4 | public final static int SUCCESS = 200; 5 | public final static int ERROR = 201; 6 | public final static int EXCEPTION = 202; 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/net/ServerHandler.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.net; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public interface ServerHandler { 7 | JSONObject handleRequest(JSONObject json) throws JSONException; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/provider/KidWidgetProvider.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.provider 2 | 3 | import android.app.PendingIntent 4 | import android.appwidget.AppWidgetManager 5 | import android.appwidget.AppWidgetProvider 6 | import android.content.Context 7 | import android.content.Intent 8 | import android.widget.RemoteViews 9 | import com.zhou.android.MainActivity 10 | import com.zhou.android.R 11 | import java.text.SimpleDateFormat 12 | import java.util.* 13 | 14 | /** 15 | * Created by zhou on 2021/7/20. 16 | */ 17 | class KidWidgetProvider : AppWidgetProvider() { 18 | 19 | private val dateFormat = SimpleDateFormat("HH:mm", Locale.getDefault()) 20 | 21 | override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { 22 | appWidgetIds.forEach { id -> 23 | 24 | val pendingIntent = Intent(context, MainActivity::class.java).let { 25 | PendingIntent.getActivity(context, 0, it, 0) 26 | } 27 | val view = RemoteViews(context.packageName, R.layout.layout_kid_widget_provider).apply { 28 | setOnClickPendingIntent(R.id.layout, pendingIntent) 29 | setTextViewText(R.id.tvContent, dateFormat.format(Date())) 30 | } 31 | 32 | appWidgetManager.updateAppWidget(id, view) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/retrofit/Blog.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.retrofit; 2 | 3 | public class Blog { 4 | public long id; 5 | public String title; 6 | public String content; 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/retrofit/BlogServer.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.retrofit; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | import org.json.JSONObject; 6 | 7 | import retrofit2.Call; 8 | import retrofit2.http.Body; 9 | import retrofit2.http.DELETE; 10 | import retrofit2.http.GET; 11 | import retrofit2.http.POST; 12 | import retrofit2.http.PUT; 13 | import retrofit2.http.Path; 14 | import retrofit2.http.Query; 15 | import retrofit2.http.QueryMap; 16 | 17 | /** 18 | * Blog 接口 19 | * Created by ZhOu on 2017/10/8. 20 | */ 21 | 22 | public interface BlogServer { 23 | 24 | @GET("query") 25 | Call> getBlog(@Query("id") String id); 26 | 27 | @POST("create") 28 | Call> createBlog(@Body Blog blog); 29 | 30 | @PUT("update") 31 | Call> updateBlog(@Query("id")String id,@Body Blog blog); 32 | 33 | @DELETE("delete") 34 | Call> deleteBlog(@Query("id") String id); 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/retrofit/CustomConverterFactory.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.retrofit; 2 | 3 | import java.lang.annotation.Annotation; 4 | import java.lang.reflect.Type; 5 | 6 | import okhttp3.RequestBody; 7 | import okhttp3.ResponseBody; 8 | import retrofit2.Converter; 9 | import retrofit2.Retrofit; 10 | 11 | /** 12 | * Created by ZhOu on 2018/4/25. 13 | */ 14 | 15 | public class CustomConverterFactory extends Converter.Factory { 16 | 17 | @Override 18 | public Converter requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) { 19 | return new CustomRequestConverter(); 20 | } 21 | 22 | @Override 23 | public Converter responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { 24 | return super.responseBodyConverter(type, annotations, retrofit); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/retrofit/CustomRequestConverter.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.retrofit; 2 | 3 | import java.io.IOException; 4 | import java.io.OutputStreamWriter; 5 | import java.io.Writer; 6 | import java.nio.charset.Charset; 7 | 8 | import okhttp3.MediaType; 9 | import okhttp3.RequestBody; 10 | import okio.Buffer; 11 | 12 | /** 13 | * Created by ZhOu on 2018/4/25. 14 | */ 15 | 16 | public class CustomRequestConverter implements retrofit2.Converter { 17 | 18 | private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8"); 19 | private static final Charset UTF_8 = Charset.forName("UTF-8"); 20 | 21 | CustomRequestConverter(){ 22 | 23 | } 24 | 25 | @Override 26 | public RequestBody convert(String value) throws IOException { 27 | Buffer buffer = new Buffer(); 28 | Writer writer = new OutputStreamWriter(buffer.outputStream(), UTF_8); 29 | writer.write(value); 30 | writer.close(); 31 | return RequestBody.create(MEDIA_TYPE, buffer.readByteString()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/retrofit/CustomResponseConverter.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.retrofit; 2 | 3 | import java.io.IOException; 4 | 5 | import okhttp3.ResponseBody; 6 | import retrofit2.Converter; 7 | 8 | /** 9 | * Created by ZhOu on 2018/4/25. 10 | */ 11 | 12 | public class CustomResponseConverter implements Converter { 13 | 14 | @Override 15 | public String convert(ResponseBody value) throws IOException { 16 | return value.toString(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/retrofit/Result.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.retrofit; 2 | 3 | /** 4 | * Created by ZhOu on 2017/10/8. 5 | */ 6 | 7 | public class Result { 8 | public int code = -1; 9 | public String msg = ""; 10 | public T result = null; 11 | 12 | public String toString() { 13 | return "[ code = " + code + " , msg = " + msg + " , result = " 14 | + (result == null ? "null" : result.toString()) + " ]"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/share/ShareActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.share; 2 | 3 | import android.content.Intent; 4 | import android.support.v4.app.ActivityCompat; 5 | import android.support.v4.app.ActivityOptionsCompat; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | 9 | import com.zhou.android.R; 10 | import com.zhou.android.common.BaseActivity; 11 | 12 | /** 13 | * Created by ZhOu on 2018/7/30. 14 | */ 15 | 16 | public class ShareActivity extends BaseActivity { 17 | 18 | private ImageView cover; 19 | 20 | @Override 21 | protected void setContentView() { 22 | setContentView(R.layout.activity_share); 23 | } 24 | 25 | @Override 26 | protected void init() { 27 | cover = (ImageView) findViewById(R.id.cover); 28 | } 29 | 30 | @Override 31 | protected void addListener() { 32 | findViewById(R.id.ll_view).setOnClickListener(new View.OnClickListener() { 33 | @Override 34 | public void onClick(View v) { 35 | ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(ShareActivity.this, 36 | cover, getString(R.string.cover)); 37 | ActivityCompat.startActivity(ShareActivity.this, 38 | new Intent(ShareActivity.this, ShareListActivity.class), 39 | optionsCompat.toBundle()); 40 | } 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/share/ShareListActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.share; 2 | 3 | import com.zhou.android.R; 4 | import com.zhou.android.common.BaseActivity; 5 | 6 | /** 7 | * Created by ZhOu on 2018/7/30. 8 | */ 9 | 10 | public class ShareListActivity extends BaseActivity { 11 | 12 | @Override 13 | protected void setContentView() { 14 | setContentView(R.layout.activity_share_list); 15 | } 16 | 17 | @Override 18 | protected void init() { 19 | 20 | } 21 | 22 | @Override 23 | protected void addListener() { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/skin/AttrFactory.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.skin 2 | 3 | import android.view.View 4 | 5 | /** 6 | * Created by mxz on 2021/3/18. 7 | */ 8 | fun getSkinAttr(view: View, attrName: String, id: Int, entryName: String, typeName: String): SkinAttr? { 9 | return when (attrName) { 10 | "background" -> BackgroundSkinAttr(view, attrName, id, entryName, typeName) 11 | "textColor" -> TextColorSkinAttr(view, attrName, id, entryName, typeName) 12 | else -> null 13 | } 14 | } 15 | 16 | private val supportAttrArray = arrayOf("background", "textColor") 17 | fun isSupport(attrName: String) = supportAttrArray.contains(attrName) -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/skin/SkinAttr.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.skin 2 | 3 | /** 4 | * Created by mxz on 2021/3/17. 5 | */ 6 | abstract class SkinAttr { 7 | 8 | abstract fun apply() 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/skin/SkinBean.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.skin 2 | 3 | import android.view.View 4 | import android.widget.Button 5 | import android.widget.TextView 6 | import java.util.* 7 | 8 | /** 9 | * Created by mxz on 2021/3/17. 10 | */ 11 | class SkinItem(private val data: List) : Observer { 12 | 13 | override fun update(o: Observable?, arg: Any?) { 14 | apply() 15 | } 16 | 17 | fun apply() { 18 | for (attr in data) { 19 | attr.apply() 20 | } 21 | } 22 | 23 | } 24 | 25 | class BackgroundSkinAttr(val view: View, val attrName: String, val id: Int, val entryName: String, val typeName: String) : SkinAttr() { 26 | override fun apply() { 27 | when (typeName) { 28 | "color" -> view.setBackgroundColor(SkinManager.getColor(entryName)) 29 | "drawable" -> view.setBackgroundResource(SkinManager.getDrawableRes(entryName)) 30 | } 31 | } 32 | } 33 | 34 | class TextColorSkinAttr(val view: View, val attrName: String, val id: Int, val entryName: String, val typeName: String) : SkinAttr() { 35 | override fun apply() { 36 | if (view is Button || view is TextView) { 37 | (view as TextView).setTextColor(SkinManager.getColor(entryName)) 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/skin/SkinManager.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.skin 2 | 3 | import android.graphics.drawable.Drawable 4 | import android.support.annotation.ColorInt 5 | import com.zhou.android.R 6 | import com.zhou.android.ZApplication 7 | import java.util.* 8 | 9 | /** 10 | * Created by mxz on 2021/3/17. 11 | */ 12 | object SkinManager : Observable() { 13 | 14 | private val resource = ZApplication.context.resources 15 | 16 | private val daySkin = mapOf( 17 | "shape_button" to R.drawable.shape_button_day, 18 | "text_color" to R.color.text_color_day, 19 | "button_color" to R.color.button_color_day, 20 | "page_color" to R.color.page_color_day, 21 | "shape_linear" to R.drawable.shape_linear_day, 22 | "shape_skin_item" to R.drawable.shape_skin_item_day) 23 | 24 | private val nightSkin = mapOf( 25 | "shape_button" to R.drawable.shape_button_night, 26 | "text_color" to R.color.text_color_night, 27 | "button_color" to R.color.button_color_night, 28 | "page_color" to R.color.page_color_night, 29 | "shape_linear" to R.drawable.shape_linear_night, 30 | "shape_skin_item" to R.drawable.shape_skin_item_night) 31 | 32 | private var map = daySkin 33 | 34 | fun isDayMode() = map === daySkin 35 | 36 | fun switchMode() = switchMode(!isDayMode()) 37 | 38 | fun switchMode(dayMode: Boolean = true) { 39 | map = if (dayMode) daySkin else nightSkin 40 | 41 | setChanged() 42 | notifyObservers() 43 | } 44 | 45 | //资源名称 46 | fun getDrawable(entryName: String): Drawable { 47 | val id = map[entryName] ?: R.drawable.shape_button_day 48 | return resource.getDrawable(id) 49 | } 50 | 51 | //资源名称 52 | fun getDrawableRes(entryName: String): Int { 53 | val name = entryName.substring(0, entryName.lastIndexOf("_")) 54 | return map[name] ?: R.drawable.shape_button_day 55 | } 56 | 57 | //属性名称 58 | @ColorInt 59 | fun getColor(entryName: String): Int { 60 | val name = entryName.substring(0, entryName.lastIndexOf("_")) 61 | val id = map[name] ?: R.color.text_color_day 62 | return resource.getColor(id) 63 | } 64 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ui/AutoFixTextureView.kt: -------------------------------------------------------------------------------- 1 | package com.zhou.android.ui 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import android.view.TextureView 6 | 7 | /** 8 | * Created by mxz on 2019/11/1. 9 | */ 10 | class AutoFixTextureView : TextureView { 11 | 12 | private var mRatioWidth = 0 13 | private var mRatioHeight = 0 14 | 15 | @JvmOverloads 16 | constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) : super(context, attrs, defStyle) 17 | 18 | fun setAspectRatio(width: Int, height: Int) { 19 | if (width < 0 || height < 0) { 20 | throw IllegalArgumentException("Size cannot be negative.") 21 | } 22 | mRatioWidth = width 23 | mRatioHeight = height 24 | 25 | requestLayout() 26 | } 27 | 28 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { 29 | super.onMeasure(widthMeasureSpec, heightMeasureSpec) 30 | val width = MeasureSpec.getSize(widthMeasureSpec) 31 | val height = MeasureSpec.getSize(heightMeasureSpec) 32 | 33 | if (0 == mRatioWidth || 0 == mRatioHeight) { 34 | setMeasuredDimension(width, height) 35 | } else { 36 | if (width < height * mRatioWidth / mRatioHeight) { 37 | setMeasuredDimension(width, width * mRatioHeight / mRatioWidth) 38 | } else { 39 | setMeasuredDimension(height * mRatioWidth / mRatioHeight, height) 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ui/CardNestedLayout.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.ui; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.NestedScrollingParent; 5 | import android.util.AttributeSet; 6 | import android.view.ViewGroup; 7 | 8 | public class CardNestedLayout extends ViewGroup implements NestedScrollingParent { 9 | 10 | public CardNestedLayout(Context context) { 11 | this(context, null); 12 | } 13 | 14 | public CardNestedLayout(Context context, AttributeSet attrs) { 15 | this(context, attrs, 0); 16 | } 17 | 18 | public CardNestedLayout(Context context, AttributeSet attrs, int defStyleAttr) { 19 | super(context, attrs, defStyleAttr); 20 | } 21 | 22 | @Override 23 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ui/DividerItemDecoration.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.ui; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.View; 8 | 9 | import com.zhou.android.common.Tools; 10 | 11 | /** 12 | * 分割线 13 | * Created by ZhOu on 2017/10/31. 14 | */ 15 | 16 | public class DividerItemDecoration extends RecyclerView.ItemDecoration { 17 | 18 | private Paint paint; 19 | 20 | public DividerItemDecoration(Context context) { 21 | paint = new Paint(); 22 | paint.setStyle(Paint.Style.FILL); 23 | paint.setAntiAlias(true); 24 | paint.setColor(0xffffffff); 25 | paint.setStrokeWidth(Tools.dip2px(context, 4)); 26 | } 27 | 28 | public void setColor(int color) { 29 | paint.setColor(color); 30 | } 31 | 32 | public void setStrokeWidth(int width) { 33 | paint.setStrokeWidth(width); 34 | } 35 | 36 | @Override 37 | public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { 38 | super.onDrawOver(c, parent, state); 39 | drawVertical(c, parent); 40 | drawHorizontal(c, parent); 41 | } 42 | 43 | public void drawVertical(Canvas c, RecyclerView parent) { 44 | int childCount = parent.getChildCount(); 45 | for (int i = 0; i < childCount; i++) { 46 | View view = parent.getChildAt(i); 47 | RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) view.getLayoutParams(); 48 | int top = view.getTop() - lp.topMargin; 49 | int bottom = view.getBottom() + lp.topMargin + lp.bottomMargin; 50 | int x = view.getRight() + lp.rightMargin; 51 | c.drawLine(x, top, x, bottom, paint); 52 | } 53 | } 54 | 55 | public void drawHorizontal(Canvas c, RecyclerView parent) { 56 | 57 | int childCount = parent.getChildCount(); 58 | for (int i = 0; i < childCount; i++) { 59 | View view = parent.getChildAt(i); 60 | RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) view.getLayoutParams(); 61 | int left = view.getLeft() - lp.leftMargin; 62 | int right = view.getRight() + lp.rightMargin; 63 | int y = view.getBottom() + lp.topMargin + lp.bottomMargin / 2; 64 | c.drawLine(left, y, right, y, paint); 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ui/FloatView.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.ui; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.view.MotionEvent; 7 | import android.view.View; 8 | 9 | import com.zhou.android.R; 10 | import com.zhou.android.common.Tools; 11 | 12 | /** 13 | * 悬浮球 14 | * Created by ZhOu on 2017/3/23. 15 | */ 16 | 17 | public class FloatView extends View { 18 | 19 | private Context context; 20 | private int size = 50; 21 | private Paint paint, whitePaint; 22 | 23 | public FloatView(Context context) { 24 | super(context); 25 | this.context = context; 26 | size = Tools.dip2px(context, size); 27 | paint = new Paint(); 28 | paint.setStyle(Paint.Style.FILL); 29 | paint.setAntiAlias(true); 30 | paint.setColor(getResources().getColor(R.color.colorPrimary)); 31 | whitePaint = new Paint(); 32 | whitePaint.setStyle(Paint.Style.STROKE); 33 | whitePaint.setStrokeWidth(5); 34 | whitePaint.setAntiAlias(true); 35 | whitePaint.setColor(getResources().getColor(R.color.white)); 36 | } 37 | 38 | @Override 39 | protected void onDraw(Canvas canvas) { 40 | canvas.drawCircle(size / 2, size / 2, size / 2, paint); 41 | canvas.drawCircle(size / 2, size / 2, size / 2 - 10, whitePaint); 42 | } 43 | 44 | @Override 45 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 46 | setMeasuredDimension(size, size); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ui/NestedListView.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.ui; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.ListView; 6 | 7 | public class NestedListView extends ListView { 8 | 9 | public NestedListView(Context context) { 10 | this(context, null); 11 | } 12 | 13 | public NestedListView(Context context, AttributeSet attrs) { 14 | this(context, attrs, 0); 15 | } 16 | 17 | public NestedListView(Context context, AttributeSet attrs, int defStyleAttr) { 18 | super(context, attrs, defStyleAttr); 19 | } 20 | 21 | @Override 22 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 23 | int mExpandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 24 | super.onMeasure(widthMeasureSpec, mExpandSpec); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhou/android/ui/SquaredImageView.java: -------------------------------------------------------------------------------- 1 | package com.zhou.android.ui; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | import android.widget.ImageView; 7 | 8 | /** 9 | * 正方形图片 10 | * Created by ZhOu on 2017/8/6. 11 | */ 12 | 13 | public class SquaredImageView extends ImageView { 14 | public SquaredImageView(Context context) { 15 | super(context); 16 | } 17 | 18 | public SquaredImageView(Context context, @Nullable AttributeSet attrs) { 19 | super(context, attrs); 20 | } 21 | 22 | public SquaredImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 23 | super(context, attrs, defStyleAttr); 24 | } 25 | 26 | @Override 27 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 28 | int width = MeasureSpec.getSize(widthMeasureSpec); 29 | setMeasuredDimension(width, width); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libindoor.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/jniLibs/armeabi/libindoor.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/liblocSDK7b.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/jniLibs/armeabi/liblocSDK7b.so -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_bottom_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_bottom_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/color/bg_tab_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_folder.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_friend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_friend.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_link.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_open.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_place.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_place.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_smile.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_video_record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_video_record.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_viewgroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_viewgroup.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_wx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/ic_wx.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/icon_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/pic_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-hdpi/pic_head.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/bg_welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/bg_welcome.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/cover.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/create.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_block_tab_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_block_tab_checked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_block_tab_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_block_tab_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_chat_left.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_chat_left.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_chat_right.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_chat_right.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_failed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_focus.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/ic_like.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_wifi_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/pic_wifi_00.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_wifi_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/pic_wifi_01.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_wifi_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiaozhou1234/AndroidDemo/1ac1fb02463856a47fd71b9925f8212693b84926/app/src/main/res/drawable-xhdpi/pic_wifi_02.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_block_tab.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_camera_record.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_camera_shot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_gray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_round_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_status.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_griditem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_round_kid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_button_day.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_button_night.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_divider_v.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_linear_day.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_linear_night.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_rectangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_round_black.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_round_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_round_rect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_skin_item_day.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_skin_item_night.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_skin_uni.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/wifi_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/accc.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 20 | 21 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_app_size.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |