diff --git a/app/build.gradle b/app/build.gradle index 7e7426c..6cc05a9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ if (project.hasProperty("project.configs") //noinspection GroovyMissingReturnStatement android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 28 + buildToolsVersion "28.0.3" signingConfigs { release @@ -22,7 +22,7 @@ android { defaultConfig { applicationId "ch.dissem.apps.${appName.toLowerCase()}" minSdkVersion 21 - targetSdkVersion 27 + targetSdkVersion 28 versionCode 23 versionName "1.0-rc1" multiDexEnabled true @@ -62,13 +62,16 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" implementation "org.jetbrains.anko:anko:$anko_version" - implementation "com.android.support:appcompat-v7:$supportVersion" - implementation "com.android.support:preference-v7:$supportVersion" - implementation "com.android.support:cardview-v7:$supportVersion" - implementation "com.android.support:support-v13:$supportVersion" - implementation "com.android.support:preference-v14:$supportVersion" - implementation "com.android.support:design:$supportVersion" - implementation "com.android.support:multidex:1.0.3" + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.preference:preference:1.0.0' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'androidx.legacy:legacy-support-v13:1.0.0' + implementation 'androidx.legacy:legacy-preference-v14:1.0.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.multidex:multidex:2.0.0' + implementation 'androidx.core:core-ktx:1.0.0' + implementation 'androidx.sqlite:sqlite-ktx:2.0.0-rc01' + implementation 'androidx.fragment:fragment-ktx:1.0.0' implementation "ch.dissem.jabit:jabit-core:$jabitVersion" implementation "ch.dissem.jabit:jabit-networking:$jabitVersion" @@ -80,15 +83,15 @@ dependencies { implementation 'org.slf4j:slf4j-android:1.7.25' - implementation 'com.mikepenz:materialize:1.1.2@aar' - implementation('com.mikepenz:materialdrawer:6.0.8@aar') { + implementation 'com.mikepenz:materialize:1.2.0-rc01@aar' + implementation('com.mikepenz:materialdrawer:6.1.0-rc01.2@aar') { transitive = true } - implementation('com.mikepenz:aboutlibraries:6.0.9@aar') { + implementation('com.mikepenz:aboutlibraries:6.2.0-rc01@aar') { transitive = true } - implementation "com.mikepenz:iconics-core:3.0.4@aar" - implementation "com.mikepenz:iconics-views:3.0.4@aar" + implementation "com.mikepenz:iconics-core:3.1.0-rc01@aar" + implementation "com.mikepenz:iconics-views:3.1.0-rc01@aar" implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar' implementation 'com.mikepenz:community-material-typeface:2.0.46.1@aar' @@ -97,11 +100,12 @@ dependencies { implementation 'com.github.kobakei:MaterialFabSpeedDial:1.2.0' implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0@aar' - implementation('com.github.h6ah4i:android-advancedrecyclerview:0.11.0@aar') { - transitive = true - } implementation 'com.github.angads25:filepicker:1.1.1' - implementation 'com.android.support.constraint:constraint-layout:1.1.2' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' + + implementation "io.reactivex.rxjava2:rxjava:2.2.2" + implementation "io.reactivex.rxjava2:rxkotlin:2.3.0" + implementation "io.reactivex.rxjava2:rxandroid:2.1.0" testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.19.0' @@ -111,7 +115,7 @@ dependencies { testImplementation 'org.robolectric:robolectric:3.7.1' testImplementation "org.robolectric:shadows-multidex:3.7.1" - androidTestImplementation "com.android.support:multidex:1.0.3" + androidTestImplementation "androidx.multidex:multidex:2.0.0" } idea.module { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e8ed1be..21b654b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,9 +11,10 @@ + diff --git a/app/src/main/java/ch/dissem/apps/abit/AbstractItemListFragment.kt b/app/src/main/java/ch/dissem/apps/abit/AbstractItemListFragment.kt index a87a73e..3036f9f 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AbstractItemListFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/AbstractItemListFragment.kt @@ -18,7 +18,7 @@ package ch.dissem.apps.abit import android.content.Context import android.os.Bundle -import android.support.v4.app.ListFragment +import androidx.fragment.app.ListFragment import android.view.View import android.widget.ListView 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 6fc090c..8bd70db 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/AddressDetailFragment.kt @@ -19,7 +19,7 @@ package ch.dissem.apps.abit import android.app.AlertDialog import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.text.Editable import android.text.TextWatcher import android.view.* 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 8c8e051..3e4f7ec 100644 --- a/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/AddressListFragment.kt @@ -28,7 +28,6 @@ import android.widget.ImageView import android.widget.TextView import ch.dissem.apps.abit.service.Singleton import ch.dissem.bitmessage.entity.BitmessageAddress -import com.google.zxing.integration.android.IntentIntegrator import io.github.kobakei.materialfabspeeddial.FabSpeedDialMenu import org.jetbrains.anko.doAsync import org.jetbrains.anko.uiThread @@ -44,7 +43,7 @@ class AddressListFragment : AbstractItemListFragment() super.onCreate(savedInstanceState) adapter = object : ArrayAdapter( - activity, + activity!!, R.layout.subscription_row, R.id.name, LinkedList() @@ -109,9 +108,10 @@ class AddressListFragment : AbstractItemListFragment() activity.initFab(R.drawable.ic_action_add_contact, menu) .addOnMenuItemClickListener { _, _, itemId -> when (itemId) { - 1 -> IntentIntegrator.forSupportFragment(this@AddressListFragment) - .setDesiredBarcodeFormats(IntentIntegrator.QR_CODE) - .initiateScan() + // FIXME +// 1 -> IntentIntegrator.forSupportFragment(this@AddressListFragment) +// .setDesiredBarcodeFormats(IntentIntegrator.QR_CODE) +// .initiateScan() 2 -> { val intent = Intent(getActivity(), CreateAddressActivity::class.java) startActivity(intent) diff --git a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.kt b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.kt index a900abf..2cb3352 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.kt @@ -20,8 +20,8 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment -import android.support.v7.app.AppCompatActivity +import androidx.fragment.app.Fragment +import androidx.appcompat.app.AppCompatActivity import ch.dissem.apps.abit.service.Singleton import ch.dissem.bitmessage.entity.Plaintext import ch.dissem.bitmessage.entity.Plaintext.Encoding.EXTENDED diff --git a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.kt b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.kt index bca4f5f..b1e8f82 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageFragment.kt @@ -20,7 +20,7 @@ import android.app.Activity.RESULT_OK import android.content.Context import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment +import androidx.fragment.app.Fragment import android.view.* import android.widget.AdapterView import android.widget.Toast @@ -89,10 +89,10 @@ class ComposeMessageFragment : Fragment() { recipient = getSerializable(EXTRA_RECIPIENT) as BitmessageAddress } if (containsKey(EXTRA_SUBJECT)) { - subject = getString(EXTRA_SUBJECT) + subject = getString(EXTRA_SUBJECT) ?: throw IllegalStateException("EXTRA_SUBJECT expected") } if (containsKey(EXTRA_CONTENT)) { - content = getString(EXTRA_CONTENT) + content = getString(EXTRA_CONTENT) ?: throw IllegalStateException("EXTRA_CONTENT expected") } encoding = getSerializable(EXTRA_ENCODING) as? Plaintext.Encoding ?: Plaintext.Encoding.SIMPLE 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 f611ff1..8b24ca9 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ConversationDetailFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ConversationDetailFragment.kt @@ -17,8 +17,8 @@ package ch.dissem.apps.abit import android.os.Bundle -import android.support.v4.app.Fragment -import android.support.v7.widget.LinearLayoutManager +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.LinearLayoutManager import android.view.* import ch.dissem.apps.abit.adapter.ConversationAdapter import ch.dissem.apps.abit.service.Singleton @@ -74,8 +74,7 @@ class ConversationDetailFragment : Fragment() { item?.let { item -> subject.text = item.subject avatar.setImageDrawable(MultiIdenticon(item.participants)) - messages.adapter = - ConversationAdapter(ctx, this@ConversationDetailFragment, item, Singleton.currentLabel.value) + messages.adapter = ConversationAdapter(ctx, this@ConversationDetailFragment, item, Singleton.currentLabel) messages.layoutManager = LinearLayoutManager(activity) } } 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 ab09695..fe20a28 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ConversationListFragment.kt +++ b/app/src/main/java/ch/dissem/apps/abit/ConversationListFragment.kt @@ -19,36 +19,29 @@ package ch.dissem.apps.abit import android.content.Intent import android.os.Bundle -import android.support.v4.app.Fragment -import android.support.v4.content.ContextCompat -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.RecyclerView.OnScrollListener import android.view.* import android.widget.Toast +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.ItemTouchHelper +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView.OnScrollListener import ch.dissem.apps.abit.ComposeMessageActivity.Companion.EXTRA_BROADCAST import ch.dissem.apps.abit.ComposeMessageActivity.Companion.EXTRA_IDENTITY +import ch.dissem.apps.abit.adapter.EventListener +import ch.dissem.apps.abit.adapter.SwipeToDeleteCallback import ch.dissem.apps.abit.adapter.SwipeableConversationAdapter 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.preferences -import ch.dissem.bitmessage.entity.Conversation import ch.dissem.bitmessage.entity.valueobject.Label import ch.dissem.bitmessage.utils.ConversationService -import com.h6ah4i.android.widget.advrecyclerview.animator.SwipeDismissItemAnimator -import com.h6ah4i.android.widget.advrecyclerview.decoration.SimpleListDividerDecorator -import com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager -import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchActionGuardManager -import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils import io.github.kobakei.materialfabspeeddial.FabSpeedDialMenu +import io.reactivex.disposables.Disposable import kotlinx.android.synthetic.main.fragment_message_list.* -import org.jetbrains.anko.cancelButton -import org.jetbrains.anko.doAsync -import org.jetbrains.anko.support.v4.alert -import org.jetbrains.anko.support.v4.onUiThread -import org.jetbrains.anko.uiThread +import org.jetbrains.anko.* import java.util.* private const val PAGE_SIZE = 15 @@ -70,12 +63,9 @@ class ConversationListFragment : Fragment(), ListHolder