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
1 change: 1 addition & 0 deletions .github/workflows/screenshot_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
run_id: ${{ github.event.workflow_run.id }}
name: screenshot-diff
path: screenshot-diff
if_no_artifact_found: ignore # the artifact is not uploaded if there are no diffs
- id: check-if-there-are-valid-files
name: Check if there are valid files
shell: bash
Expand Down
1 change: 0 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/BackendExporting.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2023 lukstbit <52494258+lukstbit@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 David Allison <davidallisongithub@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
package com.ichi2.anki

Expand Down
2 changes: 0 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/anki/DayRolloverHandler.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
Expand Down
2 changes: 2 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ open class DeckPicker :
}
override val baseSnackbarBuilder: SnackbarBuilder = {
anchorView = floatingActionButtonBinding.fabMain.takeIf { it.isVisible }
// Follow the FAB as it moves when the keyboard opens or closes.
isAnchorViewLayoutListenerEnabled = true
addCallback(activeSnackbarCallback)
}

Expand Down
3 changes: 2 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/NoteEditorFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ class NoteEditorFragment :
DispatchKeyEventListener,
MenuProvider,
ShortcutGroupProvider {
private val binding by viewBinding(FragmentNoteEditorBinding::bind)
@VisibleForTesting
internal val binding by viewBinding(FragmentNoteEditorBinding::bind)

private var bottomInsetPx = 0

Expand Down
17 changes: 16 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ import androidx.core.view.WindowInsetsCompat.Type.navigationBars
import androidx.core.view.WindowInsetsCompat.Type.systemBars
import androidx.core.view.WindowInsetsControllerCompat
import androidx.core.view.isGone
import androidx.core.view.updateLayoutParams
import androidx.core.view.updateMargins
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import anki.frontend.SetSchedulingStatesRequest
Expand Down Expand Up @@ -527,7 +529,20 @@ open class Reviewer :
// the card and its overlays reach the bottom of the screen when the answer buttons
// are shown above them
clearInsets(findViewById(R.id.flashcard), top = contentTop, bottom = cardBottom)
clearInsets(findViewById(R.id.touch_layer), top = contentTop, bottom = cardBottom)
// Touches are forwarded to the WebView in the touch layer's coordinates.
// So the layer insets need to match the WebView
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.touch_layer)) { view, insets ->
val bars = insets.bars()
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
updateMargins(
left = bars.left,
top = contentTop?.invoke(insets) ?: 0,
right = bars.right,
bottom = cardBottom(insets),
)
}
insets
}
clearInsets(findViewById(R.id.whiteboard), top = contentTop, bottom = cardBottom)

clearInsets(colorPalette, bottom = whiteboardPaletteBottom)
Expand Down
2 changes: 0 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/anki/TtsVoices.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) 2023 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2024 Sanjay Sargam <sargamsanjaykumar@gmail.com>
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2024 Sanjay Sargam <sargamsanjaykumar@gmail.com>
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2024 Sanjay Sargam <sargamsanjaykumar@gmail.com>
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.browser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2025 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.browser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.browser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2023 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.browser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2025 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.browser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright (c) 2021 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.cardviewer

import android.os.Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2023 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.cardviewer

Expand Down
16 changes: 1 addition & 15 deletions AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/VideoPlayer.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2024 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.cardviewer

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2023 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.cardviewer

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
Copyright (c) 2020 David Allison <davidallisongithub@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.ichi2.anki.contextmenu

import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
Copyright (c) 2020 David Allison <davidallisongithub@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.ichi2.anki.contextmenu

import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
Copyright (c) 2020 David Allison <davidallisongithub@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.ichi2.anki.contextmenu

import android.annotation.SuppressLint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* Copyright (c) 2025 David Allison <davidallisongithub@gmail.com>
* Copyright (c) 2025 Gautam Bhetanabhotla <gautamarcturus@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ class CreateDeckDialog(

fun createDeck(deckName: String) {
if (Decks.isValidDeckName(deckName)) {
createNewDeck(deckName)
// 11668: Display feedback if a deck is created
displayFeedback(context.getString(R.string.deck_created))
if (createNewDeck(deckName)) {
// 11668: Display feedback if a deck is created
displayFeedback(context.getString(R.string.deck_created))
}
} else {
Timber.d("CreateDeckDialog::createDeck - Not creating invalid deck name '%s'", deckName)
displayFeedback(context.getString(R.string.invalid_deck_name), Snackbar.LENGTH_LONG)
Expand All @@ -186,6 +187,7 @@ class CreateDeckDialog(
onNewDeckCreated(newDeckId)
} catch (filteredAncestor: BackendDeckIsFilteredException) {
Timber.w(filteredAncestor)
displayFeedback(filteredAncestor.localizedMessage ?: filteredAncestor.message ?: "", Snackbar.LENGTH_LONG)
return false
}
return true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
Copyright (c) 2020 David Allison <davidallisongithub@gmail.com>
Copyright (c) 2026 lukstbit <52494258+lukstbit@users.noreply.github.com>

This program is free software; you can redistribute it and/or modify it under
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (c) 2025 David Allison <davidallisongithub@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0-or-later

package com.ichi2.anki.dialogs

Expand Down
Loading
Loading