137 Commits

Author SHA1 Message Date
afohrman
73cb135c15 Update vertical motion for TextInputLayout's error text.
Motion additions/updates in this change:
- Added animation for error text's translation down
- Updated durations and interpolators for the opacity in and out animations

These changes roll forward changes that were previously rolled back because they broke screenshot tests.

PiperOrigin-RevId: 158881906
2017-06-14 16:38:11 -07:00
travisc
06b88e84ad Remove the split base/ics/lollipop directories.
The implementation in ics/ was the only remaining implementation of that class,
so it made sense to move it directly into src/. Most of the implementations in
base/ were the only remaining implementations, and thus also made sense to move
into src/.

The remaining classes were already post-fixed with Lollipop, so I see very
little value in maintaining separate source directories for them (and I know
these separate directories have also been flagged as confusing). They've all
been moved into src/ as well now. I also renamed FloatingActionButtonLollipop
to FloatingActionButtonImplLollipop here, as that better describes what it is
a version of.

PiperOrigin-RevId: 158187999
2017-06-14 16:37:39 -07:00
afohrman
94947cde8a Broke some screenshot tests.
PiperOrigin-RevId: 157239931
2017-06-14 16:33:59 -07:00
afohrman
63acb542ed Update motion for TextInputLayout's error state.
Motion additions/updates in this change:
- Added animation for error text's translation down
- Updated durations and interpolators for the opacity in and out animations

PiperOrigin-RevId: 157220100
2017-06-14 16:32:30 -07:00
gauthams
60549808c5 Fix divide-by-zero crash when building BottomNavigationMenu with <2 children and shifting mode enabled.
PiperOrigin-RevId: 156888556
2017-05-24 16:37:07 -07:00
gauthams
c8052c3e2f Modify setShiftingMode() in BottomNavigationItemView to call setChecked() if the item view has already been initialized, so that shifting mode changes are immediately visible without having to re-initialize the view.
Also setting shifting mode before initializing view in BottomNavigationMenuView's updateMenu(), for consistency with buildMenu().

PiperOrigin-RevId: 156800545
2017-05-24 16:36:29 -07:00
afohrman
78eb50a405 Update motion for TextInputLayout's active state.
Motion updates in this change:
- Shortened the duration for the label scale
- Changed the interpolators from linear to FastOutSlowIn

PiperOrigin-RevId: 156553820
2017-05-24 16:35:55 -07:00
miguely
644139fb99 Add a BackLayerLayout and BackLayerSiblingBehavior + tests.
These are the foundation for the back layer functionality. The behavior
does the heavy lifting to measure the adjacent content view.

As of now this only lays out the views correctly in the hidden state, it doesn't support exposing the back layer at all, yet. Full of TODOs, this is just a skeleton.

PiperOrigin-RevId: 156334640
2017-05-24 16:33:21 -07:00
gauthams
08c783554a Update documentation for methods to set and get shifting mode on BottomNavigationView
PiperOrigin-RevId: 156251192
2017-05-24 16:31:55 -07:00
gauthams
eb96b9a358 Fix crash in BottomNavigationMenuView when updateMenuView is called while mMenu or mButtons is null
PiperOrigin-RevId: 156243521
2017-05-16 16:03:49 -07:00
gauthams
8493677be9 Add option to disable shifting mode even on BottomNavigationViews with 3+ children
Fixes #22.

PiperOrigin-RevId: 156126715
2017-05-16 16:02:31 -07:00
gauthams
32b1f744e4 Update BottomNavigationView onMeasure to properly measure with invisible children
PiperOrigin-RevId: 155899080
2017-05-12 13:18:19 -07:00
gauthams
71c3e81905 Don't skip adding non-visible children in BottomNavigationView to avoid NPE when accessing those
PiperOrigin-RevId: 155893998
2017-05-12 13:18:02 -07:00
gauthams
d15d791fb7 Fix NPE on bottom nav menu update, and add test for this case.
PiperOrigin-RevId: 155776319
2017-05-11 13:00:34 -07:00
gauthams
e442abe704 Tweak animation for bottom nav hiding behavior
PiperOrigin-RevId: 155563392
2017-05-09 17:20:07 -07:00
gauthams
7957a2d8aa Update shifting BottomNavigationView behavior to size active view width based on label size, rather than defaulting to maxWidth.
PiperOrigin-RevId: 155252923
2017-05-05 16:44:28 -07:00
gauthams
81573c4357 BottomNavigationView menu item visibility can now be set using setVisible
PiperOrigin-RevId: 155120882
2017-05-05 16:41:10 -07:00
gauthams
0d29fa6a89 Add default scrolling behavior to BottomNavigationView
PiperOrigin-RevId: 155029168
2017-05-05 16:38:46 -07:00
travisc
cbf9a71966 Use split support v4 libraries rather than pulling in the whole thing.
PiperOrigin-RevId: 154330449
2017-04-26 13:00:00 -07:00
travisc
2994b30524 Revert to using LIBRARY_GROUP restriction now that we don't need to build against older support libraries.
PiperOrigin-RevId: 154328482
2017-04-26 12:59:27 -07:00
dcarlsson
f37a53e9b6 Move component documentation under docs/ root.
PiperOrigin-RevId: 153763840
2017-04-24 16:14:48 -07:00
shyndman
574570c18d Introduces a root directory for component docs (/catalog).
PiperOrigin-RevId: 153757510
2017-04-21 14:00:48 -07:00
Material Design Team
678cb61a4c textColorError can also be a reference
Aligns with Support Library changes in 26.0.0.

PiperOrigin-RevId: 153749146
2017-04-21 14:00:29 -07:00
travisc
5f8bb4c8a1 Bump versions to 25.3.1.
This also bumps up the build tools + Android gradle plugin version, since these
were out of date, and removes a couple unused version values.

PiperOrigin-RevId: 153652782
2017-04-19 16:56:46 -07:00
shyndman
0ae2ee1f28 Adds documentation skeletons for material.io/components/android.
To be used by the documentation generator here:
https://github.com/material-components/material-components-site-generator

Component documentation lives alongside the source code. I've scavenged what I could from the other platforms to get us started.

PiperOrigin-RevId: 153501710
2017-04-18 15:26:27 -07:00
Chris Banes
c1506d4568 Fix CollapsingToolbarLayout height when wrap_content
If there is a top window inset we need to make sure
that we expand our height to allow the Toolbar
to be offset.

BUG: 36126318
Test: included
Change-Id: I179fc6764166d80d92a8a995c93d54650365c2bf
PiperOrigin-RevId: 152452065
2017-04-12 17:43:05 -07:00
Alan Viverette
cbdbf8d7c3 Re-enable lint enforcement, fix remaining lint issues
Bug: 29630077
Test: ./gradlew lint
Change-Id: Ied1e4b1c33ba158d6bfab5439497ee4fc8284a8f
PiperOrigin-RevId: 152441310
2017-04-12 17:42:51 -07:00
Alan Viverette
3fd154ffd9 Clean up files left over from old SDK build
Test: make sdk
Change-Id: I3721857fc7af654506b2302229149598b073d3bc
PiperOrigin-RevId: 152414734
2017-04-12 17:40:30 -07:00
Aurimas Liutikas
65acdeaf1b Remove unused class AnimationListenerAdapter.
Test: None
Change-Id: Ib700d13a8288e28f258444bc5f7882dc6c1d2d6c
PiperOrigin-RevId: 152302963
2017-04-12 17:39:45 -07:00
Aurimas Liutikas
6a7f232192 A pass at fixing unchecked javac warnings.
Add types where needed.

Test: ./gradlew assemble still works
Change-Id: If1350e896948c7e27c212cf7b1a94f08b9131193
PiperOrigin-RevId: 152295095
2017-04-12 17:39:28 -07:00
Aurimas Liutikas
7a8955e1b5 Add all missing @Override annotations.
Historically, we could not add @Override for certain methods due to
using older SDKs to build support library. That is no longer the case
so we can add @Override everywhere now.

Test: ./gradlew assemble assembleAndroidTest still works
Change-Id: I85e3c1157f0e253e3eab7584189f3bf95cf030e9
PiperOrigin-RevId: 152290260
2017-04-12 17:39:11 -07:00
Aurimas Liutikas
682c45cbd3 Clean up ParcelableCompat after minSdk 14 bump.
Bug: 32794064
Test: ./gradlew assemble
Change-Id: I87d35d527e80d55ac4a2a626a6040fcdaff63ae3
PiperOrigin-RevId: 152212864
2017-04-12 17:38:28 -07:00
Aurimas Liutikas
d9a2a442ee Remove usages of ScrollerCompat after minSdk 14 bump.
ScrollerCompat can be completely replaced by OverScroller that was
added in API14 which ScrollerCompat wraps.

Bug: 32794064
Test: ./gradlew assemble
Change-Id: Ice79dd122b00e1b3c92dea3a95446ac897135a84
PiperOrigin-RevId: 152204128
2017-04-12 17:38:10 -07:00
Aurimas Liutikas
43ec3dd052 Remove usage of MotionEventCompat methods.
We bumped our minSdk to 14 and now most of MotionEventCompat methods and
constants are no longer needed.

Bug: 32794064
Test: ./gradlew assemble assembleAndroidTest
Change-Id: I5fc698fc8243107cd969743b7500163818f8c258
PiperOrigin-RevId: 152201817
2017-04-12 17:37:17 -07:00
Geoffrey Métais
f0b3b462ee Prevent potential NPE
Ignore scroll events if mNestedScrollingChildRef is not set yet.
It happens if BottomSheetBehavior view is inflated from a ViewStub for
example, input events can arrive too soon.

bug: https://code.google.com/p/android/issues/detail?id=232646
Test: nullity check, existing unit tests still pass.
Change-Id: I0535a63ed834d64fcbf20dd8b268d109232c5077
PiperOrigin-RevId: 152195381
2017-04-12 17:36:54 -07:00
Aurimas Liutikas
465ea656d0 Clean up usage of ConfigurationHelper.
Bug: 32794064
Test: ./gradlew assemble
Change-Id: I7b92c5a6d846336c22b893fe228521bed239e337
PiperOrigin-RevId: 152181216
2017-04-12 17:36:41 -07:00
Aurimas Liutikas
70cff08266 Remove usages of methods in VelocityTrackerCompat that got added before API 14.
Bug: 32794064
Test: ./gradlew assemble still works.
Change-Id: Ia805a39aeebce9ff69278836c6dad55218b8b2d5
PiperOrigin-RevId: 152179324
2017-04-12 17:33:31 -07:00
Aurimas Liutikas
8428f09805 Remove ViewCompat method usages for things that were added in API 11.
Bug: 32794064
Test: ./gradlew assemble assembleAndroidTest still works
Change-Id: I18fb0cc1ebc67c911eeb30aada7b8315afc15835
PiperOrigin-RevId: 152030798
2017-04-12 17:31:18 -07:00
Kassim Maguire
45120e4f07 Use enabled scrolling child in BottomSheetBehavior
Modification of findScrollingChild() that only returns a view if
it has nested scrolling enabled (instead of just implementing
NestedScrollingChild). As to prevent an incorrect view being
referrenced, leading to incorrect behavior when scrolling.

Test: added BottomSheetBehaviorTest.testFindScrollingChildEnabled()
that tests that an enabled NestedScrollView contained within a disabled
NestedScrollView parent is returned by findScrollingChild(parent)
Change-Id: I9841db9c67520f858913a5109dc08ffed9e53568
PiperOrigin-RevId: 151889793
2017-04-12 17:26:05 -07:00
Aurimas Liutikas
eda6419b17 Cleanup FloatingActionButton code to remove unneeded code.
Remove code that is no longer needed since minSdk for support library is API
14.
This code collapses FloatingActionButtonImpl, FloatingActionButtonGingerbread
and FloatingActionButtonIcs into one class.

Bug: 32794064
Test: ./gradlew clean assemble still works
Change-Id: Id20c0d1807e08ab11ece63883debe2682cfa815f
PiperOrigin-RevId: 151874300
2017-04-12 17:25:18 -07:00
Aurimas Liutikas
9d9d667e46 Simplify ViewGroupUtils code.
We can delete the different pre API 11 implementation since now
minSdk for support library is API 14.

Bug: 32794064
Test: ./gradlew clean assemble still works
Change-Id: I6ada8869060539b1a5fd7039a343bad766c5aced
PiperOrigin-RevId: 151872595
2017-04-12 17:23:15 -07:00
Aurimas Liutikas
f02b42594b Move to using Transitions directly for BottomNavigationView.
Since our minsdk is now 14 we can use support transitions apis directly
from BottomNavigationView.

Bug: 32794064
Test: ./gradlew clean assemble still works
Change-Id: Ic9372da05c7ebba59f9a37926ab81f4138f967a2
PiperOrigin-RevId: 151644244
2017-04-12 17:22:50 -07:00
Aurimas Liutikas
d32ba949a8 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
PiperOrigin-RevId: 151641145
2017-04-12 17:22:06 -07:00
Aurimas Liutikas
96436e4d8d Bump minSdkVersion to API 14.
First step in moving minSdkVersion to API 14 for design library.

Bug: 32794064
Test: gradlew clean assemble assembleAndroidTest still works
Change-Id: I113834cc6e3c088cdf606a86fe7a35faa192b801
PiperOrigin-RevId: 151608161
2017-04-12 17:21:22 -07:00
travisc
84e5eb6527 Fix lint error that was breaking the build on Travis.
PiperOrigin-RevId: 150213396
2017-03-15 11:07:39 -07:00
travisc
1f58c9f2c3 Bump version to 25.3.0.
PiperOrigin-RevId: 150135802
2017-03-14 17:35:07 -07:00
Aurimas Liutikas
ce8442831d Fix BottomNavigationView label animation.
In ag/1820194 we broke this by moving beginDelayedTransition to after
the layout params and scale are set causing it to no longer animate
the text label.

Bug: 36074994
Test: Unable to come up with good automated test. Tested manually - text labels no longer jump
Change-Id: I6bcc988dfd8b2b38360c68fdb6634fcb60c00a2f

PiperOrigin-RevId: 150134808
2017-03-14 17:34:54 -07:00
travisc
395a258bc7 Bump version to 25.2.0.
PiperOrigin-RevId: 150132393
2017-03-14 17:34:29 -07:00
Kirill Grouchnikov
5d84aba7fc Remove unnecessary null check
If that variable is null, it would crash in the previous line

Bug: 34129526
Test: run a few design lib tests
Change-Id: Ic403d4ccf79899f4d2978856fbb02ffc65de0f3f

PiperOrigin-RevId: 150132347
2017-03-14 17:34:18 -07:00
Jonathan Koren
3bd7fdf7c1 Make bottom navigation item pool non-static
This also fixes a flaky test where items acquired from the pool were
still attached to their old parent.

Bug: 35422793
Bug: 35395583
Change-Id: I303d49bb4a287856baf997bd85d42fd53131c32b

PiperOrigin-RevId: 150129729
2017-03-14 17:34:06 -07:00