diff --git a/app/build.gradle b/app/build.gradle index bdd5ba2..0f7de7f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -71,7 +71,7 @@ dependencies { compile 'com.journeyapps:zxing-android-embedded:3.5.0@aar' compile 'com.google.zxing:core:3.3.0' - compile 'io.github.yavski:fab-speed-dial:1.0.7' + compile 'com.github.kobakei:MaterialFabSpeedDial:1.1.4' compile 'com.github.amlcurran.showcaseview:library:5.4.3' compile('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.4@aar') { transitive = true diff --git a/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.java b/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.java index ee220a8..bae372f 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.java +++ b/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.java @@ -23,8 +23,8 @@ import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.design.widget.FloatingActionButton; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; @@ -40,9 +40,7 @@ import ch.dissem.apps.abit.listener.ActionBarListener; import ch.dissem.apps.abit.repository.AndroidAddressRepository; import ch.dissem.apps.abit.service.Singleton; import ch.dissem.bitmessage.entity.BitmessageAddress; -import ch.dissem.bitmessage.entity.valueobject.Label; -import io.github.yavski.fabspeeddial.FabSpeedDial; -import io.github.yavski.fabspeeddial.SimpleMenuListenerAdapter; +import io.github.kobakei.materialfabspeeddial.FabSpeedDial; /** * Fragment that shows a list of all contacts, the ones we subscribed to first. @@ -133,21 +131,21 @@ public class AddressListFragment extends AbstractItemListFragment { // Show the dummy content as text in a TextView. FabSpeedDial fab = (FabSpeedDial) rootView.findViewById(R.id .fab_compose_message); - fab.setMenuListener(new SimpleMenuListenerAdapter() { + fab.addOnMenuItemClickListener(new FabSpeedDial.OnMenuItemClickListener() { @Override - public boolean onMenuItemSelected(MenuItem menuItem) { + public void onMenuItemClick(FloatingActionButton floatingActionButton, @Nullable TextView textView, int itemId) { BitmessageAddress identity = Singleton.getIdentity(getActivity()); if (identity == null) { Toast.makeText(getActivity(), R.string.no_identity_warning, Toast.LENGTH_LONG).show(); - return false; } else { - switch (menuItem.getItemId()) { + switch (itemId) { case R.id.action_compose_message: { Intent intent = new Intent(getActivity(), ComposeMessageActivity.class); intent.putExtra(EXTRA_IDENTITY, identity); startActivity(intent); - return true; + break; } case R.id.action_compose_broadcast: { Intent intent = new Intent(getActivity(), ComposeMessageActivity.class); intent.putExtra(EXTRA_IDENTITY, identity); intent.putExtra(EXTRA_BROADCAST, true); startActivity(intent); - return true; + break; } default: - return false; + break; } } } diff --git a/app/src/main/res/layout/fragment_address_list.xml b/app/src/main/res/layout/fragment_address_list.xml index 7ba2697..58c630c 100644 --- a/app/src/main/res/layout/fragment_address_list.xml +++ b/app/src/main/res/layout/fragment_address_list.xml @@ -17,7 +17,7 @@ android:paddingBottom="88dp" android:scrollbarStyle="outsideOverlay" /> - + app:fab_useTouchGuard="true" + app:fab_miniFabTextBackground="@color/colorPrimaryLight" + app:fab_fabDrawable="@drawable/ic_action_add_contact" + app:fab_menu="@menu/fab_address" /> diff --git a/app/src/main/res/layout/fragment_message_list.xml b/app/src/main/res/layout/fragment_message_list.xml index 2cbf5e8..7ab5168 100644 --- a/app/src/main/res/layout/fragment_message_list.xml +++ b/app/src/main/res/layout/fragment_message_list.xml @@ -19,7 +19,7 @@ android:scrollbars="vertical" tools:listitem="@layout/message_row"/> - + app:fab_useTouchGuard="true" + app:fab_miniFabTextBackground="@color/colorPrimaryLight" + app:fab_fabDrawable="@drawable/ic_action_compose_message" + app:fab_menu="@menu/fab_message"/> diff --git a/build.gradle b/build.gradle index 250f078..1e3da88 100644 --- a/build.gradle +++ b/build.gradle @@ -24,5 +24,6 @@ allprojects { jcenter() mavenCentral() maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } + maven { url "https://jitpack.io" } } }