History log of /frameworks/support/design/src/android/support/design/widget/TabLayout.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a4c6825b4b077cb12adb4f14b825001b6fd0e865 03-Mar-2017 Vladislav Kaznacheev <kaznacheev@google.com> Introduce android.support.v7.widget.TooltipCompat

Backport com.android.internal.view.TooltipPopup with
as much style and behavior details as practically possible.
Make it available through the new TooltipCompat class.

Bug: 35669189
Test: Support7Demos > AppCompat > Action Bar >
Action Bar Usage, hover mouse over action buttons.

Change-Id: I7077d01536d5d7ca9e6865a0c169a2e0dcf34b6b
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
618627e88b517f56e932e1ec44042d21e34c5837 10-Feb-2017 Aurimas Liutikas <aurimas@google.com> Fix setLayoutDirection behavior for TabLayout.

There was a bug in Android before M that LinearLayout did not relayout
its children when the RtlProperties changed. It was fixed in LayoutManager
in ag/701717.

Bug: 34686900
Test: Now TabLayoutTest#setScrollPositionRtl passes.
Change-Id: Ib494e97ee482f6b221ad957518af8b4885e88d89
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
6c3fec5f2bc62c363c459b97bdd39d91631a93fc 08-Feb-2017 Jonathan Koren <jdkoren@google.com> resolve merge conflicts of 53118fb315 to master

Change-Id: Ia5991d8adef351e5791266b5f13fc59020afa5cc
86d6a88c4d98bf6f125d4a514004bdf86a2a215a 30-Jan-2017 Jonathan Koren <jdkoren@google.com> Fix TabLayout#setScrollPosition() in RTL

Bug: 34686900
Test: Added new test in TabLayoutTest

Change-Id: I2bdee71d55e8b68377124fc4d8a7b94a01a567ba
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
e337f69585dee67d926bba7558b6c35acc44aa54 19-Jan-2017 Vladislav Kaznacheev <kaznacheev@google.com> Rename View.setTooltip/getTooltip to setTooltipText/getTooltipText

Bug: 34454987
Test: Support7Demos -> Action Bar Usage
Change-Id: Idee511cabee413270ac6b4d2c76c328f51217836
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
ae7189188acb2bc972b08d9fbd59939f341c7829 06-Jan-2017 Aurimas Liutikas <aurimas@google.com> Move to using ValueAnimator directly instead of compat versions.

ValueAnimator can now be used directly given that our minSdk is 14.

Bug: 32794064
Test: ./gradlew clean assemble still works
Change-Id: Ibf0111b104eaea10acf33c8d54a3275fdfa0c1a4
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
daa85ce5c5aa5d44fabf6675ede7e7be55a79034 23-Nov-2016 Vladislav Kaznacheev <kaznacheev@google.com> Introduce ViewCompat.setTooltip

This calls View.setTooltip on API26+. The fallback
implementation is a Toast-based tooltip.

Use the new method in ActionMenuItemView,
MediaRouteButton, ScrollingTabContainerView and
TabLayout.

Bug: 31516506
Test: manual in Support7Demos and SupportDesignDemos
Change-Id: I23832a2fd5b589769225a0542c2a0ce4778e673c
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
e22ae93397361d1bd5568fa51d82e2f7553712e1 08-Dec-2016 Alan Viverette <alanv@google.com> Remove unnecessary @TargetApi annotations

Bug: 33412815
Test: ./gradlew assemble
Change-Id: I0be3358fb97d6e637357c253f3f43f39355a643a
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
8e10080c914d1ad0784394fa3026b85535535847 18-Nov-2016 Aurimas Liutikas <aurimas@google.com> Move from GROUP_ID to LIBRARY_GROUP annotations

- GROUP_ID was deprecated in favor of LIBRARY_GROUP.
- Fix import order in touched files.

Test: ./gradlew assemble assembleAndroidTest
Change-Id: I2a774e93215090f42262fb86cf8e841f2a546a4f
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
6efa7f23d91fb036b11b884b5122b3302b927c23 23-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement custom pointer icon for widgets in support lib"
155d8e15c8f1b959196c16555c54d19a5ccafe99 21-Sep-2016 Vladislav Kaznacheev <kaznacheev@google.com> Implement custom pointer icon for widgets in support lib

BottomNavigationItemView and TabLayout now display
PointerIcon.TYPE_HAND when hovered.

Bug: 31652293
Change-Id: I6cf4690f7cdf85eed04609c169f0b60bce044674
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
c39d9c75590eca86a5e7e32a8824ba04a0d42e9b 25-Aug-2016 Alan Viverette <alanv@google.com> Add @RestrictTo(GROUP_ID) annotations to match @hide docs annotations

Also removes some unnecessary @hide annotations on classes that wouldn't
have shown up in docs anyway due to package/private visibility or NO_DOCS.

Bug: 27937193
Change-Id: Iab127a5a3ce57a2d61965d3cef782621eb3859f5
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
96a3a5a841741fddc3773f35a22e31cded6bbdd8 06-Sep-2016 Aurimas Liutikas <aurimas@google.com> Remove all the extra accessor methods added by javac in support-design.
am: 657ea1100f

Change-Id: I762e3378d1c7e82139e9f04c3f750324ffd9851c
657ea1100fee4750f148f9d0dcb7e7e2028f105e 25-Aug-2016 Aurimas Liutikas <aurimas@google.com> Remove all the extra accessor methods added by javac in support-design.

Change private methods to be package protected to avoid extra methods
that get added to be able to access them from inner classes.

This CL saves 138 methods in our jar.

Bug: 31075707
Change-Id: I9ee192652fe005957e28ccfe35c9707be242aac1
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
ce079f97f27b75c934eebc177f2a7117137818a6 23-Aug-2016 Aurimas Liutikas <aurimas@google.com> Fix usages of deprecated methods in support-design code.
am: 7b75d53b8e

Change-Id: I7c4b8a3f05018caee611f15233b611ebaf2b7626
6ff96f58e00664a867b9f9e8e900ca190a82ebf4 23-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix usages of deprecated methods in support-design code." into nyc-mr1-dev
7b75d53b8e5584895595f801256a3d63bb68148a 23-Aug-2016 Aurimas Liutikas <aurimas@google.com> Fix usages of deprecated methods in support-design code.

Bug: 30074170
Bug: 31017538
Change-Id: Ib62709f853ca13db889d91688c30c97ee48fbe01
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
47082c30c630c34829439a9eecd1cf7e8d255a86 23-Aug-2016 Aurimas Liutikas <aurimas@google.com> Fix all usages of deprecated setBackgroundDrawable.

- Adds ViewCompat#setBackground that will call setBackgroundDrawable
or setBackground depending on the version.
- Replaced usages of setBackgroundDrawable with this ViewCompat version.

Bug: 30074170
Change-Id: I756c8558608da752acd6f3ca7121114d3cd1416a
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
0dcaf948ec9b788f47038876c4b8ff799df79dc6 15-Aug-2016 Aurimas Liutikas <aurimas@google.com> Stop sending OnTabSelectedListener calls with null tabs.
am: 32ae746bb6

Change-Id: I9ea902716d16c400eed624f8f531e79e0c018dd3
32ae746bb6f38afc8f346e993f1e5a816ea8edf8 13-Aug-2016 Aurimas Liutikas <aurimas@google.com> Stop sending OnTabSelectedListener calls with null tabs.

Bug: 30824831
Change-Id: Id24f740ec57b5bc9cc0b5a48f6bebf50059d4ef3
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
141f5ae472feb06dc6059f02cab9e88791d30449 04-Aug-2016 Alan Viverette <alanv@google.com> Ensure click sound effect plays when TabView is clicked

Bug: 30660965
Change-Id: I9f426e865c59ae489807cf3d0d7e86988dd2010a
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
1266ef17a626074fbd1cea8afdf0732528a87bb2 28-Jul-2016 Chris Banes <chrisbanes@google.com> Fix TabLayout flickering

Caused by I9bd2fb00daacaa07ff201a4d5f0b5c7f40cfab40,
we moved the setSelectedTabView() call outside of the
appropriate if branch.

BUG: 30456876
Change-Id: If6fe0dd4d14d59b2f82e2be30e9ba1f18e749233
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
c26cfaff58b502418b31f08399ac6a770bd0181c 20-Jul-2016 Chris Banes <chrisbanes@google.com> Add clearOnTabSelectedListeners() API

BUG: 30247930
Change-Id: I7553fe4a1c9f6a3712eb1345a0b08a99399d4516
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
5a0083cc8328f05b15efe0293b7aa83723cdd9ad 05-Jul-2016 Chris Banes <chrisbanes@google.com> Move FloatingActionButton shadow to use ValueAnimatorCompat

Moves us away from using the old custom Animation
code. Had to change some of the ValueAnimatorCompat
API, which is why this CL looks so large (it's not
really).

BUG: 29974832

Change-Id: I1f66565e0b2053556feccd746f72753ff027fc09
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
ed4b3d49f03292ccc92bef64f34116426aa1096f 28-Jun-2016 Chris Banes <chrisbanes@google.com> Fix TabLayout setSelection() issues with custom views

Also tidied up the addTab() logic so that we only
have one code path now.

Also moved all of TabLayoutTest to use @UiThreadTest

BUG: 29760031

Change-Id: I9bd2fb00daacaa07ff201a4d5f0b5c7f40cfab40
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
4c99f0e29b0926d8e5de44b7e3980d47f052f04c 24-Jun-2016 Chris Banes <chrisbanes@google.com> Add AppCompatResources.getDrawable()

This CL adds the new public method, which just
proxies to AppCompatDrawableManager for now. Also
moved all internal calls of
AppCompatDrawableManager.getDrawable() to the new method.

Looks like a huge commit, but it's mostly just moving
things to use the new method.

BUG: 29564497
Change-Id: Ie1603cc83d58333d70b90aefcfaf21fd367081ae
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
63305fa8581f5e5430df94ef23027409eb941a8d 23-Jun-2016 Aurimas Liutikas <aurimas@google.com> Add bounds check in TabLayout#getTabAt(int).

Added bound check prevents crashes when an app calls notifyDataSetChanged
on a PagerAdapter after items' position changes and ViewPager dispatches
onPageSelected to TabLayout. See details more detais in the bug.

Bug:
https://code.google.com/p/android/issues/detail?id=199514
https://code.google.com/p/android/issues/detail?id=213470

Change-Id: Ie04e6d3ce4b39566e5a378b056b33993db4783e2
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
db0eb650fb842982333c66d6ef3e982a0ec9f58d 04-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix TabLayout long click Toast placement" into nyc-dev
3be5f23bbe512ce9c4b073efbdcbac132a737787 27-Apr-2016 Chris Banes <chrisbanes@google.com> Fix TabLayout long click Toast placement

Logic copied over from ActionMenuItemView.

BUG: 28381728
Change-Id: Icd23c6aaf2a65e0704a8cfba6a2e3fb483f8cba7
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
8f27603fc4caa4931c98a97d4482b1b01bf4bd0f 04-Apr-2016 Chris Banes <chrisbanes@google.com> TabLayout + ViewPager improvements

- Add support for arbitrary decor views in ViewPager.
Previously it had a hidden marker interface, but now
we have a public class annotation.
- Made ViewPager's internal adapter change listener public
to enable decor views to receive any changes.
- TabLayout now supports being a decor view by automatically
setting itself if it has a ViewPager parent.

BUG: 27812405
Change-Id: Ia1a369f9401ee0108544a4aacc1461db3639cc80
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
dbc2b633f06747574b77a85ec662895c4ae6ccfc 12-Apr-2016 Ryan Lothian <rjlothian@google.com> Revert "TabLayout + ViewPager improvements"

This reverts commit 7555fd53f72cea589dec80f856dafaba5ecf99e8.

After ag/904114, builds of Android Wear crash loop on startup.

Bug: 28132794
Bug: 27812405
Change-Id: I85026dd8ab57dd268139e24037ad5a8544232935
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
7555fd53f72cea589dec80f856dafaba5ecf99e8 04-Apr-2016 Chris Banes <chrisbanes@google.com> TabLayout + ViewPager improvements

- Add support for arbitrary decor views in ViewPager.
Previously it had a hidden marker interface, but now
we just treat any view added via inflation as part of
the decor.
- Made ViewPager's internal adapter change listener public
to enable decor views to receive any changes.
- TabLayout now supports being a decor view by automatically
setting itself if it has a ViewPager parent.

BUG: 27812405
Change-Id: I7ebf2cd999b99285ed7367d6bf3436ad9a0f7355
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
27da60cbce61a72f4731cbe67071cbb87136d207 06-Apr-2016 Chris Banes <chrisbanes@google.com> Fix TabLayout text size issue

Some new measurement code in N seems to have
tickled a recursion exit check in TabLayout's
text size setting code when it's not required.

This CL fixes the check by checking against
the available space for the text, rather than
the existing Layout's width.

BUG: 27923340
Change-Id: I1be8c489488fc96fc3802b45c525b5fa6cae337d
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
6759b1021d8198ad1d239bb30e5a102b99624bce 25-Feb-2016 Adam Lesinski <adamlesinski@google.com> Build support libs with AAPT2

Use AAPT2 to build the framework support libraries. Apps built with AAPT2 can more efficiently
link against these libraries by specifying their module name in LOCAL_STATIC_ANDROID_LIBRARIES.

Ex:

LOCAL_STATIC_ANDROID_LIBRARIES := android-support-v7-appcompat android-support-v4

Apps built with AAPT2 do not need to specify --auto-add-overlay or --extra-packages, as these
are automatically added as needed by the build system.

This change will not affect any apps that currently depend on the support libraries.
This is because they import the resources directly.

We use LOCAL_JAR_EXCLUDE_FILES := none only to support javac when building javadoc.
Jack builds are correct because the build system passes in the latest generated R.java
ahead of any previous ones packaged in classes.jack. This means we can dynamically reference
a support lib module, correctly seeing non-final R.java. Then at app package time, we only
include the final R.java generated by the AAPT2 packaging step.

Bug:25958912
Change-Id: I6577a91e4d428dd29fecaa86a26be43d4da8310c
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
57f39186667b8acef1a0ebeda585c357a751a8b3 02-Apr-2016 Adam Lesinski <adamlesinski@google.com> Revert "Build support libs with AAPT2"

This reverts commit 66b8608151c5923de3c9877bc03218d83f6b3beb.

Change-Id: I2178c0336bef8386e1f36ff3816b6dbf1e6a64d0
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
66b8608151c5923de3c9877bc03218d83f6b3beb 25-Feb-2016 Adam Lesinski <adamlesinski@google.com> Build support libs with AAPT2

Use AAPT2 to build the framework support libraries. Apps built with AAPT2 can more efficiently
link against these libraries by specifying their module name in LOCAL_STATIC_ANDROID_LIBRARIES.

Ex:

LOCAL_STATIC_ANDROID_LIBRARIES := android-support-v7-appcompat android-support-v4

Apps built with AAPT2 do not need to specify --auto-add-overlay or --extra-packages, as these
are automatically added as needed by the build system.

This change will not affect any apps that currently depend on the support libraries.
This is because they import the resources directly.

We use LOCAL_JAR_EXCLUDE_FILES := none only to support javac when building javadoc.
Jack builds are correct because the build system passes in the latest generated R.java
ahead of any previous ones packaged in classes.jack. This means we can dynamically reference
a support lib module, correctly seeing non-final R.java. Then at app package time, we only
include the final R.java generated by the AAPT2 packaging step.

Bug:25958912
Change-Id: I5235b73ac68f2050d089aefc3163901ff80f2d46
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
4ac91fa3f14db2f25345595fb921497c11d4e5c0 31-Mar-2016 Adam Lesinski <adamlesinski@google.com> Revert "Build support libs with AAPT2"

This reverts commit 0dac8d82e2a249d7c9c42ab259389e11cac15400.

Change-Id: I830fb18162b6eea8dde9e38f9dc39b02449ec846
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
0dac8d82e2a249d7c9c42ab259389e11cac15400 25-Feb-2016 Adam Lesinski <adamlesinski@google.com> Build support libs with AAPT2

Use AAPT2 to build the framework support libraries. Apps built with AAPT2 can more efficiently
link against these libraries by specifying their module name in LOCAL_STATIC_ANDROID_LIBRARIES.

Ex:

LOCAL_STATIC_ANDROID_LIBRARIES := android-support-v7-appcompat android-support-v4

Apps built with AAPT2 do not need to specify --auto-add-overlay or --extra-packages, as these
are automatically added as needed by the build system.

This change will not affect any apps that currently depend on the support libraries.
This is because they import the resources directly.

We use LOCAL_JAR_EXCLUDE_FILES := none only to support javac when building javadoc.
Jack builds are correct because the build system passes in the latest generated R.java
ahead of any previous ones packaged in classes.jack. This means we can dynamically reference
a support lib module, correctly seeing non-final R.java. Then at app package time, we only
include the final R.java generated by the AAPT2 packaging step.

Bug:25958912
Change-Id: I71bff080ff2694aa3df1c8a67d933e2daab0f245
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
69992cb40e18789f4f406ffc94c4ebbd2bc274f7 16-Mar-2016 Kirill Grouchnikov <kirillg@google.com> Fix selection state for custom views on TabLayout

If Tab.setCustomView is called after TabLayout.addTab, we need
to explicitly propagate the selected state from the TabLayout to
the newly set custom view, mirroring the logic in
TabLayout.addTabView.

Also tweak a few test layouts for consistent attribute ordering
and indentation.

Bug: 27677664
Change-Id: I838092e787f9098e64004ebef3ae84ecbba774b9
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
3cbbf6cc4d8124ae40181b5ce38c7a89e749ff0f 09-Mar-2016 Chris Banes <chrisbanes@google.com> Add overload for setupWithViewPager()

Allows disabling of the new auto-refresh from
adapter changes.

BUG: 27477819
Change-Id: I61416c910bead2dd1b1aea50e8c4e63e91d3abca
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
6f9a84a7424c822c628fd0d7ebfaf6abf1656155 25-Feb-2016 Chris Banes <chrisbanes@google.com> Add add/remove methods for TabLayout's selection listener

Allows us to use an internal listener without fear of
an external developer wiping it out. Deprecated the
old set version.

BUG: 27351323
Change-Id: Iac693d1289327047d5529415e6f83f5c472a1499
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
84549395ed3e2ec0453f7349716a12eab9901703 26-Feb-2016 Chris Banes <chrisbanes@google.com> resolve merge conflicts of c16e4c6eec to nyc-dev

Change-Id: Ic309b7bbeb3c89e4e73f09b5806b566d004e0250
44a089034f93de72e5e3e65c90ae4494c37771ab 25-Feb-2016 Chris Banes <chrisbanes@google.com> Revert "Add add/remove methods for TabLayout's selection listener"

This reverts commit ee41c207d5acc4fbfa271afe0b32c6785997c66f.

Change-Id: Iadd7730e3eae714620f6f27e9ab157f5221323aa
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
ee41c207d5acc4fbfa271afe0b32c6785997c66f 25-Feb-2016 Chris Banes <chrisbanes@google.com> Add add/remove methods for TabLayout's selection listener

Allows us to use an internal listener without fear of
an external developer wiping it out. Deprecated the
old set version.

BUG: 27351323
Change-Id: Ibebddbbc3494b5c9bf8468b92b3fa470957a5554
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
50f777a07774d0f24529e2888fcba95744cb0be1 25-Feb-2016 Chris Banes <chrisbanes@google.com> Fix TabLayout's Tab pooling to actually work

Currently we do not reset the parent which mean that
a different TabLayout trying to use a pooled Tab
instance will blow up.

BUG: 27356169
Change-Id: I332ffaf06bce456b31a29d806df34354ab60d09f
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
b3ba94bf8b5cdae24e5a09a83813d72f2e2d8c1a 23-Feb-2016 Chris Banes <chrisbanes@google.com> Revert "Add default style attrs for design components"

This reverts commit 7e268c7de8bb10fc24ddda5d237d5cc5ce3b591b.

Change-Id: I5ba53003569cb7918fdaa550d36a697c86b2c282
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
7e268c7de8bb10fc24ddda5d237d5cc5ce3b591b 22-Feb-2016 Chris Banes <chrisbanes@google.com> Add default style attrs for design components

BUG: 27285523
Change-Id: Id19144f3fe58fe61ea132c2ca4fbf2cda5595277
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
617471b5d3c1465056c542de6343812cc6d6cd06 22-Feb-2016 Chris Banes <chrisbanes@google.com> Make TabLayout scroll to the current ViewPager page

Previously we were not reading scrolling to the
current page when setup.

BUG: 27258295
Change-Id: Id8a262feea2993973ae323e82cd86979e6b6a0f3
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
4cc50ca6952dcc35f1babd918742dbd09e3c01c7 05-Jan-2016 Chris Banes <chrisbanes@google.com> Allow TabLayout items to be added in a layout

Adds a new dummy view called TabItem which is just a
vehicle for reading attributes.

Also tidied up TabLayout's attribute javadoc

BUG: 19634570

Change-Id: Ia3a5e518bcf8266fb9fa800f062dd1dc6fe7214c
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
9c2232ee41f2db73648348e84cba637b892de617 11-Jan-2016 Chris Banes <chrisbanes@google.com> Guard against NPE in TabLayout

I can't recreate but it's a simple check and worth
doing anyway.

BUG: 26482513
Change-Id: Iaaaee0ff077152b4c859d51e44c7ec69d476e8fd
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
090d6780d4a901b258f33bcaa53014ca06744857 06-Jan-2016 Chris Banes <chrisbanes@google.com> Disable delay child pressed state propogation for Tabs

If the tabs can't scroll then we don't need to delay.

Change-Id: I452def4a572cb731b54a7f24d6ea2f3360c18956
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
c7f2aad754af4373c32fcab613de0ba164ada2a2 22-Dec-2015 Kirill Grouchnikov <kirillg@google.com> Third pass for testing TabLayout with ViewPager

Testing min and max tab title width under scrollable mode

Change-Id: I70abd29082a9f7ec3f1ee401eafeaa1cd7d83d2a
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
3a1aa2f92d0d07fac2364078b6c603a650ebbe0e 25-Nov-2015 Chris Banes <chrisbanes@google.com> Fix NPE in setCustomView() before addTab()

Fixed by moving the Tab's view creation to
within newTab(), ensuring that there is a View
and Context available for setCustomView().

Also fixed a memory leak due to our new view
pooling and a shared OnClickListener. Fixed by
moving our click handling to be within TabView.

BUG: 25855779

Change-Id: Iba104840933d88d7482fb758684286aa7922ea92
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
38cc44cffde90f6fe689b0df6b82f49481a981f7 03-Nov-2015 Chris Banes <chrisbanes@google.com> Add dynamic tab support to TabLayout

TabLayout will now automatically invalidate
and re-populate itself when the linked PagerAdapter
has it's data set changed.

Two objects Pools are used to minimize churn when the
adapter is updated.

A small change had to be made to ViewPager + PagerAdapter's
observing functionality. Observable will always dispatch
changed events in reverse added order, which means that
ViewPager is the last to know. This means that any later
added Observer can't update the ViewPager (since it
doesn't know about the data set change yet). This is fixed
by moving ViewPager's observer out of the Observable and
always calling it first.

BUG: 20908355

Change-Id: I631620ff186047ae57e928db78f5ca77a0b80306
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
3fbbd54cd1abc2a5471437949f907f2ecf99e946 02-Nov-2015 Chris Banes <chrisbanes@google.com> Fix Tab indicator animation glitch

Caused by a small timing issue where the ViewPager
is travelling over a large amount of items, therefore
the animation duration is longer then TabLayout's.

Fixed by tightening up TabLayout's handling of ViewPager's
states.

BUG: 25414410
Change-Id: I8192085ea33164983796b84f8c02c8a1e78f9690
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
4172f25e47c484612b50143da44878003db238d1 27-Oct-2015 Chris Banes <chrisbanes@google.com> Fix Tabs not filling correctly in FIXED mode

Caused by using the wrong measure spec mode.

BUG: 25296491
Change-Id: I0cc508feb159abe1659072f27d3b4f53565f68b9
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
66698bb15ba0f873aa1c2290cc50d6bb839a474a 26-Oct-2015 Chris Banes <chrisbanes@google.com> Flatten AppCompat class hierarchy

This allows us to do two things:

1) Move away from using public @hidden classes
everywhere.
2) Workaround silly OEM bugs.

BUG: 18218511

Change-Id: I7582e242c7564c32feeb044fc9eff6bfb5c56536
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
b8459a8c30dbaf3c8b82eb3b5d5eaed5526daded 20-Oct-2015 Chris Banes <chrisbanes@google.com> Make sure we inflate custom Tab views correctly

We were previously not inflating against the parent
view, resulting in the layout's LayoutParams being
dropped.

BUG: 25103360
Change-Id: Ieae0b254399ce26183ccce856030c4e9d301e7ed
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
7e4e8b664820f773bc96e37ee1d2bbf500d64e69 12-Oct-2015 Chris Banes <chrisbanes@google.com> Add AppCompatDrawableManager

Refactored from TintManager, AppCompatDrawableManager
is now architectured differently. It is now a singleton
which keeps multi-map of cached tints.

This is to enable the new InflateDelegate extension point,
which will allows libraries (and eventually apps) to hook
into the compat drawable inflation.

While this CL looks large, it's mostly just updating method
calls to match the new parameters.

BUG: 24852773

Change-Id: Ic9f5ecc6fd0208d2f7a8a686f077f16588020516
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
092bd179f5a24c29a63717ce69c6d4065e33abe6 05-Oct-2015 Chris Banes <chrisbanes@google.com> Fix TabLayout crashing due to using getMaxLines()

Added a compatible shim to TextViewCompat

BUG: 24663522
Change-Id: I6ba367338a6c42ecad175c5ebe0163c3dc5a9cd2
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
1eb1857ff5ccb41f61e71c23a2f2ba91188b268f 15-Sep-2015 Chris Banes <chrisbanes@google.com> Merge "Stop calling onTabReselected on tab clicks" into mnc-ub-dev
289c3d98a7dc9525dbb47b1432f11d4f84cb7fd6 14-Sep-2015 Chris Banes <chrisbanes@google.com> Stop calling onTabReselected on tab clicks

When a Tab is clicked then TabLayout will automatically
call onTabUnselected/selected. It then calls setCurrentItem()
on the VP, meaning that onTabReselected is dispatched.

BUG: 24047129
Change-Id: Ie4f713498f3f12c760244e3c7c5dc3c1a43f8831
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
854d6b89f46fb2877c009eaa80394b8c8079f7ee 07-Sep-2015 Chris Banes <chrisbanes@google.com> Fix TabLayout's flickering for good

The problem is due us not handling ViewPager's
page change listeners correctly. onPageSelected() can
be called while the ViewPager is still mostly in the
previous page. This means that the next onPageScrolled()
int will not match the selected page.

The fix is to skip updating the selected text, like we already
do with the indicator.

BUG: 22709728
Change-Id: Ic17a136b3352ae5c620f4295f852d5f9e5a53f92
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
9c1a007db43f0b5a5db6dee449486279309fed86 18-Aug-2015 Chris Banes <chrisbanes@google.com> Merge "TabLayout measure performance improvements" into mnc-ub-dev
cb37b09ebbc5e8e9c7c6c65211686d61e2ed3a3f 11-Aug-2015 Chris Banes <chrisbanes@google.com> TabLayout measure performance improvements

- Disable the framework fillViewport functionality
and we do it ourselves instead. This allows us
to remove multiple unnecessary measure passes.
- Use the available space for max tab width calculation
- Actually honor the scrollable tab min width (this
wasn't working before).

BUG: 23173903

Change-Id: I7dd2c9219dedf930e533207dad9444553b040447
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
14113e918762c4319dfde99e5b87873deeda9f03 18-Aug-2015 Chris Banes <chrisbanes@google.com> Revert TabLayoutOnPageChangeListener change

BUG: 23304024
Change-Id: I31d465996410d172ba8927af5a15edc456ee4e69
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
c3a5ae275653ae325d0cb5428f4a3aa071aa467b 30-Jun-2015 Chris Banes <chrisbanes@google.com> Update TabLayout to Material Spec

- Tabs + Icons are now vertically aligned
- Text size is updated based on multi-line

BUG: 22964033

Change-Id: Iee4e5ab5a78d02884fd507a5c889b0d99a317de8
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
3d176d204e7e671b68ec4051c578c9a48068c422 07-Aug-2015 Chris Banes <chrisbanes@google.com> Merge "Fix tab indicator getting out of sync" into mnc-ub-dev
809bb62055ad42b88f3a69308be222801b89fbd9 07-Aug-2015 Chris Banes <chrisbanes@google.com> Add more helpful exception to design components

If a developer doesn't use a AppCompat theme, bad
things happen with the design lib. This CL adds
an explicit check with a helpful error message.

Change-Id: I60c81ed87057fa75b38e26bf8c4b1edbc9ff7a3f
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
ba2a96aaf54f6fc755856ef05a3c967a5f000b82 06-Aug-2015 Chris Banes <chrisbanes@google.com> Fix tab indicator getting out of sync

Caused when the indicator is animating to a
position, but a re-layout happens during the
animation moving the target position.

BUG: 23004032
Change-Id: If9ab0f7e6ea088b28ceca7666a8fde40d5e715e2
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
09db0f00a693704eb747027def4279362c51894e 21-Jul-2015 Chris Banes <chrisbanes@google.com> TabLayout improvements + fixes

- Fix NPE when it's given an empty PagerAdapter
- Fix onTabReselected() being called at the wrong time
- Fix text flickering when used with ViewPager
- Fix wobbling indicator
- Optimized setSelectedTabView method

BUG: 22625805
BUG: 22709585
BUG: 22709728
BUG: 22711100

Change-Id: Ic8691c55f539707466928662a8d9a7acfbcbe92a
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
a577676a64e5353b8ec927117151aa6be84adf66 23-Jun-2015 Chris Banes <chrisbanes@google.com> Prefix design lib resources to try and avoid conflicts

BUG: 21363917
Change-Id: I770a01618ac8fefae6d82d1640ccf313111e38e8
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
21f887ec48f1e9780a69833723e1fba64e7557c5 22-Jun-2015 Chris Banes <chrisbanes@google.com> Make Tab#getCustomView() public

BUG: 21989932
Change-Id: Iee65d3b3f4ca344d54a5631ab214582e7e74f61e
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
d67a60744b4a713ca37e219e349b55743a39272a 18-Jun-2015 Chris Banes <chrisbanes@google.com> Fix TabLayout when used in a HorizontalScrollView

It's not an intended use case, but it does show up
some problems with TabLayout's measure code when
it's given an UNSPECIFIED measure spec. This CL
fixes TabLayout so that it measures itself correctly.

BUG: 21913808
Change-Id: I1674f3da1da334543c943ab3b7aa9d1920f325b6
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
442f2c89dbee247e70b6b82af92ce662b3880afd 15-Jun-2015 Chris Banes <chrisbanes@google.com> Move the Tab Indicator higher up the draw call stack

Allows us to always draw above the TabView children

BUG: 21842796
Change-Id: I6a3d6a90aeaf7a2263a3cd3a612f99f1ec28ed0c
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
fa591aab28de2eacabc23b4ce26791ea6f5a20b6 15-Jun-2015 Chris Banes <chrisbanes@google.com> Merge "Add APIs to TabLayout to get selected tab position" into lmp-mr1-ub-dev
fe2bbcd84ea174f75852c4c12b1eab782dd80a24 12-Jun-2015 Chris Banes <chrisbanes@google.com> Merge "Simplify tab min/max width measure code" into lmp-mr1-ub-dev
35ee849e74452227047987c4eb2355b8a61b0505 12-Jun-2015 Chris Banes <chrisbanes@google.com> Simplify tab min/max width measure code

Allows us to fix some states when both the min and max are set,
but are not both taken into account.

Change-Id: I7b1edaed29a4cef992b32e85ca61ba1501c15120
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
1a2ccecaf4ea84b1a9ecadb0bdba6d99a4935abb 12-Jun-2015 Chris Banes <chrisbanes@google.com> Add APIs to TabLayout to get selected tab position

BUG: 21796426
Change-Id: I6570a224780a37924576f62a9967cd4d8654fbb0
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
15ed6a51e94cf108c3e5043d13e02c634c44faae 12-Jun-2015 Chris Banes <chrisbanes@google.com> Fix Tab click not updating the visible selected Tab

BUG: 21795536
Change-Id: Ie51ecc29bce4ff0f9a84b9fa1e64556b2b8a2f92
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
40fc642141f4ee9ce0763febe67dc258eed04a2b 08-Jun-2015 Chris Banes <chrisbanes@google.com> Make TabLayout more customizable

We now try to find a suitable TextView and ImageView
from the provided custom view.

The text and icon views are now also loaded from
resources, which allows external apps to hook
into the LayoutInflater to style them.

I also went crazy with the new support annotations.

BUG: 21689777

Change-Id: I4026d0cb451f82119a8f8a4ca6c265ed50432bac
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
26389612704e87706994079597ad4b66b9c249e3 04-Jun-2015 Chris Banes <chrisbanes@google.com> Merge "Ensure TabLayout + ViewPager selected item are in sync" into lmp-mr1-ub-dev
84a51515c4b2d8b7b8dd619e158589c78048adf9 31-May-2015 Chris Banes <chrisbanes@google.com> Allow setting the Tab Indicator at runtime

BUG: 21538661

Change-Id: I296857a3ba445e40a10848de24c71e437b2c5998
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
112f648090b48c0d00a51983baf148dbbc800abb 31-May-2015 Chris Banes <chrisbanes@google.com> Ensure TabLayout + ViewPager selected item are in sync

BUG: 21539668
Change-Id: I3d472ca8b151af8b8cf56a0e9a9cbcad38bced97
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
82042243a3592851e3ce5aefaa2b784210499ac8 30-May-2015 Chris Banes <chrisbanes@google.com> Make sure we always use the provide Tab text colors

BUG: 21527183
Change-Id: I36375ad94777de19828c5e2f6b5af59e57e541ac
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
bd085f17cd76603445c1befc020495f7d9dd00d6 22-May-2015 Chris Banes <chrisbanes@google.com> More TabLayout fixes

- Respect top/bottom padding
- Fix jank caused by checking wrong animator
- Only proxy ViewPager page selected events when
it isn't being dragged (or settling).
- Restore selection properly after a nuke +
layout.

BUG: 21373757
BUG: 21375601

Change-Id: If897051ae15a151bf11df0b4dd50a87086c5ec88
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
a4d0ea328b382109435bcfea115d9c41e750af19 21-May-2015 Chris Banes <chrisbanes@google.com> Fix flickering with TabLayout + ViewPager

BUG: 21359788
Change-Id: I4baa7104c6f1df90a5cbf5d6e858261dd9943bb6
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
9fb154338a62edc2c57dc036895199d6f1769400 18-May-2015 Chris Banes <chrisbanes@google.com> Some design lib doc improvements

Change-Id: I0207a11d830d180defacd11c777e6768363cf31b
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
745636602593f0b8ae508eb10266a3c7c675e746 07-May-2015 Chris Banes <chrisbanes@google.com> Tidy up TabLayout + ViewPager integration

Also added the ability to add/remove OnPageChangeListeners
to ViewPager.

BUG: 20897298
Change-Id: I51ec2117a1f49aab15f7ed1a30960330fa00c317
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
92a2d7b7f62472a768e62f66681c0e1841cd57ba 08-May-2015 Dan Albert <danalbert@google.com> Revert "Tidy up TabLayout + ViewPager integration"

Build is still broken in other projects, so reverting for now.

This reverts commit 40f27ea67cb42ab88020275f63cc600fcc42adcb.

Change-Id: I94a6335d10390697e81cba177c9e059b616fedf9
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
40f27ea67cb42ab88020275f63cc600fcc42adcb 07-May-2015 Chris Banes <chrisbanes@google.com> Tidy up TabLayout + ViewPager integration

Also added the ability to add/remove OnPageChangeListeners
to ViewPager.

BUG: 20897298

Change-Id: I7d944d2ebcd169c5c084000bd17f20da5c60e7ea
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
5023ec9783e8677de949d2f925a998ff9643b4f2 01-May-2015 Chris Banes <chrisbanes@google.com> Merge "Revert "Fix tab blinking while fling"" into lmp-mr1-ub-dev
ac571281c28a7bcf2937acac3bc47bf224178f0f 01-May-2015 Chris Banes <chrisbanes@google.com> Revert "Fix tab blinking while fling"

This reverts commit 81fdc55233cee968c50c1d24e14fbd26b1016648.

Change-Id: I3be7a0ef90e75fcb39c27741ce2d2de1e3d72ea9
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
45cbb1d10c865209f373a148556191700d8ea345 29-Apr-2015 Chris Banes <chrisbanes@google.com> TabLayout text color handling improvements

We now accept ColorStateLists via app:tabTextColor.

Change-Id: If234a61983b1fd6ddc8509092f39522b63aecb32
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
81fdc55233cee968c50c1d24e14fbd26b1016648 29-Apr-2015 Alan Jeon <skyisle@gmail.com> Fix tab blinking while fling

When fling start, onPageSelected called and onPageScrolled called
subsequently. This CL fixes tab blinkig in this situation.

Change-Id: Ice6a8b43b8e5ddb0d9824e66d48124b1f3691d4a
Signed-off-by: Alan Jeon <skyisle@gmail.com>
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
149689d3a0b4165577470d7152112674d1d7f87c 28-Apr-2015 Chris Banes <chrisbanes@google.com> Fix design lib's attribute doc references

BUG: 20524332
Change-Id: I6dece9ec425acb3305efd0800d2f5d4f15d0aad2
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
d70e8e024a94ca0f4c3a1e0ce8a456773393a071 23-Apr-2015 Chris Banes <chrisbanes@google.com> Merge "Use the internal ValueAnimatorCompat in other widgets" into lmp-mr1-ub-dev
86568f1f241c4e9a07383cda799b96c7880c5082 22-Apr-2015 Yuichi Araki <yaraki@google.com> Content description for tabs in TabLayout

A specified content description is used for TextView as well as
ImageView (icon) of a tab.

Change-Id: Ieabea34681f1d6341799e8221629f94aa9cebf1b
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
f44e88b81821e61a65886cc7027617ca8995070b 21-Apr-2015 Chris Banes <chrisbanes@google.com> Use the internal ValueAnimatorCompat in other widgets

Allows us to move away from our hack with view animations.

Change-Id: I7d38bf26ce2715d681c75b1a22efeef245269841
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
c6ff5383d5db2613f0c7325825434300cc2697cc 21-Apr-2015 Chris Banes <chrisbanes@google.com> am f0f36370: Merge "Re-measure tab width after max width is decided"

* commit 'f0f363707e53c83688ee66a029885685de398dd0':
Re-measure tab width after max width is decided
7c71281dc4879e7889c65283aabaeed68521fb14 21-Apr-2015 Alan Jeon <skyisle@gmail.com> Re-measure tab width after max width is decided

Tabview's onMeasure can be called before mTabMaxWidth is decided.

Change-Id: I063f31232041bc6d8447756df9689f824a199019
Signed-off-by: Alan Jeon <skyisle@gmail.com>
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
b7f9224b1495db47eb8fd813b5912250e900770a 09-Jan-2015 Chris Banes <chrisbanes@google.com> Snackbar

Also added a new default swipe-to-dismiss behavior
and hooked it up. Also hooked up the Snackbar
to the Floating Action Buttons.

Change-Id: I717d4db5d34b6c17a2afabe5a3bc2c79fcee4233
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
f4e0b1dddb77f8be3e61529fbaeb60655b539121 12-Mar-2015 Chris Banes <chrisbanes@google.com> Merge "TextInputLayout - a wrapper around EditText" into lmp-mr1-ub-dev
c5b63021dfda1dd155775a0b4845c5ca3c70b1b0 07-Feb-2015 Chris Banes <chrisbanes@google.com> TextInputLayout - a wrapper around EditText

Currently it implements the floating label
pattern and error message handling.

Change-Id: I65132d06e0eef71f671594c3bb39633e9f89a0da
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
ccfefa26b718c232ec8e3095e05dab75b963f918 12-Mar-2015 Chris Banes <chrisbanes@google.com> Don't update selected state as we settle from a scroll

BUG: 19690332
Change-Id: Ifbd21f3c463d9b7d541e9aafacd06a605386c754
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
2cccf609662389d6a23dbc0711d5fb2e826e8c63 18-Feb-2015 Chris Banes <chrisbanes@google.com> Rename and move all of the tint widgets

They're public so shouldn't live in the internal package.
I've also stopped setting the setting the platform widget styles
(e.g. android:editTextStyle) and instead provide our own versions.
On Lollipop, we set these the default framework styles.

This fixes the times where the framework widgets are used but with
the untinted material style (e.g. Preferences).

BUG: 19407610
BUG: 19300319

Change-Id: I5dbdee240cbf28d4dc9b05f5c56b386d83b18df3
/frameworks/support/design/src/android/support/design/widget/TabLayout.java
320c3e9fe1e100a5a7cda5dd217d2d1152d08b3f 28-Jan-2015 Chris Banes <chrisbanes@google.com> New TabLayout

Change-Id: If8a0720ab759b80bcfce7fad645e5b2a8d6e7c3a
/frameworks/support/design/src/android/support/design/widget/TabLayout.java