GithubHelp home page GithubHelp logo

tieusangaka / nox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pedrovgs/nox

0.0 2.0 0.0 8.59 MB

Nox is an Android library created to show a custom view with some little images inside which are drawn following a shape indicated by the library user.

License: Apache License 2.0

Java 100.00%

nox's Introduction

Nox Build Status Android Arsenal

Nox is an Android library created to show a custom view with some images or drawables (NoxItem instances) inside which are drawn following a shape indicated by the library user. You can create you own Shape implementations if you want, by default there are some interesting Shape implementations to show NoxItem instances following a circular, spiral or linear shape. The space needed to show you NoxItem instances will be calculated automatically by the library and the scroll effect will be enabled if needed. If the Shape you choose needs a bidirectional scroll, like CircularShape, this will be enabled automatically.

Screenshots

Demo Screenshot

Usage

To use Nox inside your layouts you have to follow this steps:

  • 1 - Add a NoxView widget to your layout:
  <com.github.pedrovgs.nox.NoxView
      xmlns:nox="http://schemas.android.com/apk/res-auto"
      android:id="@+id/nox_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      nox:item_size="@dimen/nox_item_size"
      nox:item_margin="@dimen/nox_item_margin"
      nox:item_placeholder="@drawable/nox_item_placeholder"
      nox:shape="circular_shape"/>
  • 2 - Provide different configurations based on styleable attributes:

  • NoxItem size: nox:item_size

  • NoxItem margin: nox:item_margin

  • NoxItem placeholder: nox:item_placeholder. This placeholder will be used if the NoxItem to draw has no a placeholder configured.

  • Use circular transformation: nox:use_circular_transformation. Applies a Picasso circular transformation to the resource loaded.

  • Shape used: nox:shape. Review attrs.xml file to know the list of shapes ready to be used in the library.

This configuration can be also provided programmatically. Take a look to the sample project to find some samples.

  • 3 - Create a List and invoke the method showNoxItems in your NoxView instance:
  List<NoxItem> noxItems = new ArrayList<NoxItem>();
  noxItems.add(new NoxItem("http://api.randomuser.me/portraits/thumb/1.jpg"));
  noxView.showNoxItems(noxItems);

If you've added a new NoxItem to your list and you want to redraw your NoxView you can use notifyDataSetChanged method:

   noxView.notifyDataSetChanged();
   

If you are going to download any resource from internet remember to add the internet permission to your AndroidManifest.

To be able to configure a custom Shape implementation review MainActivity class.

Add it to your project

Add Nox dependency to your build.gradle

dependencies{
    compile 'com.github.pedrovgs:nox:1.0'
}

Or add Nox as a new dependency inside your pom.xml

<dependency>
    <groupId>com.github.pedrovgs</groupId>
    <artifactId>nox</artifactId>
    <version>1.0</version>
    <type>aar</type>
</dependency>

Do you want to contribute?

Please, do it!!! I'd like to improve this library with your help, there are some new features to implement waiting for you ;) Take a look to the repository issues.

Libraries used in this project

  • [Robolectric] 7
  • [JUnit] 8
  • [Mockito] 9
  • [Picasso] 10

Developed By

Follow me on Twitter Add me to Linkedin

License

Copyright 2015 Pedro Vicente Gómez Sánchez

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

nox's People

Contributors

pedrovgs avatar

Watchers

James Cloos 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.