Clean after Benoit's review

This commit is contained in:
ganfra 2019-10-15 11:37:22 +02:00
parent 3c3c6aeac6
commit 6cd04525aa
7 changed files with 62 additions and 15 deletions

View File

@ -316,7 +316,6 @@ dependencies {
implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
// File picker
implementation 'com.github.jaiselrahman:FilePicker:1.2.2'
implementation 'com.kbeanie:multipicker:1.6@aar'
// DI

View File

@ -85,16 +85,12 @@
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<!-- Configure specific file types that you want to handle -->
<!-- <data android:mimeType="video/*" -->
<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"/>
<!-- Configure specific file types that you want to handle -->
<!-- <data android:mimeType="image/*" -->
<data android:mimeType="*/*"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />

View File

@ -339,11 +339,6 @@ SOFTWARE.
<br/>
Copyright 2014 Leo Lin
</li>
<li>
<b>FilePicker</b>
<br/>
Copyright (c) 2018, Jaisel Rahman
</li>
<li>
<b>diff-match-patch</b>
<br/>
@ -359,6 +354,11 @@ SOFTWARE.
<br/>
Copyright 2017 Gabriel Ittner.
</li>
<li>
<b>Android-multipicker-library</b>
<br/>
Copyright 2018 Kumar Bibek
</li>
</ul>
<pre>
Apache License

View File

@ -1,3 +1,19 @@
/*
* 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.core.utils
import android.app.Activity
@ -11,6 +27,7 @@ class KeyboardStateUtils(activity: Activity) : ViewTreeObserver.OnGlobalLayoutLi
it.viewTreeObserver.addOnGlobalLayoutListener(this)
}
var isKeyboardShowing: Boolean = false
private set
override fun onGlobalLayout() {
val rect = Rect()

View File

@ -22,6 +22,7 @@ import androidx.fragment.app.Fragment
import com.kbeanie.multipicker.api.Picker.*
import com.kbeanie.multipicker.core.PickerManager
import com.kbeanie.multipicker.utils.IntentUtils
import im.vector.matrix.android.BuildConfig
import im.vector.matrix.android.api.session.content.ContentAttachmentData
import im.vector.riotx.core.platform.Restorable
import timber.log.Timber
@ -47,7 +48,9 @@ class AttachmentsHelper private constructor(private val pickerManagerFactory: Pi
interface Callback {
fun onContactAttachmentReady(contactAttachment: ContactAttachment) {
Timber.v("On contact attachment ready: $contactAttachment")
if (BuildConfig.LOG_PRIVATE_DATA) {
Timber.v("On contact attachment ready: $contactAttachment")
}
}
fun onContentAttachmentsReady(attachments: List<ContentAttachmentData>)

View File

@ -1,3 +1,19 @@
/*
* 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.features.attachments
/**

View File

@ -1,3 +1,19 @@
/*
* 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.features.share
import android.content.ClipDescription
@ -53,10 +69,10 @@ class IncomingShareActivity :
isShareManaged = handleTextShare(intent)
}
if (!isShareManaged) {
cantManageShare()
cannottManageShare()
}
} else {
cantManageShare()
cannottManageShare()
}
}
@ -67,10 +83,10 @@ class IncomingShareActivity :
}
override fun onAttachmentsProcessFailed() {
cantManageShare()
cannottManageShare()
}
private fun cantManageShare() {
private fun cannottManageShare() {
Toast.makeText(this, R.string.error_handling_incoming_share, Toast.LENGTH_LONG).show()
finish()
}