mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 11:23:38 +00:00
fix: compile issues and deprecate java for kotlin lint
This commit is contained in:
parent
7f7971e47f
commit
41c05b1e67
@ -87,14 +87,13 @@ class ConversationActionBarView : LinearLayout {
|
|||||||
R.dimen.small_profile_picture_size
|
R.dimen.small_profile_picture_size
|
||||||
}
|
}
|
||||||
val size = resources.getDimension(sizeID).roundToInt()
|
val size = resources.getDimension(sizeID).roundToInt()
|
||||||
binding.profilePictureView.root.layoutParams = LayoutParams(size, size)
|
binding.profilePictureView.layoutParams = LayoutParams(size, size)
|
||||||
binding.profilePictureView.root.glide = glide
|
|
||||||
MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded(threadId, context)
|
MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded(threadId, context)
|
||||||
update(recipient, openGroup, config)
|
update(recipient, openGroup, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun update(recipient: Recipient, openGroup: OpenGroup? = null, config: ExpirationConfiguration? = null) {
|
fun update(recipient: Recipient, openGroup: OpenGroup? = null, config: ExpirationConfiguration? = null) {
|
||||||
binding.profilePictureView.root.update(recipient)
|
binding.profilePictureView.update(recipient)
|
||||||
binding.conversationTitleView.text = when {
|
binding.conversationTitleView.text = when {
|
||||||
recipient.isLocalNumber -> context.getString(R.string.note_to_self)
|
recipient.isLocalNumber -> context.getString(R.string.note_to_self)
|
||||||
else -> recipient.toShortString()
|
else -> recipient.toShortString()
|
||||||
@ -104,7 +103,7 @@ class ConversationActionBarView : LinearLayout {
|
|||||||
val marginEnd = if (recipient.showCallMenu()) {
|
val marginEnd = if (recipient.showCallMenu()) {
|
||||||
0
|
0
|
||||||
} else {
|
} else {
|
||||||
binding.profilePictureView.root.width
|
binding.profilePictureView.width
|
||||||
}
|
}
|
||||||
val lp = binding.conversationTitleContainer.layoutParams as MarginLayoutParams
|
val lp = binding.conversationTitleContainer.layoutParams as MarginLayoutParams
|
||||||
lp.marginEnd = marginEnd
|
lp.marginEnd = marginEnd
|
||||||
|
@ -111,9 +111,9 @@ import org.thoughtcrime.securesms.conversation.expiration.ExpirationSettingsActi
|
|||||||
import org.thoughtcrime.securesms.conversation.v2.ConversationReactionOverlay.OnActionSelectedListener
|
import org.thoughtcrime.securesms.conversation.v2.ConversationReactionOverlay.OnActionSelectedListener
|
||||||
import org.thoughtcrime.securesms.conversation.v2.ConversationReactionOverlay.OnReactionSelectedListener
|
import org.thoughtcrime.securesms.conversation.v2.ConversationReactionOverlay.OnReactionSelectedListener
|
||||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.MESSAGE_TIMESTAMP
|
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.MESSAGE_TIMESTAMP
|
||||||
|
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_DELETE
|
||||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_REPLY
|
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_REPLY
|
||||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_RESEND
|
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_RESEND
|
||||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_DELETE
|
|
||||||
import org.thoughtcrime.securesms.conversation.v2.dialogs.BlockedDialog
|
import org.thoughtcrime.securesms.conversation.v2.dialogs.BlockedDialog
|
||||||
import org.thoughtcrime.securesms.conversation.v2.dialogs.LinkPreviewDialog
|
import org.thoughtcrime.securesms.conversation.v2.dialogs.LinkPreviewDialog
|
||||||
import org.thoughtcrime.securesms.conversation.v2.dialogs.SendSeedDialog
|
import org.thoughtcrime.securesms.conversation.v2.dialogs.SendSeedDialog
|
||||||
@ -172,7 +172,6 @@ import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
|
|||||||
import org.thoughtcrime.securesms.util.DateUtils
|
import org.thoughtcrime.securesms.util.DateUtils
|
||||||
import org.thoughtcrime.securesms.util.MediaUtil
|
import org.thoughtcrime.securesms.util.MediaUtil
|
||||||
import org.thoughtcrime.securesms.util.SaveAttachmentTask
|
import org.thoughtcrime.securesms.util.SaveAttachmentTask
|
||||||
import org.thoughtcrime.securesms.util.drawToBitmap
|
|
||||||
import org.thoughtcrime.securesms.util.isScrolledToBottom
|
import org.thoughtcrime.securesms.util.isScrolledToBottom
|
||||||
import org.thoughtcrime.securesms.util.push
|
import org.thoughtcrime.securesms.util.push
|
||||||
import org.thoughtcrime.securesms.util.show
|
import org.thoughtcrime.securesms.util.show
|
||||||
@ -1681,6 +1680,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||||||
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults)
|
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, intent)
|
super.onActivityResult(requestCode, resultCode, intent)
|
||||||
val mediaPreppedListener = object : ListenableFuture.Listener<Boolean> {
|
val mediaPreppedListener = object : ListenableFuture.Listener<Boolean> {
|
||||||
|
@ -9,7 +9,6 @@ import android.view.Menu
|
|||||||
import android.view.MenuInflater
|
import android.view.MenuInflater
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.ColorInt
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.view.ContextThemeWrapper
|
import androidx.appcompat.view.ContextThemeWrapper
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
@ -36,8 +35,8 @@ import org.thoughtcrime.securesms.groups.EditClosedGroupActivity
|
|||||||
import org.thoughtcrime.securesms.groups.EditClosedGroupActivity.Companion.groupIDKey
|
import org.thoughtcrime.securesms.groups.EditClosedGroupActivity.Companion.groupIDKey
|
||||||
import org.thoughtcrime.securesms.preferences.PrivacySettingsActivity
|
import org.thoughtcrime.securesms.preferences.PrivacySettingsActivity
|
||||||
import org.thoughtcrime.securesms.service.WebRtcCallService
|
import org.thoughtcrime.securesms.service.WebRtcCallService
|
||||||
import org.thoughtcrime.securesms.showSessionDialog
|
|
||||||
import org.thoughtcrime.securesms.showMuteDialog
|
import org.thoughtcrime.securesms.showMuteDialog
|
||||||
|
import org.thoughtcrime.securesms.showSessionDialog
|
||||||
import org.thoughtcrime.securesms.util.BitmapUtil
|
import org.thoughtcrime.securesms.util.BitmapUtil
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
@ -188,6 +187,7 @@ object ConversationMenuHelper {
|
|||||||
private fun addShortcut(context: Context, thread: Recipient) {
|
private fun addShortcut(context: Context, thread: Recipient) {
|
||||||
object : AsyncTask<Void?, Void?, IconCompat?>() {
|
object : AsyncTask<Void?, Void?, IconCompat?>() {
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun doInBackground(vararg params: Void?): IconCompat? {
|
override fun doInBackground(vararg params: Void?): IconCompat? {
|
||||||
var icon: IconCompat? = null
|
var icon: IconCompat? = null
|
||||||
val contactPhoto = thread.contactPhoto
|
val contactPhoto = thread.contactPhoto
|
||||||
@ -206,6 +206,7 @@ object ConversationMenuHelper {
|
|||||||
return icon
|
return icon
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onPostExecute(icon: IconCompat?) {
|
override fun onPostExecute(icon: IconCompat?) {
|
||||||
val name = Optional.fromNullable<String>(thread.name)
|
val name = Optional.fromNullable<String>(thread.name)
|
||||||
.or(Optional.fromNullable<String>(thread.profileName))
|
.or(Optional.fromNullable<String>(thread.profileName))
|
||||||
|
@ -176,6 +176,7 @@ class EditClosedGroupActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Updating
|
// region Updating
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, data)
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
|
@ -71,8 +71,8 @@ import org.thoughtcrime.securesms.onboarding.SeedActivity
|
|||||||
import org.thoughtcrime.securesms.onboarding.SeedReminderViewDelegate
|
import org.thoughtcrime.securesms.onboarding.SeedReminderViewDelegate
|
||||||
import org.thoughtcrime.securesms.permissions.Permissions
|
import org.thoughtcrime.securesms.permissions.Permissions
|
||||||
import org.thoughtcrime.securesms.preferences.SettingsActivity
|
import org.thoughtcrime.securesms.preferences.SettingsActivity
|
||||||
import org.thoughtcrime.securesms.showSessionDialog
|
|
||||||
import org.thoughtcrime.securesms.showMuteDialog
|
import org.thoughtcrime.securesms.showMuteDialog
|
||||||
|
import org.thoughtcrime.securesms.showSessionDialog
|
||||||
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
|
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
|
||||||
import org.thoughtcrime.securesms.util.DateUtils
|
import org.thoughtcrime.securesms.util.DateUtils
|
||||||
import org.thoughtcrime.securesms.util.IP2Country
|
import org.thoughtcrime.securesms.util.IP2Country
|
||||||
@ -447,6 +447,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
|
|||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Interaction
|
// region Interaction
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
if (binding.globalSearchRecycler.isVisible) {
|
if (binding.globalSearchRecycler.isVisible) {
|
||||||
binding.globalSearchInputLayout.clearSearch(true)
|
binding.globalSearchInputLayout.clearSearch(true)
|
||||||
|
@ -54,6 +54,7 @@ class LinkDeviceActivity : BaseActionBarActivity(), ScanQRCodeWrapperFragmentDel
|
|||||||
private val adapter = LinkDeviceActivityAdapter(this)
|
private val adapter = LinkDeviceActivityAdapter(this)
|
||||||
private var restoreJob: Job? = null
|
private var restoreJob: Job? = null
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
if (restoreJob?.isActive == true) return // Don't allow going back with a pending job
|
if (restoreJob?.isActive == true) return // Don't allow going back with a pending job
|
||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
|
@ -59,6 +59,7 @@ class PrivacySettingsPreferenceFragment : ListSummaryPreferenceFragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onRequestPermissionsResult(
|
override fun onRequestPermissionsResult(
|
||||||
requestCode: Int,
|
requestCode: Int,
|
||||||
permissions: Array<String>,
|
permissions: Array<String>,
|
||||||
|
@ -30,9 +30,9 @@ import nl.komponents.kovenant.all
|
|||||||
import nl.komponents.kovenant.ui.alwaysUi
|
import nl.komponents.kovenant.ui.alwaysUi
|
||||||
import nl.komponents.kovenant.ui.successUi
|
import nl.komponents.kovenant.ui.successUi
|
||||||
import org.session.libsession.avatars.AvatarHelper
|
import org.session.libsession.avatars.AvatarHelper
|
||||||
|
import org.session.libsession.avatars.ProfileContactPhoto
|
||||||
import org.session.libsession.messaging.MessagingModuleConfiguration
|
import org.session.libsession.messaging.MessagingModuleConfiguration
|
||||||
import org.session.libsession.snode.SnodeAPI
|
import org.session.libsession.snode.SnodeAPI
|
||||||
import org.session.libsession.avatars.ProfileContactPhoto
|
|
||||||
import org.session.libsession.utilities.*
|
import org.session.libsession.utilities.*
|
||||||
import org.session.libsession.utilities.SSKEnvironment.ProfileManagerProtocol
|
import org.session.libsession.utilities.SSKEnvironment.ProfileManagerProtocol
|
||||||
import org.session.libsession.utilities.recipients.Recipient
|
import org.session.libsession.utilities.recipients.Recipient
|
||||||
@ -151,6 +151,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, data)
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
|
@ -66,6 +66,7 @@ class SaveAttachmentTask @JvmOverloads constructor(context: Context, count: Int
|
|||||||
this.contextReference = WeakReference(context)
|
this.contextReference = WeakReference(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun doInBackground(vararg attachments: Attachment?): Pair<Int, String?> {
|
override fun doInBackground(vararg attachments: Attachment?): Pair<Int, String?> {
|
||||||
if (attachments.isEmpty()) {
|
if (attachments.isEmpty()) {
|
||||||
throw IllegalArgumentException("Must pass in at least one attachment")
|
throw IllegalArgumentException("Must pass in at least one attachment")
|
||||||
@ -227,6 +228,7 @@ class SaveAttachmentTask @JvmOverloads constructor(context: Context, count: Int
|
|||||||
return File(fileName).name
|
return File(fileName).name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onPostExecute(result: Pair<Int, String?>) {
|
override fun onPostExecute(result: Pair<Int, String?>) {
|
||||||
super.onPostExecute(result)
|
super.onPostExecute(result)
|
||||||
val context = contextReference.get() ?: return
|
val context = contextReference.get() ?: return
|
||||||
|
@ -29,6 +29,7 @@ class ScanQRCodeWrapperFragment : Fragment(), ScanQRCodePlaceholderFragmentDeleg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
|
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
|
||||||
super.setUserVisibleHint(isVisibleToUser)
|
super.setUserVisibleHint(isVisibleToUser)
|
||||||
enabled = isVisibleToUser
|
enabled = isVisibleToUser
|
||||||
|
@ -19,6 +19,7 @@ class HangUpRtcOnPstnCallAnsweredListener(private val hangupListener: ()->Unit):
|
|||||||
private val TAG = Log.tag(HangUpRtcOnPstnCallAnsweredListener::class.java)
|
private val TAG = Log.tag(HangUpRtcOnPstnCallAnsweredListener::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java")
|
||||||
override fun onCallStateChanged(state: Int, phoneNumber: String?) {
|
override fun onCallStateChanged(state: Int, phoneNumber: String?) {
|
||||||
super.onCallStateChanged(state, phoneNumber)
|
super.onCallStateChanged(state, phoneNumber)
|
||||||
if (state == TelephonyManager.CALL_STATE_OFFHOOK) {
|
if (state == TelephonyManager.CALL_STATE_OFFHOOK) {
|
||||||
|
@ -7,10 +7,13 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<include layout="@layout/view_profile_picture"
|
<org.thoughtcrime.securesms.components.ProfilePictureView
|
||||||
android:id="@+id/profilePictureView"
|
android:id="@+id/profilePictureView"
|
||||||
android:layout_width="@dimen/medium_profile_picture_size"
|
android:layout_width="@dimen/medium_profile_picture_size"
|
||||||
android:layout_height="@dimen/medium_profile_picture_size" />
|
android:layout_height="@dimen/medium_profile_picture_size"
|
||||||
|
android:layout_marginTop="@dimen/medium_spacing"
|
||||||
|
android:layout_marginStart="@dimen/medium_spacing"
|
||||||
|
android:layout_marginBottom="@dimen/medium_spacing" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/conversationTitleContainer"
|
android:id="@+id/conversationTitleContainer"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user