Comments (10)
Can you attach some captures or past your code ? so i can reproduce the issue.
thanks
from fancybuttons.
just try add layout_margin to its xml attributes, you will find it won't work. maybe this should be removed?
from fancybuttons.
Same sample buttons have already layout_margin and it works perfectly.
https://github.com/medyo/fancybuttons/blob/master/samples/src/main/res/layout/activity_xml_buttons.xml#L27
from fancybuttons.
I tried put it in FrameLayout, all layout params except width and height are invalid, I found LayoutParams was always set to LinearLayout.LayoutParams despite of what parent is.
from fancybuttons.
Please paste the code you have tried, so i can reproduce the same scenario.
from fancybuttons.
I can't reproduce it on a new project, but when I put fancybutton in an xml file, and inflate it runtime, It crashes. Actually after I commenting setLayoutParams
out, sample code still works fine: https://github.com/mariotaku/fancybuttons
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to com.wefika.flowlayout.FlowLayout$LayoutParams
at com.wefika.flowlayout.FlowLayout.onMeasure(FlowLayout.java:239)
at android.view.View.measure(View.java:17547)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17547)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1260)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.widget.ScrollView.onMeasure(ScrollView.java:337)
at android.view.View.measure(View.java:17547)
from fancybuttons.
I've tried to run the same sample using FlowLayout Library and it works perfectly. here is my code :
<?xml version="1.0" encoding="utf-8"?>
<merge>
<com.wefika.flowlayout.FlowLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fancy="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|top"
android:padding="10dp">
<mehdi.sakout.fancybuttons.FancyButton
android:id="@+id/btn_facebook_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:padding="10dp"
fancy:borderColor="#FFFFFF"
fancy:borderWidth="1dp"
fancy:defaultColor="#3b5998"
fancy:focusColor="#5577bd"
fancy:fontIconResource="@string/icon_like"
fancy:fontIconSize="10sp"
fancy:iconPosition="right"
fancy:radius="30dp"
fancy:text="Like my facebook page"
fancy:textColor="#FFFFFF"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="dolor" />
</com.wefika.flowlayout.FlowLayout>
</merge>
from fancybuttons.
Does this commit #26 fixes your issue ?
from fancybuttons.
hi @mariotaku
Have you fixed the issue ?
from fancybuttons.
@medyo I use shaped drawable for now because I can't figure out why margin is ignored. Thank you though!
from fancybuttons.
Related Issues (20)
- how to set textStyle="bold"
- how to remove the default text and show only drawable icon? HOT 1
- font not loaded HOT 1
- Black buttons that only show text "Fancy Buttons" HOT 5
- how i can set fb_fontIconResource HOT 4
- "fancy:fb_focusColor" not working in 1.9.0 HOT 2
- Auto complete not work
- stop using fancy namespace
- I cannot use implementation "com.android.support:appcompat-v7:$support_lib_version" HOT 1
- Ripple effect on click?
- How can I add gradient background drawable to a button? HOT 1
- When set radius programmatically, ripple effect gone?
- ripple effect doesn't work HOT 3
- 是否能加入对渐变颜色的支持? HOT 4
- Can't make Button text as bold
- Update to Font Awesome 5.8.2
- Method ‘setFontIconSize’ can‘t work when I put my iconresource in drawable and import it by using R.drawable.xxx HOT 1
- fb_textSize , fb_textAllCaps not work
- Dead library?
- Your library no longer works HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fancybuttons.