Merge pull request #5947 from vector-im/feature/bma/renaming

Small changes
This commit is contained in:
Benoit Marty 2022-05-18 16:27:48 +02:00 committed by GitHub
commit 12644e9915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View File

@ -18,11 +18,11 @@ package org.billcarsonfr.jsonviewer
import android.content.ClipData import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context
import android.view.ContextMenu import android.view.ContextMenu
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.content.getSystemService
import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyHolder import com.airbnb.epoxy.EpoxyHolder
import com.airbnb.epoxy.EpoxyModelClass import com.airbnb.epoxy.EpoxyModelClass
@ -77,8 +77,7 @@ internal abstract class ValueItem : EpoxyModelWithHolder<ValueItem.Holder>() {
) { ) {
if (copyValue != null) { if (copyValue != null) {
val menuItem = menu?.add(R.string.copy_value) val menuItem = menu?.add(R.string.copy_value)
val clipService = val clipService = v?.context?.getSystemService<ClipboardManager>()
v?.context?.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
menuItem?.setOnMenuItemClickListener { menuItem?.setOnMenuItemClickListener {
clipService?.setPrimaryClip(ClipData.newPlainText("", copyValue)) clipService?.setPrimaryClip(ClipData.newPlainText("", copyValue))
true true

View File

@ -67,6 +67,9 @@ echo "Search for forbidden patterns in code..."
${searchForbiddenStringsScript} ./tools/check/forbidden_strings_in_code.txt \ ${searchForbiddenStringsScript} ./tools/check/forbidden_strings_in_code.txt \
./matrix-sdk-android/src/main/java \ ./matrix-sdk-android/src/main/java \
./matrix-sdk-android-flow/src/main/java \ ./matrix-sdk-android-flow/src/main/java \
./library/core-utils/src/main/java \
./library/jsonviewer/src/main/java \
./library/ui-styles/src/main/java \
./vector/src/main/java \ ./vector/src/main/java \
./vector/src/debug/java \ ./vector/src/debug/java \
./vector/src/release/java \ ./vector/src/release/java \
@ -100,6 +103,7 @@ echo
echo "Search for forbidden patterns in resources..." echo "Search for forbidden patterns in resources..."
${searchForbiddenStringsScript} ./tools/check/forbidden_strings_in_resources.txt \ ${searchForbiddenStringsScript} ./tools/check/forbidden_strings_in_resources.txt \
./library/ui-styles/src/main/res/values \
./vector/src/main/res/color \ ./vector/src/main/res/color \
./vector/src/main/res/layout \ ./vector/src/main/res/layout \
./vector/src/main/res/values \ ./vector/src/main/res/values \

View File

@ -55,6 +55,7 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.di.ActivityEntryPoint import im.vector.app.core.di.ActivityEntryPoint
import im.vector.app.core.dialogs.DialogLocker import im.vector.app.core.dialogs.DialogLocker
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog import im.vector.app.core.dialogs.UnrecognizedCertificateDialog
import im.vector.app.core.error.fatalError
import im.vector.app.core.extensions.observeEvent import im.vector.app.core.extensions.observeEvent
import im.vector.app.core.extensions.observeNotNull import im.vector.app.core.extensions.observeNotNull
import im.vector.app.core.extensions.registerStartForActivityResult import im.vector.app.core.extensions.registerStartForActivityResult
@ -611,11 +612,7 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
} }
}.show() }.show()
} else { } else {
if (vectorPreferences.failFast()) { fatalError("No CoordinatorLayout to display this snackbar!", vectorPreferences.failFast())
error("No CoordinatorLayout to display this snackbar!")
} else {
Timber.w("No CoordinatorLayout to display this snackbar!")
}
} }
} }

View File

@ -317,6 +317,7 @@ class DefaultNavigator @Inject constructor(
if (context is AppCompatActivity) { if (context is AppCompatActivity) {
if (context !is MatrixToBottomSheet.InteractionListener) { if (context !is MatrixToBottomSheet.InteractionListener) {
fatalError("Caller context should implement MatrixToBottomSheet.InteractionListener", vectorPreferences.failFast()) fatalError("Caller context should implement MatrixToBottomSheet.InteractionListener", vectorPreferences.failFast())
return
} }
// TODO check if there is already one?? // TODO check if there is already one??
MatrixToBottomSheet.withLink(link, origin) MatrixToBottomSheet.withLink(link, origin)