move timestamp below message, move buttons back to the left

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2023-06-07 15:20:57 +02:00
parent 06388ba539
commit 09c7aa2d0a
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 26 additions and 15 deletions

View file

@ -36,6 +36,7 @@ import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
@ -144,7 +145,12 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
}
}
if (notification.getMessage() != null && !notification.getMessage().isEmpty()) {
holder.binding.message.setText(notification.getMessage());
holder.binding.message.setVisibility(View.VISIBLE);
} else {
holder.binding.message.setVisibility(View.GONE);
}
if (!TextUtils.isEmpty(notification.getIcon())) {
downloadIcon(notification.getIcon(), holder.binding.icon, notificationsActivity);
@ -179,6 +185,12 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
List<Action> overflowActions = new ArrayList<>();
if (notification.getActions().size() > 0) {
holder.binding.buttons.setVisibility(View.VISIBLE);
} else {
holder.binding.buttons.setVisibility(View.GONE);
}
if (notification.getActions().size() > 2) {
for (Action action : notification.getActions()) {
if (action.primary) {

View file

@ -23,7 +23,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -80,31 +79,31 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:paddingBottom="@dimen/standard_quarter_padding"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="@color/secondary_text_color"
android:textSize="@dimen/txt_size_14sp"
tools:text="@string/placeholder_sentence" />
<TextView
android:id="@+id/datetime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:textColor="@color/secondary_text_color"
android:textSize="@dimen/text_size_13sp"
tools:text="@string/placeholder_sentence" />
<LinearLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:layout_marginTop="@dimen/standard_quarter_margin"
android:layout_marginEnd="@dimen/notification_list_item_grid_layout_left_start_margin"
android:layout_marginTop="@dimen/alternate_half_margin"
android:columnCount="3"
android:gravity="start"
android:orientation="horizontal" />
<TextView
android:id="@+id/datetime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:ellipsize="end"
android:textColor="@color/secondary_text_color"
android:textSize="@dimen/text_size_13sp"
tools:text="@string/placeholder_sentence" />
</LinearLayout>
</RelativeLayout>

View file

@ -100,7 +100,7 @@
<dimen name="activity_row_layout_height">48dp</dimen>
<dimen name="notification_icon_width">24dp</dimen>
<dimen name="notification_icon_height">24dp</dimen>
<dimen name="notification_icon_layout_right_end_margin">22dp</dimen>
<dimen name="notification_icon_layout_right_end_margin">21dp</dimen>
<dimen name="notification_list_item_grid_layout_left_start_margin">-8dp</dimen>
<dimen name="uploader_list_separator_height">1dp</dimen>
<dimen name="contactlist_item_icon_layout_width">40dp</dimen>