From c1ca104021fdc9c229e644d2498d8aab0cce6b39 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sat, 7 Dec 2019 20:46:00 +0100 Subject: [PATCH] [UI/Announcements] Make better announcements look. --- .../announcements/AnnouncementsAdapter.java | 16 +- .../announcements/AnnouncementsFragment.java | 5 +- .../notifications/NotificationsFragment.kt | 8 +- .../res/layout/row_announcements_item.xml | 168 ++++++++---------- 4 files changed, 94 insertions(+), 103 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java index 1b0d4fda..8d02a678 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java @@ -1,6 +1,7 @@ package pl.szczodrzynski.edziennik.ui.modules.announcements; import android.content.Context; +import android.graphics.Bitmap; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Typeface; @@ -8,14 +9,16 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import java.util.List; - import androidx.annotation.NonNull; import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.databinding.RowAnnouncementsItemBinding; import pl.szczodrzynski.edziennik.data.db.modules.announcements.AnnouncementFull; +import pl.szczodrzynski.edziennik.databinding.RowAnnouncementsItemBinding; +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesUtils; public class AnnouncementsAdapter extends RecyclerView.Adapter { @@ -51,7 +54,7 @@ public class AnnouncementsAdapter extends RecyclerView.Adapter { + b.announcementsItem.setOnClickListener((v -> { if (onClick != null) { onClick.onClick(v, item); } @@ -59,7 +62,7 @@ public class AnnouncementsAdapter extends RecyclerView.Adapter { if (app == null || app.profile == null || activity == null || b == null || !isAdded()) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.kt index e63e11cb..49c213d0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.kt @@ -12,7 +12,6 @@ import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment import androidx.lifecycle.Observer -import androidx.recyclerview.widget.DividerItemDecoration.HORIZONTAL import androidx.recyclerview.widget.LinearLayoutManager import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial import pl.szczodrzynski.edziennik.App @@ -71,9 +70,8 @@ class NotificationsFragment : Fragment() { b.notificationsView.adapter = adapter b.notificationsView.apply { setHasFixedSize(true) - layoutManager = LinearLayoutManager(context).apply { - addItemDecoration(SimpleDividerItemDecoration(context)) - } + layoutManager = LinearLayoutManager(context) + addItemDecoration(SimpleDividerItemDecoration(context)) } } adapter.notifyDataSetChanged() @@ -87,4 +85,4 @@ class NotificationsFragment : Fragment() { } }) } -} \ No newline at end of file +} diff --git a/app/src/main/res/layout/row_announcements_item.xml b/app/src/main/res/layout/row_announcements_item.xml index d0c6c2ba..38c5e98d 100644 --- a/app/src/main/res/layout/row_announcements_item.xml +++ b/app/src/main/res/layout/row_announcements_item.xml @@ -3,104 +3,92 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - + android:layout_height="match_parent"> - + - + - + - - - - - - - + + + - \ No newline at end of file +