Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-05-30 13:52:23 +02:00
parent 124fd801a1
commit c335e7b7bd
3 changed files with 2 additions and 74 deletions

View File

@ -137,10 +137,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
EmojiEditText messageInput; EmojiEditText messageInput;
@BindView(R.id.popupBubbleView) @BindView(R.id.popupBubbleView)
PopupBubble popupBubble; PopupBubble popupBubble;
@BindView(R.id.emptyLayout)
RelativeLayout emptyLayout;
@BindView(R.id.sendHiTextView)
TextView sendHiTextView;
@BindView(R.id.progressBar) @BindView(R.id.progressBar)
ProgressBar loadingProgressBar; ProgressBar loadingProgressBar;
@BindView(R.id.smileyButton) @BindView(R.id.smileyButton)
@ -296,9 +292,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
getActionBar().show(); getActionBar().show();
boolean adapterWasNull = false; boolean adapterWasNull = false;
sendHiTextView.setText(String.format(getResources().getString(R.string.nc_chat_empty), getResources()
.getString(R.string.nc_hello)));
if (adapter == null) { if (adapter == null) {
loadingProgressBar.setVisibility(View.VISIBLE); loadingProgressBar.setVisibility(View.VISIBLE);
@ -329,11 +322,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
} }
}); });
} else { } else {
if (adapter.getItemCount() == 0) { messagesListView.setVisibility(View.VISIBLE);
emptyLayout.setVisibility(View.VISIBLE);
} else {
messagesListView.setVisibility(View.VISIBLE);
}
} }
@ -653,14 +642,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
emojiPopup.toggle(); emojiPopup.toggle();
} }
@OnClick(R.id.emptyLayout)
void sendHello() {
if (!isHelloClicked) {
isHelloClicked = true;
sendMessage(getResources().getString(R.string.nc_hello) + " 👋");
}
}
private void joinRoomWithPassword() { private void joinRoomWithPassword() {
if (currentCall == null) { if (currentCall == null) {
@ -921,33 +902,10 @@ public class ChatController extends BaseController implements MessagesListAdapte
loadingProgressBar.setVisibility(View.GONE); loadingProgressBar.setVisibility(View.GONE);
} }
if (chatMessageList.size() == 0) {
if (emptyLayout != null) {
emptyLayout.setVisibility(View.VISIBLE);
}
if (messagesListView != null) {
messagesListView.setVisibility(View.GONE);
}
} else {
if (emptyLayout != null) {
emptyLayout.setVisibility(View.GONE);
}
if (messagesListView != null) {
messagesListView.setVisibility(View.VISIBLE);
}
}
} else {
if (emptyLayout != null) {
emptyLayout.setVisibility(View.GONE);
}
if (messagesListView != null) { if (messagesListView != null) {
messagesListView.setVisibility(View.VISIBLE); messagesListView.setVisibility(View.VISIBLE);
} }
} }
int countGroupedMessages = 0; int countGroupedMessages = 0;
@ -1046,10 +1004,6 @@ public class ChatController extends BaseController implements MessagesListAdapte
if (loadingProgressBar != null) { if (loadingProgressBar != null) {
loadingProgressBar.setVisibility(View.GONE); loadingProgressBar.setVisibility(View.GONE);
} }
if (emptyLayout != null && emptyLayout.getVisibility() != View.VISIBLE) {
emptyLayout.setVisibility(View.VISIBLE);
}
} }
historyRead = true; historyRead = true;

View File

@ -37,31 +37,6 @@
android:indeterminateTintMode="src_in" android:indeterminateTintMode="src_in"
android:visibility="gone" /> android:visibility="gone" />
<RelativeLayout
android:id="@+id/emptyLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<TextView
android:id="@+id/wawingTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="👋"
android:textAlignment="center"
android:textSize="72sp" />
<TextView
android:id="@+id/sendHiTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/wawingTextView"
android:layout_margin="8dp"
android:textAlignment="center"
android:textSize="20sp" />
</RelativeLayout>
<com.stfalcon.chatkit.messages.MessagesList <com.stfalcon.chatkit.messages.MessagesList
android:id="@+id/messagesListView" android:id="@+id/messagesListView"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -244,7 +244,6 @@
<string name="nc_description_send_message_button">Send message</string> <string name="nc_description_send_message_button">Send message</string>
<!-- Empty states --> <!-- Empty states -->
<string name="nc_chat_empty">Tap to be the first to say %1$s!</string>
<string name="nc_conversations_empty">Join a conversation or start a new one\n Say hi to your friends and colleagues!</string> <string name="nc_conversations_empty">Join a conversation or start a new one\n Say hi to your friends and colleagues!</string>
<string name="nc_hello">Hello</string> <string name="nc_hello">Hello</string>