Git Product home page Git Product logo

pixate-freestyle-android's Introduction

Pixate Freestyle for Android

This repo contains the Pixate Freestyle library project.

Pixate Freestyle is a free framework that lets you style your native Android views with stylesheets.

Under the hood, Pixate is a powerful resolution-independent graphics engine which translates familiar CSS markup to scalable graphics and bitmap effects. It is designed to work with your existing assets, as well as with SVG (Scalable Vector Graphics) assets that can be applied to your views just like any other image.

Installing Pixate Freestyle

You can either clone this repo or download the package directly from the releases section.

Integrating Pixate Freestyle

We've tried to make Pixate easy to integrate into any existing app, and there are a few simple steps that need to be done in order to have it integrated with your project.

  1. In your project settings, make a reference to use the PixateFreestyle library project.
  2. Initialize Pixate in your Activity or Fragment by making a call to Pixate.init(...). For example:
    @Override

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

// Initialize pixate for the Activity PixateFreestyle.init(this);

// In case it's a Fragment, use: // PixateFreestyle.init(getActivity());

setContentView(R.layout.main); }

3. Create a _'default.css'_ file in your assets directory. This file will hold the styling markup for your app.

### Xamarin.Android

A module is also available (with source code) for using Pixate Freestyle on Xamarin.Android:

* [Xamarin Freestyle Module](https://github.com/Pixate/Xamarin-PixateFreestyle)

### Styling

Pixate enables you to style all Views of the same type by using the View's class name as an element name in the CSS, such as in this example:
```css
button {
background-color: red;
}

However, in most cases you would style a view by its ID (the same one that was defined in the XML layout):

#myButton {
  background-color: red;
}

The above example is a very simple one. Pixate also supports advanced styling instructions, like nth-child for Lists, matrix transformations and more.

See the Views Demo blog post to get a taste of what's possible.

Supported Views

The Pixate Freestyle library is a work in progress. At the moment there are a few common views that we've added extensive support to:

  1. View (generic attributes support for all views)
  2. ImageView
  3. TextView
  4. Button
  5. ImageButton
  6. ToggleButton
  7. RadioButton
  8. CheckBox
  9. Spinner
  10. ListView
  11. GridView
  12. EditText (support a non-editing mode)
  13. ActionBar (not in the View's hierarchy, but almost completely supported)

Samples

You can find a few sample projects under this repo's Samples folder. These projects use Pixate Freestyle to style various components, and demonstrate the current capabilities of the framework.

Mailing List & Twitter

Keep up with notifications and announcements by joining Pixate's mailing list and follow us on Twitter.

Docs

You can find the latest Pixate Freestyle documentation here.

pixate-freestyle-android's People

Contributors

billdawson avatar bobspace avatar justinbelcher avatar shalom avatar

Watchers

 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.