Nox

Android library created to show a custom view with some intems inside following a shape selected by the library client.

License

License

GroupId

GroupId

com.github.pedrovgs
ArtifactId

ArtifactId

nox
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

aar
Description

Description

Nox
Android library created to show a custom view with some intems inside following a shape selected by the library client.
Project URL

Project URL

https://github.com/pedrovgs/Nox
Source Code Management

Source Code Management

https://github.com/pedrovgs/Nox

Download nox

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.pedrovgs/nox/ -->
<dependency>
    <groupId>com.github.pedrovgs</groupId>
    <artifactId>nox</artifactId>
    <version>1.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.pedrovgs/nox/
implementation 'com.github.pedrovgs:nox:1.0'
// https://jarcasting.com/artifacts/com.github.pedrovgs/nox/
implementation ("com.github.pedrovgs:nox:1.0")
'com.github.pedrovgs:nox:aar:1.0'
<dependency org="com.github.pedrovgs" name="nox" rev="1.0">
  <artifact name="nox" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.pedrovgs', module='nox', version='1.0')
)
libraryDependencies += "com.github.pedrovgs" % "nox" % "1.0"
[com.github.pedrovgs/nox "1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 22.1.1
com.squareup.picasso : picasso jar 2.5.2

Project Modules

There are no modules declared in this project.

Nox Build Status Android Arsenal Maven Central

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.

Versions

Version
1.0