Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class CardTemplateNotetype(

/**
* Handles everything for a note type change at once - template add / deletes as well as content updates
* This is an extension function on Collection and should be called from within undoableOp
*/
suspend fun saveNoteType(
notetype: NotetypeJson,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ class BrowserMultiColumnAdapter(
LayoutInflater
.from(parent.context)
.inflate(R.layout.card_item_browser, parent, false)
// Set a fixed height to prevent scrollbar jitter, with enough space to show content
val params = view.layoutParams
params.height = (parent.context.resources.displayMetrics.density * 56).toInt() // Increased to 56dp for better visibility
view.layoutParams = params
return MultiColumnViewHolder(view)
}

Expand Down Expand Up @@ -275,7 +279,24 @@ class BrowserMultiColumnAdapter(
holder.numberOfColumns = row.cellsCount

for (i in 0 until row.cellsCount) {
holder.columnViews[i].text = renderColumn(i)
val columnText = renderColumn(i)
holder.columnViews[i].text = columnText
// Add tooltip showing full text when truncated - long press to see full text
holder.columnViews[i].setOnLongClickListener { view ->
android.widget.Toast
.makeText(
context,
"Long text:\n$columnText",
android.widget.Toast.LENGTH_LONG,
).show()
true
}
// Set content description for accessibility and show hint if text is truncated
holder.columnViews[i].contentDescription = columnText
// Show hint on first view
if (columnText.length > 30) {
holder.columnViews[i].setTooltipText("Long press to see full text")
}
}
holder.setIsSelected(isSelected)
val rowColor =
Expand Down
10 changes: 8 additions & 2 deletions AnkiDroid/src/main/res/layout/browser_column_cell.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="8dp"
android:paddingVertical="1dp"
android:layout_gravity="top"
android:paddingEnd="6dp"
android:paddingVertical="6dp"
android:gravity="center_vertical|start"
android:ellipsize="end"
android:maxLines="2"
android:textColor="?android:attr/textColorPrimary"
android:textSize="14sp"
android:lineSpacingMultiplier="1.1"
/>
3 changes: 2 additions & 1 deletion AnkiDroid/src/main/res/layout/card_item_browser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_item_browser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="56dp"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal"
xmlns:tools="http://schemas.android.com/tools">

<CheckBox
Expand Down
2 changes: 2 additions & 0 deletions AnkiDroid/src/main/res/layout/item_notetype_field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
android:drawableTint="?attr/colorControlNormal"
android:layout_gravity="start|center_vertical"
android:textAppearance="?attr/textAppearanceListItem"
android:ellipsize="end"
android:singleLine="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
2 changes: 2 additions & 0 deletions AnkiDroid/src/main/res/layout/item_require_exclude_tag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
android:gravity="center_vertical"
android:paddingHorizontal="8dp"
android:background="?attr/selectableItemBackground"
android:ellipsize="end"
android:singleLine="true"
tools:text="Tag entry"/>
2 changes: 2 additions & 0 deletions AnkiDroid/src/main/res/layout/tags_item_list_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
android:layout_weight="1"
android:paddingStart="6dp"
android:textSize="16sp"
android:ellipsize="end"
android:singleLine="true"
tools:text="Example Tag" />

<com.ichi2.ui.CheckBoxTriStates
Expand Down
Loading