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
18 changes: 3 additions & 15 deletions AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ import java.io.FileOutputStream
import androidx.browser.customtabs.CustomTabsIntent.Builder as CustomTabsIntentBuilder

@UiThread
@KotlinCleanup("set activityName")
open class AnkiActivity :
AppCompatActivity,
open class AnkiActivity(
@LayoutRes contentLayoutId: Int? = null,
) : AppCompatActivity(contentLayoutId ?: 0),
ShortcutGroupProvider,
AnkiActivityProvider {
/**
Expand All @@ -117,8 +117,6 @@ open class AnkiActivity :

var importColpkgListener: ImportColpkgListener? = null

/** The name of the parent class (example: 'Reviewer') */
private val activityName: String
val dialogHandler = DialogHandler(this)
override val ankiActivity = this

Expand All @@ -134,16 +132,6 @@ open class AnkiActivity :
}
}

constructor() : super() {
activityName = javaClass.simpleName
}

constructor(
@LayoutRes contentLayoutId: Int,
) : super(contentLayoutId) {
activityName = javaClass.simpleName
}

@Suppress("deprecation") // #9332: UI Visibility -> Insets
override fun onCreate(savedInstanceState: Bundle?) {
// The hardware buttons should control the music volume
Expand Down
134 changes: 58 additions & 76 deletions AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ import com.ichi2.utils.HandlerUtils
import com.ichi2.utils.IntentUtil
import timber.log.Timber

abstract class NavigationDrawerActivity :
AnkiActivity(),
abstract class NavigationDrawerActivity(
@LayoutRes contentLayoutId: Int? = null,
) : AnkiActivity(contentLayoutId),
NavigationView.OnNavigationItemSelectedListener {
/**
* Navigation Drawer
Expand Down
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/res/layout-xlarge/homescreen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:layout_height="match_parent"/>

<com.ichi2.anki.ui.ResizingDivider
android:id="@+id/homescreen_resizing_divider"
android:id="@+id/resizing_divider"
android:layout_width="8dp"
android:layout_height="match_parent" />

Expand Down
8 changes: 5 additions & 3 deletions AnkiDroid/src/main/res/layout/deck_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
android:fastScrollEnabled="true"
android:focusable="true"
android:paddingBottom="72dp"
android:layout_above="@id/today_stats_text_view"
android:layout_above="@id/review_summary_text_view"
android:scrollbars="vertical" />

<com.ichi2.ui.FixedTextView
android:id="@+id/today_stats_text_view"
android:id="@+id/review_summary_text_view"
android:layout_width="match_parent"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
Expand Down Expand Up @@ -93,5 +93,7 @@
</LinearLayout>

<include layout="@layout/anki_progress"/>
<include layout="@layout/floating_add_button"/>
<include
android:id="@+id/floating_action_button"
layout="@layout/floating_add_button"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
4 changes: 3 additions & 1 deletion AnkiDroid/src/main/res/layout/homescreen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<include layout="@layout/toolbar" />

<include layout="@layout/deck_picker" />
<include
android:id="@+id/deck_picker_pane"
layout="@layout/deck_picker" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion AnkiDroid/src/test/java/com/ichi2/anki/DeckPickerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ class DeckPickerTest : RobolectricTest() {

// ACT: open up the Deck Context Menu
val deckToClick =
recyclerView.children.single {
deckPickerBinding.decks.children.single {
it.findViewById<TextView>(R.id.deckpicker_name).text == "With Cards"
}
deckToClick.performLongClick()
Expand Down