All Projects → hcbpassos → Waterfall Toolbar

hcbpassos / Waterfall Toolbar

Licence: mit

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Waterfall Toolbar

Tc Material Design
Série de artigos sobre o Material Design Android
Stars: ✭ 64 (-77.3%)
Mutual labels:  material-design, toolbar
Materialdesignsamples
Material Design 系列控件samples,讲了Material Design 系列新控件的使用方法和一些场景示例,使用详情请看对应博客,持续更新中...
Stars: ✭ 900 (+219.15%)
Mutual labels:  material-design, toolbar
Awesomebar
Just beautiful
Stars: ✭ 870 (+208.51%)
Mutual labels:  material-design, toolbar
Materialdesign
Material Design 控件集合。ConstraintLayout、NestedScrollView、Toolbar、TabLayout、TextInputLayout。。。
Stars: ✭ 68 (-75.89%)
Mutual labels:  material-design, toolbar
Textfieldboxes
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.
Stars: ✭ 760 (+169.5%)
Mutual labels:  xml, material-design
Material Bottomnavigation
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html
Stars: ✭ 1,375 (+387.59%)
Mutual labels:  xml, material-design
Datingapp
Dating UI kit is used for online meet up with girls and boys . The screen contains more than 30 icons and most of all required elements required to design an application like this. The XML and JAVA files contains comments at each and every point for easy understanding. Everything was made with a detail oriented style and followed by today's web trends. Clean coded & Layers are well-organized, carefully named, and grouped.
Stars: ✭ 97 (-65.6%)
Mutual labels:  xml, material-design
Material Design Guideline
A library for Android developers who want to create layout which follows Google material design principle.
Stars: ✭ 170 (-39.72%)
Mutual labels:  xml, material-design
Shapeofview
Give a custom shape to any android view, Material Design 2 ready
Stars: ✭ 2,977 (+955.67%)
Mutual labels:  xml
Jackrabbit
Mirror of Apache Jackrabbit
Stars: ✭ 273 (-3.19%)
Mutual labels:  xml
Laravel Material Design
Laravel 5.6 on Material Design Lite 1.3 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. This makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. Uses laravel ORM modeling and has CRUD (Create Read Update Delete) functionality for all tasks. Quick setup, can be done in 5 minutes. It will take longer to obtain your Facebook, Twitter, and Google Plus API Keys than it will to set this up.
Stars: ✭ 263 (-6.74%)
Mutual labels:  material-design
Carbon
Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.
Stars: ✭ 2,942 (+943.26%)
Mutual labels:  material-design
Loaders.gl
Loaders for big data visualization. Website:
Stars: ✭ 272 (-3.55%)
Mutual labels:  xml
Material Design Avatars
Create material deisgn avatars for users just like Google Messager. It may not be unique but looks better than Identicon or Gravatar.
Stars: ✭ 266 (-5.67%)
Mutual labels:  material-design
Nativescript Cardview
♦️ ♣️ NativeScript widget for Material Design CardView
Stars: ✭ 279 (-1.06%)
Mutual labels:  material-design
Sequent
A simple continuous animation library for Android UI.
Stars: ✭ 263 (-6.74%)
Mutual labels:  material-design
Epiboard
Web Extension — A new tab page extension with material design and useful features 🆕 🎉
Stars: ✭ 262 (-7.09%)
Mutual labels:  material-design
Sweet xml
Stars: ✭ 279 (-1.06%)
Mutual labels:  xml
Pubmed parser
📋 A Python Parser for PubMed Open-Access XML Subset and MEDLINE XML Dataset
Stars: ✭ 274 (-2.84%)
Mutual labels:  xml
Andotp
Open source two-factor authentication for Android
Stars: ✭ 3,326 (+1079.43%)
Mutual labels:  material-design
Icon

Waterfall Toolbar

Android Arsenal JitPack
Made in Kotlin, Waterfall Toolbar is an Android version of Material Design's web component waterfall toolbar. Basically, what it does is dynamize an ordinary Toolbar, increasing and decreasing its shadow when an associated view is scrolled.

Sample

Get it on Google Play
You can install the sample.apk to get a better notion of what's going on. Also available at Play Store (click in the badge above).

Sample

Setup

Gradle dependency

Waterfall Toolbar is available on Jitpack.
To add this library to your project, write the code below in your root (not module) build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

And this one to your module build.gradle file:

dependencies {
    ...
    implementation 'com.github.hugocastelani:waterfall-toolbar:0.5.0'
}

Implementation

Since almost everyone who knows Java knows Kotlin, I'm going to base the implementation in Java, but Kotlin is fully supported.
Implementing Waterfall Toolbar is quite simple. All you gotta do is add it to your layout and refer a RecyclerView or a ScrollView.
Your XML code:

<com.hugocastelani.waterfalltoolbar.WaterfallToolbar
    android:id="@+id/waterfall_toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"/>
        
</com.hugocastelani.waterfalltoolbar.WaterfallToolbar>

Your Java code:

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ...
        WaterfallToolbar waterfallToolbar = (WaterfallToolbar) findViewById(R.id.waterfall_toolbar);
        waterfallToolbar.setRecyclerView(recyclerView);
    }
}

Congratulations, you're all set!
Note: you can do whatever you want with your inner Toolbar, Waterfall Toolbar won't interfere.

Customization

Well, there are people who follow standards and people who create their standards. These last ones can customize three aspects of Waterfall Toolbar with Java or XML.

Note: The sample project provides a nice environment to test all of these aspects. Maybe you should give it a try.

How to use Px and Dp classes

I've created these classes to simplify the conversion between px and dp, which happens often inside WaterfallToolbar class. Using them is quite simple. If you have a WaterfallToolbar object instantiated in your class, just create a new object passing the intended size:

final Pixel pixel = new Pixel(50);

But if you're using them before instantiating, you have to give your display density:

DimensionUnitsKt.setDensity(getResources().getDisplayMetrics().density);

Initial elevation

The elevation with which the toolbar starts. Default value: 0 dp. Java and XML implementation, respectively:

waterfallToolbar.setInitialElevation(new Dp(1).toPx());
app:initial_elevation="1dp"

Result:

New initial shadow

As you can see, there's now a tiny initial shadow.
Note: Waterfall Toolbar extends CardView, and its elevation in taken seriously by Android. Since elevation is set to 0dp, if there's another view below it, Waterfall Toolbar is going to be overlaid. Fortunately, if you set the views' limits properly, you won't have any related trouble.

Final elevation

The elevation the toolbar gets when it reaches final scroll elevation. Default value: 4 dp. Java and XML implementation, respectively:

waterfallToolbar.setFinalElevation(new Dp(10).toPx());
app:final_elevation="10dp"

Result:

New final shadow

As result, the final shadow gets much bigger.

Scroll final position

The percentage of the screen's height that is going to be scrolled to reach the final elevation. Default value: 12%. Java and XML implementation, respectively:
Short value:

waterfallToolbar.setScrollFinalPosition(4);
app:scroll_final_elevation="4"

Long value:

waterfallToolbar.setScrollFinalPosition(40);
app:scroll_final_elevation="40"

Respective results:

Short value to scroll final position Long value to scroll final position

Now the final shadow takes much less and much longer to completely appear, respectively.

Current project situation

Waterfall Toolbar is stable, but ListView would come in handy. If you want to contribute, please read this.

License

MIT License
 
Copyright (c) 2019 Hugo Castelani
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].