Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
79615038
Commit
79615038
authored
Apr 16, 2019
by
Divyanshu Bhargava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added strings
parent
805f30fe
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
66 additions
and
24 deletions
+66
-24
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+33
-8
AndroidPermissionsHelper.kt
...va/chat/rocket/android/helper/AndroidPermissionsHelper.kt
+15
-11
ImageHelper.kt
app/src/main/java/chat/rocket/android/helper/ImageHelper.kt
+2
-5
strings.xml
app/src/main/res/values-ar/strings.xml
+1
-0
strings.xml
app/src/main/res/values-de/strings.xml
+1
-0
strings.xml
app/src/main/res/values-es/strings.xml
+1
-0
strings.xml
app/src/main/res/values-fa/strings.xml
+1
-0
strings.xml
app/src/main/res/values-fr/strings.xml
+1
-0
strings.xml
app/src/main/res/values-hi-rIN/strings.xml
+1
-0
strings.xml
app/src/main/res/values-it/strings.xml
+1
-0
strings.xml
app/src/main/res/values-ja/strings.xml
+1
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+1
-0
strings.xml
app/src/main/res/values-pt-rPT/strings.xml
+1
-0
strings.xml
app/src/main/res/values-ru-rRU/strings.xml
+1
-0
strings.xml
app/src/main/res/values-tr/strings.xml
+1
-0
strings.xml
app/src/main/res/values-uk/strings.xml
+1
-0
strings.xml
app/src/main/res/values-zh-rCN/strings.xml
+1
-0
strings.xml
app/src/main/res/values-zh-rTW/strings.xml
+1
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
79615038
...
...
@@ -918,7 +918,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
if
(
hasCameraPermission
(
it
))
{
dispatchTakePictureIntent
()
}
else
{
getCameraPermission
(
it
)
getCameraPermission
(
this
)
}
}
handler
.
postDelayed
({
...
...
@@ -939,10 +939,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
button_drawing
.
setOnClickListener
{
activity
?.
let
{
fragmentActivity
->
if
(!
hasWriteExternalStoragePermission
(
fragmentActivity
))
{
getWriteExternalStoragePermission
(
fragmentActivity
)
getWriteExternalStoragePermission
(
this
)
}
else
{
val
intent
=
Intent
(
fragmentActivity
,
DrawingActivity
::
class
.
java
)
startActivityForResult
(
intent
,
REQUEST_CODE_FOR_DRAW
)
dispatchDrawingIntent
()
}
}
...
...
@@ -953,6 +952,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
}
private
fun
dispatchDrawingIntent
()
{
val
intent
=
Intent
(
activity
,
DrawingActivity
::
class
.
java
)
startActivityForResult
(
intent
,
REQUEST_CODE_FOR_DRAW
)
}
private
fun
dispatchTakePictureIntent
()
{
Intent
(
MediaStore
.
ACTION_IMAGE_CAPTURE
).
also
{
takePictureIntent
->
// Create the File where the photo should go
...
...
@@ -973,17 +977,38 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
}
override
fun
onRequestPermissionsResult
(
requestCode
:
Int
,
permissions
:
Array
<
out
String
>,
grantResults
:
IntArray
)
{
override
fun
onRequestPermissionsResult
(
requestCode
:
Int
,
permissions
:
Array
<
out
String
>,
grantResults
:
IntArray
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
)
Log
.
e
(
"TAG_permission"
,
requestCode
.
toString
())
when
(
requestCode
)
{
AndroidPermissionsHelper
.
CAMERA_CODE
->
{
if
(
(
grantResults
.
isNotEmpty
()
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
)
{
if
(
grantResults
.
isNotEmpty
()
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
// permission was granted
dispatchTakePictureIntent
()
}
else
{
// permission denied
Snackbar
.
make
(
root_layout
,
R
.
string
.
msg_camera_permission_denied
,
Snackbar
.
LENGTH_SHORT
).
show
()
Snackbar
.
make
(
root_layout
,
R
.
string
.
msg_camera_permission_denied
,
Snackbar
.
LENGTH_SHORT
).
show
()
}
return
}
AndroidPermissionsHelper
.
WRITE_EXTERNAL_STORAGE_CODE
->
{
if
(
grantResults
.
isNotEmpty
()
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
// permission was granted
dispatchDrawingIntent
()
}
else
{
// permission denied
Snackbar
.
make
(
root_layout
,
R
.
string
.
msg_storage_permission_denied
,
Snackbar
.
LENGTH_SHORT
).
show
()
}
return
}
...
...
app/src/main/java/chat/rocket/android/helper/AndroidPermissionsHelper.kt
View file @
79615038
...
...
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager
import
android.view.ContextThemeWrapper
import
androidx.core.app.ActivityCompat
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.Fragment
object
AndroidPermissionsHelper
{
...
...
@@ -28,28 +29,31 @@ object AndroidPermissionsHelper {
return
AndroidPermissionsHelper
.
checkPermission
(
context
,
Manifest
.
permission
.
CAMERA
)
}
fun
getCameraPermission
(
context
:
Context
)
{
if
(
context
is
ContextThemeWrapper
)
{
val
activity
=
if
(
context
.
baseContext
is
Activity
)
context
.
baseContext
as
Activity
else
context
as
Activity
AndroidPermissionsHelper
.
requestPermission
(
activity
,
Manifest
.
permission
.
CAMERA
,
AndroidPermissionsHelper
.
WRITE_EXTERNAL_STORAGE_CODE
)
}
fun
getCameraPermission
(
fragment
:
Fragment
)
{
fragment
.
requestPermissions
(
arrayOf
(
Manifest
.
permission
.
CAMERA
),
CAMERA_CODE
)
}
fun
hasWriteExternalStoragePermission
(
context
:
Context
):
Boolean
{
return
checkPermission
(
context
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
}
fun
getWriteExternalStoragePermission
(
context
:
Context
)
{
fun
getWriteExternalStoragePermission
(
fragment
:
Fragment
)
{
fragment
.
requestPermissions
(
arrayOf
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
),
WRITE_EXTERNAL_STORAGE_CODE
)
}
fun
checkWritingPermission
(
context
:
Context
)
{
if
(
context
is
ContextThemeWrapper
)
{
val
activity
=
if
(
context
.
baseContext
is
Activity
)
context
.
baseContext
as
Activity
else
context
as
Activity
AndroidPermissionsHelper
.
requestPermission
(
activity
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
WRITE_EXTERNAL_STORAGE_CODE
AndroidPermissionsHelper
.
WRITE_EXTERNAL_STORAGE_CODE
)
}
}
...
...
app/src/main/java/chat/rocket/android/helper/ImageHelper.kt
View file @
79615038
package
chat.rocket.android.helper
import
android.Manifest
import
android.app.Activity
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Typeface
...
...
@@ -9,7 +7,6 @@ import android.media.MediaScannerConnection
import
android.os.Environment
import
android.text.TextUtils
import
android.util.TypedValue
import
android.view.ContextThemeWrapper
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
...
...
@@ -18,7 +15,7 @@ import androidx.appcompat.widget.Toolbar
import
androidx.core.net.toUri
import
androidx.core.view.setPadding
import
chat.rocket.android.R
import
chat.rocket.android.helper.AndroidPermissionsHelper.
getWriteExternalStorage
Permission
import
chat.rocket.android.helper.AndroidPermissionsHelper.
checkWriting
Permission
import
chat.rocket.android.helper.AndroidPermissionsHelper.hasWriteExternalStoragePermission
import
com.facebook.binaryresource.FileBinaryResource
import
com.facebook.cache.common.CacheKey
...
...
@@ -120,7 +117,7 @@ object ImageHelper {
private
fun
saveImage
(
context
:
Context
):
Boolean
{
if
(!
hasWriteExternalStoragePermission
(
context
))
{
getWriteExternalStorage
Permission
(
context
)
checkWriting
Permission
(
context
)
return
false
}
if
(
ImagePipelineFactory
.
getInstance
().
mainFileCache
.
hasKey
(
cacheKey
))
{
...
...
app/src/main/res/values-ar/strings.xml
View file @
79615038
...
...
@@ -183,6 +183,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Credentials saved successfully
</string>
<!-- TODO Translate -->
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-de/strings.xml
View file @
79615038
...
...
@@ -174,6 +174,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Login-Daten erfolgreich gespeichert
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-es/strings.xml
View file @
79615038
...
...
@@ -193,6 +193,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Credenciales guardadas con éxito
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<!-- Preferences messages -->
<string
name=
"msg_analytics_tracking"
>
Analytics tracking
</string>
<!-- TODO Add translation -->
...
...
app/src/main/res/values-fa/strings.xml
View file @
79615038
...
...
@@ -178,6 +178,7 @@
</plurals>
<!-- TODO Add translation -->
<string
name=
"msg_credentials_saved_successfully"
>
اختیارها با موفقیت ذخیره شد
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-fr/strings.xml
View file @
79615038
...
...
@@ -182,6 +182,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Certificats sauvegardés
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-hi-rIN/strings.xml
View file @
79615038
...
...
@@ -168,6 +168,7 @@
<string
name=
"msg_two_factor_authentication"
>
दो तरीकों से प्रमाणीकरण
</string>
<string
name=
"msg__your_2fa_code"
>
आपका 2FA कोड क्या है?
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<!-- Create channel messages -->
<string
name=
"msg_private_channel"
>
प्राइवेट
</string>
...
...
app/src/main/res/values-it/strings.xml
View file @
79615038
...
...
@@ -175,6 +175,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Credenziali salvate con successo
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-ja/strings.xml
View file @
79615038
...
...
@@ -178,6 +178,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
資格情報を正常に保存しました
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
79615038
...
...
@@ -183,6 +183,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Credenciais salvas com sucesso
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-pt-rPT/strings.xml
View file @
79615038
...
...
@@ -174,6 +174,7 @@
<item
quantity=
"other"
>
%1$s reagiram com %2$s
</item>
</plurals>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-ru-rRU/strings.xml
View file @
79615038
...
...
@@ -181,6 +181,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Учетные данные успешно сохранены
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-tr/strings.xml
View file @
79615038
...
...
@@ -165,6 +165,7 @@
<string
name=
"msg_two_factor_authentication"
>
Two-factor Authentication
</string>
<!-- TODO Add translation -->
<string
name=
"msg__your_2fa_code"
>
What’s your 2FA code?
</string>
<!-- TODO Add translation -->
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<!-- Create channel messages -->
<string
name=
"msg_private_channel"
>
Özel
</string>
...
...
app/src/main/res/values-uk/strings.xml
View file @
79615038
...
...
@@ -180,6 +180,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Облікові дані було успішно збережено
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-zh-rCN/strings.xml
View file @
79615038
...
...
@@ -175,6 +175,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
凭证成功保存
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values-zh-rTW/strings.xml
View file @
79615038
...
...
@@ -175,6 +175,7 @@
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
憑證保存成功
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<!-- TODO Add translation -->
<string
name=
"msg_server"
>
Server
</string>
<!-- TODO Translate -->
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
<!-- TODO Translate -->
...
...
app/src/main/res/values/strings.xml
View file @
79615038
...
...
@@ -191,6 +191,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
</plurals>
<string
name=
"msg_credentials_saved_successfully"
>
Credentials saved successfully
</string>
<string
name=
"msg_camera_permission_denied"
>
Camera permission is needed to open camera.
</string>
<string
name=
"msg_storage_permission_denied"
>
Storage permission is needed to open Drawing.
</string>
<string
name=
"msg_server"
>
Server
</string>
<string
name=
"msg_add_new_server"
>
Add New Server
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment