家和公司地址

This commit is contained in:
zhangyuanzhen
2020-04-07 10:43:04 +08:00
parent fccd57f6eb
commit f4785c5305
3 changed files with 7 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.module.navi.bean.SearchPoi;
import com.mogo.module.navi.constants.DataConstants;
import com.mogo.utils.logger.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -15,6 +16,7 @@ import org.jetbrains.annotations.Nullable;
*/
public class AddressHelper {
private static final String TAG = "AddressHelper";
public static void notifyHomeAddressChanged( ) {
AbsMogoApplication.getApp().getContentResolver().notifyChange( DataConstants.CONTENT_HOME_ADDRESS_URI, null );
}
@@ -25,8 +27,8 @@ public class AddressHelper {
}
public static void notifyAddressChanged(
@NotNull SearchPoi searchPoi) {
if (searchPoi.getType()== DataConstants.TYPE_HOME_ADDRESS) {
int type) {
if (type== DataConstants.TYPE_HOME_ADDRESS) {
notifyHomeAddressChanged();
}else {
notifyCompanyAddressChanged();

View File

@@ -125,7 +125,7 @@ object AddressManager {
ObservableOnSubscribe<String> {
poiDao.delete(homeAddress)
homeAddress?.name=""
AddressHelper.notifyAddressChanged( homeAddress!!)
AddressHelper.notifyAddressChanged( 1)
homeAddress=null
})
@@ -140,7 +140,7 @@ object AddressManager {
ObservableOnSubscribe<String> {
poiDao.delete(companyAddress)
companyAddress?.name=""
AddressHelper.notifyAddressChanged( companyAddress!!)
AddressHelper.notifyAddressChanged( 0)
companyAddress=null
})

View File

@@ -186,7 +186,7 @@ class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
AppDataBase.getDatabase(activity)
.poiDao()
.insert(searchPoi)
AddressHelper.notifyAddressChanged(searchPoi)
AddressHelper.notifyAddressChanged(searchPoi.type)
})
.subscribeOn(Schedulers.io())
.subscribe()