-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/use-m3-SetupEncryptionDialogFragment
Signed-off-by: Andy Scherzinger <[email protected]>
- Loading branch information
Showing
83 changed files
with
1,183 additions
and
1,797 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
Binary file modified
BIN
+1.37 KB
(100%)
...y/debug/com.nextcloud.client.SyncedFoldersActivityIT_testSyncedFolderDialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
89 changes: 0 additions & 89 deletions
89
app/src/main/java/com/owncloud/android/ui/adapter/StoragePathAdapter.java
This file was deleted.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
app/src/main/java/com/owncloud/android/ui/adapter/StoragePathAdapter.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,80 @@ | ||
/* | ||
* Nextcloud Android client application | ||
* | ||
* @author Andy Scherzinger | ||
* Copyright (C) 2019 Andy Scherzinger | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or 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 AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.owncloud.android.ui.adapter | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.owncloud.android.databinding.StoragePathItemBinding | ||
import com.owncloud.android.ui.adapter.StoragePathAdapter.StoragePathViewHolder | ||
import com.owncloud.android.utils.theme.ViewThemeUtils | ||
|
||
class StoragePathAdapter( | ||
private val pathList: List<StoragePathItem>?, | ||
private val storagePathAdapterListener: StoragePathAdapterListener, | ||
private val viewThemeUtils: ViewThemeUtils | ||
) : RecyclerView.Adapter<StoragePathViewHolder>() { | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StoragePathViewHolder { | ||
return StoragePathViewHolder( | ||
StoragePathItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) | ||
) | ||
} | ||
|
||
override fun onBindViewHolder(holder: StoragePathViewHolder, position: Int) { | ||
if (pathList != null && pathList.size > position) { | ||
val storagePathItem = pathList[position] | ||
holder.binding.btnStoragePath.setIconResource(storagePathItem.icon) | ||
holder.binding.btnStoragePath.text = storagePathItem.name | ||
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(holder.binding.btnStoragePath) | ||
} | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return pathList?.size ?: 0 | ||
} | ||
|
||
interface StoragePathAdapterListener { | ||
/** | ||
* sets the chosen path. | ||
* | ||
* @param path chosen path | ||
*/ | ||
fun chosenPath(path: String) | ||
} | ||
|
||
inner class StoragePathViewHolder(var binding: StoragePathItemBinding) : | ||
RecyclerView.ViewHolder( | ||
binding.root | ||
), | ||
View.OnClickListener { | ||
init { | ||
binding.root.setOnClickListener(this) | ||
} | ||
|
||
override fun onClick(view: View) { | ||
val path = pathList?.get(absoluteAdapterPosition)?.path | ||
path?.let { | ||
storagePathAdapterListener.chosenPath(it) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.