Clean some code
This commit is contained in:
parent
9e436483de
commit
8e3234d188
|
@ -14,3 +14,5 @@
|
|||
/tmp
|
||||
|
||||
ktlint
|
||||
.idea/copyright/New_vector.xml
|
||||
.idea/copyright/profiles_settings.xml
|
||||
|
|
|
@ -8,7 +8,8 @@ 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
|
||||
- Attachments: start using system pickers (#52)
|
||||
- Attachments: start handling incoming share (#58)
|
||||
|
||||
Other changes:
|
||||
- Accessibility improvements to read receipts in the room timeline and reactions emoji chooser
|
||||
|
|
|
@ -80,18 +80,18 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".features.share.IncomingShareActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<activity android:name=".features.share.IncomingShareActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<data android:mimeType="*/*" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.OPENABLE" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
<data android:mimeType="*/*" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.OPENABLE" />
|
||||
</intent-filter>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* Copyright 2019 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package im.vector.riotx
|
||||
|
||||
import arrow.core.Option
|
||||
|
|
|
@ -28,10 +28,11 @@ data class ContactAttachment(
|
|||
) {
|
||||
|
||||
fun toHumanReadable(): String {
|
||||
val stringBuilder = StringBuilder(displayName)
|
||||
phones.concatIn(stringBuilder)
|
||||
emails.concatIn(stringBuilder)
|
||||
return stringBuilder.toString()
|
||||
return buildString {
|
||||
append(displayName)
|
||||
phones.concatIn(this)
|
||||
emails.concatIn(this)
|
||||
}
|
||||
}
|
||||
|
||||
private fun List<String>.concatIn(stringBuilder: StringBuilder) {
|
||||
|
|
|
@ -1126,6 +1126,7 @@ class RoomDetailFragment :
|
|||
}
|
||||
|
||||
override fun onContactAttachmentReady(contactAttachment: ContactAttachment) {
|
||||
super.onContactAttachmentReady(contactAttachment)
|
||||
val formattedContact = contactAttachment.toHumanReadable()
|
||||
roomDetailViewModel.process(RoomDetailActions.SendMessage(formattedContact, false))
|
||||
}
|
||||
|
|
|
@ -69,10 +69,10 @@ class IncomingShareActivity :
|
|||
isShareManaged = handleTextShare(intent)
|
||||
}
|
||||
if (!isShareManaged) {
|
||||
cannottManageShare()
|
||||
cannotManageShare()
|
||||
}
|
||||
} else {
|
||||
cannottManageShare()
|
||||
cannotManageShare()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,10 +83,10 @@ class IncomingShareActivity :
|
|||
}
|
||||
|
||||
override fun onAttachmentsProcessFailed() {
|
||||
cannottManageShare()
|
||||
cannotManageShare()
|
||||
}
|
||||
|
||||
private fun cannottManageShare() {
|
||||
private fun cannotManageShare() {
|
||||
Toast.makeText(this, R.string.error_handling_incoming_share, Toast.LENGTH_LONG).show()
|
||||
finish()
|
||||
}
|
||||
|
|
|
@ -3,9 +3,4 @@
|
|||
<cache-path
|
||||
name="shared"
|
||||
path="/" />
|
||||
|
||||
<external-path
|
||||
name="external_files"
|
||||
path="." />
|
||||
|
||||
</paths>
|
Loading…
Reference in New Issue