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; ...@@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.view.GravityCompat; import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SlidingPaneLayout; import android.support.v4.widget.SlidingPaneLayout;
...@@ -21,6 +20,7 @@ import java.util.UUID; ...@@ -21,6 +20,7 @@ import java.util.UUID;
import chat.rocket.android.R; import chat.rocket.android.R;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment; 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.fragment.chatroom.dialog.UsersOfRoomDialogFragment;
import chat.rocket.android.helper.FileUploadHelper; import chat.rocket.android.helper.FileUploadHelper;
import chat.rocket.android.helper.LoadMoreScrollListener; import chat.rocket.android.helper.LoadMoreScrollListener;
...@@ -31,6 +31,10 @@ import chat.rocket.android.layouthelper.chatroom.MessageComposerManager; ...@@ -31,6 +31,10 @@ import chat.rocket.android.layouthelper.chatroom.MessageComposerManager;
import chat.rocket.android.layouthelper.chatroom.MessageListAdapter; import chat.rocket.android.layouthelper.chatroom.MessageListAdapter;
import chat.rocket.android.layouthelper.chatroom.PairedMessage; import chat.rocket.android.layouthelper.chatroom.PairedMessage;
import chat.rocket.android.log.RCLog; 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.ServerConfig;
import chat.rocket.android.model.SyncState; import chat.rocket.android.model.SyncState;
import chat.rocket.android.model.ddp.Message; import chat.rocket.android.model.ddp.Message;
...@@ -51,8 +55,6 @@ import chat.rocket.android.widget.message.MessageComposer; ...@@ -51,8 +55,6 @@ import chat.rocket.android.widget.message.MessageComposer;
public class RoomFragment extends AbstractChatRoomFragment public class RoomFragment extends AbstractChatRoomFragment
implements OnBackPressListener, RealmModelListAdapter.OnItemClickListener<PairedMessage> { implements OnBackPressListener, RealmModelListAdapter.OnItemClickListener<PairedMessage> {
private static final int RC_UPL = 0x12;
private String serverConfigId; private String serverConfigId;
private RealmHelper realmHelper; private RealmHelper realmHelper;
private String roomId; private String roomId;
...@@ -64,6 +66,9 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -64,6 +66,9 @@ public class RoomFragment extends AbstractChatRoomFragment
private RealmObjectObserver<LoadMessageProcedure> procedureObserver; private RealmObjectObserver<LoadMessageProcedure> procedureObserver;
private MessageComposerManager messageComposerManager; private MessageComposerManager messageComposerManager;
private MessageSelectionDialogFragment.ClickListener messageSelectionClickListener =
messageSpec -> messageSpec.onSelect(RoomFragment.this);
public RoomFragment() { public RoomFragment() {
} }
...@@ -148,14 +153,13 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -148,14 +153,13 @@ public class RoomFragment extends AbstractChatRoomFragment
setupSideMenu(); setupSideMenu();
setupMessageComposer(); setupMessageComposer();
setupFileUploader();
} }
@Override @Override
public void onItemClick(PairedMessage pairedMessage) { public void onItemClick(PairedMessage pairedMessage) {
if (pairedMessage.target != null) { if (pairedMessage.target != null) {
final int syncstate = pairedMessage.target.getSyncState(); final int syncState = pairedMessage.target.getSyncState();
if (syncstate == SyncState.FAILED) { if (syncState == SyncState.FAILED) {
final String messageId = pairedMessage.target.getId(); final String messageId = pairedMessage.target.getId();
new AlertDialog.Builder(getContext()) new AlertDialog.Builder(getContext())
.setPositiveButton(R.string.resend, (dialog, which) -> { .setPositiveButton(R.string.resend, (dialog, which) -> {
...@@ -171,7 +175,6 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -171,7 +175,6 @@ public class RoomFragment extends AbstractChatRoomFragment
realm.where(Message.class) realm.where(Message.class)
.equalTo("_id", messageId).findAll().deleteAllFromRealm() .equalTo("_id", messageId).findAll().deleteAllFromRealm()
).continueWith(new LogcatIfError()); ).continueWith(new LogcatIfError());
;
}) })
.show(); .show();
} }
...@@ -180,8 +183,8 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -180,8 +183,8 @@ public class RoomFragment extends AbstractChatRoomFragment
} }
private void setupSideMenu() { private void setupSideMenu() {
View sidemenu = rootView.findViewById(R.id.room_side_menu); View sideMenu = rootView.findViewById(R.id.room_side_menu);
sidemenu.findViewById(R.id.btn_users).setOnClickListener(view -> { sideMenu.findViewById(R.id.btn_users).setOnClickListener(view -> {
UsersOfRoomDialogFragment.create(serverConfigId, roomId, hostname) UsersOfRoomDialogFragment.create(serverConfigId, roomId, hostname)
.show(getFragmentManager(), UsersOfRoomDialogFragment.class.getSimpleName()); .show(getFragmentManager(), UsersOfRoomDialogFragment.class.getSimpleName());
closeSideMenuIfNeeded(); closeSideMenuIfNeeded();
...@@ -214,11 +217,9 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -214,11 +217,9 @@ public class RoomFragment extends AbstractChatRoomFragment
} }
private void setupMessageComposer() { private void setupMessageComposer() {
final FloatingActionButton fabCompose =
(FloatingActionButton) rootView.findViewById(R.id.fab_compose);
final MessageComposer messageComposer = final MessageComposer messageComposer =
(MessageComposer) rootView.findViewById(R.id.message_composer); (MessageComposer) rootView.findViewById(R.id.message_composer);
messageComposerManager = new MessageComposerManager(fabCompose, messageComposer); messageComposerManager = new MessageComposerManager(messageComposer);
messageComposerManager.setSendMessageCallback(messageText -> messageComposerManager.setSendMessageCallback(messageText ->
realmHelper.executeTransaction(realm -> realmHelper.executeTransaction(realm ->
realm.createOrUpdateObjectFromJson(Message.class, new JSONObject() realm.createOrUpdateObjectFromJson(Message.class, new JSONObject()
...@@ -227,29 +228,25 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -227,29 +228,25 @@ public class RoomFragment extends AbstractChatRoomFragment
.put("ts", System.currentTimeMillis()) .put("ts", System.currentTimeMillis())
.put("rid", roomId) .put("rid", roomId)
.put("msg", messageText)))); .put("msg", messageText))));
messageComposerManager.setVisibilityChangedListener(shown -> { messageComposerManager.setExtrasPickerListener(() -> {
FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab_upload_file); MessageSelectionDialogFragment fragment = MessageSelectionDialogFragment.create();
if (shown) {
fab.hide(); fragment.addMessageSpec(new ImageUploadMessageSpec());
} else { fragment.addMessageSpec(new AudioUploadMessageSpec());
fab.show(); fragment.addMessageSpec(new VideoUploadMessageSpec());
}
}); fragment.setListener(messageSelectionClickListener);
}
private void setupFileUploader() { fragment.show(getFragmentManager(), MessageSelectionDialogFragment.TAG);
rootView.findViewById(R.id.fab_upload_file).setOnClickListener(view -> {
Intent intent = new Intent(); closeSideMenuIfNeeded();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture to Upload"), RC_UPL);
}); });
} }
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (requestCode != RC_UPL || resultCode != Activity.RESULT_OK) { if (requestCode != AbstractUploadMessageSpec.RC_UPL || resultCode != Activity.RESULT_OK) {
return; return;
} }
...@@ -292,10 +289,10 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -292,10 +289,10 @@ public class RoomFragment extends AbstractChatRoomFragment
RecyclerView listView = (RecyclerView) rootView.findViewById(R.id.recyclerview); RecyclerView listView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
if (listView != null && listView.getAdapter() instanceof MessageListAdapter) { if (listView != null && listView.getAdapter() instanceof MessageListAdapter) {
MessageListAdapter adapter = (MessageListAdapter) listView.getAdapter(); MessageListAdapter adapter = (MessageListAdapter) listView.getAdapter();
final int syncstate = procedure.getSyncState(); final int syncState = procedure.getSyncState();
final boolean hasNext = procedure.hasNext(); final boolean hasNext = procedure.hasNext();
RCLog.d("hasNext: %s syncstate: %d", hasNext, syncstate); RCLog.d("hasNext: %s syncstate: %d", hasNext, syncState);
if (syncstate == SyncState.SYNCED || syncstate == SyncState.FAILED) { if (syncState == SyncState.SYNCED || syncState == SyncState.FAILED) {
scrollListener.setLoadingDone(); scrollListener.setLoadingDone();
adapter.updateFooter(hasNext, true); adapter.updateFooter(hasNext, true);
} else { } else {
...@@ -366,6 +363,6 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -366,6 +363,6 @@ public class RoomFragment extends AbstractChatRoomFragment
@Override @Override
public boolean onBackPressed() { public boolean onBackPressed() {
return closeSideMenuIfNeeded() || messageComposerManager.hideMessageComposerIfNeeded(); return closeSideMenuIfNeeded();
} }
} }
...@@ -10,7 +10,7 @@ import android.support.design.widget.BottomSheetDialogFragment; ...@@ -10,7 +10,7 @@ import android.support.design.widget.BottomSheetDialogFragment;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.realm_helper.RealmStore; import chat.rocket.android.realm_helper.RealmStore;
abstract class AbstractChatroomDialogFragment extends BottomSheetDialogFragment { abstract class AbstractChatRoomDialogFragment extends BottomSheetDialogFragment {
protected RealmHelper realmHelper; protected RealmHelper realmHelper;
protected String roomId; protected String roomId;
......
...@@ -17,7 +17,7 @@ import chat.rocket.android.renderer.FileUploadingRenderer; ...@@ -17,7 +17,7 @@ import chat.rocket.android.renderer.FileUploadingRenderer;
/** /**
* dialog fragment to display progress of file uploading. * dialog fragment to display progress of file uploading.
*/ */
public class FileUploadProgressDialogFragment extends AbstractChatroomDialogFragment { public class FileUploadProgressDialogFragment extends AbstractChatRoomDialogFragment {
private String uplId; private String uplId;
private RealmObjectObserver<FileUploading> fileUploadingObserver; 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; ...@@ -25,7 +25,7 @@ import chat.rocket.android.service.RocketChatService;
/** /**
* Dialog to show members in a room. * Dialog to show members in a room.
*/ */
public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment { public class UsersOfRoomDialogFragment extends AbstractChatRoomDialogFragment {
private String hostname; private String hostname;
private RealmObjectObserver<GetUsersOfRoomsProcedure> procedureObserver; private RealmObjectObserver<GetUsersOfRoomsProcedure> procedureObserver;
...@@ -113,13 +113,13 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment { ...@@ -113,13 +113,13 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
return; return;
} }
int syncstate = procedure.getSyncState(); int syncState = procedure.getSyncState();
if (previousSyncState != syncstate) { if (previousSyncState != syncState) {
onSyncStateUpdated(syncstate); onSyncStateUpdated(syncState);
previousSyncState = syncstate; previousSyncState = syncState;
} }
if (syncstate == SyncState.SYNCED) { if (syncState == SyncState.SYNCED) {
onRenderTotalCount(procedure.getTotal()); onRenderTotalCount(procedure.getTotal());
try { try {
...@@ -138,8 +138,8 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment { ...@@ -138,8 +138,8 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
/** /**
* called only if prevSyncstate != newSyncstate. * called only if prevSyncstate != newSyncstate.
*/ */
private void onSyncStateUpdated(int newSyncstate) { private void onSyncStateUpdated(int newSyncState) {
boolean show = newSyncstate == SyncState.NOT_SYNCED || newSyncstate == SyncState.SYNCING; boolean show = newSyncState == SyncState.NOT_SYNCED || newSyncState == SyncState.SYNCING;
getDialog().findViewById(R.id.waiting).setVisibility(show ? View.VISIBLE : View.GONE); getDialog().findViewById(R.id.waiting).setVisibility(show ? View.VISIBLE : View.GONE);
} }
......
...@@ -45,8 +45,8 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai ...@@ -45,8 +45,8 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai
bindMessage(pairedMessage); bindMessage(pairedMessage);
if (pairedMessage.target != null) { if (pairedMessage.target != null) {
int syncstate = pairedMessage.target.getSyncState(); int syncState = pairedMessage.target.getSyncState();
if (syncstate == SyncState.NOT_SYNCED || syncstate == SyncState.SYNCING) { if (syncState == SyncState.NOT_SYNCED || syncState == SyncState.SYNCING) {
itemView.setAlpha(0.6f); itemView.setAlpha(0.6f);
} else { } else {
itemView.setAlpha(1.0f); itemView.setAlpha(1.0f);
...@@ -76,7 +76,7 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai ...@@ -76,7 +76,7 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai
private void setSequential(boolean sequential) { private void setSequential(boolean sequential) {
if (avatar != null) { if (avatar != null) {
if (sequential) { if (sequential) {
avatar.setVisibility(View.INVISIBLE); avatar.setVisibility(View.GONE);
} else { } else {
avatar.setVisibility(View.VISIBLE); avatar.setVisibility(View.VISIBLE);
} }
......
package chat.rocket.android.layouthelper.chatroom; package chat.rocket.android.layouthelper.chatroom;
import android.support.design.widget.FloatingActionButton;
import bolts.Task; import bolts.Task;
import chat.rocket.android.widget.message.MessageComposer; import chat.rocket.android.widget.message.MessageComposer;
...@@ -9,89 +7,73 @@ 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. * handling visibility of FAB-compose and MessageComposer.
*/ */
public class MessageComposerManager { public class MessageComposerManager {
private final FloatingActionButton fabCompose;
private final MessageComposer messageComposer; private final MessageComposer messageComposer;
private SendMessageCallback sendMessageCallback; private SendMessageCallback sendMessageCallback;
private VisibilityChangedListener visibilityChangedListener; private ExtrasPickerListener extrasPickerListener;
public MessageComposerManager(FloatingActionButton fabCompose, MessageComposer messageComposer) { public MessageComposerManager(MessageComposer messageComposer) {
this.fabCompose = fabCompose;
this.messageComposer = messageComposer; this.messageComposer = messageComposer;
init(); init();
} }
private void init() { private void init() {
fabCompose.setOnClickListener(view -> {
setMessageComposerVisibility(true);
});
messageComposer.setOnActionListener(new MessageComposer.ActionListener() { messageComposer.setOnActionListener(new MessageComposer.ActionListener() {
@Override @Override
public void onSubmit(String message) { public void onSubmit(String message) {
if (sendMessageCallback != null) { sendMessage(message);
messageComposer.setEnabled(false); }
sendMessageCallback.onSubmit(message).onSuccess(task -> {
clearComposingText(); @Override
return null; public void onExtra() {
}).continueWith(task -> { openExtras();
messageComposer.setEnabled(true);
return null;
});
}
} }
@Override @Override
public void onCancel() { public void onCancel() {
setMessageComposerVisibility(false);
} }
}); });
setMessageComposerVisibility(false);
} }
public void setSendMessageCallback(SendMessageCallback sendMessageCallback) { public void setSendMessageCallback(SendMessageCallback sendMessageCallback) {
this.sendMessageCallback = sendMessageCallback; this.sendMessageCallback = sendMessageCallback;
} }
public void setVisibilityChangedListener(VisibilityChangedListener listener) { public void setExtrasPickerListener(ExtrasPickerListener listener) {
this.visibilityChangedListener = listener; extrasPickerListener = listener;
} }
public void clearComposingText() { public void clearComposingText() {
messageComposer.setText(""); messageComposer.setText("");
} }
private void setMessageComposerVisibility(boolean show) { private void sendMessage(String message) {
if (show) { if (sendMessageCallback == null) {
fabCompose.hide(); return;
messageComposer.show(() -> {
if (visibilityChangedListener != null) {
visibilityChangedListener.onVisibilityChanged(true);
}
});
} else {
messageComposer.hide(() -> {
fabCompose.show();
if (visibilityChangedListener != null) {
visibilityChangedListener.onVisibilityChanged(false);
}
});
} }
messageComposer.setEnabled(false);
sendMessageCallback.onSubmit(message).onSuccess(task -> {
clearComposingText();
return null;
}).continueWith(task -> {
messageComposer.setEnabled(true);
return null;
});
} }
public boolean hideMessageComposerIfNeeded() { private void openExtras() {
if (messageComposer.isShown()) { if (extrasPickerListener == null) {
setMessageComposerVisibility(false); return;
return true;
} }
return false;
extrasPickerListener.onOpen();
} }
public interface SendMessageCallback { public interface SendMessageCallback {
Task<Void> onSubmit(String messageText); Task<Void> onSubmit(String messageText);
} }
public interface VisibilityChangedListener { public interface ExtrasPickerListener {
void onVisibilityChanged(boolean shown); void onOpen();
} }
} }
...@@ -92,7 +92,6 @@ public class MessageListAdapter ...@@ -92,7 +92,6 @@ public class MessageListAdapter
return new AbstractMessageViewHolder(itemView, hostname, userId, token) { return new AbstractMessageViewHolder(itemView, hostname, userId, token) {
@Override @Override
protected void bindMessage(PairedMessage pairedMessage) { protected void bindMessage(PairedMessage pairedMessage) {
} }
}; };
} }
......
...@@ -9,7 +9,7 @@ import chat.rocket.android.widget.message.RocketChatMessageLayout; ...@@ -9,7 +9,7 @@ import chat.rocket.android.widget.message.RocketChatMessageLayout;
import chat.rocket.android.widget.message.RocketChatMessageUrlsLayout; import chat.rocket.android.widget.message.RocketChatMessageUrlsLayout;
/** /**
* View holder of NORMAL chat message. * ViewData holder of NORMAL chat message.
*/ */
public class MessageNormalViewHolder extends AbstractMessageViewHolder { public class MessageNormalViewHolder extends AbstractMessageViewHolder {
private final RocketChatMessageLayout body; private final RocketChatMessageLayout body;
......
...@@ -7,7 +7,7 @@ import chat.rocket.android.R; ...@@ -7,7 +7,7 @@ import chat.rocket.android.R;
import chat.rocket.android.renderer.MessageRenderer; import chat.rocket.android.renderer.MessageRenderer;
/** /**
* View holder of NORMAL chat message. * ViewData holder of NORMAL chat message.
*/ */
public class MessageSystemViewHolder extends AbstractMessageViewHolder { public class MessageSystemViewHolder extends AbstractMessageViewHolder {
private final TextView body; private final TextView body;
......
...@@ -4,7 +4,7 @@ import chat.rocket.android.helper.DateTime; ...@@ -4,7 +4,7 @@ import chat.rocket.android.helper.DateTime;
import chat.rocket.android.model.ddp.Message; import chat.rocket.android.model.ddp.Message;
/** /**
* View Model for messages in chatroom. * ViewData Model for messages in chatroom.
*/ */
public class PairedMessage { public class PairedMessage {
public final Message target; 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; ...@@ -11,7 +11,7 @@ import chat.rocket.android.fragment.oauth.GoogleOAuthFragment;
import chat.rocket.android.fragment.oauth.TwitterOAuthFragment; import chat.rocket.android.fragment.oauth.TwitterOAuthFragment;
/** /**
* View model for OAuth login button. * ViewData model for OAuth login button.
*/ */
public class OAuthProviderInfo { public class OAuthProviderInfo {
private static final ArrayList<OAuthProviderInfo> _LIST = new ArrayList<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; ...@@ -4,7 +4,7 @@ import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey; import io.realm.annotations.PrimaryKey;
/** /**
* View model for notification. * ViewData model for notification.
*/ */
public class NotificationItem extends RealmObject { public class NotificationItem extends RealmObject {
@PrimaryKey private String roomId; @PrimaryKey private String roomId;
......
...@@ -125,7 +125,7 @@ public class NotificationItemObserver extends AbstractModelObserver<Notification ...@@ -125,7 +125,7 @@ public class NotificationItemObserver extends AbstractModelObserver<Notification
.setContentText(description) .setContentText(description)
.setNumber(unreadCount) .setNumber(unreadCount)
.setColor(ContextCompat.getColor(context, R.color.colorPrimary)) .setColor(ContextCompat.getColor(context, R.color.colorPrimary))
.setSmallIcon(R.drawable.rocket_chat_notification_24dp) .setSmallIcon(R.drawable.rocket_chat_notification)
.setContentIntent(getContentIntent(roomId)) .setContentIntent(getContentIntent(roomId))
.setDeleteIntent(getDeleteIntent(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 @@ ...@@ -2,9 +2,8 @@
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0" android:viewportHeight="24.0">
android:alpha="0.78">
<path <path
android:fillColor="#FFFFFFFF" 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>
<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 @@ ...@@ -2,28 +2,24 @@
<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" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" 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.support.design.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="@string/app_name" app:title="@string/app_name" />
/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<FrameLayout <FrameLayout
...@@ -31,8 +27,7 @@ ...@@ -31,8 +27,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" 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> </android.support.design.widget.CoordinatorLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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> </LinearLayout>
\ No newline at end of file
...@@ -3,20 +3,17 @@ ...@@ -3,20 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_pane" android:id="@+id/sliding_pane"
android:layout_width="match_parent" 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.support.design.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/activity_main_toolbar" android:id="@+id/activity_main_toolbar"
...@@ -24,18 +21,15 @@ ...@@ -24,18 +21,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:title="@string/app_name" app:title="@string/app_name" />
/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<FrameLayout <FrameLayout
android:id="@+id/activity_main_container" android:id="@+id/activity_main_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"
android:clickable="true" 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.design.widget.CoordinatorLayout>
</android.support.v4.widget.SlidingPaneLayout> </android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
...@@ -5,20 +5,19 @@ ...@@ -5,20 +5,19 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minWidth="288dp" android:minWidth="288dp"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_channel_name" android:id="@+id/text_input_channel_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/editor_channel_name" android:id="@+id/editor_channel_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textWebEmailAddress" android:inputType="textWebEmailAddress"
android:hint="@string/dialog_add_channel_name" android:hint="@string/dialog_add_channel_name" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<LinearLayout <LinearLayout
...@@ -27,29 +26,26 @@ ...@@ -27,29 +26,26 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="@dimen/margin_16" android:layout_marginTop="@dimen/margin_16"
android:layout_marginStart="@dimen/margin_8" android:layout_marginStart="@dimen/margin_8"
android:layout_marginEnd="@dimen/margin_8" android:layout_marginEnd="@dimen/margin_8">
>
<CheckBox <CheckBox
android:id="@+id/checkbox_private" android:id="@+id/checkbox_private"
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/dialog_add_channel_private" android:text="@string/dialog_add_channel_private" />
/>
<CheckBox <CheckBox
android:id="@+id/checkbox_read_only" android:id="@+id/checkbox_read_only"
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/dialog_add_channel_read_only" android:text="@string/dialog_add_channel_read_only" />
/>
</LinearLayout> </LinearLayout>
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/margin_16" android:layout_height="@dimen/margin_16" />
/>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_add_channel" android:id="@+id/btn_add_channel"
...@@ -58,8 +54,7 @@ ...@@ -58,8 +54,7 @@
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
/>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
android:id="@+id/waiting" android:id="@+id/waiting"
...@@ -68,7 +63,6 @@ ...@@ -68,7 +63,6 @@
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="gone" android:visibility="gone"
app:dotCount="5" app:dotCount="5"
app:dotSize="12dp" app:dotSize="12dp" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -5,26 +5,24 @@ ...@@ -5,26 +5,24 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minWidth="288dp" android:minWidth="288dp"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username" android:id="@+id/text_input_username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.v7.widget.AppCompatAutoCompleteTextView <android.support.v7.widget.AppCompatAutoCompleteTextView
android:id="@+id/editor_username" android:id="@+id/editor_username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="username" android:hint="username"
android:completionThreshold="3" android:completionThreshold="3" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/margin_16" android:layout_height="@dimen/margin_16" />
/>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_add_direct_message" android:id="@+id/btn_add_direct_message"
...@@ -33,8 +31,7 @@ ...@@ -33,8 +31,7 @@
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
/>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
android:id="@+id/waiting" android:id="@+id/waiting"
...@@ -43,7 +40,6 @@ ...@@ -43,7 +40,6 @@
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="gone" android:visibility="gone"
app:dotCount="5" app:dotCount="5"
app:dotSize="12dp" app:dotSize="12dp" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -6,22 +6,19 @@ ...@@ -6,22 +6,19 @@
android:paddingStart="@dimen/margin_16" android:paddingStart="@dimen/margin_16"
android:paddingEnd="@dimen/margin_16" android:paddingEnd="@dimen/margin_16"
android:paddingBottom="@dimen/margin_16" android:paddingBottom="@dimen/margin_16"
android:orientation="vertical" android:orientation="vertical">
>
<FrameLayout <FrameLayout
android:id="@+id/room_user_titlebar" android:id="@+id/room_user_titlebar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize">
>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical" android:layout_gravity="start|center_vertical"
android:text="@string/file_uploading_title" android:text="@string/file_uploading_title"
android:textAppearance="@style/TextAppearance.AppCompat.Title" android:textAppearance="@style/TextAppearance.AppCompat.Title" />
/>
</FrameLayout> </FrameLayout>
...@@ -33,8 +30,7 @@ ...@@ -33,8 +30,7 @@
android:layout_marginTop="@dimen/margin_8" android:layout_marginTop="@dimen/margin_8"
android:layout_marginBottom="@dimen/margin_8" android:layout_marginBottom="@dimen/margin_8"
tools:progress="12" tools:progress="12"
tools:max="120" tools:max="120" />
/>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -42,25 +38,25 @@ ...@@ -42,25 +38,25 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_gravity="end" android:layout_gravity="end"
android:paddingEnd="2dp" android:paddingEnd="2dp"
> android:paddingRight="2dp">
<TextView <TextView
android:id="@+id/txt_filesize_uploaded" android:id="@+id/txt_filesize_uploaded"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="12" tools:text="12" />
/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="/" android:text="/"
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:layout_marginEnd="2dp" android:layout_marginEnd="2dp" />
/>
<TextView <TextView
android:id="@+id/txt_filesize_total" android:id="@+id/txt_filesize_total"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="120" tools:text="120" />
/>
</LinearLayout> </LinearLayout>
</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 @@ ...@@ -5,14 +5,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:minWidth="288dp" android:minWidth="288dp"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_email" android:id="@+id/text_input_email"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/editor_email" android:id="@+id/editor_email"
...@@ -21,20 +19,17 @@ ...@@ -21,20 +19,17 @@
android:hint="@string/dialog_user_registration_email" android:hint="@string/dialog_user_registration_email"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textWebEmailAddress" android:inputType="textWebEmailAddress"
android:singleLine="true" android:singleLine="true" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<Space <Space
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/margin_8" android:layout_height="@dimen/margin_8" />
/>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username" android:id="@+id/text_input_username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/editor_username" android:id="@+id/editor_username"
...@@ -43,21 +38,18 @@ ...@@ -43,21 +38,18 @@
android:hint="@string/dialog_user_registration_username" android:hint="@string/dialog_user_registration_username"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textWebEmailAddress" android:inputType="textWebEmailAddress"
android:singleLine="true" android:singleLine="true" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<Space <Space
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/margin_8" android:layout_height="@dimen/margin_8" />
/>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_passwd" android:id="@+id/text_input_passwd"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:passwordToggleEnabled="true" app:passwordToggleEnabled="true">
>
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/editor_passwd" android:id="@+id/editor_passwd"
...@@ -66,14 +58,12 @@ ...@@ -66,14 +58,12 @@
android:hint="@string/dialog_user_registration_password" android:hint="@string/dialog_user_registration_password"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textWebPassword" android:inputType="textWebPassword"
android:singleLine="true" android:singleLine="true" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<Space <Space
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/margin_16" android:layout_height="@dimen/margin_16" />
/>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_register_user" android:id="@+id/btn_register_user"
...@@ -82,8 +72,7 @@ ...@@ -82,8 +72,7 @@
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
/>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
android:id="@+id/waiting" android:id="@+id/waiting"
...@@ -91,7 +80,6 @@ ...@@ -91,7 +80,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
app:dotCount="5" app:dotCount="5"
app:dotSize="12dp" app:dotSize="12dp" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical">
>
<FrameLayout <FrameLayout
android:id="@+id/room_user_titlebar" android:id="@+id/room_user_titlebar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:paddingRight="@dimen/margin_16" android:paddingEnd="@dimen/margin_16"
android:paddingStart="@dimen/margin_16" android:paddingStart="@dimen/margin_16">
>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical" android:layout_gravity="start|center_vertical"
android:text="@string/users_of_room_title" android:text="@string/users_of_room_title"
android:textAppearance="@style/TextAppearance.AppCompat.Title" android:textAppearance="@style/TextAppearance.AppCompat.Title" />
/>
<TextView <TextView
android:id="@+id/room_user_count" android:id="@+id/room_user_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical" android:layout_gravity="end|center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small" />
/>
</FrameLayout> </FrameLayout>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical" />
/>
</LinearLayout> </LinearLayout>
...@@ -48,7 +42,6 @@ ...@@ -48,7 +42,6 @@
android:id="@+id/waiting" android:id="@+id/waiting"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center" />
/>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -5,27 +5,23 @@ ...@@ -5,27 +5,23 @@
android:gravity="center" android:gravity="center"
android:minWidth="288dp" android:minWidth="288dp"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<ImageView <ImageView
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_marginBottom="@dimen/margin_24" android:layout_marginBottom="@dimen/margin_24"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" android:src="@mipmap/ic_launcher" />
/>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<TextView <TextView
android:id="@+id/txt_caption" android:id="@+id/txt_caption"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_16" android:layout_marginTop="@dimen/margin_16"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/margin_16" android:padding="@dimen/margin_16"
android:theme="@style/Theme.AppCompat.Light" android:theme="@style/Theme.AppCompat.Light">
>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -14,12 +13,10 @@ ...@@ -14,12 +13,10 @@
android:layout_marginBottom="@dimen/margin_16" android:layout_marginBottom="@dimen/margin_16"
android:gravity="center" android:gravity="center"
android:text="@string/fragment_home_welcome_message" android:text="@string/fragment_home_welcome_message"
android:textSize="14sp" android:textSize="14sp" />
/>
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher" android:src="@mipmap/ic_launcher" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark" android:background="?attr/colorPrimaryDark">
>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -13,22 +12,19 @@ ...@@ -13,22 +12,19 @@
android:background="@color/white" android:background="@color/white"
android:minWidth="288dp" android:minWidth="288dp"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<LinearLayout <LinearLayout
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical" android:orientation="vertical">
>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/fragment_input_hostname_hostname" android:text="@string/fragment_input_hostname_hostname"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
/>
<EditText <EditText
android:id="@+id/editor_hostname" android:id="@+id/editor_hostname"
...@@ -37,14 +33,12 @@ ...@@ -37,14 +33,12 @@
android:hint="@string/fragment_input_hostname_server_hint" android:hint="@string/fragment_input_hostname_server_hint"
android:imeOptions="actionGo" android:imeOptions="actionGo"
android:inputType="textWebEditText" android:inputType="textWebEditText"
android:singleLine="true" android:singleLine="true" />
/>
</LinearLayout> </LinearLayout>
<Space <Space
android:layout_width="@dimen/margin_8" android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_connect" android:id="@+id/btn_connect"
...@@ -53,7 +47,6 @@ ...@@ -53,7 +47,6 @@
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark" android:background="?attr/colorPrimaryDark">
>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -13,14 +12,12 @@ ...@@ -13,14 +12,12 @@
android:background="@color/white" android:background="@color/white"
android:minWidth="288dp" android:minWidth="288dp"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal">
>
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_twitter" android:id="@+id/btn_login_with_twitter"
...@@ -29,7 +26,7 @@ ...@@ -29,7 +26,7 @@
android:layout_marginEnd="@dimen/margin_8" android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_twitter" android:text="@string/fa_twitter"
android:textSize="16dp" android:textSize="16dp"
/> android:layout_marginRight="@dimen/margin_8" />
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_facebook" android:id="@+id/btn_login_with_facebook"
...@@ -38,7 +35,7 @@ ...@@ -38,7 +35,7 @@
android:layout_marginEnd="@dimen/margin_8" android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_facebook_official" android:text="@string/fa_facebook_official"
android:textSize="16dp" android:textSize="16dp"
/> android:layout_marginRight="@dimen/margin_8" />
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_github" android:id="@+id/btn_login_with_github"
...@@ -47,7 +44,7 @@ ...@@ -47,7 +44,7 @@
android:layout_marginEnd="@dimen/margin_8" android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_github" android:text="@string/fa_github"
android:textSize="16dp" android:textSize="16dp"
/> android:layout_marginRight="@dimen/margin_8" />
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_login_with_google" android:id="@+id/btn_login_with_google"
...@@ -56,15 +53,14 @@ ...@@ -56,15 +53,14 @@
android:layout_marginEnd="@dimen/margin_8" android:layout_marginEnd="@dimen/margin_8"
android:text="@string/fa_google" android:text="@string/fa_google"
android:textSize="16dp" android:textSize="16dp"
/> android:layout_marginRight="@dimen/margin_8" />
</LinearLayout> </LinearLayout>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username" android:id="@+id/text_input_username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/editor_username" android:id="@+id/editor_username"
...@@ -73,21 +69,18 @@ ...@@ -73,21 +69,18 @@
android:hint="@string/fragment_login_username_or_email" android:hint="@string/fragment_login_username_or_email"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textWebEmailAddress" android:inputType="textWebEmailAddress"
android:singleLine="true" android:singleLine="true" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<Space <Space
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/margin_8" android:layout_height="@dimen/margin_8" />
/>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/text_input_passwd" android:id="@+id/text_input_passwd"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:passwordToggleEnabled="true" app:passwordToggleEnabled="true">
>
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/editor_passwd" android:id="@+id/editor_passwd"
...@@ -96,20 +89,17 @@ ...@@ -96,20 +89,17 @@
android:hint="@string/fragment_login_password" android:hint="@string/fragment_login_password"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textWebPassword" android:inputType="textWebPassword"
android:singleLine="true" android:singleLine="true" />
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<Space <Space
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/margin_16" android:layout_height="@dimen/margin_16" />
/>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal">
>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_user_registration" android:id="@+id/btn_user_registration"
...@@ -119,8 +109,7 @@ ...@@ -119,8 +109,7 @@
app:backgroundTint="@color/white" app:backgroundTint="@color/white"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" 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.support.design.widget.FloatingActionButton
android:id="@+id/btn_login_with_email" android:id="@+id/btn_login_with_email"
...@@ -129,8 +118,7 @@ ...@@ -129,8 +118,7 @@
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="normal" app:fabSize="normal"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
/>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark" android:background="?attr/colorPrimaryDark">
>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -13,15 +12,13 @@ ...@@ -13,15 +12,13 @@
android:background="@color/white" android:background="@color/white"
android:minWidth="288dp" android:minWidth="288dp"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/margin_24" android:padding="@dimen/margin_24">
>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/fragment_retry_login_error_title" android:text="@string/fragment_retry_login_error_title"
android:textAppearance="@style/TextAppearance.AppCompat.Title" android:textAppearance="@style/TextAppearance.AppCompat.Title" />
/>
<TextView <TextView
android:id="@+id/txt_error_description" android:id="@+id/txt_error_description"
...@@ -29,16 +26,14 @@ ...@@ -29,16 +26,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_8" android:layout_marginBottom="@dimen/margin_8"
android:layout_marginTop="@dimen/margin_8" android:layout_marginTop="@dimen/margin_8"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1" android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1" />
/>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical">
>
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_retry_login" android:id="@+id/btn_retry_login"
...@@ -47,15 +42,13 @@ ...@@ -47,15 +42,13 @@
android:layout_margin="@dimen/margin_8" android:layout_margin="@dimen/margin_8"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="normal" app:fabSize="normal"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/fragment_retry_login_retry_title" android:text="@string/fragment_retry_login_retry_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
/>
</LinearLayout> </LinearLayout>
...@@ -66,8 +59,7 @@ ...@@ -66,8 +59,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/margin_16" android:layout_marginTop="@dimen/margin_16"
app:dotCount="5" app:dotCount="5"
app:dotSize="12dp" app:dotSize="12dp" />
/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -2,19 +2,17 @@ ...@@ -2,19 +2,17 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" 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 <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="end" android:layout_gravity="end"
android:clickable="true" 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> </FrameLayout>
</android.support.v4.widget.DrawerLayout> </android.support.v4.widget.DrawerLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
/> android:layout_above="@+id/message_composer" />
<chat.rocket.android.widget.message.MessageComposer <chat.rocket.android.widget.message.MessageComposer
android:id="@+id/message_composer" android:id="@+id/message_composer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/Theme.AppCompat.Light" android:theme="@style/Theme.AppCompat.Light"
android:layout_gravity="bottom" android:layout_alignParentBottom="true" />
android:background="@android:color/white" </RelativeLayout>
/> \ No newline at end of file
<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
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingStart="?attr/listPreferredItemPaddingLeft"> android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingLeft="?attr/listPreferredItemPaddingLeft">
<TextView <TextView
android:id="@+id/unread_title" android:id="@+id/unread_title"
...@@ -80,7 +81,8 @@ ...@@ -80,7 +81,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight" android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:orientation="vertical" /> android:orientation="vertical"
android:layout_marginRight="?attr/listPreferredItemPaddingRight" />
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -112,7 +114,8 @@ ...@@ -112,7 +114,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight" android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:orientation="vertical" /> android:orientation="vertical"
android:layout_marginRight="?attr/listPreferredItemPaddingRight" />
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -144,7 +147,8 @@ ...@@ -144,7 +147,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight" android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:orientation="vertical" /> android:orientation="vertical"
android:layout_marginRight="?attr/listPreferredItemPaddingRight" />
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
......
...@@ -3,29 +3,25 @@ ...@@ -3,29 +3,25 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark" android:background="?attr/colorPrimaryDark"
android:theme="@style/AppTheme.Dark" android:theme="@style/AppTheme.Dark">
>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical">
>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<TextView <TextView
android:id="@+id/txt_caption" android:id="@+id/txt_caption"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_32" android:layout_marginTop="@dimen/margin_32"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
<Space xmlns:android="http://schemas.android.com/apk/res/android" <Space xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/space" android:id="@+id/space"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="88dp" android:layout_height="0dp" />
/> \ No newline at end of file
\ No newline at end of file
...@@ -3,14 +3,12 @@ ...@@ -3,14 +3,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:theme="@style/AppTheme" android:theme="@style/AppTheme">
>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_margin="@dimen/margin_8" android:layout_margin="@dimen/margin_8" />
/>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -6,15 +6,13 @@ ...@@ -6,15 +6,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_margin="16dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal">
>
<View <View
android:layout_width="0px" android:layout_width="0px"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/newday_color" android:background="@color/newday_color" />
/>
<TextView <TextView
android:id="@+id/newday_text" android:id="@+id/newday_text"
...@@ -25,14 +23,12 @@ ...@@ -25,14 +23,12 @@
android:textColor="@color/newday_color" android:textColor="@color/newday_color"
android:textSize="8sp" android:textSize="8sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="2016/01/23" tools:text="2016/01/23" />
/>
<View <View
android:layout_width="0px" android:layout_width="0px"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/newday_color" android:background="@color/newday_color" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:theme="@style/AppTheme" android:theme="@style/AppTheme">
>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -12,7 +11,6 @@ ...@@ -12,7 +11,6 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_margin="@dimen/margin_16" android:layout_margin="@dimen/margin_16"
android:text="@string/start_of_conversation" android:text="@string/start_of_conversation"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
/>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -4,77 +4,70 @@ ...@@ -4,77 +4,70 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:layout_marginBottom="2dp">
>
<ImageView <ImageView
android:id="@+id/user_avatar" android:id="@+id/user_avatar"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_margin="8dp" android:layout_margin="8dp"
tools:src="@drawable/ic_default_avatar" tools:src="@drawable/ic_default_avatar" />
/>
<LinearLayout <LinearLayout
android:layout_width="0px" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_weight="1" android:layout_marginStart="48dp"
android:orientation="vertical" android:orientation="vertical"
> android:layout_marginRight="8dp"
android:layout_marginLeft="48dp">
<LinearLayout <LinearLayout
android:id="@+id/user_and_timestamp_container" android:id="@+id/user_and_timestamp_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal">
>
<TextView <TextView
android:id="@+id/username" android:id="@+id/username"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
tools:text="John Doe" tools:text="John Doe" />
/>
<Space <Space
android:layout_width="@dimen/margin_8" android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<TextView <TextView
android:id="@+id/timestamp" android:id="@+id/timestamp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
tools:text="12:34" tools:text="12:34" />
/>
</LinearLayout> </LinearLayout>
<chat.rocket.android.widget.message.RocketChatMessageLayout <chat.rocket.android.widget.message.RocketChatMessageLayout
android:id="@+id/message_body" android:id="@+id/message_body"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<chat.rocket.android.widget.message.RocketChatMessageUrlsLayout <chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
android:id="@+id/message_urls" android:id="@+id/message_urls"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout <chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
android:id="@+id/message_attachments" android:id="@+id/message_attachments"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
</LinearLayout> </LinearLayout>
</LinearLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -4,60 +4,53 @@ ...@@ -4,60 +4,53 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:orientation="horizontal"
>
<ImageView <ImageView
android:id="@+id/user_avatar" android:id="@+id/user_avatar"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_margin="8dp" android:layout_margin="8dp"
tools:src="@drawable/ic_default_avatar" tools:src="@drawable/ic_default_avatar" />
/>
<LinearLayout <LinearLayout
android:layout_width="0px" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_weight="1" android:layout_marginStart="48dp"
android:orientation="vertical" android:orientation="vertical"
> android:layout_marginRight="8dp"
android:layout_marginLeft="48dp">
<LinearLayout <LinearLayout
android:id="@+id/user_and_timestamp_container" android:id="@+id/user_and_timestamp_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal">
>
<TextView <TextView
android:id="@+id/username" android:id="@+id/username"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
tools:text="John Doe" tools:text="John Doe" />
/>
<Space <Space
android:layout_width="@dimen/margin_8" android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<TextView <TextView
android:id="@+id/timestamp" android:id="@+id/timestamp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
tools:text="12:34" tools:text="12:34" />
/>
</LinearLayout> </LinearLayout>
<TextView <TextView
...@@ -66,8 +59,7 @@ ...@@ -66,8 +59,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textStyle="italic" android:textStyle="italic"
android:enabled="false" android:enabled="false" />
/>
</LinearLayout> </LinearLayout>
</LinearLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -3,21 +3,18 @@ ...@@ -3,21 +3,18 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall" android:layout_height="?attr/listPreferredItemHeightSmall"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal">
>
<ImageView <ImageView
android:id="@+id/room_user_status" android:id="@+id/room_user_status"
android:layout_width="8dp" android:layout_width="8dp"
android:layout_height="8dp" android:layout_height="8dp"
android:layout_margin="@dimen/margin_8" android:layout_margin="@dimen/margin_8" />
/>
<ImageView <ImageView
android:id="@+id/room_user_avatar" android:id="@+id/room_user_avatar"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp" />
/>
<TextView <TextView
android:id="@+id/room_user_name" android:id="@+id/room_user_name"
...@@ -27,7 +24,6 @@ ...@@ -27,7 +24,6 @@
android:layout_marginLeft="@dimen/margin_8" android:layout_marginLeft="@dimen/margin_8"
android:layout_marginRight="@dimen/margin_8" android:layout_marginRight="@dimen/margin_8"
android:layout_weight="1" android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -4,31 +4,27 @@ ...@@ -4,31 +4,27 @@
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="end" android:layout_gravity="end"
android:orientation="vertical" android:orientation="vertical">
>
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:enabled="false" android:enabled="false"
android:text="@string/fa_search" android:text="@string/fa_search"
android:textSize="24dp" android:textSize="24dp" />
/>
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:id="@+id/btn_users" android:id="@+id/btn_users"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:text="@string/fa_users" android:text="@string/fa_users"
android:textSize="24dp" android:textSize="24dp" />
/>
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:enabled="false" android:enabled="false"
android:text="@string/fa_at" android:text="@string/fa_at"
android:textSize="24dp" android:textSize="24dp" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -4,44 +4,38 @@ ...@@ -4,44 +4,38 @@
android:layout_width="280dp" android:layout_width="280dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_gravity="start"
android:theme="@style/AppTheme.Dark" android:theme="@style/AppTheme.Dark">
>
<android.support.v4.widget.NestedScrollView <android.support.v4.widget.NestedScrollView
android:layout_width="96dp" android:layout_width="96dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_gravity="start"
android:background="?attr/colorPrimaryDark" android:background="?attr/colorPrimaryDark">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical">
>
<ImageButton <ImageButton
style="@style/Base.Widget.AppCompat.Button.Borderless" style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_margin="@dimen/margin_8" android:layout_margin="@dimen/margin_8"
android:src="@mipmap/ic_launcher" android:src="@mipmap/ic_launcher" />
/>
<chat.rocket.android.widget.FontAwesomeButton <chat.rocket.android.widget.FontAwesomeButton
style="@style/Base.Widget.AppCompat.Button.Borderless" style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_margin="@dimen/margin_8" android:layout_margin="@dimen/margin_8"
android:text="@string/fa_plus" android:text="@string/fa_plus" />
/>
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
<FrameLayout <FrameLayout
android:id="@+id/sidebar_fragment_container" android:id="@+id/sidebar_fragment_container"
android:layout_width="280dp" android:layout_width="280dp"
android:layout_height="match_parent" android:layout_height="match_parent" />
/>
</android.support.v4.widget.SlidingPaneLayout> </android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
<WebView xmlns:android="http://schemas.android.com/apk/res/android" <WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview" android:id="@+id/webview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
/> \ No newline at end of file
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<string name="resend">Resend</string> <string name="resend">Resend</string>
<string name="discard">Discard</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_email">Email</string>
<string name="dialog_user_registration_username">Username</string> <string name="dialog_user_registration_username">Username</string>
...@@ -34,4 +34,9 @@ ...@@ -34,4 +34,9 @@
<string name="server_config_activity_authenticating">Authenticating…</string> <string name="server_config_activity_authenticating">Authenticating…</string>
<string name="home_fragment_title">Rocket.Chat - Home</string> <string name="home_fragment_title">Rocket.Chat - Home</string>
<string name="fragment_sidebar_main_unread_rooms_title">UNREAD ROOMS</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> </resources>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<item name="actionModeBackground">?attr/colorPrimaryDark</item> <item name="actionModeBackground">?attr/colorPrimaryDark</item>
<item name="android:statusBarColor" tools:targetApi="21">?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:navigationBarColor" tools:targetApi="21">?attr/colorPrimaryDark</item>
<item name="android:windowBackground">@android:color/white</item>
</style> </style>
<style name="AppTheme.Dark" parent="Theme.AppCompat.NoActionBar"> <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; ...@@ -4,11 +4,14 @@ import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -19,6 +22,9 @@ public class MessageComposer extends LinearLayout { ...@@ -19,6 +22,9 @@ public class MessageComposer extends LinearLayout {
protected ActionListener actionListener; protected ActionListener actionListener;
protected ViewGroup composer; protected ViewGroup composer;
private View btnExtra;
private View btnSubmit;
public MessageComposer(Context context) { public MessageComposer(Context context) {
super(context); super(context);
init(); init();
...@@ -47,14 +53,50 @@ public class MessageComposer extends LinearLayout { ...@@ -47,14 +53,50 @@ public class MessageComposer extends LinearLayout {
private void init() { private void init() {
composer = (ViewGroup) LayoutInflater.from(getContext()) composer = (ViewGroup) LayoutInflater.from(getContext())
.inflate(R.layout.message_composer, this, false); .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 @Override
public void onClick(View view) { public void onClick(View view) {
String messageText = getText(); String messageText = getText();
if (messageText.length() > 0) { if (messageText.length() > 0 && actionListener != null) {
if (actionListener != null) { actionListener.onSubmit(messageText);
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 { ...@@ -113,9 +155,29 @@ public class MessageComposer extends LinearLayout {
return getVisibility() == View.VISIBLE; 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 { public interface ActionListener {
void onSubmit(String message); void onSubmit(String message);
void onExtra();
void onCancel(); 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 @@ ...@@ -3,5 +3,4 @@
android:id="@android:id/text1" android:id="@android:id/text1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.RocketChat.MessageBody" android:textAppearance="@style/TextAppearance.RocketChat.MessageBody" />
/>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TextView <TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1" android:id="@android:id/text1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -11,4 +10,5 @@ ...@@ -11,4 +10,5 @@
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:layout_marginBottom="3dp" android:layout_marginBottom="3dp"
/> android:layout_marginLeft="0px"
\ No newline at end of file android:layout_marginRight="6dp" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical">
>
<chat.rocket.android.widget.DividerView <chat.rocket.android.widget.DividerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" 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 <EditText
android:id="@+id/editor" android:id="@+id/editor"
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" 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:layout_weight="1"
android:maxLines="3" android:textSize="14sp"
/> android:hint="@string/message_composer_message_hint"
android:minLines="1"
android:maxLines="4" />
<ImageButton <FrameLayout
android:id="@+id/btn_submit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content">
android:layout_gravity="center_vertical"
app:srcCompat="@drawable/ic_send_black_24dp" <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>
</LinearLayout> </LinearLayout>
...@@ -4,21 +4,19 @@ ...@@ -4,21 +4,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_margin="4dp" android:layout_margin="4dp"
android:padding="4dp" android:padding="4dp">
>
<View <View
android:layout_width="3dp" android:layout_width="3dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:background="@color/inline_attachment_quote_line" android:background="@color/inline_attachment_quote_line" />
/>
<LinearLayout <LinearLayout
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical" android:orientation="vertical">
>
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
...@@ -27,8 +25,7 @@ ...@@ -27,8 +25,7 @@
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title" android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground" />
/>
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
...@@ -38,8 +35,7 @@ ...@@ -38,8 +35,7 @@
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:scaleType="fitStart" android:scaleType="fitStart" />
/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
android:orientation="horizontal" android:orientation="horizontal"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:layout_margin="4dp" android:layout_margin="4dp"
android:padding="4dp" android:padding="4dp">
>
<View <View
android:layout_width="3dp" android:layout_width="3dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:background="@color/inline_attachment_quote_line" android:background="@color/inline_attachment_quote_line"
/> android:layout_marginRight="5dp" />
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
...@@ -23,14 +23,13 @@ ...@@ -23,14 +23,13 @@
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:scaleType="fitStart" android:scaleType="fitStart"
/> android:layout_marginRight="8dp" />
<LinearLayout <LinearLayout
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical" android:orientation="vertical">
>
<TextView <TextView
android:id="@+id/hostname" android:id="@+id/hostname"
...@@ -38,8 +37,7 @@ ...@@ -38,8 +37,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:enabled="false" android:enabled="false" />
/>
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
...@@ -47,8 +45,7 @@ ...@@ -47,8 +45,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title" android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Title" />
/>
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
...@@ -56,8 +53,7 @@ ...@@ -56,8 +53,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Description" android:textAppearance="@style/TextAppearance.RocketChat.MessageAttachment.Description" />
/>
</LinearLayout> </LinearLayout>
......
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/inline_attachment_background" android:background="@drawable/inline_attachment_background"
android:layout_margin="4dp" android:layout_margin="4dp"
android:padding="4dp" android:padding="4dp">
>
<ImageView <ImageView
android:id="@+id/message_inline_image" android:id="@+id/message_inline_image"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxHeight="200dp" android:maxHeight="200dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:scaleType="fitStart" android:scaleType="fitStart" />
/>
</FrameLayout> </FrameLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" <merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
>
<FrameLayout <FrameLayout
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="?attr/listPreferredItemHeightSmall" android:layout_height="?attr/listPreferredItemHeightSmall"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
> android:layout_marginRight="16dp">
<chat.rocket.android.widget.FontAwesomeTextView <chat.rocket.android.widget.FontAwesomeTextView
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
/>
</FrameLayout> </FrameLayout>
<TextView <TextView
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
android:layout_height="?attr/listPreferredItemHeightSmall" android:layout_height="?attr/listPreferredItemHeightSmall"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Body2" android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
/>
<FrameLayout <FrameLayout
android:id="@+id/alert_count_container" android:id="@+id/alert_count_container"
...@@ -35,14 +34,14 @@ ...@@ -35,14 +34,14 @@
android:padding="3dp" android:padding="3dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/unread_count_background" android:background="@drawable/unread_count_background"
> android:layout_marginLeft="8dp">
<TextView <TextView
android:id="@+id/alert_count" android:id="@+id/alert_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14dp" android:textSize="14dp"
android:layout_gravity="center" android:layout_gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
/>
</FrameLayout> </FrameLayout>
</merge> </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