mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 19:05:56 +03:00
Merge branch 'develop' into feature/icons
This commit is contained in:
commit
39fa7d850a
7 changed files with 45 additions and 17 deletions
|
@ -5,11 +5,12 @@ Features ✨:
|
|||
-
|
||||
|
||||
Improvements 🙌:
|
||||
-
|
||||
- Add long click gesture to copy userId, user display name, room name, room topic and room alias (#1774)
|
||||
|
||||
Bugfix 🐛:
|
||||
- Display name not shown under Settings/General (#1926)
|
||||
- Fix bad color for settings icon on Android < 24 (#1786)
|
||||
- Change user or room avatar: when selecting Gallery, I'm not proposed to crop the selected image (#1590)
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
|
|
@ -378,7 +378,7 @@ dependencies {
|
|||
implementation "com.github.bumptech.glide:glide:$glide_version"
|
||||
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
||||
implementation 'com.danikula:videocache:2.7.1'
|
||||
implementation 'com.github.yalantis:ucrop:2.2.4'
|
||||
implementation 'com.github.yalantis:ucrop:2.2.6'
|
||||
|
||||
// Badge for compatibility
|
||||
implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
|
||||
|
|
|
@ -24,7 +24,9 @@ import android.widget.TextView
|
|||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.view.isVisible
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.utils.copyToClipboard
|
||||
import im.vector.app.features.themes.ThemeUtils
|
||||
|
||||
/**
|
||||
|
@ -68,3 +70,18 @@ fun TextView.setTextWithColoredPart(@StringRes fullTextRes: Int,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set long click listener to copy the current text of the TextView to the clipboard and show a Snackbar
|
||||
*/
|
||||
fun TextView.copyOnLongClick() {
|
||||
setOnLongClickListener { view ->
|
||||
(view as? TextView)
|
||||
?.text
|
||||
?.let { text ->
|
||||
copyToClipboard(view.context, text, false)
|
||||
Snackbar.make(view, view.resources.getString(R.string.copied_to_clipboard), Snackbar.LENGTH_SHORT).show()
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,9 +144,7 @@ class BigImageViewerActivity : VectorBaseActivity() {
|
|||
.get(MultiPicker.IMAGE)
|
||||
.getSelectedFiles(this, requestCode, resultCode, data)
|
||||
.firstOrNull()?.let {
|
||||
// TODO. UCrop library cannot read from Gallery. For now, we will set avatar as it is.
|
||||
// onRoomAvatarSelected(it)
|
||||
onAvatarCropped(it.contentUri)
|
||||
onRoomAvatarSelected(it)
|
||||
}
|
||||
}
|
||||
UCrop.REQUEST_CROP -> data?.let { onAvatarCropped(UCrop.getOutput(it)) }
|
||||
|
|
|
@ -35,6 +35,7 @@ import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener
|
|||
import im.vector.app.core.dialogs.ConfirmationDialogBuilder
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.extensions.copyOnLongClick
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.platform.StateView
|
||||
|
@ -44,11 +45,11 @@ import im.vector.app.features.crypto.verification.VerificationBottomSheet
|
|||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.roommemberprofile.devices.DeviceListBottomSheet
|
||||
import im.vector.app.features.roommemberprofile.powerlevel.EditPowerLevelDialogs
|
||||
import org.matrix.android.sdk.api.session.room.powerlevels.Role
|
||||
import org.matrix.android.sdk.api.util.MatrixItem
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.android.synthetic.main.fragment_matrix_profile.*
|
||||
import kotlinx.android.synthetic.main.view_stub_room_member_profile_header.*
|
||||
import org.matrix.android.sdk.api.session.room.powerlevels.Role
|
||||
import org.matrix.android.sdk.api.util.MatrixItem
|
||||
import javax.inject.Inject
|
||||
|
||||
@Parcelize
|
||||
|
@ -110,6 +111,12 @@ class RoomMemberProfileFragment @Inject constructor(
|
|||
is RoomMemberProfileViewEvents.OnInviteActionSuccess -> Unit
|
||||
}.exhaustive
|
||||
}
|
||||
setupLongClicks()
|
||||
}
|
||||
|
||||
private fun setupLongClicks() {
|
||||
memberProfileNameView.copyOnLongClick()
|
||||
memberProfileIdView.copyOnLongClick()
|
||||
}
|
||||
|
||||
private fun handleShowPowerLevelDemoteWarning(event: RoomMemberProfileViewEvents.ShowPowerLevelDemoteWarning) {
|
||||
|
|
|
@ -34,16 +34,12 @@ import com.airbnb.mvrx.args
|
|||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import com.yalantis.ucrop.UCrop
|
||||
import im.vector.lib.multipicker.MultiPicker
|
||||
import im.vector.lib.multipicker.entity.MultiPickerImageType
|
||||
import org.matrix.android.sdk.api.session.room.notification.RoomNotificationState
|
||||
import org.matrix.android.sdk.api.util.MatrixItem
|
||||
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.animations.AppBarStateChangeListener
|
||||
import im.vector.app.core.animations.MatrixItemAppBarStateChangeListener
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.extensions.copyOnLongClick
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.intent.getFilenameFromUri
|
||||
|
@ -62,9 +58,14 @@ import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedA
|
|||
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedActionViewModel
|
||||
import im.vector.app.features.media.BigImageViewerActivity
|
||||
import im.vector.app.features.media.createUCropWithDefaultSettings
|
||||
import im.vector.lib.multipicker.MultiPicker
|
||||
import im.vector.lib.multipicker.entity.MultiPickerImageType
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.android.synthetic.main.fragment_matrix_profile.*
|
||||
import kotlinx.android.synthetic.main.view_stub_room_profile_header.*
|
||||
import org.matrix.android.sdk.api.session.room.notification.RoomNotificationState
|
||||
import org.matrix.android.sdk.api.util.MatrixItem
|
||||
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||
import timber.log.Timber
|
||||
import java.io.File
|
||||
import javax.inject.Inject
|
||||
|
@ -120,6 +121,13 @@ class RoomProfileFragment @Inject constructor(
|
|||
.observe()
|
||||
.subscribe { handleQuickActions(it) }
|
||||
.disposeOnDestroyView()
|
||||
setupLongClicks()
|
||||
}
|
||||
|
||||
private fun setupLongClicks() {
|
||||
roomProfileNameView.copyOnLongClick()
|
||||
roomProfileAliasView.copyOnLongClick()
|
||||
roomProfileTopicView.copyOnLongClick()
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
|
@ -301,9 +309,7 @@ class RoomProfileFragment @Inject constructor(
|
|||
.get(MultiPicker.IMAGE)
|
||||
.getSelectedFiles(requireContext(), requestCode, resultCode, data)
|
||||
.firstOrNull()?.let {
|
||||
// TODO. UCrop library cannot read from Gallery. For now, we will set avatar as it is.
|
||||
// onRoomAvatarSelected(it)
|
||||
onAvatarCropped(it.contentUri)
|
||||
onRoomAvatarSelected(it)
|
||||
}
|
||||
}
|
||||
UCrop.REQUEST_CROP -> data?.let { onAvatarCropped(UCrop.getOutput(it)) }
|
||||
|
|
|
@ -356,8 +356,7 @@ class VectorSettingsGeneralFragment : VectorSettingsBaseFragment() {
|
|||
.get(MultiPicker.IMAGE)
|
||||
.getSelectedFiles(requireContext(), requestCode, resultCode, data)
|
||||
.firstOrNull()?.let {
|
||||
// TODO. UCrop library cannot read from Gallery. For now, we will set avatar as it is.
|
||||
onAvatarCropped(it.contentUri)
|
||||
onAvatarSelected(it)
|
||||
}
|
||||
}
|
||||
UCrop.REQUEST_CROP -> data?.let { onAvatarCropped(UCrop.getOutput(it)) }
|
||||
|
|
Loading…
Reference in a new issue