Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how dynamic string can be use to generate image drawable. #18

Closed
satishkadyan opened this issue Oct 12, 2016 · 4 comments
Closed

how dynamic string can be use to generate image drawable. #18

satishkadyan opened this issue Oct 12, 2016 · 4 comments

Comments

@satishkadyan
Copy link

CharSequence charseq = "";
holder.image.setImageDrawable(new PrintDrawable.Builder(mActivity.getApplicationContext())
.iconText(charseq)
.iconColorRes(R.color.bl_accent)
.iconSizeRes(R.dimen.big_margin)
.build());

in above code, if i am trying to set char sequence dynamically in icontext, it does not generating icon but only text, only work if i define icon in string xml as resource. how can put icon code like this to work. please help.
thanks.

@johnkil
Copy link
Owner

johnkil commented Oct 12, 2016

What font you use?

@satishkadyan
Copy link
Author

@satishkadyan
Copy link
Author

holder.image.setImageDrawable(new PrintDrawable.Builder(mActivity.getApplicationContext())
.iconText("")
.iconColorRes(R.color.bl_accent)
.iconSizeRes(R.dimen.large_padding).iconFont("material-icon-font.ttf")
.build());

font file is in assets folder

@satishkadyan
Copy link
Author

satishkadyan commented Oct 13, 2016

UPDATE:- xmlns:app="http://schemas.android.com/apk/res-auto" i was missing correct shcema import, first now it is fixed working fine. please ignore this issue
even when trying to add with
<com.github.johnkil.print.PrintView
android:layout_alignParentLeft="true"
android:id="@+id/arrow_icon"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:iconText="@string/ic_access_alarms"
app:iconColor="#12558C"
app:iconFont="material-icon-font.ttf"
app:iconSize="20dp" />

it keeps giving warning in logging The iconic font is not set.

@johnkil johnkil closed this as completed Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants