Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't load in fragment #10

Closed
dmuharemagic opened this issue Feb 19, 2015 · 1 comment
Closed

Won't load in fragment #10

dmuharemagic opened this issue Feb 19, 2015 · 1 comment

Comments

@dmuharemagic
Copy link

Inflated it

    View view = inflater.inflate(R.layout.fragment_pocetna, container, false);
    listview = (ListView) view.findViewById(R.id.pocetna_listview);
    ActionButton actionButton = (ActionButton) view.findViewById(R.id.action_button);
    actionButton.show();

Here's my layout fragment_pocetna:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ECECEC">

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/pocetna_swipe"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

<ListView
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:divider="@null"
    android:dividerHeight="0dp"
    android:transcriptMode="normal"
    android:id="@+id/pocetna_listview"
   />

</android.support.v4.widget.SwipeRefreshLayout>

<com.software.shell.fab.ActionButton
    android:id="@+id/action_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_marginRight="@dimen/fab_margin"
    android:layout_marginBottom="@dimen/fab_margin"
    />

</LinearLayout>

But doesn't seem to show. There's no errors in logcat. Thanks

@vbaidak
Copy link
Member

vbaidak commented Feb 19, 2015

Hi larryfour,

This is because of the LinearLayout. It doesn't allow you to properly place ActionButton to overlay other layout components. If you use LinearLayout you should provide a "place" for it like create inside it another layout etc.

I suggest you to use RelativeLayout instead of LinerLayout. This will solve your issue completely.

BTW, you do not need to call show() method explicitly - ActionButton will be shown if it is declared in the layout. If you need to play animation during the first appearing, just call playShowAnimation()

This should help
Have a nice day :)

@vbaidak vbaidak closed this as completed Feb 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants