Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ Android client for [Django Files Upload Server](https://github.com/django-files/

ALWAYS use the `task *` commands

| Command | Purpose |
| -------------- | --------------------------------------------------- |
| `task compile` | Compile Kotlin |
| `task debug` | Build debug variant (APK) |
| `task release` | Build release variant (APK) |
| `task bundle` | Build Android App Bundle (AAB) |
| `task lint` | Prettier check + yamllint + actionlint + shellcheck |
| `task format` | Prettier write (format non-kotlin files) |
| Command | Purpose |
| -------------- | ---------------------------------------- |
| `task lint` | Gradle Lint |
| `task compile` | Compile Kotlin |
| `task debug` | Build debug variant (APK) |
| `task release` | Build release variant (APK) |
| `task bundle` | Build Android App Bundle (AAB) |
| `task check` | Prettier check (check non-kotlin files) |
| `task format` | Prettier write (format non-kotlin files) |

Do NOT use `-q` or pipe Gradle output through `Select-Object` — both hide progress and make long builds look hung.

Expand Down
13 changes: 9 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ vars:
GRADLEW: 'gradlew{{if eq OS "windows"}}.bat{{end}}'

tasks:
lint:
desc: Lint
check:
desc: Check Non-Kotlin Files
aliases: [prettier:check]
cmds:
- prettier --check .
- yamllint -c .github/yamllint.yaml .
- actionlint -shellcheck="-e SC2129"
- shellcheck .github/scripts/prepare.sh

format:
desc: Format
desc: Format Non-Kotlin Files
aliases: [prettier, prettier:write]
cmds:
- prettier --write .

lint:
desc: Gradle Lint
cmd: "{{.GRADLEW}} lint {{.CLI_ARGS}}"

compile:
desc: Compile Kotlin
cmd: "{{.GRADLEW}} :app:compileDebugKotlin"
cmd: "{{.GRADLEW}} :app:compileDebugKotlin {{.CLI_ARGS}}"

debug:
desc: Build Debug (recommended android studio)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class FilesBottomSheet : BottomSheetDialogFragment() {
dialog.setOnShowListener {
dialog.window?.let { window ->
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
window.setNavigationBarContrastEnforced(false)
window.isNavigationBarContrastEnforced = false
}
WindowCompat.setDecorFitsSystemWindows(window, false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@ class FilesFragment : Fragment() {
fun updateCheckButton() {
val selectedSize = viewModel.selected.value?.size ?: 0
val filesSize = viewModel.filesData.value?.size ?: 0
binding.filesTotalText.text = resources.getQuantityString(R.plurals.files_total, filesSize, filesSize)
binding.filesTotalText.text =
resources.getQuantityString(R.plurals.files_total, filesSize, filesSize)
binding.filesSelectedText.text =
resources.getQuantityString(R.plurals.files_selected_total, selectedSize, selectedSize, filesSize)
binding.filesSelectedText.text =
resources.getQuantityString(R.plurals.files_selected_total, filesSize, selectedSize, filesSize)
resources.getQuantityString(
R.plurals.files_selected_total,
filesSize,
selectedSize,
filesSize
)
if (selectedSize == filesSize) {
//Log.i("filesData[updateCheckButton]", "ALL SELECTED")
binding.filesSelectAll.setImageResource(R.drawable.md_check_box_24px)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class HomeFragment : Fragment() {
// insets
//}
ViewCompat.setOnApplyWindowInsetsListener(view) { view, windowInsets ->
val types = WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()
val types =
WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()
val insets = windowInsets.getInsets(types)
view.updatePadding(top = insets.top)
WindowInsetsCompat.Builder(windowInsets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class UploadMultiFragment : Fragment() {
Log.i("Multi[onViewCreated]", "INITIALIZE NEW ADAPTER")
adapter = UploadMultiAdapter(fileUris, selectedUris.toMutableSet()) { updated ->
viewModel.selectedUris.value = updated
binding.uploadButton.text = getString(R.string.upload_multi, updated.size)
binding.uploadButton.text =
resources.getQuantityString(R.plurals.upload_multi, updated.size, updated.size)
}
}

Expand Down Expand Up @@ -179,7 +180,11 @@ class UploadMultiFragment : Fragment() {
val editRequest = FileEditRequest()

// Upload Button
binding.uploadButton.text = getString(R.string.upload_multi, selectedUris.size)
binding.uploadButton.text = resources.getQuantityString(
R.plurals.upload_multi,
selectedUris.size,
selectedUris.size
)
binding.uploadButton.setOnClickListener {
val selectedUris = viewModel.getSelectedUris()
//Log.d("uploadButton", "selectedUris: $selectedUris")
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/res/layout/fragment_short.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,26 @@
app:icon="@drawable/md_share_24px"
app:iconSize="24dp"
app:iconGravity="textStart"
app:iconPadding="0dp" />
app:iconPadding="0dp"
style="@style/Widget.Material3.Button" />
<Button
android:id="@+id/open_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon="@drawable/md_open_in_new_24px"
app:iconSize="24dp"
app:iconGravity="textStart"
app:iconPadding="0dp" />
app:iconPadding="0dp"
style="@style/Widget.Material3.Button" />
<Button
android:id="@+id/options_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon="@drawable/md_settings_24px"
app:iconSize="24dp"
app:iconGravity="textStart"
app:iconPadding="0dp" />
app:iconPadding="0dp"
style="@style/Widget.Material3.Button" />
</androidx.constraintlayout.widget.ConstraintLayout>

<Button
Expand All @@ -118,7 +121,8 @@
app:icon="@drawable/md_link_24px"
app:iconGravity="end"
app:iconPadding="-28dp"
app:iconSize="28dp" />
app:iconSize="28dp"
style="@style/Widget.Material3.Button" />
</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
7 changes: 5 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<string name="app_name">Django Files</string>
<string name="version_string">v%s</string>
<string name="version_code_string">%1$s (%2$s)</string>
Expand All @@ -20,7 +20,10 @@
<string name="file_list">File List</string>
<string name="app_settings">App Settings</string>

<string name="upload_multi" tools:ignore="PluralsCandidate">Upload %1$d Files</string>
<plurals name="upload_multi">
<item quantity="one">Upload %d File</item>
<item quantity="other">Upload %d Files</item>
</plurals>
<plurals name="files_total">
<item quantity="one">%1$d File</item>
<item quantity="other">%1$d Files</item>
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ moshiKotlinCodegen = "1.15.2"
glide = "5.0.9"

googleServices = "4.5.0"
firebaseBom = "34.17.0"
crashlyticsPlugin = "3.0.7"
firebaseBom = "34.18.0"
crashlyticsPlugin = "3.0.8"

# navigationSafeargsVersion = "2.8.9"
# roomRuntime = "2.6.1"
Expand Down
Loading