Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xenonnn4w committed Aug 11, 2024
1 parent d5fc262 commit f815709
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ class DeckPickerWidgetConfig : AnkiActivity(), DeckSelectionListener {
itemTouchHelper.attachToRecyclerView(this)
}

findViewById<Button>(R.id.done_button).setOnClickListener {
val doneButton = findViewById<Button>(R.id.done_button)
val saveText = getString(R.string.save).uppercase()
doneButton.text = saveText

doneButton.setOnClickListener {
saveSelectedDecksToPreferencesDeckPickerWidget()
hasUnsavedChanges = false // Reset flag after saving

Expand Down
Binary file modified AnkiDroid/src/main/res/drawable/widget_deck_picker_drawable.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions AnkiDroid/src/main/res/layout/widget_deck_picker_config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -55,21 +53,23 @@
<RelativeLayout
android:id="@+id/buttonBackgroundLayer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="45dp"
android:layout_alignParentBottom="true"
android:padding="16dp">
>

<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/done_button"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-6dp"
android:layout_marginEnd="250dp"
android:padding="16dp"
android:layout_width="88dp"
android:layout_height="match_parent"
android:layout_marginEnd="20dp"
android:background="@android:color/transparent"
android:clickable="true"
android:paddingStart="12dp"
android:paddingTop="0dp"
android:text="@string/save"
app:cornerRadius="8dp"
app:elevation="4dp" />
android:textColor="@color/material_blue_A700"
android:textSize="20sp" />

</RelativeLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
Expand All @@ -82,4 +82,4 @@
android:layout_marginBottom="40dp"
android:src="@drawable/ic_add_white" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
1 change: 1 addition & 0 deletions AnkiDroid/src/main/res/layout/widget_item_deck_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:textSize="22sp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
tools:text="Deck1" />

<TextView
Expand Down

0 comments on commit f815709

Please sign in to comment.