diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java index a6548fe..8851225 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java @@ -100,7 +100,6 @@ public class SCNApp extends Application implements LifecycleObserver } } -//TODO: Collapse on click again //TODO: Share button on expand //TODO: Delete button on expand //TODO: Config for collapsed line count diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/model/CMessage.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/model/CMessage.java index 9a21eda..f95fc40 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/model/CMessage.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/model/CMessage.java @@ -9,6 +9,8 @@ import java.util.TimeZone; public class CMessage { + public boolean IsExpandedInAdapter = false; + public final long SCN_ID; public final long Timestamp; public final String Title; diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/MessageAdapter.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/MessageAdapter.java index b717fdd..834e98e 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/MessageAdapter.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/MessageAdapter.java @@ -136,6 +136,8 @@ public class MessageAdapter extends RecyclerView.Adapter tvTitle.setText(msg.Title); tvMessage.setText(msg.Content); + tvMessage.setMaxLines(msg.IsExpandedInAdapter ? 999 : 6); + switch (msg.Priority) { case LOW: @@ -160,15 +162,25 @@ public class MessageAdapter extends RecyclerView.Adapter @Override public void onClick(View v) { + if (data.IsExpandedInAdapter) + { + data.IsExpandedInAdapter=false; + tvMessage.setMaxLines(6); + return; + } + for (MessagePresenter holder : MessageAdapter.this.viewHolders.keySet()) { if (holder == null) continue; if (holder == this) continue; if (holder.tvMessage == null) continue; - if (holder.tvMessage.getMaxLines() == 6) continue; + if (!holder.data.IsExpandedInAdapter) continue; + + holder.data.IsExpandedInAdapter=false; holder.tvMessage.setMaxLines(6); } + data.IsExpandedInAdapter=true; tvMessage.setMaxLines(9999); } }