Add no connectivity icon & fix FAB appearance on various states

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-10-17 13:26:56 +02:00
parent fd44934b98
commit 978be1afe1
2 changed files with 35 additions and 5 deletions

View File

@ -199,7 +199,7 @@ class ConversationsListView : BaseView(), OnQueryTextListener,
view?.loadingStateView?.visibility = View.GONE view?.loadingStateView?.visibility = View.GONE
view?.stateWithMessageView?.visibility = View.GONE view?.stateWithMessageView?.visibility = View.GONE
view?.dataStateView?.visibility = View.VISIBLE view?.dataStateView?.visibility = View.VISIBLE
view?.floatingActionButton?.visibility = View.GONE view?.floatingActionButton?.visibility = View.VISIBLE
searchItem?.isVisible = true searchItem?.isVisible = true
} }
LOADED_EMPTY, FAILED -> { LOADED_EMPTY, FAILED -> {
@ -209,15 +209,20 @@ class ConversationsListView : BaseView(), OnQueryTextListener,
view?.swipeRefreshLayoutView?.isEnabled = true view?.swipeRefreshLayoutView?.isEnabled = true
view?.loadingStateView?.visibility = View.GONE view?.loadingStateView?.visibility = View.GONE
view?.dataStateView?.visibility = View.GONE view?.dataStateView?.visibility = View.GONE
view?.floatingActionButton?.visibility = View.GONE
searchItem?.isVisible = false searchItem?.isVisible = false
if (value.equals(FAILED)) { if (value.equals(FAILED)) {
view?.stateWithMessageView?.errorStateTextView?.text = messageData view?.stateWithMessageView?.errorStateTextView?.text = messageData
if (messageData.equals(context.resources.getString(R.string.nc_no_connection_error))) {
view?.stateWithMessageView?.errorStateImageView?.setImageResource( view?.stateWithMessageView?.errorStateImageView?.setImageResource(
R.drawable.ic_announcement_white_24dp R.drawable.ic_cloud_off_white_24dp)
)
} else { } else {
view?.stateWithMessageView?.errorStateImageView?.setImageResource(
R.drawable.ic_announcement_white_24dp)
}
view?.floatingActionButton?.visibility = View.GONE
} else {
view?.floatingActionButton?.visibility = View.VISIBLE
view?.stateWithMessageView?.errorStateTextView?.text = view?.stateWithMessageView?.errorStateTextView?.text =
resources?.getText(R.string.nc_conversations_empty) resources?.getText(R.string.nc_conversations_empty)
view?.stateWithMessageView?.errorStateImageView?.setImageResource(R.drawable.ic_logo) view?.stateWithMessageView?.errorStateImageView?.setImageResource(R.drawable.ic_logo)

View File

@ -0,0 +1,25 @@
<!--
~ Nextcloud Talk application
~
~ @author Mario Danic
~ Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4c-1.48,0 -2.85,0.43 -4.01,1.17l1.46,1.46C10.21,6.23 11.08,6 12,6c3.04,0 5.5,2.46 5.5,5.5v0.5H19c1.66,0 3,1.34 3,3 0,1.13 -0.64,2.11 -1.56,2.62l1.45,1.45C23.16,18.16 24,16.68 24,15c0,-2.64 -2.05,-4.78 -4.65,-4.96zM3,5.27l2.75,2.74C2.56,8.15 0,10.77 0,14c0,3.31 2.69,6 6,6h11.73l2,2L21,20.73 4.27,4 3,5.27zM7.73,10l8,8H6c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4h1.73z"/>
</vector>