This also moves expandable and transformation into their own packages, as was originally intended (but they had resources, which was problematic at that time). CoordinatorLayout has been moved out of the typical source root to ease its later deletion (when it has made it into core-ui).
PiperOrigin-RevId: 180728823
There was a bug in the way the dependency graph was filled on the first
measure/layout pass. We iterated over all child views and for each child
A we iterated every other child and for each other child B we checked if
B depends on A and if so, we added an edge A->B to the dependency graph.
For anchors, on the first run, each child's LayoutParams only have info
about its anchorId and not the anchor view itself. This is resolved by
calling LayoutParams.findAnchorView(). Until this call, checking
LayoutParams.dependsOn() returns false. In current implementation we
only called findAnchorView() for child A, but then we checked
dependsOn() for child B.
This fixes this issue with inverting the check, so we check if A depends
on B and if it does, we add an edge B->A to the dependency graph.
Bug: 31622224
Test: Added CoordinatorLayoutTest.testAnchorDependencyGraph() test case
that fails without this fix.
Change-Id: Idcdf82031cce02340b2733aad1e30feb6f9359bb
PiperOrigin-RevId: 177204145
Also refactor one of the existing tests to use activity
recreation instead of orientation change (which is not as
reliable)
Bug: 37930078
Bug: 35368213
Test: ./gradlew support-design:connectedCheck --info --daemon
-Pandroid.testInstrumentationRunnerArguments.package=android.support.design.widget
Change-Id: I1b9165fb11e03b9c855e118f31dee27e7dac8149
PiperOrigin-RevId: 177198734
- Update design demo sample
- Add test for content descriptions
Bug: 33896023
Test: Added new test to BottomNavigationViewTest
Change-Id: I80b2bcdb45d96cfe574685f22a20003b0f2a4d4d
PiperOrigin-RevId: 177085075
Instead of sending a ACTION_CANCEL event only to the last child
that returned true from its Behavior.onTouchEvent / onInterceptTouchEvent,
send that to all the child views so that they can cancel whatever
tracking logic they might have.
Add a test that covers the specific case of HorizontalScrollView
in AppBarLayout that starts intercepting a horizontal swipe. Also
fix behavior for bottom sheet that wasn't "ready" to get cancel
events during the window attach phase.
Test: ./gradlew design:connectedCheck --info --daemon
-Pandroid.testInstrumentationRunnerArguments.class=android.support.design.widget.AppBarHorizontalScrollingTest
Test: ./gradlew design:connectedCheck --info --daemon
-Pandroid.testInstrumentationRunnerArguments.class=android.support.design.widget.AppBarWithCollapsingToolbarTest
Test: ./gradlew design:connectedCheck --info --daemon
-Pandroid.testInstrumentationRunnerArguments.package=android.support.design.widget
Bug: 33824951
Change-Id: Ida605ab53cc156c44d9cc8b14fb8ce7a024b18c5
PiperOrigin-RevId: 174240782
Also update the demo text fields so that their helper text is set via the attribute, instead of programmatically.
This commit also introduces some new methods in IndicatorViewController to provide symmetry with error text and abstract out some code that could be used for both error and helper text.
PiperOrigin-RevId: 174038374
Add support for a box corner radius parameter via 4 new attributes, one for each corner. TextInputLayout now supports setting a corner radius with an attribute or programmatically.
PiperOrigin-RevId: 173965263
This move paves the way for a dense vs. standard height parameter, which will be implemented with styles (*Box.Dense suffix will be introduced for the filled/outline box's dense version).
PiperOrigin-RevId: 172952022
The screenshot tests showed a diff because of a change in the way the collapsed height was being measured. It used to be measured as -ascent, but it was changed to measure the text using the more traditional descent - ascent. This commit changes the collapsed text measurement back to -ascent, and should result in no diff.
PiperOrigin-RevId: 170737363
Adds an attribute for the box's stroke (outline) color. Includes a public and private attribute, setters, getters, documentation, and tests.
PiperOrigin-RevId: 170239224
ExpandableBehavior:
onExpandedStateChange() is now guaranteed to be called after the dependency and child have both been laid out.
The first-layout case does this by using a pre draw listener.
ExpandableTransformationBehavior:
onCreateExpandedStateChangeAnimation() now has a currentlyAnimating hint,
which when false can be used by subclasses to initialize the sheet during expansion.
FabTransformationBehavior:
Contains translation and expansion, with scaffolding for other motion components.
FabTransformationSheetBehavior:
Contains the MotionTiming for each motion component for FAB to sheet transformation.
Demo in catalog is now draggable.
You can reposition the FAB and the sheet to see how it affects the transformation.
PiperOrigin-RevId: 167796529
Specific attributes used in AppBarLayout's theme will cause
the super constructor to call onCreateDrawableState before
class-level fields are initialized. Move the creation of temp
array to be on-demand.
Bug: 37460722
Test: ./gradlew support-design:connectedCheck --info --daemon
-Pandroid.testInstrumentationRunnerArguments.class=android.support.design.widget.AppBarWithScrollbarsTest
Change-Id: I086f25c676201876fd76cd3684afcab7e09436d0
PiperOrigin-RevId: 165010107
Most of the layout files were not following our code style and followed an attribute ordering scheme that didn't make very much sense (ex: putting an attribute's format before its name).
Reformatting these files in a separate commit will help prevent formatting changes distracting from the main point of commits.
PiperOrigin-RevId: 162670506
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
NavigationView was crashing on restoring its states when an action view
outside the screen gets inside the screen by screen orientation change
or similar.
Test: NavigationViewTest#testActionViewState
Bug: 34796332
Change-Id: Id2c150fce4d6cc4695c50d57523243975c4f2ef0
PiperOrigin-RevId: 150128785
Also includes Ib494e97ee482f6b221ad957518af8b4885e88d89, as the added
test fails pre-M otherwise.
Bug: 34686900
Test: Added new test in TabLayoutTest
Change-Id: I2bdee71d55e8b68377124fc4d8a7b94a01a567ba
PiperOrigin-RevId: 149492933
Currently AppBarLayout scrolls too far. This
CL fixes that.
Test: included
BUG: 33934454
Change-Id: Id835c255dddef3ce4fdedd5a4e18a7bd493c5f9a
PiperOrigin-RevId: 149335184
- Not restoring elevation
- Not restoring on min-height with status bar insets
- Not restoring when expanded="true" set in layout
Test: included
BUG: 33471543
BUG: 33510949
BUG: 33511540
Change-Id: I43b2afeaf1c2cebf0a87045314830064554e2c5d
PiperOrigin-RevId: 148701728
Happens when the EditText is populated with
text from the layout, etc. Caused by some
state being set wrong in the constructor,
which makes the proceeding state update
no-op, since it thinks it is already in the
state.
BUG: 33585556
Test: included
Change-Id: I34c6e9aca3c41f864974ad32fcdbb6dc829645b8
PiperOrigin-RevId: 147067802
Bazel wants a structure where the application used for testing and the tests themselves are in separate packages (which gradle is less picky about). Android has a gradle plugin for this setup (com.android.test), although it unfortunately has seemingly worse Android Studio support at this point. In any case, this change splits the code up a bit more, into 3 parts:
- lib: the files we actually distribute as a library to end users
- testing: the test application and its custom component subclasses that are tested by the emulator tests
- tests: the actual emulator test code
The structure is a tad strange for typical gradle projects (testing in particular, which has a build.gradle file for each individual Java package, at the same level as the actual source files), but it better matches the conventions of bazel while also avoiding the need for a ton of parallel directory structures at the top level.
Known issues as of this commit:
- Android Studio doesn't think the Java files in testing/ have the right package. I tried to fix this by bumping their java srcDir up to the java/ root and changing the includes, but Android studio seems unable to properly figure that out and instead acted like the Java files didn't exist at all, so I reverted that. We can possibly modify the iml files that get generated, but I'll save this for a follow-up commit since this is already very large.
- Android Studio seems unable to run emulator tests properly (but they work from the command-line). I don't quite know why they fail, but seems like lacking support for the com.android.test plugin. Hopefully this is something we can work around for find a fix for in the near future.
PiperOrigin-RevId: 146940681