Coder Social home page Coder Social logo

Comments (10)

medyo avatar medyo commented on June 2, 2024

Can you attach some captures or past your code ? so i can reproduce the issue.
thanks

from fancybuttons.

mariotaku avatar mariotaku commented on June 2, 2024

just try add layout_margin to its xml attributes, you will find it won't work. maybe this should be removed?

from fancybuttons.

medyo avatar medyo commented on June 2, 2024

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.

mariotaku avatar mariotaku commented on June 2, 2024

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.

medyo avatar medyo commented on June 2, 2024

Please paste the code you have tried, so i can reproduce the same scenario.

from fancybuttons.

mariotaku avatar mariotaku commented on June 2, 2024

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.

medyo avatar medyo commented on June 2, 2024

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.

medyo avatar medyo commented on June 2, 2024

Does this commit #26 fixes your issue ?

from fancybuttons.

medyo avatar medyo commented on June 2, 2024

hi @mariotaku
Have you fixed the issue ?

from fancybuttons.

mariotaku avatar mariotaku commented on June 2, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.