Skip to content

Commit

Permalink
truncate long titles in log
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Jan 20, 2024
1 parent 806b87e commit dbafcfb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public void onBindViewHolder(@NonNull final ViewHolder holder, final int positio
}
String timeFormattedHuman = DateUtils.getRelativeTimeSpanString(timestamp).toString();

holder.logtitle.setText(selectedTrigger.getString(SyncLog.TITLE));
String text = selectedTrigger.getString(SyncLog.TITLE);
holder.logtitle.setText(text);
holder.logtitle.setOnClickListener(v -> {
Toasty.info(v.getContext(), text).show();
});
holder.logdetails.setText(selectedTrigger.getString(SyncLog.CONTENT));
holder.logdate.setText(timeFormattedHuman);

Expand All @@ -65,6 +69,7 @@ public void onBindViewHolder(@NonNull final ViewHolder holder, final int positio
Toasty.info(v.getContext(), timeFormattedFullFinal).show();
});


Context c = holder.view.getContext();
switch (selectedTrigger.getInt(SyncLog.TYPE)){
case SyncLog.TYPE_ERROR:
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/layout/fragment_log_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@

<TextView
android:id="@+id/logtitle"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:ellipsize="end"
android:fontFamily="sans-serif"
android:textAppearance="?attr/textAppearanceListItem"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@+id/log_icon"
app:layout_constraintEnd_toStartOf="@+id/logdate"
app:layout_constraintStart_toEndOf="@+id/log_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="title" />
Expand Down

0 comments on commit dbafcfb

Please sign in to comment.