├── .gitignore ├── .idea └── encodings.xml ├── FlycoTabLayout_Lib ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── flyco │ │ └── tablayout │ │ ├── CommonTabLayout.java │ │ ├── SegmentTabLayout.java │ │ ├── SlidingTabLayout.java │ │ ├── SlidingTabLayout2.java │ │ ├── bens │ │ └── TabEntity.java │ │ ├── listener │ │ ├── CustomTabEntity.java │ │ └── OnTabSelectListener.java │ │ ├── utils │ │ ├── FragmentChangeManager.java │ │ └── UnreadMsgUtils.java │ │ └── widget │ │ └── MsgView.java │ └── res │ ├── layout │ ├── layout_tab.xml │ ├── layout_tab_bottom.xml │ ├── layout_tab_left.xml │ ├── layout_tab_right.xml │ ├── layout_tab_segment.xml │ └── layout_tab_top.xml │ └── values │ ├── attrs.xml │ └── color.xml ├── LICENSE ├── README.md ├── appinfo ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── yumu │ │ └── appinfo │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── yumu │ │ │ └── appinfo │ │ │ ├── activity │ │ │ ├── BaseActivity.java │ │ │ ├── CameraKitActivity.java │ │ │ ├── GalleryActivity.java │ │ │ ├── GetAppInfoActivity.java │ │ │ ├── LocationTaskActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MyAlbumActivity.java │ │ │ ├── PopViewAnimActivity.java │ │ │ └── TestBehaviorActivity.java │ │ │ ├── adapter │ │ │ ├── AppInfoAdapter.java │ │ │ ├── CirculationViewAdapter.java │ │ │ ├── MenuAdapter.java │ │ │ └── MyAlbumAdapter.java │ │ │ ├── bean │ │ │ ├── APPInfo.java │ │ │ ├── Album.java │ │ │ └── MainMenu.java │ │ │ ├── card_tantan │ │ │ ├── CardActivity.java │ │ │ ├── GalleryActivity.java │ │ │ ├── SwipeCardActivity.java │ │ │ ├── TanTanAvatarActivity.java │ │ │ ├── TanTanCardActivity.java │ │ │ └── ZuiMeiCardActivity.java │ │ │ ├── dialog │ │ │ └── RedPacketDialog.java │ │ │ ├── fragment │ │ │ ├── BaseFragment.java │ │ │ ├── DiscoveryFragment.java │ │ │ ├── DiscoveryTabFragment.java │ │ │ ├── EmptyFragment.java │ │ │ ├── HomeFragment.java │ │ │ ├── HomeTabFragment.java │ │ │ ├── MailboxFragment.java │ │ │ ├── NewHomeFragment.java │ │ │ └── PersonFragment.java │ │ │ ├── imageutil │ │ │ ├── BlurTransformation.java │ │ │ ├── FastBlur.java │ │ │ └── ImageLoaderManager.java │ │ │ ├── layoutmanager │ │ │ ├── AvatarLayoutManager.java │ │ │ ├── BaseLoopGallery.java │ │ │ ├── CardConfig.java │ │ │ ├── GalleryLayoutManager.java │ │ │ ├── OnSwipeListener.java │ │ │ ├── OverLayCardLayoutManager.java │ │ │ ├── RenRenCallback.java │ │ │ ├── ScaleCardLayoutManager.java │ │ │ └── TanTanCallback.java │ │ │ ├── tantan_card │ │ │ ├── CardConfig.java │ │ │ ├── CardItemTouchHelperCallback.java │ │ │ ├── CardLayoutManager.java │ │ │ └── OnSwipeListener.java │ │ │ ├── transform │ │ │ ├── AccordionTransformer.java │ │ │ ├── BaseOverlayPageAdapter.java │ │ │ ├── BaseTransformer.java │ │ │ ├── CardOverlayAdapter.java │ │ │ ├── DepthPageTransformer.java │ │ │ ├── OverlayTransformer.java │ │ │ ├── OverlayTransformerLan2.java │ │ │ ├── PageTransformerFactory.java │ │ │ ├── RotateUpTransformer.java │ │ │ ├── ScaleInTransformer.java │ │ │ ├── StackPageTransformer.java │ │ │ ├── StackTransformer.java │ │ │ ├── TransformerStyle.java │ │ │ └── ValueInterpolator.java │ │ │ ├── utils │ │ │ ├── BaseConstans.java │ │ │ ├── DeviceHelper.java │ │ │ ├── DisplayHelper.java │ │ │ ├── GlideEngine.java │ │ │ ├── MD5.java │ │ │ ├── PictureSelectUtil.java │ │ │ ├── StatusBarHelper.java │ │ │ └── Utils.java │ │ │ └── views │ │ │ ├── AnimDialogView.java │ │ │ ├── CustomLinerLayoutManager.java │ │ │ ├── CustomerCallback.java │ │ │ ├── DraggableFrameLayout.java │ │ │ ├── IView.java │ │ │ ├── LuckyDrawCardItemView.java │ │ │ ├── LuckyDrawView.java │ │ │ ├── MyHtmlTagHandler.java │ │ │ ├── NoScrollViewPager.java │ │ │ ├── NumberAnimTextView.java │ │ │ ├── RoundImageView.java │ │ │ ├── SyFloatView.java │ │ │ ├── ViewPager2Adapter.java │ │ │ └── ViewPagerAdapter.java │ └── res │ │ ├── anim │ │ ├── bottom_dialog_enter.xml │ │ ├── bottom_dialog_exit.xml │ │ ├── scale_anim.xml │ │ └── top_dialog_enter.xml │ │ ├── drawable │ │ ├── draw_launch.xml │ │ ├── ic_android_black_24dp.xml │ │ ├── ic_camera.xml │ │ ├── ic_facing.xml │ │ ├── ic_facing_back.xml │ │ ├── ic_facing_front.xml │ │ ├── ic_flash_auto.xml │ │ ├── ic_flash_off.xml │ │ ├── ic_flash_on.xml │ │ ├── ic_flash_torch.xml │ │ ├── ic_gallery.xml │ │ ├── ic_info.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_photo.xml │ │ ├── ic_preview.xml │ │ ├── ic_settings.xml │ │ ├── item_card_border.xml │ │ ├── item_card_border_parent.xml │ │ ├── launch_bg.xml │ │ ├── logomark_light.xml │ │ ├── shape_age.xml │ │ ├── shape_constellation.xml │ │ ├── tab_bg_with_shadow.xml │ │ ├── tab_discovery.xml │ │ ├── tab_home.xml │ │ ├── tab_mailbox.xml │ │ ├── tab_person.xml │ │ ├── tab_title_color.xml │ │ └── video_button.xml │ │ ├── layout │ │ ├── activity_aplash.xml │ │ ├── activity_camerakit.xml │ │ ├── activity_card.xml │ │ ├── activity_get_app_info.xml │ │ ├── activity_main.xml │ │ ├── activity_person_new.xml │ │ ├── activity_pop_view_anim.xml │ │ ├── activity_test_behavior.xml │ │ ├── activity_vertical.xml │ │ ├── content_vertical.xml │ │ ├── dialog_share_qr_code_layout.xml │ │ ├── fragment_discovery.xml │ │ ├── fragment_empty.xml │ │ ├── fragment_holder.xml │ │ ├── fragment_home.xml │ │ ├── fragment_home_new.xml │ │ ├── fragment_mailbox.xml │ │ ├── fragment_tab.xml │ │ ├── item.xml │ │ ├── item_adapter_tab.xml │ │ ├── item_appinfo.xml │ │ ├── item_mailbox_item_view.xml │ │ ├── item_menu_adapter.xml │ │ ├── item_user_detail_tab.xml │ │ ├── item_viewpager_image.xml │ │ ├── layout_my_album_adapter.xml │ │ ├── my_album_activity.xml │ │ ├── simple_location_activity.xml │ │ ├── sy_floating_view.xml │ │ ├── uc_item_main_image_header.xml │ │ ├── view_lucky_draw.xml │ │ └── view_lucky_draw_card_item.xml │ │ ├── menu │ │ └── main.xml │ │ ├── mipmap-xhdpi │ │ ├── btn_normal.png │ │ ├── btn_pressed.png │ │ ├── bubble0.png │ │ ├── bubble1.png │ │ ├── icon_add.png │ │ ├── icon_album_add.png │ │ ├── icon_back_bg.png │ │ ├── icon_def_avatar.png │ │ ├── icon_delete_image.png │ │ ├── icon_diamond.png │ │ ├── icon_discovery_normal.png │ │ ├── icon_discovery_select.png │ │ ├── icon_home_normal.png │ │ ├── icon_home_select.png │ │ ├── icon_mailbox_normal.png │ │ ├── icon_mailbox_select.png │ │ ├── icon_main_menu.png │ │ ├── icon_open_red_packet.png │ │ ├── icon_person_normal.png │ │ ├── icon_person_select.png │ │ ├── icon_picture_video_play.png │ │ ├── icon_questionmark.png │ │ ├── icon_red_packet_bg.png │ │ ├── icon_red_packet_open_bg.png │ │ ├── img_avatar_01.jpg │ │ ├── img_avatar_02.jpg │ │ ├── img_avatar_03.png │ │ ├── img_avatar_04.jpg │ │ ├── img_avatar_05.jpg │ │ ├── img_avatar_06.jpg │ │ ├── img_avatar_07.jpg │ │ ├── img_card_background.9.png │ │ ├── img_dislike.png │ │ ├── img_like.png │ │ └── luckybg.jpg │ │ ├── mipmap-xxhdpi │ │ ├── bg_launcher.jpg │ │ ├── bg_launcher_bottom_icon.png │ │ ├── bg_launcher_name.png │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── file_paths.xml │ └── test │ └── java │ └── com │ └── yumu │ └── appinfo │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── appinfos.gif ├── appinfos_scroll.gif ├── appinfos_scroll_tab.gif ├── prize.gif └── scroll.gif ├── indicatorlib ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── example │ │ └── indicatorlib │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── indicatorlib │ │ │ ├── base │ │ │ └── BaseFragmentAdapter.java │ │ │ ├── utils │ │ │ └── Utils.java │ │ │ └── views │ │ │ ├── IndicatorManager.java │ │ │ ├── PageIndicatorView.java │ │ │ ├── TabLayout.java │ │ │ ├── TabView.java │ │ │ ├── animation │ │ │ ├── AnimationManager.java │ │ │ ├── controller │ │ │ │ ├── AnimationController.java │ │ │ │ └── ValueController.java │ │ │ ├── data │ │ │ │ ├── AnimationValue.java │ │ │ │ ├── Value.java │ │ │ │ └── type │ │ │ │ │ ├── ColorAnimationValue.java │ │ │ │ │ ├── DropAnimationValue.java │ │ │ │ │ ├── FillAnimationValue.java │ │ │ │ │ ├── ScaleAnimationValue.java │ │ │ │ │ ├── SlideAnimationValue.java │ │ │ │ │ ├── SwapAnimationValue.java │ │ │ │ │ ├── ThinWormAnimationValue.java │ │ │ │ │ └── WormAnimationValue.java │ │ │ └── type │ │ │ │ ├── AnimationType.java │ │ │ │ ├── BaseAnimation.java │ │ │ │ ├── ColorAnimation.java │ │ │ │ ├── DropAnimation.java │ │ │ │ ├── FillAnimation.java │ │ │ │ ├── ScaleAnimation.java │ │ │ │ ├── ScaleDownAnimation.java │ │ │ │ ├── SlideAnimation.java │ │ │ │ ├── SwapAnimation.java │ │ │ │ ├── ThinWormAnimation.java │ │ │ │ └── WormAnimation.java │ │ │ ├── draw │ │ │ ├── DrawManager.java │ │ │ ├── controller │ │ │ │ ├── AttributeController.java │ │ │ │ ├── DrawController.java │ │ │ │ └── MeasureController.java │ │ │ ├── data │ │ │ │ ├── Indicator.java │ │ │ │ ├── Orientation.java │ │ │ │ ├── PositionSavedState.java │ │ │ │ └── RtlMode.java │ │ │ └── drawer │ │ │ │ ├── Drawer.java │ │ │ │ └── type │ │ │ │ ├── BaseDrawer.java │ │ │ │ ├── BasicDrawer.java │ │ │ │ ├── ColorDrawer.java │ │ │ │ ├── DropDrawer.java │ │ │ │ ├── FillDrawer.java │ │ │ │ ├── ScaleDownDrawer.java │ │ │ │ ├── ScaleDrawer.java │ │ │ │ ├── SlideDrawer.java │ │ │ │ ├── SwapDrawer.java │ │ │ │ ├── ThinWormDrawer.java │ │ │ │ └── WormDrawer.java │ │ │ └── utils │ │ │ ├── CoordinatesUtils.java │ │ │ ├── DensityUtils.java │ │ │ └── IdUtils.java │ └── res │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── example │ └── indicatorlib │ └── ExampleUnitTest.java ├── jks ├── appinfo.jks └── 密码.txt ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── aohanyao │ │ └── transformer │ │ └── library │ │ └── conf │ │ ├── CardPageTransformer.java │ │ ├── OnPageTransformerListener.java │ │ └── PageTransformerConfig.java │ └── res │ └── values │ └── strings.xml ├── settings.gradle └── simplelocation ├── .DS_Store ├── build.gradle ├── proguard-rules.pro └── src ├── .DS_Store └── main ├── AndroidManifest.xml ├── java └── com │ └── mjzuo │ └── location │ ├── GeocodingManager.java │ ├── ReverseGeocodingManager.java │ ├── bean │ ├── Latlng.java │ └── ParseLocation.java │ ├── constant │ ├── Constant.java │ ├── ResponseConstant.java │ └── UrlConstant.java │ ├── helper │ ├── ConverHelper.java │ ├── GeReFactory.java │ └── Helper.java │ ├── location │ ├── BsGeocoding.java │ ├── GoogleGeocoding.java │ ├── IGeocoding.java │ └── OpenCellidGeocoding.java │ ├── net │ ├── NetUtil.java │ └── StreamUtil.java │ ├── regelocation │ ├── BaiduGeRe.java │ ├── GaodeGeRe.java │ ├── GoogleRege.java │ ├── IReGe.java │ └── TencentGeRe.java │ └── util │ ├── CommonUtil.java │ └── LogUtil.java └── res └── values └── strings.xml /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | *.DS_Store 7 | 8 | # Files for the ART/Dalvik VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | *.idea 14 | 15 | # Generated files 16 | bin/ 17 | gen/ 18 | out/ 19 | # Uncomment the following line in case you need and you don't have the release build type files in your app 20 | # release/ 21 | 22 | # Gradle files 23 | .gradle/ 24 | build/ 25 | 26 | # Local configuration file (sdk path, etc) 27 | local.properties 28 | 29 | # Proguard folder generated by Eclipse 30 | proguard/ 31 | 32 | # Log Files 33 | *.log 34 | 35 | # Android Studio Navigation editor temp files 36 | .navigation/ 37 | 38 | # Android Studio captures folder 39 | captures/ 40 | 41 | # IntelliJ 42 | *.iml 43 | .idea/workspace.xml 44 | .idea/tasks.xml 45 | .idea/gradle.xml 46 | .idea/assetWizardSettings.xml 47 | .idea/dictionaries 48 | .idea/libraries 49 | # Android Studio 3 in .gitignore file. 50 | .idea/caches 51 | .idea/modules.xml 52 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 53 | .idea/navEditor.xml 54 | 55 | # Keystore files 56 | # Uncomment the following lines if you do not want to check your keystore files in. 57 | #*.jks 58 | #*.keystore 59 | 60 | # External native build folder generated in Android Studio 2.2 and later 61 | .externalNativeBuild 62 | .cxx/ 63 | 64 | # Google Services (e.g. APIs or Firebase) 65 | # google-services.json 66 | 67 | # Freeline 68 | freeline.py 69 | freeline/ 70 | freeline_project_description.json 71 | 72 | # fastlane 73 | fastlane/report.xml 74 | fastlane/Preview.html 75 | fastlane/screenshots 76 | fastlane/test_output 77 | fastlane/readme.md 78 | 79 | # Version control 80 | vcs.xml 81 | 82 | # lint 83 | lint/intermediates/ 84 | lint/generated/ 85 | lint/outputs/ 86 | lint/tmp/ 87 | # lint/reports/ 88 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | // 这个version是区分library版本的,因此当我们需要更新library时记得修改这个version 4 | version = "2.0.8" 5 | android { 6 | compileSdkVersion 29 7 | buildToolsVersion "29.0.0" 8 | defaultConfig { 9 | minSdkVersion 15 10 | targetSdkVersion 29 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | 22 | lintOptions { 23 | abortOnError false 24 | } 25 | 26 | } 27 | 28 | dependencies { 29 | implementation fileTree(dir: 'libs', include: ['*.jar']) 30 | implementation 'androidx.appcompat:appcompat:1.1.0' 31 | api 'androidx.viewpager2:viewpager2:1.0.0' 32 | 33 | } 34 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/lihui/work/AndroidStudio/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 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/bens/TabEntity.java: -------------------------------------------------------------------------------- 1 | package com.flyco.tablayout.bens; 2 | 3 | import com.flyco.tablayout.listener.CustomTabEntity; 4 | 5 | public class TabEntity implements CustomTabEntity { 6 | public String title; 7 | public String type; 8 | public int selectedIcon; 9 | public int unSelectedIcon; 10 | 11 | public TabEntity(String title) { 12 | this.title = title; 13 | } 14 | 15 | public TabEntity(String title, String type) { 16 | this.title = title; 17 | this.type = type; 18 | } 19 | 20 | public TabEntity(String title, int selectedIcon, int unSelectedIcon) { 21 | this.title = title; 22 | this.selectedIcon = selectedIcon; 23 | this.unSelectedIcon = unSelectedIcon; 24 | } 25 | 26 | @Override 27 | public String getTabTitle() { 28 | return title; 29 | } 30 | 31 | @Override 32 | public int getTabSelectedIcon() { 33 | return selectedIcon; 34 | } 35 | 36 | @Override 37 | public int getTabUnselectedIcon() { 38 | return unSelectedIcon; 39 | } 40 | 41 | public String getType() { 42 | return type; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/listener/CustomTabEntity.java: -------------------------------------------------------------------------------- 1 | package com.flyco.tablayout.listener; 2 | 3 | import androidx.annotation.DrawableRes; 4 | 5 | public interface CustomTabEntity { 6 | String getTabTitle(); 7 | 8 | @DrawableRes 9 | int getTabSelectedIcon(); 10 | 11 | @DrawableRes 12 | int getTabUnselectedIcon(); 13 | } -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/listener/OnTabSelectListener.java: -------------------------------------------------------------------------------- 1 | package com.flyco.tablayout.listener; 2 | 3 | public interface OnTabSelectListener { 4 | void onTabSelect(int position); 5 | void onTabReselect(int position); 6 | } -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/utils/FragmentChangeManager.java: -------------------------------------------------------------------------------- 1 | package com.flyco.tablayout.utils; 2 | 3 | import androidx.fragment.app.Fragment; 4 | import androidx.fragment.app.FragmentManager; 5 | import androidx.fragment.app.FragmentTransaction; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class FragmentChangeManager { 10 | private FragmentManager mFragmentManager; 11 | private int mContainerViewId; 12 | /** Fragment切换数组 */ 13 | private ArrayList mFragments; 14 | /** 当前选中的Tab */ 15 | private int mCurrentTab; 16 | 17 | public FragmentChangeManager(FragmentManager fm, int containerViewId, ArrayList fragments) { 18 | this.mFragmentManager = fm; 19 | this.mContainerViewId = containerViewId; 20 | this.mFragments = fragments; 21 | initFragments(); 22 | } 23 | 24 | /** 初始化fragments */ 25 | private void initFragments() { 26 | for (Fragment fragment : mFragments) { 27 | mFragmentManager.beginTransaction().add(mContainerViewId, fragment).hide(fragment).commit(); 28 | } 29 | 30 | setFragments(0); 31 | } 32 | 33 | /** 界面切换控制 */ 34 | public void setFragments(int index) { 35 | for (int i = 0; i < mFragments.size(); i++) { 36 | FragmentTransaction ft = mFragmentManager.beginTransaction(); 37 | Fragment fragment = mFragments.get(i); 38 | if (i == index) { 39 | ft.show(fragment); 40 | } else { 41 | ft.hide(fragment); 42 | } 43 | ft.commit(); 44 | } 45 | mCurrentTab = index; 46 | } 47 | 48 | public int getCurrentTab() { 49 | return mCurrentTab; 50 | } 51 | 52 | public Fragment getCurrentFragment() { 53 | return mFragments.get(mCurrentTab); 54 | } 55 | } -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/java/com/flyco/tablayout/utils/UnreadMsgUtils.java: -------------------------------------------------------------------------------- 1 | package com.flyco.tablayout.utils; 2 | 3 | 4 | import android.util.DisplayMetrics; 5 | import android.view.View; 6 | import android.widget.RelativeLayout; 7 | 8 | import com.flyco.tablayout.widget.MsgView; 9 | 10 | /** 11 | * 未读消息提示View,显示小红点或者带有数字的红点: 12 | * 数字一位,圆 13 | * 数字两位,圆角矩形,圆角是高度的一半 14 | * 数字超过两位,显示99+ 15 | */ 16 | public class UnreadMsgUtils { 17 | public static void show(MsgView msgView, int num) { 18 | if (msgView == null) { 19 | return; 20 | } 21 | RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) msgView.getLayoutParams(); 22 | DisplayMetrics dm = msgView.getResources().getDisplayMetrics(); 23 | msgView.setVisibility(View.VISIBLE); 24 | if (num <= 0) {//圆点,设置默认宽高 25 | msgView.setStrokeWidth(0); 26 | msgView.setText(""); 27 | 28 | lp.width = (int) (10 * dm.density); 29 | lp.height = (int) (10 * dm.density); 30 | msgView.setLayoutParams(lp); 31 | } else { 32 | lp.height = (int) (18 * dm.density); 33 | if (num > 0 && num < 10) {//圆 34 | lp.width = (int) (18 * dm.density); 35 | msgView.setText(num + ""); 36 | } else if (num > 9 && num < 100) {//圆角矩形,圆角是高度的一半,设置默认padding 37 | lp.width = RelativeLayout.LayoutParams.WRAP_CONTENT; 38 | msgView.setPadding((int) (6 * dm.density), 0, (int) (6 * dm.density), 0); 39 | msgView.setText(num + ""); 40 | } else {//数字超过两位,显示99+ 41 | lp.width = RelativeLayout.LayoutParams.WRAP_CONTENT; 42 | msgView.setPadding((int) (6 * dm.density), 0, (int) (6 * dm.density), 0); 43 | msgView.setText("99+"); 44 | } 45 | msgView.setLayoutParams(lp); 46 | } 47 | } 48 | 49 | public static void setSize(MsgView rtv, int size) { 50 | if (rtv == null) { 51 | return; 52 | } 53 | RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) rtv.getLayoutParams(); 54 | lp.width = size; 55 | lp.height = size; 56 | rtv.setLayoutParams(lp); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/layout/layout_tab.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 31 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/layout/layout_tab_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 27 | 28 | 29 | 30 | 44 | 45 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/layout/layout_tab_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 21 | 22 | 27 | 28 | 29 | 43 | 44 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/layout/layout_tab_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 27 | 28 | 29 | 30 | 44 | 45 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/layout/layout_tab_segment.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 38 | 39 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/layout/layout_tab_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 21 | 22 | 27 | 28 | 29 | 43 | -------------------------------------------------------------------------------- /FlycoTabLayout_Lib/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FD481F 4 | -------------------------------------------------------------------------------- /appinfo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /appinfo/src/androidTest/java/com/yumu/appinfo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getTargetContext(); 24 | 25 | assertEquals("com.yumu.myapplication", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/activity/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.activity; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import com.yumu.appinfo.views.SyFloatView; 6 | 7 | /** 8 | * @author sunan 9 | * @date 2023/3/17 10:36 10 | */ 11 | public class BaseActivity extends AppCompatActivity { 12 | @Override 13 | protected void onResume() { 14 | super.onResume(); 15 | SyFloatView.getInstance(this).bind(this); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/activity/PopViewAnimActivity.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.activity; 2 | 3 | import android.os.Bundle; 4 | import android.view.Gravity; 5 | import android.view.View; 6 | import android.widget.FrameLayout; 7 | import android.widget.ImageView; 8 | 9 | 10 | import com.yumu.appinfo.R; 11 | import com.yumu.appinfo.views.AnimDialogView; 12 | 13 | /** 14 | * Date : 2020-03-28. 15 | * Time : 15:39. 16 | * Created by sunan. 17 | */ 18 | public class PopViewAnimActivity extends BaseActivity { 19 | private ImageView tv_btn; 20 | private AnimDialogView pop_view; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_pop_view_anim); 26 | pop_view = findViewById(R.id.pop_view); 27 | tv_btn = findViewById(R.id.tv_btn); 28 | tv_btn.setOnClickListener(onClickListener); 29 | } 30 | 31 | private boolean isexplan; 32 | 33 | View.OnClickListener onClickListener = new View.OnClickListener() { 34 | @Override 35 | public void onClick(View v) { 36 | if (pop_view.findViewById(R.id.imageView) == null) { 37 | ImageView imageView = new ImageView(getApplicationContext()); 38 | imageView.setId(R.id.imageView); 39 | imageView.setBackgroundColor(R.color.colorAccent); 40 | // imageView.setScaleType(ImageView.ScaleType.FIT_XY); 41 | FrameLayout.LayoutParams layoutParam = new FrameLayout.LayoutParams(700, 900); 42 | layoutParam.gravity = Gravity.CENTER; 43 | imageView.setImageResource(R.mipmap.bg_launcher_bottom_icon); 44 | pop_view.addView(imageView, layoutParam); 45 | } 46 | 47 | pop_view.getParent().requestLayout(); 48 | pop_view.requestLayout(); 49 | 50 | if (isexplan) { 51 | pop_view.endAnimation(v); 52 | } else { 53 | pop_view.startAnimation(v); 54 | } 55 | isexplan = !isexplan; 56 | } 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/adapter/CirculationViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | 9 | import androidx.annotation.NonNull; 10 | import androidx.recyclerview.widget.RecyclerView; 11 | 12 | import com.yumu.appinfo.R; 13 | 14 | /** 15 | * Date : 2020-03-28. 16 | * Time : 15:39. 17 | * Created by sunan. 18 | */ 19 | public class CirculationViewAdapter extends RecyclerView.Adapter { 20 | private Context context; 21 | private CardViewAdapterCallback callback; 22 | private int type; 23 | 24 | public CirculationViewAdapter(Context context, int type) { 25 | this.context = context; 26 | this.type = type; 27 | } 28 | 29 | public interface CardViewAdapterCallback { 30 | void onItemClick(int position); 31 | } 32 | 33 | public void setCallback(CardViewAdapterCallback callback) { 34 | this.callback = callback; 35 | } 36 | 37 | @NonNull 38 | @Override 39 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 40 | View view = LayoutInflater.from(context).inflate(R.layout.item_mailbox_item_view, parent, false); 41 | return new ViewHolder(view); 42 | } 43 | 44 | 45 | @Override 46 | public void onBindViewHolder(@NonNull final CirculationViewAdapter.ViewHolder holder, int position) { 47 | 48 | } 49 | 50 | 51 | @Override 52 | public int getItemCount() { 53 | if (type == 1 || type == 2) { 54 | return 15; 55 | } 56 | return Integer.MAX_VALUE; 57 | } 58 | 59 | 60 | public class ViewHolder extends RecyclerView.ViewHolder { 61 | 62 | private ImageView iv_front; 63 | 64 | public ViewHolder(View view) { 65 | super(view); 66 | iv_front = view.findViewById(R.id.iv_front); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/bean/Album.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author ansen 7 | * @create time 2019/1/2 8 | */ 9 | public class Album implements Serializable { 10 | private String id;// 11 | private String type;//image/video 12 | private int status = -1;//0/1/2 待审核/审核成功/失败 13 | private String file_url;//原图,大图 14 | private String preview_url;//预览图 15 | private boolean selected;//是否选择 16 | private long duration; 17 | private String videoUrl;//视频播放Url 18 | 19 | public Album() { 20 | 21 | } 22 | 23 | public Album(String previewUrl) { 24 | this.preview_url = previewUrl; 25 | } 26 | 27 | public boolean isVideo() { 28 | if (type.equals("video")) { 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | public boolean isImage() { 35 | if (type.equals("image")) { 36 | return true; 37 | } 38 | return false; 39 | } 40 | 41 | public String getId() { 42 | return id; 43 | } 44 | 45 | public void setId(String id) { 46 | this.id = id; 47 | } 48 | 49 | public String getType() { 50 | return type; 51 | } 52 | 53 | public void setType(String type) { 54 | this.type = type; 55 | } 56 | 57 | public int getStatus() { 58 | return status; 59 | } 60 | 61 | public void setStatus(int status) { 62 | this.status = status; 63 | } 64 | 65 | public String getFile_url() { 66 | return file_url; 67 | } 68 | 69 | public void setFile_url(String file_url) { 70 | this.file_url = file_url; 71 | } 72 | 73 | public String getPreview_url() { 74 | return preview_url; 75 | } 76 | 77 | public void setPreview_url(String preview_url) { 78 | this.preview_url = preview_url; 79 | } 80 | 81 | public boolean isSelected() { 82 | return selected; 83 | } 84 | 85 | public void setSelected(boolean selected) { 86 | this.selected = selected; 87 | } 88 | 89 | public String getVideoUrl() { 90 | return videoUrl; 91 | } 92 | 93 | public void setVideoUrl(String videoUrl) { 94 | this.videoUrl = videoUrl; 95 | } 96 | 97 | public long getDuration() { 98 | return duration; 99 | } 100 | 101 | public void setDuration(long duration) { 102 | this.duration = duration; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/bean/MainMenu.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.bean; 2 | 3 | /** 4 | * @author sunan 5 | * @date 2023/2/20 11:45 6 | */ 7 | public class MainMenu { 8 | private String title; 9 | private int res_id; 10 | private String type; 11 | private String description; 12 | 13 | 14 | public MainMenu() { 15 | 16 | } 17 | 18 | public MainMenu(String title, int res_id, String type) { 19 | this.res_id = res_id; 20 | this.title = title; 21 | this.type = type; 22 | } 23 | 24 | public MainMenu(String title, int res_id, String type, String description) { 25 | this.res_id = res_id; 26 | this.title = title; 27 | this.type = type; 28 | this.description = description; 29 | } 30 | 31 | public MainMenu(String title, String type) { 32 | this.title = title; 33 | this.type = type; 34 | } 35 | 36 | public String getTitle() { 37 | return title; 38 | } 39 | 40 | public void setTitle(String title) { 41 | this.title = title; 42 | } 43 | 44 | public int getRes_id() { 45 | return res_id; 46 | } 47 | 48 | public void setRes_id(int res_id) { 49 | this.res_id = res_id; 50 | } 51 | 52 | public String getType() { 53 | return type; 54 | } 55 | 56 | public void setType(String type) { 57 | this.type = type; 58 | } 59 | 60 | public String getDescription() { 61 | return description; 62 | } 63 | 64 | public void setDescription(String description) { 65 | this.description = description; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/card_tantan/GalleryActivity.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.card_tantan; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | 9 | import androidx.appcompat.app.AppCompatActivity; 10 | import androidx.recyclerview.widget.ItemTouchHelper; 11 | import androidx.recyclerview.widget.LinearSnapHelper; 12 | import androidx.recyclerview.widget.RecyclerView; 13 | import androidx.recyclerview.widget.SnapHelper; 14 | 15 | import com.mcxtzhang.commonadapter.rv.ViewHolder; 16 | import com.yumu.appinfo.R; 17 | import com.yumu.appinfo.layoutmanager.BaseLoopGallery; 18 | import com.yumu.appinfo.layoutmanager.CardConfig; 19 | import com.yumu.appinfo.layoutmanager.GalleryLayoutManager; 20 | import com.yumu.appinfo.layoutmanager.OverLayCardLayoutManager; 21 | import com.yumu.appinfo.layoutmanager.RenRenCallback; 22 | 23 | import java.util.ArrayList; 24 | import java.util.List; 25 | 26 | /** 27 | * Date : 2023-02-15. 28 | * Time : 11:39. 29 | * Created by sunan. 30 | * 画廊效果 31 | */ 32 | public class GalleryActivity extends AppCompatActivity { 33 | 34 | private List list = new ArrayList<>(); 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.activity_card); 40 | initData(); 41 | initView(); 42 | } 43 | 44 | private void initView() { 45 | BaseLoopGallery alyLoopGallery = (BaseLoopGallery) findViewById(R.id.alyLoopGallery); 46 | alyLoopGallery.setDatasAndLayoutId(initData(), R.layout.uc_item_main_image_header, new BaseLoopGallery.BindDataListener() { 47 | @Override 48 | public void onBindData(ViewHolder holder, Integer res) { 49 | ImageView imageView = holder.getView(R.id.image); 50 | imageView.setImageResource(res); 51 | } 52 | }); 53 | } 54 | 55 | private List initData() { 56 | list.add(R.mipmap.img_avatar_01); 57 | list.add(R.mipmap.img_avatar_02); 58 | list.add(R.mipmap.img_avatar_03); 59 | list.add(R.mipmap.img_avatar_04); 60 | list.add(R.mipmap.img_avatar_05); 61 | list.add(R.mipmap.img_avatar_06); 62 | list.add(R.mipmap.img_avatar_07); 63 | return list; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/fragment/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.fragment; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import androidx.annotation.Nullable; 10 | import androidx.fragment.app.Fragment; 11 | import androidx.localbroadcastmanager.content.LocalBroadcastManager; 12 | import androidx.viewpager.widget.ViewPager; 13 | 14 | import com.flyco.tablayout.SlidingTabLayout; 15 | import com.flyco.tablayout.listener.OnTabSelectListener; 16 | import com.yumu.appinfo.R; 17 | import com.yumu.appinfo.views.ViewPagerAdapter; 18 | 19 | 20 | /** 21 | * Date : 2020-03-28. 22 | * Time : 15:39. 23 | * Created by sunan. 24 | */ 25 | public class BaseFragment extends Fragment { 26 | 27 | public void sendBroadcast(boolean isShow) { 28 | Intent intent = new Intent(); 29 | intent.setAction("action.list.action"); 30 | if (android.os.Build.VERSION.SDK_INT >= 12) { 31 | intent.setFlags(32);//3.1以后的版本需要设置Intent.FLAG_INCLUDE_STOPPED_PACKAGES 32 | } 33 | intent.putExtra("isShow", isShow); 34 | LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getActivity()); 35 | lbm.sendBroadcast(intent); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/fragment/DiscoveryTabFragment.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.TextView; 8 | import androidx.annotation.Nullable; 9 | import androidx.recyclerview.widget.GridLayoutManager; 10 | import androidx.recyclerview.widget.RecyclerView; 11 | 12 | import com.yumu.appinfo.R; 13 | 14 | /** 15 | * Date : 2020-03-28. 16 | * Time : 15:39. 17 | * Created by sunan. 18 | */ 19 | public class DiscoveryTabFragment extends BaseFragment { 20 | private RecyclerView recyclerView; 21 | 22 | @Nullable 23 | @Override 24 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, 25 | @Nullable Bundle savedInstanceState) { 26 | View v = View.inflate(getContext(), R.layout.fragment_tab, null); 27 | recyclerView = (RecyclerView) v.findViewById(R.id.recyclerView); 28 | recyclerView.setAdapter(new Adapter()); 29 | recyclerView.setLayoutManager(new GridLayoutManager(getContext(),2)); 30 | return v; 31 | } 32 | 33 | @Override 34 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 35 | super.onViewCreated(view, savedInstanceState); 36 | } 37 | 38 | class Adapter extends RecyclerView.Adapter { 39 | 40 | @Override 41 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 42 | return new ViewHolder(View.inflate(parent.getContext(), R.layout.item_adapter_tab, null)); 43 | } 44 | 45 | @Override 46 | public void onBindViewHolder(ViewHolder holder, int position) { 47 | holder.textView.setText("第" + position + "个"); 48 | } 49 | 50 | @Override 51 | public int getItemCount() { 52 | return 100; 53 | } 54 | 55 | class ViewHolder extends RecyclerView.ViewHolder { 56 | TextView textView; 57 | 58 | public ViewHolder(View itemView) { 59 | super(itemView); 60 | textView = (TextView) itemView.findViewById(R.id.text); 61 | } 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/fragment/EmptyFragment.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.TextView; 8 | 9 | import androidx.annotation.NonNull; 10 | import androidx.annotation.Nullable; 11 | import androidx.recyclerview.widget.GridLayoutManager; 12 | import androidx.recyclerview.widget.RecyclerView; 13 | 14 | import com.yumu.appinfo.R; 15 | 16 | /** 17 | * Date : 2020-03-28. 18 | * Time : 15:39. 19 | * Created by sunan. 20 | */ 21 | public class EmptyFragment extends BaseFragment { 22 | 23 | private String tile; 24 | 25 | public EmptyFragment() { 26 | } 27 | 28 | public static EmptyFragment getInstance(String title) { 29 | EmptyFragment emptyFragment = new EmptyFragment(); 30 | Bundle bundle = new Bundle(); 31 | bundle.putString("params", title); 32 | emptyFragment.setArguments(bundle); 33 | return emptyFragment; 34 | } 35 | 36 | 37 | @Nullable 38 | @Override 39 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 40 | View v = View.inflate(getContext(), R.layout.fragment_empty, null); 41 | return v; 42 | } 43 | 44 | @Override 45 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { 46 | super.onViewCreated(view, savedInstanceState); 47 | tile = getArguments().getString("params"); 48 | TextView tv_title = view.findViewById(R.id.tv_title); 49 | tv_title.setText(tile); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/layoutmanager/AvatarLayoutManager.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.layoutmanager; 2 | 3 | import android.view.View; 4 | 5 | import androidx.recyclerview.widget.RecyclerView; 6 | 7 | /** 8 | * @author sunan 9 | * @date 2023/2/15 10:24 10 | */ 11 | public class AvatarLayoutManager extends RecyclerView.LayoutManager { 12 | @Override 13 | public RecyclerView.LayoutParams generateDefaultLayoutParams() { 14 | return new RecyclerView.LayoutParams(RecyclerView.LayoutParams.WRAP_CONTENT, RecyclerView.LayoutParams.WRAP_CONTENT); 15 | } 16 | 17 | @Override 18 | public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { 19 | if (getChildCount() > 0) { 20 | detachAndScrapAttachedViews(recycler); 21 | } 22 | int itemCount = getItemCount(); 23 | if (itemCount < 6) return; 24 | 25 | int width = getWidth(); 26 | int gap = width / 3; 27 | 28 | int left = 0, top = 0; 29 | for (int i = 0; i < 6; i++) { 30 | View view = recycler.getViewForPosition(i); 31 | addView(view); 32 | measureChildWithMargins(view, 0, 0); 33 | if (i == 0) { 34 | layoutDecoratedWithMargins(view, left, top, left + gap * 2, top + gap * 2); 35 | left += gap * 2; 36 | 37 | } else { 38 | layoutDecoratedWithMargins(view, left, top, left + gap, top + gap); 39 | if (i > 0 && i < 3) { 40 | top += gap; 41 | } else { 42 | left -= gap; 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/layoutmanager/CardConfig.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.layoutmanager; 2 | 3 | import android.content.Context; 4 | import android.util.TypedValue; 5 | 6 | /** 7 | * @author sunan 8 | * @date 2023/2/15 10:31 9 | */ 10 | public class CardConfig { 11 | //屏幕上最多同时显示几个Item 12 | public static int MAX_SHOW_COUNT; 13 | 14 | //每一级Scale相差0.05f,translationY相差7dp左右 15 | public static float SCALE_GAP; 16 | public static int TRANS_Y_GAP; 17 | 18 | public static void initConfig(Context context) { 19 | MAX_SHOW_COUNT = 4; 20 | SCALE_GAP = 0.05f; 21 | TRANS_Y_GAP = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 15, context.getResources().getDisplayMetrics()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/layoutmanager/OnSwipeListener.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.layoutmanager; 2 | 3 | 4 | import androidx.recyclerview.widget.RecyclerView; 5 | 6 | /** 7 | * @author 8 | */ 9 | 10 | public interface OnSwipeListener { 11 | 12 | /** 13 | * 卡片还在滑动时回调 14 | * 15 | * @param viewHolder 该滑动卡片的viewHolder 16 | * @param ratio 滑动进度的比例 17 | * @param direction 卡片滑动的方向,CardConfig.SWIPING_LEFT 为向左滑,CardConfig.SWIPING_RIGHT 为向右滑, 18 | * CardConfig.SWIPING_NONE 为不偏左也不偏右 19 | */ 20 | default void onSwiping(RecyclerView.ViewHolder viewHolder, float ratio, int direction) { 21 | } 22 | 23 | /** 24 | * 卡片完全滑出时回调 25 | * 26 | * @param viewHolder 该滑出卡片的viewHolder 27 | * @param t 该滑出卡片的数据 28 | * @param direction 卡片滑出的方向,CardConfig.SWIPED_LEFT 为左边滑出;CardConfig.SWIPED_RIGHT 为右边滑出 29 | */ 30 | default void onSwiped(RecyclerView.ViewHolder viewHolder, T t, int direction) { 31 | } 32 | 33 | /** 34 | * 所有的卡片全部滑出时回调 35 | */ 36 | default void onSwipedClear() { 37 | } 38 | 39 | default void getNextPage() { 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/tantan_card/CardConfig.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.tantan_card; 2 | 3 | /** 4 | * @author yuqirong 5 | */ 6 | 7 | public final class CardConfig { 8 | /** 9 | * 显示可见的卡片数量 10 | */ 11 | public static final int DEFAULT_SHOW_ITEM = 3; 12 | /** 13 | * 默认缩放的比例 14 | */ 15 | public static final float DEFAULT_SCALE = 0.1f; 16 | /** 17 | * 卡片Y轴偏移量时按照14等分计算 18 | */ 19 | public static final int DEFAULT_TRANSLATE_Y = 14; 20 | /** 21 | * 卡片滑动时默认倾斜的角度 22 | */ 23 | public static final float DEFAULT_ROTATE_DEGREE = 15f; 24 | /** 25 | * 卡片滑动时不偏左也不偏右 26 | */ 27 | public static final int SWIPING_NONE = 1; 28 | /** 29 | * 卡片向左滑动时 30 | */ 31 | public static final int SWIPING_LEFT = 1 << 2; 32 | /** 33 | * 卡片向右滑动时 34 | */ 35 | public static final int SWIPING_RIGHT = 1 << 3; 36 | /** 37 | * 卡片从左边滑出 38 | */ 39 | public static final int SWIPED_LEFT = 1; 40 | /** 41 | * 卡片从右边滑出 42 | */ 43 | public static final int SWIPED_RIGHT = 1 << 2; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/tantan_card/OnSwipeListener.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.tantan_card; 2 | 3 | 4 | import androidx.recyclerview.widget.RecyclerView; 5 | 6 | /** 7 | * @author yuqirong 8 | */ 9 | 10 | public interface OnSwipeListener { 11 | 12 | /** 13 | * 卡片还在滑动时回调 14 | * 15 | * @param viewHolder 该滑动卡片的viewHolder 16 | * @param ratio 滑动进度的比例 17 | * @param direction 卡片滑动的方向,CardConfig.SWIPING_LEFT 为向左滑,CardConfig.SWIPING_RIGHT 为向右滑, 18 | * CardConfig.SWIPING_NONE 为不偏左也不偏右 19 | */ 20 | void onSwiping(RecyclerView.ViewHolder viewHolder, float ratio, int direction); 21 | 22 | /** 23 | * 卡片完全滑出时回调 24 | * 25 | * @param viewHolder 该滑出卡片的viewHolder 26 | * @param t 该滑出卡片的数据 27 | * @param direction 卡片滑出的方向,CardConfig.SWIPED_LEFT 为左边滑出;CardConfig.SWIPED_RIGHT 为右边滑出 28 | */ 29 | void onSwiped(RecyclerView.ViewHolder viewHolder, T t, int direction); 30 | 31 | /** 32 | * 所有的卡片全部滑出时回调 33 | */ 34 | void onSwipedClear(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/AccordionTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.yumu.appinfo.transform; 18 | 19 | import android.view.View; 20 | 21 | public class AccordionTransformer extends BaseTransformer { 22 | 23 | @Override 24 | protected void onTransform(View view, float position) { 25 | view.setPivotX(position < 0 ? 0 : view.getWidth()); 26 | view.setScaleX(position < 0 ? 1f + position : 1f - position); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/CardOverlayAdapter.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.transform; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import androidx.annotation.NonNull; 9 | 10 | import com.ansen.shape.AnsenImageView; 11 | import com.bumptech.glide.Glide; 12 | import com.yumu.appinfo.R; 13 | import com.yumu.appinfo.bean.Album; 14 | 15 | public class CardOverlayAdapter extends BaseOverlayPageAdapter { 16 | private LayoutInflater mInflater; 17 | private Context context; 18 | 19 | public CardOverlayAdapter(Context context) { 20 | super(context); 21 | mInflater = LayoutInflater.from(context); 22 | this.context = context; 23 | } 24 | 25 | @Override 26 | protected View itemView(int position) { 27 | return mInflater.inflate(R.layout.item_viewpager_image, null); 28 | } 29 | 30 | @NonNull 31 | @Override 32 | public Object instantiateItem(@NonNull ViewGroup container, final int position) { 33 | final Album data = getList().get(position); 34 | View rootView = itemView(position); 35 | if (null == rootView) { 36 | throw new RuntimeException("you should set a item layout"); 37 | } 38 | AnsenImageView imageView = rootView.findViewById(R.id.iv_avatar); 39 | if (null == imageView) { 40 | throw new RuntimeException("you should set a item layout"); 41 | } 42 | Glide.with(context).load(data.getPreview_url()).into(imageView); 43 | container.addView(rootView); 44 | return rootView; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/DepthPageTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.yumu.appinfo.transform; 18 | 19 | import android.view.View; 20 | 21 | public class DepthPageTransformer extends BaseTransformer { 22 | 23 | private static final float MIN_SCALE = 0.75f; 24 | 25 | @Override 26 | protected void onTransform(View view, float position) { 27 | if (position <= 0f) { 28 | view.setTranslationX(0f); 29 | view.setScaleX(1f); 30 | view.setScaleY(1f); 31 | } else if (position <= 1f) { 32 | final float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position)); 33 | view.setAlpha(1 - position); 34 | view.setPivotY(0.5f * view.getHeight()); 35 | view.setTranslationX(view.getWidth() * -position); 36 | view.setScaleX(scaleFactor); 37 | view.setScaleY(scaleFactor); 38 | } 39 | } 40 | 41 | @Override 42 | protected boolean isPagingEnabled() { 43 | return true; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/OverlayTransformer.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.transform; 2 | 3 | 4 | import android.view.View; 5 | 6 | import androidx.viewpager.widget.ViewPager; 7 | 8 | /** 9 | * 右堆叠效果 10 | * 可调整 缩放 ,堆叠层 偏移量 11 | */ 12 | public class OverlayTransformer implements ViewPager.PageTransformer { 13 | private float scaleOffset = 0f; 14 | private float transOffset = 40f; 15 | private final int overlayCount; 16 | 17 | public OverlayTransformer(int overlayCount) { 18 | this.overlayCount = overlayCount; 19 | } 20 | 21 | public OverlayTransformer(int overlayCount, float scaleOffset, float transOffset) { 22 | this.overlayCount = overlayCount; 23 | if (Float.compare(scaleOffset, -1) != 0) this.scaleOffset = scaleOffset; 24 | if (Float.compare(transOffset, -1) != 0) this.transOffset = transOffset; 25 | } 26 | 27 | public int getOverlayCount() { 28 | return overlayCount; 29 | } 30 | 31 | @Override 32 | public void transformPage(View page, float position) { 33 | 34 | if (position <= 0.0f) {//当前页 35 | page.setTranslationX(0f); 36 | page.setAlpha(1 - 0.5f * Math.abs(position)); 37 | // page.setRotation(0 - Math.abs(position) * 6); 38 | page.setClickable(true); 39 | } else { 40 | otherTrans(page, position); 41 | page.setClickable(false); 42 | } 43 | } 44 | 45 | private void otherTrans(View page, float position) { 46 | //缩放比例 47 | float scale = (page.getWidth() - scaleOffset * position) / (float) (page.getWidth()); 48 | page.setScaleX(scale); 49 | page.setScaleY(scale); 50 | page.setAlpha(1f); 51 | if (position > overlayCount - 1 && position < overlayCount) { //当前页向右滑动时,最右面第四个及以后页面应消失 52 | float curPositionOffset = transOffset * (float) Math.floor(position); //向下取整 53 | float lastPositionOffset = transOffset * (float) Math.floor(position - 1); //上一个卡片的偏移量 54 | float singleOffset = 1 - Math.abs(position % (int) position); 55 | float transX = (-page.getWidth() * position) + (lastPositionOffset + singleOffset * (curPositionOffset - lastPositionOffset)); 56 | page.setTranslationX(transX); 57 | } else if (position <= overlayCount - 1) { 58 | float transX = (-page.getWidth() * position) + (transOffset * position); 59 | page.setTranslationX(transX); 60 | } else { 61 | page.setAlpha(0f); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/PageTransformerFactory.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.transform; 2 | 3 | 4 | import static com.yumu.appinfo.transform.TransformerStyle.ACCORDION; 5 | import static com.yumu.appinfo.transform.TransformerStyle.DEPTH; 6 | import static com.yumu.appinfo.transform.TransformerStyle.ROTATE; 7 | import static com.yumu.appinfo.transform.TransformerStyle.SCALE_IN; 8 | import static com.yumu.appinfo.transform.TransformerStyle.STACK; 9 | 10 | import androidx.viewpager2.widget.ViewPager2; 11 | 12 | public class PageTransformerFactory { 13 | 14 | public ViewPager2.PageTransformer createPageTransformer(int transformerStyle) { 15 | ViewPager2.PageTransformer transformer = null; 16 | switch (transformerStyle) { 17 | case DEPTH: 18 | transformer = new DepthPageTransformer(); 19 | break; 20 | case ROTATE: 21 | transformer = new RotateUpTransformer(); 22 | break; 23 | case STACK: 24 | transformer = new StackTransformer(); 25 | break; 26 | case ACCORDION: 27 | transformer = new AccordionTransformer(); 28 | break; 29 | case SCALE_IN: 30 | transformer = new ScaleInTransformer(ScaleInTransformer.DEFAULT_MIN_SCALE); 31 | break; 32 | } 33 | return transformer; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/RotateUpTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.yumu.appinfo.transform; 18 | 19 | import android.view.View; 20 | 21 | public class RotateUpTransformer extends BaseTransformer { 22 | 23 | private static final float ROT_MOD = -15f; 24 | 25 | @Override 26 | protected void onTransform(View view, float position) { 27 | final float width = view.getWidth(); 28 | final float rotation = ROT_MOD * position; 29 | 30 | view.setPivotX(width * 0.5f); 31 | view.setPivotY(0f); 32 | view.setTranslationX(0f); 33 | view.setRotation(rotation); 34 | } 35 | 36 | @Override 37 | protected boolean isPagingEnabled() { 38 | return true; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/ScaleInTransformer.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.transform; 2 | 3 | import android.view.View; 4 | 5 | import androidx.viewpager2.widget.ViewPager2; 6 | 7 | 8 | public class ScaleInTransformer implements ViewPager2.PageTransformer { 9 | 10 | private static final float DEFAULT_CENTER = 0.5f; 11 | public static final float DEFAULT_MIN_SCALE = 0.85f; 12 | public static final float MAX_SCALE = 0.999f; 13 | private float mMinScale; 14 | 15 | public ScaleInTransformer(float minScale) { 16 | mMinScale = minScale; 17 | } 18 | 19 | @Override 20 | public void transformPage(View view, float position) { 21 | int pageWidth = view.getWidth(); 22 | int pageHeight = view.getHeight(); 23 | // 24 | view.setPivotY(pageHeight / 2); 25 | view.setPivotX(pageWidth / 2); 26 | if (position < -1) { 27 | // This page is way off-screen to the left. 28 | view.setScaleX(mMinScale); 29 | view.setScaleY(mMinScale); 30 | view.setPivotX(pageWidth); 31 | } else if (position <= 1) { 32 | // Modify the default slide transition to shrink the page as well 33 | if (position < 0) { 34 | float scaleFactor = (1 + position) * (1 - mMinScale) + mMinScale; 35 | view.setScaleX(scaleFactor); 36 | view.setScaleY(scaleFactor); 37 | view.setPivotX(pageWidth * (DEFAULT_CENTER + (DEFAULT_CENTER * -position))); 38 | } else { 39 | float scaleFactor = (1 - position) * (1 - mMinScale) + mMinScale; 40 | view.setScaleX(scaleFactor); 41 | view.setScaleY(scaleFactor); 42 | view.setPivotX(pageWidth * ((1 - position) * DEFAULT_CENTER)); 43 | } 44 | } else { 45 | view.setPivotX(0); 46 | view.setScaleX(mMinScale); 47 | view.setScaleY(mMinScale); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/StackTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.yumu.appinfo.transform; 18 | 19 | import android.view.View; 20 | 21 | public class StackTransformer extends BaseTransformer { 22 | 23 | @Override 24 | protected void onTransform(View view, float position) { 25 | view.setTranslationX(position < 0 ? 0f : -view.getWidth() * position); 26 | view.setTranslationZ(-position); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/TransformerStyle.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.transform; 2 | 3 | public interface TransformerStyle { 4 | int NONE = 0; 5 | int DEPTH = 1 << 1; 6 | int STACK = 1 << 2; 7 | int ACCORDION = 1 << 3; 8 | int ROTATE = 1 << 4; 9 | int SCALE_IN = 1 << 5; 10 | } 11 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/transform/ValueInterpolator.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.transform; 2 | 3 | public class ValueInterpolator { 4 | 5 | private float mRangeMapFromMin; 6 | private float mRangeMapToMin; 7 | 8 | private float mScaleFactor; 9 | 10 | public ValueInterpolator(float[] rangeMapFrom, float[] rangeMapTo) { 11 | this(rangeMapFrom[0], rangeMapFrom[1], rangeMapTo[0], rangeMapTo[1]); 12 | } 13 | 14 | public ValueInterpolator(float rangeMapFromMin, float rangeMapFromMax, float rangeMapToMin, float rangeMapToMax) { 15 | mRangeMapFromMin = rangeMapFromMin; 16 | mRangeMapToMin = rangeMapToMin; 17 | 18 | float rangeMapFromSpan = rangeMapFromMax - rangeMapFromMin; 19 | float rangeMapToSpan = rangeMapToMax - rangeMapToMin; 20 | 21 | mScaleFactor = rangeMapToSpan / rangeMapFromSpan; 22 | } 23 | 24 | public float map(float value) { 25 | return mRangeMapToMin + ((value - mRangeMapFromMin) * mScaleFactor); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/utils/BaseConstans.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.utils; 2 | 3 | /** 4 | * Date : 2020/6/1. 5 | * Time : 11:51. 6 | * Created by sunan. 7 | */ 8 | public class BaseConstans { 9 | /** 10 | * 跳转请求code 11 | */ 12 | public static class RequestCode { 13 | public final static int SELECT_VIDEO = 1;//选择视频 14 | public final static int SELECT_IMAGE = 2;//选择图片 15 | public final static int CHANGE_IMAGE = 3;//更改图片 16 | 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/utils/DisplayHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making QMUI_Android available. 3 | * 4 | * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. 5 | * 6 | * Licensed under the MIT License (the "License"); you may not use this file except in 7 | * compliance with the License. You may obtain a copy of the License at 8 | * 9 | * http://opensource.org/licenses/MIT 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | * either express or implied. See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.yumu.appinfo.utils; 18 | 19 | import android.content.Context; 20 | import android.content.res.Resources; 21 | import android.util.DisplayMetrics; 22 | import android.util.TypedValue; 23 | 24 | /** 25 | * @author cginechen 26 | * @date 2016-03-17 27 | */ 28 | public class DisplayHelper { 29 | public static float getDensity(Context context) { 30 | if (context == null) { 31 | return 1; 32 | } 33 | return context.getResources().getDisplayMetrics().density; 34 | } 35 | 36 | public static int getWidthPixels() { 37 | return Resources.getSystem().getDisplayMetrics().widthPixels; 38 | } 39 | 40 | /** 41 | * 单位转换: dp -> px 42 | * 43 | * @param dp 44 | * @return 45 | */ 46 | public static int dp2px(Context context, int dp) { 47 | return (int) (getDensity(context) * dp + 0.5); 48 | } 49 | 50 | 51 | public static int dpToPx(Context context, float dipValue) { 52 | DisplayMetrics metrics = context.getResources().getDisplayMetrics(); 53 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipValue, metrics); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/utils/MD5.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.utils; 2 | 3 | import java.security.MessageDigest; 4 | 5 | /** 6 | * Date : 2019-11-20. 7 | * Time : 17:41. 8 | * Created by sunan. 9 | */ 10 | public class MD5 { 11 | public static final String getMessageDigest(byte[] paramArrayOfByte) { 12 | char[] arrayOfChar1 = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102}; 13 | try { 14 | MessageDigest localMessageDigest = MessageDigest.getInstance("MD5"); 15 | localMessageDigest.update(paramArrayOfByte); 16 | byte[] arrayOfByte = localMessageDigest.digest(); 17 | int i = arrayOfByte.length; 18 | char[] arrayOfChar2 = new char[i * 2]; 19 | int j = 0; 20 | int k = 0; 21 | while (true) { 22 | if (j >= i) 23 | return new String(arrayOfChar2); 24 | int m = arrayOfByte[j]; 25 | int n = k + 1; 26 | arrayOfChar2[k] = arrayOfChar1[(0xF & m >>> 4)]; 27 | k = n + 1; 28 | arrayOfChar2[n] = arrayOfChar1[(m & 0xF)]; 29 | j++; 30 | } 31 | } catch (Exception localException) { 32 | } 33 | return null; 34 | } 35 | 36 | public static final byte[] getRawDigest(byte[] paramArrayOfByte) { 37 | try { 38 | MessageDigest localMessageDigest = MessageDigest.getInstance("MD5"); 39 | localMessageDigest.update(paramArrayOfByte); 40 | byte[] arrayOfByte = localMessageDigest.digest(); 41 | return arrayOfByte; 42 | } catch (Exception localException) { 43 | } 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/views/CustomerCallback.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.views; 2 | 3 | /** 4 | * Date : 2020-03-28. 5 | * Time : 15:39. 6 | * Created by sunan. 7 | */ 8 | public interface CustomerCallback { 9 | void customerCallback(int status); 10 | } 11 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/views/IView.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.views; 2 | 3 | import android.widget.ImageView; 4 | 5 | /** 6 | * Date : 2020-03-28. 7 | * Time : 15:39. 8 | * Created by sunan. 9 | */ 10 | public interface IView { 11 | 12 | void setSelect(boolean isFocused); 13 | 14 | void setBack(boolean isFocused); 15 | 16 | void setAction(boolean isNeedCallBack); 17 | 18 | void resetView(); 19 | 20 | ImageView getImageFront(); 21 | } 22 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/views/NoScrollViewPager.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.views; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.MotionEvent; 6 | 7 | import androidx.viewpager.widget.ViewPager; 8 | 9 | 10 | /** 11 | * Date : 2020-03-28. 12 | * Time : 15:39. 13 | * Created by sunan. 14 | */ 15 | public class NoScrollViewPager extends ViewPager { 16 | 17 | private boolean isPagingEnabled = false; 18 | 19 | public NoScrollViewPager(Context context) { 20 | super(context); 21 | } 22 | 23 | public NoScrollViewPager(Context context, AttributeSet attrs) { 24 | super(context, attrs); 25 | } 26 | 27 | @Override 28 | public boolean onTouchEvent(MotionEvent event) { 29 | return this.isPagingEnabled && super.onTouchEvent(event); 30 | } 31 | 32 | @Override 33 | public boolean onInterceptTouchEvent(MotionEvent event) { 34 | return this.isPagingEnabled && super.onInterceptTouchEvent(event); 35 | } 36 | 37 | @Override 38 | public void scrollTo(int x, int y) { 39 | super.scrollTo(x, y); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/views/RoundImageView.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.views; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.Paint; 7 | import android.graphics.PaintFlagsDrawFilter; 8 | import android.graphics.Path; 9 | import android.graphics.RectF; 10 | import android.util.AttributeSet; 11 | import android.view.View; 12 | 13 | import com.yumu.appinfo.R; 14 | 15 | /** 16 | * @author yuqirong 17 | */ 18 | 19 | public class RoundImageView extends androidx.appcompat.widget.AppCompatImageView { 20 | 21 | private Path mPath; 22 | private RectF mRectF; 23 | private float[] rids = new float[8]; 24 | private PaintFlagsDrawFilter paintFlagsDrawFilter; 25 | 26 | public RoundImageView(Context context) { 27 | this(context, null); 28 | } 29 | 30 | public RoundImageView(Context context, AttributeSet attrs) { 31 | this(context, attrs, 0); 32 | } 33 | 34 | public RoundImageView(Context context, AttributeSet attrs, int defStyleAttr) { 35 | super(context, attrs, defStyleAttr); 36 | TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RoundImageView); 37 | float mRadius = array.getDimension(R.styleable.RoundImageView_radius, 10); 38 | rids[0] = mRadius; 39 | rids[1] = mRadius; 40 | rids[2] = mRadius; 41 | rids[3] = mRadius; 42 | rids[4] = 0f; 43 | rids[5] = 0f; 44 | rids[6] = 0f; 45 | rids[7] = 0f; 46 | array.recycle(); 47 | mPath = new Path(); 48 | paintFlagsDrawFilter = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG); 49 | setLayerType(View.LAYER_TYPE_HARDWARE, null); 50 | } 51 | 52 | @Override 53 | protected void onDraw(Canvas canvas) { 54 | mPath.reset(); 55 | mPath.addRoundRect(mRectF, rids, Path.Direction.CW); 56 | canvas.setDrawFilter(paintFlagsDrawFilter); 57 | canvas.save(); 58 | canvas.clipPath(mPath); 59 | super.onDraw(canvas); 60 | canvas.restore(); 61 | } 62 | 63 | @Override 64 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 65 | super.onSizeChanged(w, h, oldw, oldh); 66 | mRectF = new RectF(0, 0, w, h); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /appinfo/src/main/java/com/yumu/appinfo/views/ViewPager2Adapter.java: -------------------------------------------------------------------------------- 1 | package com.yumu.appinfo.views; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.fragment.app.Fragment; 5 | import androidx.fragment.app.FragmentActivity; 6 | import androidx.viewpager2.adapter.FragmentStateAdapter; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * Date : 2020-03-03. 13 | * Time : 14:53. 14 | * Created by sunan. 15 | */ 16 | public class ViewPager2Adapter extends FragmentStateAdapter { 17 | private List fragmentList = new ArrayList(); 18 | 19 | public ViewPager2Adapter(@NonNull FragmentActivity fragmentActivity) { 20 | super(fragmentActivity); 21 | } 22 | 23 | public void addFragment(Fragment fragment) { 24 | fragmentList.add(fragment); 25 | } 26 | 27 | public Fragment getFragment(int position) { 28 | return fragmentList.get(position); 29 | } 30 | 31 | public List getFragmentList() { 32 | return fragmentList; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public Fragment createFragment(int position) { 38 | return fragmentList.get(position); 39 | } 40 | 41 | @Override 42 | public int getItemCount() { 43 | return fragmentList.size(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /appinfo/src/main/res/anim/bottom_dialog_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /appinfo/src/main/res/anim/bottom_dialog_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /appinfo/src/main/res/anim/scale_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | -------------------------------------------------------------------------------- /appinfo/src/main/res/anim/top_dialog_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/draw_launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 21 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_android_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_facing.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_facing_back.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_facing_front.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_flash_auto.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_flash_off.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_flash_on.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_flash_torch.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_info.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_photo.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_preview.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/ic_settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/item_card_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/item_card_border_parent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/launch_bg.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 17 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/logomark_light.xml: -------------------------------------------------------------------------------- 1 | 6 | 12 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/shape_age.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/shape_constellation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/tab_bg_with_shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/tab_discovery.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/tab_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/tab_mailbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/tab_person.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/tab_title_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /appinfo/src/main/res/drawable/video_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /appinfo/src/main/res/layout/activity_aplash.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /appinfo/src/main/res/layout/activity_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | -------------------------------------------------------------------------------- /appinfo/src/main/res/layout/activity_person_new.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 |