Commit 63e62798 authored by Grigory Fedorov's avatar Grigory Fedorov

Contact list "scroll up" action button added.

parent 93218ce4
......@@ -104,6 +104,8 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
this, (LinearLayout) view.findViewById(R.id.account_action_buttons));
accountActionButtonsAdapter.onChange();
view.findViewById(R.id.fab_up_container).setOnClickListener(this);
return view;
}
......@@ -368,6 +370,12 @@ public class ContactListFragment extends Fragment implements OnAccountChangedLis
@Override
public void onClick(View view) {
if (view.getId() == R.id.fab_up_container) {
scrollUp();
return;
}
String account = accountActionButtonsAdapter.getItemForView(view);
if (account == null) { // Check for tap on account in the title
return;
......
......@@ -15,6 +15,7 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -73,14 +74,42 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:orientation="vertical"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:id="@+id/account_action_buttons"
android:layout_above="@+id/fab_up_container"
>
</LinearLayout>
<FrameLayout
android:id="@+id/fab_up_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
>
<com.melnykov.fab.FloatingActionButton
android:id="@+id/fab_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_type="mini"
fab:fab_colorNormal="@color/red_500"
fab:fab_colorPressed="@color/red_700"
fab:fab_colorRipple="@color/color_primary_light"
android:src="@drawable/ic_arrow_up_white_24dp"
android:clickable="false"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
/>
</FrameLayout>
</RelativeLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment