Show Fragment in Activity with Transition

Asked

Viewed 104 times

1

Good afternoon, I have a main Activity with a button and I would like that when the person clicked this button this Fragment opened on the screen, are three buttons within a linear layout.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"
android:layout_height="wrap_content"
tools:context="com.example.jelbez.wolterskluwer_agendadeobricacoes.DrawerFragment">

<!-- TODO: Update blank fragment layout -->

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:visibility="visible">

    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Minha conta"
        android:id="@+id/btnFragmentAccount"
        android:background="@color/colorPrimary"
        android:layout_margin="2dp"
        android:textColor="#fff"
        android:textAllCaps="false"
        android:drawableLeft="@mipmap/ic_user_white"
        android:drawablePadding="10dp"
        android:textAlignment="textStart"
        android:paddingLeft="30dp" />

    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Cadastro de Obrigações"
        android:id="@+id/btnFragmentRegister"
        android:layout_marginLeft="2dp"
        android:layout_marginRight="2dp"
        android:background="@color/colorPrimary"
        android:textColor="#fff"
        android:textAllCaps="false"
        android:drawableLeft="@mipmap/ic_ancora"
        android:drawablePadding="10dp"
        android:textAlignment="textStart"
        android:paddingLeft="30dp"
        android:layout_marginBottom="2dp" />

    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Sobre a Wolters Kluwer"
        android:id="@+id/btnFragmentAbout"
        android:layout_marginLeft="2dp"
        android:layout_marginRight="2dp"
        android:textColor="#fff"
        android:textAllCaps="false"
        android:background="@color/colorPrimary"
        android:drawableLeft="@mipmap/ic_agenda"
        android:drawablePadding="10dp"
        android:textAlignment="textStart"
        android:paddingLeft="30dp"/>
</LinearLayout>

  • http://pt.broculos.net/2011/12/android-101-use-fragments-to-handle.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.