Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test MaterialDrawer v5.0.0 with FastAdapter, fitsSystemWindows #920

Closed
mikepenz opened this issue Jan 6, 2016 · 27 comments
Closed

Test MaterialDrawer v5.0.0 with FastAdapter, fitsSystemWindows #920

mikepenz opened this issue Jan 6, 2016 · 27 comments

Comments

@mikepenz
Copy link
Owner

mikepenz commented Jan 6, 2016

v5.0.0 of the MaterialDrawer will internally switch to the FastAdapter which provides a highly flexible and performant Adapter implementation which allows a flexible setting of new Item's as the MaterialDrawer did it in the past.

This is a huge step as it will bring new features in the future.

Changes for this are currently on the FastAdapter branch (https://github.com/mikepenz/MaterialDrawer/tree/feature/FastAdapter)

Via this dependency:

compile('com.mikepenz:materialdrawer:5.0.0.b27-SNAPSHOT@aar') {
    transitive = true
}

As this is just a SNAPSHOT at the moment it is only available on the SNAPSHOTS repo of maven central. You can add it like done here:
https://github.com/mikepenz/MaterialDrawer/blob/feature/FastAdapter/build.gradle#L17

Please test and report back

@mikepenz mikepenz self-assigned this Jan 6, 2016
@fergalmoran
Copy link

I'm getting
Error:(80, 13) Failed to resolve: com.mikepenz:materialdrawer:5.0.0.fastAdapter-SNAPSHOT

@mikepenz
Copy link
Owner Author

mikepenz commented Jan 7, 2016

@fergalmoran oh sorry. missed that you have to add the snapshots repo so it can find it:
https://github.com/mikepenz/MaterialDrawer/blob/feature/FastAdapter/build.gradle#L17

@mikepenz
Copy link
Owner Author

mikepenz commented Jan 7, 2016

new snapshot 5.0.0.fastAdapter.b8-SNAPSHOT

@mikepenz
Copy link
Owner Author

  • new SNAPSHOT with the latest FastAdapter v0.6.0 which switches from ICollapsible to IExpandable. Note that this switches the previous collapsed logic to expanded --> if collapsed == true --> expaneded == false
compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b8-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

  • enable multi selection mode from the FastAdapter
    • enable it via .withMultiSelect(true)
  • add some methods to deselect
  • add some more javadoc
  • update smaple to latest crossfadedrawerlayout
  • update to latest FastAdapter v0.7.3
compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b9-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b10-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

  • update all DrawerItems to reflect the new Interface of the latest version of the FastAdatper (v0.9.1) which now also takes the type of the ViewHolder so no casting is required.
compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b12-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

  • update to latest FastAdapter v0.9.3
compile('com.mikepenz:materialdrawer:5.0.0.fastAdapter.b14-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz mikepenz changed the title Test MaterialDrawer v5.0.0 with FastAdapter Test MaterialDrawer v5.0.0 with FastAdapter, fitsSystemWindows Jan 26, 2016
@mikepenz
Copy link
Owner Author

Ok i just pushed a new beta for the MaterialDrawer. This one contains huge changes how the drawer is drawn behind the StatusBar. In previous versions this was done via a ScrimInsetsFrameLayout and a lot of handling of the paddings. With this release i now use fitsSystemWindows wherever i can.
This brings two changes:

  • The ScrimInsetsFrameLayout is no longer needed
  • There will be no more colored StatusBar for API 19-20 as this is not system default (if you need / want this. v4.6.4 will be the last version for you)

Use the system, don’t fight it

I made this descision after reading the following article, which is may interesting for you too:
https://medium.com/google-developers/why-would-i-want-to-fitssystemwindows-4e26d9ce1eec?linkId=19685562#.xuh9a3bfq

I already updated the sample containing all necessary changes

compile('com.mikepenz:materialdrawer:5.0.0.b21-SNAPSHOT@aar') {
    transitive = true
}

@justjanne
Copy link

@mikepenz: With 5.0.0.b21-SNAPSHOT, it doesn’t seem to support showing the drawer below the status bar yet.

(And the issues with 4.6.4 are obvious, regarding KeyboardUtil and its interaction with SlidingUpPanel, etc)

@mikepenz
Copy link
Owner Author

@justjanne b21 starts to use the fitsSystemWindows property from android, so it now also follows all rules (and propably limitations) of this.
b21 should no longer have the keyboard issues as the fullscreen flag is no longer set.

Showing below the the StatusBar is showcased here: https://github.com/mikepenz/MaterialDrawer/blob/feature/fitsSystemWindows/app/src/main/java/com/mikepenz/materialdrawer/app/NonTranslucentDrawerActivity.java
If you meant behind the StatusBar this is no longer supported on API < 21. This follows the guideliens and also the platform rules. (The same is also not done in the cheesesquare sample)

@justjanne
Copy link

@mikepenz

I’m on b21, using

        drawerLeft = new DrawerBuilder()
                .withActivity(this)
                .withToolbar(toolbar)
                .withAccountHeader(accountHeader)
                .withSavedInstance(savedInstanceState)
                .withTranslucentStatusBar(true)
                .build();

And get this result on LOLLIPOP: http://i.imgur.com/7JOJetM.png

@mikepenz
Copy link
Owner Author

@justjanne your theme?

@mikepenz
Copy link
Owner Author

@justjanne you either use a theme which has the translucentStatus MaterialDrawerTheme.TranslucentStatus or you also set withTranslucentStatusBarProgrammatically(true)

@mikepenz
Copy link
Owner Author

@justjanne no problem ;)

@mikepenz
Copy link
Owner Author

@justjanne Material-Dialogs is from aiden not me :D

@mikepenz
Copy link
Owner Author

  • b23 released which uses the latest version of the FastAdapter and fixes a tiny issues which causes the wrong color to be used for the description text.
compile('com.mikepenz:materialdrawer:5.0.0.b23-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

mikepenz commented Feb 1, 2016

  • some new improvements to the styling
  • remove obsolete methods
compile('com.mikepenz:materialdrawer:5.0.0.b24-SNAPSHOT@aar') {
    transitive = true
}

@sebastianperdomo
Copy link

I changed to use this new library but I see that the drawer is the same as always, what changes exactly provides ?

@mikepenz
Copy link
Owner Author

mikepenz commented Feb 2, 2016

v5.0.0 has many internal changes, uses a new adapter internally, provides expandable item functionality, ....
I will prepare a whole changelog as soon as i release.

It now also do not add the FULLSCREEN flag anymore, it will now use the system internal mechanisms as far as possible. depending on fitsSystemWindows

no more colored statusbar on API < 21

@mikepenz
Copy link
Owner Author

mikepenz commented Feb 6, 2016

  • update dependencies
  • many fixes in the dependencies
compile('com.mikepenz:materialdrawer:5.0.0.b25-SNAPSHOT@aar') {
    transitive = true
}

@rubengees
Copy link
Contributor

Works great so far, but I noticed one minor thing:

If a user opens the App for the first time, the Drawer is supposed to stay at the screen until used or swiped away. That doens't work with 5.0 for me whereas it does work with 4.6.4.

With 5.0 the Drawer shortly shows up and then closes itself at first start.

@mikepenz
Copy link
Owner Author

mikepenz commented Feb 8, 2016

@rubengees just tried it in the sample. The drawer opens and it stays opened. Perhaps somehting on your side triggers this?

@rubengees
Copy link
Contributor

Hmm okay very weird, I will have a look.

@mikepenz
Copy link
Owner Author

  • update FastAdapter to v1.0.4
  • only set fitsSystemWindows on API >= 21
compile('com.mikepenz:materialdrawer:5.0.0.b26-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

  • updated to latest Materialize library v0.8.2 with the following change:
    • only set the FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS on API >= 21
    • this fixes a Samsung bug on Android 4.3. Thanks @FabianTerhorst for reporting and debugging it
compile('com.mikepenz:materialdrawer:5.0.0.b27-SNAPSHOT@aar') {
    transitive = true
}

@mikepenz
Copy link
Owner Author

v5.0.1 is realeased. This issue is now "solved"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants