├── .gitignore ├── .idea ├── gradle.xml ├── runConfigurations.xml └── vcs.xml ├── BaseComponentLibrary ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── default_camera_lens.png │ ├── java │ └── jsc │ │ └── kit │ │ └── component │ │ ├── IViewAttrDelegate.java │ │ ├── adapter │ │ └── FilterAdapter.java │ │ ├── advertisement │ │ └── AdvertisementView.java │ │ ├── archeaderview │ │ ├── ArcHeaderDrawable.java │ │ ├── BaseArcHeaderView.java │ │ ├── LGradientArcHeaderView.java │ │ └── PictureArcHeaderView.java │ │ ├── bannerview │ │ ├── BannerPagerAdapter.java │ │ ├── JSCBannerView.java │ │ ├── OnCreateIndicatorViewListener.java │ │ ├── OnDataSetChangedListener.java │ │ ├── OnPageAdapterItemClickListener.java │ │ ├── PageAdapterItemLifeCycle.java │ │ └── pageTransformer │ │ │ ├── AlphaPageTransformer.java │ │ │ ├── DepthPageTransformer.java │ │ │ ├── ScaleTransformer.java │ │ │ └── ZoomOutPageTransformer.java │ │ ├── baseui │ │ ├── BaseAppCompatActivity.java │ │ ├── BaseEmptyFragmentActivity.java │ │ ├── BaseFragment.java │ │ ├── BaseLazyLoadFragment.java │ │ ├── basemvp │ │ │ ├── BaseMVPActivity.java │ │ │ ├── BaseMVPFragment.java │ │ │ ├── BasePresenter.java │ │ │ ├── IBaseModel.java │ │ │ └── IBaseView.java │ │ ├── basemvp2 │ │ │ ├── BasePresenterImpl.java │ │ │ ├── IBaseModel.java │ │ │ ├── IBasePresenter.java │ │ │ ├── IBaseView.java │ │ │ ├── LifecycleActivity.java │ │ │ ├── LifecycleContract.java │ │ │ ├── LifecyclePresenterImpl.java │ │ │ ├── TemplateContract.java │ │ │ └── TemplatePresenterImpl.java │ │ ├── baseview │ │ │ ├── BaseViewActivity.java │ │ │ ├── BaseViewCreateDelegate.java │ │ │ ├── BaseViewFragment.java │ │ │ ├── BaseViewProvider.java │ │ │ └── BaseViewShowDelegate.java │ │ ├── camera2 │ │ │ ├── AutoFitTextureView.java │ │ │ └── Camera2BasicFragment.java │ │ ├── download │ │ │ ├── DownloadEntity.java │ │ │ ├── DownloadListener.java │ │ │ └── FileDownloader.java │ │ ├── fragmentmanager │ │ │ ├── BackRecord.java │ │ │ └── FragmentBackHelper.java │ │ ├── handler │ │ │ ├── HandlerDelegate.java │ │ │ └── HandlerProvider.java │ │ ├── permission │ │ │ └── PermissionChecker.java │ │ ├── photo │ │ │ ├── BasePhotoActivity.java │ │ │ └── CropConfig.java │ │ ├── resizable │ │ │ ├── BaseResizableAdapter.java │ │ │ ├── BaseResizableFragment.java │ │ │ └── OnScreenChangeListener.java │ │ └── transition │ │ │ ├── TransitionDelegate.java │ │ │ ├── TransitionEnum.java │ │ │ └── TransitionProvider.java │ │ ├── graph │ │ ├── ColumnarItem.java │ │ ├── DataItem.java │ │ ├── LabelItem.java │ │ ├── LineChartView.java │ │ ├── LineItem.java │ │ └── VerticalColumnarGraphView.java │ │ ├── guide │ │ ├── GuideDialog.java │ │ ├── GuideLayout.java │ │ ├── GuidePopupView.java │ │ ├── GuidePopupWindow.java │ │ ├── GuideRippleView.java │ │ ├── OnCustomClickListener.java │ │ └── OnTargetClickListener.java │ │ ├── itemlayout │ │ └── JSCItemLayout.java │ │ ├── monthview │ │ ├── DayItem.java │ │ ├── DayView.java │ │ ├── MonthUtils.java │ │ └── MonthView.java │ │ ├── progressbar │ │ └── JSCRoundCornerProgressBar.java │ │ ├── radarview │ │ ├── RadarEntity.java │ │ ├── RadarPoint.java │ │ └── RadarView.java │ │ ├── reboundlayout │ │ ├── ReboundFrameLayout.java │ │ ├── ReboundLinearLayout.java │ │ └── ReboundRecyclerView.java │ │ ├── refreshlayout │ │ └── RefreshLayout.java │ │ ├── rippleview │ │ └── RippleView.java │ │ ├── stepview │ │ ├── DrawDelegate.java │ │ ├── RouteViewPoint.java │ │ ├── VerticalStepLinearLayout.java │ │ └── VerticalStepView.java │ │ ├── swiperecyclerview │ │ ├── BaseRecyclerViewAdapter.java │ │ ├── BaseViewHolder.java │ │ ├── BlankSpaceItemDecoration.java │ │ ├── OnItemClickListener.java │ │ ├── OnItemLongClickListener.java │ │ ├── SwipeRefreshRecyclerView.java │ │ ├── VerticalStepItemDecoration.java │ │ ├── ViewAdapter.java │ │ └── manager │ │ │ └── OverLayCardLayoutManager.java │ │ ├── turntable │ │ ├── ChassisView.java │ │ ├── GiftEntity.java │ │ └── TurntableView.java │ │ ├── utils │ │ ├── AntiShakeUtils.java │ │ ├── BaseAnimationListener.java │ │ ├── BitmapCacheManager.java │ │ ├── CommandUtils.java │ │ ├── CompatResourceUtils.java │ │ ├── CustomToast.java │ │ ├── FileProviderCompat.java │ │ ├── LetterNumberKeyListener.java │ │ ├── SharePreferencesUtils.java │ │ ├── UriUtils.java │ │ ├── WindowUtils.java │ │ └── dynamicdrawable │ │ │ └── DynamicDrawableFactory.java │ │ ├── vscrollscreen │ │ └── VScrollScreenLayout.java │ │ └── widget │ │ ├── AutoTextSizeView.java │ │ ├── AverageLayout.java │ │ ├── CameraMask.java │ │ ├── DotView.java │ │ ├── LabelValueView.java │ │ ├── NoScrollViewPager.java │ │ ├── ScannerCameraMask.java │ │ ├── aspectlayout │ │ ├── AspectRatioFrameLayout.java │ │ ├── AspectRatioHelper.java │ │ ├── AspectRatioImageView.java │ │ ├── AspectRatioLinearLayout.java │ │ └── IAspect.java │ │ ├── dialog │ │ └── LoadingDialog.java │ │ └── spacelickable │ │ ├── OnSpaceClickListener.java │ │ ├── SpaceClickHelper.java │ │ ├── SpaceClickableFrameLayout.java │ │ ├── SpaceClickableLinearLayout.java │ │ └── SpaceClickableRelativeLayout.java │ └── res │ ├── anim │ ├── custom_toast_anim_in.xml │ └── custom_toast_anim_out.xml │ ├── drawable-xxhdpi │ ├── ic_action_info.png │ └── ic_luck_compass.png │ ├── drawable │ ├── indicator_background_selector.xml │ ├── kit_default_img.png │ ├── kit_ic_assignment_blue_24dp.xml │ ├── kit_ic_chevron_right_gray_24dp.xml │ ├── kit_jump_background_shape.xml │ └── kit_scanner_bar.png │ └── values │ ├── jsc_attr.xml │ ├── jsc_dimens.xml │ ├── jsc_ids.xml │ ├── jsc_kit_style.xml │ ├── jsc_strings.xml │ ├── jsc_text_size.xml │ └── jsk_kit_colors.xml ├── DateTimePickerLibrary ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── jsc │ │ └── kit │ │ └── datetimepicker │ │ └── widget │ │ ├── BaseBuilder.java │ │ ├── BaseWheelDialog.java │ │ ├── Builder.java │ │ ├── DatePickerView.java │ │ ├── DateTimePicker.java │ │ ├── OnPickerDialog.java │ │ ├── TwoPickerDialog.java │ │ ├── WheelView.java │ │ └── YearMonthPickerDialog.java │ └── res │ ├── layout │ ├── base_picker_layout.xml │ └── date_time_picker_layout.xml │ ├── values-zh-rCN │ └── dt_strings.xml │ └── values │ ├── dt_strings.xml │ ├── dt_style.xml │ └── picker_attrs.xml ├── JscTestKeyStore.jks ├── Learn sources.md ├── README.md ├── Retrofit2Library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── jsc │ └── kit │ └── retrofit2 │ ├── ConnectivityHelper.java │ ├── LoadingDialogObserver.java │ ├── response │ ├── BaseObservableTransformer.java │ └── BaseResponse.java │ └── retrofit │ ├── CustomHttpClient.java │ └── CustomRetrofit.java ├── ZXingLibrary ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── jsc │ │ └── kit │ │ └── zxing │ │ ├── core │ │ ├── BGAQRCodeUtil.java │ │ ├── CameraConfigurationManager.java │ │ ├── CameraPreview.java │ │ ├── ProcessDataTask.java │ │ ├── QRCodeView.java │ │ └── ScanBoxView.java │ │ └── zxing │ │ ├── QRCodeDecoder.java │ │ ├── QRCodeEncoder.java │ │ ├── ZXingView.java │ │ └── ui │ │ ├── ZXingFragment.java │ │ └── ZXingScanActivity.java │ └── res │ ├── drawable-xxhdpi │ └── ic_flash_light.png │ ├── drawable │ ├── ic_brightness_high_white_32dp.xml │ ├── ic_brightness_low_white_32dp.xml │ ├── ic_zxing_circle_selector.xml │ ├── qrcode_default_grid_scan_line.png │ ├── qrcode_default_scan_line.png │ ├── scan_icon_scanline.png │ └── selector_btn_orange.xml │ ├── layout │ ├── activity_z_xing_scan.xml │ ├── fragment_z_xing_scan.xml │ ├── toolbar.xml │ └── view_control.xml │ └── values │ ├── zxing_attrs.xml │ ├── zxing_colors.xml │ ├── zxing_ids.xml │ └── zxing_style.xml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── jsc │ │ └── exam │ │ └── jsckit │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── img │ │ │ ├── 1.jpg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ └── 6.jpg │ ├── java │ │ └── jsc │ │ │ └── exam │ │ │ └── jsckit │ │ │ ├── Configration.java │ │ │ ├── InstanceManager.java │ │ │ ├── LaunchActivity.java │ │ │ ├── MyApplication.java │ │ │ ├── ScreenshotService.java │ │ │ ├── TemplateActivity.java │ │ │ ├── adapter │ │ │ ├── ClassItemAdapter.java │ │ │ ├── ComponentItemAdapter.java │ │ │ ├── ComponentItemDecoration.java │ │ │ ├── LayoutManagerAdapter.java │ │ │ ├── LinearAdapter.java │ │ │ └── MyFragmentPagerAdapter.java │ │ │ ├── entity │ │ │ ├── ApkInfo.java │ │ │ ├── Banner.java │ │ │ ├── ClassItem.java │ │ │ ├── ComponentItem.java │ │ │ ├── OutputType.java │ │ │ ├── User.java │ │ │ └── VersionEntity.java │ │ │ ├── service │ │ │ └── ApiService.java │ │ │ └── ui │ │ │ ├── AboutActivity.java │ │ │ ├── BaseActivity.java │ │ │ ├── BaseViewShowActivity.java │ │ │ ├── BottomNavigationViewActivity.java │ │ │ ├── CircularRevealActivity.java │ │ │ ├── ComponentsActivity.java │ │ │ ├── CustomToastActivity.java │ │ │ ├── DateTimePickerActivity.java │ │ │ ├── DownloadFileActivity.java │ │ │ ├── EmptyFragmentActivity.java │ │ │ ├── FragmentBackHelperActivity.java │ │ │ ├── FragmentBackHelperActivity2.java │ │ │ ├── MainActivity.java │ │ │ ├── PhotoActivity.java │ │ │ ├── Retrofit2Activity.java │ │ │ ├── SharedTransitionActivity.java │ │ │ ├── component │ │ │ ├── AdvertisementViewActivity.java │ │ │ ├── ArcHeaderViewActivity.java │ │ │ ├── AutoSizeTextViewActivity.java │ │ │ ├── AverageLayoutActivity.java │ │ │ ├── CameraMaskActivity.java │ │ │ ├── JSCBannerViewActivity.java │ │ │ ├── JSCItemLayoutActivity.java │ │ │ ├── JSCRoundCornerProgressBarActivity.java │ │ │ ├── LayoutManagerActivity.java │ │ │ ├── MonthViewActivity.java │ │ │ ├── RadarViewActivity.java │ │ │ ├── ReboundFrameLayoutActivity.java │ │ │ ├── ReboundRecyclerViewActivity.java │ │ │ ├── RefreshLayoutActivity.java │ │ │ ├── RippleViewActivity.java │ │ │ ├── ScannerCameraMaskActivity.java │ │ │ ├── SwipeRecyclerViewActivity.java │ │ │ ├── TurntableViewActivity.java │ │ │ ├── VScrollScreenLayoutActivity.java │ │ │ ├── VerticalColumnarGraphViewActivity.java │ │ │ ├── VerticalStepLinearLayoutActivity.java │ │ │ └── VerticalStepViewActivity.java │ │ │ ├── fragment │ │ │ ├── DefaultFragment.java │ │ │ ├── LineChartViewFragment.java │ │ │ └── ReboundLinearLayoutFragment.java │ │ │ ├── mvp │ │ │ ├── activity │ │ │ │ └── TestActivity.java │ │ │ ├── model │ │ │ │ ├── ITestModel.java │ │ │ │ └── TestModel.java │ │ │ ├── presenter │ │ │ │ ├── MyBasePresenter.java │ │ │ │ └── TestPresenter.java │ │ │ └── view │ │ │ │ ├── CommonView.java │ │ │ │ └── ITestView.java │ │ │ └── zxing │ │ │ ├── ZXingQRCodeActivity.java │ │ │ └── ZXingScannerActivity.java │ └── res │ │ ├── drawable-v21 │ │ └── ripple_round_corner_white_r4.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ └── hand_o_up.png │ │ ├── drawable-xxhdpi │ │ ├── butterfly_96px.png │ │ ├── main_icon_create.png │ │ ├── main_mid_show_left_camera.png │ │ ├── main_mid_show_left_fullscreen.png │ │ ├── main_mid_show_left_share.png │ │ └── main_mid_show_left_yx.png │ │ ├── drawable │ │ ├── beauty_bg.jpg │ │ ├── circle_gray_light_shape.xml │ │ ├── circle_theme_light_shape.xml │ │ ├── header.jpg │ │ ├── ic_assignment_turned_in_blue_24dp.xml │ │ ├── ic_chevron_left_white_24dp.xml │ │ ├── ic_chevron_left_white_48dp.xml │ │ ├── ic_home_black_24dp.xml │ │ ├── ic_info_blue_24dp.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_navigation_black_24dp.xml │ │ ├── ic_person_black_24dp.xml │ │ ├── ic_scanner_blue_24dp.xml │ │ ├── ic_toys_black_24dp.xml │ │ ├── item_decoration_shape.xml │ │ ├── jsc_button_shape.xml │ │ ├── linear_layout_space_line_shape.xml │ │ ├── progressbar.xml │ │ ├── ripple_round_corner_white_r4.xml │ │ └── tiger.png │ │ ├── layout │ │ ├── activity_about.xml │ │ ├── activity_arc_header_view.xml │ │ ├── activity_auto_size_text_view.xml │ │ ├── activity_average_layout.xml │ │ ├── activity_bottom_navigation_view.xml │ │ ├── activity_circular_reveal.xml │ │ ├── activity_custom_toast.xml │ │ ├── activity_date_time_picker.xml │ │ ├── activity_download_file.xml │ │ ├── activity_fragment_manager.xml │ │ ├── activity_jsc_banner_view.xml │ │ ├── activity_jsc_item_layout.xml │ │ ├── activity_jsc_round_corner_progress_bar.xml │ │ ├── activity_month_view.xml │ │ ├── activity_photo.xml │ │ ├── activity_radar_view.xml │ │ ├── activity_rebound_layout.xml │ │ ├── activity_refresh_layout.xml │ │ ├── activity_retrofit2.xml │ │ ├── activity_ripple_view.xml │ │ ├── activity_swip_recycler_view.xml │ │ ├── activity_template.xml │ │ ├── activity_turntable_view.xml │ │ ├── activity_v_scroll_screen_layout.xml │ │ ├── activity_vertical_columnar_graph_view.xml │ │ ├── activity_vertical_step_view.xml │ │ ├── activity_z_xing_qr_code.xml │ │ ├── activity_z_xing_scanner.xml │ │ ├── class_item_layout.xml │ │ ├── content_base_view_layout.xml │ │ ├── fragment_line_chart_view.xml │ │ ├── fragment_rebound_linear_layout.xml │ │ ├── page_empty_layout.xml │ │ ├── page_errror_layout.xml │ │ ├── page_loading_layout.xml │ │ ├── refresh_layout_content.xml │ │ └── refresh_layout_header.xml │ │ ├── menu │ │ └── navigation.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-nodpi │ │ └── default_user_header.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── attr.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── provider_paths.xml │ └── test │ └── java │ └── jsc │ └── exam │ └── jsckit │ └── ExampleUnitTest.kt ├── build.gradle ├── capture ├── JSCKitDemo.apk ├── apk_qr_code.png ├── download_qr_code.png ├── output.json └── screenshot │ ├── CustomToast01.jpg │ ├── DateTimePicker01.jpg │ ├── DateTimePicker02.jpg │ ├── JSCBannerView01.jpg │ ├── JSCBannerView02.jpg │ ├── JSCBannerView03.jpg │ ├── LGradientArcHeaderView01.jpg │ ├── LGradientArcHeaderView02.jpg │ ├── PictureArcHeaderView01.jpg │ ├── PictureArcHeaderView02.jpg │ └── RadarView01.jpg ├── doc ├── assets │ ├── CameraMask_attributions.png │ ├── CameraMask_screen_shot_01.png │ ├── CameraMask_screen_shot_02.png │ ├── ScannerCameraMask_screen_show_01.png │ └── options_for_image_crop.png ├── baseComponent │ ├── README.md │ ├── arc_header.md │ ├── custom_toast.md │ ├── jsc_banner_view.md │ └── radar_view.md ├── dateTimePicker │ ├── README.md │ └── date_time_picker.md ├── retrofit2 │ ├── README.md │ └── retrofit2_document.md └── zXing │ ├── README.md │ └── zXing_document.md ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | /.gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BaseComponentLibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /BaseComponentLibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.novoda.bintray-release' 3 | 4 | android { 5 | compileSdkVersion sdk_veriosn 6 | defaultConfig { 7 | minSdkVersion min_sdk_veriosn 8 | targetSdkVersion sdk_veriosn 9 | versionCode version_code 10 | versionName version_name 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | publish { 22 | userOrg = "$user_org" 23 | groupId = 'jsc.kit.component' 24 | artifactId = 'BaseComponentLibrary' 25 | publishVersion = "$version_name" 26 | desc = 'A library of basic customized componets.' 27 | website = 'https://github.com/JustinRoom/JSCKit/BaseComponentLibrary' 28 | } 29 | 30 | dependencies { 31 | api fileTree(include: ['*.jar'], dir: 'libs') 32 | api "com.android.support:appcompat-v7:$component_version" 33 | api "com.android.support:recyclerview-v7:$component_version" 34 | api "com.android.support:design:$component_version" 35 | api 'com.android.support.constraint:constraint-layout:2.0.0-alpha2' 36 | } 37 | -------------------------------------------------------------------------------- /BaseComponentLibrary/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 | -keep class jsc.kit.**{*;} -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/assets/default_camera_lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/BaseComponentLibrary/src/main/assets/default_camera_lens.png -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/IViewAttrDelegate.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public interface IViewAttrDelegate { 15 | 16 | public void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr); 17 | } 18 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/archeaderview/LGradientArcHeaderView.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.archeaderview; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.LinearGradient; 6 | import android.graphics.Shader; 7 | import android.support.annotation.ColorInt; 8 | import android.support.annotation.NonNull; 9 | import android.support.annotation.Nullable; 10 | import android.util.AttributeSet; 11 | 12 | import jsc.kit.component.R; 13 | 14 | /** 15 | *
Email:1006368252@qq.com 16 | *
QQ:1006368252 17 | *
https://github.com/JustinRoom/JSCKit 18 | * 19 | * @author jiangshicheng 20 | */ 21 | public class LGradientArcHeaderView extends BaseArcHeaderView { 22 | private int startColor; 23 | private int endColor; 24 | 25 | public LGradientArcHeaderView(Context context) { 26 | super(context); 27 | } 28 | 29 | public LGradientArcHeaderView(Context context, @Nullable AttributeSet attrs) { 30 | super(context, attrs); 31 | } 32 | 33 | public LGradientArcHeaderView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 34 | super(context, attrs, defStyleAttr); 35 | } 36 | 37 | @Override 38 | protected void init(Context context, TypedArray a) { 39 | startColor = a.getColor(R.styleable.BaseArcHeaderView_ahv_start_color, 0xFFFF3A80); 40 | endColor = a.getColor(R.styleable.BaseArcHeaderView_ahv_end_color, 0xFFFF3745); 41 | } 42 | 43 | @NonNull 44 | @Override 45 | protected Shader getShader() { 46 | return new LinearGradient(getWidth() / 2, 0, getWidth() / 2, getHeight(), startColor, endColor, Shader.TileMode.MIRROR); 47 | } 48 | 49 | public int getStartColor() { 50 | return startColor; 51 | } 52 | 53 | public int getEndColor() { 54 | return endColor; 55 | } 56 | 57 | /** 58 | * @param startColor start color 59 | * @param endColor end color 60 | */ 61 | public void setColors(@ColorInt int startColor, @ColorInt int endColor) { 62 | resetShader(); 63 | this.startColor = startColor; 64 | this.endColor = endColor; 65 | postInvalidate(); 66 | } 67 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/OnCreateIndicatorViewListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public interface OnCreateIndicatorViewListener { 15 | /** 16 | * Here you can create your own indicator item view at different index.
17 | * You are recommended to use {@link android.widget.LinearLayout.LayoutParams} if necessary.
18 | * For example: 19 | *

20 | * LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(30, 30);
21 | * params.leftMargin = 10;
22 | * params.rightMargin = 10;
23 | * View view = new View(context);
24 | * view.setLayoutParams(params);
25 | * return view; 26 | * 27 | * @param context context 28 | * @param index index 29 | * @param item entity 30 | * @return indicator view at index 31 | */ 32 | @Nullable 33 | View onCreateIndicatorView(Context context, int index, T item); 34 | } 35 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/OnDataSetChangedListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | interface OnDataSetChangedListener { 13 | void onDataSetChanged(List bannerItems, OnCreateIndicatorViewListener createIndicatorViewListener); 14 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/OnPageAdapterItemClickListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public interface OnPageAdapterItemClickListener { 13 | 14 | /** 15 | * item click listener. 16 | * 17 | * @param view the target view 18 | * @param item the bind entity of target view 19 | */ 20 | void onPageAdapterItemClick(View view, T item); 21 | } 22 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/PageAdapterItemLifeCycle.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public interface PageAdapterItemLifeCycle { 15 | /** 16 | * create your banner view. 17 | * 18 | * @param container parent container 19 | * @param item entity 20 | * @return item view 21 | */ 22 | @NonNull 23 | View onInstantiateItem(ViewGroup container, T item); 24 | 25 | /** 26 | * destroy banner view. 27 | * 28 | * @param container parent container 29 | * @param object object 30 | * @return true-destroy item by your way 31 | *
false-destroy item by default way: {@code container.removeView((View) object);} 32 | */ 33 | boolean onDestroyItem(ViewGroup container, Object object); 34 | } 35 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/pageTransformer/AlphaPageTransformer.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview.pageTransformer; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.v4.view.ViewPager; 5 | import android.view.View; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public class AlphaPageTransformer implements ViewPager.PageTransformer { 15 | 16 | @Override 17 | public void transformPage(@NonNull View page, float position) { 18 | float alpha = 0.0f; 19 | if (0.0f <= position && position <= 1.0f) { 20 | alpha = 1.0f - position; 21 | } else if (-1.0f <= position && position < 0.0f) { 22 | alpha = position + 1.0f; 23 | } 24 | if (alpha < 0.5f) 25 | alpha = 0.5f; 26 | page.setAlpha(alpha); 27 | } 28 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/pageTransformer/DepthPageTransformer.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview.pageTransformer; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.v4.view.ViewPager; 5 | import android.view.View; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public class DepthPageTransformer implements ViewPager.PageTransformer { 15 | private static float MIN_SCALE = 0.75f; 16 | 17 | @Override 18 | public void transformPage(@NonNull View view, float position) { 19 | int pageWidth = view.getWidth(); 20 | if (position < -1) { // [-Infinity,-1)//This page is way off-screen to the left. 21 | view.setAlpha(0); 22 | } else if (position <= 0) { // [-1,0]Use //the default slide transition when moving to the left page 23 | view.setAlpha(1); 24 | view.setTranslationX(0); 25 | view.setScaleX(1); 26 | view.setScaleY(1); 27 | } else if (position <= 1) { // (0,1]// Fade the page out. 28 | view.setAlpha(1 - position); 29 | // Counteract the default slide transition 30 | view.setTranslationX(pageWidth * -position); 31 | // Scale the page down (between MIN_SCALE and 1) 32 | float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) 33 | * (1 - Math.abs(position)); 34 | view.setScaleX(scaleFactor); 35 | view.setScaleY(scaleFactor); 36 | } else { // (1,+Infinity] 37 | // This page is way off-screen to the right. 38 | view.setAlpha(0); 39 | 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/pageTransformer/ScaleTransformer.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview.pageTransformer; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.v4.view.ViewPager; 5 | import android.view.View; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public class ScaleTransformer implements ViewPager.PageTransformer { 15 | private static final float MIN_SCALE = 0.70f; 16 | private static final float MIN_ALPHA = 0.5f; 17 | 18 | @Override 19 | public void transformPage(@NonNull View page, float position) { 20 | if (position < -1 || position > 1) { 21 | page.setAlpha(MIN_ALPHA); 22 | page.setScaleX(MIN_SCALE); 23 | page.setScaleY(MIN_SCALE); 24 | } else if (position <= 1) { // [-1,1] 25 | float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs(position)); 26 | if (position < 0) { 27 | float scaleXY = 1 + 0.3f * position; 28 | page.setScaleX(scaleXY); 29 | page.setScaleY(scaleXY); 30 | } else { 31 | float scaleXY = 1 - 0.3f * position; 32 | page.setScaleX(scaleXY); 33 | page.setScaleY(scaleXY); 34 | } 35 | page.setAlpha(MIN_ALPHA + (scaleFactor - MIN_SCALE) / (1 - MIN_SCALE) * (1 - MIN_ALPHA)); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/bannerview/pageTransformer/ZoomOutPageTransformer.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.bannerview.pageTransformer; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.v4.view.ViewPager; 5 | import android.view.View; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public class ZoomOutPageTransformer implements ViewPager.PageTransformer { 15 | 16 | private final static float MIN_SCALE = 0.85f; 17 | private final static float MIN_ALPHA = 0.5f; 18 | 19 | @Override 20 | public void transformPage(@NonNull View view, float position) { 21 | int pageWidth = view.getWidth(); 22 | int pageHeight = view.getHeight(); 23 | 24 | if (position < -1) { // [-Infinity,-1) 25 | // This page is way off-screen to the left. 26 | view.setAlpha(0); 27 | } else if (position <= 1) { // [-1,1] 28 | // Modify the default slide transition to 29 | // shrink the page as well 30 | float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs(position)); 31 | float vertMargin = pageHeight * (1 - scaleFactor) / 2; 32 | float horzMargin = pageWidth * (1 - scaleFactor) / 2; 33 | if (position < 0) { 34 | view.setTranslationX(horzMargin - vertMargin / 2); 35 | } else { 36 | view.setTranslationX(-horzMargin + vertMargin / 2); 37 | } 38 | // Scale the page down (between MIN_SCALE and 1) 39 | view.setScaleX(scaleFactor); 40 | view.setScaleY(scaleFactor); 41 | // Fade the page relative to its size. 42 | view.setAlpha(MIN_ALPHA + (scaleFactor - MIN_SCALE) 43 | / (1 - MIN_SCALE) * (1 - MIN_ALPHA)); 44 | } else { // (1,+Infinity] 45 | // This page is way off-screen to the right. 46 | view.setAlpha(0); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui; 2 | 3 | import android.support.v4.app.Fragment; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public abstract class BaseFragment extends Fragment { 13 | 14 | protected boolean isVisible; 15 | 16 | @Override 17 | public void setUserVisibleHint(boolean isVisibleToUser) { 18 | super.setUserVisibleHint(isVisibleToUser); 19 | if (getUserVisibleHint()) { 20 | isVisible = true; 21 | onVisible(); 22 | } else { 23 | isVisible = false; 24 | onInVisible(); 25 | } 26 | } 27 | 28 | protected void onVisible() { 29 | lazyLoad(); 30 | } 31 | 32 | protected void onInVisible() { 33 | } 34 | 35 | protected abstract void lazyLoad(); 36 | } 37 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp/BaseMVPFragment.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import jsc.kit.component.baseui.BaseLazyLoadFragment; 9 | 10 | /** 11 | *
Email:1006368252@qq.com 12 | *
QQ:1006368252 13 | *
https://github.com/JustinRoom/JSCKit 14 | * 15 | * @author jiangshicheng 16 | */ 17 | public abstract class BaseMVPFragment extends BaseLazyLoadFragment { 18 | 19 | private List presenterManager = null; 20 | 21 | /** 22 | * Add presenter into presenter manager. 23 | * 24 | * @param presenter presenter instance 25 | */ 26 | public final void addToPresenterManager(@NonNull BasePresenter presenter) { 27 | if (presenterManager == null) { 28 | presenterManager = new ArrayList<>(); 29 | } 30 | presenterManager.add(presenter); 31 | } 32 | 33 | /** 34 | * Remove presenter from presenter manager. 35 | * 36 | * @param presenter presenter instance 37 | */ 38 | public final void removeFromPresenterManager(@NonNull BasePresenter presenter) { 39 | if (presenterManager != null && !presenterManager.isEmpty()) { 40 | presenterManager.remove(presenter); 41 | } 42 | } 43 | 44 | /** 45 | * Release presenters' resources. 46 | */ 47 | public void recyclePresenterResources() { 48 | if (presenterManager != null && !presenterManager.isEmpty()) { 49 | for (BasePresenter presenter : presenterManager) { 50 | presenter.release(); 51 | presenter = null; 52 | } 53 | } 54 | } 55 | 56 | @Override 57 | public void onDestroyView() { 58 | recyclePresenterResources(); 59 | super.onDestroyView(); 60 | } 61 | 62 | @Override 63 | public void onDestroy() { 64 | super.onDestroy(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp/BasePresenter.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import java.lang.ref.WeakReference; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public abstract class BasePresenter { 15 | private WeakReference viewWeakReference; 16 | private M model; 17 | 18 | public BasePresenter() { 19 | } 20 | 21 | public BasePresenter(@NonNull V view, @NonNull M model) { 22 | viewWeakReference = new WeakReference<>(view); 23 | this.model = model; 24 | } 25 | 26 | public M getModel() { 27 | return model; 28 | } 29 | 30 | public void setModel(@NonNull M model) { 31 | this.model = model; 32 | } 33 | 34 | /** 35 | * You should call method {@link #isViewAttached()} before calling this method. 36 | *
For example: 37 | *

38 |      *     if(isViewAttached()){
39 |      *         V view = getView();
40 |      *         //todo
41 |      *     }
42 |      * 
43 | * 44 | * @return view 45 | */ 46 | public V getView() { 47 | return viewWeakReference.get(); 48 | } 49 | 50 | public boolean isViewAttached(){ 51 | return viewWeakReference.get() != null; 52 | } 53 | 54 | public void setView(@NonNull V view) { 55 | viewWeakReference = new WeakReference<>(view); 56 | } 57 | 58 | public void release() { 59 | if (viewWeakReference != null){ 60 | V view = viewWeakReference.get(); 61 | view = null; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp/IBaseModel.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface IBaseModel { 11 | } 12 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp/IBaseView.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface IBaseView { 11 | } 12 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/BasePresenterImpl.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | import java.lang.ref.WeakReference; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public abstract class BasePresenterImpl { 13 | private WeakReference modelReference = null; 14 | private WeakReference viewReference = null; 15 | 16 | public BasePresenterImpl() { 17 | attachModel(null); 18 | attachView(null); 19 | } 20 | 21 | public BasePresenterImpl(V v) { 22 | attachModel(null); 23 | attachView(v); 24 | } 25 | 26 | public BasePresenterImpl(M m, V v) { 27 | attachModel(m); 28 | attachView(v); 29 | } 30 | 31 | public void attachModel(M m) { 32 | modelReference = m == null ? null : new WeakReference<>(m); 33 | } 34 | 35 | public boolean isModelAttached() { 36 | return modelReference != null && modelReference.get() != null; 37 | } 38 | 39 | public M model() { 40 | return modelReference == null ? null : modelReference.get(); 41 | } 42 | 43 | public void attachView(V v) { 44 | viewReference = v == null ? null : new WeakReference<>(v); 45 | } 46 | 47 | public boolean isViewAttached() { 48 | return viewReference != null && viewReference.get() != null; 49 | } 50 | 51 | public V view() { 52 | return viewReference == null ? null : viewReference.get(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/IBaseModel.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface IBaseModel { 11 | } 12 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/IBasePresenter.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface IBasePresenter { 11 | public void attachModel(M m); 12 | public boolean isModelAttached(); 13 | public M model(); 14 | public void attachView(V v); 15 | public boolean isViewAttached(); 16 | public V view(); 17 | } 18 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/IBaseView.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface IBaseView { 11 | } 12 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/LifecycleContract.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface LifecycleContract { 11 | public interface Model extends IBaseModel {} 12 | public interface View extends IBaseView { 13 | public void onLifecycleStart(); 14 | public void onLifecycleResume(); 15 | public void onLifecyclePause(); 16 | public void onLifecycleStop(); 17 | public void onLifecycleDestroy(); 18 | } 19 | public interface Presenter { 20 | public void start(); 21 | public void resume(); 22 | public void pause(); 23 | public void stop(); 24 | public void destroy(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/LifecyclePresenterImpl.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import java.lang.ref.WeakReference; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | */ 14 | public class LifecyclePresenterImpl extends BasePresenterImpl implements LifecycleContract.Presenter { 15 | 16 | @Override 17 | public void start() { 18 | if (isViewAttached()) 19 | view().onLifecycleStart(); 20 | } 21 | 22 | @Override 23 | public void resume() { 24 | if (isViewAttached()) 25 | view().onLifecycleResume(); 26 | } 27 | 28 | @Override 29 | public void pause() { 30 | if (isViewAttached()) 31 | view().onLifecyclePause(); 32 | } 33 | 34 | @Override 35 | public void stop() { 36 | if (isViewAttached()) 37 | view().onLifecycleStop(); 38 | } 39 | 40 | @Override 41 | public void destroy() { 42 | if (isViewAttached()) 43 | view().onLifecycleDestroy(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/TemplateContract.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public interface TemplateContract { 11 | public interface Model extends IBaseModel {} 12 | public interface View extends IBaseView {} 13 | public interface Presenter extends IBasePresenter {} 14 | } 15 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/basemvp2/TemplatePresenterImpl.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.basemvp2; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public class TemplatePresenterImpl implements TemplateContract.Presenter { 11 | 12 | 13 | @Override 14 | public void attachModel(TemplateContract.Model model) { 15 | 16 | } 17 | 18 | @Override 19 | public boolean isModelAttached() { 20 | return false; 21 | } 22 | 23 | @Override 24 | public TemplateContract.Model model() { 25 | return null; 26 | } 27 | 28 | @Override 29 | public void attachView(TemplateContract.View view) { 30 | 31 | } 32 | 33 | @Override 34 | public boolean isViewAttached() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public TemplateContract.View view() { 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/baseview/BaseViewShowDelegate.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.baseview; 2 | 3 | import android.os.Bundle; 4 | import android.os.Message; 5 | import android.support.annotation.NonNull; 6 | import android.support.annotation.Nullable; 7 | import android.view.View; 8 | 9 | /** 10 | *
Email:1006368252@qq.com 11 | *
QQ:1006368252 12 | *
https://github.com/JustinRoom/JSCKit 13 | * 14 | * @author jiangshicheng 15 | */ 16 | public interface BaseViewShowDelegate { 17 | 18 | void onShowContentPage(@NonNull View contentView, @Nullable Bundle bundle); 19 | 20 | void onShowEmptyPage(@NonNull View emptyView, @Nullable Bundle bundle); 21 | 22 | void onShowLoadingPage(@NonNull View loadingView, @Nullable Bundle bundle); 23 | 24 | void onShowErrorPage(@NonNull View errorView, @Nullable Bundle bundle); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/download/DownloadListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.download; 2 | 3 | import android.net.Uri; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public interface DownloadListener { 13 | /** 14 | * Observe downloading progress. 15 | * 16 | * @param downloadedBytes downloaded bytes 17 | * @param totalBytes total bytes 18 | * @param downStatus download status 19 | */ 20 | public void onDownloadProgress(int downloadedBytes, int totalBytes, int downStatus); 21 | 22 | /** 23 | * Download successfully. 24 | * 25 | * @param uri file uri 26 | */ 27 | public void onDownloadCompleted(Uri uri); 28 | } 29 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/handler/HandlerDelegate.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.handler; 2 | 3 | import android.os.Message; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public interface HandlerDelegate { 13 | 14 | /** 15 | * Do your ui operations here, in UI thread. 16 | * 17 | * @param msg message 18 | */ 19 | public void handleUIMessage(Message msg); 20 | 21 | /** 22 | * Do your long-running operations here, in none UI thread. 23 | * 24 | * @param msg message 25 | */ 26 | public void handleWorkMessage(Message msg); 27 | } 28 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/resizable/BaseResizableAdapter.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.resizable; 2 | 3 | import android.support.annotation.IdRes; 4 | import android.support.annotation.IntDef; 5 | import android.support.annotation.LayoutRes; 6 | import android.support.annotation.NonNull; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | import jsc.kit.component.swiperecyclerview.BaseRecyclerViewAdapter; 18 | 19 | /** 20 | * 大小屏切换基础适配器。 21 | *
Email:1006368252@qq.com 22 | *
QQ:1006368252 23 | *
https://github.com/JustinRoom/JSCKit 24 | * 25 | * @author jiangshicheng 26 | */ 27 | public abstract class BaseResizableAdapter extends BaseRecyclerViewAdapter { 28 | 29 | public static final int VIEW_TYPE_SMALL = 0; 30 | public static final int VIEW_TYPE_FULL = 1; 31 | 32 | @IntDef({VIEW_TYPE_SMALL, VIEW_TYPE_FULL}) 33 | @Retention(RetentionPolicy.SOURCE) 34 | public @interface ViewType { 35 | } 36 | 37 | private int viewType = VIEW_TYPE_FULL; 38 | 39 | /** 40 | * 大小屏切换。 41 | * @param viewType one of {@link #VIEW_TYPE_SMALL}、{@link #VIEW_TYPE_FULL} 42 | * @param layoutId layoutId 43 | */ 44 | public void updateViewType(@ViewType int viewType, @LayoutRes int layoutId) { 45 | if (this.viewType == viewType) 46 | return; 47 | 48 | this.viewType = viewType; 49 | this.layoutId = layoutId; 50 | notifyDataSetChanged(); 51 | } 52 | 53 | @Override 54 | public int getItemViewType(int position) { 55 | return viewType; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/resizable/OnScreenChangeListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.resizable; 2 | 3 | public interface OnScreenChangeListener { 4 | void onScreenChange(boolean fullScreen); 5 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/transition/TransitionDelegate.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.transition; 2 | 3 | import android.annotation.TargetApi; 4 | import android.os.Build; 5 | import android.transition.Transition; 6 | import android.view.View; 7 | 8 | /** 9 | *
Email:1006368252@qq.com 10 | *
QQ:1006368252 11 | *
https://github.com/JustinRoom/JSCKit 12 | * 13 | * @author jiangshicheng 14 | */ 15 | public interface TransitionDelegate { 16 | 17 | /** 18 | * activity's entering transition 19 | *
This transition will be executed when jump to this activity. 20 | * 21 | * @return a transition for entering activity 22 | */ 23 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 24 | public Transition createEnterTransition(); 25 | 26 | /** 27 | * activity's exiting transition 28 | *
This transition will be executed when jump to next activity. 29 | * 30 | * @return a transition for exiting activity 31 | */ 32 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 33 | public Transition createExitTransition(); 34 | 35 | /** 36 | * activity's returning transition 37 | *
This transition will be executed when return to previous activity. 38 | * 39 | * @return a transition for returning activity 40 | */ 41 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 42 | public Transition createReturnTransition(); 43 | 44 | /** 45 | * activity's re-entering transition 46 | *
This transition will be executed when back to this activity. 47 | * 48 | * @return a transition for re-entering activity 49 | */ 50 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 51 | public Transition createReenterTransition(); 52 | 53 | /** 54 | * initialize shared_elements' transition name here. 55 | *
It should be called after calling {@link android.app.Activity#setContentView(View)} method on your own. 56 | */ 57 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 58 | public void initSharedElement(); 59 | } 60 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/baseui/transition/TransitionEnum.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.baseui.transition; 2 | 3 | import android.support.annotation.Nullable; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public enum TransitionEnum { 13 | SLIDE((byte) 0, "slide"), 14 | EXPLODE((byte) 1, "explode"), 15 | FADE((byte) 2, "fade"); 16 | 17 | private byte value; 18 | private String label; 19 | 20 | TransitionEnum(byte value, String label) { 21 | this.value = value; 22 | this.label = label; 23 | } 24 | 25 | public byte getValue() { 26 | return value; 27 | } 28 | 29 | public String getLabel() { 30 | return label; 31 | } 32 | 33 | @Nullable 34 | public static TransitionEnum createTransitionByValue(byte value) { 35 | if (value == 0) 36 | return SLIDE; 37 | if (value == 1) 38 | return EXPLODE; 39 | if (value == 2) 40 | return FADE; 41 | return null; 42 | } 43 | 44 | @Nullable 45 | public static TransitionEnum createTransitionByLabel(String label) { 46 | if (SLIDE.getLabel().equalsIgnoreCase(label)) 47 | return SLIDE; 48 | if (EXPLODE.getLabel().equalsIgnoreCase(label)) 49 | return EXPLODE; 50 | if (FADE.getLabel().equalsIgnoreCase(label)) 51 | return FADE; 52 | return null; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/graph/DataItem.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.graph; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public class DataItem { 11 | private float ratio;//比率, 柱形高度百分比 12 | 13 | public DataItem() { 14 | } 15 | 16 | public DataItem(float ratio) { 17 | this.ratio = ratio; 18 | } 19 | 20 | public float getRatio() { 21 | return ratio; 22 | } 23 | 24 | public void setRatio(float ratio) { 25 | this.ratio = ratio; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/graph/LabelItem.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.graph; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.ColorInt; 5 | import android.support.annotation.FloatRange; 6 | import android.support.annotation.NonNull; 7 | import android.util.DisplayMetrics; 8 | import android.util.TypedValue; 9 | 10 | /** 11 | *
Email:1006368252@qq.com 12 | *
QQ:1006368252 13 | *
https://github.com/JustinRoom/JSCKit 14 | * 15 | * @author jiangshicheng 16 | */ 17 | public class LabelItem { 18 | private int color;//标签颜色 19 | private float size;//标签大小 20 | private String label;//标签 21 | 22 | public LabelItem() { 23 | color = 0xFF04DB5B; 24 | } 25 | 26 | public LabelItem(@ColorInt int color, @FloatRange(from = 0) float size, String label) { 27 | this.color = color; 28 | this.size = size; 29 | this.label = label; 30 | } 31 | 32 | public int getColor() { 33 | return color; 34 | } 35 | 36 | public void setColor(@ColorInt int color) { 37 | this.color = color; 38 | } 39 | 40 | public float getSize() { 41 | return size; 42 | } 43 | 44 | public void setSize(@FloatRange(from = 0)float size) { 45 | this.size = size; 46 | } 47 | 48 | /** 49 | * @param context context 50 | * @param unit unit 51 | * @param value value 52 | * @see TypedValue#applyDimension(int, float, DisplayMetrics) 53 | */ 54 | public void setSize(@NonNull Context context, int unit, @FloatRange(from = 0)float value) { 55 | this.size = TypedValue.applyDimension(unit, value, context.getResources().getDisplayMetrics()); 56 | } 57 | 58 | public String getLabel() { 59 | return label; 60 | } 61 | 62 | public void setLabel(String label) { 63 | this.label = label; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/graph/LineItem.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.graph; 2 | 3 | import android.graphics.Color; 4 | import android.support.annotation.ColorInt; 5 | 6 | /** 7 | *
Email:1006368252@qq.com 8 | *
QQ:1006368252 9 | *
https://github.com/JustinRoom/JSCKit 10 | * 11 | * @author jiangshicheng 12 | */ 13 | public class LineItem { 14 | private int lineColor = Color.BLUE; 15 | private DataItem[] data = null; 16 | 17 | public LineItem() { 18 | } 19 | 20 | public LineItem(@ColorInt int lineColor, DataItem[] data) { 21 | this.lineColor = lineColor; 22 | this.data = data; 23 | } 24 | 25 | public int getLineColor() { 26 | return lineColor; 27 | } 28 | 29 | public void setLineColor(@ColorInt int lineColor) { 30 | this.lineColor = lineColor; 31 | } 32 | 33 | public DataItem[] getData() { 34 | return data; 35 | } 36 | 37 | public void setData(DataItem[] data) { 38 | this.data = data; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/guide/OnCustomClickListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.guide; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.view.View; 5 | 6 | public interface OnCustomClickListener { 7 | public void onCustomClick(@NonNull View view); 8 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/guide/OnTargetClickListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.guide; 2 | 3 | import android.view.View; 4 | 5 | public interface OnTargetClickListener { 6 | public void onTargetClick(View target); 7 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/radarview/RadarPoint.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.radarview; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public class RadarPoint { 11 | private float x; 12 | private float y; 13 | 14 | public RadarPoint() { 15 | } 16 | 17 | public RadarPoint(float x, float y) { 18 | this.x = x; 19 | this.y = y; 20 | } 21 | 22 | public float getX() { 23 | return x; 24 | } 25 | 26 | public void setX(float x) { 27 | this.x = x; 28 | } 29 | 30 | public float getY() { 31 | return y; 32 | } 33 | 34 | public void setY(float y) { 35 | this.y = y; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/stepview/DrawDelegate.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.stepview; 2 | 3 | import android.graphics.Canvas; 4 | import android.graphics.Paint; 5 | import android.support.annotation.NonNull; 6 | 7 | /** 8 | * This delegate is for {@link VerticalStepLinearLayout} drawing steps. 9 | *
Email:1006368252@qq.com 10 | *
QQ:1006368252 11 | *
https://github.com/JustinRoom/JSCKit 12 | * 13 | * @author jiangshicheng 14 | */ 15 | public interface DrawDelegate { 16 | /** 17 | * Draw the vertical line. 18 | *
Override this method to draw the vertical line on your own style. 19 | * 20 | * @param canvas canvas 21 | * @param centerX center x axis 22 | */ 23 | public void drawLine(@NonNull Canvas canvas, float centerX); 24 | 25 | /** 26 | * Draw index. 27 | *
Override this method to draw index info on your own style. 28 | * 29 | * @param canvas canvas 30 | * @param index index 31 | * @param centerX center x axis 32 | * @param fontMetrics fontMetrics 33 | */ 34 | public void drawIndex(@NonNull Canvas canvas, int index, float centerX, @NonNull Paint.FontMetrics fontMetrics); 35 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/swiperecyclerview/OnItemClickListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.swiperecyclerview; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public interface OnItemClickListener { 13 | void onItemClick(View itemView, int position, T item); 14 | } 15 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/swiperecyclerview/OnItemLongClickListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.swiperecyclerview; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public interface OnItemLongClickListener { 13 | boolean onItemLongClick(View itemView, int position, T item); 14 | } 15 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/swiperecyclerview/ViewAdapter.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.swiperecyclerview; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public interface ViewAdapter { 13 | 14 | public List getItems(); 15 | 16 | public T getItemAt(int position); 17 | 18 | public void setItems(List items); 19 | 20 | public void addItems(List items); 21 | 22 | public void addItems(int position, List items); 23 | 24 | public void addItem(T item); 25 | 26 | public void addItem(int position, T item); 27 | 28 | public void removeItem(int position); 29 | 30 | public void removeItem(T item); 31 | } 32 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/utils/AntiShakeUtils.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.utils; 2 | 3 | import android.support.annotation.IntRange; 4 | import android.support.annotation.NonNull; 5 | import android.view.View; 6 | 7 | import jsc.kit.component.R; 8 | 9 | /** 10 | * 防抖动点击 11 | *
Email:1006368252@qq.com 12 | *
QQ:1006368252 13 | *
https://github.com/JustinRoom/JSCKit 14 | * 15 | * @author jiangshicheng 16 | */ 17 | public class AntiShakeUtils { 18 | 19 | private final static long INTERNAL_TIME = 1000; 20 | 21 | /** 22 | * Whether this click event is invalid. 23 | * 24 | * @param target target view 25 | * @return true, invalid click event. 26 | * @see #isInvalidClick(View, long) 27 | */ 28 | public static boolean isInvalidClick(@NonNull View target) { 29 | return isInvalidClick(target, INTERNAL_TIME); 30 | } 31 | 32 | /** 33 | * Whether this click event is invalid. 34 | * 35 | * @param target target view 36 | * @param internalTime the internal time. The unit is millisecond. 37 | * @return true, invalid click event. 38 | */ 39 | public static boolean isInvalidClick(@NonNull View target, @IntRange(from = 0) long internalTime) { 40 | long curTimeStamp = System.currentTimeMillis(); 41 | long lastClickTimeStamp = 0; 42 | Object o = target.getTag(R.id.last_click_time); 43 | if (o == null){ 44 | target.setTag(R.id.last_click_time, curTimeStamp); 45 | return false; 46 | } 47 | lastClickTimeStamp = (Long) o; 48 | boolean isInvalid = curTimeStamp - lastClickTimeStamp < internalTime; 49 | if (!isInvalid) 50 | target.setTag(R.id.last_click_time, curTimeStamp); 51 | return isInvalid; 52 | } 53 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/utils/BaseAnimationListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.utils; 2 | 3 | import android.view.animation.Animation; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | */ 12 | public class BaseAnimationListener implements Animation.AnimationListener { 13 | 14 | @Override 15 | public void onAnimationStart(Animation animation) { 16 | 17 | } 18 | 19 | @Override 20 | public void onAnimationEnd(Animation animation) { 21 | 22 | } 23 | 24 | @Override 25 | public void onAnimationRepeat(Animation animation) { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/utils/FileProviderCompat.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.utils; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | import android.os.Build; 7 | 8 | import java.io.File; 9 | 10 | /** 11 | *
Email:1006368252@qq.com 12 | *
QQ:1006368252 13 | *
https://github.com/JustinRoom/JSCKit 14 | * 15 | * @author jiangshicheng 16 | */ 17 | public class FileProviderCompat { 18 | 19 | /** 20 | * Get uri for file. 21 | *
System provides {@link android.support.v4.content.FileProvider} to find uri of file for security since android {@link Build.VERSION_CODES#N}. 22 | * 23 | * @param context context 24 | * @param file file 25 | * @return uri 26 | */ 27 | public static Uri getUriForFile(Context context, File file) { 28 | Uri fileUri = null; 29 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 30 | fileUri = getUriForFile24(context, file); 31 | } else { 32 | fileUri = Uri.fromFile(file); 33 | } 34 | return fileUri; 35 | } 36 | 37 | public static Uri getUriForFile24(Context context, File file) { 38 | return android.support.v4.content.FileProvider.getUriForFile(context, 39 | context.getPackageName() + ".fileProvider", 40 | file); 41 | } 42 | 43 | 44 | public static void setDataAndType(Intent intent, Uri uri, String type, boolean writeAble) { 45 | intent.setDataAndType(uri, type); 46 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 47 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 48 | if (writeAble) { 49 | intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/NoScrollViewPager.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.view.ViewPager; 7 | import android.util.AttributeSet; 8 | import android.view.MotionEvent; 9 | 10 | /** 11 | *
Email:1006368252@qq.com 12 | *
QQ:1006368252 13 | *
https://github.com/JustinRoom/JSCKit 14 | * 15 | * @author jiangshicheng 16 | */ 17 | public class NoScrollViewPager extends ViewPager { 18 | 19 | private boolean mNoScroll = true; 20 | 21 | public NoScrollViewPager(@NonNull Context context) { 22 | super(context); 23 | } 24 | 25 | public NoScrollViewPager(@NonNull Context context, @Nullable AttributeSet attrs) { 26 | super(context, attrs); 27 | } 28 | 29 | public void setNoScroll(boolean noScroll) { 30 | this.mNoScroll = noScroll; 31 | } 32 | 33 | @Override 34 | public boolean onTouchEvent(MotionEvent event) { 35 | if (mNoScroll) 36 | return false; 37 | else 38 | return super.onTouchEvent(event); 39 | } 40 | 41 | @Override 42 | public boolean onInterceptTouchEvent(MotionEvent event) { 43 | if (mNoScroll) 44 | return false; 45 | else 46 | return super.onInterceptTouchEvent(event); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/aspectlayout/AspectRatioHelper.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget.aspectlayout; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | /** 10 | *
Email:1006368252@qq.com 11 | *
QQ:1006368252 12 | *
https://github.com/JustinRoom/JSCKit 13 | * 14 | * @author jiangshicheng 15 | */ 16 | public class AspectRatioHelper { 17 | 18 | public static final int BASE_HORIZONTAL = 0; 19 | public static final int BASE_VERTICAL = 1; 20 | @IntDef({BASE_HORIZONTAL, BASE_VERTICAL}) 21 | @Retention(RetentionPolicy.SOURCE) 22 | public @interface BaseWhat { 23 | } 24 | 25 | private int baseWhat; 26 | private int aspectX; 27 | private int aspectY; 28 | 29 | public AspectRatioHelper() { 30 | } 31 | 32 | public AspectRatioHelper(int baseWhat, int aspectX, int aspectY) { 33 | this.baseWhat = baseWhat; 34 | this.aspectX = aspectX; 35 | this.aspectY = aspectY; 36 | if (this.aspectX <= 0) 37 | this.aspectX = 1; 38 | if (this.aspectY <= 0) 39 | this.aspectY = 1; 40 | } 41 | 42 | public int getBaseWhat() { 43 | return baseWhat; 44 | } 45 | 46 | public void setBaseWhat(@AspectRatioHelper.BaseWhat int baseWhat) { 47 | this.baseWhat = baseWhat; 48 | } 49 | 50 | public int getAspectX() { 51 | return aspectX; 52 | } 53 | 54 | public void setAspectX(int aspectX) { 55 | this.aspectX = aspectX; 56 | } 57 | 58 | public int getAspectY() { 59 | return aspectY; 60 | } 61 | 62 | public void setAspectY(int aspectY) { 63 | this.aspectY = aspectY; 64 | } 65 | 66 | public int calHeightMeasureSpec(int width){ 67 | int height = width * aspectY / aspectX; 68 | return View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY); 69 | } 70 | 71 | public int calWidthMeasureSpec(int height){ 72 | int width = height * aspectX / aspectY; 73 | return View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/aspectlayout/IAspect.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget.aspectlayout; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | interface IAspect { 11 | 12 | int getBaseWhat(); 13 | 14 | void setBaseWhat(int baseWhat); 15 | 16 | int getAspectX(); 17 | 18 | void setAspectX(int aspectX); 19 | 20 | int getAspectY(); 21 | 22 | void setAspectY(int aspectY); 23 | } 24 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/spacelickable/OnSpaceClickListener.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget.spacelickable; 2 | 3 | import android.view.ViewGroup; 4 | 5 | public interface OnSpaceClickListener { 6 | void onSpaceClick(V layout); 7 | } -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/spacelickable/SpaceClickableFrameLayout.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget.spacelickable; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | import android.widget.FrameLayout; 8 | 9 | import jsc.kit.component.IViewAttrDelegate; 10 | 11 | /** 12 | * 可监听空白处点击的FrameLayout 13 | *
Email:1006368252@qq.com 14 | *
QQ:1006368252 15 | *
https://github.com/JustinRoom/JSCKit 16 | * 17 | * @author jiangshicheng 18 | */ 19 | public class SpaceClickableFrameLayout extends FrameLayout implements IViewAttrDelegate { 20 | 21 | private SpaceClickHelper spaceClickHelper = null; 22 | 23 | public SpaceClickableFrameLayout(Context context) { 24 | super(context); 25 | initAttr(context, null, 0); 26 | } 27 | 28 | public SpaceClickableFrameLayout(Context context, @Nullable AttributeSet attrs) { 29 | super(context, attrs); 30 | initAttr(context, attrs, 0); 31 | } 32 | 33 | public SpaceClickableFrameLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 34 | super(context, attrs, defStyleAttr); 35 | initAttr(context, attrs, defStyleAttr); 36 | } 37 | 38 | @Override 39 | public void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 40 | spaceClickHelper = new SpaceClickHelper<>(this); 41 | } 42 | 43 | public void setOnSpaceClickListener(OnSpaceClickListener onSpaceClickListener) { 44 | spaceClickHelper.setOnSpaceClickListener(onSpaceClickListener); 45 | } 46 | 47 | @Override 48 | public boolean onTouchEvent(MotionEvent event) { 49 | return spaceClickHelper.onTouchEvent(event); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/spacelickable/SpaceClickableLinearLayout.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget.spacelickable; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | import android.widget.FrameLayout; 8 | import android.widget.LinearLayout; 9 | 10 | import jsc.kit.component.IViewAttrDelegate; 11 | 12 | /** 13 | * 可监听空白处点击的LinearLayout 14 | *
Email:1006368252@qq.com 15 | *
QQ:1006368252 16 | *
https://github.com/JustinRoom/JSCKit 17 | * 18 | * @author jiangshicheng 19 | */ 20 | public class SpaceClickableLinearLayout extends LinearLayout implements IViewAttrDelegate { 21 | 22 | private SpaceClickHelper spaceClickHelper = null; 23 | 24 | public SpaceClickableLinearLayout(Context context) { 25 | super(context); 26 | initAttr(context, null, 0); 27 | } 28 | 29 | public SpaceClickableLinearLayout(Context context, @Nullable AttributeSet attrs) { 30 | super(context, attrs); 31 | initAttr(context, attrs, 0); 32 | } 33 | 34 | public SpaceClickableLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 35 | super(context, attrs, defStyleAttr); 36 | initAttr(context, attrs, defStyleAttr); 37 | } 38 | 39 | @Override 40 | public void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 41 | spaceClickHelper = new SpaceClickHelper<>(this); 42 | } 43 | 44 | public void setOnSpaceClickListener(OnSpaceClickListener onSpaceClickListener) { 45 | spaceClickHelper.setOnSpaceClickListener(onSpaceClickListener); 46 | } 47 | 48 | @Override 49 | public boolean onTouchEvent(MotionEvent event) { 50 | return spaceClickHelper.onTouchEvent(event); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/java/jsc/kit/component/widget/spacelickable/SpaceClickableRelativeLayout.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.component.widget.spacelickable; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | import android.widget.FrameLayout; 8 | import android.widget.RelativeLayout; 9 | 10 | import jsc.kit.component.IViewAttrDelegate; 11 | 12 | /** 13 | * 可监听空白处点击的RelativeLayout 14 | *
Email:1006368252@qq.com 15 | *
QQ:1006368252 16 | *
https://github.com/JustinRoom/JSCKit 17 | * 18 | * @author jiangshicheng 19 | */ 20 | public class SpaceClickableRelativeLayout extends RelativeLayout implements IViewAttrDelegate { 21 | 22 | private SpaceClickHelper spaceClickHelper = null; 23 | 24 | public SpaceClickableRelativeLayout(Context context) { 25 | super(context); 26 | initAttr(context, null, 0); 27 | } 28 | 29 | public SpaceClickableRelativeLayout(Context context, @Nullable AttributeSet attrs) { 30 | super(context, attrs); 31 | initAttr(context, attrs, 0); 32 | } 33 | 34 | public SpaceClickableRelativeLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 35 | super(context, attrs, defStyleAttr); 36 | initAttr(context, attrs, defStyleAttr); 37 | } 38 | 39 | @Override 40 | public void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 41 | spaceClickHelper = new SpaceClickHelper<>(this); 42 | } 43 | 44 | public void setOnSpaceClickListener(OnSpaceClickListener onSpaceClickListener) { 45 | spaceClickHelper.setOnSpaceClickListener(onSpaceClickListener); 46 | } 47 | 48 | @Override 49 | public boolean onTouchEvent(MotionEvent event) { 50 | return spaceClickHelper.onTouchEvent(event); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/anim/custom_toast_anim_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/anim/custom_toast_anim_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable-xxhdpi/ic_action_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/BaseComponentLibrary/src/main/res/drawable-xxhdpi/ic_action_info.png -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable-xxhdpi/ic_luck_compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/BaseComponentLibrary/src/main/res/drawable-xxhdpi/ic_luck_compass.png -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable/indicator_background_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable/kit_default_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/BaseComponentLibrary/src/main/res/drawable/kit_default_img.png -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable/kit_ic_assignment_blue_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable/kit_ic_chevron_right_gray_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable/kit_jump_background_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/drawable/kit_scanner_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/BaseComponentLibrary/src/main/res/drawable/kit_scanner_bar.png -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/values/jsc_ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/values/jsc_kit_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 25 | 26 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/values/jsc_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Library 3 | This sample needs camera permission. 4 | This device doesn\'t support Camera2 API. 5 | 6 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/values/jsc_text_size.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8dip 5 | 9dip 6 | 10dip 7 | 11dip 8 | 12dip 9 | 13dip 10 | 14dip 11 | 15dip 12 | 16dip 13 | 17dip 14 | 18dip 15 | 19dip 16 | 20dip 17 | 21dip 18 | 22dip 19 | 23dip 20 | 24dip 21 | 25dip 22 | 26dip 23 | 27dip 24 | 28dip 25 | 29dip 26 | 30dip 27 | 31dip 28 | 32dip 29 | 33dip 30 | 34dip 31 | 35dip 32 | 36dip 33 | 37dip 34 | 38dip 35 | 39dip 36 | 40dip 37 | 38 | -------------------------------------------------------------------------------- /BaseComponentLibrary/src/main/res/values/jsk_kit_colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.novoda.bintray-release' 3 | 4 | android { 5 | compileSdkVersion sdk_veriosn 6 | defaultConfig { 7 | minSdkVersion min_sdk_veriosn 8 | targetSdkVersion sdk_veriosn 9 | versionCode version_code 10 | versionName version_name 11 | 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | } 22 | 23 | publish { 24 | userOrg = "$user_org" 25 | groupId = 'jsc.kit.datetimepicker' 26 | artifactId = 'DateTimePickerLibrary' 27 | publishVersion = "$version_name" 28 | desc = 'A library of date time picker.' 29 | website = 'https://github.com/JustinRoom/JSCKit/DateTimePickerLibrary' 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(dir: 'libs', include: ['*.jar']) 34 | implementation "com.android.support:appcompat-v7:$component_version" 35 | } 36 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/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 | -keep class jsc.lib.datetimepicker.**{*;} -------------------------------------------------------------------------------- /DateTimePickerLibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/src/main/res/values-zh-rCN/dt_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 请选择时间 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/src/main/res/values/dt_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Select Date 4 | Y 5 | M 6 | D 7 | h 8 | m 9 | 10 | 11 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/src/main/res/values/dt_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /DateTimePickerLibrary/src/main/res/values/picker_attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /JscTestKeyStore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/JscTestKeyStore.jks -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JSCKit 2 | ![](https://api.bintray.com/packages/justinquote/maven/BaseComponentLibrary/images/download.svg) 3 | 4 | # Install Demo APK 5 | **Download apk by scanning the QRCode below:** 6 | ![JSCKitDemo.apk](/capture/download_qr_code.png) 7 | [**Local Download**](/capture/JSCKitDemo.apk?raw=true) 8 | 9 | # Document 10 | + document for [BaseComponentLibrary](/doc/baseComponent/README.md) 11 | + document for [ZXingLibrary](/doc/zXing/README.md) 12 | + document for [Retrofit2Library](/doc/retrofit2/README.md) 13 | + document for [DateTimePickerLibrary](/doc/dateTimePicker/README.md) 14 | -------------------------------------------------------------------------------- /Retrofit2Library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Retrofit2Library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.novoda.bintray-release' 3 | 4 | android { 5 | compileSdkVersion sdk_veriosn 6 | defaultConfig { 7 | minSdkVersion min_sdk_veriosn 8 | targetSdkVersion sdk_veriosn 9 | versionCode version_code 10 | versionName version_name 11 | 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | } 22 | 23 | publish { 24 | userOrg = "$user_org" 25 | groupId = 'jsc.kit.retrofit2' 26 | artifactId = 'Retrofit2Library' 27 | publishVersion = "$version_name" 28 | desc = 'A library base on retrofit2 library.' 29 | website = 'https://github.com/JustinRoom/JSCKit/Retrofit2Library' 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(dir: 'libs', include: ['*.jar']) 34 | 35 | api 'com.squareup.retrofit2:retrofit:2.4.0' 36 | api 'com.squareup.retrofit2:converter-gson:2.4.0' 37 | api 'com.squareup.retrofit2:converter-scalars:2.4.0' 38 | api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' 39 | //https://github.com/square/okhttp 40 | api 'com.squareup.okhttp3:logging-interceptor:3.10.0' 41 | 42 | //https://github.com/ReactiveX/RxAndroid 43 | api 'io.reactivex.rxjava2:rxandroid:2.0.2' 44 | api 'io.reactivex.rxjava2:rxjava:2.1.12' 45 | } 46 | -------------------------------------------------------------------------------- /Retrofit2Library/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 | -keep class jsc.lib.retrofitlibrary.**{*;} -------------------------------------------------------------------------------- /Retrofit2Library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Retrofit2Library/src/main/java/jsc/kit/retrofit2/ConnectivityHelper.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.retrofit2; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.Network; 6 | import android.net.NetworkInfo; 7 | 8 | import java.util.Objects; 9 | 10 | /** 11 | * 12 | * ConnectivityHelper 网络工具 13 | * 14 | * 15 | */ 16 | public class ConnectivityHelper { 17 | 18 | public static boolean isNetworkAvailable(Context context) { 19 | ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 20 | Objects.requireNonNull(cm); 21 | NetworkInfo networkInfo = cm.getActiveNetworkInfo(); 22 | return networkInfo != null && networkInfo.isAvailable(); 23 | } 24 | 25 | /** 26 | * 判断网络是否可用 27 | * 28 | * @param context context 29 | * @return boolean 30 | */ 31 | public static boolean isConnectivityAvailable(Context context) { 32 | // 判断网络是否可用 33 | ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 34 | Objects.requireNonNull(cm); 35 | NetworkInfo info = cm.getActiveNetworkInfo(); 36 | if (info == null || !info.isConnected()) { 37 | return false; 38 | } 39 | return info.isAvailable() || info.isRoaming(); 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Retrofit2Library/src/main/java/jsc/kit/retrofit2/response/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.retrofit2.response; 2 | 3 | /** 4 | *
Email:1006368252@qq.com 5 | *
QQ:1006368252 6 | *
https://github.com/JustinRoom/JSCKit 7 | * 8 | * @author jiangshicheng 9 | */ 10 | public class BaseResponse { 11 | private int code; //状态码 12 | private String msg; //返回信息 13 | private T response; //响应数据 14 | private long systemTime;//系统时间 15 | 16 | public boolean isFailed(){ 17 | return code != 0; 18 | } 19 | 20 | public boolean isSuccess(){ 21 | return code == 0; 22 | } 23 | 24 | public int getCode() { 25 | return code; 26 | } 27 | 28 | public void setCode(int code) { 29 | this.code = code; 30 | } 31 | 32 | public String getMsg() { 33 | return msg; 34 | } 35 | 36 | public void setMsg(String msg) { 37 | this.msg = msg; 38 | } 39 | 40 | public T getResponse() { 41 | return response; 42 | } 43 | 44 | public void setResponse(T response) { 45 | this.response = response; 46 | } 47 | 48 | public long getSystemTime() { 49 | return systemTime; 50 | } 51 | 52 | public void setSystemTime(long systemTime) { 53 | this.systemTime = systemTime; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ZXingLibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /ZXingLibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.novoda.bintray-release' 3 | 4 | android { 5 | compileSdkVersion sdk_veriosn 6 | defaultConfig { 7 | minSdkVersion min_sdk_veriosn 8 | targetSdkVersion sdk_veriosn 9 | versionCode version_code 10 | versionName version_name 11 | 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | } 22 | 23 | publish { 24 | userOrg = "$user_org" 25 | groupId = 'jsc.kit.zxing' 26 | artifactId = 'ZXingLibrary' 27 | publishVersion = "$version_name" 28 | desc = 'A library base on xzing library.' 29 | website = 'https://github.com/JustinRoom/JSCKit/ZXingLibrary' 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(dir: 'libs', include: ['*.jar']) 34 | 35 | implementation "com.android.support:appcompat-v7:$component_version" 36 | 37 | //zxing 38 | api 'com.google.zxing:core:3.3.2' 39 | } 40 | -------------------------------------------------------------------------------- /ZXingLibrary/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 | -keep class jsc.lib.zxinglibrary.**{*;} -------------------------------------------------------------------------------- /ZXingLibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/java/jsc/kit/zxing/zxing/ZXingView.java: -------------------------------------------------------------------------------- 1 | package jsc.kit.zxing.zxing; 2 | 3 | import android.content.Context; 4 | import android.graphics.Rect; 5 | import android.util.AttributeSet; 6 | 7 | import com.google.zxing.BinaryBitmap; 8 | import com.google.zxing.MultiFormatReader; 9 | import com.google.zxing.PlanarYUVLuminanceSource; 10 | import com.google.zxing.Result; 11 | import com.google.zxing.common.HybridBinarizer; 12 | 13 | import jsc.kit.zxing.core.QRCodeView; 14 | 15 | public class ZXingView extends QRCodeView { 16 | private MultiFormatReader mMultiFormatReader; 17 | 18 | public ZXingView(Context context) { 19 | this(context, null); 20 | } 21 | 22 | public ZXingView(Context context, AttributeSet attributeSet) { 23 | this(context, attributeSet, 0); 24 | } 25 | 26 | public ZXingView(Context context, AttributeSet attrs, int defStyleAttr) { 27 | super(context, attrs, defStyleAttr); 28 | initMultiFormatReader(); 29 | } 30 | 31 | private void initMultiFormatReader() { 32 | mMultiFormatReader = new MultiFormatReader(); 33 | mMultiFormatReader.setHints(QRCodeDecoder.HINTS); 34 | } 35 | 36 | @Override 37 | public String processData(byte[] data, int width, int height, boolean isRetry) { 38 | String result = null; 39 | Result rawResult = null; 40 | 41 | try { 42 | PlanarYUVLuminanceSource source = null; 43 | Rect rect = mScanBoxView.getScanBoxAreaRect(height); 44 | if (rect != null) { 45 | source = new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top, rect.width(), rect.height(), false); 46 | } else { 47 | source = new PlanarYUVLuminanceSource(data, width, height, 0, 0, width, height, false); 48 | } 49 | rawResult = mMultiFormatReader.decodeWithState(new BinaryBitmap(new HybridBinarizer(source))); 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } finally { 53 | mMultiFormatReader.reset(); 54 | } 55 | 56 | if (rawResult != null) { 57 | result = rawResult.getText(); 58 | } 59 | return result; 60 | } 61 | } -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable-xxhdpi/ic_flash_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/ZXingLibrary/src/main/res/drawable-xxhdpi/ic_flash_light.png -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/ic_brightness_high_white_32dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/ic_brightness_low_white_32dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/ic_zxing_circle_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/qrcode_default_grid_scan_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/ZXingLibrary/src/main/res/drawable/qrcode_default_grid_scan_line.png -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/qrcode_default_scan_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/ZXingLibrary/src/main/res/drawable/qrcode_default_scan_line.png -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/scan_icon_scanline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/ZXingLibrary/src/main/res/drawable/scan_icon_scanline.png -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/drawable/selector_btn_orange.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/layout/activity_z_xing_scan.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/layout/toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/values/zxing_colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #f57257 4 | #f46444 5 | #f46444 6 | 7 | #CCf57257 8 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/values/zxing_ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ZXingLibrary/src/main/res/values/zxing_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/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 | 23 | -keep class com.wang.avi.** { *; } 24 | -keep class com.wang.avi.indicators.** { *; } 25 | 26 | -keep class jsc.kit.** { *; } 27 | #>>>zxing 28 | -keep class com.google.zxing.** { *; } 29 | 30 | #>>>retrofit2 31 | # Retain generic type information for use by reflection by converters and adapters. 32 | -keepattributes Signature 33 | # Retain service method parameters. 34 | -keepclassmembernames,allowobfuscation interface * { 35 | @retrofit2.http.* ; 36 | } 37 | # Ignore annotation used for build tooling. 38 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 39 | 40 | #>>>okhttp3 41 | -dontwarn okhttp3.** 42 | -dontwarn okio.** 43 | -dontwarn javax.annotation.** 44 | -dontwarn org.conscrypt.** 45 | # A resource is loaded with a relative path so the package of this class must be preserved. 46 | -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase 47 | 48 | #>>>rxandroid 49 | -keep class io.reactivex.android.**{*;} 50 | -keep class io.reactivex.**{*;} -------------------------------------------------------------------------------- /app/src/androidTest/java/jsc/exam/jsckit/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("jsc.exam.jsckit", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/assets/img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/assets/img/1.jpg -------------------------------------------------------------------------------- /app/src/main/assets/img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/assets/img/2.jpg -------------------------------------------------------------------------------- /app/src/main/assets/img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/assets/img/3.jpg -------------------------------------------------------------------------------- /app/src/main/assets/img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/assets/img/4.jpg -------------------------------------------------------------------------------- /app/src/main/assets/img/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/assets/img/5.jpg -------------------------------------------------------------------------------- /app/src/main/assets/img/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/assets/img/6.jpg -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/Configration.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit; 2 | 3 | public class Configration { 4 | 5 | /**记录上一次显示广告界面的时间戳字段*/ 6 | public final static String SP_ADVERTISEMENT_LAST_SHOW_TIME = "advertisement_last_show_time"; 7 | /**记录广告图片的保存路径字段*/ 8 | public final static String SP_ADVERTISEMENT_PICTURE = "advertisement_picture"; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/InstanceManager.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit; 2 | 3 | import android.app.Application; 4 | 5 | import jsc.kit.component.utils.BitmapCacheManager; 6 | 7 | public class InstanceManager { 8 | private volatile static InstanceManager instance = null; 9 | private boolean isInitialized = false; 10 | private BitmapCacheManager bitmapCacheManager; 11 | 12 | private InstanceManager(){} 13 | 14 | public static InstanceManager getInstance() { 15 | if (instance == null){ 16 | synchronized (InstanceManager.class){ 17 | if (instance == null) 18 | instance = new InstanceManager(); 19 | } 20 | } 21 | return instance; 22 | } 23 | 24 | public void init(Application application){ 25 | isInitialized = true; 26 | bitmapCacheManager = new BitmapCacheManager(); 27 | } 28 | 29 | public BitmapCacheManager getBitmapCacheManager() { 30 | checkIsInitialized(); 31 | return bitmapCacheManager; 32 | } 33 | 34 | private void checkIsInitialized(){ 35 | if (!isInitialized) 36 | throw new RuntimeException("Please init first."); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/TemplateActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import jsc.exam.jsckit.ui.BaseActivity; 7 | 8 | public class TemplateActivity extends BaseActivity { 9 | 10 | @Override 11 | protected void onCreate(@Nullable Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_template); 14 | setTitle(getClass().getSimpleName().replace("Activity", "")); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/adapter/ComponentItemDecoration.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.adapter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Rect; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.util.TypedValue; 8 | import android.view.View; 9 | 10 | /** 11 | * Created by Justin Qin on 7/22/2018. 12 | */ 13 | 14 | public class ComponentItemDecoration extends RecyclerView.ItemDecoration { 15 | 16 | int space; 17 | public ComponentItemDecoration(Context context){ 18 | space = (int) (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, context.getResources().getDisplayMetrics()) + .5f); 19 | } 20 | 21 | @Override 22 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { 23 | super.getItemOffsets(outRect, view, parent, state); 24 | outRect.set(space, space, space, space); 25 | } 26 | 27 | @Override 28 | public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { 29 | super.onDraw(c, parent, state); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/adapter/MyFragmentPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.adapter; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentPagerAdapter; 7 | import android.view.ViewGroup; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * TODO<主页面适配器> 13 | * 14 | * @author jsc 15 | */ 16 | public class MyFragmentPagerAdapter extends FragmentPagerAdapter { 17 | 18 | private List mFragments; 19 | 20 | public MyFragmentPagerAdapter(FragmentManager fm) { 21 | super(fm); 22 | } 23 | 24 | public void setFragments(List fragments) { 25 | this.mFragments = fragments; 26 | notifyDataSetChanged(); 27 | } 28 | 29 | public List getFragments() { 30 | return mFragments; 31 | } 32 | 33 | @Override 34 | public Fragment getItem(int position) { 35 | if (mFragments != null && mFragments.size() > 0) { 36 | return mFragments.get(position); 37 | } else { 38 | return null; 39 | } 40 | } 41 | 42 | @NonNull 43 | @Override 44 | public Object instantiateItem(ViewGroup container, int position) { 45 | return super.instantiateItem(container, position); 46 | } 47 | 48 | @Override 49 | public int getCount() { 50 | return mFragments == null ? 0 : mFragments.size(); 51 | } 52 | 53 | /** 54 | * 重写此方法,不做实现,可防止子fragment被回收 55 | */ 56 | @Override 57 | public void destroyItem(ViewGroup container, int position, Object object) { 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/entity/ApkInfo.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.entity; 2 | 3 | public class ApkInfo { 4 | private String type; 5 | private int versionCode; 6 | private String versionName; 7 | private boolean enabled; 8 | private String outputFile; 9 | private String fullName; 10 | private String baseName; 11 | 12 | public String getType() { 13 | return type; 14 | } 15 | 16 | public void setType(String type) { 17 | this.type = type; 18 | } 19 | 20 | public int getVersionCode() { 21 | return versionCode; 22 | } 23 | 24 | public void setVersionCode(int versionCode) { 25 | this.versionCode = versionCode; 26 | } 27 | 28 | public String getVersionName() { 29 | return versionName; 30 | } 31 | 32 | public void setVersionName(String versionName) { 33 | this.versionName = versionName; 34 | } 35 | 36 | public boolean isEnabled() { 37 | return enabled; 38 | } 39 | 40 | public void setEnabled(boolean enabled) { 41 | this.enabled = enabled; 42 | } 43 | 44 | public String getOutputFile() { 45 | return outputFile; 46 | } 47 | 48 | public void setOutputFile(String outputFile) { 49 | this.outputFile = outputFile; 50 | } 51 | 52 | public String getFullName() { 53 | return fullName; 54 | } 55 | 56 | public void setFullName(String fullName) { 57 | this.fullName = fullName; 58 | } 59 | 60 | public String getBaseName() { 61 | return baseName; 62 | } 63 | 64 | public void setBaseName(String baseName) { 65 | this.baseName = baseName; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/entity/Banner.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.entity; 2 | 3 | /** 4 | * Created on 2018/3/10. 5 | * 6 | * @author jsc 7 | */ 8 | 9 | public class Banner { 10 | private String label; 11 | private String url; 12 | 13 | public Banner(String url) { 14 | this("", url); 15 | } 16 | 17 | public Banner(String label, String url) { 18 | this.label = label; 19 | this.url = url; 20 | } 21 | 22 | public String getLabel() { 23 | return label; 24 | } 25 | 26 | public void setLabel(String label) { 27 | this.label = label; 28 | } 29 | 30 | public String getUrl() { 31 | return url; 32 | } 33 | 34 | public void setUrl(String url) { 35 | this.url = url; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/entity/ClassItem.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.entity; 2 | 3 | public class ClassItem { 4 | private String label; 5 | private Class cls; 6 | private boolean updated; 7 | 8 | public ClassItem() { 9 | } 10 | 11 | public ClassItem(String label, Class cls) { 12 | this(label, cls, false); 13 | } 14 | 15 | public ClassItem(String label, Class cls, boolean updated) { 16 | this.label = label; 17 | this.cls = cls; 18 | this.updated = updated; 19 | } 20 | 21 | public String getLabel() { 22 | return label; 23 | } 24 | 25 | public void setLabel(String label) { 26 | this.label = label; 27 | } 28 | 29 | public Class getCls() { 30 | return cls; 31 | } 32 | 33 | public void setCls(Class cls) { 34 | this.cls = cls; 35 | } 36 | 37 | public boolean isUpdated() { 38 | return updated; 39 | } 40 | 41 | public void setUpdated(boolean updated) { 42 | this.updated = updated; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/entity/ComponentItem.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.entity; 2 | 3 | public class ComponentItem extends ClassItem{ 4 | 5 | private String fragmentClassName; 6 | 7 | public ComponentItem() { 8 | } 9 | 10 | public ComponentItem(String label, Class cls) { 11 | super(label, cls); 12 | } 13 | 14 | public ComponentItem(String label, Class cls, boolean updated) { 15 | super(label, cls, updated); 16 | } 17 | 18 | public ComponentItem(String label, Class cls, boolean updated, String fragmentClassName) { 19 | super(label, cls, updated); 20 | this.fragmentClassName = fragmentClassName; 21 | } 22 | 23 | public String getFragmentClassName() { 24 | return fragmentClassName; 25 | } 26 | 27 | public void setFragmentClassName(String fragmentClassName) { 28 | this.fragmentClassName = fragmentClassName; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/entity/OutputType.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.entity; 2 | 3 | public class OutputType { 4 | private String type; 5 | 6 | public String getType() { 7 | return type; 8 | } 9 | 10 | public void setType(String type) { 11 | this.type = type; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/entity/User.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.entity; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class User implements Parcelable { 7 | private String id; 8 | private String name; 9 | private int age; 10 | private int sex; 11 | 12 | public String getId() { 13 | return id; 14 | } 15 | 16 | public void setId(String id) { 17 | this.id = id; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public int getAge() { 29 | return age; 30 | } 31 | 32 | public void setAge(int age) { 33 | this.age = age; 34 | } 35 | 36 | public int getSex() { 37 | return sex; 38 | } 39 | 40 | public void setSex(int sex) { 41 | this.sex = sex; 42 | } 43 | 44 | protected User(Parcel in) { 45 | id = in.readString(); 46 | name = in.readString(); 47 | age = in.readInt(); 48 | sex = in.readInt(); 49 | } 50 | 51 | public static final Creator CREATOR = new Creator() { 52 | @Override 53 | public User createFromParcel(Parcel in) { 54 | return new User(in); 55 | } 56 | 57 | @Override 58 | public User[] newArray(int size) { 59 | return new User[size]; 60 | } 61 | }; 62 | 63 | @Override 64 | public int describeContents() { 65 | return 0; 66 | } 67 | 68 | @Override 69 | public void writeToParcel(Parcel dest, int flags) { 70 | dest.writeString(getId()); 71 | dest.writeString(getName()); 72 | dest.writeInt(getAge()); 73 | dest.writeInt(getSex()); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/service/ApiService.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.service; 2 | 3 | import io.reactivex.Observable; 4 | import jsc.exam.jsckit.entity.User; 5 | import jsc.kit.retrofit2.response.BaseResponse; 6 | import retrofit2.http.GET; 7 | import retrofit2.http.Path; 8 | 9 | public interface ApiService { 10 | 11 | @GET("user/{userId}") 12 | Observable> login(@Path("userId") String userId); 13 | 14 | @GET("JustinRoom/JSCKit/master/capture/output.json") 15 | Observable getVersionInfo(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/AutoSizeTextViewActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.util.TypedValue; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import java.util.Random; 10 | 11 | import jsc.exam.jsckit.R; 12 | import jsc.exam.jsckit.ui.BaseActivity; 13 | import jsc.kit.component.widget.AutoTextSizeView; 14 | 15 | public class AutoSizeTextViewActivity extends BaseActivity { 16 | 17 | AutoTextSizeView autoTextSizeView; 18 | View myView; 19 | 20 | @Override 21 | protected void onCreate(@Nullable Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_auto_size_text_view); 24 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 25 | 26 | autoTextSizeView = findViewById(R.id.auto_text_size_view); 27 | myView = findViewById(R.id.rv); 28 | } 29 | 30 | String[] text = {"hello, world", "Hello", "Kit"}; 31 | int[] widths = {100, 64, 128, 48}; 32 | public void onWidgetClick(View view){ 33 | switch (view.getId()){ 34 | case R.id.btn_change_text: 35 | autoTextSizeView.setAutoSizeImmediatelyText(text[new Random().nextInt(3)]); 36 | break; 37 | case R.id.btn_change_width: 38 | int dp = widths[new Random().nextInt(4)]; 39 | int pix = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics()); 40 | ViewGroup.LayoutParams params = autoTextSizeView.getLayoutParams(); 41 | params.width = pix; 42 | autoTextSizeView.setLayoutParams(params); 43 | 44 | ViewGroup.LayoutParams p = myView.getLayoutParams(); 45 | p.width = pix; 46 | myView.setLayoutParams(p); 47 | break; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/JSCItemLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.util.TypedValue; 6 | import android.view.View; 7 | 8 | import jsc.exam.jsckit.R; 9 | import jsc.exam.jsckit.ui.BaseActivity; 10 | import jsc.kit.component.itemlayout.JSCItemLayout; 11 | import jsc.kit.component.widget.DotView; 12 | 13 | public class JSCItemLayoutActivity extends BaseActivity { 14 | 15 | DotView dotView; 16 | 17 | @Override 18 | protected void onCreate(@Nullable Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_jsc_item_layout); 21 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 22 | 23 | JSCItemLayout layout = findViewById(R.id.item_layout_02); 24 | layout.getDotView().setTextSize(TypedValue.COMPLEX_UNIT_SP, 11); 25 | layout.setUnreadCount(10); 26 | 27 | dotView = findViewById(R.id.dot_view); 28 | dotView.setOnClickListener(new View.OnClickListener() { 29 | @Override 30 | public void onClick(View v) { 31 | dotView.setShape(DotView.CIRCULAR); 32 | } 33 | }); 34 | } 35 | 36 | public void widgetClick(View view){ 37 | switch (view.getId()){ 38 | case R.id.item_layout_01: 39 | dotView.setShape(DotView.ROUND_CORNER_SQUARE, 4); 40 | break; 41 | case R.id.item_layout_02: 42 | dotView.setShape(DotView.TRIANGLE, 4); 43 | break; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/JSCRoundCornerProgressBarActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import jsc.exam.jsckit.R; 7 | import jsc.exam.jsckit.ui.BaseActivity; 8 | 9 | public class JSCRoundCornerProgressBarActivity extends BaseActivity { 10 | 11 | @Override 12 | protected void onCreate(@Nullable Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_jsc_round_corner_progress_bar); 15 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/RadarViewActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import jsc.exam.jsckit.R; 10 | import jsc.exam.jsckit.ui.BaseActivity; 11 | import jsc.kit.component.radarview.RadarEntity; 12 | import jsc.kit.component.radarview.RadarView; 13 | 14 | public class RadarViewActivity extends BaseActivity { 15 | 16 | @Override 17 | protected void onCreate(@Nullable Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_radar_view); 20 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 21 | 22 | RadarView radarView1 = findViewById(R.id.radar_view1); 23 | RadarView radarView2 = findViewById(R.id.radar_view2); 24 | String[] labels = new String[]{"中单", "射手", "辅助", "打野", "上单"}; 25 | float[] data = new float[]{0.6f, 0.95f, 0.45f, 0.9f, 0.7f}; 26 | int[] align = new int[]{RadarEntity.ALIGN_RIGHT, RadarEntity.ALIGN_BOTTOM, RadarEntity.ALIGN_BOTTOM, RadarEntity.ALIGN_LEFT, RadarEntity.ALIGN_TOP}; 27 | List entities = new ArrayList<>(); 28 | for (int i = 0; i < data.length; i++) { 29 | RadarEntity entity = new RadarEntity(); 30 | entity.setLabel(labels[i]); 31 | entity.setValue(data[i]); 32 | entity.setLabelAlignType(align[i]); 33 | entities.add(entity); 34 | } 35 | radarView1.setRadarEntities(entities); 36 | radarView2.setRadarEntities(entities); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/RippleViewActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | 7 | import jsc.exam.jsckit.R; 8 | import jsc.exam.jsckit.ui.BaseActivity; 9 | 10 | public class RippleViewActivity extends BaseActivity { 11 | 12 | final String TAG = getClass().getSimpleName(); 13 | // RippleView rippleView; 14 | 15 | @Override 16 | protected void onCreate(@Nullable Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_ripple_view); 19 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 20 | 21 | // rippleView = findViewById(R.id.ripple_view); 22 | // rippleView.setColor(Color.CYAN); 23 | // rippleView.setMinRadius(50.0f); 24 | // rippleView.setRepeatCount(-1); 25 | // rippleView.setAutoRunOnAttached(true); 26 | // rippleView.setAnimListener(new RippleView.AnimListener() { 27 | // @Override 28 | // public void onAnimationStart() { 29 | // Log.i(TAG, "onAnimationStart: "); 30 | // } 31 | // 32 | // @Override 33 | // public void onAnimationRepeat(int repeatIndex) { 34 | // Log.i(TAG, "onAnimationRepeat: repeatIndex = " + repeatIndex); 35 | // } 36 | // 37 | // @Override 38 | // public void onAnimationStop() { 39 | // Log.i(TAG, "onAnimationStop: "); 40 | // } 41 | // }); 42 | } 43 | 44 | public void widgetClick(View v){ 45 | // rippleView.start(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/ScannerCameraMaskActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.ViewGroup; 6 | import android.widget.FrameLayout; 7 | import android.widget.ImageView; 8 | 9 | import jsc.exam.jsckit.R; 10 | import jsc.exam.jsckit.ui.BaseActivity; 11 | import jsc.kit.component.utils.CompatResourceUtils; 12 | import jsc.kit.component.widget.ScannerCameraMask; 13 | 14 | public class ScannerCameraMaskActivity extends BaseActivity { 15 | 16 | @Override 17 | protected void onCreate(@Nullable Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | FrameLayout frameLayout = new FrameLayout(this); 20 | setContentView(frameLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); 21 | // 22 | ImageView imageView = new ImageView(this); 23 | imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); 24 | imageView.setImageResource(R.drawable.beauty_bg); 25 | frameLayout.addView(imageView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); 26 | 27 | // 28 | ScannerCameraMask scannerCameraMask = new ScannerCameraMask(this); 29 | frameLayout.addView(scannerCameraMask, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); 30 | scannerCameraMask.setText("Put QR code inside camera lens please."); 31 | scannerCameraMask.setTextVerticalMargin(CompatResourceUtils.getDimensionPixelSize(this, R.dimen.space_16)); 32 | scannerCameraMask.setTopMargin(CompatResourceUtils.getDimensionPixelSize(this, R.dimen.space_32)); 33 | 34 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 35 | if (getSupportActionBar() != null) 36 | getSupportActionBar().hide(); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/component/VScrollScreenLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.component; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.view.View; 7 | 8 | import jsc.exam.jsckit.R; 9 | import jsc.exam.jsckit.ui.BaseActivity; 10 | import jsc.kit.component.vscrollscreen.VScrollScreenLayout; 11 | 12 | public class VScrollScreenLayoutActivity extends BaseActivity { 13 | 14 | VScrollScreenLayout scrollScreenLayout; 15 | @Override 16 | protected void onCreate(@Nullable Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_v_scroll_screen_layout); 19 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 20 | 21 | scrollScreenLayout = findViewById(R.id.v_scroll_screen_layout); 22 | scrollScreenLayout.setOnScrollPageChangedListener(new VScrollScreenLayout.OnScrollPageChangedListener() { 23 | @Override 24 | public void onScroll(Context context, int pageIndex) { 25 | showCustomToast("The current page is " + (pageIndex + 1)); 26 | } 27 | }); 28 | } 29 | 30 | public void widgetClick(View v){ 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/fragment/DefaultFragment.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.NonNull; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.view.Gravity; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.FrameLayout; 12 | import android.widget.TextView; 13 | 14 | public class DefaultFragment extends Fragment { 15 | 16 | public final static String EXTRA_CONTENT = "extra_content"; 17 | 18 | @Nullable 19 | @Override 20 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | FrameLayout layout = new FrameLayout(inflater.getContext()); 22 | layout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); 23 | 24 | TextView textView = new TextView(inflater.getContext()); 25 | textView.setText(getArguments() == null ? "default content" : getArguments().getString(EXTRA_CONTENT)); 26 | FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); 27 | params.gravity = Gravity.CENTER; 28 | layout.addView(textView, params); 29 | return layout; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/fragment/ReboundLinearLayoutFragment.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.NonNull; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.view.Gravity; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.Button; 12 | import android.widget.LinearLayout; 13 | import android.widget.Toast; 14 | 15 | import jsc.exam.jsckit.R; 16 | 17 | /** 18 | *
Email:1006368252@qq.com 19 | *
QQ:1006368252 20 | *
https://github.com/JustinRoom/JSCKit 21 | * 22 | * @author jiangshicheng 23 | */ 24 | public class ReboundLinearLayoutFragment extends Fragment { 25 | 26 | @Nullable 27 | @Override 28 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 29 | LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.fragment_rebound_linear_layout, container, false); 30 | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); 31 | params.gravity = Gravity.CENTER_HORIZONTAL; 32 | Button button = new Button(layout.getContext()); 33 | button.setText("Hello"); 34 | button.setOnClickListener(new View.OnClickListener() { 35 | @Override 36 | public void onClick(View v) { 37 | Toast.makeText(v.getContext(), "Hello", Toast.LENGTH_SHORT).show(); 38 | } 39 | }); 40 | layout.addView(button, 0, params); 41 | return layout; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/mvp/model/ITestModel.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.mvp.model; 2 | 3 | import io.reactivex.Observable; 4 | import jsc.kit.component.baseui.basemvp.IBaseModel; 5 | 6 | /** 7 | *
Email:1006368252@qq.com 8 | *
QQ:1006368252 9 | *
https://github.com/JustinRoom/JSCKit 10 | * 11 | * @author jiangshicheng 12 | * @createTime 2018-06-06 2:29 PM Wednesday 13 | */ 14 | public interface ITestModel extends IBaseModel { 15 | 16 | Observable loadVersionInfo(String baseUrl, String token, boolean showNetLog); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/mvp/model/TestModel.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.mvp.model; 2 | 3 | import android.util.Pair; 4 | 5 | import io.reactivex.Observable; 6 | import jsc.exam.jsckit.service.ApiService; 7 | import jsc.kit.retrofit2.retrofit.CustomHttpClient; 8 | import jsc.kit.retrofit2.retrofit.CustomRetrofit; 9 | 10 | /** 11 | *
Email:1006368252@qq.com 12 | *
QQ:1006368252 13 | *
https://github.com/JustinRoom/JSCKit 14 | * 15 | * @author jiangshicheng 16 | * @createTime 2018-06-06 2:31 PM Wednesday 17 | */ 18 | public class TestModel implements ITestModel { 19 | 20 | @Override 21 | public Observable loadVersionInfo(String baseUrl, String token, boolean showNetLog) { 22 | return new CustomRetrofit() 23 | .setBaseUrl(baseUrl) 24 | .setOkHttpClient(new CustomHttpClient() 25 | .addHeader(new Pair<>("token", token)) 26 | .setConnectTimeout(5_000) 27 | .setShowLog(showNetLog) 28 | .createOkHttpClient()) 29 | .createRetrofit() 30 | .create(ApiService.class) 31 | .getVersionInfo(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/mvp/view/CommonView.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.mvp.view; 2 | 3 | import android.app.Dialog; 4 | 5 | import jsc.kit.component.baseui.basemvp.IBaseView; 6 | 7 | /** 8 | *
Email:1006368252@qq.com 9 | *
QQ:1006368252 10 | *
https://github.com/JustinRoom/JSCKit 11 | * 12 | * @author jiangshicheng 13 | * @createTime 2018-06-06 2:22 PM Wednesday 14 | */ 15 | public interface CommonView extends IBaseView{ 16 | 17 | /** 18 | * Show log of network requesting or not. 19 | * @return show if {@code true}, else not. 20 | */ 21 | boolean isShowNetLog(); 22 | 23 | /** 24 | * Get the base url of network requesting. 25 | * @return base url 26 | */ 27 | String getBaseUrl(); 28 | 29 | /** 30 | * Get network requesting token 31 | * @return token 32 | */ 33 | String getToken(); 34 | 35 | /** 36 | * Get the current user id 37 | * @return the current user id 38 | */ 39 | String getCurrentUserId(); 40 | 41 | /** 42 | * Create loading dialog. 43 | * @return loading dialog instance 44 | */ 45 | Dialog getLoadingDialog(); 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/mvp/view/ITestView.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.mvp.view; 2 | 3 | import jsc.kit.component.baseui.basemvp.IBaseView; 4 | 5 | /** 6 | *
Email:1006368252@qq.com 7 | *
QQ:1006368252 8 | *
https://github.com/JustinRoom/JSCKit 9 | * 10 | * @author jiangshicheng 11 | * @createTime 2018-06-06 2:22 PM Wednesday 12 | */ 13 | public interface ITestView extends IBaseView{ 14 | 15 | void onLoadVersionInfo(String result); 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/jsc/exam/jsckit/ui/zxing/ZXingScannerActivity.java: -------------------------------------------------------------------------------- 1 | package jsc.exam.jsckit.ui.zxing; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | 7 | import jsc.exam.jsckit.R; 8 | import jsc.exam.jsckit.ui.BaseActivity; 9 | import jsc.kit.zxing.zxing.ui.ZXingFragment; 10 | 11 | public class ZXingScannerActivity extends BaseActivity { 12 | 13 | @Override 14 | protected void onCreate(@Nullable Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_z_xing_scanner); 17 | setTitleBarTitle(getClass().getSimpleName().replace("Activity", "")); 18 | 19 | getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, new ZXingFragment()).commit(); 20 | } 21 | 22 | public void widgetClick(View v) { 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ripple_round_corner_white_r4.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/hand_o_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xhdpi/hand_o_up.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/butterfly_96px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xxhdpi/butterfly_96px.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/main_icon_create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xxhdpi/main_icon_create.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/main_mid_show_left_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xxhdpi/main_mid_show_left_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/main_mid_show_left_fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xxhdpi/main_mid_show_left_fullscreen.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/main_mid_show_left_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xxhdpi/main_mid_show_left_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/main_mid_show_left_yx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable-xxhdpi/main_mid_show_left_yx.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/beauty_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable/beauty_bg.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_gray_light_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_theme_light_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable/header.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment_turned_in_blue_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_chevron_left_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_chevron_left_white_48dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_home_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info_blue_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_navigation_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_scanner_blue_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_toys_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_decoration_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/jsc_button_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/linear_layout_space_line_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ripple_round_corner_white_r4.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 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tiger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JustinRoom/JSCKit/f5547ab61e08ae99b6051ae163cb8a1e6bd93475/app/src/main/res/drawable/tiger.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_auto_size_text_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |