diff --git a/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt b/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt index af66c9e..6fc090c 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt @@ -26,6 +26,7 @@ import android.view.* import android.widget.Toast import ch.dissem.apps.abit.service.Singleton import ch.dissem.apps.abit.util.Drawables +import ch.dissem.apps.abit.util.qrCode import ch.dissem.bitmessage.entity.BitmessageAddress import ch.dissem.bitmessage.wif.WifExporter import com.mikepenz.community_material_typeface_library.CommunityMaterial @@ -185,7 +186,7 @@ class AddressDetailFragment : Fragment() { } // QR code - qr_code.setImageBitmap(Drawables.qrCode(item)) + qr_code.setImageBitmap(item.qrCode()) } } diff --git a/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.kt b/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.kt index e7dc2db..5f77d05 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.kt @@ -27,7 +27,6 @@ import android.widget.ArrayAdapter import android.widget.ImageView import android.widget.TextView import ch.dissem.apps.abit.service.Singleton -import ch.dissem.apps.abit.util.FabUtils import ch.dissem.bitmessage.entity.BitmessageAddress import com.google.zxing.integration.android.IntentIntegrator import io.github.kobakei.materialfabspeeddial.FabSpeedDialMenu @@ -107,7 +106,7 @@ class AddressListFragment : AbstractItemListFragment() val menu = FabSpeedDialMenu(activity) menu.add(R.string.scan_qr_code).setIcon(R.drawable.ic_action_qr_code) menu.add(R.string.create_contact).setIcon(R.drawable.ic_action_create_contact) - FabUtils.initFab(activity, R.drawable.ic_action_add_contact, menu) + activity.initFab(R.drawable.ic_action_add_contact, menu) .addOnMenuItemClickListener { _, _, itemId -> when (itemId) { 1 -> IntentIntegrator.forSupportFragment(this@AddressListFragment) diff --git a/app/src/main/java/ch/dissem/apps/abit/ConversationDetailFragment.kt b/app/src/main/java/ch/dissem/apps/abit/ConversationDetailFragment.kt index f1e202b..3030c57 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ConversationDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ConversationDetailFragment.kt @@ -19,7 +19,6 @@ package ch.dissem.apps.abit import android.content.Context import android.content.Intent import android.os.Bundle -import android.support.annotation.IdRes import android.support.v4.app.Fragment import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView @@ -28,9 +27,9 @@ import android.widget.ImageView import android.widget.TextView import ch.dissem.apps.abit.adapter.ConversationAdapter import ch.dissem.apps.abit.service.Singleton -import ch.dissem.apps.abit.util.Assets import ch.dissem.apps.abit.util.Drawables import ch.dissem.apps.abit.util.Strings.prepareMessageExtract +import ch.dissem.apps.abit.util.getDrawable import ch.dissem.bitmessage.entity.Conversation import ch.dissem.bitmessage.entity.Plaintext import com.mikepenz.google_material_typeface_library.GoogleMaterial @@ -148,7 +147,7 @@ class ConversationDetailFragment : Fragment() { val message = messages[position] viewHolder.avatar.setImageDrawable(Identicon(message.from)) - viewHolder.status.setImageResource(Assets.getStatusDrawable(message.status)) + viewHolder.status.setImageResource(message.status.getDrawable()) viewHolder.sender.text = message.from.toString() viewHolder.extract.text = prepareMessageExtract(message.text) viewHolder.item = message diff --git a/app/src/main/java/ch/dissem/apps/abit/ConversationListFragment.kt b/app/src/main/java/ch/dissem/apps/abit/ConversationListFragment.kt index c5a49c7..80f7427 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ConversationListFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ConversationListFragment.kt @@ -33,7 +33,6 @@ import ch.dissem.apps.abit.listener.ListSelectionListener import ch.dissem.apps.abit.repository.AndroidMessageRepository import ch.dissem.apps.abit.service.Singleton import ch.dissem.apps.abit.service.Singleton.currentLabel -import ch.dissem.apps.abit.util.FabUtils import ch.dissem.bitmessage.entity.Conversation import ch.dissem.bitmessage.entity.valueobject.Label import ch.dissem.bitmessage.utils.ConversationService @@ -248,7 +247,7 @@ class ConversationListFragment : Fragment(), ListHolder