Closed StephaneBg closed 9 years ago
Ok , thanks for reporting the issue. I will take a look. In the meantime you can use pstsTabPaddingLeftRight
if you didn't do it yet.
I tried it without success.
Le mar. 25 nov. 2014 19:27, Javier Pardo de Santayana Gómez < notifications@github.com> a écrit :
Ok , thanks for reporting the issue. I will take a look. In the meantime you can use pstsTabPaddingLeftRight if you didn't do it yet.
— Reply to this email directly or view it on GitHub https://github.com/jpardogo/PagerSlidingTabStrip/issues/30#issuecomment-64447190 .
Could it be because they are inside a dialog fragment? what the whole xml of this dialog fragment? Could you do more test on this devices and tell me when it happens and when it doesn't? what device is it?
I tried on another tablet and it works fine with the DialogFragment. I think it is specific to this device/platform. I'll try to dig a little more why it happens. Device is an Archos G9 running Android 4.0.4.
Le Tue Nov 25 2014 at 21:59:00, Javier Pardo de Santayana Gómez < notifications@github.com> a écrit :
Could it be because they are inside a dialog fragment? could you do more
test on this devices and tell me when it happen and when it doesn't? what device is it?
— Reply to this email directly or view it on GitHub https://github.com/jpardogo/PagerSlidingTabStrip/issues/30#issuecomment-64469698 .
I'm experiencing this issue on an old Android 4.0.4 device as well:
There's plenty of padding on newer versions of Android. Changing any of the settings doesn't help. If there's a limited number of tabs, however, it seems like it works with the expanded setting:
What device?
This is on an old Xperia Neo that I keep around for testing purposes :-)
same issue in the original library https://github.com/astuetz/PagerSlidingTabStrip/issues/120
Like mentioned in that issue description setting a 9-patch-background to a view will remove the padding. So just reapply the padding of the tab in the updateTabStyles()
should solve the problem.
private void updateTabStyles() {
for (int i = 0; i < tabCount; i++) {
View v = tabsContainer.getChildAt(i);
v.setBackgroundResource(tabBackgroundResId);
+ v.setPadding(tabPadding, v.getPaddingTop(), tabPadding, v.getPaddingBottom());
TextView tab_title = (TextView) v.findViewById(R.id.tab_title);
Awesome! Seems like an easy fix then.
Can you implement the fix, @jpardogo?
I will try to take a look tonight. Did you test it @MizzleDK ? In stead of reapplying the padding I will just apply the padding after the backgroun,I deleting it from here. It should be alright
I have tested it and it worked on my Galaxy Nexus. Yes you can remove the other line
Yep, that should work! :+1:
Did you manage to take a look at it? :smiley:
No sorry, maybe tomorrow.
Awesome! :-) On Dec 6, 2014 6:52 PM, "Javier Pardo de Santayana Gómez" < notifications@github.com> wrote:
No sorry, maybe tomorrow.
— Reply to this email directly or view it on GitHub https://github.com/jpardogo/PagerSlidingTabStrip/issues/30#issuecomment-65907103 .
Just thought I'd mention that the proposed fix does indeed work :-)
There is no padding around text of tabs with version 4.0.4 on a tablet. It works on my Nexus 5 on Lollipop. Here is my XML extract : <com.astuetz.PagerSlidingTabStrip android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:textColor="@color/white" app:pstsIndicatorColor="@color/white" app:pstsTabBackground="?attr/selectableItemBackground"/>
https://github.com/StephaneBg/ScoreItProject/blob/master/ScoreIt/src/main/res/layout-sw600dp/activity_about.xml