Fixed Unresolved reference: ColorRole and Exceeded max line length issue

This commit is contained in:
Smarshall 2023-08-23 17:04:28 +05:30
parent 4121f538c0
commit 62a79fa144
7 changed files with 28 additions and 13 deletions

View file

@ -428,9 +428,9 @@ class CallActivity : CallBaseActivity() {
if (viewState.showStartedInfo) { if (viewState.showStartedInfo) {
vibrateShort(context) vibrateShort(context)
Snackbar.make( Snackbar.make(
binding!!.root, context.resources.getString(R.string.record_active_info), Snackbar binding!!.root,
.LENGTH_LONG) context.resources.getString(R.string.record_active_info),
.show() Snackbar.LENGTH_LONG).show()
} }
} else if (viewState is RecordingStartingState) { } else if (viewState is RecordingStartingState) {
if (isAllowedToStartOrStopRecording) { if (isAllowedToStartOrStopRecording) {

View file

@ -44,6 +44,7 @@ import com.nextcloud.talk.databinding.ItemCustomOutcomingLocationMessageBinding
import com.nextcloud.talk.models.json.chat.ChatMessage import com.nextcloud.talk.models.json.chat.ChatMessage
import com.nextcloud.talk.models.json.chat.ReadStatus import com.nextcloud.talk.models.json.chat.ReadStatus
import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.android.common.ui.theme.utils.ColorRole
import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.ApiUtils
import com.nextcloud.talk.utils.DateUtils import com.nextcloud.talk.utils.DateUtils
import com.nextcloud.talk.utils.UriUtils import com.nextcloud.talk.utils.UriUtils

View file

@ -594,8 +594,9 @@ class ConversationInfoActivity :
} }
override fun onNext(genericOverall: GenericOverall) { override fun onNext(genericOverall: GenericOverall) {
Snackbar.make(binding.root, context.getString(R.string.nc_clear_history_success), Snackbar.LENGTH_LONG) Snackbar.make(binding.root,
.show() context.getString(R.string.nc_clear_history_success),
Snackbar.LENGTH_LONG).show()
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {

View file

@ -151,8 +151,9 @@ class GuestAccessHelper(
override fun onComplete() { override fun onComplete() {
if (resendInvitationsResult.successful) { if (resendInvitationsResult.successful) {
Snackbar.make(binding.root, R.string.nc_guest_access_resend_invitations_successful, Snackbar.LENGTH_SHORT) Snackbar.make(binding.root,
.show() R.string.nc_guest_access_resend_invitations_successful,
Snackbar.LENGTH_SHORT).show()
} }
} }
} }

View file

@ -744,8 +744,7 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
Manifest.permission.POST_NOTIFICATIONS Manifest.permission.POST_NOTIFICATIONS
) != PackageManager.PERMISSION_GRANTED ) != PackageManager.PERMISSION_GRANTED
) { ) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding // here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions, // public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults) // int[] grantResults)

View file

@ -319,7 +319,11 @@ class LocationPickerActivity :
binding.centerMapButton.setOnClickListener { binding.centerMapButton.setOnClickListener {
if (myLocation.latitude == COORDINATE_ZERO && myLocation.longitude == COORDINATE_ZERO) { if (myLocation.latitude == COORDINATE_ZERO && myLocation.longitude == COORDINATE_ZERO) {
Snackbar.make(binding.root, context.getString(R.string.nc_location_unknown), Snackbar.LENGTH_LONG).show() Snackbar.make(
binding.root,
context.getString(R.string.nc_location_unknown),
Snackbar.LENGTH_LONG
).show()
} else { } else {
mapController.animateTo(myLocation) mapController.animateTo(myLocation)
moveToCurrentLocation = true moveToCurrentLocation = true
@ -341,11 +345,13 @@ class LocationPickerActivity :
setLocationDescription(isGpsLocation = true, isGeocodedResult = false) setLocationDescription(isGpsLocation = true, isGeocodedResult = false)
moveToCurrentLocation = false moveToCurrentLocation = false
} }
geocodingResult != null -> { geocodingResult != null -> {
binding.shareLocation.isClickable = true binding.shareLocation.isClickable = true
setLocationDescription(isGpsLocation = false, isGeocodedResult = true) setLocationDescription(isGpsLocation = false, isGeocodedResult = true)
geocodingResult = null geocodingResult = null
} }
else -> { else -> {
binding.shareLocation.isClickable = true binding.shareLocation.isClickable = true
setLocationDescription(isGpsLocation = false, isGeocodedResult = false) setLocationDescription(isGpsLocation = false, isGeocodedResult = false)
@ -377,6 +383,7 @@ class LocationPickerActivity :
this this
) )
} }
locationManager!!.isProviderEnabled(LocationManager.GPS_PROVIDER) -> { locationManager!!.isProviderEnabled(LocationManager.GPS_PROVIDER) -> {
locationManager!!.requestLocationUpdates( locationManager!!.requestLocationUpdates(
LocationManager.GPS_PROVIDER, LocationManager.GPS_PROVIDER,
@ -386,6 +393,7 @@ class LocationPickerActivity :
) )
Log.d(TAG, "LocationManager.NETWORK_PROVIDER falling back to LocationManager.GPS_PROVIDER") Log.d(TAG, "LocationManager.NETWORK_PROVIDER falling back to LocationManager.GPS_PROVIDER")
} }
else -> { else -> {
Log.e( Log.e(
TAG, TAG,
@ -413,11 +421,13 @@ class LocationPickerActivity :
binding.placeName.visibility = View.GONE binding.placeName.visibility = View.GONE
binding.placeName.text = "" binding.placeName.text = ""
} }
isGeocodedResult -> { isGeocodedResult -> {
binding.shareLocationDescription.text = context!!.getText(R.string.nc_share_this_location) binding.shareLocationDescription.text = context!!.getText(R.string.nc_share_this_location)
binding.placeName.visibility = View.VISIBLE binding.placeName.visibility = View.VISIBLE
binding.placeName.text = geocodingResult?.displayName binding.placeName.text = geocodingResult?.displayName
} }
else -> { else -> {
binding.shareLocationDescription.text = context!!.getText(R.string.nc_share_this_location) binding.shareLocationDescription.text = context!!.getText(R.string.nc_share_this_location)
binding.placeName.visibility = View.GONE binding.placeName.visibility = View.GONE
@ -531,8 +541,11 @@ class LocationPickerActivity :
if (requestCode == REQUEST_PERMISSIONS_REQUEST_CODE && areAllGranted(grantResults)) { if (requestCode == REQUEST_PERMISSIONS_REQUEST_CODE && areAllGranted(grantResults)) {
initMap() initMap()
} else { } else {
Snackbar.make(binding.root, context!!.getString(R.string.nc_location_permission_required), Snackbar.LENGTH_LONG) Snackbar.make(
.show() binding.root,
context!!.getString(R.string.nc_location_permission_required),
Snackbar.LENGTH_LONG
).show()
} }
} }

View file

@ -95,7 +95,7 @@ class ShareRecordingToChatReceiver : BroadcastReceiver() {
// For this reason there is only a Snackbar for now until we got rid of conductor. // For this reason there is only a Snackbar for now until we got rid of conductor.
Snackbar.make( Snackbar.make(
View(context), View(context),
context.resources.getString(R.string.nc_all_ok_operation), context.resources.getString(R.string.nc_all_ok_operation),
Snackbar.LENGTH_LONG Snackbar.LENGTH_LONG
).show() ).show()