Code Monkey home page Code Monkey logo

grilledui's Introduction

GrilledUI

Library to implement common UIs easily. Available UI types are: TabActivity, SectionActivity and HybridActivity. Pre-ICS devices are also supported with the help of ActionBarSherlock. Use library folder for ICS+ devices only and library-sherlock together with your installation of ActionBarSherlock for 2.1+ projects.

GrilledUI is licensed under 2 clause BSD license. In simple words - use the way you want! But remember to notify your users that you use this library.

TabActivity

This is a base activity to create your tabbed UIs. It wraps all the code needed to create and manage scrollable tabs inside activity. Empty activity is created by default, override createSectionAdapter() method to add tabs on start-up or use getSectionAdapter() to retrieve current section adapter to manage tabs dynamically.

SectionActivity

This is a base activity to create master detail flow UI for your app. Unlike Google's example, everything is done in one activity, UI sections can be populated from XML file and dynamic modification is available.

HybridActivity

This activity is a hybrid between MDF and tabs. Tabs will be used on phones and MDF on tablets by default. But behaviour can easily be overriden with proper layouts. It is quite possible to use MDF in landscape and tabs in portrait orientation, for example. Check out CustomLayoutExample for this advanced behaviour.

XmlSectionReader

XmlSectionReader is a convenience class to load tab sections from XML file. Override createSectionAdapter() and return SectionAdapter from XmlSectionReader.load() method. You can use XML resources or any XML in form of XmlPullParser instance. You can use @string resources inside XML file to reuse your internationalized string resources as tab titles.

XML example

XML file must have <sections> root tag with multiple <section> tags inside. Each <section> should have title and fragment attributes. title will be shown as a tab title and fragment is a fully qualified class name containing fragment for section tab.

<?xml version="1.0" encoding="utf-8"?>
<sections>
  <section title="@string/title_section1" fragment="com.grilledmonkey.grilleduiexample.DummySectionFragment" />
  <section title="@string/title_section2" fragment="com.grilledmonkey.grilleduiexample.TabModFragment" />
</sections>

Examples

Check project wiki for code example descriptions and where to find them (all inside repo, actually).

Screenshots

Screenshots are available in Picasa album.

grilledui's People

Contributors

auxx avatar

Watchers

 avatar  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.