Browse Source

1.一装一卸。

石慧云 4 years ago
parent
commit
c14554cfee
63 changed files with 3279 additions and 4 deletions
  1. 1 0
      app/build.gradle
  2. 3 1
      app/src/main/java/com/quansu/heifengwuliu/activity/HomeActivity.kt
  3. 9 1
      app/src/main/java/com/quansu/heifengwuliu/component/CpApp.kt
  4. 2 0
      app/src/main/java/com/quansu/heifengwuliu/config/ConfigRx.kt
  5. 6 0
      app/src/main/java/com/quansu/heifengwuliu/fragment/DeliverGoodsFragment.kt
  6. 37 0
      app/src/main/java/com/quansu/heifengwuliu/fragment/OwnerSingleFragment.kt
  7. 53 0
      app/src/main/java/com/quansu/heifengwuliu/widget/AddressItemView.java
  8. 3 0
      app/src/main/res/layout/fragment_ownersingle.xml
  9. 22 2
      app/src/main/res/layout/widget_addressitem.xml
  10. 26 0
      base/src/main/java/com/ysnows/base/model/PositionBean.java
  11. 2 0
      base/src/main/java/com/ysnows/base/route/IApp.kt
  12. 15 0
      base/src/main/java/com/ysnows/base/route/IGaode.kt
  13. 2 0
      gaode/.gitignore
  14. 56 0
      gaode/build.gradle
  15. 47 0
      gaode/proguard-rules.pro
  16. 69 0
      gaode/src/main/AndroidManifest.xml
  17. 72 0
      gaode/src/main/debug/AndroidManifest.xml
  18. 471 0
      gaode/src/main/java/com/quansu/gaode/activity/AutoListView.java
  19. 720 0
      gaode/src/main/java/com/quansu/gaode/activity/GaodeActivity.java
  20. 242 0
      gaode/src/main/java/com/quansu/gaode/activity/SearchAddressActivity.java
  21. 63 0
      gaode/src/main/java/com/quansu/gaode/adapter/PoiAdapter.java
  22. 112 0
      gaode/src/main/java/com/quansu/gaode/adapter/SearchResultAdapter.java
  23. 20 0
      gaode/src/main/java/com/quansu/gaode/adapter/ViewHolder.java
  24. 92 0
      gaode/src/main/java/com/quansu/gaode/bean/PoiBean.java
  25. 63 0
      gaode/src/main/java/com/quansu/gaode/componnent/CpGaode.java
  26. 237 0
      gaode/src/main/java/com/quansu/gaode/view/SegmentedGroup.java
  27. BIN
      gaode/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v7_1_0.so
  28. BIN
      gaode/src/main/res/drawable-xxhdpi/gaode_delete.webp
  29. BIN
      gaode/src/main/res/drawable-xxhdpi/gaode_serch.webp
  30. BIN
      gaode/src/main/res/drawable-xxhdpi/icon_affirm_selected.webp
  31. BIN
      gaode/src/main/res/drawable-xxhdpi/purple_pin.png
  32. 6 0
      gaode/src/main/res/drawable/bg_search_shape_44.xml
  33. 6 0
      gaode/src/main/res/drawable/button_text_color.xml
  34. 30 0
      gaode/src/main/res/drawable/custom_progress_bar.xml
  35. 16 0
      gaode/src/main/res/drawable/gaode_stock_gary.xml
  36. 13 0
      gaode/src/main/res/drawable/gaode_stock_white.xml
  37. 9 0
      gaode/src/main/res/drawable/ic_arrow_back_black_24dp.xml
  38. 10 0
      gaode/src/main/res/drawable/radio_checked.xml
  39. 10 0
      gaode/src/main/res/drawable/radio_unchecked.xml
  40. 267 0
      gaode/src/main/res/layout/activity_gaode.xml
  41. 160 0
      gaode/src/main/res/layout/activity_search_address.xml
  42. 38 0
      gaode/src/main/res/layout/autolistview_footer.xml
  43. 12 0
      gaode/src/main/res/layout/gaode_item_marker.xml
  44. 39 0
      gaode/src/main/res/layout/item_select_address.xml
  45. 52 0
      gaode/src/main/res/layout/map_bubble_back.xml
  46. 49 0
      gaode/src/main/res/layout/pull_to_refresh_header.xml
  47. 41 0
      gaode/src/main/res/layout/view_holder_result.xml
  48. BIN
      gaode/src/main/res/mipmap-hdpi/loading_0.png
  49. BIN
      gaode/src/main/res/mipmap-hdpi/loading_1.png
  50. BIN
      gaode/src/main/res/mipmap-hdpi/loading_2.png
  51. BIN
      gaode/src/main/res/mipmap-hdpi/loading_3.png
  52. BIN
      gaode/src/main/res/mipmap-hdpi/loading_4.png
  53. BIN
      gaode/src/main/res/mipmap-hdpi/loading_5.png
  54. BIN
      gaode/src/main/res/mipmap-hdpi/loading_6.png
  55. BIN
      gaode/src/main/res/mipmap-hdpi/loading_7.png
  56. BIN
      gaode/src/main/res/mipmap-hdpi/poi_marker_1.png
  57. BIN
      gaode/src/main/res/mipmap-hdpi/point4.png
  58. BIN
      gaode/src/main/res/mipmap-hdpi/pull_to_refresh_arrow.png
  59. 7 0
      gaode/src/main/res/values/colors.xml
  60. 3 0
      gaode/src/main/res/values/dimens.xml
  61. 11 0
      gaode/src/main/res/values/strings.xml
  62. 54 0
      gaode/src/main/res/values/styles.xml
  63. 1 0
      settings.gradle

+ 1 - 0
app/build.gradle

@@ -118,6 +118,7 @@ dependencies {
     addComponent 'update'
     addComponent 'umeng'
     addComponent 'jpush'
+    addComponent 'gaode'
 
     //微信sdk
     implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'

+ 3 - 1
app/src/main/java/com/quansu/heifengwuliu/activity/HomeActivity.kt

@@ -7,7 +7,6 @@ import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.base.MBActivity
 import com.quansu.heifengwuliu.databinding.ActivityHomeBinding
 import com.quansu.heifengwuliu.fragment.DeliverGoodsFragment
-import com.quansu.heifengwuliu.fragment.IndexFragment
 import com.quansu.heifengwuliu.fragment.MineFragment
 import com.quansu.heifengwuliu.fragment.WayBillFragment
 import com.quansu.heifengwuliu.repository.HomeRepository
@@ -90,5 +89,8 @@ class HomeActivity : MBActivity<HomeVModel, ActivityHomeBinding>() {
                 .rendor()
     }
 
+    override val isRxbus: Boolean
+        get() = true
+
 
 }

+ 9 - 1
app/src/main/java/com/quansu/heifengwuliu/component/CpApp.kt

@@ -1,6 +1,5 @@
 package com.quansu.heifengwuliu.component
 
-import android.util.Log
 import com.billy.cc.core.component.CC
 import com.billy.cc.core.component.CCResult
 import com.billy.cc.core.component.IComponent
@@ -8,6 +7,7 @@ import com.hwangjr.rxbus.RxBus
 import com.quansu.heifengwuliu.config.ConfigRx
 import com.quansu.heifengwuliu.model.bean.OneLoginBean
 import com.ysnows.base.ccextension.BIComponent
+import com.ysnows.base.model.PositionBean
 
 open class CpApp() : IComponent, BIComponent() {
 
@@ -28,5 +28,13 @@ open class CpApp() : IComponent, BIComponent() {
 
          return false
     }
+    fun setDatas(cc: CC, item: PositionBean): Boolean{
+
+        RxBus.get().post(ConfigRx.ADD_POSITION, item)
+
+        CC.sendCCResult(cc.callId, CCResult.success())
+
+        return false
+    }
 
 }

+ 2 - 0
app/src/main/java/com/quansu/heifengwuliu/config/ConfigRx.kt

@@ -18,5 +18,7 @@ object ConfigRx {
 
     const val ADD_SEND_CODE = "ADD_SEND_CODE" //微信登录的code
 
+    const val ADD_POSITION = "ADD_POSITION" //选择位置-位置
+
 
 }

+ 6 - 0
app/src/main/java/com/quansu/heifengwuliu/fragment/DeliverGoodsFragment.kt

@@ -27,9 +27,12 @@ class DeliverGoodsFragment : MBFragment<BViewModel<BRepository>, FragmentDeliver
         initFragments()
         switchContent(0)
 
+
     }
 
 
+
+
     override fun listeners() {
         super.listeners()
 
@@ -94,4 +97,7 @@ class DeliverGoodsFragment : MBFragment<BViewModel<BRepository>, FragmentDeliver
     override fun title(): String? {
         return null
     }
+
+    override val isRxbus: Boolean
+        get() =true
 }

+ 37 - 0
app/src/main/java/com/quansu/heifengwuliu/fragment/OwnerSingleFragment.kt

@@ -2,18 +2,26 @@ package com.quansu.heifengwuliu.fragment
 
 import android.content.Context
 import android.os.Bundle
+import android.util.Log
 import android.view.LayoutInflater
 import android.view.ViewGroup
 import android.view.animation.AccelerateInterpolator
 import android.view.animation.DecelerateInterpolator
+import com.hwangjr.rxbus.annotation.Subscribe
+import com.hwangjr.rxbus.annotation.Tag
 import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.adapter.FragmentAdapter
 import com.quansu.heifengwuliu.base.MBFragment
+import com.quansu.heifengwuliu.config.ConfigRx
 import com.quansu.heifengwuliu.databinding.FragmentOwnersingleBinding
 import com.quansu.heifengwuliu.utils.AList
 import com.quansu.heifengwuliu.utils.TAB
 import com.ysnows.base.base.BRepository
 import com.ysnows.base.base.BViewModel
+import com.ysnows.base.ccretrofit.CCRetrofit
+import com.ysnows.base.model.PositionBean
+import com.ysnows.base.route.IGaode
+import com.ysnows.base.route.IJpush
 import com.ysnows.base.utils.B
 import net.lucode.hackware.magicindicator.ViewPagerHelper
 import net.lucode.hackware.magicindicator.buildins.UIUtil
@@ -40,8 +48,23 @@ class OwnerSingleFragment : MBFragment<BViewModel<BRepository>, FragmentOwnersin
         setIndicator()
         binding.viewPager.offscreenPageLimit = 0
         initViewPager()
+        initData()
+
     }
 
+    private fun initData() {
+
+        //卸货信息
+         binding.viewEnter.tvCity.setHint("请选择卸货地址")
+        binding.viewEnter.llChoseMap.setOnClickListener {
+            //地图选点
+            CCRetrofit.instance()
+                    .with(context)
+                    .create(IGaode::class.java)
+                    .selectLocation()
+                    .subscribe()
+        }
+    }
 
 
     private fun initViewPager() {
@@ -131,4 +154,18 @@ class OwnerSingleFragment : MBFragment<BViewModel<BRepository>, FragmentOwnersin
         return null
     }
 
+    override val isRxbus: Boolean
+        get() = true
+
+
+    @Subscribe(tags = [Tag(ConfigRx.ADD_POSITION)])
+    fun getPosition(bean: PositionBean) {
+
+        var provincename=bean.provincename
+        var cityname=bean.cityname
+        var areaname=bean.areaname
+        Log.e("-shy-", "areaname=: "+areaname )
+
+
+    }
 }

+ 53 - 0
app/src/main/java/com/quansu/heifengwuliu/widget/AddressItemView.java

@@ -2,6 +2,11 @@ package com.quansu.heifengwuliu.widget;
 
 import android.content.Context;
 import android.util.AttributeSet;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.qmuiteam.qmui.widget.QMUIRadiusImageView;
 import com.quansu.heifengwuliu.R;
 import com.ysnows.base.view.BView;
 import com.ysnows.base.view.BaseView;
@@ -12,6 +17,17 @@ import com.ysnows.base.view.BaseView;
  */
 public class AddressItemView extends BaseLinearLayout {
     private BView view;
+    private QMUIRadiusImageView img;
+    private TextView tvCity;
+    private LinearLayout llChoseAddress;
+    private EditText etDetailedAddress;
+    private LinearLayout llChoseMap;
+    private TextView tvChoseTime;
+    private EditText etName;
+    private EditText etPhone;
+
+
+
 
 
 
@@ -34,8 +50,45 @@ public class AddressItemView extends BaseLinearLayout {
             this.view = (BView) context;
         }
         inflate(context, R.layout.widget_addressitem, this);
+        img = findViewById(R.id.img);
+        tvCity = findViewById(R.id.tv_city);
+        llChoseAddress = findViewById(R.id.ll_chose_address);
+        etDetailedAddress = findViewById(R.id.et_detailed_address);
+        llChoseMap = findViewById(R.id.ll_chose_map);
+        tvChoseTime = findViewById(R.id.tv_chose_time);
+        etName = findViewById(R.id.et_name);
+        etPhone = findViewById(R.id.et_phone);
+    }
+
+
+    public void  setData(){
+
+    }
 
 
+    public TextView getTvCity(){
+        return tvCity;
+    }
+    public TextView getTvChoseTime(){
+        return tvChoseTime;
+    }
+    public LinearLayout getLlChoseAddress(){
+        return llChoseAddress;
+    }
+    public LinearLayout getLlChoseMap(){
+        return llChoseMap;
+    }
+    public EditText getEtName(){
+        return etName;
+    }
 
+    public EditText getEtPhone(){
+        return etPhone;
     }
+    public EditText getEtDetailedAddress(){
+        return etDetailedAddress;
+    }
+
+
+
 }

+ 3 - 0
app/src/main/res/layout/fragment_ownersingle.xml

@@ -81,6 +81,7 @@
                 </LinearLayout>
 
                 <com.quansu.heifengwuliu.widget.AddressItemView
+                    android:id="@+id/view_out"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     >
@@ -97,6 +98,8 @@
                     android:textSize="@dimen/sp_16"></TextView>
 
                 <com.quansu.heifengwuliu.widget.AddressItemView
+                    android:id="@+id/view_enter"
+
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     >

+ 22 - 2
app/src/main/res/layout/widget_addressitem.xml

@@ -29,6 +29,7 @@
 
 
             <com.qmuiteam.qmui.widget.QMUIRadiusImageView
+                android:id="@+id/img"
                 android:layout_width="25dp"
                 android:layout_height="25dp"
                 android:src="@drawable/ic_math"
@@ -36,13 +37,21 @@
 
 
             <TextView
+                android:id="@+id/tv_city"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/dp_10"
                 android:layout_weight="1"
                 android:textColor="#101010"
                 android:textSize="@dimen/sp_16"
-                tools:text="山东省临沂市河东区"></TextView>
+                android:hint="请选择省市区"
+               ></TextView>
+
+            <LinearLayout
+                android:id="@+id/ll_chose_address"
+                android:layout_width="wrap_content"
+                android:gravity="center_vertical"
+                android:layout_height="wrap_content">
 
             <TextView
                 android:layout_width="wrap_content"
@@ -56,7 +65,7 @@
             <ImageView
                 style="@style/mine_arrow_right"
                 android:src="@drawable/mine_right" />
-
+            </LinearLayout>
         </LinearLayout>
 
 
@@ -69,6 +78,7 @@
 
 
             <EditText
+                android:id="@+id/et_detailed_address"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="35dp"
@@ -79,6 +89,11 @@
                 android:textColorHint="#BBBBBB"
                 android:textSize="@dimen/sp_15"></EditText>
 
+        <LinearLayout
+            android:id="@+id/ll_chose_map"
+            android:layout_width="wrap_content"
+            android:gravity="center_vertical"
+            android:layout_height="wrap_content">
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -95,8 +110,11 @@
 
         </LinearLayout>
 
+        </LinearLayout>
+
 
         <TextView
+            android:id="@+id/tv_chose_time"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="35dp"
@@ -131,6 +149,7 @@
                 app:qmui_radius="@dimen/dp_2">
 
                 <EditText
+                    android:id="@+id/et_name"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     android:background="@null"
@@ -160,6 +179,7 @@
                 app:qmui_radius="@dimen/dp_2">
 
                 <EditText
+                    android:id="@+id/et_phone"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     android:background="@null"

+ 26 - 0
base/src/main/java/com/ysnows/base/model/PositionBean.java

@@ -0,0 +1,26 @@
+package com.ysnows.base.model;
+
+/**
+ * Created by shihuiyun
+ * on 2020-01-11
+ */
+public class PositionBean {
+
+    public String position;
+    public String latitude;
+    public String longitude;
+    public String provincename;
+    public String cityname;
+    public String areaname;
+
+
+    public PositionBean(String position, String latitude, String longitude,
+                        String provincename, String cityname, String areaname ) {
+        this.position = position;
+        this.latitude = latitude;
+        this.longitude = longitude;
+        this.provincename=provincename;
+        this.cityname=cityname;
+        this.areaname=areaname;
+    }
+}

+ 2 - 0
base/src/main/java/com/ysnows/base/route/IApp.kt

@@ -3,10 +3,12 @@ package com.ysnows.base.route
 import com.billy.cc.core.component.CCResult
 import com.ysnows.base.ccretrofit.IRoute
 import com.ysnows.base.ccretrofit.annotation.Param
+import com.ysnows.base.model.PositionBean
 import io.reactivex.Observable
 
 interface IApp : IRoute {
     fun setLogin(@Param("token") token: String): Observable<CCResult>
     fun isError(@Param("code") code: Int,@Param("msg") msg: String):Observable<CCResult>
+    fun setDatas(@Param("item") item: PositionBean): Observable<CCResult>
 
 }

+ 15 - 0
base/src/main/java/com/ysnows/base/route/IGaode.kt

@@ -0,0 +1,15 @@
+package com.ysnows.base.route
+
+import com.billy.cc.core.component.CCResult
+import com.ysnows.base.ccretrofit.IRoute
+import io.reactivex.Observable
+
+/**
+ *Created by shihuiyun
+ *on 2020/9/11
+ */
+interface  IGaode : IRoute {
+
+    fun selectLocation(): Observable<CCResult>
+
+}

+ 2 - 0
gaode/.gitignore

@@ -0,0 +1,2 @@
+/build
+*.iml

+ 56 - 0
gaode/build.gradle

@@ -0,0 +1,56 @@
+apply from: rootProject.file('cc-settings.gradle')
+apply from: rootProject.file('common-build.gradle')
+
+android {
+    compileSdkVersion rootProject.target_sdk_version
+
+
+    defaultConfig {
+        minSdkVersion rootProject.min_sdk_version
+        targetSdkVersion rootProject.target_sdk_version
+        versionCode rootProject.application_version_code
+        versionName rootProject.application_version_name
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+
+    packagingOptions {
+        exclude 'META-INF/XXXX'
+    }
+
+    sourceSets {
+        main {
+            if (!runAsApp) {
+                manifest.srcFile 'src/main/AndroidManifest.xml'
+                //release模式下排除debug文件夹中的所有Java文件
+                java {
+                    exclude 'src/main/debug/**'
+                }
+            } else {
+                manifest.srcFile 'src/main/debug/AndroidManifest.xml'
+//                java.srcDirs = ['src/main/debug']
+            }
+        }
+    }
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+
+}
+
+dependencies {
+    implementation 'com.amap.api:location:latest.integration' //定位功能
+    implementation 'com.amap.api:search:latest.integration' //搜索功能
+    implementation 'com.amap.api:3dmap:latest.integration'//3D地图
+    implementation 'com.githang:status-bar-compat:0.7'
+    //2D地图
+   // implementation 'com.amap.api:map2d:latest.integration'
+    implementation project(':base')
+
+}

+ 47 - 0
gaode/proguard-rules.pro

@@ -0,0 +1,47 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
+#3D 地图 V5.0.0之前:
+    -keep   class com.amap.api.maps.**{*;}
+    -keep   class com.autonavi.amap.mapcore.*{*;}
+    -keep   class com.amap.api.trace.**{*;}
+
+#    3D 地图 V5.0.0之后:
+    -keep   class com.amap.api.maps.**{*;}
+    -keep   class com.autonavi.**{*;}
+    -keep   class com.amap.api.trace.**{*;}
+
+#    定位
+    -keep class com.amap.api.location.**{*;}
+    -keep class com.amap.api.fence.**{*;}
+    -keep class com.loc.**{*;}
+    -keep class com.autonavi.aps.amapapi.model.**{*;}
+
+#    搜索
+    -keep   class com.amap.api.services.**{*;}
+
+#    2D地图
+    -keep class com.amap.api.maps2d.**{*;}
+    -keep class com.amap.api.mapcore2d.**{*;}
+
+#    导航
+    -keep class com.amap.api.navi.**{*;}
+    -keep class com.autonavi.**{*;}

+ 69 - 0
gaode/src/main/AndroidManifest.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    package="com.quansu.gaode">
+
+    <!-- Normal Permissions 不需要运行时注册 -->
+    <!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+    <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+    <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
+    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
+
+    <!-- 请求网络 -->
+    <uses-permission android:name="android.permission.INTERNET"/>
+
+    <!-- 不是SDK需要的权限,是示例中的后台唤醒定位需要的权限 -->
+    <uses-permission android:name="android.permission.WAKE_LOCK"/>
+
+    <!-- 需要运行时注册的权限 -->
+    <!-- 用于进行网络定位 -->
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
+    <!-- 用于访问GPS定位 -->
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+    <!-- 用于提高GPS定位速度 -->
+    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
+    <!-- 写入扩展存储,向扩展卡写入数据,用于写入缓存定位数据 -->
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <!-- 读取缓存数据 -->
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+
+    <!-- 用于读取手机当前的状态 -->
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
+
+    <!-- 更改设置 -->
+    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
+
+    <!--如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限-->
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
+    <!--如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明-->
+    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
+
+    <application
+        android:allowBackup="true"
+        android:label="@string/app_name"
+        android:supportsRtl="true"
+        android:largeHeap="true"
+        >
+        <!-- 设置key -->
+        <meta-data
+            android:name="com.amap.api.v2.apikey"
+            android:value="038d70248e9c34995e9aae054f11f6b5"/>
+
+        <!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location"-->
+        <service
+            android:name="com.amap.api.location.APSService" />
+
+
+        <activity android:name=".activity.GaodeActivity" >
+
+        </activity >
+        <activity android:name=".activity.SearchAddressActivity"></activity>
+
+
+
+    </application>
+
+</manifest>

+ 72 - 0
gaode/src/main/debug/AndroidManifest.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="com.quansu.gaode"
+          xmlns:android="http://schemas.android.com/apk/res/android"
+          xmlns:tools="http://schemas.android.com/tools" >
+    <!-- Normal Permissions 不需要运行时注册 -->
+    <!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+    <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+    <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
+    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
+
+    <!-- 请求网络 -->
+    <uses-permission android:name="android.permission.INTERNET"/>
+
+    <!-- 不是SDK需要的权限,是示例中的后台唤醒定位需要的权限 -->
+    <uses-permission android:name="android.permission.WAKE_LOCK"/>
+
+    <!-- 需要运行时注册的权限 -->
+    <!-- 用于进行网络定位 -->
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
+    <!-- 用于访问GPS定位 -->
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+    <!-- 用于提高GPS定位速度 -->
+    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
+    <!-- 写入扩展存储,向扩展卡写入数据,用于写入缓存定位数据 -->
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <!-- 读取缓存数据 -->
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+
+    <!-- 用于读取手机当前的状态 -->
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
+
+    <!-- 更改设置 -->
+    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
+
+    <!--如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限-->
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
+    <!--如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明-->
+    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
+
+
+    <application
+        android:allowBackup="true"
+        android:label="@string/app_name"
+        android:supportsRtl="true"
+        android:largeHeap="true" >
+        <!-- 设置key -->
+        <meta-data
+            android:name="com.amap.api.v2.apikey"
+            android:value="880c8098488a8cd9c66310e215aca2ea"/>
+
+        <!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location"-->
+        <service
+            android:name="com.amap.api.location.APSService" />
+
+
+
+        <activity android:name=".activity.GaodeActivity" >
+<!--            <intent-filter >-->
+<!--                <action android:name="android.intent.action.MAIN" />-->
+<!--                <category android:name="android.intent.category.LAUNCHER" />-->
+<!--            </intent-filter >-->
+        </activity >
+        <activity android:name=".activity.SearchAddressActivity"></activity>
+
+
+
+    </application >
+
+</manifest >

+ 471 - 0
gaode/src/main/java/com/quansu/gaode/activity/AutoListView.java

@@ -0,0 +1,471 @@
+package com.quansu.gaode.activity;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.LinearInterpolator;
+import android.view.animation.RotateAnimation;
+import android.widget.AbsListView;
+import android.widget.AbsListView.OnScrollListener;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.quansu.gaode.R;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+public class AutoListView extends ListView implements OnScrollListener {
+	// 区分当前操作是刷新还是加载?
+	public static final int REFRESH = 0;
+	public static final int LOAD = 1;
+	// 区分PULL和RELEASE的距离的大小
+	private static final int SPACE = 20;
+	// 定义header的四种状态和当前状载?
+	private static final int NONE = 0;
+	private static final int PULL = 1;
+	private static final int RELEASE = 2;
+	private static final int REFRESHING = 3;
+	private final String TAG = "AutoListView";
+	/**
+	 * 这个方法是根据结果的大小来决定footer显示的�??
+	 * <p>
+	 * 这里假定每次请求的条数为10。如果请求到�?10条�?�则认为还有数据。如过结果不�?10条,则认为数据�
+	 * ��经全部加载,这时footer显示已经全部加载
+	 * </p>
+	 *
+	 * @param resultSize
+	 */
+	int mResultSize;
+	private int state;
+	private LayoutInflater inflater;
+	private View header;
+	private View footer;
+	private TextView tip;
+	private TextView lastUpdate;
+	private ImageView arrow;
+	private ProgressBar refreshing;
+	private TextView noData;
+	private TextView loadFull;
+	private TextView more;
+	private ProgressBar loading;
+	private RotateAnimation animation;
+	private RotateAnimation reverseAnimation;
+	private int startY;
+	private int firstVisibleItem;
+	private int scrollState;
+	private int headerContentInitialHeight;
+	private int headerContentHeight;
+	// 只有在listview第一个item显示的时候(listview滑到了顶部)才进行下拉刷新,
+	// 否则此时的下拉只是滑动listview
+	private boolean isRecorded;
+	private boolean isLoading;// 判断是否正在加载
+	private boolean loadEnable = true;// �?启或者关闭加载更多功�?
+	private boolean isLoadFull;
+	private int pageSize = 10;
+	private int currentSize = 0;
+	private OnRefreshListener onRefreshListener;
+	private OnLoadListener onLoadListener;
+	private int mLastMotionY;
+
+	public AutoListView(Context context) {
+		super(context);
+		initView(context);
+	}
+
+	public AutoListView(Context context, AttributeSet attrs) {
+		super(context, attrs);
+		initView(context);
+	}
+
+	public AutoListView(Context context, AttributeSet attrs, int defStyle) {
+		super(context, attrs, defStyle);
+		initView(context);
+	}
+
+	public static String getCurrentTime(String format) {
+		Date date = new Date();
+		SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
+		String currentTime = sdf.format(date);
+		return currentTime;
+	}
+
+	public static String getCurrentTime() {
+		return getCurrentTime("yyyy-MM-dd  HH:mm:ss");
+	}
+
+	// 下拉刷新监听
+	public void setOnRefreshListener(OnRefreshListener onRefreshListener) {
+		this.onRefreshListener = onRefreshListener;
+	}
+
+	// 加载更多监听
+	public void setOnLoadListener(OnLoadListener onLoadListener) {
+		this.loadEnable = true;
+		this.onLoadListener = onLoadListener;
+	}
+
+	public boolean isLoadEnable() {
+		return loadEnable;
+	}
+
+	// 这里的开启或者关闭加载更多,并不支持动�?�调�?
+	public void setLoadEnable(boolean loadEnable) {
+		this.loadEnable = loadEnable;
+		this.removeFooterView(footer);
+	}
+
+	public int getPageSize8(){
+		this.pageSize=8;
+		return pageSize;
+	}
+
+	public int getPageSize() {
+		return pageSize;
+	}
+
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+
+	public int getCurrentSize() {
+		return currentSize;
+	}
+
+	public void setCurrentSize(int currentSize) {
+		this.currentSize = currentSize;
+	}
+
+	// 初始化组�?
+	private void initView(Context context) {
+
+		// 设置箭头特效
+		animation = new RotateAnimation(0, -180,
+				RotateAnimation.RELATIVE_TO_SELF, 0.5f,
+				RotateAnimation.RELATIVE_TO_SELF, 0.5f);
+		animation.setInterpolator(new LinearInterpolator());
+		animation.setDuration(100);
+		animation.setFillAfter(true);
+
+		reverseAnimation = new RotateAnimation(-180, 0,
+				RotateAnimation.RELATIVE_TO_SELF, 0.5f,
+				RotateAnimation.RELATIVE_TO_SELF, 0.5f);
+		reverseAnimation.setInterpolator(new LinearInterpolator());
+		reverseAnimation.setDuration(100);
+		reverseAnimation.setFillAfter(true);
+
+		inflater = LayoutInflater.from(context);
+		footer = inflater.inflate(R.layout.autolistview_footer, null);
+		loadFull = (TextView) footer.findViewById(R.id.loadFull);
+		noData = (TextView) footer.findViewById(R.id.noData);
+		more = (TextView) footer.findViewById(R.id.more);
+		loading = (ProgressBar) footer.findViewById(R.id.loading);
+
+		header = inflater.inflate(R.layout.pull_to_refresh_header, null);
+		arrow = (ImageView) header.findViewById(R.id.arrow);
+		tip = (TextView) header.findViewById(R.id.tip);
+		lastUpdate = (TextView) header.findViewById(R.id.lastUpdate);
+		refreshing = (ProgressBar) header.findViewById(R.id.refreshing);
+
+		// 为listview添加头部和尾部,并进行初始化
+		headerContentInitialHeight = header.getPaddingTop();
+		measureView(header);
+		headerContentHeight = header.getMeasuredHeight();
+		topPadding(-headerContentHeight);
+		this.addHeaderView(header, null, false);
+		this.addFooterView(footer, null, false);
+		this.setOnScrollListener(this);
+		footer.setVisibility(View.GONE);
+	}
+
+	public void onRefresh() {
+		currentSize = 0;
+		if (onRefreshListener != null) {
+			onRefreshListener.onRefresh();
+		}
+	}
+
+	public void onLoad() {
+		if (onLoadListener != null) {
+			onLoadListener.onLoad();
+		}
+	}
+
+	public void onRefreshComplete(String updateTime) {
+		lastUpdate.setText(this.getContext().getString(R.string.lastUpdateTime,
+				getCurrentTime()));
+		state = NONE;
+		refreshHeaderViewByState();
+	}
+
+	// 用于下拉刷新结束后的回调
+	public void onRefreshComplete() {
+		String currentTime = getCurrentTime();
+		onRefreshComplete(currentTime);
+	}
+
+	// 用于加载更多结束后的回调
+	public void onLoadComplete() {
+		isLoading = false;
+	}
+
+	@Override
+	public void onScroll(AbsListView view, int firstVisibleItem,
+						 int visibleItemCount, int totalItemCount) {
+		this.firstVisibleItem = firstVisibleItem;
+	}
+
+	@Override
+	public void onScrollStateChanged(AbsListView view, int scrollState) {
+		this.scrollState = scrollState;
+		ifNeedLoad(view, scrollState);
+	}
+
+	// 根据listview滑动的状态判断是否需要加载更�?
+	private void ifNeedLoad(AbsListView view, int scrollState) {
+		if (!loadEnable) {
+			return;
+		}
+//		if(isLoadFull&&view.getLastVisiblePosition() == view
+//				.getPositionForView(footer) &&!isLoading){
+//			ToastMgr.showShort(getContext(), "暂无更多内容");
+//			isLoading=true;
+//		}
+		try {
+			if (scrollState == OnScrollListener.SCROLL_STATE_IDLE
+					&& !isLoading
+					&& view.getLastVisiblePosition() == view
+							.getPositionForView(footer) && !isLoadFull) {
+//				LogMgr.d("loading:");
+				onLoad();
+				isLoading = true;
+			}
+		} catch (Exception e) {
+		}
+	}
+
+	@Override
+	public boolean onInterceptTouchEvent(MotionEvent ev) {
+		switch (ev.getAction()) {
+		case MotionEvent.ACTION_DOWN:
+			startY = (int) ev.getY();
+			break;
+
+		default:
+			break;
+		}
+		return super.onInterceptTouchEvent(ev);
+	}
+
+	/**
+	 * 监听触摸事件,解读手式
+	 */
+	@Override
+	public boolean onTouchEvent(MotionEvent ev) {
+		switch (ev.getAction()) {
+		case MotionEvent.ACTION_DOWN:
+//			Log.d(TAG, "=====onTouchEvent down");
+			if (firstVisibleItem == 0) {
+				isRecorded = true;
+				startY = (int) ev.getY();
+			}
+			break;
+		case MotionEvent.ACTION_CANCEL:
+		case MotionEvent.ACTION_UP:
+//			Log.d(TAG, "=====onTouchEvent up");
+			if (state == PULL) {
+//				Log.d(TAG, "=====onTouchEvent up if");
+				state = NONE;
+				refreshHeaderViewByState();
+				onRefresh();
+			} else if (state == RELEASE) {
+//				Log.d(TAG, "=====onTouchEvent up else");
+				state = REFRESHING;
+				refreshHeaderViewByState();
+				onRefresh();
+			}
+			isRecorded = false;
+			break;
+		case MotionEvent.ACTION_MOVE:
+//			Log.d(TAG, "=====onTouchEvent move");
+			if (firstVisibleItem == 0) {
+				isRecorded = true;
+				// startY = (int) ev.getY();
+			}
+			whenMove(ev);
+			break;
+		}
+		return super.onTouchEvent(ev);
+	}
+
+	// 解读手势,刷新header状�??
+	private void whenMove(MotionEvent ev) {
+		if (!isRecorded) {
+//			Log.d("", "=====isrecorded");
+			return;
+		}
+//		Log.d("", "=====isrecord");
+		int tmpY = (int) ev.getY();
+		int space = tmpY - startY;
+		int topPadding = space - headerContentHeight;
+		switch (state) {
+		case NONE:
+			if (space > 0) {
+//				LogMgr.d(TAG, "state1 "+state);
+				state = PULL;
+				refreshHeaderViewByState();
+			}
+			break;
+		case PULL:
+			topPadding(topPadding);
+			if (scrollState == SCROLL_STATE_TOUCH_SCROLL
+					&& space > headerContentHeight + SPACE) {
+//				LogMgr.d(TAG, "state2 "+state);
+				state = RELEASE;
+				refreshHeaderViewByState();
+			}
+			break;
+		case RELEASE:
+			topPadding(topPadding);
+			if (space > 0 && space < headerContentHeight + SPACE) {
+//				LogMgr.d(TAG, "state3 "+state);
+				state = PULL;
+				refreshHeaderViewByState();
+			} else if (space <= 0) {
+//				LogMgr.d(TAG, "state4 "+state);
+				state = NONE;
+				refreshHeaderViewByState();
+			}
+			break;
+		}
+
+	}
+
+	// 调整header的大小�?�其实调整的只是距离顶部的高度�??
+	private void topPadding(int topPadding) {
+		header.setPadding(header.getPaddingLeft(), topPadding,
+				header.getPaddingRight(), header.getPaddingBottom());
+		header.invalidate();
+	}
+
+	public int getmResultSize() {
+		return mResultSize;
+	}
+
+	public void setResultSize(int resultSize) {
+		mResultSize = resultSize;
+		currentSize += resultSize;
+		if (currentSize == 0) {
+			isLoadFull = true;
+			loadFull.setVisibility(View.GONE);
+			loading.setVisibility(View.GONE);
+			more.setVisibility(View.GONE);
+			noData.setVisibility(View.VISIBLE);
+		} else if (resultSize >= 0 && resultSize < pageSize) {
+			isLoadFull = true;
+			loadFull.setVisibility(View.VISIBLE);
+			loading.setVisibility(View.GONE);
+			more.setVisibility(View.GONE);
+			noData.setVisibility(View.GONE);
+		} else if (resultSize == pageSize) {
+			isLoadFull = false;
+			loadFull.setVisibility(View.GONE);
+			loading.setVisibility(View.VISIBLE);
+			more.setVisibility(View.VISIBLE);
+			noData.setVisibility(View.GONE);
+		}
+
+	}
+
+	// 根据当前状�?�,调整header
+	private void refreshHeaderViewByState() {
+		switch (state) {
+		case NONE:
+			topPadding(-headerContentHeight);
+			tip.setText(R.string.pull_to_refresh);
+			refreshing.setVisibility(View.GONE);
+			arrow.clearAnimation();
+			arrow.setImageResource(R.mipmap.pull_to_refresh_arrow);
+			break;
+		case PULL:
+			arrow.setVisibility(View.VISIBLE);
+			tip.setVisibility(View.VISIBLE);
+			lastUpdate.setVisibility(View.VISIBLE);
+			refreshing.setVisibility(View.GONE);
+			tip.setText(R.string.pull_to_refresh);
+			arrow.clearAnimation();
+			arrow.setAnimation(reverseAnimation);
+			break;
+		case RELEASE:
+			arrow.setVisibility(View.VISIBLE);
+			tip.setVisibility(View.VISIBLE);
+			lastUpdate.setVisibility(View.VISIBLE);
+			refreshing.setVisibility(View.GONE);
+			tip.setText(R.string.release_to_refresh);
+			arrow.clearAnimation();
+			arrow.setAnimation(animation);
+			break;
+		case REFRESHING:
+			topPadding(headerContentInitialHeight);
+			refreshing.setVisibility(View.VISIBLE);
+			arrow.clearAnimation();
+			arrow.setVisibility(View.GONE);
+			tip.setVisibility(View.GONE);
+			lastUpdate.setVisibility(View.GONE);
+			break;
+		}
+	}
+
+	// 用来计算header大小的�?�比较隐晦�?�因为header的初始高度就�?0,貌似可以不用�?
+	private void measureView(View child) {
+		ViewGroup.LayoutParams p = child.getLayoutParams();
+		if (p == null) {
+			p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+					ViewGroup.LayoutParams.WRAP_CONTENT);
+		}
+		int childWidthSpec = ViewGroup.getChildMeasureSpec(0, 0 + 0, p.width);
+		int lpHeight = p.height;
+		int childHeightSpec;
+		if (lpHeight > 0) {
+			childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight,
+					MeasureSpec.EXACTLY);
+		} else {
+			childHeightSpec = MeasureSpec.makeMeasureSpec(0,
+					MeasureSpec.UNSPECIFIED);
+		}
+		child.measure(childWidthSpec, childHeightSpec);
+	}
+	
+	public View getHeadView() {
+		return header;
+	}
+
+	public View getFooterView() {
+		return footer;
+	}
+
+	public void hideFooterView() {
+		footer.setVisibility(View.GONE);
+		this.removeHeaderView(header);
+	}
+
+	/*
+	 * 定义下拉刷新接口
+	 */
+	public interface OnRefreshListener {
+		public void onRefresh();
+	}
+
+	/*
+	 * 定义加载更多接口
+	 */
+	public interface OnLoadListener {
+		public void onLoad();
+	}
+}

+ 720 - 0
gaode/src/main/java/com/quansu/gaode/activity/GaodeActivity.java

@@ -0,0 +1,720 @@
+package com.quansu.gaode.activity;
+
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.BitmapFactory;
+import android.graphics.Color;
+import android.graphics.Point;
+import android.os.Bundle;
+import android.text.Spannable;
+import android.text.SpannableString;
+import android.text.Spanned;
+import android.text.TextUtils;
+import android.text.style.AbsoluteSizeSpan;
+import android.text.style.ForegroundColorSpan;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.animation.Interpolator;
+import android.widget.AdapterView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.amap.api.location.AMapLocation;
+import com.amap.api.location.AMapLocationClient;
+import com.amap.api.location.AMapLocationClientOption;
+import com.amap.api.location.AMapLocationListener;
+import com.amap.api.maps.AMap;
+import com.amap.api.maps.CameraUpdateFactory;
+import com.amap.api.maps.LocationSource;
+import com.amap.api.maps.MapView;
+import com.amap.api.maps.model.BitmapDescriptorFactory;
+import com.amap.api.maps.model.CameraPosition;
+import com.amap.api.maps.model.LatLng;
+import com.amap.api.maps.model.Marker;
+import com.amap.api.maps.model.MarkerOptions;
+import com.amap.api.maps.model.MyLocationStyle;
+import com.amap.api.maps.model.animation.Animation;
+import com.amap.api.maps.model.animation.TranslateAnimation;
+import com.amap.api.services.core.AMapException;
+import com.amap.api.services.core.LatLonPoint;
+import com.amap.api.services.core.PoiItem;
+import com.amap.api.services.geocoder.GeocodeResult;
+import com.amap.api.services.geocoder.GeocodeSearch;
+import com.amap.api.services.geocoder.RegeocodeQuery;
+import com.amap.api.services.geocoder.RegeocodeResult;
+import com.amap.api.services.poisearch.PoiResult;
+import com.amap.api.services.poisearch.PoiSearch;
+import com.githang.statusbar.StatusBarCompat;
+
+import com.jaeger.library.StatusBarUtil;
+import com.quansu.gaode.R;
+import com.quansu.gaode.adapter.SearchResultAdapter;
+import com.quansu.gaode.view.SegmentedGroup;
+import com.ysnows.base.ccretrofit.CCRetrofit;
+import com.ysnows.base.model.PositionBean;
+import com.ysnows.base.route.IApp;
+import com.ysnows.base.utils.Toasts;
+import com.ysnows.base.utils.UiSwitch;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class GaodeActivity extends AppCompatActivity implements LocationSource,
+        AMapLocationListener, GeocodeSearch.OnGeocodeSearchListener,
+
+        PoiSearch.OnPoiSearchListener {
+
+
+    private static final int REQUEST_SEARCH_CODE = 1;
+
+
+    private ListView listView;
+    AdapterView.OnItemClickListener onItemClickListener = new AdapterView.OnItemClickListener() {
+        @Override
+        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+            if (position != searchResultAdapter.getSelectedPosition()) {
+
+                PoiItem poiItem = (PoiItem) searchResultAdapter.getItem(position);
+
+                chosepoiItem = poiItem;
+                LatLng curLatlng = new LatLng(poiItem.getLatLonPoint().getLatitude(), poiItem.getLatLonPoint().getLongitude());
+
+
+                isItemClickAction = true;
+
+                aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(curLatlng, 16f));
+
+                searchResultAdapter.setSelectedPosition(position);
+                searchResultAdapter.notifyDataSetChanged();
+            }
+        }
+    };
+
+
+    private SegmentedGroup mSegmentedGroup;
+    private AMap aMap;
+    private MapView mapView;
+    private OnLocationChangedListener mListener;
+    private AMapLocationClient mlocationClient;
+    private AMapLocationClientOption mLocationOption;
+
+
+    private Marker locationMarker;
+
+    private ProgressDialog progDialog = null;
+    private GeocodeSearch geocoderSearch;
+
+    private int currentPage = 0;// 当前页面,从0开始计数
+    private PoiSearch.Query query;// Poi查询条件类
+    private PoiSearch poiSearch;
+    private List<PoiItem> poiItems;// poi数据
+
+    private String searchType = "";
+    private String searchKey = "";
+    private LatLonPoint searchLatlonPoint;
+    private LinearLayout currentLocation;//选择当前的定位位置 :注意 可能只有经纬度
+
+
+    private List<PoiItem> resultData;
+
+    private SearchResultAdapter searchResultAdapter;
+
+    private boolean isItemClickAction;
+
+
+    private ImageView imgLeft;
+    private TextView tvRight;
+
+    private PoiItem chosepoiItem;//选择的地点
+
+
+    private String adress = null;//地址
+
+    private String s1 = "";//第二个参数传入null或者“”代表在全国进行检索,否则按照传入的city进行检索
+    private TextView tv;
+
+    private Double lat, lng;
+    private String provincename;
+    private String cityname;
+    private String areaname;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        StatusBarCompat.setStatusBarColor(this, Color.parseColor("#00ffffff"));
+        setStatusBar();
+
+        super.setContentView(R.layout.activity_gaode);
+
+
+        Bundle bundle = getIntent().getExtras();
+        if (null != bundle) {
+            adress = bundle.getString("adress");
+        }
+        mapView = (MapView) findViewById(R.id.map);
+        mapView.onCreate(savedInstanceState);
+        init();
+
+        initView();
+
+        resultData = new ArrayList<>();
+
+    }
+
+    private LinearLayout llSearch;
+
+    private void initView() {
+
+        llSearch = findViewById(R.id.ll_search);
+        tv = findViewById(R.id.tv);
+
+        imgLeft = findViewById(R.id.img_left);
+        tvRight = findViewById(R.id.tv_right);
+
+        currentLocation = findViewById(R.id.current_location);
+
+        listView = (ListView) findViewById(R.id.listview);
+        searchResultAdapter = new SearchResultAdapter(GaodeActivity.this);
+        listView.setAdapter(searchResultAdapter);
+
+        listView.setOnItemClickListener(onItemClickListener);
+
+        mSegmentedGroup = (SegmentedGroup) findViewById(R.id.segmented_group);
+        mSegmentedGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                searchType = items[0];
+
+                if (checkedId == R.id.radio0) {
+                    searchType = items[0];
+                } else if (checkedId == R.id.radio1) {
+                    searchType = items[1];
+                } else if (checkedId == R.id.radio2) {
+                    searchType = items[2];
+                } else if (checkedId == R.id.radio3) {
+                    searchType = items[3];
+                }
+
+                geoAddress();
+            }
+        });
+
+
+        geocoderSearch = new GeocodeSearch(this);
+        geocoderSearch.setOnGeocodeSearchListener(this);
+        progDialog = new ProgressDialog(this);
+
+
+        imgLeft.setOnClickListener(view -> {
+            finish();
+        });
+
+        tvRight.setOnClickListener(view -> {
+
+            //  LatLng curLatlng = new LatLng(chosepoiItem.getLatLonPoint().getLatitude(), chosepoiItem.getLatLonPoint().getLongitude());
+
+            Toast.makeText(this, "选择了" + chosepoiItem.getTitle(),Toast.LENGTH_SHORT).show();
+
+
+            String latitude = String.valueOf(chosepoiItem.getLatLonPoint().getLatitude());
+            String longitude = String.valueOf(chosepoiItem.getLatLonPoint().getLongitude());
+            String provincename = chosepoiItem.getProvinceName();
+            String cityname = chosepoiItem.getCityName();
+            String areaname = chosepoiItem.getAdName();
+
+            Log.e("-shy-", "provincename=: " + provincename + "/cityname=" + cityname + "/areaname=" + areaname);
+
+
+            PositionBean positionBean = new PositionBean(chosepoiItem.getTitle(), latitude, longitude, provincename, cityname, areaname);
+
+            CCRetrofit.instance()
+                    .create(IApp.class)
+                     .setDatas(positionBean)
+                    .subscribe();
+
+            finish();
+
+        });
+
+
+        if (!TextUtils.isEmpty(adress)) {
+
+            tvRight.setVisibility(View.INVISIBLE);
+
+        }
+
+        llSearch.setOnClickListener(v -> {
+            UiSwitch.singleRes(this, SearchAddressActivity.class, REQUEST_SEARCH_CODE);
+        });
+
+
+        currentLocation.setOnClickListener(v -> {
+
+            if (null != searchLatlonPoint) {
+
+                Toast.makeText(this, "选择了当前定位位置",Toast.LENGTH_SHORT).show();
+
+                String latitude = String.valueOf(lat);
+                String longitude = String.valueOf(lng);
+                String title = "经度:" + longitude + "/维度:" + latitude;
+
+                //省市区大概的位置是不会变的
+                String provincename = chosepoiItem.getProvinceName();
+                String cityname = chosepoiItem.getCityName();
+                String areaname = chosepoiItem.getAdName();
+                Log.e("-shy-", "provincename=: " + provincename + "/cityname=" + cityname + "/areaname=" + areaname);
+
+                PositionBean positionBean = new PositionBean(title, latitude, longitude,
+                        provincename, cityname, areaname);
+
+                CCRetrofit.instance()
+                        .create(IApp.class)
+                        .setDatas(positionBean)
+                        .subscribe();
+
+                finish();
+
+            } else {
+
+                Toast.makeText(this, "无法获得当前位置",Toast.LENGTH_LONG).show();
+
+            }
+
+        });
+
+
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (requestCode == REQUEST_SEARCH_CODE && resultCode == 6) {
+            PoiItem searchPonItem = data.getParcelableExtra("poiItem");
+            LatLonPoint latLonPoint = searchPonItem.getLatLonPoint();
+            //移动标志和地图
+            // addmark(latLonPoint.getLatitude(),latLonPoint.getLongitude());
+            aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()), 14));
+            //重新搜索附近
+            //数据清空
+            searchKey = searchPonItem.getCityName();
+            String name = data.getStringExtra("name");
+            tv.setText(name);
+            searchLatlonPoint = new LatLonPoint(latLonPoint.getLatitude(), latLonPoint.getLongitude());
+
+            doSearchQuery();
+
+        }
+    }
+
+    private String[] items = {"", "学校", "楼宇", "商场"};
+
+    /**
+     * 设置一些amap的属性
+     */
+    private void setUpMap() {
+        aMap.getUiSettings().setZoomControlsEnabled(false);
+        MyLocationStyle myLocationStyle = new MyLocationStyle();//初始化定位蓝点样式类
+        myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE);//连续定位、且将视角移动到地图中心点,定位点依照设备方向旋转,并且会跟随设备移动。(1秒1次定位)如果不设置myLocationType,默认也会执行此种模式。
+        myLocationStyle.interval(2000); //设置连续定位模式下的定位间隔,只在连续定位模式下生效,单次定位模式下不会生效。单位为毫秒。
+        aMap.setMyLocationStyle(myLocationStyle);//设置定位蓝点的Style
+
+
+        aMap.setLocationSource(this);// 设置定位监听
+        aMap.getUiSettings().setMyLocationButtonEnabled(true);// 设置默认定位按钮是否显示
+        aMap.setMyLocationEnabled(true);// 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
+        aMap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
+//        aMap.setInfoWindowAdapter(this);//将自定义的 InfoWindow 样式给map
+
+    }
+
+    //dip和px转换
+    private static int dip2px(Context context, float dpValue) {
+        final float scale = context.getResources().getDisplayMetrics().density;
+        return (int) (dpValue * scale + 0.5f);
+    }
+
+    protected void setStatusBar() {
+        StatusBarUtil.setDarkMode(this);
+      StatusBarUtil.setColor(this, getResources().getColor(R.color.colorPrimary), 1);
+    }
+
+    /**
+     * 初始化
+     */
+    private void init() {
+        if (aMap == null) {
+            aMap = mapView.getMap();
+            setUpMap();
+        }
+
+        aMap.setOnCameraChangeListener(new AMap.OnCameraChangeListener() {
+            @Override
+            public void onCameraChange(CameraPosition cameraPosition) {
+
+            }
+
+            @Override
+            public void onCameraChangeFinish(CameraPosition cameraPosition) {
+
+                lat = cameraPosition.target.latitude;
+                lng = cameraPosition.target.longitude;
+
+
+                if (!isItemClickAction) {
+                    geoAddress();
+                    //todo:暂时去掉动画
+                    //startJumpAnimation();
+                }
+                searchLatlonPoint = new LatLonPoint(cameraPosition.target.latitude, cameraPosition.target.longitude);
+
+                isItemClickAction = false;
+            }
+        });
+
+        aMap.setOnMapLoadedListener(new AMap.OnMapLoadedListener() {
+            @Override
+            public void onMapLoaded() {
+                addMarkerInScreenCenter(null);
+            }
+        });
+    }
+
+    /**
+     * 方法必须重写
+     */
+    @Override
+    protected void onResume() {
+        super.onResume();
+        mapView.onResume();
+    }
+
+    /**
+     * 方法必须重写
+     */
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mapView.onPause();
+        deactivate();
+    }
+
+    /**
+     * 激活定位
+     */
+    @Override
+    public void activate(OnLocationChangedListener listener) {
+        mListener = listener;
+        if (mlocationClient == null) {
+            mlocationClient = new AMapLocationClient(this);
+            mLocationOption = new AMapLocationClientOption();
+            //设置定位监听
+            mlocationClient.setLocationListener(this);
+            //设置为高精度定位模式
+            mLocationOption.setOnceLocation(true);
+            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
+            //设置定位参数
+            mlocationClient.setLocationOption(mLocationOption);
+            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
+            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
+            // 在定位结束后,在合适的生命周期调用onDestroy()方法
+            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
+            mlocationClient.startLocation();
+        }
+    }
+
+    /**
+     * 停止定位
+     */
+    @Override
+    public void deactivate() {
+        mListener = null;
+        if (mlocationClient != null) {
+            mlocationClient.stopLocation();
+            mlocationClient.onDestroy();
+        }
+        mlocationClient = null;
+    }
+
+
+    /**
+     * 响应逆地理编码
+     */
+    public void geoAddress() {
+//        Log.i("MY", "geoAddress"+ searchLatlonPoint.toString());
+        showDialog();
+        if (searchLatlonPoint != null) {
+            RegeocodeQuery query = new RegeocodeQuery(searchLatlonPoint, 200, GeocodeSearch.AMAP);// 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系
+            geocoderSearch.getFromLocationAsyn(query);
+        }
+    }
+
+
+    /**
+     * 开始进行poi搜索
+     */
+    protected void doSearchQuery() {
+//        Log.i("MY", "doSearchQuery");
+        currentPage = 0;//searchKey  searchType
+        query = new PoiSearch.Query(searchKey, searchType, "");// 第一个参数表示搜索字符串,第二个参数表示poi搜索类型,第三个参数表示poi搜索区域(空字符串代表全国)
+        query.setCityLimit(true);
+        query.setPageSize(30);
+        query.setPageNum(currentPage);
+
+        if (searchLatlonPoint != null) {
+            poiSearch = new PoiSearch(this, query);
+            poiSearch.setOnPoiSearchListener(this);
+            poiSearch.setBound(new PoiSearch.SearchBound(searchLatlonPoint, 1000, true));//
+            poiSearch.searchPOIAsyn();
+        }
+    }
+
+    /**
+     * 方法必须重写
+     */
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        mapView.onSaveInstanceState(outState);
+    }
+
+    /**
+     * 方法必须重写
+     */
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mapView.onDestroy();
+        if (null != mlocationClient) {
+            mlocationClient.onDestroy();
+        }
+    }
+
+    /**
+     * POI搜索结果回调
+     *
+     * @param poiResult  搜索结果
+     * @param resultCode 错误码
+     */
+    @Override
+    public void onPoiSearched(PoiResult poiResult, int resultCode) {
+        if (resultCode == AMapException.CODE_AMAP_SUCCESS) {
+            if (poiResult != null && poiResult.getQuery() != null) {
+                if (poiResult.getQuery().equals(query)) {
+                    poiItems = poiResult.getPois();
+                    if (poiItems != null && poiItems.size() > 0) {
+                        updateListview(poiItems);
+                    } else {
+                        Toast.makeText(GaodeActivity.this, "无搜索结果", Toast.LENGTH_SHORT).show();
+                    }
+                }
+            } else {
+                Toast.makeText(GaodeActivity.this, "无搜索结果", Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+
+    /**
+     * 更新列表中的item
+     *
+     * @param poiItems
+     */
+    private void updateListview(List<PoiItem> poiItems) {
+        resultData.clear();
+        searchResultAdapter.setSelectedPosition(0);
+        //todo:
+        chosepoiItem = poiItems.get(0);
+        // resultData.add(firstItem);
+        resultData.addAll(poiItems);
+
+        searchResultAdapter.setData(resultData);
+        searchResultAdapter.notifyDataSetChanged();
+
+
+        if (!TextUtils.isEmpty(adress)) {
+            Toast.makeText(this, adress, Toast.LENGTH_SHORT).show();
+
+            tvRight.setVisibility(View.INVISIBLE);
+
+
+            adress = null;
+        }
+    }
+
+    /**
+     * 定位成功后回调函数
+     */
+    @Override
+    public void onLocationChanged(AMapLocation amapLocation) {
+        if (mListener != null && amapLocation != null) {
+            if (amapLocation != null
+                    && amapLocation.getErrorCode() == 0) {
+                mListener.onLocationChanged(amapLocation);
+
+                LatLng curLatlng = new LatLng(amapLocation.getLatitude(), amapLocation.getLongitude());
+
+                searchLatlonPoint = new LatLonPoint(curLatlng.latitude, curLatlng.longitude);
+
+
+                aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(curLatlng, 16f));
+
+
+            } else {
+                String errText = "定位失败," + amapLocation.getErrorCode() + ": " + amapLocation.getErrorInfo();
+                Log.e("AmapErr", errText);
+            }
+        }
+    }
+
+    @Override
+    public void onRegeocodeSearched(RegeocodeResult result, int rCode) {
+        dismissDialog();
+        if (rCode == AMapException.CODE_AMAP_SUCCESS) {
+            if (result != null && result.getRegeocodeAddress() != null
+                    && result.getRegeocodeAddress().getFormatAddress() != null) {
+                String address = result.getRegeocodeAddress().getProvince() + result.getRegeocodeAddress().getCity() + result.getRegeocodeAddress().getDistrict() + result.getRegeocodeAddress().getTownship();
+//                firstItem = new PoiItem("regeo", searchLatlonPoint, address, address);
+//                chosepoiItem=firstItem;
+
+                doSearchQuery();
+            }
+        } else {
+            Toast.makeText(GaodeActivity.this, "error code is " + rCode, Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    @Override
+    public void onGeocodeSearched(GeocodeResult geocodeResult, int i) {
+
+    }
+
+    @Override
+    public void onPoiItemSearched(PoiItem poiItem, int i) {
+
+    }
+
+    private void addMarkerInScreenCenter(LatLng locationLatLng) {
+        LatLng latLng = aMap.getCameraPosition().target;
+        Point screenPosition = aMap.getProjection().toScreenLocation(latLng);
+
+        View markerView = getLayoutInflater().inflate(R.layout.gaode_item_marker, null);
+
+        locationMarker = aMap.addMarker(new MarkerOptions()
+                .anchor(0.5f, 0.5f)
+                .title("当前位置")
+                .visible(true)
+                .icon(BitmapDescriptorFactory.fromView(markerView)));
+
+        //.icon(BitmapDescriptorFactory.fromResource(R.drawable.purple_pin)));
+        //设置Marker在屏幕上,不跟随地图移动
+        locationMarker.setPositionByPixels(screenPosition.x, screenPosition.y);
+        locationMarker.setZIndex(1);
+
+    }
+
+    private void addmark(double latitude, double longitude) {
+
+        if (locationMarker == null) {
+            locationMarker = aMap.addMarker(new MarkerOptions()
+                    .position(new LatLng(latitude, longitude))
+                    .icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory
+                            .decodeResource(getResources(), R.mipmap.poi_marker_1)))
+                    .draggable(true));
+        } else {
+            locationMarker.setPosition(new LatLng(latitude, longitude));
+        }
+    }
+
+
+    /**
+     * 屏幕中心marker 跳动
+     */
+    public void startJumpAnimation() {
+
+        if (locationMarker != null) {
+            //根据屏幕距离计算需要移动的目标点
+            final LatLng latLng = locationMarker.getPosition();
+            Point point = aMap.getProjection().toScreenLocation(latLng);
+            point.y -= dip2px(this, 125);
+            LatLng target = aMap.getProjection()
+                    .fromScreenLocation(point);
+            //使用TranslateAnimation,填写一个需要移动的目标点
+            Animation animation = new TranslateAnimation(target);
+            animation.setInterpolator(new Interpolator() {
+                @Override
+                public float getInterpolation(float input) {
+                    // 模拟重加速度的interpolator
+                    if (input <= 0.5) {
+                        return (float) (0.5f - 2 * (0.5 - input) * (0.5 - input));
+                    } else {
+                        return (float) (0.5f - Math.sqrt((input - 0.5f) * (1.5f - input)));
+                    }
+                }
+            });
+            //整个移动所需要的时间
+            animation.setDuration(600);
+            //设置动画
+            locationMarker.setAnimation(animation);
+            //开始动画
+            locationMarker.startAnimation();
+
+        } else {
+            Log.e("ama", "screenMarker is null");
+        }
+    }
+
+    public void showDialog() {
+        progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+        progDialog.setIndeterminate(false);
+        progDialog.setCancelable(true);
+        progDialog.setMessage("正在加载...");
+        progDialog.show();
+    }
+
+    public void dismissDialog() {
+        if (progDialog != null) {
+            progDialog.dismiss();
+        }
+    }
+
+
+ //   View infoWindow = null;
+
+//    @Override
+//    public View getInfoWindow(Marker marker) {
+//        if (infoWindow == null) {
+//            infoWindow = LayoutInflater.from(this).inflate(R.layout.map_bubble_back, null);
+//        }
+//        TextView tvPosition = (TextView) infoWindow.findViewById(R.id.tv_position);
+//        // TextView tvStreet = (TextView) infoWindow.findViewById(R.id.tv_street);
+//
+//        if (null != chosepoiItem) {
+//
+//            String title = "我在" + chosepoiItem.getTitle() + "附近";
+//            Spannable sp = new SpannableString(title);
+//            sp.setSpan(new AbsoluteSizeSpan(18, true),
+//                    2, title.length() - 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
+//
+//            sp.setSpan(new ForegroundColorSpan(Color.parseColor("#000000")), 2,
+//                    title.length() - 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
+//            tvPosition.setText(sp);
+//
+//            // tvStreet.setText(chosepoiItem.getDirection());
+//        }
+//        return infoWindow;
+//    }
+//
+//    @Override
+//    public View getInfoContents(Marker marker) {
+//        return null;
+//    }
+}

+ 242 - 0
gaode/src/main/java/com/quansu/gaode/activity/SearchAddressActivity.java

@@ -0,0 +1,242 @@
+package com.quansu.gaode.activity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.AdapterView;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.amap.api.services.core.AMapException;
+import com.amap.api.services.core.PoiItem;
+import com.amap.api.services.poisearch.PoiResult;
+import com.amap.api.services.poisearch.PoiSearch;
+import com.githang.statusbar.StatusBarCompat;
+import com.jaeger.library.StatusBarUtil;
+import com.quansu.gaode.R;
+import com.quansu.gaode.adapter.PoiAdapter;
+import com.quansu.gaode.bean.PoiBean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * poi关键字搜索
+ * Created by yufs on 2017/3/1.
+ */
+
+public class SearchAddressActivity extends AppCompatActivity implements PoiSearch.OnPoiSearchListener, AutoListView.OnRefreshListener, AutoListView.OnLoadListener {
+    EditText et_search;
+    ImageView tv_title_back;
+    TextView tv_title_right;
+    LinearLayout ll_loading;
+    AutoListView lv_list;
+    TextView tv_no_data;
+    private ImageView ivDelete;
+    private int currentPage = 0;
+    private PoiSearch.Query query;// Poi查询条件类
+    private PoiSearch poiSearch;// POI搜索
+
+    private List<PoiBean> poiData = new ArrayList<>();
+    private List<PoiItem> savePoiItem = new ArrayList<>();
+    private PoiAdapter mAdapter;
+    private String mKeyWord;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        StatusBarCompat.setStatusBarColor(this, Color.parseColor("#00ffffff"));
+        setStatusBar();
+        setContentView(R.layout.activity_search_address);
+        initView();
+        setListener();
+
+    }
+
+    protected void setStatusBar() {
+        StatusBarUtil.setDarkMode(this);
+        StatusBarUtil.setColor(this, getResources().getColor(R.color.colorPrimary), 1);
+    }
+
+    private void initView() {
+        et_search = (EditText) findViewById(R.id.et_search);
+        tv_title_back = (ImageView) findViewById(R.id.tv_title_back);
+        ll_loading = (LinearLayout) findViewById(R.id.ll_loading);
+        lv_list = (AutoListView) findViewById(R.id.lv_list);
+        tv_no_data = (TextView) findViewById(R.id.tv_no_data);
+        tv_title_right = (TextView) findViewById(R.id.tv_title_right);
+        ivDelete = findViewById(R.id.iv_delete);
+
+    }
+
+    private void setListener() {
+        mAdapter = new PoiAdapter(this, poiData);
+        lv_list.setAdapter(mAdapter);
+        lv_list.setOnRefreshListener(this);
+        lv_list.setOnLoadListener(this);
+        lv_list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                PoiItem poiItem = savePoiItem.get(position-1);
+                PoiBean  poiBean= poiData.get(position-1);
+                Intent intent = new Intent();
+                intent.putExtra("poiItem", poiItem);
+                intent.putExtra("name", poiBean.getTitleName());
+                setResult(6, intent);
+                finish();
+            }
+        });
+
+        tv_title_right.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                search();
+            }
+        });
+
+        tv_title_back.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                finish();
+            }
+        });
+        ivDelete.setOnClickListener(v -> {
+            et_search.setText("");
+        });
+        et_search.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+
+                if (actionId == EditorInfo.IME_ACTION_DONE) {
+
+                    search();
+                    return true;
+                }
+
+                return false;
+            }
+        });
+
+    }
+
+
+    public void search() {
+        mKeyWord = et_search.getText().toString();
+        if (TextUtils.isEmpty(mKeyWord)) {
+            Toast.makeText(this, "请输入您要查找的地点", Toast.LENGTH_SHORT).show();
+            return;
+        }
+        hideSoftKey(et_search);
+
+        savePoiItem.clear();
+        poiData.clear();
+        currentPage = 0;
+        doSearchQuery(mKeyWord);
+
+    }
+
+    private void hideSoftKey(View view) {
+        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+        imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
+        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
+    }
+
+    protected void doSearchQuery(String keyWord) {
+        if (currentPage == 0) {
+            savePoiItem.clear();
+            poiData.clear();
+            mAdapter.notifyDataSetChanged();
+            ll_loading.setVisibility(View.VISIBLE);// 显示进度框
+            lv_list.setVisibility(View.GONE);
+        }
+        query = new PoiSearch.Query(keyWord, "", "");// 第一个参数表示搜索字符串,第二个参数表示poi搜索类型,第三个参数表示poi搜索区域(空字符串代表全国)
+        query.setPageSize(10);// 设置每页最多返回多少条poiitem
+        query.setPageNum(currentPage);// 设置查第一页
+        query.setCityLimit(true);
+        poiSearch = new PoiSearch(this, query);
+        poiSearch.setOnPoiSearchListener(this);
+        poiSearch.searchPOIAsyn();
+    }
+
+    @Override
+    public void onPoiSearched(PoiResult poiResult, int rCode) {
+        lv_list.onLoadComplete();
+
+        if (rCode == AMapException.CODE_AMAP_SUCCESS) {
+            if (poiResult != null && poiResult.getQuery() != null) {// 搜索poi的结果
+
+                if (poiResult.getQuery().equals(query)) {// 是否是同一条
+                    if (currentPage == 0) {
+                        ll_loading.setVisibility(View.GONE);// 隐藏对话框
+                        lv_list.setVisibility(View.VISIBLE);
+                        tv_no_data.setVisibility(View.GONE);
+                    }
+                    // 取得搜索到的poiitems有多少页
+                    List<PoiItem> poiItems = poiResult.getPois();// 取得第一页的poiitem数据,页数从数字0开始
+                    savePoiItem.addAll(poiItems);
+                    List<PoiBean> tem = new ArrayList<>();
+                    if (poiItems != null && poiItems.size() > 0) {
+                        for (int i = 0; i < poiItems.size(); i++) {
+                            PoiItem poiItem = poiItems.get(i);
+                            PoiBean bean = new PoiBean();
+                            bean.setTitleName(poiItem.getTitle());
+                            bean.setCityName(poiItem.getCityName());
+                            bean.setAd(poiItem.getAdName());
+                            bean.setSnippet(poiItem.getSnippet());
+                            bean.setPoint(poiItem.getLatLonPoint());
+                            Log.e("yufs", "" + poiItem.getTitle() + "," + poiItem.getProvinceName() + ","
+                                    + poiItem.getCityName() + ","
+                                    + poiItem.getAdName() + ","//区
+                                    + poiItem.getSnippet() + ","
+                                    + poiItem.getLatLonPoint() + "\n");
+                            tem.add(bean);
+                        }
+                    }
+                    poiData.addAll(tem);
+                    mAdapter.notifyDataSetChanged();
+                } else {
+                    //没有结果
+                    ll_loading.setVisibility(View.GONE);// 隐藏对话框
+                    lv_list.setVisibility(View.GONE);
+                    tv_no_data.setVisibility(View.VISIBLE);
+                }
+            } else {
+                Toast.makeText(this, "搜索失败:" + rCode, Toast.LENGTH_SHORT).show();
+            }
+
+
+        }
+    }
+
+
+    @Override
+    public void onPoiItemSearched(PoiItem poiItem, int i) {
+
+    }
+
+    //刷新
+    @Override
+    public void onRefresh() {
+        lv_list.onRefreshComplete();
+    }
+
+    //加载下一页数据
+    @Override
+    public void onLoad() {
+        currentPage++;
+        doSearchQuery(mKeyWord);
+    }
+}

+ 63 - 0
gaode/src/main/java/com/quansu/gaode/adapter/PoiAdapter.java

@@ -0,0 +1,63 @@
+package com.quansu.gaode.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.quansu.gaode.R;
+import com.quansu.gaode.bean.PoiBean;
+
+import java.util.List;
+
+/**
+ * Created by yufs on 2017/3/1.
+ */
+
+public class PoiAdapter extends BaseAdapter {
+    List<PoiBean> data;
+    Context context;
+    public PoiAdapter(Context context, List<PoiBean> data) {
+        this.context=context;
+        this.data=data;
+    }
+
+    @Override
+    public int getCount() {
+        return data.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return data.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        convertView= View.inflate(context, R.layout.item_select_address,null);
+        TextView tv_title=ViewHolder.get(convertView,R.id.tv_title);
+        TextView tv_address=ViewHolder.get(convertView,R.id.tv_address);
+        ImageView iv_checked=ViewHolder.get(convertView,R.id.iv_checked);
+        PoiBean item= data.get(position);
+        if(item.isSelected()){
+            iv_checked.setVisibility(View.VISIBLE);
+        }else{
+            iv_checked.setVisibility(View.INVISIBLE);
+        }
+        if(item.isLoc()){
+            tv_address.setVisibility(View.GONE);
+        }else{
+            tv_address.setVisibility(View.VISIBLE);
+        }
+        tv_title.setText(item.getTitleName());
+        tv_address.setText(item.getCityName()+item.getAd()+item.getSnippet());
+        return convertView;
+    }
+}

+ 112 - 0
gaode/src/main/java/com/quansu/gaode/adapter/SearchResultAdapter.java

@@ -0,0 +1,112 @@
+package com.quansu.gaode.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.amap.api.services.core.PoiItem;
+import com.quansu.gaode.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 包名: com.amap.searchdemo
+ * <p>
+ * 创建时间:2016/10/19
+ * 项目名称:SearchDemo
+ *
+ * @author guibao.ggb
+ * @email guibao.ggb@alibaba-inc.com
+ * <p>
+ * 类说明:
+ */
+public class SearchResultAdapter extends BaseAdapter {
+
+    private List<PoiItem> data;
+    private Context context;
+
+    private int selectedPosition = 0;
+
+    public SearchResultAdapter(Context context) {
+        this.context = context;
+        data = new ArrayList<>();
+    }
+
+    public void setData(List<PoiItem> data) {
+        this.data = data;
+    }
+
+    public void setSelectedPosition(int selectedPosition) {
+        this.selectedPosition = selectedPosition;
+    }
+
+    public int getSelectedPosition() {
+        return selectedPosition;
+    }
+
+    @Override
+    public int getCount() {
+        return data.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return data.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder viewHolder;
+        if (convertView == null) {
+            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = inflater.inflate(R.layout.view_holder_result, parent, false);
+
+            viewHolder = new ViewHolder(convertView);
+
+            convertView.setTag(viewHolder);
+
+        } else {
+            viewHolder = (ViewHolder) convertView.getTag();
+        }
+
+        viewHolder.bindView(position);
+
+        return convertView;
+    }
+
+
+    class ViewHolder {
+        TextView textTitle;
+        TextView textSubTitle;
+        ImageView imageCheck;
+
+        public ViewHolder(View view) {
+            textTitle = (TextView) view.findViewById(R.id.text_title);
+            textSubTitle = (TextView) view.findViewById(R.id.text_title_sub);
+            imageCheck = (ImageView) view.findViewById(R.id.image_check);
+        }
+
+        public void bindView(int position) {
+            if (position >= data.size())
+                return;
+
+            PoiItem poiItem = data.get(position);
+
+            textTitle.setText(poiItem.getTitle());
+            textSubTitle.setText(poiItem.getCityName() + poiItem.getAdName() + poiItem.getSnippet());
+
+            imageCheck.setVisibility(position == selectedPosition ? View.VISIBLE : View.INVISIBLE);
+            textSubTitle.setVisibility((position == 0 && poiItem.getPoiId().equals("regeo")) ? View.GONE : View.VISIBLE);
+        }
+    }
+}

+ 20 - 0
gaode/src/main/java/com/quansu/gaode/adapter/ViewHolder.java

@@ -0,0 +1,20 @@
+package com.quansu.gaode.adapter;
+
+import android.util.SparseArray;
+import android.view.View;
+
+public class ViewHolder {
+	 public static <T extends View> T get(View view, int id) {
+	        SparseArray<View> viewHolder = (SparseArray<View>) view.getTag();
+	        if (viewHolder == null) {
+	            viewHolder = new SparseArray<View>();
+	            view.setTag(viewHolder);
+	        }
+	        View childView = viewHolder.get(id);
+	        if (childView == null) {
+	            childView = view.findViewById(id);
+	            viewHolder.put(id, childView);
+	        }
+	        return (T) childView;
+	    }
+}

+ 92 - 0
gaode/src/main/java/com/quansu/gaode/bean/PoiBean.java

@@ -0,0 +1,92 @@
+package com.quansu.gaode.bean;
+
+import com.amap.api.services.core.LatLonPoint;
+
+/**
+ * 地图搜索周边bean
+ * Created by yufs on 2017/3/1.
+ */
+
+public class PoiBean {
+    String titleName;
+    String province;//省 p
+    String cityName;//市 q
+    String ad;//区
+    String snippet;//详细地址
+    boolean selected;//是否选中当前
+    LatLonPoint point;//经纬度对象
+    boolean loc;//当前地址为定位得到,非搜索周边得到
+    String locAddress;//定位得到详细地址
+
+    public String getLocAddress() {
+        return locAddress;
+    }
+
+    public void setLocAddress(String locAddress) {
+        this.locAddress = locAddress;
+    }
+
+    public boolean isLoc() {
+        return loc;
+    }
+
+    public void setLoc(boolean loc) {
+        this.loc = loc;
+    }
+
+    public LatLonPoint getPoint() {
+        return point;
+    }
+
+    public void setPoint(LatLonPoint point) {
+        this.point = point;
+    }
+
+    public boolean isSelected() {
+        return selected;
+    }
+
+    public void setSelected(boolean selected) {
+        this.selected = selected;
+    }
+
+    public String getTitleName() {
+        return titleName;
+    }
+
+    public void setTitleName(String titleName) {
+        this.titleName = titleName;
+    }
+
+    public String getAd() {
+        return ad;
+    }
+
+    public void setAd(String ad) {
+        this.ad = ad;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCityName() {
+        return cityName;
+    }
+
+    public void setCityName(String cityName) {
+        this.cityName = cityName;
+    }
+
+    public String getSnippet() {
+        return snippet;
+    }
+
+    public void setSnippet(String snippet) {
+        this.snippet = snippet;
+    }
+}

+ 63 - 0
gaode/src/main/java/com/quansu/gaode/componnent/CpGaode.java

@@ -0,0 +1,63 @@
+package com.quansu.gaode.componnent;
+
+import android.Manifest;
+import android.content.Intent;
+import android.util.Log;
+
+import com.billy.cc.core.component.CC;
+import com.billy.cc.core.component.CCResult;
+import com.billy.cc.core.component.IComponent;
+
+import com.yanzhenjie.permission.Action;
+import com.yanzhenjie.permission.AndPermission;
+import com.yanzhenjie.permission.runtime.Permission;
+import com.ysnows.base.base.BApp;
+import com.ysnows.base.ccextension.BIComponent;
+
+import java.util.List;
+
+
+public class CpGaode extends BIComponent implements IComponent {
+
+    public boolean selectLocation(CC cc) {
+
+        Log.e("-shy-", "---3333- " );
+
+        AndPermission.with(BApp.instance().getApplicationContext())
+                .runtime()
+                .permission(Permission.ACCESS_COARSE_LOCATION,
+                        Permission.ACCESS_FINE_LOCATION,
+                        Permission.WRITE_EXTERNAL_STORAGE,
+                        Permission.READ_EXTERNAL_STORAGE,
+                        Permission.READ_PHONE_STATE
+                )
+                .onGranted(new Action<List<String>>() {
+                    /**
+                     * @param data
+                     */
+                    @Override
+                    public void onAction(List<String> data) {
+
+                        Log.e("-shy-", "---- " );
+
+                        Intent intent = new Intent(BApp.instance().getApplicationContext(),com.quansu.gaode.activity.GaodeActivity.class);
+                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+                        BApp.instance().getApplicationContext().startActivity(intent);
+
+
+                        // UiSwitch.single(BaseApp.getInstance().getApplicationContext(), com.quansu.gaode.activity.GaodeActivity.class);
+
+                    }
+
+                }).start();
+
+        CC.sendCCResult(cc.getCallId(), CCResult.success());
+
+        return false;
+    }
+
+
+}
+
+
+

+ 237 - 0
gaode/src/main/java/com/quansu/gaode/view/SegmentedGroup.java

@@ -0,0 +1,237 @@
+package com.quansu.gaode.view;
+
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.StateListDrawable;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.View;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.RadioGroup;
+
+import com.quansu.gaode.R;
+
+
+public class SegmentedGroup extends RadioGroup {
+
+    private int mMarginDp;
+    private Resources resources;
+    private int mTintColor;
+    private int mCheckedTextColor = Color.WHITE;
+    private LayoutSelector mLayoutSelector;
+    private Float mCornerRadius;
+
+    public SegmentedGroup(Context context) {
+        super(context);
+        resources = getResources();
+        mTintColor = resources.getColor(R.color.radio_button_selected_color);
+        mMarginDp = (int) getResources().getDimension(R.dimen.radio_button_stroke_border);
+        mCornerRadius = getResources().getDimension(R.dimen.radio_button_conner_radius);
+        mLayoutSelector = new LayoutSelector(mCornerRadius);
+    }
+
+    /* Reads the attributes from the layout */
+    private void initAttrs(AttributeSet attrs) {
+        TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(
+                attrs,
+                R.styleable.SegmentedGroup,
+                0, 0);
+
+        try {
+            mMarginDp = (int) typedArray.getDimension(
+                    R.styleable.SegmentedGroup_sc_border_width,
+                    getResources().getDimension(R.dimen.radio_button_stroke_border));
+
+            mCornerRadius = typedArray.getDimension(
+                    R.styleable.SegmentedGroup_sc_corner_radius,
+                    getResources().getDimension(R.dimen.radio_button_conner_radius));
+
+            mTintColor = typedArray.getColor(
+                    R.styleable.SegmentedGroup_sc_tint_color,
+                    getResources().getColor(R.color.radio_button_selected_color));
+
+            mCheckedTextColor = typedArray.getColor(
+                    R.styleable.SegmentedGroup_sc_checked_text_color,
+                    getResources().getColor(android.R.color.white));
+
+        } finally {
+            typedArray.recycle();
+        }
+    }
+
+    public SegmentedGroup(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        resources = getResources();
+        mTintColor = resources.getColor(R.color.radio_button_selected_color);
+        mMarginDp = (int) getResources().getDimension(R.dimen.radio_button_stroke_border);
+        mCornerRadius = getResources().getDimension(R.dimen.radio_button_conner_radius);
+        initAttrs(attrs);
+        mLayoutSelector = new LayoutSelector(mCornerRadius);
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+        //Use holo light for default
+        updateBackground();
+    }
+
+    public void setTintColor(int tintColor) {
+        mTintColor = tintColor;
+        updateBackground();
+    }
+
+    public void setTintColor(int tintColor, int checkedTextColor) {
+        mTintColor = tintColor;
+        mCheckedTextColor = checkedTextColor;
+        updateBackground();
+    }
+
+    public void updateBackground() {
+        int count = super.getChildCount();
+        for (int i = 0; i < count; i++) {
+            View child = getChildAt(i);
+            updateBackground(child);
+
+            // If this is the last view, don't set LayoutParams
+            if (i == count - 1) break;
+
+            LayoutParams initParams = (LayoutParams) child.getLayoutParams();
+            LayoutParams params = new LayoutParams(initParams.width, initParams.height, initParams.weight);
+            // Check orientation for proper margins
+            if (getOrientation() == LinearLayout.HORIZONTAL) {
+                params.setMargins(0, 0, -mMarginDp, 0);
+            } else {
+                params.setMargins(0, 0, 0, -mMarginDp);
+            }
+            child.setLayoutParams(params);
+        }
+    }
+
+    private void updateBackground(View view) {
+        int checked = mLayoutSelector.getSelected();
+        int unchecked = mLayoutSelector.getUnselected();
+        //Set text color
+        ColorStateList colorStateList = new ColorStateList(new int[][]{
+                {android.R.attr.state_pressed},
+                {-android.R.attr.state_pressed, -android.R.attr.state_checked},
+                {-android.R.attr.state_pressed, android.R.attr.state_checked}},
+                new int[]{Color.GRAY, mTintColor, mCheckedTextColor});
+        ((Button) view).setTextColor(colorStateList);
+
+        //Redraw with tint color
+        Drawable checkedDrawable = resources.getDrawable(checked).mutate();
+        Drawable uncheckedDrawable = resources.getDrawable(unchecked).mutate();
+        ((GradientDrawable) checkedDrawable).setColor(mTintColor);
+        ((GradientDrawable) checkedDrawable).setStroke(mMarginDp, mTintColor);
+        ((GradientDrawable) uncheckedDrawable).setStroke(mMarginDp, mTintColor);
+        //Set proper radius
+        ((GradientDrawable) checkedDrawable).setCornerRadii(mLayoutSelector.getChildRadii(view));
+        ((GradientDrawable) uncheckedDrawable).setCornerRadii(mLayoutSelector.getChildRadii(view));
+
+        //Create drawable
+        StateListDrawable stateListDrawable = new StateListDrawable();
+        stateListDrawable.addState(new int[]{-android.R.attr.state_checked}, uncheckedDrawable);
+        stateListDrawable.addState(new int[]{android.R.attr.state_checked}, checkedDrawable);
+
+        //Set button background
+        if (Build.VERSION.SDK_INT >= 16) {
+            view.setBackground(stateListDrawable);
+        } else {
+            view.setBackgroundDrawable(stateListDrawable);
+        }
+    }
+
+    /*
+     * This class is used to provide the proper layout based on the view.
+     * Also provides the proper radius for corners.
+     * The layout is the same for each selected left/top middle or right/bottom button.
+     * float tables for setting the radius via Gradient.setCornerRadii are used instead
+     * of multiple xml drawables.
+     */
+    private class LayoutSelector {
+
+        private int children;
+        private int child;
+        private final int SELECTED_LAYOUT = R.drawable.radio_checked;
+        private final int UNSELECTED_LAYOUT = R.drawable.radio_unchecked;
+
+        private float r;    //this is the radios read by attributes or xml dimens
+        private final float r1 = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP
+                , 0.1f, getResources().getDisplayMetrics());    //0.1 dp to px
+        private final float[] rLeft;    // left radio button
+        private final float[] rRight;   // right radio button
+        private final float[] rMiddle;  // middle radio button
+        private final float[] rDefault; // default radio button
+        private final float[] rTop;     // top radio button
+        private final float[] rBot;     // bot radio button
+        private float[] radii;          // result radii float table
+
+        public LayoutSelector(float cornerRadius) {
+            children = -1; // Init this to force setChildRadii() to enter for the first time.
+            child = -1; // Init this to force setChildRadii() to enter for the first time
+            r = cornerRadius;
+            rLeft = new float[]{r, r, r1, r1, r1, r1, r, r};
+            rRight = new float[]{r1, r1, r, r, r, r, r1, r1};
+            rMiddle = new float[]{r1, r1, r1, r1, r1, r1, r1, r1};
+            rDefault = new float[]{r, r, r, r, r, r, r, r};
+            rTop = new float[]{r, r, r, r, r1, r1, r1, r1};
+            rBot = new float[]{r1, r1, r1, r1, r, r, r, r};
+        }
+
+        private int getChildren() {
+            return SegmentedGroup.this.getChildCount();
+        }
+
+        private int getChildIndex(View view) {
+            return SegmentedGroup.this.indexOfChild(view);
+        }
+
+        private void setChildRadii(int newChildren, int newChild) {
+
+            // If same values are passed, just return. No need to update anything
+            if (children == newChildren && child == newChild)
+                return;
+
+            // Set the new values
+            children = newChildren;
+            child = newChild;
+
+            // if there is only one child provide the default radio button
+            if (children == 1) {
+                radii = rDefault;
+            } else if (child == 0) { //left or top
+                radii = (getOrientation() == LinearLayout.HORIZONTAL) ? rLeft : rTop;
+            } else if (child == children - 1) {  //right or bottom
+                radii = (getOrientation() == LinearLayout.HORIZONTAL) ? rRight : rBot;
+            } else {  //middle
+                radii = rMiddle;
+            }
+        }
+
+        /* Returns the selected layout id based on view */
+        public int getSelected() {
+            return SELECTED_LAYOUT;
+        }
+
+        /* Returns the unselected layout id based on view */
+        public int getUnselected() {
+            return UNSELECTED_LAYOUT;
+        }
+
+        /* Returns the radii float table based on view for Gradient.setRadii()*/
+        public float[] getChildRadii(View view) {
+            int newChildren = getChildren();
+            int newChild = getChildIndex(view);
+            setChildRadii(newChildren, newChild);
+            return radii;
+        }
+    }
+}

BIN
gaode/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v7_1_0.so


BIN
gaode/src/main/res/drawable-xxhdpi/gaode_delete.webp


BIN
gaode/src/main/res/drawable-xxhdpi/gaode_serch.webp


BIN
gaode/src/main/res/drawable-xxhdpi/icon_affirm_selected.webp


BIN
gaode/src/main/res/drawable-xxhdpi/purple_pin.png


+ 6 - 0
gaode/src/main/res/drawable/bg_search_shape_44.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <solid android:color="#ffffff"/>
+    <corners android:radius="44dp"/>
+</shape>

+ 6 - 0
gaode/src/main/res/drawable/button_text_color.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:color="#DDd4d4d4" />
+    <item android:state_pressed="false" android:state_checked="false" android:color="@color/radio_button_selected_color" />
+    <item android:state_pressed="false" android:state_checked="true" android:color="#fff2f2f2" />
+</selector>

+ 30 - 0
gaode/src/main/res/drawable/custom_progress_bar.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
+    android:oneshot="false" >
+
+    <item
+        android:drawable="@mipmap/loading_0"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_1"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_2"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_3"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_4"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_5"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_6"
+        android:duration="100"/>
+    <item
+        android:drawable="@mipmap/loading_7"
+        android:duration="100"/>
+
+</animation-list>

+ 16 - 0
gaode/src/main/res/drawable/gaode_stock_gary.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+android:shape="rectangle" >
+
+<!-- 填充的颜色-->
+
+
+    <solid android:color="#ffffff" />
+
+    <stroke
+        android:width="1dp"
+        android:color="#B8B7B6" />
+
+    <corners android:radius="2dp" />
+
+</shape >

+ 13 - 0
gaode/src/main/res/drawable/gaode_stock_white.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+android:shape="rectangle" >
+
+<!-- 填充的颜色-->
+
+
+    <solid android:color="#ffffff" />
+
+
+    <corners android:radius="2dp" />
+
+</shape >

+ 9 - 0
gaode/src/main/res/drawable/ic_arrow_back_black_24dp.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
+</vector>

+ 10 - 0
gaode/src/main/res/drawable/radio_checked.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle"
+    android:padding="10dp">
+    <!-- you can use any color you want I used here gray color-->
+    <solid android:color="@color/radio_button_bill_color" />
+    <stroke
+        android:width="@dimen/radio_button_stroke_border"
+        android:color="@color/radio_button_bill_color" />
+</shape>

+ 10 - 0
gaode/src/main/res/drawable/radio_unchecked.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle"
+    android:padding="10dp">
+    <!-- you can use any color you want I used here gray color-->
+    <solid android:color="@color/radio_button_unselected_color" />
+    <stroke
+        android:width="@dimen/radio_button_stroke_border"
+        android:color="@color/radio_button_selected_color" />
+</shape>

+ 267 - 0
gaode/src/main/res/layout/activity_gaode.xml

@@ -0,0 +1,267 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F6F6F6"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:orientation="vertical">
+
+    <!--标题栏-->
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:orientation="horizontal">
+
+        <ImageView
+            android:id="@+id/img_left"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:layout_centerVertical="true"
+            android:layout_gravity="center_vertical"
+            android:background="?android:selectableItemBackground"
+            android:padding="@dimen/dp_13"
+            android:src="@drawable/ic_arrow_back_black_24dp"
+            />
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:ellipsize="marquee"
+            android:gravity="center"
+            android:maxWidth="180dp"
+            android:singleLine="true"
+            android:text="选点"
+            android:textColor="@color/black"
+            android:textSize="@dimen/sp_16"
+            android:textStyle="bold" />
+
+        <TextView
+            android:id="@+id/tv_right"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:gravity="center"
+            android:text="确定"
+            android:textColor="@color/black"
+            android:textSize="15sp"></TextView>
+
+
+    </LinearLayout>
+
+
+    <!--    搜索-->
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:focusable="true"
+        android:layout_marginLeft="12dp"
+        android:layout_marginRight="12dp"
+        android:focusableInTouchMode="true"
+        android:orientation="horizontal"
+        android:gravity="center_vertical"
+        android:visibility="gone">
+
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@drawable/gaode_stock_white"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp">
+
+            <ImageView
+                android:layout_width="12dp"
+                android:layout_height="12dp"
+                android:src="@drawable/gaode_serch">
+
+            </ImageView>
+
+            <AutoCompleteTextView
+                android:id="@+id/keyWord"
+                android:layout_width="0dp"
+                android:layout_height="34dp"
+                android:layout_weight="1"
+                android:background="@null"
+                android:completionThreshold="1"
+                android:dropDownVerticalOffset="10.0dp"
+                android:focusable="true"
+                android:hint="地点"
+                android:imeOptions="actionDone"
+                android:inputType="text|textAutoComplete"
+                android:maxLength="20"
+                android:paddingLeft="15dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:textColor="#2F2F31"
+                android:textColorHint="#929390"
+                android:textSize="14sp" />
+
+            <ImageView
+                android:id="@+id/iv_delete"
+                android:layout_width="14dp"
+                android:layout_height="14dp"
+                android:layout_marginLeft="10dp"
+                android:src="@drawable/gaode_delete">
+
+            </ImageView>
+
+        </LinearLayout>
+
+        <TextView
+            android:id="@+id/tv_serch"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="7dp"
+            android:gravity="center|left"
+            android:text="搜索"
+            android:textColor="#2F2F31"
+            android:textSize="15sp">
+
+        </TextView>
+
+
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:id="@+id/ll_search"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:layout_marginLeft="20dp"
+        android:layout_marginRight="20dp"
+        android:layout_marginBottom="10dp"
+        android:background="@drawable/gaode_stock_white"
+        android:gravity="center_vertical"
+        android:orientation="horizontal"
+        android:paddingLeft="10dp"
+        android:paddingRight="10dp">
+
+        <ImageView
+            android:layout_width="12dp"
+            android:layout_height="12dp"
+            android:src="@drawable/gaode_serch">
+
+        </ImageView>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center_vertical|left"
+            android:orientation="horizontal">
+
+            <TextView
+                android:id="@+id/tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:hint="地点"
+                android:textColor="#2F2F31"
+                android:textColorHint="#929390"
+                android:textSize="14sp">
+
+            </TextView>
+        </LinearLayout>
+
+
+    </LinearLayout>
+
+
+    <com.amap.api.maps.MapView
+        android:id="@+id/map"
+        android:layout_width="match_parent"
+        android:layout_height="240dp" />
+
+
+    <LinearLayout
+        android:id="@+id/current_location"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:gravity="center_vertical"
+        android:orientation="horizontal"
+        android:paddingLeft="12dp"
+        android:paddingRight="8dp">
+
+        <TextView
+            android:id="@+id/text_title"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center_vertical"
+            android:text="使用当前定位位置"
+            android:textColor="#272727"
+            android:textSize="16sp"/>
+
+
+        <ImageView
+            android:id="@+id/image_check"
+            android:layout_width="32dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:src="@drawable/purple_pin" />
+
+    </LinearLayout>
+
+    <com.quansu.gaode.view.SegmentedGroup xmlns:segmentedgroup="http://schemas.android.com/apk/res-auto"
+        android:id="@+id/segmented_group"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:padding="4dp"
+        segmentedgroup:sc_border_width="1dp"
+        segmentedgroup:sc_corner_radius="2dp">
+
+        <RadioButton
+            android:id="@+id/radio0"
+            style="@style/RadioButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight=".5"
+            android:checked="true"
+            android:text="不限" />
+
+        <RadioButton
+            android:id="@+id/radio1"
+            style="@style/RadioButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight=".5"
+            android:text="学校" />
+
+        <RadioButton
+            android:id="@+id/radio2"
+            style="@style/RadioButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight=".5"
+            android:text="楼宇" />
+
+        <RadioButton
+            android:id="@+id/radio3"
+            style="@style/RadioButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight=".33"
+            android:text="商场" />
+
+    </com.quansu.gaode.view.SegmentedGroup>
+
+
+    <ListView
+        android:id="@+id/listview"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:cacheColorHint="#00000000"
+        android:divider="@android:color/darker_gray"
+        android:dividerHeight="1px" />
+
+
+</LinearLayout>

+ 160 - 0
gaode/src/main/res/layout/activity_search_address.xml

@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#F6F6F6"
+    android:gravity="center_horizontal"
+    android:orientation="vertical">
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:orientation="horizontal">
+
+        <ImageView
+            android:id="@+id/tv_title_back"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:layout_centerVertical="true"
+            android:layout_gravity="center_vertical"
+            android:background="?android:selectableItemBackground"
+            android:padding="@dimen/dp_13"
+            android:src="@drawable/ic_arrow_back_black_24dp"
+            />
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:ellipsize="marquee"
+            android:gravity="center"
+            android:maxWidth="180dp"
+            android:singleLine="true"
+            android:text="地点搜索"
+            android:textColor="@color/black"
+            android:textSize="@dimen/sp_16"
+            android:textStyle="bold" />
+
+        <TextView
+            android:id="@+id/tv_right"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:gravity="center"
+            android:text="确定"
+            android:textColor="@color/black"
+            android:textSize="15sp"
+            android:visibility="invisible"></TextView>
+
+
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:layout_marginLeft="12dp"
+        android:layout_marginRight="12dp"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="@drawable/gaode_stock_white"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp">
+
+            <ImageView
+                android:layout_width="12dp"
+                android:layout_height="12dp"
+                android:src="@drawable/gaode_serch">
+
+            </ImageView>
+
+            <EditText
+                android:id="@+id/et_search"
+                android:layout_width="0dp"
+                android:layout_height="34dp"
+                android:layout_centerHorizontal="true"
+                android:layout_weight="1"
+                android:background="@drawable/bg_search_shape_44"
+                android:hint="请输入地点"
+                android:imeOptions="actionDone"
+                android:paddingLeft="15dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:textColor="#2F2F31"
+                android:textColorHint="#929390"
+                android:textSize="14sp"
+                />
+
+
+            <ImageView
+                android:id="@+id/iv_delete"
+                android:layout_width="14dp"
+                android:layout_height="14dp"
+                android:layout_marginLeft="10dp"
+                android:src="@drawable/gaode_delete">
+
+            </ImageView>
+
+        </LinearLayout>
+
+        <TextView
+            android:id="@+id/tv_title_right"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="7dp"
+            android:gravity="center|left"
+            android:text="搜索"
+            android:textColor="#2F2F31"
+            android:textSize="15sp">
+
+        </TextView>
+
+
+    </LinearLayout>
+
+
+
+    <com.quansu.gaode.activity.AutoListView
+        android:id="@+id/lv_list"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:cacheColorHint="#00000000"
+        android:listSelector="#00000000"
+        android:visibility="visible">
+    </com.quansu.gaode.activity.AutoListView>
+
+    <TextView
+        android:id="@+id/tv_no_data"
+        style="@style/txt_style"
+        android:layout_marginTop="30dp"
+        android:text="未能查找到相关地点"
+        android:visibility="gone" />
+    <LinearLayout
+        android:id="@+id/ll_loading"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:orientation="vertical"
+        android:visibility="gone">
+        <ProgressBar
+            android:layout_width="25dp"
+            android:layout_height="25dp" />
+        <TextView
+            style="@style/txt_style3"
+            android:text="正在查找..."
+            android:visibility="visible" />
+    </LinearLayout>
+
+</LinearLayout>

+ 38 - 0
gaode/src/main/res/layout/autolistview_footer.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center"
+    android:orientation="horizontal" >
+
+    <TextView
+        android:id="@+id/loadFull"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:padding="5dp"
+        android:text="@string/load_full"
+        android:visibility="gone" />
+
+    <TextView
+        android:id="@+id/noData"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:padding="5dp"
+        android:text="@string/no_data"
+        android:visibility="gone" />
+
+    <TextView
+        android:id="@+id/more"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:padding="5dp"
+        android:text="@string/more" />
+
+    <ProgressBar
+        android:id="@+id/loading"
+        style="@style/customProgressBar" />
+
+</LinearLayout>

+ 12 - 0
gaode/src/main/res/layout/gaode_item_marker.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="20dp"
+        android:layout_height="27dp"
+        android:src="@drawable/purple_pin">
+    </ImageView>
+
+</LinearLayout>

+ 39 - 0
gaode/src/main/res/layout/item_select_address.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="#ffffff"
+
+    android:gravity="center_vertical"
+    android:minHeight="70dp"
+    android:orientation="horizontal"
+    android:paddingTop="5dp"
+    android:paddingBottom="5dp">
+
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_weight="1"
+
+        android:orientation="vertical">
+        <TextView
+            android:id="@+id/tv_title"
+            style="@style/txt_style"
+            android:text="中国科学院大学" />
+        <TextView
+            android:id="@+id/tv_address"
+            style="@style/txt_style2"
+            android:layout_marginTop="10dp"
+            android:singleLine="true"
+            android:text="北京市石景山区玉泉路"
+            android:visibility="visible"/>
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/iv_checked"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="10dp"
+        android:src="@mipmap/point4" />
+</LinearLayout>

+ 52 - 0
gaode/src/main/res/layout/map_bubble_back.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="#0000"
+    android:gravity="center"
+    android:orientation="vertical">
+
+
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/dp_40"
+        android:layout_marginRight="@dimen/dp_40"
+        android:background="@drawable/gaode_stock_gary"
+        android:orientation="vertical"
+        android:padding="10dp">
+
+        <TextView
+            android:id="@+id/tv_position"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:ellipsize="end"
+            android:singleLine="true"
+            android:textColor="#333333"
+            android:textSize="14sp"
+            tools:text="街道">
+        </TextView>
+
+        <TextView
+            android:id="@+id/tv_street"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="@dimen/dp_10"
+            android:ellipsize="end"
+            android:singleLine="true"
+            android:textColor="#2A2A2A"
+            android:textSize="12sp"
+            android:visibility="gone"
+            tools:text="附近">
+        </TextView>
+
+    </LinearLayout>
+
+
+
+
+</LinearLayout>

+ 49 - 0
gaode/src/main/res/layout/pull_to_refresh_header.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center"
+    android:orientation="vertical" >
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="10dp" >
+
+        <LinearLayout
+            android:id="@+id/layout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerHorizontal="true"
+            android:layout_centerVertical="true"
+            android:orientation="vertical" >
+
+            <ProgressBar
+                android:id="@+id/refreshing"
+                style="@style/customProgressBar" />
+
+            <TextView
+                android:id="@+id/tip"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center" />
+
+            <TextView
+                android:id="@+id/lastUpdate"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:textSize="12sp" />
+        </LinearLayout>
+
+        <ImageView
+            android:id="@+id/arrow"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="20dp"
+            android:layout_toLeftOf="@id/layout"
+            android:contentDescription="@string/d"
+            android:src="@mipmap/pull_to_refresh_arrow" />
+    </RelativeLayout>
+</LinearLayout>

+ 41 - 0
gaode/src/main/res/layout/view_holder_result.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="8dp"
+    android:gravity="center_vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_weight="1">
+
+        <TextView
+            android:id="@+id/text_title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:textSize="15sp"
+            android:text="title"/>
+
+        <TextView
+            android:id="@+id/text_title_sub"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:textSize="13sp"
+            android:text="sub_title"
+            android:layout_marginTop="6dp"
+            android:textColor="@android:color/darker_gray"/>
+
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/image_check"
+        android:layout_width="32dp"
+        android:layout_height="32dp"
+        android:src="@drawable/icon_affirm_selected"
+        android:layout_marginLeft="8dp"/>
+
+</LinearLayout>

BIN
gaode/src/main/res/mipmap-hdpi/loading_0.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_1.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_2.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_3.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_4.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_5.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_6.png


BIN
gaode/src/main/res/mipmap-hdpi/loading_7.png


BIN
gaode/src/main/res/mipmap-hdpi/poi_marker_1.png


BIN
gaode/src/main/res/mipmap-hdpi/point4.png


BIN
gaode/src/main/res/mipmap-hdpi/pull_to_refresh_arrow.png


+ 7 - 0
gaode/src/main/res/values/colors.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <color name="radio_button_bill_color">#4070FF</color>
+    <color name="radio_button_unselected_color">@android:color/transparent</color>
+
+</resources>

+ 3 - 0
gaode/src/main/res/values/dimens.xml

@@ -0,0 +1,3 @@
+<resources >
+
+</resources >

+ 11 - 0
gaode/src/main/res/values/strings.xml

@@ -0,0 +1,11 @@
+<resources >
+    <string name="app_name" >BDLoc</string >
+    <!-- autolistview -->
+    <string name="pull_to_refresh">下拉可以刷新</string>
+    <string name="release_to_refresh">松开可以刷新</string>
+    <string name="lastUpdateTime">最近更新:%s</string>
+    <string name="load_full">已加载全部</string>
+    <string name="no_data">暂无数据</string>
+    <string name="more">加载中</string>
+    <string name="d">图片描述</string>
+</resources >

+ 54 - 0
gaode/src/main/res/values/styles.xml

@@ -0,0 +1,54 @@
+<resources >
+
+    <!-- autolistview -->
+    <style name="customProgressBar" parent="@android:style/Widget.ProgressBar.Small">
+        <item name="android:indeterminateDrawable">@drawable/custom_progress_bar</item>
+        <item name="android:layout_width">21dip</item>
+        <item name="android:layout_height">21dip</item>
+        <item name="android:layout_gravity">center</item>
+    </style>
+
+    <!--一级文字样式-->
+    <style name="txt_style">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:gravity">center</item>
+        <item name="android:textSize">16sp</item>
+        <item name="android:textColor">#333333</item>
+    </style>
+    <!--二级文字样式-->
+    <style name="txt_style2">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textSize">14sp</item>
+        <item name="android:textColor">#8f8f8f</item>
+    </style>
+    <!--三级文字样式-->
+    <style name="txt_style3">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textSize">12sp</item>
+        <item name="android:textColor">#8f8f8f</item>
+    </style>
+
+    <style name="RadioButton">
+        <item name="android:textColor">@drawable/button_text_color</item>
+        <item name="android:minHeight">33dp</item>
+        <item name="android:minWidth">70dp</item>
+        <item name="android:gravity">center</item>
+        <item name="android:button">@null</item>
+        <item name="android:paddingLeft">5dp</item>
+        <item name="android:paddingRight">5dp</item>
+    </style>
+    <color name="radio_button_selected_color">@android:color/tab_indicator_text</color>
+    <dimen name="radio_button_conner_radius">5dp</dimen>
+    <dimen name="radio_button_stroke_border">1dp</dimen>
+
+    <declare-styleable name="SegmentedGroup">
+        <attr name="sc_corner_radius" format="dimension" />
+        <attr name="sc_border_width" format="dimension" />
+        <attr name="sc_tint_color" format="color" />
+        <attr name="sc_checked_text_color" format="color" />
+    </declare-styleable>
+
+</resources >

+ 1 - 0
settings.gradle

@@ -1,4 +1,5 @@
 include ':jpush'
 include ':umeng'
 include ':update'
+include ':gaode'
 include ':app',':base'