Print


Source link: http://johnkil.github.io/Print

Print

A lightweight Android library for use iconic fonts.

Download

Gradle:

compile 'com.github.johnkil.print:print:1.3.1'

Maven:

<dependency>
  <groupId>com.github.johnkil.print</groupId>
  <artifactId>print</artifactId>
  <version>1.3.1</version>
  <type>aar</type> </dependency>

Getting started

Add fonts

Add your custom iconic fonts to assets/.

Setup default font

Define your default iconic font using PrintConfig in Application.onCreate() method. This font will be used in cases when the value of a font is not specified.

public class MyApplication extends Application {

@Override
  public void onCreate() {

super.onCreate();

 PrintConfig.initDefault(getAssets(), "fonts/iconic-font.ttf");

  
}
  
}

Note: The definition of the default font is not necessary, in this case, you must specify the value of the font all the time.

Usage

PrintDrawable

If you need an icon in ImageView or in ActionBar, then you should use PrintDrawable. To create the drawable using PrintDrawable.Builder.

@Override public boolean onCreateOptionsMenu(Menu menu) {

  getMenuInflater().inflate(R.menu.main, menu);

  // Set an icon in the ActionBar
  menu.findItem(R.id.action_info).setIcon(

 new PrintDrawable.Builder(context)

.iconTextRes(R.string.ic_info)

.iconColorRes(R.color.ab_icon_color)

.iconSizeRes(R.dimen.ab_icon_size)

.build()
  );

  return true; 
}

Custom views

Use PrintView as single icon in your layout.

<com.github.johnkil.print.PrintView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:print_iconText="@string/ic_android"

app:print_iconColor="@color/icon_color"

app:print_iconSize="@dimen/icon_size"/>

Or use PrintButton to create a button with an icon. Using a view similar to PrintView.

<com.github.johnkil.print.PrintButton

... />

XML Attributes

Attribute Name Related Method
print_iconText setIconTextRes(int resId)
setIconText(CharSequence text)
print_iconCode setIconCodeRes(int resId)
setIconCode(int code)
print_iconColor setIconColorRes(int resId)
setIconColor(int color)
setIconColor(ColorStateList colors)
print_iconSize setIconSizeRes(int resId)
setIconSizeDp(float size)
setIconSize(int unit, float size)
print_iconFont setIconFont(String path)
setIconFont(Typeface font)

Links

License

Copyright 2014 Evgeny Shishkin  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. 

Resources

Kirai - flavored Android string formatting. Library has fluent API similar to phrase with additional formatting similar to TaggerString and allows to add formatted pieces of text like BabushkaText.

Kirai means phrase in Swahili language.

NetworkEvents is Android library listening network connection state and change of the Wi-Fi signal strength.

It is able to detect ConnectivityStatus when it changes:

  • WIFI_CONNECTED
  • WIFICONNECTEDHAS_INTERNET
  • WIFICONNECTEDHASNOINTERNET
  • MOBILE_CONNECTED
  • OFFLINE

In addition it is able to detect situation when strength of the Wi-Fi signal was changed with WifiSignalStrengthChanged event.

WeatherIconView is an Android library providing custom view for displaying weather icon.

The android-apt plugin assists in working with annotation processors in combination with Android Studio. It has two purposes:

  • Allow to configure a compile time only annotation processor as a dependency, not including the artifact in the final APK or library.
  • Set up the source paths so that code that is generated from the annotation processor is correctly picked up by Android Studio.

This plugin requires the android or android-library plugin (version 0.9.x or up) to be configured on your project.

An Android Cloud Tag Widget. You can edit the tag's style, and set listener of selecting or deleting tag.

TagCloudLinkView is a simple layout with Tag View. It provides possibility add and remove Tag view.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes