更新搜索页面
This commit is contained in:
@@ -1,131 +0,0 @@
|
|||||||
package com.mogo.module.map.location;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.util.Log;
|
|
||||||
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.model.LatLng;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class AMapLocationManager {
|
|
||||||
|
|
||||||
private static final String TAG = "AMapLocationManager";
|
|
||||||
|
|
||||||
private static final Set< AMapLocationListener > mLocationChangeListeners = new HashSet<>();
|
|
||||||
private static final InternalLocationListener mInternalLocationListener = new InternalLocationListener();
|
|
||||||
|
|
||||||
private AMapLocationClient mLocationClient;
|
|
||||||
|
|
||||||
private static AMapLocation sLastKnowLocation = null;
|
|
||||||
|
|
||||||
private static volatile AMapLocationManager sInstance;
|
|
||||||
|
|
||||||
public static AMapLocationManager getInstance( Context context ) {
|
|
||||||
if ( sInstance == null ) {
|
|
||||||
synchronized ( AMapLocationManager.class ) {
|
|
||||||
if ( sInstance == null ) {
|
|
||||||
sInstance = new AMapLocationManager( context );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void release() {
|
|
||||||
stop();
|
|
||||||
mLocationChangeListeners.clear();
|
|
||||||
mLocationClient = null;
|
|
||||||
sLastKnowLocation = null;
|
|
||||||
sInstance = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private AMapLocationManager( Context context ) {
|
|
||||||
if ( context == null ) {
|
|
||||||
throw new NullPointerException( "context can't be null." );
|
|
||||||
}
|
|
||||||
mLocationClient = new AMapLocationClient( context.getApplicationContext() );
|
|
||||||
mLocationClient.setLocationListener( mInternalLocationListener );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setLocationOptions( long locateInterval ) {
|
|
||||||
AMapLocationClientOption option = new AMapLocationClientOption();
|
|
||||||
option.setLocationMode( AMapLocationClientOption.AMapLocationMode.Hight_Accuracy );
|
|
||||||
option.setNeedAddress( true );
|
|
||||||
option.setInterval( locateInterval );
|
|
||||||
if ( mLocationClient != null ) {
|
|
||||||
mLocationClient.setLocationOption( option );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void start() {
|
|
||||||
start( 2000L );
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void start( long locateInterval ) {
|
|
||||||
if ( mLocationClient != null && mLocationClient.isStarted() ) {
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
setLocationOptions( locateInterval );
|
|
||||||
mLocationClient.startLocation();
|
|
||||||
Log.d( TAG, "start location, location interval is " + locateInterval );
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void stop() {
|
|
||||||
if ( mLocationClient != null ) {
|
|
||||||
mLocationClient.stopLocation();
|
|
||||||
}
|
|
||||||
Log.d( TAG, "stop location" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AMapLocation getAMapLastKnowLocation() {
|
|
||||||
return sLastKnowLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static LatLng getLastKnowPoint() {
|
|
||||||
final AMapLocation location = getAMapLastKnowLocation();
|
|
||||||
if ( location != null ) {
|
|
||||||
return new LatLng( location.getLatitude(), location.getLongitude() );
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addLocationListener( AMapLocationListener listener ) {
|
|
||||||
if ( listener != null ) {
|
|
||||||
synchronized ( mLocationChangeListeners ) {
|
|
||||||
mLocationChangeListeners.add( listener );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeLocationListener( AMapLocationListener listener ) {
|
|
||||||
synchronized ( mLocationChangeListeners ) {
|
|
||||||
mLocationChangeListeners.remove( listener );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定位SDK监听函数
|
|
||||||
*/
|
|
||||||
private static class InternalLocationListener implements AMapLocationListener {
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged( AMapLocation aMapLocation ) {
|
|
||||||
if ( aMapLocation == null ||
|
|
||||||
aMapLocation.getLatitude() == 0.0D ||
|
|
||||||
aMapLocation.getLongitude() == 0.0D ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sLastKnowLocation = aMapLocation.clone();
|
|
||||||
synchronized ( mLocationChangeListeners ) {
|
|
||||||
Iterator iterator = mLocationChangeListeners.iterator();
|
|
||||||
while ( iterator.hasNext() ) {
|
|
||||||
AMapLocationListener listener = ( AMapLocationListener ) iterator.next();
|
|
||||||
listener.onLocationChanged( sLastKnowLocation );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package com.mogo.module.map.location;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2019-09-27
|
|
||||||
* <p>
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
public class LocationUtils {
|
|
||||||
|
|
||||||
public static float bearing( double lat1, double lon1, double lat2, double lon2 ) {
|
|
||||||
|
|
||||||
double longitude1 = lon1;
|
|
||||||
double longitude2 = lon2;
|
|
||||||
double latitude1 = Math.toRadians( lat1 );
|
|
||||||
double latitude2 = Math.toRadians( lat2 );
|
|
||||||
double longDiff = Math.toRadians( longitude2 - longitude1 );
|
|
||||||
double y = Math.sin( longDiff ) * Math.cos( latitude2 );
|
|
||||||
double x = Math.cos( latitude1 ) * Math.sin( latitude2 ) - Math.sin( latitude1 ) * Math.cos( latitude2 ) * Math
|
|
||||||
.cos( longDiff );
|
|
||||||
|
|
||||||
double result = ( Math.toDegrees( Math.atan2( y, x ) ) + 360 ) % 360;
|
|
||||||
if ( ( ( int ) result ) == ( ( int ) ( result + 0.5 ) ) ) {
|
|
||||||
return ( ( int ) result );
|
|
||||||
} else {
|
|
||||||
return ( ( int ) result ) + 0.5f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package com.mogo.module.map.location;
|
|
||||||
|
|
||||||
import com.amap.api.maps.model.MyLocationStyle;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author congtaowang
|
|
||||||
* @since 2019-10-17
|
|
||||||
* <p>
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
public class MyLocationUtils {
|
|
||||||
|
|
||||||
public static final long INTERVAL_FAST_SPEED = 2_000L;
|
|
||||||
public static final long INTERVAL_MIDDLE_SPEED = 2_000L;
|
|
||||||
public static final long INTERVAL_SLOW_SPEED = 10_000L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 前台快速定位
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static MyLocationStyle wrapperAsFast( MyLocationStyle style ) {
|
|
||||||
if ( style != null ) {
|
|
||||||
style.interval( INTERVAL_FAST_SPEED );
|
|
||||||
}
|
|
||||||
return style;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 后台慢速定位
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static MyLocationStyle wrapperAsMiddleSpeed( MyLocationStyle style ) {
|
|
||||||
if ( style != null ) {
|
|
||||||
style.interval( INTERVAL_MIDDLE_SPEED );
|
|
||||||
}
|
|
||||||
return style;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 后台慢速定位
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static MyLocationStyle wrapperAsSlow( MyLocationStyle style ) {
|
|
||||||
if ( style != null ) {
|
|
||||||
style.interval( INTERVAL_SLOW_SPEED );
|
|
||||||
}
|
|
||||||
return style;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -91,60 +91,9 @@ public class SearchFragment extends BaseFragment implements SearchView
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||||
super.onActivityCreated( savedInstanceState );
|
super.onActivityCreated( savedInstanceState );
|
||||||
initViews();
|
|
||||||
getLifecycle().addObserver( mSearchPresenter = new SearchPresenter( this ) );
|
getLifecycle().addObserver( mSearchPresenter = new SearchPresenter( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initViews() {
|
|
||||||
mClose = findViewById( R.id.amap_search_close );
|
|
||||||
mClose.setOnClickListener( view -> {
|
|
||||||
exitSearch();
|
|
||||||
} );
|
|
||||||
|
|
||||||
mSearchBox = findViewById( R.id.amap_search_search_box );
|
|
||||||
mSearchResult = findViewById( R.id.amap_search_poi_result );
|
|
||||||
mSearchResult.setLayoutManager( new LinearLayoutManager( mContext, LinearLayoutManager.VERTICAL, false ) );
|
|
||||||
|
|
||||||
mMyLocation = findViewById( R.id.amap_search_poi_my_location );
|
|
||||||
mMyLocation.setOnClickListener( view -> {
|
|
||||||
if ( !checkNetwork() ) {
|
|
||||||
shortToast( "网络未连接,请检查网络" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
multiSearchMyLocationUI();
|
|
||||||
} );
|
|
||||||
mChoicePoint = findViewById( R.id.amap_search_poi_choice_point );
|
|
||||||
mChoicePoint.setOnClickListener( view -> {
|
|
||||||
multiSearchChoicePointUI();
|
|
||||||
} );
|
|
||||||
mCurrentLocation = findViewById( R.id.amap_search_current_location );
|
|
||||||
mCurrentLocation.setOnClickListener( view -> {
|
|
||||||
if ( !checkNetwork() ) {
|
|
||||||
shortToast( "网络未连接,请检查网络" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
mActionButton = findViewById( R.id.amap_search_action_setting );
|
|
||||||
mActionButton.setOnClickListener( view -> {
|
|
||||||
if ( mUiMode == SearchConstants.UI_MODE_MULTI_MY_LOCATION ) {
|
|
||||||
saveCurrentLocationAsCommonAddress();
|
|
||||||
} else if ( mUiMode == SearchConstants.UI_MODE_MULTI_CHOICE_POINT ) {
|
|
||||||
saveRegeoAddressAsCommonAddress();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
switch ( mSearchType ) {
|
|
||||||
case SearchConstants.SEARCH_TYPE_COMMON:
|
|
||||||
commonSearchUI();
|
|
||||||
break;
|
|
||||||
case SearchConstants.SEARCH_TYPE_MULTI_HOME:
|
|
||||||
case SearchConstants.SEARCH_TYPE_MULTI_COMPANY:
|
|
||||||
multiSearchUI();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普通搜索UI:不显示我的位置、地图选点、我的定位
|
* 普通搜索UI:不显示我的位置、地图选点、我的定位
|
||||||
*/
|
*/
|
||||||
@@ -209,47 +158,47 @@ public class SearchFragment extends BaseFragment implements SearchView
|
|||||||
/**
|
/**
|
||||||
* 显示我的位置,并且可设置为家
|
* 显示我的位置,并且可设置为家
|
||||||
*/
|
*/
|
||||||
private void multiSearchMyLocationUI() {
|
//private void multiSearchMyLocationUI() {
|
||||||
mUiMode = SearchConstants.UI_MODE_MULTI_MY_LOCATION;
|
// mUiMode = SearchConstants.UI_MODE_MULTI_MY_LOCATION;
|
||||||
mSearchBox.setEnabled( false );
|
// mSearchBox.setEnabled( false );
|
||||||
mMyLocation.setVisibility( View.GONE );
|
// mMyLocation.setVisibility( View.GONE );
|
||||||
mChoicePoint.setVisibility( View.GONE );
|
// mChoicePoint.setVisibility( View.GONE );
|
||||||
mCurrentLocation.setVisibility( View.GONE );
|
// mCurrentLocation.setVisibility( View.GONE );
|
||||||
mSearchResult.setVisibility( View.GONE );
|
// mSearchResult.setVisibility( View.GONE );
|
||||||
mActionButton.setVisibility( View.VISIBLE );
|
// mActionButton.setVisibility( View.VISIBLE );
|
||||||
mActionButton.setText( SearchUtils.getSearchTypeActionName( mSearchType ) );
|
// mActionButton.setText( SearchUtils.getSearchTypeActionName( mSearchType ) );
|
||||||
mSearchBox.setCompoundDrawables( null, null, null, null );
|
// mSearchBox.setCompoundDrawables( null, null, null, null );
|
||||||
//removeChoicePointMarker();
|
// //removeChoicePointMarker();
|
||||||
mSearchBox.setTag( null );
|
// mSearchBox.setTag( null );
|
||||||
if ( mSearchBox.getLayoutParams() instanceof RelativeLayout.LayoutParams ) {
|
// if ( mSearchBox.getLayoutParams() instanceof RelativeLayout.LayoutParams ) {
|
||||||
final RelativeLayout.LayoutParams params = ( ( RelativeLayout.LayoutParams ) mSearchBox.getLayoutParams() );
|
// final RelativeLayout.LayoutParams params = ( ( RelativeLayout.LayoutParams ) mSearchBox.getLayoutParams() );
|
||||||
params.addRule( RelativeLayout.LEFT_OF, R.id.amap_search_action_setting );
|
// params.addRule( RelativeLayout.LEFT_OF, R.id.amap_search_action_setting );
|
||||||
mSearchBox.setPadding( 0, 0, WindowUtils.dip2px( mContext, 15 ), 0 );
|
// mSearchBox.setPadding( 0, 0, WindowUtils.dip2px( mContext, 15 ), 0 );
|
||||||
mSearchBox.setLayoutParams( params );
|
// mSearchBox.setLayoutParams( params );
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示我的位置,并且可设置为家
|
* 显示我的位置,并且可设置为家
|
||||||
*/
|
*/
|
||||||
private void multiSearchChoicePointUI() {
|
//private void multiSearchChoicePointUI() {
|
||||||
mUiMode = SearchConstants.UI_MODE_MULTI_CHOICE_POINT;
|
// mUiMode = SearchConstants.UI_MODE_MULTI_CHOICE_POINT;
|
||||||
mSearchBox.setEnabled( false );
|
// mSearchBox.setEnabled( false );
|
||||||
mMyLocation.setVisibility( View.GONE );
|
// mMyLocation.setVisibility( View.GONE );
|
||||||
mChoicePoint.setVisibility( View.GONE );
|
// mChoicePoint.setVisibility( View.GONE );
|
||||||
mCurrentLocation.setVisibility( View.GONE );
|
// mCurrentLocation.setVisibility( View.GONE );
|
||||||
mSearchResult.setVisibility( View.GONE );
|
// mSearchResult.setVisibility( View.GONE );
|
||||||
mActionButton.setVisibility( View.VISIBLE );
|
// mActionButton.setVisibility( View.VISIBLE );
|
||||||
mActionButton.setText( SearchUtils.getSearchTypeActionName( mSearchType ) );
|
// mActionButton.setText( SearchUtils.getSearchTypeActionName( mSearchType ) );
|
||||||
mSearchBox.setCompoundDrawables( null, null, null, null );
|
// mSearchBox.setCompoundDrawables( null, null, null, null );
|
||||||
mSearchBox.setTag( null );
|
// mSearchBox.setTag( null );
|
||||||
if ( mSearchBox.getLayoutParams() instanceof RelativeLayout.LayoutParams ) {
|
// if ( mSearchBox.getLayoutParams() instanceof RelativeLayout.LayoutParams ) {
|
||||||
final RelativeLayout.LayoutParams params = ( ( RelativeLayout.LayoutParams ) mSearchBox.getLayoutParams() );
|
// final RelativeLayout.LayoutParams params = ( ( RelativeLayout.LayoutParams ) mSearchBox.getLayoutParams() );
|
||||||
params.addRule( RelativeLayout.LEFT_OF, R.id.amap_search_action_setting );
|
// params.addRule( RelativeLayout.LEFT_OF, R.id.amap_search_action_setting );
|
||||||
mSearchBox.setPadding( 0, 0, WindowUtils.dip2px( mContext, 15 ), 0 );
|
// mSearchBox.setPadding( 0, 0, WindowUtils.dip2px( mContext, 15 ), 0 );
|
||||||
mSearchBox.setLayoutParams( params );
|
// mSearchBox.setLayoutParams( params );
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private void saveCurrentLocationAsCommonAddress() {
|
private void saveCurrentLocationAsCommonAddress() {
|
||||||
//if ( mLastAMapLocation == null ) {
|
//if ( mLastAMapLocation == null ) {
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="#3F4057"/>
|
||||||
|
<corners android:radius="@dimen/dp_8"/>
|
||||||
|
</shape>
|
||||||
|
|
||||||
@@ -1,137 +1,43 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
style="@style/amap_fragment_container_padding_style"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.search.SearchFragment">
|
android:paddingBottom="@dimen/dp_30"
|
||||||
|
android:paddingLeft="@dimen/dp_30"
|
||||||
|
android:paddingRight="@dimen/dp_30"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
tools:context=".ui.search.SearchFragment"
|
||||||
|
style="@style/amap_fragment_container_padding_style"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
<RelativeLayout
|
android:layout_width="@dimen/dp_600"
|
||||||
android:id="@+id/amap_search_search_box_width_container"
|
android:layout_height="@dimen/dp_60"
|
||||||
android:layout_width="692dp"
|
android:orientation="horizontal"
|
||||||
android:layout_height="81dp"
|
android:gravity="center_vertical"
|
||||||
android:background="@drawable/amap_white_shadow_bkg">
|
android:background="@drawable/shape_round_gray"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
<ImageView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/amap_search_close"
|
>
|
||||||
android:layout_width="@dimen/amap_search_back_size"
|
|
||||||
android:layout_height="@dimen/amap_search_back_size"
|
|
||||||
android:layout_alignTop="@+id/amap_search_search_box"
|
|
||||||
android:layout_alignBottom="@+id/amap_search_search_box"
|
|
||||||
android:layout_marginLeft="12dp"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:src="@drawable/ic_back_dark" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/amap_search_search_box"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="58dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_toRightOf="@+id/amap_search_close"
|
|
||||||
android:background="@color/transparent"
|
|
||||||
android:drawableRight="@drawable/ic_search_unshadow"
|
|
||||||
android:drawablePadding="15dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:hint="@string/navi_search_hint"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:paddingTop="@dimen/amap_search_search_box_paddingLTop"
|
|
||||||
android:paddingBottom="@dimen/amap_search_search_box_paddingBottom"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textColorHint="#848484"
|
|
||||||
android:textCursorDrawable="@drawable/amap_search_cursor_drawable"
|
|
||||||
android:textSize="@dimen/amap_search_search_box_textSize"
|
|
||||||
tools:text="@string/amap_long_text" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/amap_search_action_setting"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignTop="@+id/amap_search_search_box"
|
|
||||||
android:layout_alignBottom="@+id/amap_search_search_box"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginTop="8.5dp"
|
|
||||||
android:layout_marginRight="7.5dp"
|
|
||||||
android:layout_marginBottom="8.5dp"
|
|
||||||
android:background="@drawable/amap_search_action_button_bkg"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="25dp"
|
|
||||||
android:paddingRight="25dp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="20dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:text="设为家"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/amap_search_current_location_tag"
|
android:layout_width="@dimen/dp_40"
|
||||||
android:layout_width="wrap_content"
|
android:layout_marginLeft="@dimen/dp_12"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:src="@mipmap/icon_back"
|
||||||
|
android:layout_height="@dimen/dp_40"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="@color/white_60"
|
||||||
|
android:hint="@string/hint_map_search"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/amap_search_search_box_width_container"
|
android:layout_weight="1"/>
|
||||||
android:layout_alignLeft="@+id/amap_search_search_box_width_container"
|
|
||||||
android:layout_marginBottom="@dimen/amap_main_navi_current_location_marginBottom"
|
</LinearLayout>
|
||||||
android:src="@drawable/ic_current_location"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_goneMarginBottom="@dimen/amap_main_navi_current_location_goneMarginBottom" />
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:id="@+id/amap_search_poi_my_location"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignTop="@+id/amap_search_current_location_tag"
|
|
||||||
android:layout_alignBottom="@+id/amap_search_current_location_tag"
|
|
||||||
android:background="@drawable/amap_white_shadow_bkg"
|
|
||||||
android:drawableLeft="@drawable/ic_search_poi_location"
|
|
||||||
android:drawablePadding="15.5dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="23.5dp"
|
|
||||||
android:paddingRight="27.5dp"
|
|
||||||
android:text="我的位置"
|
|
||||||
android:textColor="#595959"
|
|
||||||
android:textSize="20dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/amap_search_poi_choice_point"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignTop="@+id/amap_search_current_location_tag"
|
|
||||||
android:layout_alignBottom="@+id/amap_search_current_location_tag"
|
|
||||||
android:layout_toRightOf="@+id/amap_search_poi_my_location"
|
|
||||||
android:background="@drawable/amap_white_shadow_bkg"
|
|
||||||
android:drawableLeft="@drawable/ic_search_poi_location"
|
|
||||||
android:drawablePadding="15.5dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="23.5dp"
|
|
||||||
android:paddingRight="27.5dp"
|
|
||||||
android:text="地图选点"
|
|
||||||
android:textColor="#595959"
|
|
||||||
android:textSize="20dp" />
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/amap_search_current_location"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:layout_marginBottom="@dimen/amap_main_navi_current_location_marginBottom"
|
|
||||||
android:src="@drawable/ic_current_location" />
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/amap_search_poi_result"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/amap_search_search_box_width_container"
|
|
||||||
android:layout_alignRight="@+id/amap_search_search_box_width_container"
|
|
||||||
android:layout_marginBottom="@dimen/amap_main_navi_current_location_marginBottom"
|
|
||||||
android:background="@drawable/amap_white_shadow_bkg"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
android:visibility="invisible" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
BIN
modules/mogo-module-navi/src/main/res/mipmap-xhdpi/icon_back.png
Executable file
BIN
modules/mogo-module-navi/src/main/res/mipmap-xhdpi/icon_back.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 703 B |
@@ -5,6 +5,7 @@
|
|||||||
<color name="colorAccent">#D81B60</color>
|
<color name="colorAccent">#D81B60</color>
|
||||||
<color name="bg_gray_common_page">#ff080625</color>
|
<color name="bg_gray_common_page">#ff080625</color>
|
||||||
<color name="white">#FFFFFF</color>
|
<color name="white">#FFFFFF</color>
|
||||||
|
<color name="white_60">#99FFFFFF</color>
|
||||||
<color name="white_7f">#7FFFFFFF</color>
|
<color name="white_7f">#7FFFFFFF</color>
|
||||||
<color name="arrow_color">#00BFFF</color>
|
<color name="arrow_color">#00BFFF</color>
|
||||||
<color name="white_30">#4DFFFFFF</color>
|
<color name="white_30">#4DFFFFFF</color>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">mogo-module-navi</string>
|
<string name="app_name">mogo-module-navi</string>
|
||||||
|
<string name="hint_map_search">查看地点、公交、地铁</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user