Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xenonnn4w committed Aug 15, 2024
1 parent 4fd756b commit 380353a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class DeckPickerWidgetConfig : AnkiActivity(), DeckSelectionListener {
* - **If decks are selected:** Sets the button text to "Save", saves the selected decks, updates the widget, and then finishes the activity.
*/
private fun setupDoneButton() {
val doneButton = findViewById<Button>(R.id.done_button)
val doneButton = findViewById<Button>(R.id.submit_button)
val saveText = getString(R.string.save).uppercase()
val cancelText = getString(R.string.dialog_cancel).uppercase()

Expand Down
19 changes: 9 additions & 10 deletions AnkiDroid/src/main/res/layout/widget_deck_picker_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,17 @@
android:layout_alignParentBottom="true"
>

<!-- Save / Cancel -->
<Button
android:id="@+id/done_button"
android:layout_width="130dp"
android:id="@+id/submit_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="20dp"
android:background="@android:color/transparent"
android:clickable="true"
android:paddingStart="2dp"
android:paddingTop="0dp"
android:text="@string/save"
android:textColor="@color/material_blue_A700"
android:textSize="20sp" />
android:textSize="@dimen/abc_text_size_button_material"
style="@style/Widget.Material3.Button.TextButton"
android:singleLine="true"
android:padding="3dp"
android:layout_gravity="center"
android:text="@string/save" />

</RelativeLayout>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import com.ichi2.anki.R
import com.ichi2.anki.RobolectricTest
import com.ichi2.anki.dialogs.DeckSelectionDialog
import com.ichi2.widget.DeckPickerWidgetConfig
import com.ichi2.widget.WidgetConfigScreenAdapter
import com.ichi2.widget.WidgetPreferences
import org.junit.Before
import org.junit.Test
Expand Down Expand Up @@ -121,9 +120,6 @@ class DeckPickerWidgetConfigTest : RobolectricTest() {
*/
@Test
fun testUpdateViewVisibility() {
activity.deckAdapter = WidgetConfigScreenAdapter { _, _ ->
}

val noDecksPlaceholder = activity.findViewById<View>(R.id.no_decks_placeholder)
val widgetConfigContainer = activity.findViewById<View>(R.id.widgetConfigContainer)

Expand Down

0 comments on commit 380353a

Please sign in to comment.