├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── android_ctrip
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-playstore.png
│ ├── java
│ │ └── net
│ │ │ └── lishaoy
│ │ │ └── android_ctrip
│ │ │ ├── channel
│ │ │ └── MethodChannelPlugin.java
│ │ │ ├── events
│ │ │ ├── GotoDestinationSearchPageEvent.java
│ │ │ ├── GotoSpeakDestinationPageEvent.java
│ │ │ ├── GotoSpeakTravelPageEvent.java
│ │ │ └── GotoTravelSearchPageEvent.java
│ │ │ ├── model
│ │ │ └── CHANNEL.java
│ │ │ ├── service
│ │ │ └── MethodChannelServiceImp.java
│ │ │ ├── util
│ │ │ ├── GotoFlutterPage.java
│ │ │ └── NoTouchViewPager.java
│ │ │ └── view
│ │ │ ├── MainActivity.java
│ │ │ ├── adapter
│ │ │ └── NavigatorAdapter.java
│ │ │ ├── destination
│ │ │ ├── DestinationFragment.java
│ │ │ └── DestinationSearchActivity.java
│ │ │ ├── my
│ │ │ └── MyFragment.java
│ │ │ ├── speak
│ │ │ └── SpeakActivity.java
│ │ │ └── travel
│ │ │ ├── TravelFragment.java
│ │ │ └── TravelSearchActivity.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_destination_search.xml
│ │ ├── activity_home.xml
│ │ ├── activity_speak.xml
│ │ ├── activity_travel_search.xml
│ │ ├── fragment_destination.xml
│ │ ├── fragment_my.xml
│ │ └── fragment_travel.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ ├── ic_launcher_round.png
│ │ ├── lvpai.png
│ │ ├── lvpai_active.png
│ │ ├── mude.png
│ │ ├── mude_active.png
│ │ ├── wode.png
│ │ ├── wode_active.png
│ │ ├── xiecheng.png
│ │ └── xiecheng_active.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_foreground.png
│ │ └── ic_launcher_round.png
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── network_security_config.xml
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── android_ctrip
│ └── ExampleUnitTest.java
├── build.gradle
├── ctrip.gradle
├── flutter_module
├── .android
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── net
│ │ │ │ └── lishaoy
│ │ │ │ └── ctrip
│ │ │ │ └── ft
│ │ │ │ └── flutter
│ │ │ │ └── module
│ │ │ │ └── host
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── include_flutter.groovy
│ ├── local.properties
│ └── settings.gradle
├── .dart_tool
│ ├── flutter_build
│ │ ├── 371f31eeedc4812d0fc855d0a8a33813
│ │ │ ├── .filecache
│ │ │ ├── app.dill
│ │ │ ├── debug_android_application.stamp
│ │ │ ├── flutter_assets.d
│ │ │ ├── kernel_snapshot.d
│ │ │ └── kernel_snapshot.stamp
│ │ └── 42670e4d7be63eaa05265d78ca7eb095
│ │ │ ├── .filecache
│ │ │ ├── app.dill
│ │ │ ├── debug_android_application.stamp
│ │ │ ├── flutter_assets.d
│ │ │ ├── kernel_snapshot.d
│ │ │ └── kernel_snapshot.stamp
│ └── package_config.json
├── .flutter-plugins-dependencies
├── .gitignore
├── .idea
│ ├── caches
│ │ └── build_file_checksums.ser
│ ├── codeStyles
│ │ └── Project.xml
│ ├── gradle.xml
│ ├── libraries
│ │ ├── Dart_Packages.xml
│ │ ├── Dart_SDK.xml
│ │ └── Flutter_Plugins.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ ├── vcs.xml
│ └── workspace.xml
├── .metadata
├── .packages
├── README.md
├── assets
│ ├── fonts
│ │ ├── PingFang-Italic.ttf
│ │ ├── PingFang-Regular.ttf
│ │ └── PingFang_Bold.ttf
│ └── images
│ │ ├── kefu.png
│ │ ├── lvpai_issue_position.png
│ │ ├── lvpai_issue_sight.png
│ │ ├── lvpai_search_list.png
│ │ ├── lvpai_search_tag.png
│ │ ├── sousuo.png
│ │ ├── type_channelgroup.png
│ │ ├── type_channelgs.png
│ │ ├── type_channelplane.png
│ │ ├── type_channeltrain.png
│ │ ├── type_cruise.png
│ │ ├── type_district.png
│ │ ├── type_food.png
│ │ ├── type_hotel.png
│ │ ├── type_huodong.png
│ │ ├── type_shop.png
│ │ ├── type_sight.png
│ │ ├── type_ticket.png
│ │ ├── type_travelgroup.png
│ │ ├── user1.png
│ │ ├── xiaoxi_grey.png
│ │ ├── xiaoxi_white.png
│ │ └── yuyin.png
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── lib
│ ├── dao
│ │ ├── destination_dao.dart
│ │ ├── destination_search_dao.dart
│ │ ├── search_dao.dart
│ │ ├── trave_hot_keyword_dao.dart
│ │ ├── trave_search_dao.dart
│ │ ├── trave_search_hot_dao.dart
│ │ ├── travel_dao.dart
│ │ ├── travel_params_dao.dart
│ │ └── travel_tab_dao.dart
│ ├── main.dart
│ ├── model
│ │ ├── destination_model.dart
│ │ ├── destination_search_model.dart
│ │ ├── seach_model.dart
│ │ ├── travel_hot_keyword_model.dart
│ │ ├── travel_model.dart
│ │ ├── travel_params_model.dart
│ │ ├── travel_search_hot_model.dart
│ │ ├── travel_search_model.dart
│ │ └── travel_tab_model.dart
│ ├── pages
│ │ ├── destination_page.dart
│ │ ├── destination_search_page.dart
│ │ ├── search_page.dart
│ │ ├── speak_page.dart
│ │ ├── travel_page.dart
│ │ ├── travel_search_page.dart
│ │ └── travel_tab_page.dart
│ ├── plugin
│ │ ├── asr_manager.dart
│ │ ├── method_channel_plugin.dart
│ │ └── vertical_tab_view.dart
│ ├── utils
│ │ └── navigator_util.dart
│ └── widget
│ │ ├── loading_container.dart
│ │ ├── scalable_box.dart
│ │ └── search_bar.dart
├── local.properties
├── pubspec.lock
├── pubspec.yaml
├── settings.gradle
└── test
│ └── widget_test.dart
├── ft_home
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── ft_home
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── net
│ │ │ └── lishaoy
│ │ │ └── ft_home
│ │ │ ├── GridNavView.java
│ │ │ ├── HomeFragment.java
│ │ │ ├── LocalNavView.java
│ │ │ ├── TabPageView.java
│ │ │ ├── adapter
│ │ │ ├── HomeBannerAdapter.java
│ │ │ ├── HomeSearchBarPlaceHolderAdapter.java
│ │ │ ├── SubNavViewAdapter.java
│ │ │ ├── TabFoodAdapter.java
│ │ │ ├── TabNearAdapter.java
│ │ │ ├── TabPageAdepter.java
│ │ │ ├── TabScenicAdapter.java
│ │ │ └── TabSelectAdapter.java
│ │ │ ├── api
│ │ │ └── RequestCenter.java
│ │ │ ├── events
│ │ │ ├── IsLoadMoreSelectEvent.java
│ │ │ ├── LoadMoreFoodEvent.java
│ │ │ ├── LoadMoreNearEvent.java
│ │ │ ├── LoadMoreScenicEvent.java
│ │ │ └── LoadMoreSelectEvent.java
│ │ │ ├── model
│ │ │ ├── CHANNEL.java
│ │ │ ├── Home.java
│ │ │ ├── TabFood.java
│ │ │ ├── TabNear.java
│ │ │ ├── TabNearItem.java
│ │ │ ├── TabScenic.java
│ │ │ ├── TabSelect.java
│ │ │ └── TabSelectRequest.java
│ │ │ ├── searchPages
│ │ │ └── SearchPageActivity.java
│ │ │ ├── service
│ │ │ └── HomeServiceImpl.java
│ │ │ ├── speak
│ │ │ └── SpeakActivity.java
│ │ │ ├── tabPages
│ │ │ ├── FoodFragment.java
│ │ │ ├── NearFragment.java
│ │ │ ├── ScenicFragment.java
│ │ │ └── SelectFragment.java
│ │ │ └── util
│ │ │ ├── CustomScrollView.java
│ │ │ ├── EllipseIndicator.java
│ │ │ ├── NoTouchViewPager.java
│ │ │ ├── ScaleTransitionPagerTitleView.java
│ │ │ └── ScrollViewPager.java
│ └── res
│ │ ├── drawable
│ │ ├── bg10.jpg
│ │ ├── nav_circular_bg.xml
│ │ ├── search_bar_circular_bg.xml
│ │ ├── second_floor.png
│ │ ├── shape_home_bar_bg.xml
│ │ ├── shape_home_nav_blue_bg.xml
│ │ ├── shape_home_nav_green_bg.xml
│ │ ├── shape_home_nav_red_bg.xml
│ │ ├── shape_home_nav_yellow_bg.xml
│ │ ├── shape_tab_select_yellow_bg.xml
│ │ ├── tab_food_circular_blue_bg.xml
│ │ ├── tab_food_circular_yellow_bg.xml
│ │ └── tab_title_circular_bg.xml
│ │ ├── layout
│ │ ├── activity_search_page.xml
│ │ ├── activity_speak.xml
│ │ ├── fragment_food.xml
│ │ ├── fragment_home.xml
│ │ ├── fragment_near.xml
│ │ ├── fragment_scenic.xml
│ │ ├── fragment_select.xml
│ │ ├── home_search_bar_place_holder_item.xml
│ │ ├── item_sub_nav.xml
│ │ ├── item_tab_food.xml
│ │ ├── item_tab_page_title.xml
│ │ ├── item_tab_select.xml
│ │ ├── view_grid_nav.xml
│ │ ├── view_local_nav.xml
│ │ └── view_tab_page.xml
│ │ ├── mipmap
│ │ ├── grid_nav_items_dingzhi.png
│ │ ├── grid_nav_items_flight.png
│ │ ├── grid_nav_items_hot.png
│ │ ├── grid_nav_items_hotel.png
│ │ ├── grid_nav_items_jhj.png
│ │ ├── grid_nav_items_minsu.png
│ │ ├── grid_nav_items_train.png
│ │ ├── grid_nav_items_travel.png
│ │ ├── lbsguide.png
│ │ ├── lvpai.png
│ │ ├── lvpai_active.png
│ │ ├── mude.png
│ │ ├── mude_active.png
│ │ ├── search.png
│ │ ├── voice.png
│ │ ├── wode.png
│ │ ├── wode_active.png
│ │ ├── xiecheng.png
│ │ └── xiecheng_active.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── ft_home
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── key.properties
├── lib_asr
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── libs
│ └── bdasr_V3_20191210_81acdf5.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_asr
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── net
│ │ │ └── lishaoy
│ │ │ └── lib_asr
│ │ │ └── asr
│ │ │ ├── AsrManager.java
│ │ │ ├── AsrPlugin.java
│ │ │ ├── OnAsrListener.java
│ │ │ ├── RecogEventAdapter.java
│ │ │ ├── RecogResult.java
│ │ │ └── ResultStateful.java
│ └── jniLibs
│ │ ├── arm64-v8a
│ │ ├── libBaiduSpeechSDK.so
│ │ └── libvad.dnn.so
│ │ ├── x86
│ │ ├── libBaiduSpeechSDK.so
│ │ └── libvad.dnn.so
│ │ └── x86_64
│ │ ├── libBaiduSpeechSDK.so
│ │ └── libvad.dnn.so
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── lib_asr
│ └── ExampleUnitTest.java
├── lib_base
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_base
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_base
│ │ ├── app
│ │ └── service
│ │ │ ├── MethodChannelService.java
│ │ │ └── wrapper
│ │ │ └── MethodChannelImpl.java
│ │ ├── ft_home
│ │ └── service
│ │ │ ├── HomeService.java
│ │ │ └── wrapper
│ │ │ └── HomeImpl.java
│ │ └── lib_webview
│ │ └── service
│ │ ├── WebViewService.java
│ │ └── wrapper
│ │ └── WebViewImpl.java
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── lib_base
│ └── ExampleUnitTest.java
├── lib_common_ui
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_common_ui
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_common_ui
│ │ └── utils
│ │ └── Utils.java
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── lib_common_ui
│ └── ExampleUnitTest.java
├── lib_image_loader
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_image_loader
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── net
│ │ │ └── lishaoy
│ │ │ └── lib_image_loader
│ │ │ ├── app
│ │ │ ├── ImageGlideExtension.java
│ │ │ ├── ImageGlideModel.java
│ │ │ └── ImageLoaderManager.java
│ │ │ ├── image
│ │ │ ├── CustomRequestListener.java
│ │ │ └── Utils.java
│ │ │ └── listener
│ │ │ ├── ImageCallBack.java
│ │ │ └── ImageCallBackListener.java
│ └── res
│ │ └── drawable
│ │ ├── ic_broken_image_black_24dp.xml
│ │ └── ic_image_black_24dp.xml
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── lib_image_loader
│ └── ExampleUnitTest.java
├── lib_network
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_network
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_network
│ │ ├── CommonOkHttpClient.java
│ │ ├── exception
│ │ └── OkHttpException.java
│ │ ├── listener
│ │ ├── DisposeDataHandle.java
│ │ ├── DisposeDataListener.java
│ │ └── DisposeDownloadListener.java
│ │ ├── request
│ │ ├── CommonRequest.java
│ │ └── RequestParams.java
│ │ └── response
│ │ ├── CommonFileCallback.java
│ │ └── CommonJsonCallback.java
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── lib_network
│ └── ExampleUnitTest.java
├── lib_webview
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── net
│ │ └── lishaoy
│ │ └── lib_webview
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── net
│ │ │ └── lishaoy
│ │ │ └── lib_webview
│ │ │ ├── WebActivity.java
│ │ │ ├── base
│ │ │ └── BaseAgentWebFragment.java
│ │ │ ├── events
│ │ │ └── RefreshEvent.java
│ │ │ ├── service
│ │ │ └── WebViewServiceImpl.java
│ │ │ └── widget
│ │ │ └── WebLayout.java
│ └── res
│ │ ├── layout
│ │ ├── activity_web.xml
│ │ └── fragment_twk_web.xml
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── net
│ └── lishaoy
│ └── lib_webview
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | *.zip
16 | key.properties
17 | ctrip_key_store
18 | /app/release
19 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/net/lishaoy/android_ctrip/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.android_ctrip", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/channel/MethodChannelPlugin.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.channel;
2 |
3 | import android.app.Activity;
4 |
5 | import net.lishaoy.android_ctrip.events.GotoDestinationSearchPageEvent;
6 | import net.lishaoy.android_ctrip.events.GotoSpeakDestinationPageEvent;
7 | import net.lishaoy.android_ctrip.events.GotoSpeakTravelPageEvent;
8 | import net.lishaoy.android_ctrip.events.GotoTravelSearchPageEvent;
9 | import net.lishaoy.lib_base.lib_webview.service.wrapper.WebViewImpl;
10 |
11 | import org.greenrobot.eventbus.EventBus;
12 |
13 | import io.flutter.plugin.common.MethodCall;
14 | import io.flutter.plugin.common.MethodChannel;
15 | import io.flutter.view.FlutterView;
16 |
17 | public class MethodChannelPlugin implements MethodChannel.MethodCallHandler {
18 |
19 | private static MethodChannel methodChannel;
20 | private Activity activity;
21 |
22 | private MethodChannelPlugin(Activity activity) {
23 | this.activity = activity;
24 | }
25 |
26 | public static void registerWith(FlutterView flutterView) {
27 | methodChannel = new MethodChannel(flutterView, "MethodChannelPlugin");
28 | MethodChannelPlugin instance = new MethodChannelPlugin((Activity) flutterView.getContext());
29 | methodChannel.setMethodCallHandler(instance);
30 | }
31 |
32 | @Override
33 | public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
34 | if (methodCall.method.equals("gotoDestinationSearchPage")) {
35 | EventBus.getDefault().post(new GotoDestinationSearchPageEvent());
36 | result.success(200);
37 | } else if (methodCall.method.equals("gotoSpeakPage")) {
38 | if(methodCall.argument("pageType").equals("destination")){
39 | EventBus.getDefault().post(new GotoSpeakDestinationPageEvent(methodCall.argument("pageType")));
40 | }if(methodCall.argument("pageType").equals("travel")){
41 | EventBus.getDefault().post(new GotoSpeakTravelPageEvent(methodCall.argument("pageType")));
42 | }
43 | result.success(200);
44 | } else if (methodCall.method.equals("gotoWebView")) {
45 | WebViewImpl.getInstance().gotoWebView(methodCall.argument("url"));
46 | result.success(200);
47 | }else if (methodCall.method.equals("gotoTravelSearchPage")){
48 | EventBus.getDefault().post(new GotoTravelSearchPageEvent());
49 | result.success(200);
50 | }
51 | else {
52 | result.notImplemented();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/events/GotoDestinationSearchPageEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.events;
2 |
3 | public class GotoDestinationSearchPageEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/events/GotoSpeakDestinationPageEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.events;
2 |
3 | public class GotoSpeakDestinationPageEvent {
4 | String pageType;
5 |
6 | public GotoSpeakDestinationPageEvent(String pageType) {
7 | this.pageType = pageType;
8 | }
9 |
10 | public String getPageType() {
11 | return pageType;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/events/GotoSpeakTravelPageEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.events;
2 |
3 | public class GotoSpeakTravelPageEvent {
4 | String pageType;
5 |
6 | public GotoSpeakTravelPageEvent(String pageType) {
7 | this.pageType = pageType;
8 | }
9 |
10 | public String getPageType() {
11 | return pageType;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/events/GotoTravelSearchPageEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.events;
2 |
3 | public class GotoTravelSearchPageEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/model/CHANNEL.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.model;
2 |
3 | public enum CHANNEL {
4 |
5 | HOME("首页", 0x01),
6 |
7 | DESTINATION("目的地", 0x02),
8 |
9 | TRAVEL("旅拍", 0x03),
10 |
11 | MY("我的", 0x04),
12 |
13 | SELECT("精选", 0x05),
14 |
15 | NEAR("附近", 0x06),
16 |
17 | SCENIC("景点", 0x07),
18 |
19 | FOOD("美食", 0x08),
20 |
21 | SELECT_SUB("当地玩法", 0x09),
22 |
23 | NEAR_SUB("探索周边", 0x10),
24 |
25 | SCENIC_SUB("尽情游览", 0x11),
26 |
27 | FOOD_SUB("地道风味", 0x12);
28 |
29 | //所有类型标识
30 | public static final int HOME_ID = 0x01;
31 | public static final int DESTINATION_ID = 0x02;
32 | public static final int TRAVEL_ID = 0x03;
33 | public static final int MY_ID = 0x04;
34 | public static final int SELECT_ID = 0x05;
35 | public static final int NEAR_ID = 0x06;
36 | public static final int SCENIC_ID = 0x07;
37 | public static final int FOOD_ID = 0x08;
38 | public static final int SELECT_SUB_ID = 0x09;
39 | public static final int NEAR_SUB_ID = 0x10;
40 | public static final int SCENIC_SUB_ID = 0x11;
41 | public static final int FOOD_SUB_ID = 0x12;
42 |
43 | private final String key;
44 | private final int value;
45 |
46 | CHANNEL(String key, int value) {
47 | this.key = key;
48 | this.value = value;
49 | }
50 |
51 | public int getValue() {
52 | return value;
53 | }
54 |
55 | public String getKey() {
56 | return key;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/service/MethodChannelServiceImp.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.service;
2 |
3 |
4 | import android.content.Context;
5 | import android.util.Log;
6 |
7 | import com.alibaba.android.arouter.facade.annotation.Route;
8 |
9 | import net.lishaoy.android_ctrip.channel.MethodChannelPlugin;
10 | import net.lishaoy.lib_base.app.service.MethodChannelService;
11 |
12 | import io.flutter.view.FlutterView;
13 |
14 | @Route(path = "/app/MethodChannel")
15 | public class MethodChannelServiceImp implements MethodChannelService {
16 | @Override
17 | public void registerWith(FlutterView flutterView) {
18 | MethodChannelPlugin.registerWith(flutterView);
19 | }
20 |
21 | @Override
22 | public void init(Context context) {
23 | Log.i(MethodChannelServiceImp.class.getSimpleName(),"init");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/util/GotoFlutterPage.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.util;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.fragment.app.FragmentActivity;
7 |
8 | import io.flutter.embedding.android.FlutterActivity;
9 |
10 | public class GotoFlutterPage extends FragmentActivity {
11 | @Override
12 | protected void onCreate(@Nullable Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | startActivity(
15 | FlutterActivity
16 | .withNewEngine()
17 | .initialRoute("destination/search")
18 | .build(this)
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/util/NoTouchViewPager.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.util;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 |
7 | import androidx.viewpager.widget.ViewPager;
8 |
9 | /**
10 | * 使ViewPager不能滑动
11 | */
12 | public class NoTouchViewPager extends ViewPager {
13 |
14 | public NoTouchViewPager(Context context) {
15 | super(context);
16 | }
17 |
18 | public NoTouchViewPager(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | }
21 |
22 | @Override
23 | public boolean onTouchEvent(MotionEvent event) {
24 | return false;
25 | }
26 |
27 | @Override
28 | public boolean onInterceptTouchEvent(MotionEvent event) {
29 | return false;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/view/destination/DestinationFragment.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.view.destination;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 |
6 | import androidx.fragment.app.Fragment;
7 |
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import net.lishaoy.android_ctrip.channel.MethodChannelPlugin;
13 | import net.lishaoy.android_ctrip.events.GotoDestinationSearchPageEvent;
14 | import net.lishaoy.android_ctrip.events.GotoSpeakDestinationPageEvent;
15 | import net.lishaoy.android_ctrip.view.speak.SpeakActivity;
16 |
17 | import org.greenrobot.eventbus.EventBus;
18 | import org.greenrobot.eventbus.Subscribe;
19 |
20 | import io.flutter.facade.Flutter;
21 | import io.flutter.view.FlutterView;
22 |
23 | public class DestinationFragment extends Fragment {
24 |
25 | public DestinationFragment() {
26 | }
27 |
28 | public static DestinationFragment newInstance() {
29 | DestinationFragment fragment = new DestinationFragment();
30 | return fragment;
31 | }
32 |
33 | @Override
34 | public void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | }
37 |
38 | @Override
39 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
40 | Bundle savedInstanceState) {
41 | FlutterView flutterView = Flutter.createView(getActivity(),getLifecycle(),"destination");
42 | MethodChannelPlugin.registerWith(flutterView);
43 | return flutterView;
44 | }
45 |
46 | @Override
47 | public void onStart() {
48 | super.onStart();
49 | EventBus.getDefault().register(this);
50 | }
51 |
52 | @Override
53 | public void onStop() {
54 | super.onStop();
55 | EventBus.getDefault().unregister(this);
56 | }
57 |
58 | @Subscribe
59 | public void gotoDestinationSearchPage(GotoDestinationSearchPageEvent event){
60 | startActivity(new Intent(getContext(), DestinationSearchActivity.class));
61 | }
62 |
63 | @Subscribe
64 | public void gotoSpeakPage (GotoSpeakDestinationPageEvent event){
65 | Intent intent = new Intent(getContext(), SpeakActivity.class);
66 | intent.putExtra("pageType",event.getPageType());
67 | startActivity(intent);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/view/destination/DestinationSearchActivity.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.view.destination;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.widget.LinearLayout;
7 |
8 | import com.gyf.immersionbar.ImmersionBar;
9 |
10 | import net.lishaoy.android_ctrip.R;
11 | import net.lishaoy.android_ctrip.channel.MethodChannelPlugin;
12 | import net.lishaoy.lib_asr.asr.AsrPlugin;
13 |
14 | import io.flutter.facade.Flutter;
15 | import io.flutter.view.FlutterView;
16 |
17 | public class DestinationSearchActivity extends AppCompatActivity {
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.activity_destination_search);
23 | getSupportActionBar().hide();
24 | ImmersionBar.with(this)
25 | .statusBarDarkFont(true)
26 | .init();
27 | FlutterView flutterView = Flutter.createView(this,getLifecycle(),"destination/search");
28 | LinearLayout.LayoutParams layoutParams =
29 | new LinearLayout.LayoutParams(
30 | LinearLayout.LayoutParams.MATCH_PARENT,
31 | LinearLayout.LayoutParams.MATCH_PARENT);
32 | setContentView(flutterView,layoutParams);
33 | MethodChannelPlugin.registerWith(flutterView);
34 | AsrPlugin.registerWith(flutterView);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/view/my/MyFragment.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.view.my;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.annotation.Nullable;
7 | import androidx.fragment.app.Fragment;
8 |
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 |
13 | import com.gyf.immersionbar.ImmersionBar;
14 |
15 | import net.lishaoy.android_ctrip.R;
16 | import net.lishaoy.lib_webview.base.BaseAgentWebFragment;
17 |
18 | /**
19 | * A simple {@link Fragment} subclass.
20 | */
21 | public class MyFragment extends BaseAgentWebFragment {
22 |
23 | private ViewGroup mViewGroup;
24 |
25 | public MyFragment() {
26 | }
27 |
28 | public static Fragment newInstance() {
29 | MyFragment fragment = new MyFragment();
30 | return fragment;
31 | }
32 |
33 |
34 | @Override
35 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
36 | Bundle savedInstanceState) {
37 | mViewGroup = (ViewGroup) inflater.inflate(R.layout.fragment_my, container, false);
38 | return mViewGroup;
39 | }
40 |
41 | @NonNull
42 | @Override
43 | protected ViewGroup getAgentWebParent() {
44 | return (ViewGroup)this.mViewGroup.findViewById(R.id.my_container);
45 | }
46 |
47 | @Override
48 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
49 | super.onViewCreated(view, savedInstanceState);
50 | }
51 |
52 | @Nullable
53 | @Override
54 | protected String getUrl() {
55 | return "http://m.ctrip.com/webapp/myctrip/?from=http%3A%2F%2Fm.ctrip.com%2Fhtml5%2F";
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/view/speak/SpeakActivity.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.view.speak;
2 |
3 | import android.os.Bundle;
4 | import android.widget.LinearLayout;
5 |
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | import com.gyf.immersionbar.ImmersionBar;
9 |
10 | import net.lishaoy.android_ctrip.R;
11 | import net.lishaoy.android_ctrip.channel.MethodChannelPlugin;
12 | import net.lishaoy.lib_asr.asr.AsrPlugin;
13 |
14 | import io.flutter.facade.Flutter;
15 | import io.flutter.view.FlutterView;
16 |
17 | public class SpeakActivity extends AppCompatActivity {
18 |
19 | private String sRoute;
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_speak);
25 | getSupportActionBar().hide();
26 | ImmersionBar.with(this)
27 | .statusBarDarkFont(true)
28 | .init();
29 | sRoute = "speak/" + getIntent().getStringExtra("pageType");
30 | FlutterView flutterView = Flutter.createView(this,getLifecycle(), sRoute);
31 | LinearLayout.LayoutParams layoutParams =
32 | new LinearLayout.LayoutParams(
33 | LinearLayout.LayoutParams.MATCH_PARENT,
34 | LinearLayout.LayoutParams.MATCH_PARENT);
35 | setContentView(flutterView,layoutParams);
36 | MethodChannelPlugin.registerWith(flutterView);
37 | AsrPlugin.registerWith(flutterView);
38 | }
39 |
40 | @Override
41 | protected void onDestroy() {
42 | super.onDestroy();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/view/travel/TravelFragment.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.view.travel;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import androidx.fragment.app.Fragment;
10 |
11 | import net.lishaoy.android_ctrip.channel.MethodChannelPlugin;
12 | import net.lishaoy.android_ctrip.events.GotoSpeakTravelPageEvent;
13 | import net.lishaoy.android_ctrip.events.GotoTravelSearchPageEvent;
14 | import net.lishaoy.android_ctrip.view.speak.SpeakActivity;
15 |
16 | import org.greenrobot.eventbus.EventBus;
17 | import org.greenrobot.eventbus.Subscribe;
18 |
19 | import io.flutter.facade.Flutter;
20 | import io.flutter.view.FlutterView;
21 |
22 | public class TravelFragment extends Fragment {
23 |
24 | public TravelFragment() {
25 | // Required empty public constructor
26 | }
27 |
28 | public static Fragment newInstance() {
29 | TravelFragment fragment = new TravelFragment();
30 | return fragment;
31 | }
32 |
33 |
34 | @Override
35 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
36 | Bundle savedInstanceState) {
37 | FlutterView flutterView = Flutter.createView(getActivity(),getLifecycle(),"travel");
38 | MethodChannelPlugin.registerWith(flutterView);
39 | return flutterView;
40 | }
41 |
42 | @Subscribe
43 | public void gotoTravelSearchPageEvent(GotoTravelSearchPageEvent event){
44 | startActivity(new Intent(getContext(), TravelSearchActivity.class));
45 | }
46 |
47 | @Subscribe
48 | public void gotoSpeakPage (GotoSpeakTravelPageEvent event){
49 | Intent intent = new Intent(getContext(), SpeakActivity.class);
50 | intent.putExtra("pageType",event.getPageType());
51 | startActivity(intent);
52 | }
53 |
54 | @Override
55 | public void onStart() {
56 | super.onStart();
57 | EventBus.getDefault().register(this);
58 | }
59 |
60 | @Override
61 | public void onStop() {
62 | super.onStop();
63 | EventBus.getDefault().unregister(this);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/net/lishaoy/android_ctrip/view/travel/TravelSearchActivity.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip.view.travel;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.widget.LinearLayout;
7 |
8 | import com.gyf.immersionbar.ImmersionBar;
9 |
10 | import net.lishaoy.android_ctrip.R;
11 | import net.lishaoy.android_ctrip.channel.MethodChannelPlugin;
12 | import net.lishaoy.lib_asr.asr.AsrPlugin;
13 |
14 | import io.flutter.facade.Flutter;
15 | import io.flutter.view.FlutterView;
16 |
17 | public class TravelSearchActivity extends AppCompatActivity {
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.activity_travel_search);
23 | getSupportActionBar().hide();
24 | ImmersionBar.with(this)
25 | .statusBarDarkFont(true)
26 | .init();
27 | FlutterView flutterView = Flutter.createView(this,getLifecycle(),"travel/search");
28 | LinearLayout.LayoutParams layoutParams =
29 | new LinearLayout.LayoutParams(
30 | LinearLayout.LayoutParams.MATCH_PARENT,
31 | LinearLayout.LayoutParams.MATCH_PARENT);
32 | setContentView(flutterView,layoutParams);
33 | MethodChannelPlugin.registerWith(flutterView);
34 | AsrPlugin.registerWith(flutterView);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_destination_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_speak.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_travel_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_destination.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_my.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_travel.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/lvpai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/lvpai.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/lvpai_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/lvpai_active.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/mude.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/mude.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/mude_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/mude_active.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/wode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/wode.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/wode_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/wode_active.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/xiecheng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/xiecheng.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/xiecheng_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xhdpi/xiecheng_active.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #4CB7F9
4 | #0196ff
5 | #34c2aa
6 | #212121
7 | #ffffff
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AFCtrip
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | imooc.com
7 | 39.97.122.129
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/test/java/net/lishaoy/android_ctrip/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.android_ctrip;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | apply from: this.rootProject.file('ctrip.gradle')
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | maven {
9 | url "https://jitpack.io"
10 | }
11 | }
12 | dependencies {
13 | classpath 'com.android.tools.build:gradle:3.6.3'
14 | // butterknife 视图注解依赖
15 | classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.1'
16 | //ARouter插件依赖
17 | classpath "com.alibaba:arouter-register:1.0.2"
18 |
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | google()
25 | jcenter()
26 | maven {
27 | url "https://jitpack.io"
28 | }
29 | }
30 | }
31 |
32 | task clean(type: Delete) {
33 | delete rootProject.buildDir
34 | }
35 |
--------------------------------------------------------------------------------
/flutter_module/.android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def flutterPluginVersion = 'managed'
2 |
3 | apply plugin: 'com.android.application'
4 |
5 | android {
6 | compileSdkVersion 28
7 |
8 | compileOptions {
9 | sourceCompatibility 1.8
10 | targetCompatibility 1.8
11 | }
12 |
13 | defaultConfig {
14 | applicationId "net.lishaoy.ctrip.ft.flutter.module.host"
15 | minSdkVersion 16
16 | targetSdkVersion 28
17 | versionCode 1
18 | versionName "1.0"
19 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20 | }
21 |
22 | buildTypes {
23 | profile {
24 | initWith debug
25 | }
26 | release {
27 | // TODO: Add your own signing config for the release build.
28 | // Signing with the debug keys for now, so `flutter run --release` works.
29 | signingConfig signingConfigs.debug
30 | }
31 | }
32 |
33 | }
34 | buildDir = new File(rootProject.projectDir, "../build/host")
35 | dependencies {
36 | implementation project(':flutter')
37 | implementation fileTree(dir: 'libs', include: ['*.jar'])
38 | implementation 'androidx.appcompat:appcompat:1.0.2'
39 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
40 | androidTestImplementation 'androidx.test:runner:1.1.1'
41 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
42 | testImplementation 'junit:junit:4.12'
43 | }
44 |
--------------------------------------------------------------------------------
/flutter_module/.android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
16 |
20 |
27 |
31 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/flutter_module/.android/app/src/main/java/net/lishaoy/ctrip/ft/flutter/module/host/MainActivity.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ctrip.ft.flutter.module.host;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/flutter_module/.android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/flutter_module/.android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/.android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_module/.android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_module/.android/build.gradle:
--------------------------------------------------------------------------------
1 | // Generated file. Do not edit.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 |
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.2.1'
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/flutter_module/.android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/flutter_module/.android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/.android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/flutter_module/.android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6 |
--------------------------------------------------------------------------------
/flutter_module/.android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/flutter_module/.android/include_flutter.groovy:
--------------------------------------------------------------------------------
1 | // Generated file. Do not edit.
2 |
3 | def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
4 | def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
5 |
6 | gradle.include ':flutter'
7 | gradle.project(':flutter').projectDir = new File(flutterProjectRoot, '.android/Flutter')
8 |
9 | if (System.getProperty('build-plugins-as-aars') != 'true') {
10 | def plugins = new Properties()
11 | def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins')
12 | if (pluginsFile.exists()) {
13 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
14 | }
15 |
16 | plugins.each { name, path ->
17 | def pluginDirectory = flutterProjectRoot.toPath().resolve(path).resolve('android').toFile()
18 | gradle.include ":$name"
19 | gradle.project(":$name").projectDir = pluginDirectory
20 | }
21 | }
22 | gradle.getGradle().projectsLoaded { g ->
23 | g.rootProject.beforeEvaluate { p ->
24 | _mainModuleName = binding.variables['mainModuleName']
25 | if (_mainModuleName != null && !_mainModuleName.empty) {
26 | p.ext.mainModuleName = _mainModuleName
27 | }
28 | def subprojects = []
29 | def flutterProject
30 | p.subprojects { sp ->
31 | if (sp.name == 'flutter') {
32 | flutterProject = sp
33 | } else {
34 | subprojects.add(sp)
35 | }
36 | }
37 | assert flutterProject != null
38 | flutterProject.ext.hostProjects = subprojects
39 | flutterProject.ext.pluginBuildDir = new File(flutterProjectRoot, 'build/host')
40 | }
41 | g.rootProject.afterEvaluate { p ->
42 | p.subprojects { sp ->
43 | if (sp.name != 'flutter') {
44 | sp.evaluationDependsOn(':flutter')
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/flutter_module/.android/local.properties:
--------------------------------------------------------------------------------
1 | sdk.dir=/Users/lishaoying/Library/Android/sdk
2 | flutter.sdk=/Applications/flutter
--------------------------------------------------------------------------------
/flutter_module/.android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Generated file. Do not edit.
2 | include ':app'
3 |
4 | rootProject.name = 'android_generated'
5 | setBinding(new Binding([gradle: this]))
6 | evaluate(new File(settingsDir, 'include_flutter.groovy'))
7 |
--------------------------------------------------------------------------------
/flutter_module/.dart_tool/flutter_build/371f31eeedc4812d0fc855d0a8a33813/app.dill:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/.dart_tool/flutter_build/371f31eeedc4812d0fc855d0a8a33813/app.dill
--------------------------------------------------------------------------------
/flutter_module/.dart_tool/flutter_build/42670e4d7be63eaa05265d78ca7eb095/app.dill:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/.dart_tool/flutter_build/42670e4d7be63eaa05265d78ca7eb095/app.dill
--------------------------------------------------------------------------------
/flutter_module/.flutter-plugins-dependencies:
--------------------------------------------------------------------------------
1 | {"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"clone_flutter_webview_plugin","dependencies":[]}]}
--------------------------------------------------------------------------------
/flutter_module/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | #.dart_tool/
3 |
4 | #.packages
5 | .pub/
6 |
7 | #.idea/
8 | .vagrant/
9 | .sconsign.dblite
10 | .svn/
11 |
12 | *.swp
13 | profile
14 |
15 | DerivedData/
16 |
17 | .generated/
18 |
19 | *.pbxuser
20 | *.mode1v3
21 | *.mode2v3
22 | *.perspectivev3
23 |
24 | !default.pbxuser
25 | !default.mode1v3
26 | !default.mode2v3
27 | !default.perspectivev3
28 |
29 | xcuserdata
30 |
31 | *.moved-aside
32 |
33 | *.pyc
34 | *sync/
35 | Icon?
36 | .tags*
37 |
38 | build/
39 | #.android/
40 | .ios/
41 | #.flutter-plugins
42 | #.flutter-plugins-dependencies
43 |
--------------------------------------------------------------------------------
/flutter_module/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/flutter_module/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/flutter_module/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/flutter_module/.idea/libraries/Flutter_Plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_module/.idea/misc.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 |
--------------------------------------------------------------------------------
/flutter_module/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_module/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/flutter_module/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/flutter_module/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
8 | channel: stable
9 |
10 | project_type: module
11 |
--------------------------------------------------------------------------------
/flutter_module/README.md:
--------------------------------------------------------------------------------
1 | # module
2 |
3 | A new Flutter module.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.dev/).
9 |
--------------------------------------------------------------------------------
/flutter_module/assets/fonts/PingFang-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/fonts/PingFang-Italic.ttf
--------------------------------------------------------------------------------
/flutter_module/assets/fonts/PingFang-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/fonts/PingFang-Regular.ttf
--------------------------------------------------------------------------------
/flutter_module/assets/fonts/PingFang_Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/fonts/PingFang_Bold.ttf
--------------------------------------------------------------------------------
/flutter_module/assets/images/kefu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/kefu.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/lvpai_issue_position.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/lvpai_issue_position.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/lvpai_issue_sight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/lvpai_issue_sight.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/lvpai_search_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/lvpai_search_list.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/lvpai_search_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/lvpai_search_tag.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/sousuo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/sousuo.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_channelgroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_channelgroup.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_channelgs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_channelgs.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_channelplane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_channelplane.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_channeltrain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_channeltrain.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_cruise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_cruise.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_district.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_district.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_food.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_food.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_hotel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_hotel.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_huodong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_huodong.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_shop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_shop.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_sight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_sight.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_ticket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_ticket.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/type_travelgroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/type_travelgroup.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/user1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/user1.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/xiaoxi_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/xiaoxi_grey.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/xiaoxi_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/xiaoxi_white.png
--------------------------------------------------------------------------------
/flutter_module/assets/images/yuyin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/assets/images/yuyin.png
--------------------------------------------------------------------------------
/flutter_module/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {}
--------------------------------------------------------------------------------
/flutter_module/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/flutter_module/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/flutter_module/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 12 16:21:46 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/flutter_module/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/destination_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:module/model/destination_model.dart';
6 |
7 | //旅拍搜索接口
8 |
9 | var Params = {"contentType":"json","head":{"cid":"09031043410934928682","ctok":"","cver":"1.0","lang":"01","sid":"8888","syscode":"09","auth":"","extension":[]},"channel":"H5","businessUnit":14,"startCity":2};
10 | var Url = 'https://sec-m.ctrip.com/restapi/soa2/14422/navigationInfo?_fxpcqlniredt=09031043410934928682';
11 |
12 |
13 | class DestinationDao {
14 | static Future fetch() async {
15 | final response = await http.post(Url, body: jsonEncode(Params));
16 | if (response.statusCode == 200) {
17 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
18 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
19 | return DestinationModel.fromJson(result);
20 | } else {
21 | throw Exception('Failed to load travel');
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/destination_search_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:module/model/destination_search_model.dart';
6 |
7 | //旅拍搜索接口
8 |
9 | var Params = {"contentType":"json","head":{"cid":"09031043410934928682","ctok":"","cver":"1.0","lang":"01","sid":"8888","syscode":"09","auth":"","extension":[]},"keyword":"h","channel":"H5","sourceVersion":"823000","tab":"1","saleCity":2,"departureCity":2};
10 |
11 |
12 |
13 | class DestinationSearchDao {
14 | static Future fetch(
15 | String url, String keyword) async {
16 | Params['keyword'] = keyword;
17 |
18 | final response = await http.post(url, body: jsonEncode(Params));
19 | if (response.statusCode == 200) {
20 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
21 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
22 | DestinationSearchModel model = DestinationSearchModel.fromJson(result);
23 | model.keyword = keyword;
24 | return model;
25 | } else {
26 | throw Exception('Failed to load travel');
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/search_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'package:http/http.dart' as http;
4 | import 'package:module/model/seach_model.dart';
5 |
6 | //搜索接口
7 | class SearchDao {
8 | static Future fetch(String url, String text) async {
9 | final response = await http.get(url);
10 | if (response.statusCode == 200) {
11 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
12 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
13 | SearchModel model = SearchModel.fromJson(result);
14 | model.keyword = text;
15 | return model;
16 | } else {
17 | throw Exception('Failed to load home_page.json');
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/trave_hot_keyword_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'package:http/http.dart' as http;
4 | import 'package:module/model/travel_hot_keyword_model.dart';
5 |
6 | //旅拍搜索接口
7 |
8 | var Params = {"head":{"cid":"09031043410934928682","ctok":"","cver":"1.0","lang":"01","sid":"8888","syscode":"09","auth":null,"extension":[{"name":"tecode","value":"h5"},{"name":"protocal","value":"https"}]},"contentType":"json"};
9 | var Url = 'https://m.ctrip.com/restapi/soa2/16189/json/searchRecommend?_fxpcqlniredt=09031043410934928682&__gw_appid=99999999&__gw_ver=1.0&__gw_from=10650016495&__gw_platform=H5';
10 |
11 |
12 | class TravelHotKeywordDao {
13 | static Future fetch() async {
14 | final response = await http.post(Url, body: jsonEncode(Params));
15 | if (response.statusCode == 200) {
16 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
17 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
18 | return TravelHotKeywordModel.fromJson(result);
19 | } else {
20 | throw Exception('Failed to load travel');
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/trave_search_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:module/model/travel_search_model.dart';
6 |
7 | //旅拍搜索接口
8 |
9 | var Params = {
10 | "keyword": "五一",
11 | "locationDistrictId": 0,
12 | "lat": -180,
13 | "lon": -180,
14 | "head": {
15 | "cid": "09031043410934928682",
16 | "ctok": "",
17 | "cver": "1.0",
18 | "lang": "01",
19 | "sid": "8888",
20 | "syscode": "09",
21 | "auth": null,
22 | "extension": [
23 | {
24 | "name": "tecode",
25 | "value": "h5"
26 | },
27 | {
28 | "name": "protocal",
29 | "value": "https"
30 | }
31 | ]
32 | },
33 | "contentType": "json"
34 | };
35 |
36 |
37 |
38 | class TravelSearchDao {
39 | static Future fetch(
40 | String url, String keyword) async {
41 | Params['keyword'] = keyword;
42 | final response = await http.post(url, body: jsonEncode(Params));
43 | if (response.statusCode == 200) {
44 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
45 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
46 | TravelSearchModel model = TravelSearchModel.fromJson(result);
47 | model.keyword = keyword;
48 | return model;
49 | } else {
50 | throw Exception('Failed to load travel');
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/trave_search_hot_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:module/model/travel_search_hot_model.dart';
6 |
7 | //旅拍搜索接口
8 |
9 | var Params = {"pageCode":"appSuggest","locationDistrictId":0,"lat":-180,"lon":-180,"head":{"cid":"09031043410934928682","ctok":"","cver":"1.0","lang":"01","sid":"8888","syscode":"09","auth":null,"extension":[{"name":"tecode","value":"h5"},{"name":"protocal","value":"https"}]},"contentType":"json"};
10 | var Url = 'https://m.ctrip.com/restapi/soa2/16189/json/moduleListSearch?_fxpcqlniredt=09031043410934928682&__gw_appid=99999999&__gw_ver=1.0&__gw_from=10650016495&__gw_platform=H5';
11 |
12 |
13 | class TravelSearchHotDao {
14 | static Future fetch() async {
15 | final response = await http.post(Url, body: jsonEncode(Params));
16 | if (response.statusCode == 200) {
17 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
18 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
19 | return TravelSearchHotModel.fromJson(result);
20 | } else {
21 | throw Exception('Failed to load travel');
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/travel_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:module/model/travel_model.dart';
6 |
7 | ///旅拍页接口
8 |
9 | var Params = {
10 | "districtId": -1,
11 | "groupChannelCode": "RX-OMF",
12 | "type": null,
13 | "lat": -180,
14 | "lon": -180,
15 | "locatedDistrictId": 0,
16 | "pagePara": {
17 | "pageIndex": 1,
18 | "pageSize": 10,
19 | "sortType": 9,
20 | "sortDirection": 0
21 | },
22 | "imageCutType": 1,
23 | "head": {'cid': "09031014111431397988"},
24 | "contentType": "json"
25 | };
26 |
27 |
28 |
29 | class TravelDao {
30 | static Future fetch(
31 | String url,Map params, String groupChannelCode, int pageIndex, int pageSize) async {
32 | Map paramsMap = params['pagePara'];
33 | paramsMap['pageIndex'] = pageIndex;
34 | paramsMap['pageSize'] = pageSize;
35 | params['groupChannelCode'] = groupChannelCode;
36 | final response = await http.post(url, body: jsonEncode(params));
37 | if (response.statusCode == 200) {
38 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
39 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
40 | return TravelItemModel.fromJson(result);
41 | } else {
42 | throw Exception('Failed to load travel');
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/travel_params_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'package:http/http.dart' as http;
4 | import 'package:module/model/travel_params_model.dart';
5 |
6 | //旅拍类别接口
7 | class TravelParamsDao {
8 | static Future fetch() async {
9 | final response = await http
10 | .get('http://www.devio.org/io/flutter_app/json/travel_page.json');
11 | if (response.statusCode == 200) {
12 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
13 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
14 | print(result);
15 | return TravelParamsModel.fromJson(result);
16 | } else {
17 | throw Exception('Failed to load travel_page.json');
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/flutter_module/lib/dao/travel_tab_dao.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:http/http.dart' as http;
5 | import 'package:module/model/travel_tab_model.dart';
6 |
7 | //旅拍类别接口
8 | class TravelTabDao {
9 | static Future fetch() async {
10 | final response = await http
11 | .get('https://m.ctrip.com/restapi/soa2/15612/json/getTripShootHomePage');
12 | if (response.statusCode == 200) {
13 | Utf8Decoder utf8decoder = Utf8Decoder(); // fix 中文乱码
14 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
15 | return TravelTabModel.fromJson(result);
16 | } else {
17 | throw Exception('Failed to load travel_page.json');
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/flutter_module/lib/model/seach_model.dart:
--------------------------------------------------------------------------------
1 | class SearchModel {
2 | String keyword;
3 | final List data;
4 |
5 | SearchModel({this.data});
6 |
7 | factory SearchModel.fromJson(Map json) {
8 | var dataJson = json['data'] as List;
9 | List data =
10 | dataJson.map((i) => SearchItem.fromJson(i)).toList();
11 | return SearchModel(data: data);
12 | }
13 | }
14 |
15 | class SearchItem {
16 | final String word; //xx酒店
17 | final String type; //hotel
18 | final String price; //实时计价
19 | final String star; //豪华型
20 | final String zonename; //虹桥
21 | final String districtname; //上海
22 | final String url;
23 |
24 | SearchItem(
25 | {this.word,
26 | this.type,
27 | this.price,
28 | this.star,
29 | this.zonename,
30 | this.districtname,
31 | this.url});
32 |
33 | factory SearchItem.fromJson(Map json) {
34 | return SearchItem(
35 | word: json['word'],
36 | type: json['type'],
37 | price: json['price'],
38 | star: json['star'],
39 | zonename: json['zonename'],
40 | districtname: json['districtname'],
41 | url: json['url'],
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/flutter_module/lib/model/travel_hot_keyword_model.dart:
--------------------------------------------------------------------------------
1 | class TravelHotKeywordModel {
2 |
3 | List hotKeyword;
4 |
5 | TravelHotKeywordModel({this.hotKeyword});
6 |
7 | TravelHotKeywordModel.fromJson(Map json) {
8 | if (json['result'] != null) {
9 | hotKeyword = new List();
10 | json['result'].forEach((v) {
11 | hotKeyword.add(new HotKeyword.fromJson(v));
12 | });
13 | }
14 | }
15 |
16 | Map toJson() {
17 | final Map data = new Map();
18 | if (this.hotKeyword != null) {
19 | data['result'] = this.hotKeyword.map((v) => v.toJson()).toList();
20 | }
21 | return data;
22 | }
23 | }
24 |
25 | class HotKeyword {
26 | String prefix;
27 | String content;
28 | String h5Url;
29 | String appUrl;
30 | String wxUrl;
31 | String mainWxUrl;
32 |
33 | HotKeyword(
34 | {this.prefix,
35 | this.content,
36 | this.h5Url,
37 | this.appUrl,
38 | this.wxUrl,
39 | this.mainWxUrl});
40 |
41 | HotKeyword.fromJson(Map json) {
42 | prefix = json['prefix'];
43 | content = json['content'];
44 | h5Url = json['h5Url'];
45 | appUrl = json['appUrl'];
46 | wxUrl = json['wxUrl'];
47 | mainWxUrl = json['mainWxUrl'];
48 | }
49 |
50 | Map toJson() {
51 | final Map data = new Map();
52 | data['prefix'] = this.prefix;
53 | data['content'] = this.content;
54 | data['h5Url'] = this.h5Url;
55 | data['appUrl'] = this.appUrl;
56 | data['wxUrl'] = this.wxUrl;
57 | data['mainWxUrl'] = this.mainWxUrl;
58 | return data;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/flutter_module/lib/model/travel_params_model.dart:
--------------------------------------------------------------------------------
1 | class TravelParamsModel {
2 | Map params;
3 | String url;
4 | List tabs;
5 |
6 | TravelParamsModel({this.url, this.tabs});
7 |
8 | TravelParamsModel.fromJson(Map json) {
9 | url = json['url'];
10 | params = json['params'];
11 | if (json['tabs'] != null) {
12 | tabs = new List();
13 | json['tabs'].forEach((v) {
14 | tabs.add(new TravelTab.fromJson(v));
15 | });
16 | }
17 | }
18 |
19 | Map toJson() {
20 | final Map data = new Map();
21 | data['url'] = this.url;
22 | if (this.tabs != null) {
23 | data['tabs'] = this.tabs.map((v) => v.toJson()).toList();
24 | }
25 | return data;
26 | }
27 | }
28 |
29 | class TravelTab {
30 | String labelName;
31 | String groupChannelCode;
32 |
33 | TravelTab({this.labelName, this.groupChannelCode});
34 |
35 | TravelTab.fromJson(Map json) {
36 | labelName = json['labelName'];
37 | groupChannelCode = json['groupChannelCode'];
38 | }
39 |
40 | Map toJson() {
41 | final Map data = new Map();
42 | data['labelName'] = this.labelName;
43 | data['groupChannelCode'] = this.groupChannelCode;
44 | return data;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/flutter_module/lib/plugin/asr_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 |
3 | class AsrManager {
4 | static const MethodChannel _channel = const MethodChannel('lib_asr');
5 |
6 | //开始录音
7 | static Future start({Map params}) async {
8 | return await _channel.invokeMethod('start', params ?? {});
9 | }
10 |
11 | //停止录音
12 | static Future stop() async {
13 | return await _channel.invokeMethod('stop');
14 | }
15 |
16 | //取消录音
17 | static Future cancel() async {
18 | return await _channel.invokeMethod('cancel');
19 | }
20 |
21 | //销毁
22 | static Future release() async {
23 | return await _channel.invokeMethod('release');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/flutter_module/lib/plugin/method_channel_plugin.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 |
3 | class MethodChannelPlugin {
4 |
5 | static const MethodChannel methodChannel = MethodChannel('MethodChannelPlugin');
6 |
7 | static Future gotoDestinationSearchPage() async {
8 | try {
9 | await methodChannel.invokeMethod('gotoDestinationSearchPage');
10 | } on PlatformException {
11 | print('Failed go to gotoDestinationSearchPage');
12 | }
13 | }
14 |
15 | static Future gotoTravelSearchPage() async {
16 | try {
17 | await methodChannel.invokeMethod('gotoTravelSearchPage');
18 | } on PlatformException {
19 | print('Failed go to gotoTravelSearchPage');
20 | }
21 | }
22 |
23 | static Future gotoSpeakPage(String pageType) async {
24 | try {
25 | await methodChannel.invokeMethod('gotoSpeakPage',{'pageType': pageType});
26 | } on PlatformException {
27 | print('Failed go to gotoSpeakPage');
28 | }
29 | }
30 |
31 | static Future gotoWebView(String url) async {
32 | try {
33 | await methodChannel.invokeMethod('gotoWebView',{'url': url});
34 | } on PlatformException {
35 | print('Failed go to gotoWebView');
36 | }
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/flutter_module/lib/utils/navigator_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 |
4 | class NavigatorUtil {
5 | ///跳转到指定页面
6 | static push(BuildContext context, Widget page) {
7 | Navigator.push(context, MaterialPageRoute(builder: (context) => page));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/flutter_module/lib/widget/loading_container.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class LoadingContainer extends StatelessWidget {
4 | final Widget child;
5 | final bool isLoading;
6 | final bool cover;
7 |
8 |
9 | LoadingContainer({@required this.child, @required this.isLoading, this.cover = false});
10 |
11 | Widget get _loadingView {
12 | return Center(
13 | child: CircularProgressIndicator(),
14 | );
15 | }
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return !cover ? !isLoading ? child : _loadingView : Stack(
20 | children: [child, isLoading ? _loadingView: Container()],
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/flutter_module/lib/widget/scalable_box.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ScalableBox extends StatefulWidget {
4 | final List visibleSpans;
5 | final List unVisibleSpans;
6 |
7 | ScalableBox(this.visibleSpans, this.unVisibleSpans);
8 |
9 | @override
10 | _ScalableBoxState createState() => _ScalableBoxState();
11 | }
12 |
13 | class _ScalableBoxState extends State {
14 | bool _isMore = true;
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Container(
19 | padding: EdgeInsets.fromLTRB(10, 0, 0, 10),
20 | child: Column(
21 | crossAxisAlignment: CrossAxisAlignment.start,
22 | children: [
23 | widget.visibleSpans.length>=1?widget.visibleSpans[0]:Container(),
24 | widget.visibleSpans.length>=2?widget.visibleSpans[1]:Container(),
25 | widget.visibleSpans.length>=3?widget.visibleSpans[2]:Container(),
26 | Offstage(
27 | offstage: _isMore,
28 | child: Column(
29 | children: widget.unVisibleSpans,
30 | ),
31 | ),
32 | widget.unVisibleSpans.length>0?Container(
33 | child: GestureDetector(
34 | onTap: () {
35 | setState(() {
36 | _isMore = !_isMore;
37 | });
38 | },
39 | child: _isMore
40 | ? Row(
41 | mainAxisAlignment: MainAxisAlignment.center,
42 | crossAxisAlignment: CrossAxisAlignment.center,
43 | children: [
44 | Text(
45 | '展开',
46 | style: TextStyle(color: Colors.blue, fontFamily: ''),
47 | ),
48 | Icon(
49 | Icons.keyboard_arrow_down,
50 | color: Colors.blue,
51 | size: 16,
52 | ),
53 | ],
54 | )
55 | : Row(
56 | mainAxisAlignment: MainAxisAlignment.center,
57 | crossAxisAlignment: CrossAxisAlignment.center,
58 | children: [
59 | Text(
60 | '收起',
61 | style: TextStyle(color: Colors.blue, fontFamily: ''),
62 | ),
63 | Icon(
64 | Icons.keyboard_arrow_up,
65 | color: Colors.blue,
66 | size: 16,
67 | ),
68 | ],
69 | ),
70 | ),
71 | ):Container(),
72 | ],
73 | ),
74 | );
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/flutter_module/local.properties:
--------------------------------------------------------------------------------
1 | ## This file must *NOT* be checked into Version Control Systems,
2 | # as it contains information specific to your local configuration.
3 | #
4 | # Location of the SDK. This is only used by Gradle.
5 | # For customization when using a Version Control System, please read the
6 | # header note.
7 | #Fri Jun 12 16:21:40 CST 2020
8 | sdk.dir=/Users/lishaoying/Library/Android/sdk
9 |
--------------------------------------------------------------------------------
/flutter_module/settings.gradle:
--------------------------------------------------------------------------------
1 |
2 | // Generated file. Do not edit.
3 | //include ':.android'
4 |
5 | include 'android'
6 | project(':android').projectDir = file('.android')
7 |
--------------------------------------------------------------------------------
/flutter_module/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:module/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | });
16 | }
17 |
--------------------------------------------------------------------------------
/ft_home/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ft_home/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/consumer-rules.pro
--------------------------------------------------------------------------------
/ft_home/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 |
--------------------------------------------------------------------------------
/ft_home/src/androidTest/java/net/lishaoy/ft_home/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.ft_home.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ft_home/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/adapter/HomeBannerAdapter.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.adapter;
2 |
3 | import android.view.View;
4 | import android.view.ViewGroup;
5 | import android.widget.ImageView;
6 |
7 | import androidx.annotation.NonNull;
8 | import androidx.recyclerview.widget.RecyclerView;
9 |
10 | import com.youth.banner.adapter.BannerAdapter;
11 | import net.lishaoy.ft_home.model.Home;
12 | import net.lishaoy.lib_base.lib_webview.service.wrapper.WebViewImpl;
13 | import net.lishaoy.lib_image_loader.app.ImageLoaderManager;
14 |
15 | import java.util.List;
16 |
17 | public class HomeBannerAdapter extends BannerAdapter {
18 |
19 | public HomeBannerAdapter(List bannerListBeans) {
20 | super(bannerListBeans);
21 | }
22 |
23 | @Override
24 | public BannerViewHolder onCreateHolder(ViewGroup parent, int viewType) {
25 | ImageView imageView = new ImageView(parent.getContext());
26 | imageView.setLayoutParams(new ViewGroup.LayoutParams(
27 | ViewGroup.LayoutParams.MATCH_PARENT,
28 | ViewGroup.LayoutParams.MATCH_PARENT));
29 | imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
30 | return new BannerViewHolder(imageView);
31 | }
32 |
33 | @Override
34 | public void onBindView(BannerViewHolder holder, final Home.BannerListBean data, int position, int size) {
35 | ImageLoaderManager.getInstance().displayImageForView(holder.imageView,data.getSIcon());
36 | holder.imageView.setOnClickListener(new View.OnClickListener() {
37 | @Override
38 | public void onClick(View v) {
39 | WebViewImpl.getInstance().gotoWebView(data.getUrl());
40 | }
41 | });
42 | }
43 |
44 | class BannerViewHolder extends RecyclerView.ViewHolder {
45 | ImageView imageView;
46 |
47 | public BannerViewHolder(@NonNull ImageView view) {
48 | super(view);
49 | this.imageView = view;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/adapter/HomeSearchBarPlaceHolderAdapter.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.adapter;
2 |
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 | import android.widget.TextView;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.recyclerview.widget.RecyclerView;
10 |
11 | import com.youth.banner.adapter.BannerAdapter;
12 |
13 | import net.lishaoy.ft_home.R;
14 | import net.lishaoy.ft_home.model.Home;
15 |
16 | import java.util.List;
17 |
18 | public class HomeSearchBarPlaceHolderAdapter extends BannerAdapter {
19 |
20 |
21 | public HomeSearchBarPlaceHolderAdapter(List datas) {
22 | super(datas);
23 | }
24 |
25 | @Override
26 | public MyViewHolder onCreateHolder(ViewGroup parent, int viewType) {
27 | return new MyViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.home_search_bar_place_holder_item,parent,false));
28 | }
29 |
30 | @Override
31 | public void onBindView(MyViewHolder holder, Home.SearchPlaceHolderListBean data, int position, int size) {
32 | holder.placeHolder.setText(data.getText());
33 | }
34 |
35 | class MyViewHolder extends RecyclerView.ViewHolder {
36 |
37 | public TextView placeHolder;
38 |
39 | public MyViewHolder(@NonNull View itemView) {
40 | super(itemView);
41 | placeHolder = itemView.findViewById(R.id.home_search_bar_placeholder_item);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/adapter/SubNavViewAdapter.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.ImageView;
8 | import android.widget.TextView;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import net.lishaoy.ft_home.R;
14 | import net.lishaoy.ft_home.R2;
15 | import net.lishaoy.ft_home.model.Home;
16 | import net.lishaoy.lib_base.lib_webview.service.wrapper.WebViewImpl;
17 | import net.lishaoy.lib_image_loader.app.ImageLoaderManager;
18 |
19 | import java.util.List;
20 |
21 | import butterknife.BindView;
22 | import butterknife.ButterKnife;
23 |
24 | public class SubNavViewAdapter extends RecyclerView.Adapter {
25 |
26 |
27 | private Context context;
28 | private List subNavListBeanList;
29 |
30 | public SubNavViewAdapter(Context context, List subNavListBeanList) {
31 | this.context = context;
32 | this.subNavListBeanList = subNavListBeanList;
33 | }
34 |
35 | @NonNull
36 | @Override
37 | public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
38 |
39 | return new MyViewHolder(LayoutInflater.from(context).inflate(R.layout.item_sub_nav, parent, false));
40 | }
41 |
42 | @Override
43 | public void onBindViewHolder(@NonNull MyViewHolder holder, final int position) {
44 | ImageLoaderManager.getInstance().displayImageForView(holder.homeSubNavImg, subNavListBeanList.get(position).getIcon());
45 | holder.homeSubNavTxt.setText(subNavListBeanList.get(position).getTitle());
46 | holder.itemView.setOnClickListener(new View.OnClickListener() {
47 | @Override
48 | public void onClick(View v) {
49 | WebViewImpl.getInstance().gotoWebView(subNavListBeanList.get(position).getUrl());
50 | }
51 | });
52 | }
53 |
54 | @Override
55 | public int getItemCount() {
56 | return subNavListBeanList.size();
57 | }
58 |
59 | static class MyViewHolder extends RecyclerView.ViewHolder {
60 |
61 | @BindView(R2.id.home_sub_nav_img)
62 | ImageView homeSubNavImg;
63 | @BindView(R2.id.home_sub_nav_txt)
64 | TextView homeSubNavTxt;
65 |
66 | public MyViewHolder(@NonNull View itemView) {
67 | super(itemView);
68 | ButterKnife.bind(this, itemView);
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/events/IsLoadMoreSelectEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.events;
2 |
3 | public class IsLoadMoreSelectEvent {
4 | boolean isLoad;
5 |
6 | public IsLoadMoreSelectEvent(boolean isLoad) {
7 | this.isLoad = isLoad;
8 | }
9 |
10 | public boolean isLoad() {
11 | return isLoad;
12 | }
13 |
14 | public void setLoad(boolean load) {
15 | isLoad = load;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/events/LoadMoreFoodEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.events;
2 |
3 | public class LoadMoreFoodEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/events/LoadMoreNearEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.events;
2 |
3 | public class LoadMoreNearEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/events/LoadMoreScenicEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.events;
2 |
3 | public class LoadMoreScenicEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/events/LoadMoreSelectEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.events;
2 |
3 | public class LoadMoreSelectEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/model/CHANNEL.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.model;
2 |
3 | public enum CHANNEL {
4 |
5 | HOME("首页", 0x01),
6 |
7 | DESTINATION("目的地", 0x02),
8 |
9 | TRAVEL("旅拍", 0x03),
10 |
11 | MY("我的", 0x04),
12 |
13 | SELECT("精选", 0x05),
14 |
15 | NEAR("附近", 0x06),
16 |
17 | SCENIC("景点", 0x07),
18 |
19 | FOOD("美食", 0x08),
20 |
21 | SELECT_SUB("当地玩法", 0x09),
22 |
23 | NEAR_SUB("探索周边", 0x10),
24 |
25 | SCENIC_SUB("尽情游览", 0x11),
26 |
27 | FOOD_SUB("地道风味", 0x12);
28 |
29 | //所有类型标识
30 | public static final int HOME_ID = 0x01;
31 | public static final int DESTINATION_ID = 0x02;
32 | public static final int TRAVEL_ID = 0x03;
33 | public static final int MY_ID = 0x04;
34 | public static final int SELECT_ID = 0x05;
35 | public static final int NEAR_ID = 0x06;
36 | public static final int SCENIC_ID = 0x07;
37 | public static final int FOOD_ID = 0x08;
38 | public static final int SELECT_SUB_ID = 0x09;
39 | public static final int NEAR_SUB_ID = 0x10;
40 | public static final int SCENIC_SUB_ID = 0x11;
41 | public static final int FOOD_SUB_ID = 0x12;
42 |
43 | private final String key;
44 | private final int value;
45 |
46 | CHANNEL(String key, int value) {
47 | this.key = key;
48 | this.value = value;
49 | }
50 |
51 | public int getValue() {
52 | return value;
53 | }
54 |
55 | public String getKey() {
56 | return key;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/searchPages/SearchPageActivity.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.searchPages;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.widget.LinearLayout;
7 |
8 | import com.alibaba.android.arouter.facade.annotation.Route;
9 | import com.alibaba.android.arouter.launcher.ARouter;
10 | import com.gyf.immersionbar.ImmersionBar;
11 |
12 | import net.lishaoy.ft_home.R;
13 | import net.lishaoy.lib_asr.asr.AsrPlugin;
14 | import net.lishaoy.lib_base.app.service.wrapper.MethodChannelImpl;
15 |
16 | import io.flutter.facade.Flutter;
17 | import io.flutter.view.FlutterView;
18 |
19 | @Route(path = "/home/search")
20 | public class SearchPageActivity extends AppCompatActivity {
21 |
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | setContentView(R.layout.activity_search_page);
26 | ARouter.getInstance().inject(this);
27 |
28 | getSupportActionBar().hide();
29 | ImmersionBar.with(this)
30 | .statusBarDarkFont(true)
31 | .init();
32 | String params = "{\"routeName\":\"search\",\"placeHolder\":\""+ getIntent().getStringExtra("placeHolder") +"\"}";
33 | FlutterView flutterView = Flutter.createView(this,getLifecycle(),params);
34 | LinearLayout.LayoutParams layoutParams =
35 | new LinearLayout.LayoutParams(
36 | LinearLayout.LayoutParams.MATCH_PARENT,
37 | LinearLayout.LayoutParams.MATCH_PARENT);
38 | setContentView(flutterView,layoutParams);
39 |
40 | AsrPlugin.registerWith(flutterView);
41 |
42 | MethodChannelImpl.getInstance().registerWith(flutterView);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/service/HomeServiceImpl.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.service;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import androidx.fragment.app.Fragment;
7 |
8 | import com.alibaba.android.arouter.facade.annotation.Route;
9 |
10 | import net.lishaoy.ft_home.HomeFragment;
11 | import net.lishaoy.lib_base.ft_home.service.HomeService;
12 |
13 | @Route(path = "/home/home_service")
14 | public class HomeServiceImpl implements HomeService {
15 | @Override
16 | public Fragment toHome(Context context) {
17 | return HomeFragment.newInstance(context);
18 | }
19 |
20 | @Override
21 | public void init(Context context) {
22 | Log.i(HomeServiceImpl.class.getSimpleName(),"init");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/speak/SpeakActivity.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.speak;
2 |
3 | import android.os.Bundle;
4 | import android.widget.LinearLayout;
5 |
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | import com.alibaba.android.arouter.facade.annotation.Route;
9 | import com.alibaba.android.arouter.launcher.ARouter;
10 | import com.gyf.immersionbar.ImmersionBar;
11 |
12 | import net.lishaoy.ft_home.R;
13 | import net.lishaoy.lib_asr.asr.AsrPlugin;
14 | import net.lishaoy.lib_base.app.service.wrapper.MethodChannelImpl;
15 |
16 | import io.flutter.facade.Flutter;
17 | import io.flutter.view.FlutterView;
18 |
19 | @Route(path = "/home/speak")
20 | public class SpeakActivity extends AppCompatActivity {
21 |
22 | private String sRoute;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_speak);
28 | ARouter.getInstance().inject(this);
29 | getSupportActionBar().hide();
30 | ImmersionBar.with(this)
31 | .statusBarDarkFont(true)
32 | .init();
33 | sRoute = "speak/" + getIntent().getStringExtra("pageType");
34 | FlutterView flutterView = Flutter.createView(this,getLifecycle(), sRoute);
35 | LinearLayout.LayoutParams layoutParams =
36 | new LinearLayout.LayoutParams(
37 | LinearLayout.LayoutParams.MATCH_PARENT,
38 | LinearLayout.LayoutParams.MATCH_PARENT);
39 | setContentView(flutterView,layoutParams);
40 | MethodChannelImpl.getInstance().registerWith(flutterView);
41 | AsrPlugin.registerWith(flutterView);
42 | }
43 |
44 | @Override
45 | protected void onDestroy() {
46 | super.onDestroy();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/util/CustomScrollView.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.util;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ScrollView;
6 | import android.widget.Scroller;
7 |
8 | public class CustomScrollView extends ScrollView {
9 |
10 | private Scroller mScroller;
11 |
12 | public CustomScrollView(Context context) {
13 | super(context);
14 | mScroller = new Scroller(context);
15 | }
16 |
17 | public CustomScrollView(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | mScroller = new Scroller(context);
20 | }
21 |
22 | public CustomScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
23 | super(context, attrs, defStyleAttr);
24 | mScroller = new Scroller(context);
25 | }
26 |
27 | public void smoothScrollToShow(int fx, int fy, int duration){
28 | int dx = fx - getScrollX();
29 | int dy = fy - getScrollY();
30 | smoothScrollBySlow(dx, dy, duration);
31 | }
32 |
33 | private void smoothScrollBySlow(int dx, int dy, int duration) {
34 | mScroller.startScroll(getScrollX(), getScrollY(), dx, dy, duration);
35 | invalidate();
36 | }
37 |
38 | @Override
39 | public void computeScroll() {
40 | if(mScroller.computeScrollOffset()){
41 | scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
42 | postInvalidate();
43 | }
44 | super.computeScroll();
45 | }
46 |
47 | private OnHoldTabScrollViewScrollChanged mOnObservableScrollViewScrollChanged;
48 |
49 | public void setOnObservableScrollViewScrollChanged(OnHoldTabScrollViewScrollChanged mOnObservableScrollViewScrollChanged) {
50 | this.mOnObservableScrollViewScrollChanged = mOnObservableScrollViewScrollChanged;
51 | }
52 |
53 |
54 | public interface OnHoldTabScrollViewScrollChanged {
55 | void onObservableScrollViewScrollChanged(int l, int t, int oldl, int oldt);
56 | }
57 |
58 | @Override
59 | protected void onScrollChanged(int l, int t, int oldl, int oldt) {
60 | super.onScrollChanged(l, t, oldl, oldt);
61 | if (mOnObservableScrollViewScrollChanged != null) {
62 | mOnObservableScrollViewScrollChanged.onObservableScrollViewScrollChanged(l, t, oldl, oldt);
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/util/EllipseIndicator.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.util;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.RectF;
6 | import android.util.AttributeSet;
7 |
8 | import com.youth.banner.indicator.BaseIndicator;
9 |
10 |
11 | public class EllipseIndicator extends BaseIndicator {
12 | private static final String TAG = "EllipseIndicator";
13 | private float mNormalRadius;
14 | private float mSelectedRadius;
15 | private float maxRadius;
16 |
17 | public EllipseIndicator(Context context) {
18 | this(context, null);
19 | }
20 |
21 | public EllipseIndicator(Context context, AttributeSet attrs) {
22 | this(context, attrs, 0);
23 | }
24 |
25 | public EllipseIndicator(Context context, AttributeSet attrs, int defStyleAttr) {
26 | super(context, attrs, defStyleAttr);
27 | mNormalRadius = config.getNormalWidth() / 2;
28 | mSelectedRadius = config.getSelectedWidth() / 2;
29 | }
30 |
31 | @Override
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
34 | int count = config.getIndicatorSize();
35 | if (count <= 1) return;
36 |
37 | mNormalRadius = config.getNormalWidth() / 2;
38 | mSelectedRadius = config.getSelectedWidth() / 2;
39 | //考虑当 选中和默认 的大小不一样的情况
40 | maxRadius = Math.max(mSelectedRadius, mNormalRadius);
41 | //间距*(总数-1)+最大的半径(考虑有时候选中时会变大的情况)+默认半径*(总数-1)
42 | int width = (int) (((count - 1) * config.getIndicatorSpace() + 3 * (maxRadius + mNormalRadius * (count - 1))) + maxRadius*3);
43 | int height = (int) config.getNormalWidth();
44 | setMeasuredDimension(width, height);
45 | }
46 |
47 | @Override
48 | protected void onDraw(Canvas canvas) {
49 | super.onDraw(canvas);
50 | int count = config.getIndicatorSize();
51 | if (count <= 1) return;
52 | mPaint.setColor(config.getNormalColor());
53 | float left = 0;
54 | for (int i = 0; i < count; i++) {
55 | float x = maxRadius*2 + (config.getNormalWidth() + config.getIndicatorSpace()) * i;
56 | canvas.drawCircle(x, mNormalRadius, mNormalRadius, mPaint);
57 | }
58 | mPaint.setColor(config.getSelectedColor());
59 | left = config.getCurrentPosition() == 0 ? 0 : config.getCurrentPosition() * (config.getNormalWidth() + config.getIndicatorSpace());
60 | RectF rectF = new RectF(left, 0, left + config.getNormalWidth() * 3, config.getNormalWidth());
61 | canvas.drawRoundRect(rectF, config.getRadius(), config.getRadius(), mPaint);
62 |
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/util/NoTouchViewPager.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.util;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 |
7 | import androidx.viewpager.widget.ViewPager;
8 |
9 | /**
10 | * 使ViewPager不能滑动
11 | */
12 | public class NoTouchViewPager extends ViewPager {
13 |
14 | public NoTouchViewPager(Context context) {
15 | super(context);
16 | }
17 |
18 | public NoTouchViewPager(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | }
21 |
22 | @Override
23 | public boolean onTouchEvent(MotionEvent event) {
24 | return false;
25 | }
26 |
27 | @Override
28 | public boolean onInterceptTouchEvent(MotionEvent event) {
29 | return false;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/util/ScaleTransitionPagerTitleView.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.util;
2 |
3 | import android.content.Context;
4 |
5 | import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
6 |
7 | public class ScaleTransitionPagerTitleView extends ColorTransitionPagerTitleView {
8 |
9 | private float mMinScale = 0.92f;
10 |
11 | public ScaleTransitionPagerTitleView(Context context) {
12 | super(context);
13 | }
14 |
15 | @Override
16 | public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
17 | super.onEnter(index, totalCount, enterPercent, leftToRight); // 实现颜色渐变
18 | setScaleX(mMinScale + (1.0f - mMinScale) * enterPercent);
19 | setScaleY(mMinScale + (1.0f - mMinScale) * enterPercent);
20 | }
21 |
22 | @Override
23 | public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
24 | super.onLeave(index, totalCount, leavePercent, leftToRight); // 实现颜色渐变
25 | setScaleX(1.0f + (mMinScale - 1.0f) * leavePercent);
26 | setScaleY(1.0f + (mMinScale - 1.0f) * leavePercent);
27 | }
28 |
29 | public float getMinScale() {
30 | return mMinScale;
31 | }
32 |
33 | public void setMinScale(float minScale) {
34 | mMinScale = minScale;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ft_home/src/main/java/net/lishaoy/ft_home/util/ScrollViewPager.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home.util;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.annotation.Nullable;
11 | import androidx.viewpager.widget.ViewPager;
12 |
13 | import java.util.HashMap;
14 | import java.util.LinkedHashMap;
15 |
16 | public class ScrollViewPager extends ViewPager {
17 |
18 | private int current;
19 | private int height = 0;
20 | private HashMap mChildrenViews = new LinkedHashMap();
21 | private boolean scrollble = true;
22 |
23 | public ScrollViewPager(@NonNull Context context) {
24 | super(context);
25 | }
26 |
27 | public ScrollViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
28 | super(context, attrs);
29 | }
30 |
31 | @Override
32 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 |
34 | if(mChildrenViews.size() > current) {
35 | View child = mChildrenViews.get(current);
36 | child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
37 | height = child.getMeasuredHeight();
38 | }
39 | heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
41 | }
42 |
43 | public void resetHeight(int current) {
44 | this.current = current;
45 | if (mChildrenViews.size() > current) {
46 |
47 | LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) getLayoutParams();
48 | if (layoutParams == null) {
49 | layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
50 | } else {
51 | layoutParams.height = height;
52 | }
53 | setLayoutParams(layoutParams);
54 | }
55 | }
56 |
57 | public void setObjectForPosition(View view, int position) {
58 | mChildrenViews.put(position, view);
59 | }
60 |
61 | public boolean isScrollble() {
62 | return scrollble;
63 | }
64 |
65 | public void setScrollble(boolean scrollble) {
66 | this.scrollble = scrollble;
67 | }
68 |
69 | @Override
70 | public boolean onTouchEvent(MotionEvent ev) {
71 | if (!scrollble) {
72 | return true;
73 | }
74 | return super.onTouchEvent(ev);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/bg10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/drawable/bg10.jpg
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/nav_circular_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/search_bar_circular_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/second_floor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/drawable/second_floor.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/shape_home_bar_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/shape_home_nav_blue_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/shape_home_nav_green_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
16 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/shape_home_nav_red_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/shape_home_nav_yellow_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/shape_tab_select_yellow_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/tab_food_circular_blue_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/tab_food_circular_yellow_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/drawable/tab_title_circular_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/activity_search_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/activity_speak.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/fragment_food.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/fragment_near.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/fragment_scenic.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/fragment_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/home_search_bar_place_holder_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/item_sub_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/item_tab_page_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/layout/view_tab_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_dingzhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_dingzhi.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_flight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_flight.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_hot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_hot.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_hotel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_hotel.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_jhj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_jhj.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_minsu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_minsu.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_train.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_train.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/grid_nav_items_travel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/grid_nav_items_travel.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/lbsguide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/lbsguide.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/lvpai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/lvpai.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/lvpai_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/lvpai_active.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/mude.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/mude.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/mude_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/mude_active.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/search.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/voice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/voice.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/wode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/wode.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/wode_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/wode_active.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/xiecheng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/xiecheng.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/mipmap/xiecheng_active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/ft_home/src/main/res/mipmap/xiecheng_active.png
--------------------------------------------------------------------------------
/ft_home/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #4CB7F9
4 | #0196ff
5 | #34c2aa
6 | #212121
7 | #ffffff
8 |
9 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ft_home/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/ft_home/src/test/java/net/lishaoy/ft_home/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.ft_home;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jun 03 14:50:19 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/key.properties:
--------------------------------------------------------------------------------
1 | storePassword=123456
2 | keyPassword=123456
3 | keyAlias=ctrip_key
4 | storeFile=../ctrip_key_store
--------------------------------------------------------------------------------
/lib_asr/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib_asr/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.android.compileSdkVersion
5 | buildToolsVersion rootProject.android.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.android.minSdkVersion
9 | targetSdkVersion rootProject.android.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 |
26 | compileOnly rootProject.depsLibs.appcompat
27 | //引入flutter模块
28 | compileOnly project(path: ':flutter')
29 | }
30 |
--------------------------------------------------------------------------------
/lib_asr/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/consumer-rules.pro
--------------------------------------------------------------------------------
/lib_asr/libs/bdasr_V3_20191210_81acdf5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/libs/bdasr_V3_20191210_81acdf5.jar
--------------------------------------------------------------------------------
/lib_asr/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 com.baidu.speech.**{*;}
23 |
--------------------------------------------------------------------------------
/lib_asr/src/androidTest/java/net/lishaoy/lib_asr/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_asr;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.lib_asr.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib_asr/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
12 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/lib_asr/src/main/java/net/lishaoy/lib_asr/asr/AsrManager.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_asr.asr;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import com.baidu.speech.EventManager;
7 | import com.baidu.speech.EventManagerFactory;
8 | import com.baidu.speech.asr.SpeechConstant;
9 |
10 | import org.json.JSONObject;
11 |
12 | import java.util.Map;
13 |
14 | public class AsrManager {
15 | private static final String TAG = "AsrManager";
16 | /**
17 | * SDK 内部核心 EventManager 类
18 | */
19 | private EventManager asr;
20 |
21 | // SDK 内部核心 事件回调类, 用于开发者写自己的识别回调逻辑
22 | private RecogEventAdapter eventListener;
23 |
24 | // 未release前,只能new一个
25 | private static volatile boolean isInited = false;
26 |
27 | /**
28 | * 初始化 提供 EventManagerFactory需要的Context和RecogEventAdapter
29 | *
30 | * @param context
31 | * @param listener 识别状态和结果回调
32 | */
33 | public AsrManager(Context context, OnAsrListener listener) {
34 | if (isInited) {
35 | Log.e(TAG, "还未调用release(),请勿新建一个新类");
36 | throw new RuntimeException("还未调用release(),请勿新建一个新类");
37 | }
38 | isInited = true;
39 | // SDK集成步骤 初始化asr的EventManager示例,多次得到的类,只能选一个使用
40 | asr = EventManagerFactory.create(context, "asr");
41 | // SDK集成步骤 设置回调event, 识别引擎会回调这个类告知重要状态和识别结果
42 | asr.registerListener(eventListener = new RecogEventAdapter(listener));
43 | }
44 |
45 | /**
46 | * @param params
47 | */
48 | public void start(Map params) {
49 | // SDK集成步骤 拼接识别参数
50 | String json = new JSONObject(params).toString();
51 | Log.i(TAG + ".Debug", "识别参数(反馈请带上此行日志)" + json);
52 | asr.send(SpeechConstant.ASR_START, json, null, 0, 0);
53 | }
54 |
55 |
56 | /**
57 | * 提前结束录音等待识别结果。
58 | */
59 | public void stop() {
60 | Log.i(TAG, "停止录音");
61 | // SDK 集成步骤(可选)停止录音
62 | if (!isInited) {
63 | throw new RuntimeException("release() was called");
64 | }
65 | asr.send(SpeechConstant.ASR_STOP, "{}", null, 0, 0);
66 | }
67 |
68 | /**
69 | * 取消本次识别,取消后将立即停止不会返回识别结果。
70 | * cancel 与stop的区别是 cancel在stop的基础上,完全停止整个识别流程,
71 | */
72 | public void cancel() {
73 | Log.i(TAG, "取消识别");
74 | if (!isInited) {
75 | throw new RuntimeException("release() was called");
76 | }
77 | // SDK集成步骤 (可选) 取消本次识别
78 | asr.send(SpeechConstant.ASR_CANCEL, "{}", null, 0, 0);
79 | }
80 |
81 | public void release() {
82 | if (asr == null) {
83 | return;
84 | }
85 | cancel();
86 | // SDK 集成步骤(可选),卸载listener
87 | asr.unregisterListener(eventListener);
88 | asr = null;
89 | isInited = false;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/lib_asr/src/main/java/net/lishaoy/lib_asr/asr/OnAsrListener.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_asr.asr;
2 |
3 | /**
4 | * 与SDK中回调参数的对应关系定义在RecogEventAdapter类中
5 | */
6 |
7 | public interface OnAsrListener {
8 |
9 | /**
10 | * CALLBACK_EVENT_ASR_READY
11 | * ASR_START 输入事件调用后,引擎准备完毕
12 | */
13 | void onAsrReady();
14 |
15 | /**
16 | * CALLBACK_EVENT_ASR_BEGIN
17 | * onAsrReady后检查到用户开始说话
18 | */
19 | void onAsrBegin();
20 |
21 | /**
22 | * CALLBACK_EVENT_ASR_END
23 | * 检查到用户开始说话停止,或者ASR_STOP 输入事件调用后,
24 | */
25 | void onAsrEnd();
26 |
27 | /**
28 | * CALLBACK_EVENT_ASR_PARTIAL resultType=partial_result
29 | * onAsrBegin 后 随着用户的说话,返回的临时结果
30 | *
31 | * @param results 可能返回多个结果,请取第一个结果
32 | * @param recogResult 完整的结果
33 | */
34 | void onAsrPartialResult(String[] results, RecogResult recogResult);
35 |
36 | /**
37 | * 语音的在线语义结果
38 | *
39 | * CALLBACK_EVENT_ASR_PARTIAL resultType=nlu_result
40 | * @param nluResult
41 | */
42 | void onAsrOnlineNluResult(String nluResult);
43 |
44 | /**
45 | * CALLBACK_EVENT_ASR_PARTIAL resultType=final_result
46 | * 最终的识别结果
47 | *
48 | * @param results 可能返回多个结果,请取第一个结果
49 | * @param recogResult 完整的结果
50 | */
51 | void onAsrFinalResult(String[] results, RecogResult recogResult);
52 |
53 | /**
54 | * CALLBACK_EVENT_ASR_FINISH
55 | * @param recogResult 完整的结果
56 | */
57 | void onAsrFinish(RecogResult recogResult);
58 |
59 | /**
60 | * CALLBACK_EVENT_ASR_FINISH error!=0
61 | *
62 | * @param errorCode
63 | * @param subErrorCode
64 | * @param descMessage
65 | * @param recogResult
66 | */
67 | void onAsrFinishError(int errorCode, int subErrorCode, String descMessage, RecogResult recogResult);
68 |
69 | /**
70 | * 长语音识别结束
71 | */
72 | void onAsrLongFinish();
73 |
74 | /**
75 | * CALLBACK_EVENT_ASR_VOLUME
76 | * 音量回调
77 | *
78 | * @param volumePercent 音量的相对值,百分比,0-100
79 | * @param volume 音量绝对值
80 | */
81 | void onAsrVolume(int volumePercent, int volume);
82 |
83 | /**
84 | * CALLBACK_EVENT_ASR_AUDIO
85 | * @param data pcm格式,16bits 16000采样率
86 | *
87 | * @param offset
88 | * @param length
89 | */
90 | void onAsrAudio(byte[] data, int offset, int length);
91 |
92 | /**
93 | * CALLBACK_EVENT_ASR_EXIT
94 | * 引擎完成整个识别,空闲中
95 | */
96 | void onAsrExit();
97 |
98 | /**
99 | * CALLBACK_EVENT_ASR_LOADED
100 | * 离线命令词资源加载成功
101 | */
102 | void onOfflineLoaded();
103 |
104 | /**
105 | * CALLBACK_EVENT_ASR_UNLOADED
106 | * 离线命令词资源释放成功
107 | */
108 | void onOfflineUnLoaded();
109 | }
110 |
--------------------------------------------------------------------------------
/lib_asr/src/main/java/net/lishaoy/lib_asr/asr/ResultStateful.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_asr.asr;
2 |
3 | import android.util.Log;
4 |
5 | import androidx.annotation.Nullable;
6 | import io.flutter.plugin.common.MethodChannel;
7 |
8 | public class ResultStateful implements MethodChannel.Result {
9 | private final static String TAG = "ResultStateful";
10 | private MethodChannel.Result result;
11 | private boolean called;
12 |
13 | public static ResultStateful of(MethodChannel.Result result) {
14 | return new ResultStateful(result);
15 | }
16 |
17 | private ResultStateful(MethodChannel.Result result) {
18 | this.result = result;
19 | }
20 |
21 | @Override
22 | public void success(@Nullable Object o) {
23 | if (called) {
24 | printError();
25 | return;
26 | }
27 | called = true;
28 | result.success(o);
29 | }
30 |
31 | @Override
32 | public void error(String s, @Nullable String s1, @Nullable Object o) {
33 | if (called) {
34 | printError();
35 | return;
36 | }
37 | called = true;
38 | result.error(s, s1, o);
39 | }
40 |
41 | @Override
42 | public void notImplemented() {
43 | if (called) {
44 | printError();
45 | return;
46 | }
47 | called = true;
48 | result.notImplemented();
49 |
50 | }
51 |
52 | private void printError() {
53 | Log.e(TAG, "error:result called");
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib_asr/src/main/jniLibs/arm64-v8a/libBaiduSpeechSDK.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/src/main/jniLibs/arm64-v8a/libBaiduSpeechSDK.so
--------------------------------------------------------------------------------
/lib_asr/src/main/jniLibs/arm64-v8a/libvad.dnn.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/src/main/jniLibs/arm64-v8a/libvad.dnn.so
--------------------------------------------------------------------------------
/lib_asr/src/main/jniLibs/x86/libBaiduSpeechSDK.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/src/main/jniLibs/x86/libBaiduSpeechSDK.so
--------------------------------------------------------------------------------
/lib_asr/src/main/jniLibs/x86/libvad.dnn.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/src/main/jniLibs/x86/libvad.dnn.so
--------------------------------------------------------------------------------
/lib_asr/src/main/jniLibs/x86_64/libBaiduSpeechSDK.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/src/main/jniLibs/x86_64/libBaiduSpeechSDK.so
--------------------------------------------------------------------------------
/lib_asr/src/main/jniLibs/x86_64/libvad.dnn.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_asr/src/main/jniLibs/x86_64/libvad.dnn.so
--------------------------------------------------------------------------------
/lib_asr/src/test/java/net/lishaoy/lib_asr/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_asr;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/lib_base/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib_base/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.android.compileSdkVersion
5 | buildToolsVersion rootProject.android.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.android.minSdkVersion
9 | targetSdkVersion rootProject.android.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | //ARouter配置
14 | javaCompileOptions {
15 | annotationProcessorOptions {
16 | arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
17 | }
18 | }
19 | }
20 |
21 | buildTypes {
22 | release {
23 | minifyEnabled false
24 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25 | }
26 | }
27 |
28 | }
29 |
30 | dependencies {
31 | implementation fileTree(dir: 'libs', include: ['*.jar'])
32 |
33 | compileOnly rootProject.depsLibs.appcompat
34 | //arouter库
35 | compileOnly(rootProject.depsLibs.arouterapi) {
36 | exclude group: 'com.android.support'
37 | }
38 | annotationProcessor rootProject.depsLibs.aroutercompiler
39 |
40 | //引入flutter模块
41 | compileOnly project(path: ':flutter')
42 | }
43 |
--------------------------------------------------------------------------------
/lib_base/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_base/consumer-rules.pro
--------------------------------------------------------------------------------
/lib_base/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 |
--------------------------------------------------------------------------------
/lib_base/src/androidTest/java/net/lishaoy/lib_base/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.lib_base.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib_base/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/lib_base/src/main/java/net/lishaoy/lib_base/app/service/MethodChannelService.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base.app.service;
2 |
3 | import com.alibaba.android.arouter.facade.template.IProvider;
4 |
5 | import io.flutter.view.FlutterView;
6 |
7 | public interface MethodChannelService extends IProvider {
8 | void registerWith(FlutterView flutterView);
9 | }
10 |
--------------------------------------------------------------------------------
/lib_base/src/main/java/net/lishaoy/lib_base/app/service/wrapper/MethodChannelImpl.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base.app.service.wrapper;
2 |
3 | import com.alibaba.android.arouter.facade.annotation.Autowired;
4 | import com.alibaba.android.arouter.launcher.ARouter;
5 |
6 | import net.lishaoy.lib_base.app.service.MethodChannelService;
7 |
8 | import io.flutter.view.FlutterView;
9 |
10 | public class MethodChannelImpl {
11 | @Autowired(name = "/app/MethodChannel")
12 | protected MethodChannelService methodChannelService;
13 |
14 | private static MethodChannelImpl methodChannel = null;
15 |
16 | public static MethodChannelImpl getInstance() {
17 | if (methodChannel == null) {
18 | synchronized (MethodChannelImpl.class) {
19 | if (methodChannel == null) {
20 | methodChannel = new MethodChannelImpl();
21 | }
22 | }
23 | }
24 |
25 | return methodChannel;
26 | }
27 |
28 | private MethodChannelImpl() {
29 | ARouter.getInstance().inject(this);
30 | }
31 |
32 | public void registerWith(FlutterView flutterView) {
33 | methodChannelService.registerWith(flutterView);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib_base/src/main/java/net/lishaoy/lib_base/ft_home/service/HomeService.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base.ft_home.service;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.fragment.app.Fragment;
6 |
7 | import com.alibaba.android.arouter.facade.template.IProvider;
8 |
9 | public interface HomeService extends IProvider {
10 |
11 | Fragment toHome (Context context);
12 | }
13 |
--------------------------------------------------------------------------------
/lib_base/src/main/java/net/lishaoy/lib_base/ft_home/service/wrapper/HomeImpl.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base.ft_home.service.wrapper;
2 |
3 | import android.content.Context;
4 | import androidx.fragment.app.Fragment;
5 | import com.alibaba.android.arouter.facade.annotation.Autowired;
6 | import com.alibaba.android.arouter.launcher.ARouter;
7 | import net.lishaoy.lib_base.ft_home.service.HomeService;
8 |
9 | public class HomeImpl {
10 |
11 | @Autowired(name = "/home/home_service") protected HomeService homeService;
12 |
13 | private static HomeImpl mHomeImpl = null;
14 |
15 | public static HomeImpl getInstance() {
16 | if (mHomeImpl == null) {
17 | synchronized (HomeImpl.class) {
18 | if (mHomeImpl == null) {
19 | mHomeImpl = new HomeImpl();
20 | }
21 | return mHomeImpl;
22 | }
23 | }
24 | return mHomeImpl;
25 | }
26 |
27 | private HomeImpl() {
28 | ARouter.getInstance().inject(this);
29 | }
30 |
31 | public Fragment toHome(Context context) {
32 | return homeService.toHome(context);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib_base/src/main/java/net/lishaoy/lib_base/lib_webview/service/WebViewService.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base.lib_webview.service;
2 |
3 | import com.alibaba.android.arouter.facade.template.IProvider;
4 |
5 | public interface WebViewService extends IProvider {
6 | void gotoWebView(String url);
7 | void gotoWebView(String url,boolean isHideBar);
8 | }
9 |
--------------------------------------------------------------------------------
/lib_base/src/main/java/net/lishaoy/lib_base/lib_webview/service/wrapper/WebViewImpl.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base.lib_webview.service.wrapper;
2 |
3 | import com.alibaba.android.arouter.facade.annotation.Autowired;
4 | import com.alibaba.android.arouter.launcher.ARouter;
5 |
6 | import net.lishaoy.lib_base.lib_webview.service.WebViewService;
7 |
8 | public class WebViewImpl {
9 | @Autowired(name = "/webview/webview_service") protected WebViewService webViewService;
10 |
11 | private static WebViewImpl mWebView = null;
12 |
13 | public static WebViewImpl getInstance(){
14 | if (mWebView == null){
15 | synchronized (WebViewImpl.class){
16 | if (mWebView == null) {
17 | mWebView = new WebViewImpl();
18 | }
19 | }
20 | }
21 |
22 | return mWebView;
23 | }
24 |
25 | private WebViewImpl(){
26 | ARouter.getInstance().inject(this);
27 | }
28 |
29 | public void gotoWebView(String url){
30 | webViewService.gotoWebView(url);
31 | }
32 |
33 | public void gotoWebView(String url,boolean isHideBar){
34 | webViewService.gotoWebView(url,isHideBar);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib_base/src/test/java/net/lishaoy/lib_base/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_base;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/lib_common_ui/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib_common_ui/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.android.compileSdkVersion
5 | buildToolsVersion rootProject.android.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.android.minSdkVersion
9 | targetSdkVersion rootProject.android.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 |
26 | compileOnly rootProject.depsLibs.appcompat
27 | }
28 |
--------------------------------------------------------------------------------
/lib_common_ui/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_common_ui/consumer-rules.pro
--------------------------------------------------------------------------------
/lib_common_ui/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 com.gyf.immersionbar.* {*;}
23 | -dontwarn com.gyf.immersionbar.**
--------------------------------------------------------------------------------
/lib_common_ui/src/androidTest/java/net/lishaoy/lib_common_ui/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_common_ui;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.lib_common_ui.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib_common_ui/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/lib_common_ui/src/main/java/net/lishaoy/lib_common_ui/utils/Utils.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_common_ui.utils;
2 |
3 | import android.content.res.Resources;
4 | import android.graphics.Outline;
5 | import android.os.Build;
6 | import android.util.TypedValue;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.view.ViewOutlineProvider;
11 |
12 | import androidx.annotation.LayoutRes;
13 | import androidx.annotation.NonNull;
14 | import androidx.annotation.RequiresApi;
15 |
16 | public class Utils {
17 |
18 | /**
19 | * 获取真正的位置
20 | *
21 | * @param isIncrease 首尾是否有增加
22 | * @param position 当前位置
23 | * @param realCount 真实数量
24 | * @return
25 | */
26 | public static int getRealPosition(boolean isIncrease, int position, int realCount) {
27 | if (!isIncrease) {
28 | return position;
29 | }
30 | int realPosition;
31 | if (position == 0) {
32 | realPosition = realCount - 1;
33 | } else if (position == realCount + 1) {
34 | realPosition = 0;
35 | } else {
36 | realPosition = position - 1;
37 | }
38 | return realPosition;
39 | }
40 |
41 | /**
42 | * 将布局文件转成view,这里为了适配viewpager2中高宽必须为match_parent
43 | *
44 | * @param parent
45 | * @param layoutId
46 | * @return
47 | */
48 | public static View getView(@NonNull ViewGroup parent, @LayoutRes int layoutId) {
49 | View view = LayoutInflater.from(parent.getContext()).inflate(layoutId, parent, false);
50 | ViewGroup.LayoutParams params = view.getLayoutParams();
51 | //这里判断高度和宽带是否都是match_parent
52 | if (params.height != -1 || params.width != -1) {
53 | params.height = -1;
54 | params.width = -1;
55 | view.setLayoutParams(params);
56 | }
57 | return view;
58 | }
59 |
60 | public static float dp2px(float dp) {
61 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics());
62 | }
63 |
64 | /**
65 | * 设置view圆角
66 | *
67 | * @param radius
68 | * @return
69 | */
70 | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
71 | public static void setBannerRound(View view, final float radius) {
72 | view.setOutlineProvider(new ViewOutlineProvider() {
73 | @Override
74 | public void getOutline(View view, Outline outline) {
75 | outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), radius);
76 | }
77 | });
78 | view.setClipToOutline(true);
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib_common_ui/src/test/java/net/lishaoy/lib_common_ui/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_common_ui;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/lib_image_loader/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib_image_loader/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.android.compileSdkVersion
5 | buildToolsVersion rootProject.android.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.android.minSdkVersion
9 | targetSdkVersion rootProject.android.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 |
26 | implementation rootProject.depsLibs.glide
27 | annotationProcessor rootProject.depsLibs.glidecompiler
28 | compileOnly rootProject.depsLibs.rxjava
29 | compileOnly rootProject.depsLibs.rxandroid
30 | }
31 |
--------------------------------------------------------------------------------
/lib_image_loader/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_image_loader/consumer-rules.pro
--------------------------------------------------------------------------------
/lib_image_loader/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 |
--------------------------------------------------------------------------------
/lib_image_loader/src/androidTest/java/net/lishaoy/lib_image_loader/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.lib_image_loader.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/java/net/lishaoy/lib_image_loader/app/ImageGlideExtension.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader.app;
2 |
3 | import com.bumptech.glide.annotation.GlideExtension;
4 | import com.bumptech.glide.annotation.GlideOption;
5 | import com.bumptech.glide.request.BaseRequestOptions;
6 |
7 | @GlideExtension
8 | public class ImageGlideExtension {
9 | private ImageGlideExtension() {
10 | }
11 |
12 | @GlideOption
13 | public static BaseRequestOptions> injectOptions(BaseRequestOptions> options) {
14 | return null;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/java/net/lishaoy/lib_image_loader/app/ImageGlideModel.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader.app;
2 |
3 | import com.bumptech.glide.annotation.GlideModule;
4 | import com.bumptech.glide.module.AppGlideModule;
5 |
6 | @GlideModule
7 | public class ImageGlideModel extends AppGlideModule {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/java/net/lishaoy/lib_image_loader/image/CustomRequestListener.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader.image;
2 |
3 | import com.bumptech.glide.request.RequestListener;
4 |
5 | public interface CustomRequestListener extends RequestListener {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/java/net/lishaoy/lib_image_loader/listener/ImageCallBack.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader.listener;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | import com.bumptech.glide.load.DataSource;
6 | import com.bumptech.glide.load.engine.GlideException;
7 | import com.bumptech.glide.request.RequestListener;
8 | import com.bumptech.glide.request.target.Target;
9 |
10 | public class ImageCallBack implements RequestListener {
11 |
12 | private ImageCallBackListener listener;
13 |
14 | public ImageCallBack(ImageCallBackListener listener) {
15 | this.listener = listener;
16 | }
17 |
18 | @Override
19 | public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
20 | listener.onFailure();
21 | return false;
22 | }
23 |
24 | @Override
25 | public boolean onResourceReady(Object resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) {
26 | listener.onSuccess();
27 | return false;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/java/net/lishaoy/lib_image_loader/listener/ImageCallBackListener.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader.listener;
2 |
3 | public interface ImageCallBackListener {
4 | /**
5 | * 请求成功回调事件处理
6 | */
7 | void onSuccess();
8 |
9 | /**
10 | * 请求失败回调事件处理
11 | */
12 | void onFailure();
13 | }
14 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/res/drawable/ic_broken_image_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/lib_image_loader/src/main/res/drawable/ic_image_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/lib_image_loader/src/test/java/net/lishaoy/lib_image_loader/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_image_loader;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/lib_network/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib_network/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.android.compileSdkVersion
5 | buildToolsVersion rootProject.android.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.android.minSdkVersion
9 | targetSdkVersion rootProject.android.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 |
26 | compileOnly rootProject.depsLibs.appcompat
27 | api rootProject.depsLibs.okhttp
28 | implementation rootProject.depsLibs.okhttpLogging
29 | compileOnly rootProject.depsLibs.gson
30 | }
31 |
--------------------------------------------------------------------------------
/lib_network/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_network/consumer-rules.pro
--------------------------------------------------------------------------------
/lib_network/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 |
--------------------------------------------------------------------------------
/lib_network/src/androidTest/java/net/lishaoy/lib_network/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.lib_network.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib_network/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/lib_network/src/main/java/net/lishaoy/lib_network/exception/OkHttpException.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network.exception;
2 |
3 | /*
4 | * 自定义异常类,返回ecode,emsg到业务层
5 | */
6 | public class OkHttpException extends Exception {
7 | private static final long serialVersionUID = 1L;
8 |
9 | /**
10 | * the server return code
11 | */
12 | private int ecode;
13 |
14 | /**
15 | * the server return error message
16 | */
17 | private Object emsg;
18 |
19 | public OkHttpException(int ecode, Object emsg) {
20 | this.ecode = ecode;
21 | this.emsg = emsg;
22 | }
23 |
24 | public int getEcode() {
25 | return ecode;
26 | }
27 |
28 | public Object getEmsg() {
29 | return emsg;
30 | }
31 | }
--------------------------------------------------------------------------------
/lib_network/src/main/java/net/lishaoy/lib_network/listener/DisposeDataHandle.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network.listener;
2 |
3 | /**
4 | * @author vision
5 | *
6 | */
7 | public class DisposeDataHandle
8 | {
9 | public DisposeDataListener mListener = null;
10 | public Class> mClass = null;
11 | public String mSource = null;
12 |
13 | public DisposeDataHandle(DisposeDataListener listener)
14 | {
15 | this.mListener = listener;
16 | }
17 |
18 | public DisposeDataHandle(DisposeDataListener listener, Class> clazz)
19 | {
20 | this.mListener = listener;
21 | this.mClass = clazz;
22 | }
23 |
24 | public DisposeDataHandle(DisposeDataListener listener, String source)
25 | {
26 | this.mListener = listener;
27 | this.mSource = source;
28 | }
29 | }
--------------------------------------------------------------------------------
/lib_network/src/main/java/net/lishaoy/lib_network/listener/DisposeDataListener.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network.listener;
2 |
3 | /*
4 | * 业务逻辑层真正处理的地方,包括java层异常和业务层异常
5 | */
6 | public interface DisposeDataListener {
7 |
8 | /**
9 | * 请求成功回调事件处理
10 | */
11 | void onSuccess(Object responseObj);
12 |
13 | /**
14 | * 请求失败回调事件处理
15 | */
16 | void onFailure(Object reasonObj);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/lib_network/src/main/java/net/lishaoy/lib_network/listener/DisposeDownloadListener.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network.listener;
2 |
3 | /**
4 | * @author vision
5 | * @function 监听下载进度
6 | */
7 | public interface DisposeDownloadListener extends DisposeDataListener {
8 | void onProgress(int progress);
9 | }
10 |
--------------------------------------------------------------------------------
/lib_network/src/main/java/net/lishaoy/lib_network/request/RequestParams.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network.request;
2 |
3 | import java.io.FileNotFoundException;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 | import java.util.concurrent.ConcurrentHashMap;
7 |
8 | /**
9 | * @author vision
10 | */
11 | public class RequestParams {
12 |
13 | public ConcurrentHashMap urlParams = new ConcurrentHashMap();
14 | public ConcurrentHashMap fileParams = new ConcurrentHashMap();
15 |
16 | /**
17 | * Constructs a new empty {@code RequestParams} instance.
18 | */
19 | public RequestParams() {
20 | this((Map) null);
21 | }
22 |
23 | /**
24 | * Constructs a new RequestParams instance containing the key/value string
25 | * params from the specified map.
26 | *
27 | * @param source the source key/value string map to add.
28 | */
29 | public RequestParams(Map source) {
30 | if (source != null) {
31 | for (Map.Entry entry : source.entrySet()) {
32 | put(entry.getKey(), entry.getValue());
33 | }
34 | }
35 | }
36 |
37 | /**
38 | * Constructs a new RequestParams instance and populate it with a single
39 | * initial key/value string param.
40 | *
41 | * @param key the key name for the intial param.
42 | * @param value the value string for the initial param.
43 | */
44 | public RequestParams(final String key, final String value) {
45 | this(new HashMap() {
46 | {
47 | put(key, value);
48 | }
49 | });
50 | }
51 |
52 | /**
53 | * Adds a key/value string pair to the request.
54 | *
55 | * @param key the key name for the new param.
56 | * @param value the value string for the new param.
57 | */
58 | public void put(String key, String value) {
59 | if (key != null && value != null) {
60 | urlParams.put(key, value);
61 | }
62 | }
63 |
64 | public void put(String key, Object object) throws FileNotFoundException {
65 |
66 | if (key != null) {
67 | fileParams.put(key, object);
68 | }
69 | }
70 |
71 | public boolean hasParams() {
72 | if(urlParams.size() > 0 || fileParams.size() > 0){
73 |
74 | return true;
75 | }
76 | return false;
77 | }
78 | }
--------------------------------------------------------------------------------
/lib_network/src/test/java/net/lishaoy/lib_network/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_network;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/lib_webview/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib_webview/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.alibaba.arouter'
3 |
4 | android {
5 | compileSdkVersion rootProject.android.compileSdkVersion
6 | buildToolsVersion rootProject.android.buildToolsVersion
7 |
8 | defaultConfig {
9 | minSdkVersion rootProject.android.minSdkVersion
10 | targetSdkVersion rootProject.android.targetSdkVersion
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | //ARouter配置
15 | javaCompileOptions {
16 | annotationProcessorOptions {
17 | arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
18 | }
19 | }
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 |
29 | }
30 |
31 | dependencies {
32 | implementation fileTree(dir: 'libs', include: ['*.jar'])
33 |
34 | compileOnly rootProject.depsLibs.appcompat
35 | implementation rootProject.depsLibs.agentweb
36 | compileOnly rootProject.depsLibs.smartRefreshLayout
37 | compileOnly rootProject.depsLibs.refreshHeader
38 | compileOnly rootProject.depsLibs.immersionbar
39 |
40 | //arouter库
41 | compileOnly(rootProject.depsLibs.arouterapi) {
42 | exclude group: 'com.android.support'
43 | }
44 | annotationProcessor rootProject.depsLibs.aroutercompiler
45 |
46 | //eventbus
47 | compileOnly rootProject.depsLibs.eventbus
48 |
49 | //base库
50 | compileOnly project(':lib_base')
51 | }
52 |
--------------------------------------------------------------------------------
/lib_webview/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/persilee/android_ctrip/a0d87989976b36cb6b294e9aebd1bb881680f6e5/lib_webview/consumer-rules.pro
--------------------------------------------------------------------------------
/lib_webview/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 |
--------------------------------------------------------------------------------
/lib_webview/src/androidTest/java/net/lishaoy/lib_webview/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_webview;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("net.lishaoy.lib_webview.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib_webview/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib_webview/src/main/java/net/lishaoy/lib_webview/events/RefreshEvent.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_webview.events;
2 |
3 | public class RefreshEvent {
4 | }
5 |
--------------------------------------------------------------------------------
/lib_webview/src/main/java/net/lishaoy/lib_webview/service/WebViewServiceImpl.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_webview.service;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import com.alibaba.android.arouter.facade.annotation.Route;
7 | import com.alibaba.android.arouter.launcher.ARouter;
8 |
9 | import net.lishaoy.lib_base.lib_webview.service.WebViewService;
10 |
11 | @Route(path = "/webview/webview_service")
12 | public class WebViewServiceImpl implements WebViewService {
13 |
14 | @Override
15 | public void gotoWebView(String url) {
16 | ARouter.getInstance()
17 | .build("/webview/web_activity")
18 | .withString("url", url)
19 | .navigation();
20 | }
21 |
22 | public void gotoWebView(String url,boolean isHideBar){
23 | ARouter.getInstance()
24 | .build("/webview/web_activity")
25 | .withString("url", url)
26 | .withBoolean("isHideBar", isHideBar)
27 | .navigation();
28 | }
29 |
30 | @Override
31 | public void init(Context context) {
32 | Log.i(WebViewServiceImpl.class.getSimpleName(),"init");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib_webview/src/main/java/net/lishaoy/lib_webview/widget/WebLayout.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_webview.widget;
2 |
3 | import android.app.Activity;
4 | import android.view.LayoutInflater;
5 | import android.view.ViewGroup;
6 | import android.webkit.WebView;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.annotation.Nullable;
10 |
11 | import com.just.agentweb.IWebLayout;
12 | import com.scwang.smart.refresh.header.ClassicsHeader;
13 | import com.scwang.smart.refresh.layout.SmartRefreshLayout;
14 | import com.scwang.smart.refresh.layout.api.RefreshLayout;
15 | import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
16 |
17 | import net.lishaoy.lib_webview.R;
18 | import net.lishaoy.lib_webview.events.RefreshEvent;
19 |
20 | import org.greenrobot.eventbus.EventBus;
21 |
22 | public class WebLayout implements IWebLayout {
23 |
24 | private Activity activity;
25 | private WebView webView = null;
26 | private final SmartRefreshLayout smartRefreshLayout;
27 |
28 | public WebLayout(Activity activity) {
29 | this.activity = activity;
30 | smartRefreshLayout = (SmartRefreshLayout) LayoutInflater.from(activity).inflate(R.layout.fragment_twk_web, null);
31 | smartRefreshLayout.setRefreshHeader(new ClassicsHeader(activity));
32 | smartRefreshLayout.setEnableLoadMore(false);
33 | smartRefreshLayout.setEnableNestedScroll(true);
34 | smartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
35 | @Override
36 | public void onRefresh(@NonNull RefreshLayout refreshLayout) {
37 | EventBus.getDefault().post(new RefreshEvent());
38 | refreshLayout.finishRefresh(1600);
39 | }
40 | });
41 | webView = smartRefreshLayout.findViewById(R.id.web_view);
42 | }
43 |
44 |
45 | @NonNull
46 | @Override
47 | public ViewGroup getLayout() {
48 | return smartRefreshLayout;
49 | }
50 |
51 | @Nullable
52 | @Override
53 | public WebView getWebView() {
54 | return webView;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib_webview/src/main/res/layout/activity_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/lib_webview/src/main/res/layout/fragment_twk_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/lib_webview/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/lib_webview/src/test/java/net/lishaoy/lib_webview/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package net.lishaoy.lib_webview;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name='android_ctrip'
2 | include ':app'
3 | setBinding(new Binding([gradle: this]))
4 | evaluate(new File(
5 | settingsDir,
6 | 'flutter_module/.android/include_flutter.groovy'
7 | ))
8 | include ':lib_common_ui'
9 | include ':lib_image_loader'
10 | include ':lib_network'
11 | include ':lib_webview'
12 | include ':ft_home'
13 | include ':lib_base'
14 | include ':flutter_module'
15 | include ':lib_asr'
16 |
--------------------------------------------------------------------------------