Coder Social home page Coder Social logo

Graphic scaling about fancybuttons HOT 6 CLOSED

medyo avatar medyo commented on June 19, 2024
Graphic scaling

from fancybuttons.

Comments (6)

medyo avatar medyo commented on June 19, 2024

what do you mean by scaling it ? having same icon size as button ?

from fancybuttons.

ToddManUtah avatar ToddManUtah commented on June 19, 2024

I have a graphic that is 150x150. I want the button to be 30x30. The
problem is, that I can't get the graphic to scale within the button. If I
make the graphic 30x30, then it works. If I don't, the button ends up
being huge.

Does that make sense?

Using the standard button, I was able to set the size of the button and
instruct the button to scale the image to fit inside those dimensions. I
can't quite figure out how to make the FancyButton do the same thing.

Todd Lawson
Business: 801-609-8633
Email: [email protected]

On Tue, Aug 18, 2015 at 4:14 AM, Mehdi Sakout [email protected]
wrote:

what do you mean by scaling it ? having same icon size as button ?


Reply to this email directly or view it on GitHub
#33 (comment).

from fancybuttons.

medyo avatar medyo commented on June 19, 2024

I think you should define a ScaleType for the fancybutton Image like so myfancybutton. getIconImageObject().setScaleType(ScaleType.X);
Change X by the suitable one : http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

from fancybuttons.

medyo avatar medyo commented on June 19, 2024

@ToddManUtah any update on this ?

from fancybuttons.

ToddManUtah avatar ToddManUtah commented on June 19, 2024

I just tried it and still no luck. The graphic isn't scaled down. Here's my code:

    refreshButton = (FancyButton) view.findViewById(R.id.app_list_refresh_button);
    refreshButton.getIconImageObject().setScaleType(ImageView.ScaleType.FIT_CENTER);

I also tried several other scale types. All allowed the button to grow beyond the bounds defined for the button. Here is the button xml:

    <mehdi.sakout.fancybuttons.FancyButton
        android:id="@+id/app_list_refresh_button"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:padding="5dp"
        fancy:fb_iconResource="@drawable/button_refresh"
        fancy:fb_fontIconSize="25dp"
        fancy:fb_iconPaddingTop="5dp"
        fancy:fb_iconPaddingBottom="5dp"
        fancy:fb_iconPaddingLeft="5dp"
        fancy:fb_iconPaddingRight="5dp"
        fancy:fb_defaultColor="#696969"
        fancy:fb_focusColor="#a9a9a9"
        fancy:fb_radius="5dp"/>

The graphic I'm using is 150x150.

from fancybuttons.

medyo avatar medyo commented on June 19, 2024

Closing. If you still have the issue please re-open

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.