1

I need to implement a floating action button in android eclipse which on clicking will navigate to another activity . I don't want it in Android Studio.

Adarsh
  • 89
  • 4
  • 14
  • I do not really have much knowledge in this. However, I am going to tell you that actually the easiest way is to migrate to android studio. However, if you really do not want to: then you have to download the v7 with eclipse. Floating action bar is material design with lollipop and no matter what library you might find that might work with eclipse, it will not be as smooth. – Miriana Itani Aug 02 '15 at 18:22
  • @Miriani Itani:Actually my whole project is being done in eclipse.So I can't migrate to studio at this stage. – Adarsh Aug 02 '15 at 18:29
  • You can migrate. I did this before. It is really easy. Please refer to developer website and I am ready to answer any questions. https://developer.android.com/sdk/installing/migrate.html – Miriana Itani Aug 02 '15 at 18:33
  • @Miriani Itani: Actually the problem is , the project involves many members and they will not be ready to migrate to studio at this stage, since the project delivery date is very near.The integration process are going on. But i think pre-lollipop versions supported FAB (i have seen it in Google plus in kitkat). – Adarsh Aug 02 '15 at 18:39
  • I will search around and if I have got anything I will let you know here. But so far start download the v7 libraries on eclipse if you do not want to waste time. If you find any sort of code and need help please drop a comment. I a ready to help ad explain, – Miriana Itani Aug 02 '15 at 18:43

2 Answers2

1

You can use official android design library to create FAB . http://developer.android.com/tools/support-library/features.html#design

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/coordinatorLayout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical"/>

</RelativeLayout>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="15dp"
    android:layout_marginRight="15dp"
    android:src="@mipmap/image"
    app:fabSize="normal"
    app:layout_anchor="@id/coordinatorLayout"
    app:layout_anchorGravity="bottom|right|end"
    app:rippleColor="#F03333"/>

Check this answer on how to add design library in eclipse : Using Support Design Library in Eclipse

Community
  • 1
  • 1
N Kaushik
  • 2,198
  • 18
  • 29
  • So can I apply this in Android Eclipse? I need it in eclipse since my whole project is in eclipse and I need to integrate Floating Action Button in it. – Adarsh Jul 22 '15 at 06:54
  • yes you can, just check the ans to how to import design library in eclipse. here is another thread for your reference : http://stackoverflow.com/questions/26878803/how-to-add-android-support-v7-libraries-in-eclipse – N Kaushik Jul 22 '15 at 07:00
0

I think I found a work around for your problem:

Here is a link http://www.truiton.com/2015/04/floating-action-buttons-android/

Now here instead of actually compiling the gradle, you will have to download the jar files and add them to eclipse.

Then follow the instructions on the developer website: http://developer.android.com/tools/support-library/setup.html#libs-with-res

Look at the tab under eclipse.

If that does not work for you check this out : https://github.com/alopix/Android-FloatingActionButton-Eclipse (But check the first solution first)

Miriana Itani
  • 865
  • 9
  • 25
  • But how can I download the jar files from it and add to eclipse? Can you explain it..I don't know how to do it.. – Adarsh Aug 04 '15 at 10:43
  • First you have to create a libs folder. After you download the jar, you just copy paste into the libs folder. Then you clean and rebuild – Miriana Itani Aug 04 '15 at 11:45
  • I will give you a link to download it from dont worry – Miriana Itani Aug 05 '15 at 07:34
  • Check this out : https://android-arsenal.com/details/1/824. There is a download zip. You could download the zip and add it as a library in your project. – Miriana Itani Aug 05 '15 at 08:02