Skip to content

Commit

Permalink
refactor: remove unused private members
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Dec 11, 2024
1 parent f0076ff commit ff60f03
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import com.google.android.material.textfield.TextInputLayout
import com.owncloud.android.R
import com.owncloud.android.domain.files.model.OCFile
import com.owncloud.android.extensions.avoidScreenshotsIfNeeded
import com.owncloud.android.extensions.showMessageInSnackbar
import com.owncloud.android.presentation.files.operations.FileOperation
import com.owncloud.android.presentation.files.operations.FileOperationsViewModel
import com.owncloud.android.utils.PreferenceUtils
Expand Down Expand Up @@ -141,17 +140,6 @@ class RenameFileDialogFragment : DialogFragment(), DialogInterface.OnClickListen
}
}

/**
* Show a temporary message in a Snackbar bound to the content view of the parent Activity
*
* @param messageResource Message to show.
*/
private fun showSnackMessage(messageResource: Int) {
showMessageInSnackbar(
message = getString(messageResource)
)
}

companion object {
const val FRAGMENT_TAG_RENAME_FILE = "RENAME_FILE_FRAGMENT"
private const val ARG_TARGET_FILE = "TARGET_FILE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ class UsersAndGroupsSearchProvider : ContentProvider() {
ShareType.FEDERATED -> {
if (federatedShareAllowed) {
icon = R.drawable.ic_user
displayName = if (userName == shareWith) { context?.getString(R.string.share_remote_clarification, userName) }
else {
displayName = if (userName == shareWith) { context?.getString(R.string.share_remote_clarification, userName)
} else {
val uriSplitted = shareWith.split("@".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
context?.getString(R.string.share_known_remote_clarification, userName, uriSplitted[uriSplitted.size - 1])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ import com.owncloud.android.presentation.authentication.EXTRA_ACCOUNT
import com.owncloud.android.presentation.authentication.EXTRA_ACTION
import com.owncloud.android.presentation.authentication.LoginActivity
import com.owncloud.android.presentation.transfers.TransferOperation.Download
import com.owncloud.android.ui.activity.FileActivity
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.ui.errorhandling.ErrorMessageAdapter
import com.owncloud.android.ui.preview.PreviewImageActivity
import com.owncloud.android.ui.preview.PreviewImageFragment.Companion.canBePreviewed
import com.owncloud.android.utils.DOWNLOAD_NOTIFICATION_CHANNEL_ID
import com.owncloud.android.utils.DOWNLOAD_NOTIFICATION_ID_DEFAULT
import com.owncloud.android.utils.FileStorageUtils
Expand Down Expand Up @@ -309,27 +305,6 @@ class DownloadFileWorker(
)
}

private fun composePendingIntentToPreviewFile(): PendingIntent {
/// includes a pending intent in the notification showing the details view of the file
val showDetailsIntent: Intent =
if (canBePreviewed(ocFile)) {
Intent(appContext, PreviewImageActivity::class.java)
} else {
Intent(appContext, FileDisplayActivity::class.java)
}.apply {
putExtra(FileActivity.EXTRA_FILE, ocFile)
putExtra(FileActivity.EXTRA_ACCOUNT, account)
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
}

return PendingIntent.getActivity(
appContext,
System.currentTimeMillis().toInt(),
showDetailsIntent,
PendingIntent.FLAG_IMMUTABLE
)
}

private fun getClientForThisDownload(): OwnCloudClient = SingleSessionManager.getDefaultSingleton()
.getClientFor(OwnCloudAccount(AccountUtils.getOwnCloudAccountByName(appContext, account.name), appContext), appContext)

Expand Down

0 comments on commit ff60f03

Please sign in to comment.