Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
Tobias Kaminsky 2023-06-02 02:31:15 +02:00
commit f11a81753a
12 changed files with 54 additions and 14 deletions

View file

@ -19,21 +19,21 @@ jobs:
run: |
if [ -z "$GITHUB_HEAD_REF" ]; then
# push
echo "::set-output name=branch::$GITHUB_REF_NAME"
echo "::set-output name=pr::$GITHUB_RUN_ID"
echo "::set-output name=repo::${{ github.repository }}"
echo "branch=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
echo "pr=$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT"
echo "repo=${{ github.repository }}" >> "$GITHUB_OUTPUT"
else
# pull request
echo "::set-output name=branch::$GITHUB_HEAD_REF"
echo "::set-output name=pr::${{ github.event.pull_request.number }}"
echo "::set-output name=repo::${{ github.event.pull_request.head.repo.full_name }}"
echo "branch=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT"
echo "pr=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "repo=${{ github.event.pull_request.head.repo.full_name }}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
repository: ${{ steps.get-vars.outputs.repo }}
ref: ${{ steps.get-vars.outputs.branch }}
- name: Set up JDK 11
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: "temurin"
java-version: 11

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -42,13 +42,35 @@ class GroupfolderListFragmentIT : AbstractIT() {
activity = testActivityRule.launchActivity(null)
}
@Test
@ScreenshotTest
fun showGroupfolder() {
val sut = GroupfolderListFragment()
activity.addFragment(sut)
shortSleep() // to let async task finish
activity.runOnUiThread {
sut.setAdapter(null)
sut.setData(
mapOf(
Pair("2", Groupfolder(2, "/subfolder/group"))
)
)
}
waitForIdleSync()
shortSleep()
screenshot(activity)
}
@Test
@ScreenshotTest
fun showGroupfolders() {
val sut = GroupfolderListFragment()
activity.addFragment(sut)
waitForIdleSync()
shortSleep() // to let async task finish
activity.runOnUiThread {
sut.setAdapter(null)

View file

@ -35,6 +35,7 @@ import android.widget.Toast
import androidx.annotation.IdRes
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.os.bundleOf
import androidx.core.view.isEmpty
import androidx.core.view.isVisible
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.setFragmentResult
@ -199,9 +200,11 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
private fun displayActions(
actions: List<FileAction>
) {
actions.forEach { action ->
val view = inflateActionView(action)
binding.fileActionsList.addView(view)
if (binding.fileActionsList.isEmpty()) {
actions.forEach { action ->
val view = inflateActionView(action)
binding.fileActionsList.addView(view)
}
}
}

View file

@ -26,7 +26,7 @@ import android.content.Intent.ACTION_VIEW
import android.os.Bundle
import android.os.Handler
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.nextcloud.android.lib.resources.groupfolders.Groupfolder
import com.nextcloud.client.di.Injectable
import com.nextcloud.client.logger.Logger
@ -35,6 +35,7 @@ import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation
import com.owncloud.android.lib.resources.files.model.RemoteFile
import com.owncloud.android.ui.EmptyRecyclerView
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.ui.adapter.GroupfolderListAdapter
import com.owncloud.android.ui.asynctasks.GroupfoldersSearchTask
@ -65,6 +66,7 @@ class GroupfolderListFragment : OCFileListFragment(), Injectable, GroupfolderLis
searchFragment = true
}
@Deprecated("Deprecated in Java")
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
@ -79,8 +81,9 @@ class GroupfolderListFragment : OCFileListFragment(), Injectable, GroupfolderLis
adapter = GroupfolderListAdapter(requireContext(), viewThemeUtils, this)
setRecyclerViewAdapter(adapter)
val layoutManager = GridLayoutManager(context, 1)
val layoutManager = LinearLayoutManager(context)
recyclerView.layoutManager = layoutManager
(recyclerView as EmptyRecyclerView).setHasFooter(false)
}
private fun search() {
@ -104,6 +107,12 @@ class GroupfolderListFragment : OCFileListFragment(), Injectable, GroupfolderLis
}
}
override fun onRefresh() {
super.onRefresh()
search()
}
@SuppressLint("NotifyDataSetChanged")
fun setData(result: Map<String, Groupfolder>) {
adapter.setData(result)

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">Bezpečnostní kód odstraněn</string>
<string name="pass_code_stored">Bezpečnostní kód uložen</string>
<string name="pass_code_wrong">Nesprávný bezpečnostní kód</string>
<string name="pdf_password_protected">Nedaří se otevřít heslem chráněné PDF. Použijte externí prohlížeč PDF.</string>
<string name="pdf_zoom_tip">Pokud chcete stránku zvětšit, klepněte na ni</string>
<string name="permission_allow">Povolit</string>
<string name="permission_deny">Odepřít</string>

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">PIN gelöscht</string>
<string name="pass_code_stored">PIN gespeichert</string>
<string name="pass_code_wrong">PIN nicht korrekt</string>
<string name="pdf_password_protected">Passwortgeschützte PDF-Datei konnte nicht geöffnet werden. Bitte verwenden Sie einen externen PDF-Viewer.</string>
<string name="pdf_zoom_tip">Auf eine Seite klicken um hereinzuzoomen</string>
<string name="permission_allow">Zulassen</string>
<string name="permission_deny">Ablehnen</string>

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">Código de acceso borrado</string>
<string name="pass_code_stored">Código de acceso almacenado</string>
<string name="pass_code_wrong">Código de acceso incorrecto</string>
<string name="pdf_password_protected">No es posible abrir archivos PDF protegidos por contraseñas. Por favor, usa un visor PDF externo.</string>
<string name="pdf_zoom_tip">Toca sobre una página para hacer zoom</string>
<string name="permission_allow">Permitir</string>
<string name="permission_deny">Denegar</string>

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">Кôд обрисан</string>
<string name="pass_code_stored">Код је сачуван</string>
<string name="pass_code_wrong">Неисправан код</string>
<string name="pdf_password_protected">Не може да се отвори PDF заштићен лозинком. Молимо вас да употребите спољни PDF приказивач.</string>
<string name="pdf_zoom_tip">Тапните на страницу да је зумирате</string>
<string name="permission_allow">Дозволи</string>
<string name="permission_deny">Одбиј</string>

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">Lösenord raderat</string>
<string name="pass_code_stored">Kod sparad</string>
<string name="pass_code_wrong">Ogiltigt lösenord</string>
<string name="pdf_password_protected">Kan inte öppna lösenordsskyddad PDF. Använd en extern PDF-läsare.</string>
<string name="pdf_zoom_tip">Tryck på sidan för zoomning</string>
<string name="permission_allow">Tillåt</string>
<string name="permission_deny">Neka</string>

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">通行碼已刪除</string>
<string name="pass_code_stored">通行碼已儲存</string>
<string name="pass_code_wrong">通行碼錯誤</string>
<string name="pdf_password_protected">無法開啟密碼保護的 PDF。請使用外部 PDF 檢視程式。</string>
<string name="pdf_zoom_tip">點擊頁面以放大</string>
<string name="permission_allow">允許</string>
<string name="permission_deny"></string>