Code Monkey home page Code Monkey logo

toolbar-samples's Introduction

Toolbar + CollapsingToolbarLayout + TabLayout Samples

Toolbar, CollapsingToolbarLayout and TabLayout samples to play with different scroll flags, transparency and some other features to create preferred layouts.

Ch1 Collapsing Toolbar Ch4 Toolbar+TabLayout Ch5 Collapsing + TabLayout
Ch6 Parallax Ch7 RV on Top of Parallax Ch8 Appbar Scroll Change
Ch9 Insets and Fullscreen Ch10 Insets Fullscreen BottomAppbar

This is small sample bundle to check out results or testing properties in one place.

Contribution

If you find any errors or have other Toolbar, TabLayout or CollapsingToolbar samples in your mind feel free to send a pr.

toolbar-samples's People

Contributors

smarttoolfactory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

toolbar-samples's Issues

Insets are not applied correctly to sample 9

I don't after trying so much how exactly insets work. How they are consumed or considered consumed? What does replaceSystemWindowInsets, it had no effect, dispatchApplyWindowInsets and other methods do? Also there is a bug with CollapsingToolbarLayout that prevents siblings to receive insets.

"Ch4 Toolbar+TabLayout" example with transparent NavigationBar

Hello,

My app uses the same principles as the "Ch4 Toolbar+TabLayout" example on your page:

<CoordinatorLayout>
	<AppbarLayout>
	 	<Toolbar/>
   	 	<TabLayout/>
	</AppbarLayout>
	<ViewPager2/>
</CoordinatorLayout>

ViewPager2 acts as container for fragments. There is one fragment per tab. Each fragment includes a RecyclerView (scrollable list). Similar to your app.

Now, I've implemented fullscreen design with insets similar to example "Ch9 Insets and Fullscreen" in accordance with the Android guidelines within MainActivity.java. I've set mlp.bottomMargin to 0 and android:paddingBottom="50dp" to ViewPager2 in order the see the list scrolling behind the transparent navbar. So far so good.

The issue that I'm now facing is, that...

  1. an ugly white bar appears at the bottom of the screen when scrolling upwards and makes the NavBar intransparent again. See a video of the issue here.
  2. I don't like the hardcoded 50dp on ViewPager2 as different devices might have different paddings.

The solution would be to know the bottom NavBar inset within my fragments. Then, I could simply apply setPadding(0,0,0, navBarPadding); + setClipToPadding(false); to the Recyclerview and could remove the 50dp from ViewPager2. Unfortunately, I don't get that info via setOnApplyWindowInsetsListener in the fragment as the function is never called there.

Do you have any plans to implement a transparent NavBar to "Ch4 Toolbar+TabLayout" and / or would like to share some of your know-how about the issue that I'm facing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.