Skip to content

Commit

Permalink
Merge branch 'master' into feature/use-m3-SetupEncryptionDialogFragment
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <[email protected]>
  • Loading branch information
AndyScherzinger authored Oct 30, 2023
2 parents 5679eea + 0925b6f commit d8837bc
Show file tree
Hide file tree
Showing 83 changed files with 1,183 additions and 1,797 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ on:
permissions:
contents: read

concurrency:
group: code-ql-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand All @@ -36,7 +32,7 @@ jobs:
with:
swap-size-gb: 10
- name: Initialize CodeQL
uses: github/codeql-action/init@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
languages: ${{ matrix.language }}
- name: Set up JDK 17
Expand All @@ -50,4 +46,4 @@ jobs:
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
./gradlew assembleDebug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
sarif_file: results.sarif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.ErrorMessageAdapter;
import com.owncloud.android.utils.PermissionUtil;
import com.owncloud.android.utils.WebViewUtil;
import com.owncloud.android.utils.theme.CapabilityUtils;
import com.owncloud.android.utils.theme.ViewThemeUtils;

Expand Down Expand Up @@ -268,6 +269,7 @@ protected void onCreate(Bundle savedInstanceState) {
viewThemeUtils = viewThemeUtilsFactory.withPrimaryAsBackground();
viewThemeUtils.platform.themeStatusBar(this, ColorRole.PRIMARY);

WebViewUtil webViewUtil = new WebViewUtil(this);

Uri data = getIntent().getData();
boolean directLogin = data != null && data.toString().startsWith(getString(R.string.login_data_own_scheme));
Expand Down Expand Up @@ -337,6 +339,8 @@ protected void onCreate(Bundle savedInstanceState) {
}

initServerPreFragment(savedInstanceState);

webViewUtil.checkWebViewVersion();
}

private void deleteCookies() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,10 @@ public void onClick(DialogInterface dialog, int which) {

private void checkOutdatedServer() {
Optional<User> user = getUser();
OwnCloudVersion serverVersion = user.get().getServer().getVersion();

// show outdated warning
if (user.isPresent() &&
CapabilityUtils.checkOutdatedWarning(getResources(),
serverVersion,
user.get().getServer().getVersion(),
getCapabilities().getExtendedSupport().isTrue())) {
DisplayUtils.showServerOutdatedSnackbar(this, Snackbar.LENGTH_LONG);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ open class FolderPickerActivity :
}
}

override fun onSortingOrderChosen(selection: FileSortOrder) {
listOfFilesFragment!!.sortFiles(selection)
override fun onSortingOrderChosen(selection: FileSortOrder?) {
listOfFilesFragment?.sortFiles(selection)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,11 @@ class SyncedFoldersActivity :
}
}

override fun onSaveSyncedFolderPreference(syncedFolder: SyncedFolderParcelable) {
override fun onSaveSyncedFolderPreference(syncedFolder: SyncedFolderParcelable?) {
if (syncedFolder == null) {
return
}

// custom folders newly created aren't in the list already,
// so triggering a refresh
if (MediaFolderType.CUSTOM == syncedFolder.type && syncedFolder.id == SyncedFolder.UNPERSISTED_ID) {
Expand Down Expand Up @@ -730,7 +734,11 @@ class SyncedFoldersActivity :
syncedFolderPreferencesDialogFragment = null
}

override fun onDeleteSyncedFolderPreference(syncedFolder: SyncedFolderParcelable) {
override fun onDeleteSyncedFolderPreference(syncedFolder: SyncedFolderParcelable?) {
if (syncedFolder == null) {
return
}

syncedFolderProvider.deleteSyncedFolder(syncedFolder.id)
adapter.removeItem(syncedFolder.section)
}
Expand Down

This file was deleted.

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)
}
}
}
}
Loading

0 comments on commit d8837bc

Please sign in to comment.