Added floating action button to add contacts (fixes #40).

This commit is contained in:
Felix Ableitner 2015-12-03 20:15:26 +01:00
parent 1942986962
commit 6867b19380
7 changed files with 13 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

View file

@ -72,6 +72,16 @@
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_margin="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_white_24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>

View file

@ -7,6 +7,7 @@ import android.content.{BroadcastReceiver, Context, Intent, IntentFilter}
import android.net.Uri
import android.os.Bundle
import android.preference.PreferenceManager
import android.support.design.widget.FloatingActionButton
import android.support.v4.content.{ContextCompat, LocalBroadcastManager}
import android.support.v7.widget.Toolbar
import android.view.View.OnClickListener
@ -70,6 +71,8 @@ class ContactsFragment extends ListFragment with OnClickListener {
toolbar.setNavigationIcon(R.drawable.ic_launcher)
title = v.findViewById(R.id.title).asInstanceOf[TextView]
subtitle = v.findViewById(R.id.subtitle).asInstanceOf[TextView]
val fab = v.findViewById(R.id.fab).asInstanceOf[FloatingActionButton]
fab.setOnClickListener(this)
updateConnections()
v
}