small fixes

This commit is contained in:
Skalii 2021-03-25 21:05:10 +02:00
parent ad409bc967
commit 1a149c0d63
4 changed files with 7 additions and 21 deletions

View file

@ -294,10 +294,13 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl
viewGroup.removeAllViews();
setupDisplayHelper();
View segmentView = SegmentGPXAdapter.createGpxTabsView(displayHelper, viewGroup, this, nightMode, true);
View segmentView = SegmentGPXAdapter.createGpxTabsView(displayHelper, viewGroup, this, nightMode);
AndroidUiHelper.setVisibility(View.GONE, segmentView.findViewById(R.id.list_item_divider));
WrapContentHeightViewPager pager = segmentView.findViewById(R.id.pager);
PagerSlidingTabStrip tabLayout = segmentView.findViewById(R.id.sliding_tabs);
tabLayout.setDividerWidth(AndroidUtils.dpToPx(app, 1));
tabLayout.setDividerColor(ContextCompat.getColor(app, nightMode ?
R.color.stroked_buttons_and_links_outline_dark : R.color.stroked_buttons_and_links_outline_light));
tabLayout.setOnTabReselectedListener(new PagerSlidingTabStrip.OnTabReselectedListener() {
@Override
public void onTabSelected(int position) {

View file

@ -49,7 +49,7 @@ public class SegmentGPXAdapter extends ArrayAdapter<GpxDisplayItem> {
boolean create = false;
if (row == null) {
create = true;
row = createGpxTabsView(displayHelper, parent, listener, nightMode, false);
row = createGpxTabsView(displayHelper, parent, listener, nightMode);
}
GpxDisplayItem item = getItem(position);
if (item != null) {
@ -67,7 +67,7 @@ public class SegmentGPXAdapter extends ArrayAdapter<GpxDisplayItem> {
}
public static View createGpxTabsView(TrackDisplayHelper displayHelper, ViewGroup root,
SegmentActionsListener listener, boolean nightMode, boolean withDivider) {
SegmentActionsListener listener, boolean nightMode) {
Context context = root.getContext();
View row = UiUtilities.getInflater(context, nightMode).inflate(R.layout.gpx_list_item_tab_content, root, false);
@ -75,11 +75,6 @@ public class SegmentGPXAdapter extends ArrayAdapter<GpxDisplayItem> {
tabLayout.setTabBackground(AndroidUtils.resolveAttribute(context, R.attr.btn_bg_border_inactive));
tabLayout.setIndicatorHeight(0);
tabLayout.setShouldExpand(true);
if (withDivider) {
tabLayout.setDividerWidth(AndroidUtils.dpToPx(context, 1.0f));
tabLayout.setDividerColor(ContextCompat.getColor(context, nightMode ?
R.color.stroked_buttons_and_links_outline_dark : R.color.stroked_buttons_and_links_outline_light));
}
WrapContentHeightViewPager pager = row.findViewById(R.id.pager);
pager.setSwipeable(false);
pager.setOffscreenPageLimit(2);

View file

@ -42,7 +42,7 @@ public class SegmentsCard extends BaseCard {
container.removeAllViews();
List<GpxDisplayItem> items = TrackDisplayHelper.flatten(displayHelper.getOriginalGroups(filterTypes));
for (GpxDisplayItem displayItem : items) {
View segmentView = SegmentGPXAdapter.createGpxTabsView(displayHelper, container, listener, nightMode, false);
View segmentView = SegmentGPXAdapter.createGpxTabsView(displayHelper, container, listener, nightMode);
WrapContentHeightViewPager pager = segmentView.findViewById(R.id.pager);
PagerSlidingTabStrip tabLayout = segmentView.findViewById(R.id.sliding_tabs);

View file

@ -129,7 +129,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
private int dividerWidth = 0;
private int dividerPadding = 0;
@ColorInt
private int dividerColor;
@ -183,7 +182,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
scrollOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, scrollOffset, dm);
indicatorHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, indicatorHeight, dm);
underlineHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, underlineHeight, dm);
dividerPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerPadding, dm);
tabPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, tabPadding, dm);
dividerWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerWidth, dm);
tabTextSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, tabTextSize, dm);
@ -214,7 +212,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
dividerWidth = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsDividerWidth, dividerWidth);
indicatorHeight = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsIndicatorHeight, indicatorHeight);
underlineHeight = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsUnderlineHeight, underlineHeight);
dividerPadding = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsDividerPadding, dividerPadding);
tabPadding = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsTabPaddingLeftRight, tabPadding);
tabBackgroundResId = a.getResourceId(R.styleable.PagerSlidingTabStrip_pstsTabBackground, tabBackgroundResId);
indicatorBgColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsTabBackground, Color.TRANSPARENT);
@ -720,10 +717,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
return underlineHeight;
}
public int getDividerPadding() {
return dividerPadding;
}
public int getScrollOffset() {
return scrollOffset;
}
@ -826,11 +819,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
invalidate();
}
public void setDividerPadding(int dividerPaddingPx) {
this.dividerPadding = dividerPaddingPx;
invalidate();
}
public void setScrollOffset(int scrollOffsetPx) {
this.scrollOffset = scrollOffsetPx;
invalidate();