修复家和公司的问题
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.module.apps;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -89,14 +90,12 @@ public class AppNavigatorFragment extends MvpFragment<AppNavigatorView, AppNavig
|
||||
.setMinScale(0.84f)
|
||||
.build());
|
||||
|
||||
|
||||
appIndicatorAdapter = new AppIndicatorAdapter(getContext(), apps);
|
||||
|
||||
appIndicatorAdapter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
NavigatorApp item = (NavigatorApp) v.getTag();
|
||||
AppServiceHandler.getMogoCardManager().switch2(item.mModuleType);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -247,7 +246,7 @@ public class AppNavigatorFragment extends MvpFragment<AppNavigatorView, AppNavig
|
||||
if (index <= -3) {
|
||||
index += CARD_SIZE;
|
||||
} else if (index >= 3) {
|
||||
index = index-CARD_SIZE;
|
||||
index = index - CARD_SIZE;
|
||||
}
|
||||
//RecyclerView 的特性,如果是否在屏幕内
|
||||
//if (index < 0) {
|
||||
@@ -268,11 +267,41 @@ public class AppNavigatorFragment extends MvpFragment<AppNavigatorView, AppNavig
|
||||
|
||||
if (Math.abs(index) == 1) {
|
||||
scroller.smoothScrollBy(getResources().getDimensionPixelSize(R.dimen.dp_137) * index,
|
||||
0,null,10);
|
||||
0, null, 10);
|
||||
} else {
|
||||
layoutManager.startSmoothPendingScroll(layoutManager.getCurrentPosition() + index);
|
||||
}
|
||||
//layoutManager.smoothScrollToPosition(scroller.getCurrentItem() + index);
|
||||
//currentPosition = position;
|
||||
}
|
||||
|
||||
private void printIds(View view) {
|
||||
System.out.println(view.getId());
|
||||
if (view instanceof ViewGroup) {
|
||||
int childCount = ((ViewGroup) view).getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
printIds(((ViewGroup) view).getChildAt(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void print(View view) {
|
||||
|
||||
ArrayList<View> views = new ArrayList<>();
|
||||
views.add(view);
|
||||
|
||||
while (views.size() > 0) {
|
||||
System.out.println(view.getId());
|
||||
View remove = views.remove(0);
|
||||
|
||||
if (remove instanceof ViewGroup) {
|
||||
|
||||
int childCount = ((ViewGroup) view).getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
views.add(((ViewGroup) view).getChildAt(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,12 @@ import com.mogo.module.navi.R
|
||||
import com.mogo.module.navi.bean.SearchPoi
|
||||
import com.mogo.module.navi.constants.DataConstants
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
import com.mogo.module.navi.cp.AddressHelper
|
||||
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.utils.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.fragment_navi_setting.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@@ -297,6 +299,10 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
tv_navi_clear_home_address.visibility = View.VISIBLE
|
||||
|
||||
}
|
||||
|
||||
UiThreadHandler.postDelayed(Runnable {
|
||||
AddressHelper.notifyAddressChanged(activity, searchPoi)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
||||
@@ -183,12 +183,12 @@ class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
|
||||
AppDataBase.getDatabase(context)
|
||||
.poiDao()
|
||||
.insert(searchPoi)
|
||||
AddressHelper.notifyAddressChanged(context, searchPoi)
|
||||
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe()
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
||||
Reference in New Issue
Block a user