-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new fragment for spaces list and empty view
- Loading branch information
Showing
13 changed files
with
246 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
owncloudApp/src/main/java/com/owncloud/android/presentation/spaces/SpacesListFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* ownCloud Android client application | ||
* | ||
* @author Juan Carlos Garrote Gascón | ||
* | ||
* Copyright (C) 2022 ownCloud GmbH. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* 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/>. | ||
*/ | ||
|
||
package com.owncloud.android.presentation.spaces | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.core.view.isVisible | ||
import androidx.fragment.app.Fragment | ||
import com.owncloud.android.databinding.SpacesListFragmentBinding | ||
import com.owncloud.android.domain.files.model.FileListOption | ||
import com.owncloud.android.extensions.toDrawableRes | ||
import com.owncloud.android.extensions.toSubtitleStringRes | ||
import com.owncloud.android.extensions.toTitleStringRes | ||
|
||
class SpacesListFragment : Fragment() { | ||
private var _binding: SpacesListFragmentBinding? = null | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
_binding = SpacesListFragmentBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
showOrHideEmptyView() | ||
} | ||
|
||
// TODO: Use this method only when necessary, for the moment the empty view is shown always | ||
private fun showOrHideEmptyView() { | ||
binding.recyclerSpacesList.isVisible = false | ||
|
||
with(binding.emptyDataParent) { | ||
root.isVisible = true | ||
listEmptyDatasetIcon.setImageResource(FileListOption.SPACES_LIST.toDrawableRes()) | ||
listEmptyDatasetTitle.setText(FileListOption.SPACES_LIST.toTitleStringRes()) | ||
listEmptyDatasetSubTitle.setText(FileListOption.SPACES_LIST.toSubtitleStringRes()) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="48dp" | ||
android:height="48dp" | ||
android:viewportWidth="48" | ||
android:viewportHeight="48"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M6,22.5L6,6h16.5v16.5ZM6,42L6,25.5h16.5L22.5,42ZM25.5,22.5L25.5,6L42,6v16.5ZM25.5,42L25.5,25.5L42,25.5L42,42Z"/> | ||
</vector> |
Oops, something went wrong.