修复家和公司的问题

This commit is contained in:
zhangyuanzhen
2020-04-02 13:03:16 +08:00
parent 818b4222cf
commit 81e7536f6f
3 changed files with 40 additions and 5 deletions

View File

@@ -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));
}
}
}
}
}