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: | run: |
if [ -z "$GITHUB_HEAD_REF" ]; then if [ -z "$GITHUB_HEAD_REF" ]; then
# push # push
echo "::set-output name=branch::$GITHUB_REF_NAME" echo "branch=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
echo "::set-output name=pr::$GITHUB_RUN_ID" echo "pr=$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT"
echo "::set-output name=repo::${{ github.repository }}" echo "repo=${{ github.repository }}" >> "$GITHUB_OUTPUT"
else else
# pull request # pull request
echo "::set-output name=branch::$GITHUB_HEAD_REF" echo "branch=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT"
echo "::set-output name=pr::${{ github.event.pull_request.number }}" echo "pr=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "::set-output name=repo::${{ github.event.pull_request.head.repo.full_name }}" echo "repo=${{ github.event.pull_request.head.repo.full_name }}" >> "$GITHUB_OUTPUT"
fi fi
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
repository: ${{ steps.get-vars.outputs.repo }} repository: ${{ steps.get-vars.outputs.repo }}
ref: ${{ steps.get-vars.outputs.branch }} ref: ${{ steps.get-vars.outputs.branch }}
- name: Set up JDK 11 - name: Set up JDK 11
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3 uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with: with:
distribution: "temurin" distribution: "temurin"
java-version: 11 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) 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 @Test
@ScreenshotTest @ScreenshotTest
fun showGroupfolders() { fun showGroupfolders() {
val sut = GroupfolderListFragment() val sut = GroupfolderListFragment()
activity.addFragment(sut) activity.addFragment(sut)
waitForIdleSync() shortSleep() // to let async task finish
activity.runOnUiThread { activity.runOnUiThread {
sut.setAdapter(null) sut.setAdapter(null)

View file

@ -35,6 +35,7 @@ import android.widget.Toast
import androidx.annotation.IdRes import androidx.annotation.IdRes
import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.content.res.AppCompatResources
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.core.view.isEmpty
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.fragment.app.setFragmentResult import androidx.fragment.app.setFragmentResult
@ -199,9 +200,11 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
private fun displayActions( private fun displayActions(
actions: List<FileAction> actions: List<FileAction>
) { ) {
actions.forEach { action -> if (binding.fileActionsList.isEmpty()) {
val view = inflateActionView(action) actions.forEach { action ->
binding.fileActionsList.addView(view) 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.Bundle
import android.os.Handler import android.os.Handler
import androidx.lifecycle.lifecycleScope 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.android.lib.resources.groupfolders.Groupfolder
import com.nextcloud.client.di.Injectable import com.nextcloud.client.di.Injectable
import com.nextcloud.client.logger.Logger 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.datamodel.OCFile
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation
import com.owncloud.android.lib.resources.files.model.RemoteFile 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.activity.FileDisplayActivity
import com.owncloud.android.ui.adapter.GroupfolderListAdapter import com.owncloud.android.ui.adapter.GroupfolderListAdapter
import com.owncloud.android.ui.asynctasks.GroupfoldersSearchTask import com.owncloud.android.ui.asynctasks.GroupfoldersSearchTask
@ -65,6 +66,7 @@ class GroupfolderListFragment : OCFileListFragment(), Injectable, GroupfolderLis
searchFragment = true searchFragment = true
} }
@Deprecated("Deprecated in Java")
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
@ -79,8 +81,9 @@ class GroupfolderListFragment : OCFileListFragment(), Injectable, GroupfolderLis
adapter = GroupfolderListAdapter(requireContext(), viewThemeUtils, this) adapter = GroupfolderListAdapter(requireContext(), viewThemeUtils, this)
setRecyclerViewAdapter(adapter) setRecyclerViewAdapter(adapter)
val layoutManager = GridLayoutManager(context, 1) val layoutManager = LinearLayoutManager(context)
recyclerView.layoutManager = layoutManager recyclerView.layoutManager = layoutManager
(recyclerView as EmptyRecyclerView).setHasFooter(false)
} }
private fun search() { private fun search() {
@ -104,6 +107,12 @@ class GroupfolderListFragment : OCFileListFragment(), Injectable, GroupfolderLis
} }
} }
override fun onRefresh() {
super.onRefresh()
search()
}
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
fun setData(result: Map<String, Groupfolder>) { fun setData(result: Map<String, Groupfolder>) {
adapter.setData(result) 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_removed">Bezpečnostní kód odstraněn</string>
<string name="pass_code_stored">Bezpečnostní kód uložen</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="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="pdf_zoom_tip">Pokud chcete stránku zvětšit, klepněte na ni</string>
<string name="permission_allow">Povolit</string> <string name="permission_allow">Povolit</string>
<string name="permission_deny">Odepřít</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_removed">PIN gelöscht</string>
<string name="pass_code_stored">PIN gespeichert</string> <string name="pass_code_stored">PIN gespeichert</string>
<string name="pass_code_wrong">PIN nicht korrekt</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="pdf_zoom_tip">Auf eine Seite klicken um hereinzuzoomen</string>
<string name="permission_allow">Zulassen</string> <string name="permission_allow">Zulassen</string>
<string name="permission_deny">Ablehnen</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_removed">Código de acceso borrado</string>
<string name="pass_code_stored">Código de acceso almacenado</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="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="pdf_zoom_tip">Toca sobre una página para hacer zoom</string>
<string name="permission_allow">Permitir</string> <string name="permission_allow">Permitir</string>
<string name="permission_deny">Denegar</string> <string name="permission_deny">Denegar</string>

View file

@ -524,6 +524,7 @@
<string name="pass_code_removed">Кôд обрисан</string> <string name="pass_code_removed">Кôд обрисан</string>
<string name="pass_code_stored">Код је сачуван</string> <string name="pass_code_stored">Код је сачуван</string>
<string name="pass_code_wrong">Неисправан код</string> <string name="pass_code_wrong">Неисправан код</string>
<string name="pdf_password_protected">Не може да се отвори PDF заштићен лозинком. Молимо вас да употребите спољни PDF приказивач.</string>
<string name="pdf_zoom_tip">Тапните на страницу да је зумирате</string> <string name="pdf_zoom_tip">Тапните на страницу да је зумирате</string>
<string name="permission_allow">Дозволи</string> <string name="permission_allow">Дозволи</string>
<string name="permission_deny">Одбиј</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_removed">Lösenord raderat</string>
<string name="pass_code_stored">Kod sparad</string> <string name="pass_code_stored">Kod sparad</string>
<string name="pass_code_wrong">Ogiltigt lösenord</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="pdf_zoom_tip">Tryck på sidan för zoomning</string>
<string name="permission_allow">Tillåt</string> <string name="permission_allow">Tillåt</string>
<string name="permission_deny">Neka</string> <string name="permission_deny">Neka</string>

View file

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