增加设置家和公司的功能
This commit is contained in:
1
.idea/.name
generated
1
.idea/.name
generated
@@ -1 +0,0 @@
|
|||||||
MogoLauncher
|
|
||||||
116
.idea/codeStyles/Project.xml
generated
116
.idea/codeStyles/Project.xml
generated
@@ -1,116 +0,0 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
|
||||||
<code_scheme name="Project" version="173">
|
|
||||||
<codeStyleSettings language="XML">
|
|
||||||
<indentOptions>
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
</indentOptions>
|
|
||||||
<arrangement>
|
|
||||||
<rules>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>xmlns:android</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>xmlns:.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>BY_NAME</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*:id</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*:name</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>name</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>style</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>BY_NAME</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<rule>
|
|
||||||
<match>
|
|
||||||
<AND>
|
|
||||||
<NAME>.*</NAME>
|
|
||||||
<XML_ATTRIBUTE />
|
|
||||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
|
||||||
</AND>
|
|
||||||
</match>
|
|
||||||
<order>BY_NAME</order>
|
|
||||||
</rule>
|
|
||||||
</section>
|
|
||||||
</rules>
|
|
||||||
</arrangement>
|
|
||||||
</codeStyleSettings>
|
|
||||||
</code_scheme>
|
|
||||||
</component>
|
|
||||||
40
.idea/gradle.xml
generated
40
.idea/gradle.xml
generated
@@ -1,40 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="GradleSettings">
|
|
||||||
<option name="linkedExternalProjectsSettings">
|
|
||||||
<GradleProjectSettings>
|
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
||||||
<option name="modules">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$" />
|
|
||||||
<option value="$PROJECT_DIR$/app" />
|
|
||||||
<option value="$PROJECT_DIR$/foudations" />
|
|
||||||
<option value="$PROJECT_DIR$/foudations/mogo-commons" />
|
|
||||||
<option value="$PROJECT_DIR$/foudations/mogo-connection" />
|
|
||||||
<option value="$PROJECT_DIR$/foudations/mogo-utils" />
|
|
||||||
<option value="$PROJECT_DIR$/libraries" />
|
|
||||||
<option value="$PROJECT_DIR$/libraries/map-amap" />
|
|
||||||
<option value="$PROJECT_DIR$/libraries/mogo-map" />
|
|
||||||
<option value="$PROJECT_DIR$/libraries/mogo-map-api" />
|
|
||||||
<option value="$PROJECT_DIR$/modules" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-apps" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-common" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-extensions" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-main" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-map" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-search" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-service" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-share" />
|
|
||||||
<option value="$PROJECT_DIR$/modules/mogo-module-tanlu" />
|
|
||||||
<option value="$PROJECT_DIR$/services" />
|
|
||||||
<option value="$PROJECT_DIR$/services/mogo-service" />
|
|
||||||
<option value="$PROJECT_DIR$/services/mogo-service-api" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
|
||||||
<option name="testRunner" value="PLATFORM" />
|
|
||||||
</GradleProjectSettings>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
12
.idea/runConfigurations.xml
generated
12
.idea/runConfigurations.xml
generated
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -24,7 +24,7 @@ SNAPSHOT_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-snapshots/
|
|||||||
USERNAME=xintai
|
USERNAME=xintai
|
||||||
PASSWORD=xintai2018
|
PASSWORD=xintai2018
|
||||||
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
|
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
|
||||||
RELEASE=true
|
RELEASE=false
|
||||||
# 模块版本
|
# 模块版本
|
||||||
DEMO_MODULE_MAP_VERSION=1.0.0-SNAPSHOT
|
DEMO_MODULE_MAP_VERSION=1.0.0-SNAPSHOT
|
||||||
DEMO_MODULE_MAP2_VERSION=1.0.0-SNAPSHOT
|
DEMO_MODULE_MAP2_VERSION=1.0.0-SNAPSHOT
|
||||||
|
|||||||
@@ -119,7 +119,12 @@ public class VoiceConstants {
|
|||||||
public static final String CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP = "CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP";
|
public static final String CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP = "CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP";
|
||||||
public static final String[] CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS = {"停止导航/结束导航/取消导航/放弃导航/退出导航/关闭导航"};
|
public static final String[] CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS = {"停止导航/结束导航/取消导航/放弃导航/退出导航/关闭导航"};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附近类命令
|
||||||
|
*/
|
||||||
|
public static final String CMD_MAP_GEO_NEARBY = "com.ileja.navi.geo.nearby";
|
||||||
|
public static final String CMD_MAP_GEO_NEARBY_WAKEUP = "CMD_MAP_GEO_NEARBY_WAKEUP";
|
||||||
|
public static final String[] CMD_MAP_GEO_NEARBY_TRIGGER_WORDS = {"查找附近的","查找附近的"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车头朝上
|
* 车头朝上
|
||||||
@@ -155,5 +160,6 @@ public class VoiceConstants {
|
|||||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_COMPANY_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_COMPANY );
|
sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_COMPANY_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_COMPANY );
|
||||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP, VoiceConstants.CMD_MAP_HISTORY_TRIGGER_WORDS );
|
sVoiceCmds.put( VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP, VoiceConstants.CMD_MAP_HISTORY_TRIGGER_WORDS );
|
||||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS );
|
sVoiceCmds.put( VoiceConstants.CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS );
|
||||||
|
sVoiceCmds.put( VoiceConstants.CMD_MAP_GEO_NEARBY_WAKEUP, VoiceConstants.CMD_MAP_GEO_NEARBY_TRIGGER_WORDS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,14 @@ import com.mogo.module.navi.bean.EntityConvertUtils
|
|||||||
import com.mogo.module.navi.bean.SearchPoi
|
import com.mogo.module.navi.bean.SearchPoi
|
||||||
import com.mogo.module.navi.constants.DataConstants
|
import com.mogo.module.navi.constants.DataConstants
|
||||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||||
|
import com.mogo.module.navi.dao.SearchPoiDao
|
||||||
import com.mogo.module.navi.database.AppDataBase
|
import com.mogo.module.navi.database.AppDataBase
|
||||||
import com.mogo.module.navi.ui.search.ChoosePathFragment
|
import com.mogo.module.navi.ui.search.ChoosePathFragment
|
||||||
import com.mogo.module.navi.ui.setting.SettingAddressFragment
|
import com.mogo.module.navi.ui.setting.SettingAddressFragment
|
||||||
import com.mogo.service.fragmentmanager.FragmentDescriptor
|
import com.mogo.service.fragmentmanager.FragmentDescriptor
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.ObservableEmitter
|
||||||
|
import io.reactivex.ObservableOnSubscribe
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.schedulers.Schedulers
|
import io.reactivex.schedulers.Schedulers
|
||||||
|
|
||||||
@@ -19,17 +23,20 @@ import io.reactivex.schedulers.Schedulers
|
|||||||
* 2020-01-12.
|
* 2020-01-12.
|
||||||
*/
|
*/
|
||||||
object AddressManager {
|
object AddressManager {
|
||||||
private var homeAddress: SearchPoi? = null
|
var homeAddress: SearchPoi? = null
|
||||||
private var companyAddress: SearchPoi? = null
|
var companyAddress: SearchPoi? = null
|
||||||
|
private lateinit var poiDao:SearchPoiDao
|
||||||
fun goHome() {
|
fun goHome() {
|
||||||
if (homeAddress == null) {
|
if (homeAddress == null) {
|
||||||
pushSettingAddress(
|
pushSettingAddress(
|
||||||
DataConstants.TYPE_HOME_ADDRESS
|
DataConstants.TYPE_HOME_ADDRESS
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
var newInstance = ChoosePathFragment.newInstance(EntityConvertUtils.poi2MogoTip(
|
var newInstance = ChoosePathFragment.newInstance(
|
||||||
homeAddress
|
EntityConvertUtils.poi2MogoTip(
|
||||||
).point)
|
homeAddress
|
||||||
|
).point
|
||||||
|
)
|
||||||
SearchServiceHolder.push(
|
SearchServiceHolder.push(
|
||||||
newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT
|
newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT
|
||||||
)
|
)
|
||||||
@@ -43,15 +50,25 @@ object AddressManager {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
var newInstance =
|
var newInstance =
|
||||||
ChoosePathFragment.newInstance(EntityConvertUtils.poi2MogoTip(
|
ChoosePathFragment.newInstance(
|
||||||
companyAddress
|
EntityConvertUtils.poi2MogoTip(
|
||||||
).point)
|
companyAddress
|
||||||
|
).point
|
||||||
|
)
|
||||||
SearchServiceHolder.push(
|
SearchServiceHolder.push(
|
||||||
newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT
|
newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun hasHome(): Boolean {
|
||||||
|
return homeAddress == null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun hasCompany(): Boolean {
|
||||||
|
return companyAddress == null
|
||||||
|
}
|
||||||
|
|
||||||
private fun pushSettingAddress(type: Int) {
|
private fun pushSettingAddress(type: Int) {
|
||||||
|
|
||||||
val builder = FragmentDescriptor.Builder()
|
val builder = FragmentDescriptor.Builder()
|
||||||
@@ -62,8 +79,10 @@ object AddressManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult") fun init(context: Context) {
|
@SuppressLint("CheckResult") fun init(context: Context) {
|
||||||
AppDataBase.getDatabase(context)
|
|
||||||
|
poiDao = AppDataBase.getDatabase(context)
|
||||||
.poiDao()
|
.poiDao()
|
||||||
|
poiDao
|
||||||
.companyAddress
|
.companyAddress
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@@ -72,8 +91,8 @@ object AddressManager {
|
|||||||
companyAddress = t1[0]
|
companyAddress = t1[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AppDataBase.getDatabase(context)
|
|
||||||
.poiDao()
|
poiDao
|
||||||
.homeAddress
|
.homeAddress
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@@ -91,4 +110,24 @@ object AddressManager {
|
|||||||
homeAddress = searchPoi
|
homeAddress = searchPoi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun deleteHome(){
|
||||||
|
homeAddress=null
|
||||||
|
Observable.create(
|
||||||
|
ObservableOnSubscribe<String> {
|
||||||
|
poiDao.delete(homeAddress)
|
||||||
|
})
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deleteCompany(){
|
||||||
|
companyAddress=null
|
||||||
|
Observable.create(
|
||||||
|
ObservableOnSubscribe<String> {
|
||||||
|
poiDao.delete(companyAddress)
|
||||||
|
})
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.mogo.map.uicontroller.EnumMapUI
|
|||||||
import com.mogo.module.common.MogoModulePaths
|
import com.mogo.module.common.MogoModulePaths
|
||||||
import com.mogo.module.navi.R
|
import com.mogo.module.navi.R
|
||||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||||
|
import com.mogo.module.navi.manager.AddressManager
|
||||||
import com.mogo.module.navi.manager.SettingManager
|
import com.mogo.module.navi.manager.SettingManager
|
||||||
import com.mogo.module.navi.ui.base.BaseFragment
|
import com.mogo.module.navi.ui.base.BaseFragment
|
||||||
import com.mogo.service.MogoServicePaths
|
import com.mogo.service.MogoServicePaths
|
||||||
@@ -37,6 +38,10 @@ 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_day_night
|
||||||
import kotlinx.android.synthetic.main.fragment_navi_setting.rg_navi_sound_type
|
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.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 java.util.HashMap
|
import java.util.HashMap
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,7 +102,11 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
|||||||
iv_back.setOnClickListener {
|
iv_back.setOnClickListener {
|
||||||
SearchServiceHolder.fragmentManager.pop()
|
SearchServiceHolder.fragmentManager.pop()
|
||||||
}
|
}
|
||||||
|
initViews()
|
||||||
|
initEvent()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initViews() {
|
||||||
|
|
||||||
rb_navi_high_way.isChecked = SettingManager.isHighSpeed()
|
rb_navi_high_way.isChecked = SettingManager.isHighSpeed()
|
||||||
rb_navi_jam.isChecked = SettingManager.isCongestion()
|
rb_navi_jam.isChecked = SettingManager.isCongestion()
|
||||||
@@ -113,6 +122,12 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
|||||||
rb_navi_draft.isChecked = SettingManager.voiceStyle == R.id.rb_navi_draft
|
rb_navi_draft.isChecked = SettingManager.voiceStyle == R.id.rb_navi_draft
|
||||||
|
|
||||||
|
|
||||||
|
updateHome()
|
||||||
|
updateCompany()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initEvent() {
|
||||||
iv_sound_plus.setOnClickListener {
|
iv_sound_plus.setOnClickListener {
|
||||||
sb_navi_volume_progress.progress = ++sb_navi_volume_progress.progress
|
sb_navi_volume_progress.progress = ++sb_navi_volume_progress.progress
|
||||||
SettingManager.volume = sb_navi_volume_progress.progress
|
SettingManager.volume = sb_navi_volume_progress.progress
|
||||||
@@ -185,5 +200,47 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tv_navi_clear_home_address.setOnClickListener {
|
||||||
|
AddressManager.deleteHome()
|
||||||
|
updateHome()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
tv_navi_clear_company_address.setOnClickListener {
|
||||||
|
AddressManager.deleteCompany()
|
||||||
|
updateCompany()
|
||||||
|
}
|
||||||
|
|
||||||
|
tv_navi_company_address.setOnClickListener {
|
||||||
|
if (!AddressManager.hasCompany()) {
|
||||||
|
AddressManager.goHome()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tv_navi_home_address.setOnClickListener {
|
||||||
|
if (!AddressManager.hasHome()) {
|
||||||
|
AddressManager.goCompany()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateHome() {
|
||||||
|
|
||||||
|
if (AddressManager.hasHome()) {
|
||||||
|
tv_navi_home_address.text = AddressManager.homeAddress?.name
|
||||||
|
tv_navi_clear_home_address.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
tv_navi_clear_home_address.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateCompany() {
|
||||||
|
if (AddressManager.hasCompany()) {
|
||||||
|
tv_navi_company_address.text = AddressManager.companyAddress?.name
|
||||||
|
tv_navi_clear_company_address.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
tv_navi_clear_company_address.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<corners android:radius="@dimen/dp_16"/>
|
||||||
|
<stroke android:width="@dimen/dp_2"
|
||||||
|
android:color="#979797"/>
|
||||||
|
</shape>
|
||||||
|
|
||||||
@@ -6,10 +6,52 @@
|
|||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:background="#2D2E3D"
|
android:background="#2D2E3D"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="@dimen/fragment_left_margin"
|
android:paddingRight="@dimen/dp_160"
|
||||||
|
android:paddingLeft="@dimen/dp_160"
|
||||||
>
|
>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_navi_setting_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_80"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_back"
|
||||||
|
android:layout_width="@dimen/dp_80"
|
||||||
|
android:layout_height="@dimen/dp_80"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/icon_back"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:layout_toRightOf="@id/iv_back"
|
||||||
|
android:text="@string/navi_setting"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/txt_title"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/rl_navi_setting_title"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_height="0dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="180dp"
|
android:layout_width="180dp"
|
||||||
android:layout_height="@dimen/dp_120"
|
android:layout_height="@dimen/dp_120"
|
||||||
@@ -139,38 +181,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/rl_navi_setting_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_80"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="@dimen/dp_30"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_back"
|
|
||||||
android:layout_width="@dimen/dp_80"
|
|
||||||
android:layout_height="@dimen/dp_80"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:src="@mipmap/icon_back"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginLeft="@dimen/dp_20"
|
|
||||||
android:layout_toRightOf="@id/iv_back"
|
|
||||||
android:text="@string/navi_setting"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="@dimen/txt_title"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -195,7 +205,7 @@
|
|||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/txt_normal"
|
android:textSize="@dimen/txt_normal"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/rl_navi_setting_title"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
@@ -296,8 +306,108 @@
|
|||||||
style="@style/rb_setting"
|
style="@style/rb_setting"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_navi_address"
|
||||||
|
android:layout_width="400px"
|
||||||
|
android:layout_height="45px"
|
||||||
|
android:layout_marginTop="@dimen/dp_40"
|
||||||
|
android:text="@string/preference_navi_address"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/txt_normal"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rg_navi_day_night"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:id="@+id/ll_navi_set_home"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp_24"
|
||||||
|
android:background="@drawable/shape_round_gray_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_navi_address"
|
||||||
|
android:layout_height="@dimen/dp_120">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_marginLeft="@dimen/dp_40"
|
||||||
|
android:src="@mipmap/icon_navi_go_home"
|
||||||
|
android:layout_width="@dimen/dp_80"
|
||||||
|
android:layout_height="@dimen/dp_80"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_navi_home_address"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/navi_set_home"
|
||||||
|
android:textSize="@dimen/dp_40"
|
||||||
|
android:textColor="@color/white_80"
|
||||||
|
android:layout_marginLeft="@dimen/dp_32"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_navi_clear_home_address"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="@string/navi_clear"
|
||||||
|
android:textSize="@dimen/dp_40"
|
||||||
|
android:textColor="@color/txt_blue"
|
||||||
|
android:layout_marginRight="@dimen/dp_88"
|
||||||
|
android:layout_marginLeft="@dimen/dp_32"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp_40"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/ll_navi_set_home"
|
||||||
|
android:background="@drawable/shape_round_gray_margin"
|
||||||
|
android:layout_height="@dimen/dp_120">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_marginLeft="@dimen/dp_40"
|
||||||
|
android:src="@mipmap/icon_navi_go_company"
|
||||||
|
android:layout_width="@dimen/dp_80"
|
||||||
|
android:layout_height="@dimen/dp_80"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_navi_company_address"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/navi_set_company"
|
||||||
|
android:textSize="@dimen/dp_40"
|
||||||
|
android:textColor="@color/white_80"
|
||||||
|
android:layout_marginLeft="@dimen/dp_32"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_navi_clear_company_address"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="@string/navi_clear"
|
||||||
|
android:textSize="@dimen/dp_40"
|
||||||
|
android:textColor="@color/txt_blue"
|
||||||
|
android:layout_marginRight="@dimen/dp_88"
|
||||||
|
android:layout_marginLeft="@dimen/dp_32"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ll_navi_search"
|
app:layout_constraintTop_toBottomOf="@+id/ll_navi_search"
|
||||||
app:cardBackgroundColor="#3F4057"
|
app:cardBackgroundColor="#3F4057"
|
||||||
app:cardCornerRadius="@dimen/dp_16"
|
app:cardCornerRadius="@dimen/dp_8"
|
||||||
>
|
>
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_search_result"
|
android:id="@+id/rv_search_result"
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
/>
|
/>
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:maxLines="1"
|
android:singleLine="true"
|
||||||
|
android:layout_marginRight="@dimen/dp_50"
|
||||||
android:id="@+id/et_navi_search"
|
android:id="@+id/et_navi_search"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
BIN
modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_go_company.png
Executable file
BIN
modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_go_company.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 980 B |
BIN
modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_go_home.png
Executable file
BIN
modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_go_home.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -35,4 +35,8 @@
|
|||||||
<string name="start_navi">开始导航</string>
|
<string name="start_navi">开始导航</string>
|
||||||
<string name="choose_path">路线选择</string>
|
<string name="choose_path">路线选择</string>
|
||||||
<string name="drag_map_to_choose">拖动地图选点</string>
|
<string name="drag_map_to_choose">拖动地图选点</string>
|
||||||
|
<string name="preference_navi_address">常用地址设置</string>
|
||||||
|
<string name="navi_set_home">去设置家</string>
|
||||||
|
<string name="navi_clear">清除</string>
|
||||||
|
<string name="navi_set_company">去设置公司</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user