Unverified Commit 8446479c authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #1151 from RocketChat/develop-2.x

Merging develop 2.x into develop
parents 2ab08f40 fab10670
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission <permission
......
package chat.rocket.android.chatroom.ui package chat.rocket.android.chatroom.ui
import android.Manifest
import android.app.Activity import android.app.Activity
import android.content.ClipData import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.support.annotation.DrawableRes import android.support.annotation.DrawableRes
import android.support.v4.app.ActivityCompat
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
import android.support.v4.content.ContextCompat
import android.support.v7.widget.DefaultItemAnimator import android.support.v7.widget.DefaultItemAnimator
import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
...@@ -468,29 +464,10 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -468,29 +464,10 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
override fun showFileSelection(filter: Array<String>) { override fun showFileSelection(filter: Array<String>) {
ui { ui {
if (ContextCompat.checkSelfPermission(it, Manifest.permission.READ_EXTERNAL_STORAGE) val intent = Intent(Intent.ACTION_GET_CONTENT)
!= PackageManager.PERMISSION_GRANTED) { intent.type = "*/*"
ActivityCompat.requestPermissions(it, intent.putExtra(Intent.EXTRA_MIME_TYPES, filter)
arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), startActivityForResult(intent, REQUEST_CODE_FOR_PERFORM_SAF)
1)
} else {
val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.type = "*/*"
intent.putExtra(Intent.EXTRA_MIME_TYPES, filter)
startActivityForResult(intent, REQUEST_CODE_FOR_PERFORM_SAF)
}
}
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
when (requestCode) {
1 -> {
if (!(grantResults.isNotEmpty() && grantResults.first() == PackageManager.PERMISSION_GRANTED)) {
handler.postDelayed({
ui { hideAttachmentOptions() }
}, 400)
}
}
} }
} }
......
...@@ -130,12 +130,12 @@ ...@@ -130,12 +130,12 @@
<string name="max_file_size_exceeded">Tamanho de arquivo (%1$d bytes) excedeu tamanho máximo de upload (%2$d bytes)</string> <string name="max_file_size_exceeded">Tamanho de arquivo (%1$d bytes) excedeu tamanho máximo de upload (%2$d bytes)</string>
<!-- Socket status --> <!-- Socket status -->
<string name="status_connected">conectado</string> <string name="status_connected">Conectado</string>
<string name="status_disconnected">desconetado</string> <string name="status_disconnected">Desconetado</string>
<string name="status_connecting">conectando</string> <string name="status_connecting">Conectando</string>
<string name="status_authenticating">autenticando</string> <string name="status_authenticating">Autenticando</string>
<string name="status_disconnecting">desconectando</string> <string name="status_disconnecting">Desconectando</string>
<string name="status_waiting">conectando em %d segundos</string> <string name="status_waiting">Conectando em %d segundos</string>
<!--Suggestions--> <!--Suggestions-->
<string name="suggest_all_description">Notifica todos nesta sala</string> <string name="suggest_all_description">Notifica todos nesta sala</string>
......
...@@ -131,12 +131,12 @@ ...@@ -131,12 +131,12 @@
<string name="max_file_size_exceeded">File size %1$d bytes exceeded max upload size of %2$d bytes</string> <string name="max_file_size_exceeded">File size %1$d bytes exceeded max upload size of %2$d bytes</string>
<!-- Socket status --> <!-- Socket status -->
<string name="status_connected">connected</string> <string name="status_connected">Connected</string>
<string name="status_disconnected">disconnected</string> <string name="status_disconnected">Disconnected</string>
<string name="status_connecting">connecting</string> <string name="status_connecting">Connecting</string>
<string name="status_authenticating">authenticating</string> <string name="status_authenticating">Authenticating</string>
<string name="status_disconnecting">disconnecting</string> <string name="status_disconnecting">Disconnecting</string>
<string name="status_waiting">connecting in %d seconds</string> <string name="status_waiting">Connecting in %d seconds</string>
<!--Suggestions--> <!--Suggestions-->
<string name="suggest_all_description">Notify all in this room</string> <string name="suggest_all_description">Notify all in this room</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment