|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
package com.owncloud.android.ui.activity
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
import android.os.Bundle
|
|
|
import android.view.Menu
|
|
|
import android.view.MenuInflater
|
|
@@ -18,53 +19,51 @@ import com.nextcloud.client.di.Injectable
|
|
|
import com.owncloud.android.R
|
|
|
import com.owncloud.android.databinding.InternalTwoWaySyncLayoutBinding
|
|
|
import com.owncloud.android.ui.adapter.InternalTwoWaySyncAdapter
|
|
|
-import com.owncloud.android.utils.theme.ViewThemeUtils
|
|
|
-import javax.inject.Inject
|
|
|
|
|
|
class InternalTwoWaySyncActivity : DrawerActivity(), Injectable {
|
|
|
lateinit var binding: InternalTwoWaySyncLayoutBinding
|
|
|
|
|
|
- @Inject
|
|
|
- lateinit var viewThemeUtils: ViewThemeUtils
|
|
|
-
|
|
|
+ @SuppressLint("NotifyDataSetChanged")
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
|
|
binding = InternalTwoWaySyncLayoutBinding.inflate(layoutInflater)
|
|
|
setContentView(binding.root)
|
|
|
|
|
|
- binding.list.apply {
|
|
|
- setEmptyView(binding.emptyList.emptyListView)
|
|
|
+ binding.run {
|
|
|
+ list.run {
|
|
|
+ setEmptyView(binding.emptyList.emptyListView)
|
|
|
|
|
|
- binding.emptyList.emptyListViewHeadline.apply {
|
|
|
- visibility = View.VISIBLE
|
|
|
- setText(R.string.internal_two_way_sync_list_empty_headline)
|
|
|
- }
|
|
|
- binding.emptyList.emptyListViewText.apply {
|
|
|
- visibility = View.VISIBLE
|
|
|
- setText(R.string.internal_two_way_sync_text)
|
|
|
- }
|
|
|
- binding.emptyList.emptyListIcon.apply {
|
|
|
- visibility = View.VISIBLE
|
|
|
- setImageDrawable(
|
|
|
- viewThemeUtils.platform.tintPrimaryDrawable(
|
|
|
- context,
|
|
|
- R.drawable.ic_sync
|
|
|
- )
|
|
|
- )
|
|
|
- }
|
|
|
+ emptyList.run {
|
|
|
+ emptyListViewHeadline.apply {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ setText(R.string.internal_two_way_sync_list_empty_headline)
|
|
|
+ }
|
|
|
+ emptyList.emptyListViewText.apply {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ setText(R.string.internal_two_way_sync_text)
|
|
|
+ }
|
|
|
+ emptyList.emptyListIcon.apply {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ setImageDrawable(
|
|
|
+ viewThemeUtils.platform.tintPrimaryDrawable(
|
|
|
+ context,
|
|
|
+ R.drawable.ic_sync
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- adapter = InternalTwoWaySyncAdapter(fileDataStorageManager, user.get(), context).apply {
|
|
|
- notifyDataSetChanged()
|
|
|
+ adapter = InternalTwoWaySyncAdapter(fileDataStorageManager, user.get(), context).apply {
|
|
|
+ notifyDataSetChanged()
|
|
|
+ }
|
|
|
+ layoutManager = LinearLayoutManager(context)
|
|
|
}
|
|
|
- layoutManager = LinearLayoutManager(context)
|
|
|
}
|
|
|
|
|
|
setupToolbar()
|
|
|
- updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_synced_folders))
|
|
|
- if (supportActionBar != null) {
|
|
|
- supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
|
|
- }
|
|
|
+ updateActionBarTitleAndHomeButtonByString(getString(R.string.internal_two_way_sync_headline))
|
|
|
+ supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
|
|
|
|
|
addMenuProvider(
|
|
|
object : MenuProvider {
|
|
@@ -77,6 +76,7 @@ class InternalTwoWaySyncActivity : DrawerActivity(), Injectable {
|
|
|
onBackPressed()
|
|
|
true
|
|
|
}
|
|
|
+
|
|
|
else -> false
|
|
|
}
|
|
|
}
|