diff --git a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/FileListAdapter.kt b/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/FileListAdapter.kt deleted file mode 100644 index 0af5cc55e..000000000 --- a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/FileListAdapter.kt +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2019 Kiwix - * 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 . - * - */ -@file:Suppress("PackageNaming") - -package org.kiwix.kiwixmobile.localFileTransfer - -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.core.view.isVisible -import androidx.recyclerview.widget.RecyclerView -import org.kiwix.kiwixmobile.R -import org.kiwix.kiwixmobile.core.base.adapter.BaseViewHolder -import org.kiwix.kiwixmobile.databinding.ItemTransferListBinding -import org.kiwix.kiwixmobile.localFileTransfer.FileItem.FileStatus.ERROR -import org.kiwix.kiwixmobile.localFileTransfer.FileItem.FileStatus.SENDING -import org.kiwix.kiwixmobile.localFileTransfer.FileItem.FileStatus.SENT -import org.kiwix.kiwixmobile.localFileTransfer.FileListAdapter.FileViewHolder - -/** - * Helper class, part of the local file sharing module. - * - * Defines the Adapter for the list of file-items displayed in {TransferProgressFragment} - */ -class FileListAdapter(private val fileItems: List) : - RecyclerView.Adapter() { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FileViewHolder = - FileViewHolder( - ItemTransferListBinding.inflate( - LayoutInflater.from(parent.context), - parent, - false - ), - this - ) - - override fun onBindViewHolder(holder: FileViewHolder, position: Int) { - holder.bind(fileItems[position]) - } - - override fun getItemCount(): Int = fileItems.size - - inner class FileViewHolder( - private val itemTransferListBinding: ItemTransferListBinding, - val fileListAdapter: FileListAdapter - ) : - BaseViewHolder(itemTransferListBinding.root) { - override fun bind(item: FileItem) { - itemTransferListBinding.textViewFileItemName.text = item.fileName - itemTransferListBinding.imageViewFileTransferred.isVisible = item.fileStatus != SENDING - itemTransferListBinding.progressBarTransferringFile.isVisible = item.fileStatus == SENDING - if (item.fileStatus != FileItem.FileStatus.TO_BE_SENT) { - // Icon for TO_BE_SENT is assigned by default in the item layout - itemTransferListBinding.progressBarTransferringFile.visibility = View.GONE - when (item.fileStatus) { - SENDING -> itemTransferListBinding.progressBarTransferringFile.visibility = View.VISIBLE - SENT -> { - itemTransferListBinding.imageViewFileTransferred.setImageResource( - R.drawable.ic_baseline_check_24px - ) - itemTransferListBinding.progressBarTransferringFile.visibility = View.GONE - } - ERROR -> { - itemTransferListBinding.imageViewFileTransferred.setImageResource( - R.drawable.ic_baseline_error_24px - ) - itemTransferListBinding.progressBarTransferringFile.visibility = View.GONE - } - else -> { - } - } - } - } - } -} diff --git a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiP2pDelegate.kt b/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiP2pDelegate.kt deleted file mode 100644 index c62ab35ff..000000000 --- a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiP2pDelegate.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2020 Kiwix - * 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 . - * - */ - -package org.kiwix.kiwixmobile.localFileTransfer.adapter - -import android.net.wifi.p2p.WifiP2pDevice -import android.view.ViewGroup -import androidx.recyclerview.widget.RecyclerView.ViewHolder -import org.kiwix.kiwixmobile.core.base.adapter.AdapterDelegate -import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.viewBinding -import org.kiwix.kiwixmobile.databinding.RowPeerDeviceBinding - -class WifiP2pDelegate(private val onItemClickAction: (WifiP2pDevice) -> Unit) : - AdapterDelegate { - override fun createViewHolder(parent: ViewGroup): ViewHolder = - WifiP2pViewHolder( - parent.viewBinding(RowPeerDeviceBinding::inflate, false), - onItemClickAction - ) - - override fun bind(viewHolder: ViewHolder, itemToBind: WifiP2pDevice) { - (viewHolder as WifiP2pViewHolder).bind(itemToBind) - } - - override fun isFor(item: WifiP2pDevice) = true -} diff --git a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiP2pViewHolder.kt b/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiP2pViewHolder.kt deleted file mode 100644 index 585a5a530..000000000 --- a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiP2pViewHolder.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2020 Kiwix - * 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 . - * - */ - -package org.kiwix.kiwixmobile.localFileTransfer.adapter - -import android.net.wifi.p2p.WifiP2pDevice -import org.kiwix.kiwixmobile.core.base.adapter.BaseViewHolder -import org.kiwix.kiwixmobile.databinding.RowPeerDeviceBinding - -class WifiP2pViewHolder( - private val rowPeerDeviceBinding: RowPeerDeviceBinding, - private val onItemClickAction: (WifiP2pDevice) -> Unit -) : BaseViewHolder(rowPeerDeviceBinding.root) { - override fun bind(item: WifiP2pDevice) { - rowPeerDeviceBinding.rowDeviceName.text = item.deviceName - containerView.setOnClickListener { - onItemClickAction.invoke(item) - } - } -} diff --git a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiPeerListAdapter.kt b/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiPeerListAdapter.kt deleted file mode 100644 index 8b73a061d..000000000 --- a/app/src/main/java/org/kiwix/kiwixmobile/localFileTransfer/adapter/WifiPeerListAdapter.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Kiwix Android - * Copyright (c) 2020 Kiwix - * 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 . - * - */ -package org.kiwix.kiwixmobile.localFileTransfer.adapter - -import android.net.wifi.p2p.WifiP2pDevice -import org.kiwix.kiwixmobile.core.base.adapter.BaseDelegateAdapter - -internal class WifiPeerListAdapter(wifiP2pDelegate: WifiP2pDelegate) : - BaseDelegateAdapter(wifiP2pDelegate) { - override fun getIdFor(item: WifiP2pDevice) = item.deviceAddress.hashCode().toLong() -} diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt index 9047c65cb..1481e7412 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt @@ -184,7 +184,8 @@ class OnlineLibraryFragment : BaseFragment(), FragmentActivityExtensions { ): View? { fragmentDestinationDownloadBinding = FragmentDestinationDownloadBinding.inflate(inflater, container, false) - val toolbar = fragmentDestinationDownloadBinding?.root?.findViewById(R.id.toolbar) + val toolbar = + fragmentDestinationDownloadBinding?.root?.findViewById(org.kiwix.kiwixmobile.core.R.id.toolbar) val activity = activity as CoreMainActivity activity.setSupportActionBar(toolbar) activity.supportActionBar?.apply { diff --git a/app/src/main/res/layout/fragment_local_file_transfer.xml b/app/src/main/res/layout/fragment_local_file_transfer.xml deleted file mode 100644 index 7d9baf636..000000000 --- a/app/src/main/res/layout/fragment_local_file_transfer.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/item_language.xml b/app/src/main/res/layout/item_language.xml deleted file mode 100644 index 3c21de6ca..000000000 --- a/app/src/main/res/layout/item_language.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/item_transfer_list.xml b/app/src/main/res/layout/item_transfer_list.xml deleted file mode 100644 index 96ad62bab..000000000 --- a/app/src/main/res/layout/item_transfer_list.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/layout/row_peer_device.xml b/app/src/main/res/layout/row_peer_device.xml deleted file mode 100644 index d2ad6dd87..000000000 --- a/app/src/main/res/layout/row_peer_device.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -