From 679b0fff985a9720015f72c047c265e1d10fd024 Mon Sep 17 00:00:00 2001 From: ganfra Date: Fri, 11 Oct 2019 17:12:53 +0200 Subject: [PATCH] Use klint and update CHANGES --- CHANGES.md | 1 + .../java/im/vector/riotx/core/extensions/ViewExtensions.kt | 2 +- .../java/im/vector/riotx/core/utils/KeyboardStateUtils.kt | 2 +- .../features/attachments/AttachmentTypeSelectorView.kt | 5 ----- .../vector/riotx/features/attachments/AttachmentsHelper.kt | 3 +-- .../features/attachments/AttachmentsPickerCallback.kt | 4 +--- .../vector/riotx/features/attachments/ContactAttachment.kt | 3 +-- .../riotx/features/attachments/PickerManagerFactory.kt | 3 --- .../riotx/features/home/room/detail/RoomDetailFragment.kt | 7 +------ .../vector/riotx/features/navigation/DefaultNavigator.kt | 1 - .../java/im/vector/riotx/features/navigation/Navigator.kt | 1 - .../vector/riotx/features/share/IncomingShareActivity.kt | 3 +-- .../main/java/im/vector/riotx/features/share/SharedData.kt | 3 +-- 13 files changed, 9 insertions(+), 29 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 42fb2cc291..5cac7e8f70 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Improvements: - Persist active tab between sessions (#503) - Do not upload file too big for the homeserver (#587) - Handle read markers (#84) + - Attachments: start using system pickers Other changes: - Accessibility improvements to read receipts in the room timeline and reactions emoji chooser diff --git a/vector/src/main/java/im/vector/riotx/core/extensions/ViewExtensions.kt b/vector/src/main/java/im/vector/riotx/core/extensions/ViewExtensions.kt index 631df78b5e..e7bd2122b6 100644 --- a/vector/src/main/java/im/vector/riotx/core/extensions/ViewExtensions.kt +++ b/vector/src/main/java/im/vector/riotx/core/extensions/ViewExtensions.kt @@ -54,4 +54,4 @@ fun View.getMeasurements(): Pair { val width = measuredWidth val height = measuredHeight return width to height -} \ No newline at end of file +} diff --git a/vector/src/main/java/im/vector/riotx/core/utils/KeyboardStateUtils.kt b/vector/src/main/java/im/vector/riotx/core/utils/KeyboardStateUtils.kt index dd41d0d28b..d1db11c21d 100644 --- a/vector/src/main/java/im/vector/riotx/core/utils/KeyboardStateUtils.kt +++ b/vector/src/main/java/im/vector/riotx/core/utils/KeyboardStateUtils.kt @@ -20,4 +20,4 @@ class KeyboardStateUtils(activity: Activity) : ViewTreeObserver.OnGlobalLayoutLi val keypadHeight = screenHeight - rect.bottom isKeyboardShowing = keypadHeight > screenHeight * 0.15 } -} \ No newline at end of file +} diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentTypeSelectorView.kt b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentTypeSelectorView.kt index d9fd3021e3..6d71d88eb2 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentTypeSelectorView.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentTypeSelectorView.kt @@ -141,7 +141,6 @@ class AttachmentTypeSelectorView(context: Context, button.startAnimation(animation) } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) private fun animateWindowInCircular(anchor: View?, contentView: View) { val coordinates = getClickCoordinates(anchor, contentView) @@ -216,7 +215,6 @@ class AttachmentTypeSelectorView(context: Context, dismiss() callback?.onTypeSelected(type) } - } /** @@ -230,8 +228,5 @@ class AttachmentTypeSelectorView(context: Context, STICKER(PERMISSIONS_EMPTY), AUDIO(PERMISSIONS_FOR_WRITING_FILES), CONTACT(PERMISSIONS_FOR_PICKING_CONTACT) - } - - } diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt index 89a397c441..dd0d6cd79c 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt @@ -186,5 +186,4 @@ class AttachmentsHelper private constructor(private val pickerManagerFactory: Pi else -> null } } - -} \ No newline at end of file +} diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsPickerCallback.kt b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsPickerCallback.kt index e1fb2eec65..5a2dd4d144 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsPickerCallback.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsPickerCallback.kt @@ -22,7 +22,6 @@ import com.kbeanie.multipicker.api.callbacks.FilePickerCallback import com.kbeanie.multipicker.api.callbacks.ImagePickerCallback import com.kbeanie.multipicker.api.callbacks.VideoPickerCallback import com.kbeanie.multipicker.api.entity.* -import timber.log.Timber /** * This class delegates the PickerManager callbacks to an [AttachmentsHelper.Callback] @@ -85,5 +84,4 @@ class AttachmentsPickerCallback(private val callback: AttachmentsHelper.Callback override fun onError(error: String?) { callback.onAttachmentsProcessFailed() } - -} \ No newline at end of file +} diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/ContactAttachment.kt b/vector/src/main/java/im/vector/riotx/features/attachments/ContactAttachment.kt index dbbed4d5fc..51c60ee4f6 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/ContactAttachment.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/ContactAttachment.kt @@ -28,5 +28,4 @@ data class ContactAttachment( stringBuilder.append(last()) } } - -} \ No newline at end of file +} diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/PickerManagerFactory.kt b/vector/src/main/java/im/vector/riotx/features/attachments/PickerManagerFactory.kt index 8bfe44308d..6c03f21ab3 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/PickerManagerFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/PickerManagerFactory.kt @@ -41,7 +41,6 @@ interface PickerManagerFactory { fun createAudioPicker(): AudioPicker fun createContactPicker(): ContactPicker - } class ActivityPickerManagerFactory(private val activity: Activity, callback: AttachmentsHelper.Callback) : PickerManagerFactory { @@ -132,6 +131,4 @@ class FragmentPickerManagerFactory(private val fragment: Fragment, callback: Att it.setContactPickerCallback(attachmentsPickerCallback) } } - } - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index 0599dce3d1..f30ee4d97d 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -117,7 +117,6 @@ import kotlinx.android.synthetic.main.merge_overlay_waiting_view.* import org.commonmark.parser.Parser import timber.log.Timber import java.io.File -import java.security.Key import javax.inject.Inject @Parcelize @@ -127,7 +126,6 @@ data class RoomDetailArgs( val sharedData: SharedData? = null ) : Parcelable - private const val REACTION_SELECT_REQUEST_CODE = 0 class RoomDetailFragment : @@ -207,7 +205,6 @@ class RoomDetailFragment : private var lockSendButton = false - override fun injectWith(injector: ScreenComponent) { injector.inject(this) } @@ -284,7 +281,6 @@ class RoomDetailFragment : null -> Timber.v("No share data to process") } } - } override fun onDestroy() { @@ -441,14 +437,13 @@ class RoomDetailFragment : ?: return val reaction = data.getStringExtra(EmojiReactionPickerActivity.EXTRA_REACTION_RESULT) ?: return - //TODO check if already reacted with that? + // TODO check if already reacted with that? roomDetailViewModel.process(RoomDetailActions.SendReaction(reaction, eventId)) } } } } - // PRIVATE METHODS ***************************************************************************** private fun setupRecyclerView() { diff --git a/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt index 4a0852925e..a3f9c009ed 100644 --- a/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt @@ -19,7 +19,6 @@ package im.vector.riotx.features.navigation import android.app.Activity import android.content.Context import android.content.Intent -import im.vector.matrix.android.api.session.content.ContentAttachmentData import im.vector.matrix.android.api.session.room.model.roomdirectory.PublicRoom import im.vector.riotx.R import im.vector.riotx.core.platform.VectorBaseActivity diff --git a/vector/src/main/java/im/vector/riotx/features/navigation/Navigator.kt b/vector/src/main/java/im/vector/riotx/features/navigation/Navigator.kt index 3591c1695c..4112dbbfc8 100644 --- a/vector/src/main/java/im/vector/riotx/features/navigation/Navigator.kt +++ b/vector/src/main/java/im/vector/riotx/features/navigation/Navigator.kt @@ -18,7 +18,6 @@ package im.vector.riotx.features.navigation import android.app.Activity import android.content.Context -import im.vector.matrix.android.api.session.content.ContentAttachmentData import im.vector.matrix.android.api.session.room.model.roomdirectory.PublicRoom import im.vector.riotx.features.share.SharedData diff --git a/vector/src/main/java/im/vector/riotx/features/share/IncomingShareActivity.kt b/vector/src/main/java/im/vector/riotx/features/share/IncomingShareActivity.kt index e5fbebf824..73f20cf201 100644 --- a/vector/src/main/java/im/vector/riotx/features/share/IncomingShareActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/share/IncomingShareActivity.kt @@ -18,7 +18,6 @@ import im.vector.riotx.features.login.LoginActivity import kotlinx.android.synthetic.main.activity_incoming_share.* import javax.inject.Inject - class IncomingShareActivity : VectorBaseActivity(), AttachmentsHelper.Callback { @@ -97,4 +96,4 @@ class IncomingShareActivity : startActivity(intent) finish() } -} \ No newline at end of file +} diff --git a/vector/src/main/java/im/vector/riotx/features/share/SharedData.kt b/vector/src/main/java/im/vector/riotx/features/share/SharedData.kt index 37776f004b..741d7b0eb3 100644 --- a/vector/src/main/java/im/vector/riotx/features/share/SharedData.kt +++ b/vector/src/main/java/im/vector/riotx/features/share/SharedData.kt @@ -27,5 +27,4 @@ sealed class SharedData: Parcelable { @Parcelize data class Attachments(val attachmentData: List): SharedData() - -} \ No newline at end of file +}