mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 02:38:47 +00:00
Add floating action button to lists fragment
This commit is contained in:
parent
dd13995ffe
commit
12bee4c48c
@ -16,6 +16,7 @@ import com.example.listify.MainActivity;
|
||||
import com.example.listify.R;
|
||||
import com.example.listify.adapter.DisplayShoppingListsAdapter;
|
||||
import com.example.listify.model.ShoppingList;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -48,6 +49,14 @@ public class ListsFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) root.findViewById(R.id.new_list_fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Toast.makeText(getContext(), "yo", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
return root;
|
||||
}
|
||||
}
|
||||
@ -19,4 +19,13 @@
|
||||
android:divider="@color/list_divider"
|
||||
android:dividerHeight="1dp"/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/new_list_fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/ic_baseline_sort_28"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
Loading…
Reference in New Issue
Block a user