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
3411736e
Commit
3411736e
authored
Dec 21, 2016
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed PMD problems
parent
2cbdaf96
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
27 deletions
+27
-27
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+2
-2
MessageSelectionDialogFragment.java
...gment/chatroom/dialog/MessageSelectionDialogFragment.java
+4
-4
MessageSelectionAdapter.java
...layouthelper/chatroom/dialog/MessageSelectionAdapter.java
+9
-9
MessageSelectionViewHolder.java
...outhelper/chatroom/dialog/MessageSelectionViewHolder.java
+4
-4
AbstractMessageSpec.java
...java/chat/rocket/android/message/AbstractMessageSpec.java
+1
-1
AbstractUploadMessageSpec.java
...hat/rocket/android/message/AbstractUploadMessageSpec.java
+1
-1
AudioUploadMessageSpec.java
...a/chat/rocket/android/message/AudioUploadMessageSpec.java
+2
-2
ImageUploadMessageSpec.java
...a/chat/rocket/android/message/ImageUploadMessageSpec.java
+2
-2
VideoUploadMessageSpec.java
...a/chat/rocket/android/message/VideoUploadMessageSpec.java
+2
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
3411736e
...
...
@@ -32,7 +32,7 @@ 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.AudioUploadMessageSpec
;
import
chat.rocket.android.message.
File
UploadMessageSpec
;
import
chat.rocket.android.message.
Abstract
UploadMessageSpec
;
import
chat.rocket.android.message.ImageUploadMessageSpec
;
import
chat.rocket.android.message.VideoUploadMessageSpec
;
import
chat.rocket.android.model.ServerConfig
;
...
...
@@ -246,7 +246,7 @@ public class RoomFragment extends AbstractChatRoomFragment
@Override
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
!=
File
UploadMessageSpec
.
RC_UPL
||
resultCode
!=
Activity
.
RESULT_OK
)
{
if
(
requestCode
!=
Abstract
UploadMessageSpec
.
RC_UPL
||
resultCode
!=
Activity
.
RESULT_OK
)
{
return
;
}
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/MessageSelectionDialogFragment.java
View file @
3411736e
...
...
@@ -4,7 +4,7 @@ import android.support.v7.widget.RecyclerView;
import
chat.rocket.android.R
;
import
chat.rocket.android.layouthelper.chatroom.dialog.MessageSelectionAdapter
;
import
chat.rocket.android.message.MessageSpec
;
import
chat.rocket.android.message.
Abstract
MessageSpec
;
public
class
MessageSelectionDialogFragment
extends
AbstractChatRoomDialogFragment
{
...
...
@@ -27,8 +27,8 @@ public class MessageSelectionDialogFragment extends AbstractChatRoomDialogFragme
});
}
public
void
addMessageSpec
(
MessageSpec
m
essageSpec
)
{
adapter
.
addMessageSpec
(
m
essageSpec
);
public
void
addMessageSpec
(
AbstractMessageSpec
abstractM
essageSpec
)
{
adapter
.
addMessageSpec
(
abstractM
essageSpec
);
}
public
void
setListener
(
ClickListener
listener
)
{
...
...
@@ -47,6 +47,6 @@ public class MessageSelectionDialogFragment extends AbstractChatRoomDialogFragme
}
public
interface
ClickListener
{
void
onClick
(
MessageSpec
m
essageSpec
);
void
onClick
(
AbstractMessageSpec
abstractM
essageSpec
);
}
}
app/src/main/java/chat/rocket/android/layouthelper/chatroom/dialog/MessageSelectionAdapter.java
View file @
3411736e
...
...
@@ -8,20 +8,20 @@ import android.view.ViewGroup;
import
java.util.ArrayList
;
import
java.util.List
;
import
chat.rocket.android.R
;
import
chat.rocket.android.message.MessageSpec
;
import
chat.rocket.android.message.
Abstract
MessageSpec
;
public
class
MessageSelectionAdapter
extends
RecyclerView
.
Adapter
<
MessageSelectionViewHolder
>
{
private
List
<
MessageSpec
>
m
essageSpecs
=
new
ArrayList
<>();
private
List
<
AbstractMessageSpec
>
abstractM
essageSpecs
=
new
ArrayList
<>();
private
ClickListener
listener
;
public
void
setListener
(
ClickListener
listener
)
{
this
.
listener
=
listener
;
}
public
void
addMessageSpec
(
MessageSpec
m
essageSpec
)
{
messageSpecs
.
add
(
m
essageSpec
);
public
void
addMessageSpec
(
AbstractMessageSpec
abstractM
essageSpec
)
{
abstractMessageSpecs
.
add
(
abstractM
essageSpec
);
notifyDataSetChanged
();
}
...
...
@@ -31,9 +31,9 @@ public class MessageSelectionAdapter
View
itemView
=
LayoutInflater
.
from
(
parent
.
getContext
())
.
inflate
(
R
.
layout
.
dialog_message_selection_item
,
parent
,
false
);
itemView
.
setOnClickListener
(
v
->
{
itemView
.
setOnClickListener
(
v
iew
->
{
if
(
listener
!=
null
)
{
listener
.
onClick
((
MessageSpec
)
itemView
.
getTag
());
listener
.
onClick
((
Abstract
MessageSpec
)
itemView
.
getTag
());
}
});
...
...
@@ -43,16 +43,16 @@ public class MessageSelectionAdapter
@Override
public
void
onBindViewHolder
(
MessageSelectionViewHolder
holder
,
int
position
)
{
holder
.
onBind
(
m
essageSpecs
.
get
(
position
));
holder
.
onBind
(
abstractM
essageSpecs
.
get
(
position
));
}
@Override
public
int
getItemCount
()
{
return
m
essageSpecs
.
size
();
return
abstractM
essageSpecs
.
size
();
}
public
interface
ClickListener
{
void
onClick
(
MessageSpec
m
essageSpec
);
void
onClick
(
AbstractMessageSpec
abstractM
essageSpec
);
}
}
app/src/main/java/chat/rocket/android/layouthelper/chatroom/dialog/MessageSelectionViewHolder.java
View file @
3411736e
...
...
@@ -11,7 +11,7 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
chat.rocket.android.R
;
import
chat.rocket.android.message.MessageSpec
;
import
chat.rocket.android.message.
Abstract
MessageSpec
;
public
class
MessageSelectionViewHolder
extends
RecyclerView
.
ViewHolder
{
...
...
@@ -24,10 +24,10 @@ public class MessageSelectionViewHolder extends RecyclerView.ViewHolder {
messageSpecTitle
=
(
TextView
)
itemView
.
findViewById
(
R
.
id
.
message_spec_title
);
}
public
void
onBind
(
MessageSpec
m
essageSpec
)
{
itemView
.
setTag
(
m
essageSpec
);
public
void
onBind
(
AbstractMessageSpec
abstractM
essageSpec
)
{
itemView
.
setTag
(
abstractM
essageSpec
);
MessageSpec
.
ViewData
viewData
=
m
essageSpec
.
getViewData
();
AbstractMessageSpec
.
ViewData
viewData
=
abstractM
essageSpec
.
getViewData
();
setIconBackgroundColorTint
(
viewData
.
getBackgroundTint
());
setIcon
(
viewData
.
getIcon
());
setTitle
(
viewData
.
getTitle
());
...
...
app/src/main/java/chat/rocket/android/message/MessageSpec.java
→
app/src/main/java/chat/rocket/android/message/
Abstract
MessageSpec.java
View file @
3411736e
...
...
@@ -6,7 +6,7 @@ import android.support.annotation.ColorRes;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.StringRes
;
public
abstract
class
MessageSpec
{
public
abstract
class
Abstract
MessageSpec
{
public
abstract
ViewData
getViewData
();
...
...
app/src/main/java/chat/rocket/android/message/
File
UploadMessageSpec.java
→
app/src/main/java/chat/rocket/android/message/
Abstract
UploadMessageSpec.java
View file @
3411736e
...
...
@@ -4,7 +4,7 @@ import android.app.Activity;
import
android.support.v4.app.Fragment
;
import
android.content.Intent
;
public
abstract
class
FileUploadMessageSpec
extends
MessageSpec
{
public
abstract
class
AbstractUploadMessageSpec
extends
Abstract
MessageSpec
{
public
static
final
int
RC_UPL
=
0x12
;
...
...
app/src/main/java/chat/rocket/android/message/AudioUploadMessageSpec.java
View file @
3411736e
...
...
@@ -4,7 +4,7 @@ import android.content.Intent;
import
chat.rocket.android.R
;
public
class
AudioUploadMessageSpec
extends
File
UploadMessageSpec
{
public
class
AudioUploadMessageSpec
extends
Abstract
UploadMessageSpec
{
@Override
protected
Intent
getIntent
()
{
...
...
@@ -19,7 +19,7 @@ public class AudioUploadMessageSpec extends FileUploadMessageSpec {
return
new
AudioUploadViewData
();
}
private
static
class
AudioUploadViewData
implements
MessageSpec
.
ViewData
{
private
static
class
AudioUploadViewData
implements
Abstract
MessageSpec
.
ViewData
{
@Override
public
int
getBackgroundTint
()
{
return
R
.
color
.
colorAccent
;
...
...
app/src/main/java/chat/rocket/android/message/ImageUploadMessageSpec.java
View file @
3411736e
...
...
@@ -4,7 +4,7 @@ import android.content.Intent;
import
chat.rocket.android.R
;
public
class
ImageUploadMessageSpec
extends
File
UploadMessageSpec
{
public
class
ImageUploadMessageSpec
extends
Abstract
UploadMessageSpec
{
@Override
public
ViewData
getSpecificViewData
()
{
...
...
@@ -19,7 +19,7 @@ public class ImageUploadMessageSpec extends FileUploadMessageSpec {
return
Intent
.
createChooser
(
intent
,
"Select Picture to Upload"
);
}
private
static
class
ImageUploadViewData
implements
MessageSpec
.
ViewData
{
private
static
class
ImageUploadViewData
implements
Abstract
MessageSpec
.
ViewData
{
@Override
public
int
getBackgroundTint
()
{
return
R
.
color
.
colorAccent
;
...
...
app/src/main/java/chat/rocket/android/message/VideoUploadMessageSpec.java
View file @
3411736e
...
...
@@ -4,7 +4,7 @@ import android.content.Intent;
import
chat.rocket.android.R
;
public
class
VideoUploadMessageSpec
extends
File
UploadMessageSpec
{
public
class
VideoUploadMessageSpec
extends
Abstract
UploadMessageSpec
{
@Override
public
ViewData
getSpecificViewData
()
{
...
...
@@ -19,7 +19,7 @@ public class VideoUploadMessageSpec extends FileUploadMessageSpec {
return
Intent
.
createChooser
(
intent
,
"Select Video to Upload"
);
}
private
static
class
VideoUploadViewData
implements
MessageSpec
.
ViewData
{
private
static
class
VideoUploadViewData
implements
Abstract
MessageSpec
.
ViewData
{
@Override
public
int
getBackgroundTint
()
{
return
R
.
color
.
colorAccent
;
...
...
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