Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
com.github.johnkil.print:print
Advanced tools
A lightweight Android library for use iconic fonts.
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>
Add your custom iconic fonts to assets/
.
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.
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;
}
Use PrintView
as single icon in your layout.
<com.github.johnkil.print.PrintView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
print:iconText="@string/ic_android"
print:iconColor="@color/icon_color"
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
... />
Attribute Name | Related Method |
---|---|
iconText | setIconTextRes(int resId) |
setIconText(CharSequence text) | |
iconCode | setIconCodeRes(int resId) |
setIconCode(int code) | |
iconColor | setIconColorRes(int resId) |
setIconColor(int color) | |
setIconColor(ColorStateList colors) | |
iconSize | setIconSizeRes(int resId) |
setIconSizeDp(float size) | |
setIconSize(int unit, float size) | |
iconFont | setIconFont(String path) |
setIconFont(Typeface font) |
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.
FAQs
A lightweight Android library for use iconic fonts.
We found that com.github.johnkil.print:print demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.