wuapnjie / stickerview Goto Github PK
View Code? Open in Web Editor NEW[No more support] A view which can add sticker and zoom,drag,delete it
License: MIT License
[No more support] A view which can add sticker and zoom,drag,delete it
License: MIT License
public class HelloIconEvent implements StickerIconEvent{
@OverRide public void onActionDown(StickerView stickerView, MotionEvent event) {
}
@OverRide public void onActionMove(StickerView stickerView, MotionEvent event) {
}
@OverRide public void onActionUp(StickerView stickerView, MotionEvent event) {
stickerView.setBringToFrontCurrentSticker(true);
// Toast.makeText(stickerView.getContext(), "Hello World!", Toast.LENGTH_SHORT).show();
}
}
can anyone tell me how to change the text of textsticker?
@wuapnjie plz help
Hello,
I am trying to change the initial position of the TextSticker.
I tried to change the position in StickerView class in addSticker(). I change the values passed to sticker.getMatrix().postTranslate(x, y), but the position is not changing.
can any one advise on how to control the text size for the TextStikcer
i try to add custom method to set the test size but i see no changes
what i need to do is have something like scroll for size change when the user use it the text size for selected Stikcer changes according to the value of the scroll bar
Hi, I'm using this library but I need then to share the image created with the stickers, but the createBitmap is not working. Also tried to use the setLocked method (if was something with that, but no luck)
stickerView.setLocked(true); Bitmap stickerViewBitmap = stickerView.createBitmap();
Can you please help me on this one?
Thanks
Hi is there any way to add shadow to text sticker like we add shadow to textviews.
Even I set:
app:showBorder="false"
app:showIcons="false"
It still show border and icon when draw on canvas. Hope that it can draw on canvas without those.
Thanks.
Whenever i create new sticker and add it stickerview. current sticker do not show controls. i have put lot of effort. but all in vain.
目前应该只有TextSticker有这方面需求。
在TextSticker修改发现无法实现。
一起交流。
how can i edit textsticker on click
Stop showing BitmapStickerIcon once clicked outside any sticker view
when we select a sticker we see the BitmapStickerIcon for that sticker and if we select a different sticker it shows BitmapStickerIcon for that sticker (and it keeps on showing it), there is no fuctionality , if we click outside all or any sticker the BitmapStickerIcon should not be shown.
this is an example
https://raw.githubusercontent.com/nimengbo/StickerView/master/stickerGIF.gif
and also can we change font and fontcolor after a textsticker is set like in the gif
when i change color of first sticker it replaces with second and both have same text and color when i and joint one another, they look-like only one sticker but when we close on another still on canvas how to solve it?
my code example is here
public static void AddTextColor(@nonnull Sticker sticker, int color) {
if (sticker instanceof TextSticker) {
((TextSticker) sticker).setTextColor(color);
}
}
private void viewColorPicker() {
ColorPickerDialogBuilder
.with(this)
.setTitle("Text Color")
.initialColor(Color.parseColor("#ffffff"))
.wheelType(ColorPickerView.WHEEL_TYPE.FLOWER)
.density(12)
.setOnColorSelectedListener(new OnColorSelectedListener() {
@Override
public void onColorSelected(int selectedColor) {
}
})
.setPositiveButton("ok", new ColorPickerClickListener() {
@Override
public void onClick(DialogInterface dialog, int selectedColor, Integer[] allColors) {
AddTextColor(sticker11, selectedColor);
stickerView.replace(sticker11);
if (allColors != null) {
StringBuilder sb = null;
for (Integer color : allColors) {
if (color == null)
continue;
if (sb == null)
sb = new StringBuilder("Color List:");
sb.append("\r\n#" + Integer.toHexString(color).toUpperCase());
}
}
}
})
.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.showColorEdit(true)
.setColorEditTextColor(ContextCompat.getColor(this, android.R.color.holo_blue_bright))
.build()
.show();
}
Thank you
When i make StickerView totally transparent it become always yellow i don't know why
prevent sticker to go out of Image area
the sticker goes out of bound of the screen how can this be prevented , it can be best explained by the
this image itself
https://github.com/wuapnjie/StickerView/blob/master/screenshots/screenshot2.png
here the text goes out of screen as can be seen how to keep it within the screen only
I have stickerView.setConstrained(true); still it moves out of area
I am developing application i which we can store sticker matrix positions in internal storage and restore sticker using old matrix position.
In that i get matrix value in float array of size 9 and restore it by float array but still always sticker added in center position.
After that i tried to replace sticker with setMatrix method but still it can't change position pragmatically.
So Please help me store and retrieve sticker positions.
I tried to add this library as a gradle project, but it gives an error of -
Error:(35, 0) Plugin with id 'com.github.dcendents.android-maven' not found.
Please how do i go about this..Thanks for the amazing library and anticipated support.
I want to show onlye delete icon and disable rotate function.
Thank you.
is it possible to set image from url in sticketimageview
If yes then how can used it with GPU Image libray i.e. https://github.com/CyberAgent/android-gpuimage
because I can't able to store images with stickers using this library. please share if you have any possible solution.
Hello
I added multiple drawable stickers. The one on the top is always the one that is handled until removed the second one behind will be handled. The drawable stickers are not full screen sizes.
How to add onClick callback to each Sticker?
i can color text sticker but how to color Sticker which is not text sticker any help please
How can I edit sticker text on Double Tab of Sticker view it will help to edit that sticker text can you please help me how should I integrate it in android
Love your amazing library, but got following issue. Can you please try to solve this error, it will be great help
Some Details:
Manufacturer Samsung
Android version Android 4.4
RAM (MB) 1024
Screen size 540 × 960
Screen density (dpi) 240
OpenGL ES version 3.0
Native platform armeabi-v7a
CPU make Qualcomm
CPU model MSM8216
Model galaxy grand prime
Note:
In almost every device user got this error, there is no such way to regenerate but if we try to move and rotate sticker for long time then this happens.
Stack Trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.PointF com.xiaopo.flying.sticker.Sticker.getMappedCenterPoint()' on a null object reference
at com.xiaopo.flying.sticker.StickerView.calculateMidPoint(StickerView.java:325)
at com.xiaopo.flying.sticker.StickerView.onTouchEvent(StickerView.java:190)
at android.view.View.dispatchTouchEvent(View.java:8725)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2606)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2266)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2606)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2266)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2606)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2266)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2606)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2266)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2606)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2266)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2606)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2266)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2545)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1745)
at android.app.Activity.dispatchTouchEvent(Activity.java:2834)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2506)
at android.view.View.dispatchPointerEvent(View.java:8915)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4098)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3961)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3523)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3576)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3542)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3652)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3550)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3709)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3523)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3576)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3542)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3550)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3523)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5795)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5769)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5740)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5885)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:143)
at android.os.Looper.loop(Looper.java:122)
at android.app.ActivityThread.main(ActivityThread.java:5753)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
i want to set minimum sticker size and maximum sticker size because when sticker get too small it losses functionality and can't show close,flip icon.
Can we add stickerview to a video and upload it to web or save it?
I am adding text sticker in which i add single line text after adding it sticker converted into multi line so what is solution to get single line as much as long text in text sticker?
i've an issue
i user dialog with custom layout contains edit text to add Text Sticker
the problem is after return from the dialog to the main activity that contain the sticker view all added sticker return to the middle of the activity
as if it was loaded on activity load
can any one please help me how to resolve this issue
Hello ,
i want to save the last position of Sticker , and when i reload an app i want to set the Sticker on last position
do you have an idea ?
Is there a way to constrain user in moving a sticker, so he couldn't be able to move it outside of the parent image view?
I am grateful for any help and advice.
Keep up the good work. :)
stickerView.setBackgroundColor(); creates black background if set to transparent
If we set the backgroundcolor to stickerView.setBackgroundColor(Color.TRANSPARENT); it creates a black bacngound instead of the transparent one how can we have a transparent background
Add stickers and text to video
i want to remove border and icon like remove, flip or resize on click of out of the text sticker and show again when i click on text again how can i get this?
Hi,
I am using this code to add sticker from drawables:
`public void addStickerView(String string) {
Drawable drawable =
ContextCompat.getDrawable(context, getResources().getIdentifier(string, "drawable", getPackageName()));
stickerView.addSticker(new DrawableSticker(drawable));
}
public void setColor(int color) {
if(currentSticker instanceof TextSticker){
((TextSticker) currentSticker).setTextColor(color);
} else {
currentSticker.getDrawable().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
}
stickerView.invalidate();
}
public void somefunction(){
addStickerView("image");
// Setting currentSticker as above added sticker
setColor(Color.RED);
addStickerView("image");
}
`
Here I am adding "R.drawable.image" two times, but as per code only first sticker should have red color and other should have default color. But on running, both images have RED color.
Please tell me how to fix it.
currently the sticker drawable is added in the middle of the sticker view float offsetX = (getWidth() - sticker.getWidth()) / 2; float offsetY = (getHeight() - sticker.getHeight()) / 2;
as enhancement add the ability the specify the position since all drawables are being added on top of each others.
情景:设置内容为一个短语时,有一两个文字超出范围换行了,收到拉长调整,超出内容的文字没有回到一行。个人觉得能根据内容是否回车或者\n等调整更好。
Is it possible to load sticker drawable from URL ?
我给每个字都加了\n之后,虽然画出来是竖着的,但是边框的计算貌似还是按照横向计算的,这应该怎么处理呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.