Post Reply

[Library] Floating Action Button from Android L on Kitkat and below

OP Faiz Malkani

24th September 2014, 07:59 PM   |  #21  
Quinny899's Avatar
Recognized Contributor
Flag Bolton le Sands, Near Lancaster, UK
Thanks Meter: 3,919
 
6,292 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by Damien98

Hey, thank you very much for this library, on eclipse all works fine, but in android studio, the little image in the floating action button doesn't display, this is a part of my xml layout file:

Code:
<com.faizmalkani.floatingactionbutton.FloatingActionButton
        android:id="@+id/fabbutton"
        android:layout_width="72dp"
        android:layout_height="72dp"
        android:layout_gravity="bottom|end"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginRight="16dp"
        android:onClick="fabClicked"
        android:drawable="@drawable/ic_action_new"/>
All this is at the end of a framelayout, where is the error? Thank you in advance

Sorry for my bad english

Follow the sample, either set the drawable in java or use app:drawable rather than android:drawable with the correct xmlns
The Following User Says Thank You to Quinny899 For This Useful Post: [ View ]
28th September 2014, 05:50 PM   |  #22  
Junior Member
Thanks Meter: 0
 
10 posts
Join Date:Joined: Jul 2014
Thumbs up
Quote:
Originally Posted by Quinny899

Follow the sample, either set the drawable in java or use app:drawable rather than android:drawable with the correct xmlns

Hey guy, thanks! You partially resolve my problem, in the main activity I've just a listview and all works fine, but in another activity, more complicated I've the FAB, but the image into it appears just when I press the FAB. My layout is this:

Code:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/FrameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="left|top">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="Modifica nome:"
            android:id="@+id/textView" />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/editText" />
    </LinearLayout>
    <com.faizmalkani.floatingactionbutton.FloatingActionButton
        android:id="@+id/fabbutton"
        android:layout_width="72dp"
        android:layout_height="72dp"
        android:layout_gravity="bottom|end"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginRight="16dp"
        android:onClick="fabClicked"
        app:drawable="@drawable/ic_action_accept"/>
</FrameLayout>
28th September 2014, 06:19 PM   |  #23  
Quinny899's Avatar
Recognized Contributor
Flag Bolton le Sands, Near Lancaster, UK
Thanks Meter: 3,919
 
6,292 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by Damien98

Hey guy, thanks! You partially resolve my problem, in the main activity I've just a listview and all works fine, but in another activity, more complicated I've the FAB, but the image into it appears just when I press the FAB. My layout is this:

Code:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/FrameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="left|top">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="Modifica nome:"
            android:id="@+id/textView" />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/editText" />
    </LinearLayout>
    <com.faizmalkani.floatingactionbutton.FloatingActionButton
        android:id="@+id/fabbutton"
        android:layout_width="72dp"
        android:layout_height="72dp"
        android:layout_gravity="bottom|end"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginRight="16dp"
        android:onClick="fabClicked"
        app:drawable="@drawable/ic_action_accept"/>
</FrameLayout>

The only thing I can think of is are the FAB and the icon the same or similar colours?
The Following User Says Thank You to Quinny899 For This Useful Post: [ View ]
28th September 2014, 08:41 PM   |  #24  
Junior Member
Thanks Meter: 0
 
10 posts
Join Date:Joined: Jul 2014
Thumbs up
Quote:
Originally Posted by Quinny899

The only thing I can think of is are the FAB and the icon the same or similar colours?

Oh my God! I'm very stupid! Sorry for my stupid error, thanks a lot
12th October 2014, 11:01 AM   |  #25  
Member
Flag Cagayan de Oro
Thanks Meter: 12
 
73 posts
Join Date:Joined: Nov 2010
More
Hey! this one is pretty awesome! been wondering if it's possible to use this on existing .apk? I know this is for developing apps from scratch eclipse or android studio, but maybe it will be possible on decompiling .apk (mms.apk for example) and add those in xmls and .smali? hehe
16th October 2014, 04:48 PM   |  #26  
tbremer19's Avatar
Member
Flag Berlin
Thanks Meter: 8
 
33 posts
Join Date:Joined: Jul 2013
More
Nice, thank you! But in Android Studio it shows me "cannot resolve symbol Fab", when I introduce it under my onCreate()...
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in IDEs, Libraries, & Programming Tools by ThreadRank