Adarsh
Adarsh

Reputation: 125

Floating Action Button in android eclipse which on clicking will navigate to another activity

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.

Upvotes: 1

Views: 2817

Answers (2)

Miriana Itani
Miriana Itani

Reputation: 915

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)

Upvotes: 0

N Kaushik
N Kaushik

Reputation: 2208

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

Upvotes: 1

Related Questions