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' implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
// File picker // File picker
implementation 'com.github.jaiselrahman:FilePicker:1.2.2'
implementation 'com.kbeanie:multipicker:1.6@aar' implementation 'com.kbeanie:multipicker:1.6@aar'
// DI // DI

View file

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

View file

@ -339,11 +339,6 @@ SOFTWARE.
<br/> <br/>
Copyright 2014 Leo Lin Copyright 2014 Leo Lin
</li> </li>
<li>
<b>FilePicker</b>
<br/>
Copyright (c) 2018, Jaisel Rahman
</li>
<li> <li>
<b>diff-match-patch</b> <b>diff-match-patch</b>
<br/> <br/>
@ -359,6 +354,11 @@ SOFTWARE.
<br/> <br/>
Copyright 2017 Gabriel Ittner. Copyright 2017 Gabriel Ittner.
</li> </li>
<li>
<b>Android-multipicker-library</b>
<br/>
Copyright 2018 Kumar Bibek
</li>
</ul> </ul>
<pre> <pre>
Apache License 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 package im.vector.riotx.core.utils
import android.app.Activity import android.app.Activity
@ -11,6 +27,7 @@ class KeyboardStateUtils(activity: Activity) : ViewTreeObserver.OnGlobalLayoutLi
it.viewTreeObserver.addOnGlobalLayoutListener(this) it.viewTreeObserver.addOnGlobalLayoutListener(this)
} }
var isKeyboardShowing: Boolean = false var isKeyboardShowing: Boolean = false
private set
override fun onGlobalLayout() { override fun onGlobalLayout() {
val rect = Rect() val rect = Rect()

View file

@ -22,6 +22,7 @@ import androidx.fragment.app.Fragment
import com.kbeanie.multipicker.api.Picker.* import com.kbeanie.multipicker.api.Picker.*
import com.kbeanie.multipicker.core.PickerManager import com.kbeanie.multipicker.core.PickerManager
import com.kbeanie.multipicker.utils.IntentUtils import com.kbeanie.multipicker.utils.IntentUtils
import im.vector.matrix.android.BuildConfig
import im.vector.matrix.android.api.session.content.ContentAttachmentData import im.vector.matrix.android.api.session.content.ContentAttachmentData
import im.vector.riotx.core.platform.Restorable import im.vector.riotx.core.platform.Restorable
import timber.log.Timber import timber.log.Timber
@ -47,7 +48,9 @@ class AttachmentsHelper private constructor(private val pickerManagerFactory: Pi
interface Callback { interface Callback {
fun onContactAttachmentReady(contactAttachment: ContactAttachment) { 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>) 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 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 package im.vector.riotx.features.share
import android.content.ClipDescription import android.content.ClipDescription
@ -53,10 +69,10 @@ class IncomingShareActivity :
isShareManaged = handleTextShare(intent) isShareManaged = handleTextShare(intent)
} }
if (!isShareManaged) { if (!isShareManaged) {
cantManageShare() cannottManageShare()
} }
} else { } else {
cantManageShare() cannottManageShare()
} }
} }
@ -67,10 +83,10 @@ class IncomingShareActivity :
} }
override fun onAttachmentsProcessFailed() { override fun onAttachmentsProcessFailed() {
cantManageShare() cannottManageShare()
} }
private fun cantManageShare() { private fun cannottManageShare() {
Toast.makeText(this, R.string.error_handling_incoming_share, Toast.LENGTH_LONG).show() Toast.makeText(this, R.string.error_handling_incoming_share, Toast.LENGTH_LONG).show()
finish() finish()
} }