Commit 9af2a0d2 authored by Yusuke Iwaki's avatar Yusuke Iwaki Committed by GitHub

Merge pull request #99 from RocketChat/feature/new-message-field

Changed message entry field
parents 72bf9d92 3411736e
......@@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SlidingPaneLayout;
......@@ -21,6 +20,7 @@ import java.util.UUID;
import chat.rocket.android.R;
import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment;
import chat.rocket.android.fragment.chatroom.dialog.MessageSelectionDialogFragment;
import chat.rocket.android.fragment.chatroom.dialog.UsersOfRoomDialogFragment;
import chat.rocket.android.helper.FileUploadHelper;
import chat.rocket.android.helper.LoadMoreScrollListener;
......@@ -31,6 +31,10 @@ 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.AudioUploadMessageSpec;
import chat.rocket.android.message.AbstractUploadMessageSpec;
import chat.rocket.android.message.ImageUploadMessageSpec;
import chat.rocket.android.message.VideoUploadMessageSpec;
import chat.rocket.android.model.ServerConfig;
import chat.rocket.android.model.SyncState;
import chat.rocket.android.model.ddp.Message;
......@@ -51,8 +55,6 @@ import chat.rocket.android.widget.message.MessageComposer;
public class RoomFragment extends AbstractChatRoomFragment
implements OnBackPressListener, RealmModelListAdapter.OnItemClickListener<PairedMessage> {
private static final int RC_UPL = 0x12;
private String serverConfigId;
private RealmHelper realmHelper;
private String roomId;
......@@ -64,6 +66,9 @@ public class RoomFragment extends AbstractChatRoomFragment
private RealmObjectObserver<LoadMessageProcedure> procedureObserver;
private MessageComposerManager messageComposerManager;
private MessageSelectionDialogFragment.ClickListener messageSelectionClickListener =
messageSpec -> messageSpec.onSelect(RoomFragment.this);
public RoomFragment() {
}
......@@ -148,14 +153,13 @@ public class RoomFragment extends AbstractChatRoomFragment
setupSideMenu();
setupMessageComposer();
setupFileUploader();
}
@Override
public void onItemClick(PairedMessage pairedMessage) {
if (pairedMessage.target != null) {
final int syncstate = pairedMessage.target.getSyncState();
if (syncstate == SyncState.FAILED) {
final int syncState = pairedMessage.target.getSyncState();
if (syncState == SyncState.FAILED) {
final String messageId = pairedMessage.target.getId();
new AlertDialog.Builder(getContext())
.setPositiveButton(R.string.resend, (dialog, which) -> {
......@@ -171,7 +175,6 @@ public class RoomFragment extends AbstractChatRoomFragment
realm.where(Message.class)
.equalTo("_id", messageId).findAll().deleteAllFromRealm()
).continueWith(new LogcatIfError());
;
})
.show();
}
......@@ -180,8 +183,8 @@ public class RoomFragment extends AbstractChatRoomFragment
}
private void setupSideMenu() {
View sidemenu = rootView.findViewById(R.id.room_side_menu);
sidemenu.findViewById(R.id.btn_users).setOnClickListener(view -> {
View sideMenu = rootView.findViewById(R.id.room_side_menu);
sideMenu.findViewById(R.id.btn_users).setOnClickListener(view -> {
UsersOfRoomDialogFragment.create(serverConfigId, roomId, hostname)
.show(getFragmentManager(), UsersOfRoomDialogFragment.class.getSimpleName());
closeSideMenuIfNeeded();
......@@ -214,11 +217,9 @@ public class RoomFragment extends AbstractChatRoomFragment
}
private void setupMessageComposer() {
final FloatingActionButton fabCompose =
(FloatingActionButton) rootView.findViewById(R.id.fab_compose);
final MessageComposer messageComposer =
(MessageComposer) rootView.findViewById(R.id.message_composer);
messageComposerManager = new MessageComposerManager(fabCompose, messageComposer);
messageComposerManager = new MessageComposerManager(messageComposer);
messageComposerManager.setSendMessageCallback(messageText ->
realmHelper.executeTransaction(realm ->
realm.createOrUpdateObjectFromJson(Message.class, new JSONObject()
......@@ -227,29 +228,25 @@ public class RoomFragment extends AbstractChatRoomFragment
.put("ts", System.currentTimeMillis())
.put("rid", roomId)
.put("msg", messageText))));
messageComposerManager.setVisibilityChangedListener(shown -> {
FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab_upload_file);
if (shown) {
fab.hide();
} else {
fab.show();
}
});
}
messageComposerManager.setExtrasPickerListener(() -> {
MessageSelectionDialogFragment fragment = MessageSelectionDialogFragment.create();
fragment.addMessageSpec(new ImageUploadMessageSpec());
fragment.addMessageSpec(new AudioUploadMessageSpec());
fragment.addMessageSpec(new VideoUploadMessageSpec());
fragment.setListener(messageSelectionClickListener);
private void setupFileUploader() {
rootView.findViewById(R.id.fab_upload_file).setOnClickListener(view -> {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture to Upload"), RC_UPL);
fragment.show(getFragmentManager(), MessageSelectionDialogFragment.TAG);
closeSideMenuIfNeeded();
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode != RC_UPL || resultCode != Activity.RESULT_OK) {
if (requestCode != AbstractUploadMessageSpec.RC_UPL || resultCode != Activity.RESULT_OK) {
return;
}
......@@ -292,10 +289,10 @@ public class RoomFragment extends AbstractChatRoomFragment
RecyclerView listView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
if (listView != null && listView.getAdapter() instanceof MessageListAdapter) {
MessageListAdapter adapter = (MessageListAdapter) listView.getAdapter();
final int syncstate = procedure.getSyncState();
final int syncState = procedure.getSyncState();
final boolean hasNext = procedure.hasNext();
RCLog.d("hasNext: %s syncstate: %d", hasNext, syncstate);
if (syncstate == SyncState.SYNCED || syncstate == SyncState.FAILED) {
RCLog.d("hasNext: %s syncstate: %d", hasNext, syncState);
if (syncState == SyncState.SYNCED || syncState == SyncState.FAILED) {
scrollListener.setLoadingDone();
adapter.updateFooter(hasNext, true);
} else {
......@@ -366,6 +363,6 @@ public class RoomFragment extends AbstractChatRoomFragment
@Override
public boolean onBackPressed() {
return closeSideMenuIfNeeded() || messageComposerManager.hideMessageComposerIfNeeded();
return closeSideMenuIfNeeded();
}
}
......@@ -10,7 +10,7 @@ import android.support.design.widget.BottomSheetDialogFragment;
import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.realm_helper.RealmStore;
abstract class AbstractChatroomDialogFragment extends BottomSheetDialogFragment {
abstract class AbstractChatRoomDialogFragment extends BottomSheetDialogFragment {
protected RealmHelper realmHelper;
protected String roomId;
......
......@@ -17,7 +17,7 @@ import chat.rocket.android.renderer.FileUploadingRenderer;
/**
* dialog fragment to display progress of file uploading.
*/
public class FileUploadProgressDialogFragment extends AbstractChatroomDialogFragment {
public class FileUploadProgressDialogFragment extends AbstractChatRoomDialogFragment {
private String uplId;
private RealmObjectObserver<FileUploading> fileUploadingObserver;
......
package chat.rocket.android.fragment.chatroom.dialog;
import android.support.v7.widget.RecyclerView;
import chat.rocket.android.R;
import chat.rocket.android.layouthelper.chatroom.dialog.MessageSelectionAdapter;
import chat.rocket.android.message.AbstractMessageSpec;
public class MessageSelectionDialogFragment extends AbstractChatRoomDialogFragment {
public static final String TAG = "MessageSelectionDialogFragment";
private MessageSelectionAdapter adapter;
private ClickListener listener;
public static MessageSelectionDialogFragment create() {
return new MessageSelectionDialogFragment();
}
public MessageSelectionDialogFragment() {
adapter = new MessageSelectionAdapter();
adapter.setListener(messageSpec -> {
if (listener != null) {
listener.onClick(messageSpec);
}
dismiss();
});
}
public void addMessageSpec(AbstractMessageSpec abstractMessageSpec) {
adapter.addMessageSpec(abstractMessageSpec);
}
public void setListener(ClickListener listener) {
this.listener = listener;
}
@Override
protected int getLayout() {
return R.layout.dialog_message_selection;
}
@Override
protected void onSetupDialog() {
RecyclerView messageSpecList = (RecyclerView) getDialog().findViewById(R.id.message_spec_list);
messageSpecList.setAdapter(adapter);
}
public interface ClickListener {
void onClick(AbstractMessageSpec abstractMessageSpec);
}
}
......@@ -25,7 +25,7 @@ import chat.rocket.android.service.RocketChatService;
/**
* Dialog to show members in a room.
*/
public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
public class UsersOfRoomDialogFragment extends AbstractChatRoomDialogFragment {
private String hostname;
private RealmObjectObserver<GetUsersOfRoomsProcedure> procedureObserver;
......@@ -113,13 +113,13 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
return;
}
int syncstate = procedure.getSyncState();
if (previousSyncState != syncstate) {
onSyncStateUpdated(syncstate);
previousSyncState = syncstate;
int syncState = procedure.getSyncState();
if (previousSyncState != syncState) {
onSyncStateUpdated(syncState);
previousSyncState = syncState;
}
if (syncstate == SyncState.SYNCED) {
if (syncState == SyncState.SYNCED) {
onRenderTotalCount(procedure.getTotal());
try {
......@@ -138,8 +138,8 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
/**
* called only if prevSyncstate != newSyncstate.
*/
private void onSyncStateUpdated(int newSyncstate) {
boolean show = newSyncstate == SyncState.NOT_SYNCED || newSyncstate == SyncState.SYNCING;
private void onSyncStateUpdated(int newSyncState) {
boolean show = newSyncState == SyncState.NOT_SYNCED || newSyncState == SyncState.SYNCING;
getDialog().findViewById(R.id.waiting).setVisibility(show ? View.VISIBLE : View.GONE);
}
......
......@@ -45,8 +45,8 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai
bindMessage(pairedMessage);
if (pairedMessage.target != null) {
int syncstate = pairedMessage.target.getSyncState();
if (syncstate == SyncState.NOT_SYNCED || syncstate == SyncState.SYNCING) {
int syncState = pairedMessage.target.getSyncState();
if (syncState == SyncState.NOT_SYNCED || syncState == SyncState.SYNCING) {
itemView.setAlpha(0.6f);
} else {
itemView.setAlpha(1.0f);
......@@ -76,7 +76,7 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai
private void setSequential(boolean sequential) {
if (avatar != null) {
if (sequential) {
avatar.setVisibility(View.INVISIBLE);
avatar.setVisibility(View.GONE);
} else {
avatar.setVisibility(View.VISIBLE);
}
......
package chat.rocket.android.layouthelper.chatroom;
import android.support.design.widget.FloatingActionButton;
import bolts.Task;
import chat.rocket.android.widget.message.MessageComposer;
......@@ -9,89 +7,73 @@ import chat.rocket.android.widget.message.MessageComposer;
* handling visibility of FAB-compose and MessageComposer.
*/
public class MessageComposerManager {
private final FloatingActionButton fabCompose;
private final MessageComposer messageComposer;
private SendMessageCallback sendMessageCallback;
private VisibilityChangedListener visibilityChangedListener;
private ExtrasPickerListener extrasPickerListener;
public MessageComposerManager(FloatingActionButton fabCompose, MessageComposer messageComposer) {
this.fabCompose = fabCompose;
public MessageComposerManager(MessageComposer messageComposer) {
this.messageComposer = messageComposer;
init();
}
private void init() {
fabCompose.setOnClickListener(view -> {
setMessageComposerVisibility(true);
});
messageComposer.setOnActionListener(new MessageComposer.ActionListener() {
@Override
public void onSubmit(String message) {
if (sendMessageCallback != null) {
messageComposer.setEnabled(false);
sendMessageCallback.onSubmit(message).onSuccess(task -> {
clearComposingText();
return null;
}).continueWith(task -> {
messageComposer.setEnabled(true);
return null;
});
sendMessage(message);
}
@Override
public void onExtra() {
openExtras();
}
@Override
public void onCancel() {
setMessageComposerVisibility(false);
}
});
setMessageComposerVisibility(false);
}
public void setSendMessageCallback(SendMessageCallback sendMessageCallback) {
this.sendMessageCallback = sendMessageCallback;
}
public void setVisibilityChangedListener(VisibilityChangedListener listener) {
this.visibilityChangedListener = listener;
public void setExtrasPickerListener(ExtrasPickerListener listener) {
extrasPickerListener = listener;
}
public void clearComposingText() {
messageComposer.setText("");
}
private void setMessageComposerVisibility(boolean show) {
if (show) {
fabCompose.hide();
messageComposer.show(() -> {
if (visibilityChangedListener != null) {
visibilityChangedListener.onVisibilityChanged(true);
}
});
} else {
messageComposer.hide(() -> {
fabCompose.show();
if (visibilityChangedListener != null) {
visibilityChangedListener.onVisibilityChanged(false);
private void sendMessage(String message) {
if (sendMessageCallback == null) {
return;
}
messageComposer.setEnabled(false);
sendMessageCallback.onSubmit(message).onSuccess(task -> {
clearComposingText();
return null;
}).continueWith(task -> {
messageComposer.setEnabled(true);
return null;
});
}
}
public boolean hideMessageComposerIfNeeded() {
if (messageComposer.isShown()) {
setMessageComposerVisibility(false);
return true;
private void openExtras() {
if (extrasPickerListener == null) {
return;
}
return false;
extrasPickerListener.onOpen();
}
public interface SendMessageCallback {
Task<Void> onSubmit(String messageText);
}
public interface VisibilityChangedListener {
void onVisibilityChanged(boolean shown);
public interface ExtrasPickerListener {
void onOpen();
}
}
......@@ -92,7 +92,6 @@ public class MessageListAdapter
return new AbstractMessageViewHolder(itemView, hostname, userId, token) {
@Override
protected void bindMessage(PairedMessage pairedMessage) {
}
};
}
......
......@@ -9,7 +9,7 @@ import chat.rocket.android.widget.message.RocketChatMessageLayout;
import chat.rocket.android.widget.message.RocketChatMessageUrlsLayout;
/**
* View holder of NORMAL chat message.
* ViewData holder of NORMAL chat message.
*/
public class MessageNormalViewHolder extends AbstractMessageViewHolder {
private final RocketChatMessageLayout body;
......
......@@ -7,7 +7,7 @@ import chat.rocket.android.R;
import chat.rocket.android.renderer.MessageRenderer;
/**
* View holder of NORMAL chat message.
* ViewData holder of NORMAL chat message.
*/
public class MessageSystemViewHolder extends AbstractMessageViewHolder {
private final TextView body;
......
......@@ -4,7 +4,7 @@ import chat.rocket.android.helper.DateTime;
import chat.rocket.android.model.ddp.Message;
/**
* View Model for messages in chatroom.
* ViewData Model for messages in chatroom.
*/
public class PairedMessage {
public final Message target;
......
package chat.rocket.android.layouthelper.chatroom.dialog;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import chat.rocket.android.R;
import chat.rocket.android.message.AbstractMessageSpec;
public class MessageSelectionAdapter
extends RecyclerView.Adapter<MessageSelectionViewHolder> {
private List<AbstractMessageSpec> abstractMessageSpecs = new ArrayList<>();
private ClickListener listener;
public void setListener(ClickListener listener) {
this.listener = listener;
}
public void addMessageSpec(AbstractMessageSpec abstractMessageSpec) {
abstractMessageSpecs.add(abstractMessageSpec);
notifyDataSetChanged();
}
@Override
public MessageSelectionViewHolder onCreateViewHolder(ViewGroup parent,
int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.dialog_message_selection_item, parent, false);
itemView.setOnClickListener(view -> {
if (listener != null) {
listener.onClick((AbstractMessageSpec) itemView.getTag());
}
});
return new MessageSelectionViewHolder(itemView);
}
@Override
public void onBindViewHolder(MessageSelectionViewHolder holder,
int position) {
holder.onBind(abstractMessageSpecs.get(position));
}
@Override
public int getItemCount() {
return abstractMessageSpecs.size();
}
public interface ClickListener {
void onClick(AbstractMessageSpec abstractMessageSpec);
}
}
package chat.rocket.android.layouthelper.chatroom.dialog;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import chat.rocket.android.R;
import chat.rocket.android.message.AbstractMessageSpec;
public class MessageSelectionViewHolder extends RecyclerView.ViewHolder {
private ImageView messageSpecIcon;
private TextView messageSpecTitle;
public MessageSelectionViewHolder(View itemView) {
super(itemView);
messageSpecIcon = (ImageView) itemView.findViewById(R.id.message_spec_icon);
messageSpecTitle = (TextView) itemView.findViewById(R.id.message_spec_title);
}
public void onBind(AbstractMessageSpec abstractMessageSpec) {
itemView.setTag(abstractMessageSpec);
AbstractMessageSpec.ViewData viewData = abstractMessageSpec.getViewData();
setIconBackgroundColorTint(viewData.getBackgroundTint());
setIcon(viewData.getIcon());
setTitle(viewData.getTitle());
}
public void setIconBackgroundColorTint(@ColorRes int color) {
// Drawable background = DrawableCompat.wrap(messageSpecIcon.getBackground());
DrawableCompat.setTint(messageSpecIcon.getBackground(),
ContextCompat.getColor(messageSpecIcon.getContext(), color));
}
public void setIcon(@DrawableRes int icon) {
messageSpecIcon.setImageResource(icon);
}
public void setTitle(@StringRes int title) {
messageSpecTitle.setText(title);
}
}
......@@ -11,7 +11,7 @@ import chat.rocket.android.fragment.oauth.GoogleOAuthFragment;
import chat.rocket.android.fragment.oauth.TwitterOAuthFragment;
/**
* View model for OAuth login button.
* ViewData model for OAuth login button.
*/
public class OAuthProviderInfo {
private static final ArrayList<OAuthProviderInfo> _LIST = new ArrayList<OAuthProviderInfo>() {
......
package chat.rocket.android.message;
import android.app.Activity;
import android.support.v4.app.Fragment;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
public abstract class AbstractMessageSpec {
public abstract ViewData getViewData();
public abstract void onSelect(Activity activity);
public abstract void onSelect(Fragment fragment);
public interface ViewData {
@ColorRes
int getBackgroundTint();
@DrawableRes
int getIcon();
@StringRes
int getTitle();
}
}
package chat.rocket.android.message;
import android.app.Activity;
import android.support.v4.app.Fragment;
import android.content.Intent;
public abstract class AbstractUploadMessageSpec extends AbstractMessageSpec {
public static final int RC_UPL = 0x12;
private ViewData viewData;
@Override
public ViewData getViewData() {
if (viewData == null) {
viewData = getSpecificViewData();
}
return viewData;
}
@Override
public void onSelect(Activity activity) {
activity.startActivityForResult(getIntent(), RC_UPL);
}
@Override
public void onSelect(Fragment fragment) {
fragment.startActivityForResult(getIntent(), RC_UPL);
}
protected abstract Intent getIntent();
protected abstract ViewData getSpecificViewData();
}
package chat.rocket.android.message;
import android.content.Intent;
import chat.rocket.android.R;
public class AudioUploadMessageSpec extends AbstractUploadMessageSpec {
@Override
protected Intent getIntent() {
Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Audio to Upload");
}
@Override
public ViewData getSpecificViewData() {
return new AudioUploadViewData();
}
private static class AudioUploadViewData implements AbstractMessageSpec.ViewData {
@Override
public int getBackgroundTint() {
return R.color.colorAccent;
}
@Override
public int getIcon() {
return R.drawable.ic_audiotrack_white_24dp;
}
@Override
public int getTitle() {
return R.string.audio_upload_message_spec_title;
}
}
}
package chat.rocket.android.message;
import android.content.Intent;
import chat.rocket.android.R;
public class ImageUploadMessageSpec extends AbstractUploadMessageSpec {
@Override
public ViewData getSpecificViewData() {
return new ImageUploadViewData();
}
@Override
protected Intent getIntent() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Picture to Upload");
}
private static class ImageUploadViewData implements AbstractMessageSpec.ViewData {
@Override
public int getBackgroundTint() {
return R.color.colorAccent;
}
@Override
public int getIcon() {
return R.drawable.ic_insert_photo_white_24dp;
}
@Override
public int getTitle() {
return R.string.image_upload_message_spec_title;
}
}
}
package chat.rocket.android.message;
import android.content.Intent;
import chat.rocket.android.R;
public class VideoUploadMessageSpec extends AbstractUploadMessageSpec {
@Override
public ViewData getSpecificViewData() {
return new VideoUploadViewData();
}
@Override
protected Intent getIntent() {
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Video to Upload");
}
private static class VideoUploadViewData implements AbstractMessageSpec.ViewData {
@Override
public int getBackgroundTint() {
return R.color.colorAccent;
}
@Override
public int getIcon() {
return R.drawable.ic_video_call_white_24dp;
}
@Override
public int getTitle() {
return R.string.video_upload_message_spec_title;
}
}
}
......@@ -4,7 +4,7 @@ import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
/**
* View model for notification.
* ViewData model for notification.
*/
public class NotificationItem extends RealmObject {
@PrimaryKey private String roomId;
......
......@@ -125,7 +125,7 @@ public class NotificationItemObserver extends AbstractModelObserver<Notification
.setContentText(description)
.setNumber(unreadCount)
.setColor(ContextCompat.getColor(context, R.color.colorPrimary))
.setSmallIcon(R.drawable.rocket_chat_notification_24dp)
.setSmallIcon(R.drawable.rocket_chat_notification)
.setContentIntent(getContentIntent(roomId))
.setDeleteIntent(getDeleteIntent(roomId));
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@android:color/black" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M16.5,6v11.5c0,2.21 -1.79,4 -4,4s-4,-1.79 -4,-4V5c0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5v10.5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V6H10v9.5c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5V5c0,-2.21 -1.79,-4 -4,-4S7,2.79 7,5v12.5c0,3.04 2.46,5.5 5.5,5.5s5.5,-2.46 5.5,-5.5V6h-1.5z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z"
android:fillColor="#FFFFFF"/>
</vector>
......@@ -2,9 +2,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:alpha="0.78">
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"/>
android:pathData="M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M17,10.5V7c0,-0.55 -0.45,-1 -1,-1H4c-0.55,0 -1,0.45 -1,1v10c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1v-3.5l4,4v-11l-4,4zM14,13h-3v3H9v-3H6v-2h3V8h2v3h3v2z"
android:fillColor="#FFFFFF"/>
</vector>
......@@ -2,28 +2,24 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<include layout="@layout/sidebar"/>
<include layout="@layout/sidebar" />
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="@string/app_name"
/>
app:title="@string/app_name" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
......@@ -31,8 +27,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
\ No newline at end of file
......@@ -2,10 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
android:orientation="horizontal">
<include layout="@layout/fragment_room_main"/>
<include layout="@layout/fragment_room_main" />
<include layout="@layout/room_side_menu"/>
<include layout="@layout/room_side_menu" />
</LinearLayout>
\ No newline at end of file
......@@ -3,20 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_pane"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<include layout="@layout/sidebar"/>
<include layout="@layout/sidebar" />
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/activity_main_toolbar"
......@@ -24,18 +21,15 @@
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="@string/app_name"
/>
app:title="@string/app_name" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/activity_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:clickable="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
......@@ -5,20 +5,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="288dp"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_channel_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/editor_channel_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebEmailAddress"
android:hint="@string/dialog_add_channel_name"
/>
android:hint="@string/dialog_add_channel_name" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
......@@ -27,29 +26,26 @@
android:orientation="horizontal"
android:layout_marginTop="@dimen/margin_16"
android:layout_marginStart="@dimen/margin_8"
android:layout_marginEnd="@dimen/margin_8"
>
android:layout_marginEnd="@dimen/margin_8">
<CheckBox
android:id="@+id/checkbox_private"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_add_channel_private"
/>
android:text="@string/dialog_add_channel_private" />
<CheckBox
android:id="@+id/checkbox_read_only"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_add_channel_read_only"
/>
android:text="@string/dialog_add_channel_read_only" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_16"
/>
android:layout_height="@dimen/margin_16" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_add_channel"
......@@ -58,8 +54,7 @@
android:layout_gravity="end|bottom"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
<chat.rocket.android.widget.WaitingView
android:id="@+id/waiting"
......@@ -68,7 +63,6 @@
android:layout_gravity="center"
android:visibility="gone"
app:dotCount="5"
app:dotSize="12dp"
/>
app:dotSize="12dp" />
</LinearLayout>
\ No newline at end of file
......@@ -5,26 +5,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="288dp"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.v7.widget.AppCompatAutoCompleteTextView
android:id="@+id/editor_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="username"
android:completionThreshold="3"
/>
android:completionThreshold="3" />
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_16"
/>
android:layout_height="@dimen/margin_16" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_add_direct_message"
......@@ -33,8 +31,7 @@
android:layout_gravity="end|bottom"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
<chat.rocket.android.widget.WaitingView
android:id="@+id/waiting"
......@@ -43,7 +40,6 @@
android:layout_gravity="center"
android:visibility="gone"
app:dotCount="5"
app:dotSize="12dp"
/>
app:dotSize="12dp" />
</LinearLayout>
\ No newline at end of file
......@@ -6,22 +6,19 @@
android:paddingStart="@dimen/margin_16"
android:paddingEnd="@dimen/margin_16"
android:paddingBottom="@dimen/margin_16"
android:orientation="vertical"
>
android:orientation="vertical">
<FrameLayout
android:id="@+id/room_user_titlebar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
>
android:layout_height="?attr/actionBarSize">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:text="@string/file_uploading_title"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
</FrameLayout>
......@@ -33,8 +30,7 @@
android:layout_marginTop="@dimen/margin_8"
android:layout_marginBottom="@dimen/margin_8"
tools:progress="12"
tools:max="120"
/>
tools:max="120" />
<LinearLayout
android:layout_width="wrap_content"
......@@ -42,25 +38,25 @@
android:orientation="horizontal"
android:layout_gravity="end"
android:paddingEnd="2dp"
>
android:paddingRight="2dp">
<TextView
android:id="@+id/txt_filesize_uploaded"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="12"
/>
tools:text="12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="/"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
/>
android:layout_marginEnd="2dp" />
<TextView
android:id="@+id/txt_filesize_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="120"
/>
tools:text="120" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<chat.rocket.android.widget.AutofitRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/message_spec_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="80dp"
tools:listitem="@layout/dialog_message_selection_item"
android:clipToPadding="false">
</chat.rocket.android.widget.AutofitRecyclerView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:padding="@dimen/margin_8">
<ImageView
android:id="@+id/message_spec_icon"
android:layout_width="64dp"
android:layout_height="64dp"
android:padding="@dimen/margin_16"
tools:src="@drawable/ic_insert_photo_white_24dp"
android:layout_marginBottom="4dp"
android:background="@drawable/circle_black" />
<TextView
android:id="@+id/message_spec_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
tools:text="Attach file" />
</LinearLayout>
\ No newline at end of file
......@@ -5,14 +5,12 @@
android:layout_height="match_parent"
android:minWidth="288dp"
android:orientation="vertical"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/editor_email"
......@@ -21,20 +19,17 @@
android:hint="@string/dialog_user_registration_email"
android:imeOptions="actionNext"
android:inputType="textWebEmailAddress"
android:singleLine="true"
/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="@dimen/margin_8"
/>
android:layout_height="@dimen/margin_8" />
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/editor_username"
......@@ -43,21 +38,18 @@
android:hint="@string/dialog_user_registration_username"
android:imeOptions="actionNext"
android:inputType="textWebEmailAddress"
android:singleLine="true"
/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="@dimen/margin_8"
/>
android:layout_height="@dimen/margin_8" />
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
>
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/editor_passwd"
......@@ -66,14 +58,12 @@
android:hint="@string/dialog_user_registration_password"
android:imeOptions="actionNext"
android:inputType="textWebPassword"
android:singleLine="true"
/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="@dimen/margin_16"
/>
android:layout_height="@dimen/margin_16" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_register_user"
......@@ -82,8 +72,7 @@
android:layout_gravity="end|bottom"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
<chat.rocket.android.widget.WaitingView
android:id="@+id/waiting"
......@@ -91,7 +80,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
app:dotCount="5"
app:dotSize="12dp"
/>
app:dotSize="12dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
android:orientation="vertical">
<FrameLayout
android:id="@+id/room_user_titlebar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:paddingRight="@dimen/margin_16"
android:paddingStart="@dimen/margin_16"
>
android:paddingEnd="@dimen/margin_16"
android:paddingStart="@dimen/margin_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:text="@string/users_of_room_title"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
<TextView
android:id="@+id/room_user_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
</FrameLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
/>
android:orientation="vertical" />
</LinearLayout>
......@@ -48,7 +42,6 @@
android:id="@+id/waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
android:layout_gravity="center" />
</FrameLayout>
\ No newline at end of file
......@@ -5,27 +5,23 @@
android:gravity="center"
android:minWidth="288dp"
android:orientation="vertical"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginBottom="@dimen/margin_24"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher"
/>
android:src="@mipmap/ic_launcher" />
<chat.rocket.android.widget.WaitingView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txt_caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_16"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</LinearLayout>
\ No newline at end of file
......@@ -5,8 +5,7 @@
android:gravity="center"
android:orientation="vertical"
android:padding="@dimen/margin_16"
android:theme="@style/Theme.AppCompat.Light"
>
android:theme="@style/Theme.AppCompat.Light">
<TextView
android:layout_width="match_parent"
......@@ -14,12 +13,10 @@
android:layout_marginBottom="@dimen/margin_16"
android:gravity="center"
android:text="@string/fragment_home_welcome_message"
android:textSize="14sp"
/>
android:textSize="14sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
/>
android:src="@mipmap/ic_launcher" />
</LinearLayout>
\ No newline at end of file
......@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark"
>
android:background="?attr/colorPrimaryDark">
<LinearLayout
android:layout_width="wrap_content"
......@@ -13,22 +12,19 @@
android:background="@color/white"
android:minWidth="288dp"
android:orientation="horizontal"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<LinearLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
>
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_input_hostname_hostname"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<EditText
android:id="@+id/editor_hostname"
......@@ -37,14 +33,12 @@
android:hint="@string/fragment_input_hostname_server_hint"
android:imeOptions="actionGo"
android:inputType="textWebEditText"
android:singleLine="true"
/>
android:singleLine="true" />
</LinearLayout>
<Space
android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_connect"
......@@ -53,7 +47,6 @@
android:layout_gravity="end|bottom"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark"
>
android:background="?attr/colorPrimaryDark">
<LinearLayout
android:layout_width="wrap_content"
......@@ -13,14 +12,12 @@
android:background="@color/white"
android:minWidth="288dp"
android:orientation="vertical"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:orientation="horizontal">
<chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_twitter"
......@@ -29,7 +26,7 @@
android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_twitter"
android:textSize="16dp"
/>
android:layout_marginRight="@dimen/margin_8" />
<chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_facebook"
......@@ -38,7 +35,7 @@
android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_facebook_official"
android:textSize="16dp"
/>
android:layout_marginRight="@dimen/margin_8" />
<chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_github"
......@@ -47,7 +44,7 @@
android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_github"
android:textSize="16dp"
/>
android:layout_marginRight="@dimen/margin_8" />
<chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_google"
......@@ -56,15 +53,14 @@
android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_google"
android:textSize="16dp"
/>
android:layout_marginRight="@dimen/margin_8" />
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/editor_username"
......@@ -73,21 +69,18 @@
android:hint="@string/fragment_login_username_or_email"
android:imeOptions="actionNext"
android:inputType="textWebEmailAddress"
android:singleLine="true"
/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="@dimen/margin_8"
/>
android:layout_height="@dimen/margin_8" />
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
>
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/editor_passwd"
......@@ -96,20 +89,17 @@
android:hint="@string/fragment_login_password"
android:imeOptions="actionNext"
android:inputType="textWebPassword"
android:singleLine="true"
/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="@dimen/margin_16"
/>
android:layout_height="@dimen/margin_16" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:orientation="horizontal">
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_user_registration"
......@@ -119,8 +109,7 @@
app:backgroundTint="@color/white"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_user_registration_blue_24dp"
/>
app:srcCompat="@drawable/ic_user_registration_blue_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_login_with_email"
......@@ -129,8 +118,7 @@
android:layout_gravity="end|bottom"
app:elevation="2dp"
app:fabSize="normal"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
</FrameLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark"
>
android:background="?attr/colorPrimaryDark">
<LinearLayout
android:layout_width="wrap_content"
......@@ -13,15 +12,13 @@
android:background="@color/white"
android:minWidth="288dp"
android:orientation="vertical"
android:padding="@dimen/margin_24"
>
android:padding="@dimen/margin_24">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_retry_login_error_title"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
<TextView
android:id="@+id/txt_error_description"
......@@ -29,16 +26,14 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_8"
android:layout_marginTop="@dimen/margin_8"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1"
/>
android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
>
android:orientation="vertical">
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_retry_login"
......@@ -47,15 +42,13 @@
android:layout_margin="@dimen/margin_8"
app:elevation="2dp"
app:fabSize="normal"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/fragment_retry_login_retry_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</LinearLayout>
......@@ -66,8 +59,7 @@
android:layout_gravity="center"
android:layout_marginTop="@dimen/margin_16"
app:dotCount="5"
app:dotSize="12dp"
/>
app:dotSize="12dp" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -2,19 +2,17 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<include layout="@layout/fragment_room_main"/>
<include layout="@layout/fragment_room_main" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="end"
android:clickable="true"
android:theme="@style/AppTheme.Dark"
>
android:theme="@style/AppTheme.Dark">
<include layout="@layout/room_side_menu"/>
<include layout="@layout/room_side_menu" />
</FrameLayout>
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
android:layout_above="@+id/message_composer" />
<chat.rocket.android.widget.message.MessageComposer
android:id="@+id/message_composer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.AppCompat.Light"
android:layout_gravity="bottom"
android:background="@android:color/white"
/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_upload_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:layout_margin="@dimen/margin_16"
app:fabSize="mini"
app:srcCompat="@drawable/ic_insert_photo_white_24dp"
/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_compose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/margin_16"
app:srcCompat="@drawable/ic_compose_white_24dp"
/>
</FrameLayout>
\ No newline at end of file
android:layout_alignParentBottom="true" />
</RelativeLayout>
\ No newline at end of file
......@@ -61,7 +61,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="?attr/listPreferredItemPaddingLeft">
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingLeft="?attr/listPreferredItemPaddingLeft">
<TextView
android:id="@+id/unread_title"
......@@ -80,7 +81,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:orientation="vertical" />
android:orientation="vertical"
android:layout_marginRight="?attr/listPreferredItemPaddingRight" />
<FrameLayout
android:layout_width="match_parent"
......@@ -112,7 +114,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:orientation="vertical" />
android:orientation="vertical"
android:layout_marginRight="?attr/listPreferredItemPaddingRight" />
<FrameLayout
android:layout_width="match_parent"
......@@ -144,7 +147,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:orientation="vertical" />
android:orientation="vertical"
android:layout_marginRight="?attr/listPreferredItemPaddingRight" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
......
......@@ -3,29 +3,25 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark"
android:theme="@style/AppTheme.Dark"
>
android:theme="@style/AppTheme.Dark">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
>
android:orientation="vertical">
<chat.rocket.android.widget.WaitingView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txt_caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_32"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -2,5 +2,4 @@
<Space xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/space"
android:layout_width="match_parent"
android:layout_height="88dp"
/>
\ No newline at end of file
android:layout_height="0dp" />
\ No newline at end of file
......@@ -3,14 +3,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:theme="@style/AppTheme"
>
android:theme="@style/AppTheme">
<chat.rocket.android.widget.WaitingView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="@dimen/margin_8"
/>
android:layout_margin="@dimen/margin_8" />
</FrameLayout>
\ No newline at end of file
......@@ -6,15 +6,13 @@
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:gravity="center_vertical"
android:orientation="horizontal"
>
android:orientation="horizontal">
<View
android:layout_width="0px"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@color/newday_color"
/>
android:background="@color/newday_color" />
<TextView
android:id="@+id/newday_text"
......@@ -25,14 +23,12 @@
android:textColor="@color/newday_color"
android:textSize="8sp"
android:textStyle="bold"
tools:text="2016/01/23"
/>
tools:text="2016/01/23" />
<View
android:layout_width="0px"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@color/newday_color"
/>
android:background="@color/newday_color" />
</LinearLayout>
\ No newline at end of file
......@@ -3,8 +3,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:theme="@style/AppTheme"
>
android:theme="@style/AppTheme">
<TextView
android:layout_width="wrap_content"
......@@ -12,7 +11,6 @@
android:layout_gravity="center"
android:layout_margin="@dimen/margin_16"
android:text="@string/start_of_conversation"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</FrameLayout>
\ No newline at end of file
......@@ -4,77 +4,70 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:theme="@style/AppTheme"
>
android:theme="@style/AppTheme">
<include layout="@layout/list_item_message_newday"/>
<include layout="@layout/list_item_message_newday" />
<LinearLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_marginBottom="2dp">
<ImageView
android:id="@+id/user_avatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp"
tools:src="@drawable/ic_default_avatar"
/>
tools:src="@drawable/ic_default_avatar" />
<LinearLayout
android:layout_width="0px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:layout_marginStart="48dp"
android:orientation="vertical"
>
android:layout_marginRight="8dp"
android:layout_marginLeft="48dp">
<LinearLayout
android:id="@+id/user_and_timestamp_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:orientation="horizontal">
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
tools:text="John Doe"
/>
tools:text="John Doe" />
<Space
android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
tools:text="12:34"
/>
tools:text="12:34" />
</LinearLayout>
<chat.rocket.android.widget.message.RocketChatMessageLayout
android:id="@+id/message_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
android:id="@+id/message_urls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
android:id="@+id/message_attachments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
......@@ -4,60 +4,53 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:theme="@style/AppTheme"
>
android:theme="@style/AppTheme">
<include layout="@layout/list_item_message_newday"/>
<include layout="@layout/list_item_message_newday" />
<LinearLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:layout_height="wrap_content">
<ImageView
android:id="@+id/user_avatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp"
tools:src="@drawable/ic_default_avatar"
/>
tools:src="@drawable/ic_default_avatar" />
<LinearLayout
android:layout_width="0px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:layout_marginStart="48dp"
android:orientation="vertical"
>
android:layout_marginRight="8dp"
android:layout_marginLeft="48dp">
<LinearLayout
android:id="@+id/user_and_timestamp_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:orientation="horizontal">
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
tools:text="John Doe"
/>
tools:text="John Doe" />
<Space
android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
tools:text="12:34"
/>
tools:text="12:34" />
</LinearLayout>
<TextView
......@@ -66,8 +59,7 @@
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textStyle="italic"
android:enabled="false"
/>
</LinearLayout>
android:enabled="false" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
......@@ -3,21 +3,18 @@
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:orientation="horizontal"
>
android:orientation="horizontal">
<ImageView
android:id="@+id/room_user_status"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_margin="@dimen/margin_8"
/>
android:layout_margin="@dimen/margin_8" />
<ImageView
android:id="@+id/room_user_avatar"
android:layout_width="24dp"
android:layout_height="24dp"
/>
android:layout_height="24dp" />
<TextView
android:id="@+id/room_user_name"
......@@ -27,7 +24,6 @@
android:layout_marginLeft="@dimen/margin_8"
android:layout_marginRight="@dimen/margin_8"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
</LinearLayout>
\ No newline at end of file
......@@ -4,31 +4,27 @@
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:orientation="vertical"
>
android:orientation="vertical">
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp"
android:layout_height="48dp"
android:enabled="false"
android:text="@string/fa_search"
android:textSize="24dp"
/>
android:textSize="24dp" />
<chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_users"
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_users"
android:textSize="24dp"
/>
android:textSize="24dp" />
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp"
android:layout_height="48dp"
android:enabled="false"
android:text="@string/fa_at"
android:textSize="24dp"
/>
android:textSize="24dp" />
</LinearLayout>
\ No newline at end of file
......@@ -4,44 +4,38 @@
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:theme="@style/AppTheme.Dark"
>
android:theme="@style/AppTheme.Dark">
<android.support.v4.widget.NestedScrollView
android:layout_width="96dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/colorPrimaryDark"
>
android:background="?attr/colorPrimaryDark">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
android:orientation="vertical">
<ImageButton
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="@dimen/margin_8"
android:src="@mipmap/ic_launcher"
/>
android:src="@mipmap/ic_launcher" />
<chat.rocket.android.widget.FontAwesomeButton
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="@dimen/margin_8"
android:text="@string/fa_plus"
/>
android:text="@string/fa_plus" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<FrameLayout
android:id="@+id/sidebar_fragment_container"
android:layout_width="280dp"
android:layout_height="match_parent"
/>
android:layout_height="match_parent" />
</android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
......@@ -2,7 +2,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
</FrameLayout>
\ No newline at end of file
......@@ -2,5 +2,4 @@
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
\ No newline at end of file
android:layout_height="match_parent" />
\ No newline at end of file
......@@ -18,7 +18,7 @@
<string name="resend">Resend</string>
<string name="discard">Discard</string>
<string name="file_uploading_title">Uploading...</string>
<string name="file_uploading_title">Uploading</string>
<string name="dialog_user_registration_email">Email</string>
<string name="dialog_user_registration_username">Username</string>
......@@ -34,4 +34,9 @@
<string name="server_config_activity_authenticating">Authenticating…</string>
<string name="home_fragment_title">Rocket.Chat - Home</string>
<string name="fragment_sidebar_main_unread_rooms_title">UNREAD ROOMS</string>
<string name="doc_upload_message_spec_title">Attach file</string>
<string name="image_upload_message_spec_title">Attach image</string>
<string name="audio_upload_message_spec_title">Attach audio</string>
<string name="video_upload_message_spec_title">Attach video</string>
</resources>
......@@ -13,6 +13,7 @@
<item name="actionModeBackground">?attr/colorPrimaryDark</item>
<item name="android:statusBarColor" tools:targetApi="21">?attr/colorPrimaryDark</item>
<item name="android:navigationBarColor" tools:targetApi="21">?attr/colorPrimaryDark</item>
<item name="android:windowBackground">@android:color/white</item>
</style>
<style name="AppTheme.Dark" parent="Theme.AppCompat.NoActionBar">
......
package chat.rocket.android.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
/**
* Chiu-Ki Chan's autofit recycler view
*
* Available at: https://github.com/chiuki/android-recyclerview/blob/master/app/src/main/java/com/sqisland/android/recyclerview/AutofitRecyclerView.java
*/
public class AutofitRecyclerView extends RecyclerView {
private GridLayoutManager manager;
private int columnWidth = -1;
public AutofitRecyclerView(Context context) {
super(context);
init(context, null);
}
public AutofitRecyclerView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public AutofitRecyclerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context, attrs);
}
private void init(Context context, AttributeSet attrs) {
if (attrs != null) {
int[] attrsArray = {
android.R.attr.columnWidth
};
TypedArray array = context.obtainStyledAttributes(attrs, attrsArray);
columnWidth = array.getDimensionPixelSize(0, -1);
array.recycle();
}
manager = new GridLayoutManager(getContext(), 1);
setLayoutManager(manager);
}
@Override
protected void onMeasure(int widthSpec, int heightSpec) {
super.onMeasure(widthSpec, heightSpec);
if (columnWidth > 0) {
int spanCount = Math.max(1, getMeasuredWidth() / columnWidth);
manager.setSpanCount(spanCount);
}
}
}
......@@ -4,11 +4,14 @@ import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
......@@ -19,6 +22,9 @@ public class MessageComposer extends LinearLayout {
protected ActionListener actionListener;
protected ViewGroup composer;
private View btnExtra;
private View btnSubmit;
public MessageComposer(Context context) {
super(context);
init();
......@@ -47,15 +53,51 @@ public class MessageComposer extends LinearLayout {
private void init() {
composer = (ViewGroup) LayoutInflater.from(getContext())
.inflate(R.layout.message_composer, this, false);
composer.findViewById(R.id.btn_submit).setOnClickListener(new OnClickListener() {
btnExtra = composer.findViewById(R.id.btn_extras);
btnExtra.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (actionListener != null) {
actionListener.onExtra();
}
}
});
btnSubmit = composer.findViewById(R.id.btn_submit);
btnSubmit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String messageText = getText();
if (messageText.length() > 0) {
if (actionListener != null) {
if (messageText.length() > 0 && actionListener != null) {
actionListener.onSubmit(messageText);
}
}
});
btnSubmit.animate().scaleX(0).scaleY(0).setDuration(0);
btnSubmit.setVisibility(GONE);
((EditText) composer.findViewById(R.id.editor)).addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (s.toString().trim().length() > 0) {
animateHide(btnExtra);
animateShow(btnSubmit);
} else {
animateShow(btnExtra);
animateHide(btnSubmit);
}
}
});
......@@ -113,9 +155,29 @@ public class MessageComposer extends LinearLayout {
return getVisibility() == View.VISIBLE;
}
private void animateHide(final View view) {
view.animate().scaleX(0).scaleY(0).setDuration(150).withEndAction(new Runnable() {
@Override
public void run() {
view.setVisibility(GONE);
}
});
}
private void animateShow(final View view) {
view.animate().scaleX(1).scaleY(1).setDuration(150).withStartAction(new Runnable() {
@Override
public void run() {
view.setVisibility(VISIBLE);
}
});
}
public interface ActionListener {
void onSubmit(String message);
void onExtra();
void onCancel();
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector>
......@@ -3,5 +3,4 @@
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.RocketChat.MessageBody"
/>
android:textAppearance="@style/TextAppearance.RocketChat.MessageBody" />
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -11,4 +10,5 @@
android:layout_marginEnd="6dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
/>
\ No newline at end of file
android:layout_marginLeft="0px"
android:layout_marginRight="6dp" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
android:orientation="vertical">
<chat.rocket.android.widget.DividerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
android:gravity="bottom"
android:orientation="horizontal">
<ImageView
android:id="@+id/emoji_keyboard_toggle"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp" />
<EditText
android:id="@+id/editor"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:padding="0dp"
android:layout_weight="1"
android:maxLines="3"
/>
android:textSize="14sp"
android:hint="@string/message_composer_message_hint"
android:minLines="1"
android:maxLines="4" />
<ImageButton
android:id="@+id/btn_submit"
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
app:srcCompat="@drawable/ic_send_black_24dp"
/>
android:layout_height="wrap_content">
<ImageView
android:id="@+id/btn_extras"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="8dp"
app:srcCompat="@drawable/ic_add_circle_outline_black_24dp" />
<ImageView
android:id="@+id/btn_submit"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="8dp"
app:srcCompat="@drawable/ic_send_black_24dp" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
......@@ -4,21 +4,19 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="4dp"
android:padding="4dp"
>
android:padding="4dp">
<View
android:layout_width="3dp"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
android:background="@color/inline_attachment_quote_line"
/>
android:background="@color/inline_attachment_quote_line" />
<LinearLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
>
android:orientation="vertical">
<TextView
android:id="@+id/title"
......@@ -27,8 +25,7 @@
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title"
android:background="?attr/selectableItemBackground"
/>
android:background="?attr/selectableItemBackground" />
<ImageView
android:id="@+id/image"
......@@ -38,8 +35,7 @@
android:layout_marginTop="4dp"
android:layout_marginRight="8dp"
android:adjustViewBounds="true"
android:scaleType="fitStart"
/>
android:scaleType="fitStart" />
</LinearLayout>
</LinearLayout>
......@@ -5,14 +5,14 @@
android:orientation="horizontal"
android:background="?attr/selectableItemBackground"
android:layout_margin="4dp"
android:padding="4dp"
>
android:padding="4dp">
<View
android:layout_width="3dp"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:background="@color/inline_attachment_quote_line"
/>
android:layout_marginRight="5dp" />
<ImageView
android:id="@+id/image"
......@@ -23,14 +23,13 @@
android:layout_marginEnd="8dp"
android:adjustViewBounds="true"
android:scaleType="fitStart"
/>
android:layout_marginRight="8dp" />
<LinearLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
>
android:orientation="vertical">
<TextView
android:id="@+id/hostname"
......@@ -38,8 +37,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:enabled="false"
/>
android:enabled="false" />
<TextView
android:id="@+id/title"
......@@ -47,8 +45,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title"
/>
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title" />
<TextView
android:id="@+id/description"
......@@ -56,8 +53,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Description"
/>
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Description" />
</LinearLayout>
......
......@@ -3,14 +3,13 @@
android:layout_height="wrap_content"
android:background="@drawable/inline_attachment_background"
android:layout_margin="4dp"
android:padding="4dp"
>
android:padding="4dp">
<ImageView
android:id="@+id/message_inline_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxHeight="200dp"
android:adjustViewBounds="true"
android:scaleType="fitStart"
/>
android:scaleType="fitStart" />
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="32dp"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:layout_marginEnd="16dp"
>
android:layout_marginRight="16dp">
<chat.rocket.android.widget.FontAwesomeTextView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</FrameLayout>
<TextView
......@@ -23,8 +23,7 @@
android:layout_height="?attr/listPreferredItemHeightSmall"
android:layout_weight="1"
android:gravity="center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
<FrameLayout
android:id="@+id/alert_count_container"
......@@ -35,14 +34,14 @@
android:padding="3dp"
android:layout_gravity="center_vertical"
android:background="@drawable/unread_count_background"
>
android:layout_marginLeft="8dp">
<TextView
android:id="@+id/alert_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dp"
android:layout_gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</FrameLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="message_composer_message_hint">Message</string>
</resources>
\ No newline at end of file
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