GithubHelp home page GithubHelp logo

abd-debug / android-constraint-layout-cheatsheet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hossain-khan/android-constraint-layout-cheatsheet

0.0 0.0 0.0 17.49 MB

A demo application for Android ConstraintLayout with various usage with sample code.

Home Page: https://developer.android.com/reference/android/support/constraint/ConstraintLayout

License: Apache License 2.0

Kotlin 100.00%

android-constraint-layout-cheatsheet's Introduction

CircleCI codebeat badge Beta Badge

ConstraintLayout Demo

NOTE: See official demo project by Google for complete set of examples.

A demo application for Android ConstraintLayout with various usage with sample code.

Get the beta release with current snapshot!
google-play-badge

๐Ÿ”– Official Demo

Google has official demo project that contains a list of layouts that showcases the various features and usage of ConstraintLayout and MotionLayout

See https://github.com/android/views-widgets-samples/tree/master/ConstraintLayoutExamples

Proposed App Features

  • Have a grid containing different feature set of ConstraintLayout
  • For each feature, have different examples
  • Each example should allow you to share the code snippet or copy to clipboard
  • Each example may also contain additional resource links to blog or technical articles
  • Example may have set of sliders/toggle to change metrics dynamically to visualize.

See contribution guideline if you want to add demos or fix something.

ConstraintLayout features to cover

TIP: Jump to layout resources directoy to see existing layouts.

  • Relative positioning
    • Horizontal Axis: left, right, start and end sides
    • Vertical Axis: top, bottom sides and text baseline
  • Margins
  • Centering positioning and bias
  • Circular positioning (Added in 1.1)
  • Visibility behavior
  • Dimension constraints
    • Ratio
    • Percent dimension
    • Min and Max
    • MATCH_CONSTRAINT dimensions (Added in 1.1)
    • WRAP_CONTENT : enforcing constraints (Added in 1.1)
    • Widgets dimension constraints
  • Chains
    • Chain Style
    • Weighted chains
    • Margins and chains (Added in 1.1)
  • Virtual Helpers objects ๐Ÿฅ‡
    • Guideline
    • Barrier
    • Group
  • Optimizer (Added in 1.1)
  • Fully functional demo screens ๐Ÿฅ‡
    • Movie Details Screen
    • TED Talk Preview Screen
    • Secure PIN Entry Screen

Objective

These are the my objectives for this demo application.

  • To explore all the features of constraint layout
  • Learn and use material design component in the sample app
  • Learn and use the new architecture components in the sample app
  • Learn and use proper architecture for the app - likely MVVM
  • Document everything well so that future external contribution is easier

Preview

Here is a snapshot of current progress (This will be updated from time to time).

Browse Layout Variances - Landscape Mode
Show Layout Screen Complete Demo - Moview Details Complete Demo - TED Talk External Learning Resources

Screencast

screencast

android-constraint-layout-cheatsheet's People

Contributors

hossain-khan avatar

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.