Commit c8be3dfb authored by Tiago Cunha's avatar Tiago Cunha

Improved message entry

Message entry always available
Clean up some views
RTL fixes
Fixes notification breaking bug
parent a21a9ec0
...@@ -154,8 +154,8 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -154,8 +154,8 @@ public class RoomFragment extends AbstractChatRoomFragment
@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 +171,6 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -171,7 +171,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 +179,8 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -180,8 +179,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();
...@@ -225,6 +224,13 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -225,6 +224,13 @@ 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.setExtrasPickerListener(() -> {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture to Upload"),
RC_UPL);
});
} }
private void setupFileUploader() { private void setupFileUploader() {
...@@ -285,10 +291,10 @@ public class RoomFragment extends AbstractChatRoomFragment ...@@ -285,10 +291,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 {
......
...@@ -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);
} }
......
...@@ -9,6 +9,7 @@ import chat.rocket.android.widget.message.MessageComposer; ...@@ -9,6 +9,7 @@ import chat.rocket.android.widget.message.MessageComposer;
public class MessageComposerManager { public class MessageComposerManager {
private final MessageComposer messageComposer; private final MessageComposer messageComposer;
private SendMessageCallback sendMessageCallback; private SendMessageCallback sendMessageCallback;
private ExtrasPickerListener extrasPickerListener;
public MessageComposerManager(MessageComposer messageComposer) { public MessageComposerManager(MessageComposer messageComposer) {
this.messageComposer = messageComposer; this.messageComposer = messageComposer;
...@@ -19,16 +20,12 @@ public class MessageComposerManager { ...@@ -19,16 +20,12 @@ public class MessageComposerManager {
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
...@@ -41,11 +38,42 @@ public class MessageComposerManager { ...@@ -41,11 +38,42 @@ public class MessageComposerManager {
this.sendMessageCallback = sendMessageCallback; this.sendMessageCallback = sendMessageCallback;
} }
public void setExtrasPickerListener(ExtrasPickerListener listener) {
extrasPickerListener = listener;
}
public void clearComposingText() { public void clearComposingText() {
messageComposer.setText(""); messageComposer.setText("");
} }
private void sendMessage(String message) {
if (sendMessageCallback == null) {
return;
}
messageComposer.setEnabled(false);
sendMessageCallback.onSubmit(message).onSuccess(task -> {
clearComposingText();
return null;
}).continueWith(task -> {
messageComposer.setEnabled(true);
return null;
});
}
private void openExtras() {
if (extrasPickerListener == null) {
return;
}
extrasPickerListener.onOpen();
}
public interface SendMessageCallback { public interface SendMessageCallback {
Task<Void> onSubmit(String messageText); Task<Void> onSubmit(String messageText);
} }
public interface ExtrasPickerListener {
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) {
} }
}; };
} }
......
...@@ -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));
......
...@@ -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
...@@ -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 xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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.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>
</FrameLayout> \ No newline at end of file
\ 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
...@@ -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">
......
...@@ -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();
} }
} }
<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
...@@ -12,20 +12,50 @@ ...@@ -12,20 +12,50 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal"> 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