This commit is contained in:
wangcongtao
2020-02-27 12:41:08 +08:00
parent 4781b10eba
commit 0d3ae83b97
9 changed files with 136 additions and 33 deletions

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -138,6 +138,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
mMapView.setRouteOverlayVisible( false );
mMapView.setCarOverlayVisible( false );
mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE );
setRenderFps( 20 );
}
}
@@ -631,4 +633,14 @@ public class AMapNaviViewWrapper implements IMogoMapView,
MotionEvent upEvent = MotionEvent.obtain(downTime + 100, eventTime + 100, MotionEvent.ACTION_UP, 0,0, metaState);
mMapView.dispatchTouchEvent(upEvent);
}
@Override
public void setRenderFps( int fps ) {
if ( checkAMapView() ) {
if ( mMapView.getMap() != null ) {
mMapView.getMap().setRenderFps( fps );
Logger.d( TAG, "设置刷新帧率 fps = %s", fps );
}
}
}
}

View File

@@ -177,4 +177,11 @@ public class AMapUIController implements IMogoMapUIController {
mClient.startJumpAnimation( marker, high, interpolator, duration );
}
}
@Override
public void setRenderFps( int fps ) {
if ( mClient != null ) {
mClient.setRenderFps( fps );
}
}
}

View File

@@ -61,9 +61,10 @@ public interface IMogoMapUIController {
/**
* 设置锁车缩放级别
*
* @param var1 级别 3-20
*/
void setLockZoom(int var1);
void setLockZoom( int var1 );
/**
* 预览全程
@@ -138,4 +139,11 @@ public interface IMogoMapUIController {
* @param duration 动画时间
*/
void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration );
/**
* 设置刷新帧率
*
* @param fps
*/
void setRenderFps( int fps );
}

View File

@@ -170,4 +170,11 @@ public class MogoMapUIController implements IMogoMapUIController {
mDelegate.startJumpAnimation( marker, high, interpolator, duration );
}
}
@Override
public void setRenderFps( int fps ) {
if ( mDelegate != null ) {
mDelegate.setRenderFps( fps );
}
}
}

View File

@@ -21,8 +21,6 @@ import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.main.assist.MapBroadCastHelper;
import com.mogo.module.main.cards.CardModulesAdapter;
import com.mogo.module.main.cards.MogoModulesHandler;
@@ -32,7 +30,6 @@ import com.mogo.module.main.cards.OrientedViewPager;
import com.mogo.module.main.cards.VerticalStackTransformer;
import com.mogo.module.main.constants.MainConstants;
import com.mogo.module.main.windowview.WindowViewHandler;
import com.mogo.module.service.ServiceConst;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.cardmanager.IMogoCardManager;
@@ -276,7 +273,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onCreate( @Nullable Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
// MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
mMogoModuleHandler = new MogoModulesManager( this );
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation();

View File

@@ -1,7 +1,5 @@
package com.mogo.module.navi.ui.setting
import android.content.Context
import android.media.AudioManager
import android.os.Bundle
import android.view.View
import android.widget.CompoundButton
@@ -9,7 +7,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.commons.debug.DebugConfig
import com.mogo.map.constants.BroadcastMode
import com.mogo.map.uicontroller.EnumMapUI
import com.mogo.module.common.MogoModulePaths
@@ -21,33 +19,10 @@ import com.mogo.module.navi.manager.AddressManager
import com.mogo.module.navi.manager.SettingManager
import com.mogo.module.navi.manager.VolumeManager
import com.mogo.module.navi.ui.base.BaseFragment
import com.mogo.service.MogoServicePaths
import com.mogo.service.module.IMogoSettingManager
import kotlinx.android.synthetic.main.fragment_navi_setting.iv_back
import kotlinx.android.synthetic.main.fragment_navi_setting.iv_navi_sound_high
import kotlinx.android.synthetic.main.fragment_navi_setting.iv_navi_sound_low
import kotlinx.android.synthetic.main.fragment_navi_setting.iv_sound_minus
import kotlinx.android.synthetic.main.fragment_navi_setting.iv_sound_plus
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_auto
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_day
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_detail
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_draft
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_fee
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_high_way
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_jam
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_night
import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_no_high_way
import kotlinx.android.synthetic.main.fragment_navi_setting.rg_navi_day_night
import kotlinx.android.synthetic.main.fragment_navi_setting.rg_navi_sound_type
import kotlinx.android.synthetic.main.fragment_navi_setting.sb_navi_volume_progress
import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_clear_company_address
import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_clear_home_address
import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_company_address
import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_home_address
import kotlinx.android.synthetic.main.fragment_navi_setting.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.HashMap
/**
* @author zyz
@@ -242,6 +217,30 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
AddressManager.goHome()
}
}
if (DebugConfig.isDebug()) {
sb_navi_fps_progress.setOnSeekBarChangeListener(object : OnSeekBarChangeListener{
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
if (progress == 0) {
tv_fps_value.text = "-1"
SearchServiceHolder.getMapUIController().setRenderFps(-1)
} else {
tv_fps_value.text = "${progress}"
SearchServiceHolder.getMapUIController().setRenderFps(progress)
}
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
}
})
} else {
tv_navi_fps.visibility = View.GONE
ll_navi_fps.visibility = View.GONE
}
}
private fun updateHome() {

View File

@@ -370,6 +370,7 @@
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="@+id/ll_navi_set_company"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_40"
app:layout_constraintTop_toBottomOf="@id/ll_navi_set_home"
@@ -405,7 +406,78 @@
</LinearLayout>
<TextView
android:id="@+id/tv_navi_fps"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_search_txt_setting_width"
android:layout_marginTop="@dimen/dp_40"
android:text="@string/set_fps"
android:textColor="@color/white_80"
android:textSize="@dimen/txt_normal"
app:layout_constraintTop_toBottomOf="@id/ll_navi_set_company"
app:layout_constraintLeft_toLeftOf="parent"
/>
<LinearLayout
android:id="@+id/ll_navi_fps"
android:layout_width="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_40"
app:layout_constraintTop_toBottomOf="@id/tv_navi_fps"
android:layout_height="@dimen/dp_120">
<TextView
android:id="@+id/tv_fps_value"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_search_txt_setting_width"
android:text="-1"
android:textColor="@color/white_80"
android:textSize="@dimen/txt_normal"
app:layout_constraintTop_toBottomOf="@id/ll_navi_set_company"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
android:id="@+id/tv_fps_reduce"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_search_txt_setting_width"
android:text="-"
android:layout_marginLeft="30px"
android:textColor="@color/white_80"
android:textSize="@dimen/txt_normal"
app:layout_constraintTop_toBottomOf="@id/ll_navi_set_company"
app:layout_constraintLeft_toLeftOf="parent"
/>
<SeekBar
android:id="@+id/sb_navi_fps_progress"
android:layout_width="300px"
android:layout_height="wrap_content"
android:splitTrack="false"
android:layout_marginLeft="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_40"
android:maxHeight="@dimen/dp_11"
android:progressDrawable="@drawable/shape_seek_bar"
android:thumb="@mipmap/icon_pb_thumb"
android:progress="0"
app:layout_constraintLeft_toRightOf="@id/iv_navi_sound_low"
app:layout_constraintRight_toLeftOf="@id/iv_navi_sound_high"
app:layout_constraintTop_toTopOf="@id/iv_navi_sound_low"
app:layout_constraintBottom_toBottomOf="@id/iv_navi_sound_low"
/>
<TextView
android:id="@+id/tv_fps_plus"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_search_txt_setting_width"
android:text="+"
android:textColor="@color/white_80"
android:textSize="@dimen/txt_normal"
app:layout_constraintTop_toBottomOf="@id/ll_navi_set_company"
app:layout_constraintLeft_toLeftOf="parent"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -40,4 +40,5 @@
<string name="navi_clear">清除</string>
<string name="navi_set_company">去设置公司</string>
<string name="preference_navi_day_mode">日夜模式</string>
<string name="set_fps">设置刷新帧率</string>
</resources>