UI Tools Library

UI Tools Library for Android

License

License

GroupId

GroupId

com.scalified
ArtifactId

ArtifactId

uitools
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

aar
Description

Description

UI Tools Library
UI Tools Library for Android
Project URL

Project URL

https://github.com/Scalified/uitools
Source Code Management

Source Code Management

https://github.com/Scalified/uitools.git

Download uitools

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.9

Project Modules

There are no modules declared in this project.

UI Tools Library for Android

Build Status Maven Central

Description

UI Tools Library contains lots of useful methods for working with Android User Interface API

Requirements

The Library requires Android SDK version 9 (Gingerbread) and higher

Gradle Dependency

dependencies {
	compile 'com.scalified:uitools:1.1.2'
}

Activity Stream

Full ChangeLog

1.1.2 - current

  1. Changed the standard Android logging API to SLF4J Logging API

1.0.0 - previous

  1. The first release! Everything is new.

Features in the next versions:

TBD

Usage

IdGenerator

IdGenerator is responsible for views id generation.

To generate the view id:

View view;
// ... view initialization code goes here

view.setId(IdGenerator.next());

ColorModifier

ColorModifier contains utility methods for color modification.

To modify the color exposure:

int color = Color.DKGRAY;

// Darken the color:
int darkerColor = ColorModifier.modifyExposure(color, 0.8f);

// Lighten the color:
int lighterColor = ColorModifier.modifyExposure(color, 1.5f);

DensityConverter

DensityConverter contains utility methods for density values conversion based on the current device's display metrics.

To convert the density-independent pixels into density-dependent ones and vice versa:

float pixels = 100.0f;

// Convert to real pixels:
float realPixels = DensityConverter.dpToPx(getContext(), pixels)

// Convert to density-independent pixels:
float densityPixels = DensityConverter.pxToDp(getContext(), pixels);

Logging

To enable logging:

  1. Add the following dependency:

    dependencies {
    	compile 'com.github.tony19:logback-android-classic:1.1.1-3'
    }
  2. Create the logback.xml file in the src/main/assets with the sample configuration:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    	<appender name="LOGCAT" class="ch.qos.logback.classic.android.LogcatAppender">
    		<tagEncoder>
    			<pattern>%logger{0}</pattern>
    		</tagEncoder>
    		<encoder>
    			<pattern>%d{HH:mm:ss.SSS} [%thread] [%logger{0}] - %msg%n</pattern>
    		</encoder>
    	</appender>
    
    	<root level="TRACE" additivity="false">
    		<appender-ref ref="LOGCAT" />
    	</root>
    </configuration>

    You may wish to configure different appenders with different log levels for packages, classes etc.

    More information about LOGBack can be found @ LOGBack Project Site

  3. Add the following InvalidPackage ignore rule into lint.xml file (located @ the root of the project):

    <issue id="InvalidPackage" >
    	<ignore path="**/logback-android-core/*" />
    </issue>

License

  Copyright 2016 Scalified <http://www.scalified.com>

  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.

Scalified Links

com.scalified

Scalified

Versions

Version
1.1.2
1.1.1
1.1.0