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
66266976
Commit
66266976
authored
Dec 22, 2016
by
Tiago Cunha
Committed by
GitHub
Dec 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #107 from RocketChat/fix/external-storage-permission
Ask for permission
parents
c0001283
ce95423e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
104 deletions
+127
-104
build.gradle
app/build.gradle
+97
-94
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+10
-9
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+20
-1
No files found.
app/build.gradle
View file @
66266976
...
...
@@ -123,6 +123,9 @@ dependencies {
compile
'frankiesardo:icepick:3.2.0'
provided
'frankiesardo:icepick-processor:3.2.0'
compile
'com.github.hotchemi:permissionsdispatcher:2.3.0'
annotationProcessor
'com.github.hotchemi:permissionsdispatcher-processor:2.3.0'
}
apply
plugin:
'com.google.gms.google-services'
app/src/main/AndroidManifest.xml
View file @
66266976
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"chat.rocket.android"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<application
android:name=
".RocketChatApplication"
...
...
@@ -16,23 +17,23 @@
android:name=
".activity.MainActivity"
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".activity.AddServerActivity"
android:windowSoftInputMode=
"adjustResize"
/>
android:windowSoftInputMode=
"adjustResize"
/>
<activity
android:name=
".activity.ServerConfigActivity"
android:windowSoftInputMode=
"adjustResize"
/>
android:windowSoftInputMode=
"adjustResize"
/>
<service
android:name=
".service.RocketChatService"
/>
<service
android:name=
".service.RocketChatService"
/>
<service
android:name=
".service.notification.NotificationDismissalCallbackService"
/>
<service
android:name=
".service.notification.NotificationDismissalCallbackService"
/>
</application>
</manifest>
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
66266976
package
chat
.
rocket
.
android
.
fragment
.
chatroom
;
import
android.Manifest
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.support.v4.view.GravityCompat
;
import
android.support.v4.widget.DrawerLayout
;
...
...
@@ -31,6 +33,7 @@ import chat.rocket.android.layouthelper.chatroom.MessageComposerManager;
import
chat.rocket.android.layouthelper.chatroom.MessageListAdapter
;
import
chat.rocket.android.layouthelper.chatroom.PairedMessage
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.message.AbstractMessageSpec
;
import
chat.rocket.android.message.AudioUploadMessageSpec
;
import
chat.rocket.android.message.AbstractUploadMessageSpec
;
import
chat.rocket.android.message.ImageUploadMessageSpec
;
...
...
@@ -48,10 +51,13 @@ import chat.rocket.android.realm_helper.RealmObjectObserver;
import
chat.rocket.android.realm_helper.RealmStore
;
import
chat.rocket.android.service.RocketChatService
;
import
chat.rocket.android.widget.message.MessageComposer
;
import
permissions.dispatcher.NeedsPermission
;
import
permissions.dispatcher.RuntimePermissions
;
/**
* Chat room screen.
*/
@RuntimePermissions
public
class
RoomFragment
extends
AbstractChatRoomFragment
implements
OnBackPressListener
,
RealmModelListAdapter
.
OnItemClickListener
<
PairedMessage
>
{
...
...
@@ -67,7 +73,8 @@ public class RoomFragment extends AbstractChatRoomFragment
private
MessageComposerManager
messageComposerManager
;
private
MessageSelectionDialogFragment
.
ClickListener
messageSelectionClickListener
=
messageSpec
->
messageSpec
.
onSelect
(
RoomFragment
.
this
);
messageSpec
->
RoomFragmentPermissionsDispatcher
.
onMessageSpecSelectedWithCheck
(
RoomFragment
.
this
,
messageSpec
);
public
RoomFragment
()
{
}
...
...
@@ -365,4 +372,16 @@ public class RoomFragment extends AbstractChatRoomFragment
public
boolean
onBackPressed
()
{
return
closeSideMenuIfNeeded
();
}
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
RoomFragmentPermissionsDispatcher
.
onRequestPermissionsResult
(
this
,
requestCode
,
grantResults
);
}
@NeedsPermission
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
)
protected
void
onMessageSpecSelected
(
AbstractMessageSpec
messageSpec
)
{
messageSpec
.
onSelect
(
RoomFragment
.
this
);
}
}
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