Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@nativescript-community/ui-material-core-tabs

Package Overview
Dependencies
Maintainers
20
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nativescript-community/ui-material-core-tabs - npm Package Compare versions

Comparing version
7.2.70
to
7.2.71
+3
-3
package.json
{
"name": "@nativescript-community/ui-material-core-tabs",
"version": "7.2.70",
"version": "7.2.71",
"description": "Material Core Tabs component",

@@ -42,5 +42,5 @@ "main": "./index",

"dependencies": {
"@nativescript-community/ui-material-core": "^7.2.70"
"@nativescript-community/ui-material-core": "^7.2.71"
},
"gitHead": "ca426777b4d884b1e9b5220e27c99840b953d6ca"
"gitHead": "e6076200bd06401a5e915a8dcda6fe3d90caff35"
}

@@ -171,2 +171,3 @@ /*

mTabStrip.onTabsViewPagerPageChanged(position, 0);
makeTabVisible(position, true);
}

@@ -427,2 +428,50 @@

private void makeTabVisible(int tabIndex) {
makeTabVisible(tabIndex, true);
}
private void makeTabVisible(int tabIndex, boolean smoothScroll) {
final int tabStripChildCount = mTabStrip.getChildCount();
if (tabStripChildCount == 0 || tabIndex < 0 || tabIndex >= tabStripChildCount) {
return;
}
View selectedChild = mTabStrip.getChildAt(tabIndex);
if (selectedChild == null) {
return;
}
int selectedLeft = selectedChild.getLeft();
int selectedRight = selectedChild.getRight();
int myWidth = getWidth();
// add padding to the sides so it's clear that we have more tabs to scroll to
if (tabIndex > 0) {
selectedLeft = selectedLeft - mTitleOffset;
}
if (tabIndex < tabStripChildCount - 1) {
selectedRight = selectedRight + mTitleOffset;
}
int scrollX = getScrollX();
if (selectedLeft < scrollX && selectedRight > myWidth + scrollX) {
// the tab is already visible and can't fit the screen, no need to scroll
return;
}
if (selectedLeft < scrollX) {
if (smoothScroll) {
smoothScrollTo(selectedLeft, 0);
} else {
scrollTo(selectedLeft, 0);
}
} else if (selectedRight > myWidth + scrollX) {
if (smoothScroll) {
smoothScrollTo(selectedRight - myWidth, 0);
} else {
scrollTo(selectedRight - myWidth, 0);
}
}
}
private class InternalViewPagerListener extends OnPageChangeCallback {

@@ -439,3 +488,3 @@ private int mScrollState;

if (positionOffset == 0 && mScrollState == androidx.viewpager.widget.ViewPager.SCROLL_STATE_SETTLING) {
scrollToTab(position, 0);
makeTabVisible(position);
}

@@ -442,0 +491,0 @@ }