From cb570978e5483635892a3307dfcde4409dc95a7d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 20 Feb 2019 16:27:00 +0000 Subject: [PATCH] Account activity: don't hide collection headers even if empty. This was an annoying remanent from DAVDroid. Maybe it makes sense for DAV, but it defo doesn't make sense for us where we can just create collections (and anyhow always have existing defaults!). --- .../com/etesync/syncadapter/ui/AccountActivity.kt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt b/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt index 5cf45e9d..b28c45ad 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt @@ -22,7 +22,6 @@ import android.provider.ContactsContract import android.support.design.widget.Snackbar import android.support.v4.content.ContextCompat import android.support.v7.app.AlertDialog -import android.support.v7.widget.CardView import android.support.v7.widget.Toolbar import android.text.TextUtils import android.view.* @@ -226,7 +225,6 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe override fun onLoadFinished(loader: Loader, info: AccountInfo) { accountInfo = info - var card = findViewById(R.id.carddav) as CardView if (info.carddav != null) { val progress = findViewById(R.id.carddav_refreshing) as ProgressBar progress.visibility = if (info.carddav!!.refreshing) View.VISIBLE else View.GONE @@ -239,10 +237,8 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe adapter.addAll(info.carddav!!.journals!!) listCardDAV!!.adapter = adapter listCardDAV!!.onItemClickListener = onItemClickListener - } else - card.visibility = View.GONE + } - card = findViewById(R.id.caldav) as CardView if (info.caldav != null) { val progress = findViewById(R.id.caldav_refreshing) as ProgressBar progress.visibility = if (info.caldav!!.refreshing) View.VISIBLE else View.GONE @@ -255,10 +251,8 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe adapter.addAll(info.caldav!!.journals!!) listCalDAV!!.adapter = adapter listCalDAV!!.onItemClickListener = onItemClickListener - } else - card.visibility = View.GONE + } - card = findViewById(R.id.taskdav) as CardView if (info.taskdav != null) { val progress = findViewById(R.id.taskdav_refreshing) as ProgressBar progress.visibility = if (info.taskdav!!.refreshing) View.VISIBLE else View.GONE @@ -271,8 +265,7 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe adapter.addAll(info.taskdav!!.journals!!) listTaskDAV!!.adapter = adapter listTaskDAV!!.onItemClickListener = onItemClickListener - } else - card.visibility = View.GONE + } } override fun onLoaderReset(loader: Loader) {