forked from github/szkolny
[UI] Implement new Event Adapter and Day Dialog (partially).
This commit is contained in:
parent
41cebc554f
commit
d70b0c0c3f
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright (c) Kuba Szczodrzyński 2019-12-16.
|
||||
*/
|
||||
|
||||
package pl.szczodrzynski.edziennik.ui.dialogs.day
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import pl.szczodrzynski.edziennik.App
|
||||
import pl.szczodrzynski.edziennik.R
|
||||
import pl.szczodrzynski.edziennik.databinding.DialogDayBinding
|
||||
import pl.szczodrzynski.edziennik.onClick
|
||||
import pl.szczodrzynski.edziennik.setText
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListAdapter
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog
|
||||
import pl.szczodrzynski.edziennik.utils.SimpleDividerItemDecoration
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||
import pl.szczodrzynski.edziennik.utils.models.Week
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
class DayDialog(
|
||||
val activity: AppCompatActivity,
|
||||
val profileId: Int,
|
||||
val date: Date,
|
||||
val onShowListener: ((tag: String) -> Unit)? = null,
|
||||
val onDismissListener: ((tag: String) -> Unit)? = null
|
||||
) : CoroutineScope {
|
||||
companion object {
|
||||
private const val TAG = "DayDialog"
|
||||
}
|
||||
|
||||
private lateinit var app: App
|
||||
private lateinit var b: DialogDayBinding
|
||||
private lateinit var dialog: AlertDialog
|
||||
|
||||
private val job = Job()
|
||||
override val coroutineContext: CoroutineContext
|
||||
get() = job + Dispatchers.Main
|
||||
|
||||
private lateinit var adapter: EventListAdapter
|
||||
|
||||
init { run {
|
||||
if (activity.isFinishing)
|
||||
return@run
|
||||
onShowListener?.invoke(TAG)
|
||||
app = activity.applicationContext as App
|
||||
b = DialogDayBinding.inflate(activity.layoutInflater)
|
||||
dialog = MaterialAlertDialogBuilder(activity)
|
||||
.setView(b.root)
|
||||
.setPositiveButton(R.string.close) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
.setNeutralButton(R.string.add, null)
|
||||
.setOnDismissListener {
|
||||
onDismissListener?.invoke(TAG)
|
||||
}
|
||||
.show()
|
||||
|
||||
dialog.getButton(AlertDialog.BUTTON_NEUTRAL)?.onClick {
|
||||
EventManualDialog(
|
||||
activity,
|
||||
profileId,
|
||||
defaultDate = date,
|
||||
onShowListener = onShowListener,
|
||||
onDismissListener = onDismissListener
|
||||
)
|
||||
}
|
||||
|
||||
update()
|
||||
}}
|
||||
|
||||
private fun update() {
|
||||
b.dayDate.setText(
|
||||
R.string.dialog_day_date_format,
|
||||
Week.getFullDayName(date.weekDay),
|
||||
date.formattedString
|
||||
)
|
||||
|
||||
adapter = EventListAdapter(
|
||||
activity,
|
||||
onItemClick = {
|
||||
Toast.makeText(activity, "Event clicked ${it.topic}", Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
onEventEditClick = {
|
||||
EventManualDialog(
|
||||
activity,
|
||||
profileId,
|
||||
editingEvent = it,
|
||||
onShowListener = onShowListener,
|
||||
onDismissListener = onDismissListener
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
app.db.eventDao().getAllByDate(profileId, date).observe(activity, Observer { events ->
|
||||
adapter.items = events
|
||||
if (b.eventsView.adapter == null) {
|
||||
b.eventsView.adapter = adapter
|
||||
b.eventsView.apply {
|
||||
setHasFixedSize(true)
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
addItemDecoration(SimpleDividerItemDecoration(context))
|
||||
}
|
||||
}
|
||||
adapter.notifyDataSetChanged()
|
||||
|
||||
if (events != null && events.isNotEmpty()) {
|
||||
b.eventsView.visibility = View.VISIBLE
|
||||
b.eventsNoData.visibility = View.GONE
|
||||
} else {
|
||||
b.eventsView.visibility = View.GONE
|
||||
b.eventsNoData.visibility = View.VISIBLE
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -5,41 +5,72 @@
|
||||
package pl.szczodrzynski.edziennik.ui.dialogs.event
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.PorterDuffColorFilter
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import pl.szczodrzynski.edziennik.App
|
||||
import pl.szczodrzynski.edziennik.MainActivity
|
||||
import pl.szczodrzynski.edziennik.R
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.events.Event
|
||||
import pl.szczodrzynski.edziennik.*
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull
|
||||
import pl.szczodrzynski.edziennik.databinding.RowDialogEventListItemBinding
|
||||
import pl.szczodrzynski.edziennik.utils.Utils.bs
|
||||
import pl.szczodrzynski.edziennik.databinding.EventListItemBinding
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||
|
||||
class EventListAdapter(
|
||||
val context: Context,
|
||||
val parentDialog: EventListDialog
|
||||
val onItemClick: ((event: EventFull) -> Unit)? = null,
|
||||
val onEventEditClick: ((event: EventFull) -> Unit)? = null
|
||||
) : RecyclerView.Adapter<EventListAdapter.ViewHolder>() {
|
||||
|
||||
private val app by lazy { context.applicationContext as App }
|
||||
|
||||
val eventList = mutableListOf<EventFull>()
|
||||
var items = listOf<EventFull>()
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
val view: RowDialogEventListItemBinding = DataBindingUtil.inflate(inflater, R.layout.row_dialog_event_list_item, parent, false)
|
||||
val view = EventListItemBinding.inflate(inflater, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val event = eventList[position]
|
||||
val event = items[position]
|
||||
val b = holder.b
|
||||
|
||||
holder.apply {
|
||||
b.root.onClick {
|
||||
onItemClick?.invoke(event)
|
||||
}
|
||||
|
||||
val bullet = " • "
|
||||
|
||||
b.topic.text = event.topic
|
||||
|
||||
b.details.text = mutableListOf<CharSequence?>(
|
||||
event.typeName,
|
||||
event.startTime?.stringHM ?: app.getString(R.string.event_all_day),
|
||||
event.subjectLongName
|
||||
).concat(bullet)
|
||||
|
||||
b.addedBy.setText(
|
||||
when (event.sharedBy) {
|
||||
null -> when {
|
||||
event.addedManually -> R.string.event_list_added_by_self_format
|
||||
event.teacherFullName == null -> R.string.event_list_added_by_unknown_format
|
||||
else -> R.string.event_list_added_by_format
|
||||
}
|
||||
"self" -> R.string.event_list_shared_by_self_format
|
||||
else -> R.string.event_list_shared_by_format
|
||||
},
|
||||
Date.fromMillis(event.addedDate).formattedString,
|
||||
event.sharedByName ?: event.teacherFullName ?: "",
|
||||
event.teamName?.let { bullet+it } ?: ""
|
||||
)
|
||||
|
||||
b.typeColor.background?.setTintColor(event.getColor())
|
||||
|
||||
b.editButton.visibility = if (event.addedManually) View.VISIBLE else View.GONE
|
||||
b.editButton.onClick {
|
||||
onEventEditClick?.invoke(event)
|
||||
}
|
||||
|
||||
/*with(holder) {
|
||||
b.eventListItemRoot.background.colorFilter = when (event.type) {
|
||||
Event.TYPE_HOMEWORK -> PorterDuffColorFilter(0xffffffff.toInt(), PorterDuff.Mode.CLEAR)
|
||||
else -> PorterDuffColorFilter(event.color, PorterDuff.Mode.MULTIPLY)
|
||||
@ -67,10 +98,10 @@ class EventListAdapter(
|
||||
onDismissListener = parentDialog.onDismissListener
|
||||
)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = eventList.size
|
||||
override fun getItemCount() = items.size
|
||||
|
||||
class ViewHolder(val b: RowDialogEventListItemBinding) : RecyclerView.ViewHolder(b.root)
|
||||
class ViewHolder(val b: EventListItemBinding) : RecyclerView.ViewHolder(b.root)
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ package pl.szczodrzynski.edziennik.ui.dialogs.event
|
||||
|
||||
import android.graphics.Typeface
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.lifecycle.Observer
|
||||
@ -117,7 +118,9 @@ class EventListDialog(
|
||||
layoutManager = LinearLayoutManager(activity)
|
||||
}
|
||||
|
||||
adapter = EventListAdapter(activity, this@EventListDialog)
|
||||
adapter = EventListAdapter(activity) {
|
||||
Toast.makeText(activity, "Event clicked ${it.topic}", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
b.eventListView.adapter = adapter
|
||||
|
||||
app.db.eventDao().getAllByDateTime(profileId, date, time).observe(activity, Observer { events ->
|
||||
@ -126,10 +129,10 @@ class EventListDialog(
|
||||
b.textNoEvents.visibility = View.VISIBLE
|
||||
} else {
|
||||
adapter.run {
|
||||
eventList.apply {
|
||||
/*items.apply {
|
||||
clear()
|
||||
addAll(events)
|
||||
}
|
||||
}*/
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ class EventManualDialog(
|
||||
saveEvent()
|
||||
}
|
||||
|
||||
val negativeButton = dialog.getButton(BUTTON_NEUTRAL)
|
||||
negativeButton?.setOnClickListener {
|
||||
val neutralButton = dialog.getButton(BUTTON_NEUTRAL)
|
||||
neutralButton?.setOnClickListener {
|
||||
showRemoveEventDialog()
|
||||
}
|
||||
}
|
||||
|
@ -50,24 +50,6 @@ class LessonDetailsDialog(
|
||||
onShowListener = onShowListener,
|
||||
onDismissListener = onDismissListener
|
||||
)
|
||||
/*MaterialAlertDialogBuilder(activity)
|
||||
.setItems(R.array.main_menu_add_options) { dialog2, which ->
|
||||
dialog2.dismiss()
|
||||
EventManualDialogOld(activity, lesson.profileId)
|
||||
.show(
|
||||
activity.application as App,
|
||||
null,
|
||||
lesson.displayDate,
|
||||
lesson.displayStartTime,
|
||||
when (which) {
|
||||
1 -> EventManualDialogOld.DIALOG_HOMEWORK
|
||||
else -> EventManualDialogOld.DIALOG_EVENT
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
.setNegativeButton(R.string.cancel) { dialog2, _ -> dialog2.dismiss() }
|
||||
.show()*/
|
||||
}
|
||||
.setOnDismissListener {
|
||||
onDismissListener?.invoke(TAG)
|
||||
|
@ -42,7 +42,7 @@ import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teachers.TeacherAbsenceFull;
|
||||
import pl.szczodrzynski.edziennik.databinding.FragmentAgendaCalendarBinding;
|
||||
import pl.szczodrzynski.edziennik.databinding.FragmentAgendaDefaultBinding;
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog;
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.day.DayDialog;
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog;
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.lessonchange.LessonChangeDialog;
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.teacherabsence.TeacherAbsenceDialog;
|
||||
@ -56,7 +56,6 @@ import pl.szczodrzynski.edziennik.utils.Colors;
|
||||
import pl.szczodrzynski.edziennik.utils.Themes;
|
||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem;
|
||||
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem;
|
||||
|
||||
@ -332,7 +331,7 @@ public class AgendaFragment extends Fragment {
|
||||
@Override
|
||||
public void onEventSelected(CalendarEvent calendarEvent) {
|
||||
if (calendarEvent instanceof BaseCalendarEvent) {
|
||||
if (!calendarEvent.isPlaceholder() && !calendarEvent.isAllDay()) {
|
||||
/*if (!calendarEvent.isPlaceholder() && !calendarEvent.isAllDay()) {
|
||||
// new EventListDialogOld(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()), Time.fromMillis(calendarEvent.getStartTime().getTimeInMillis()), true);
|
||||
new EventListDialog(
|
||||
activity,
|
||||
@ -341,16 +340,23 @@ public class AgendaFragment extends Fragment {
|
||||
Time.fromMillis(calendarEvent.getStartTime().getTimeInMillis()),
|
||||
null,
|
||||
null);
|
||||
} else {
|
||||
} else {*/
|
||||
// new EventListDialogOld(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()));
|
||||
new EventListDialog(
|
||||
new DayDialog(
|
||||
activity,
|
||||
App.profileId,
|
||||
Date.fromCalendar(calendarEvent.getInstanceDay()),
|
||||
null,
|
||||
null
|
||||
);
|
||||
/*new EventListDialog(
|
||||
activity,
|
||||
App.profileId,
|
||||
Date.fromCalendar(calendarEvent.getInstanceDay()),
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
}
|
||||
null);*/
|
||||
//}
|
||||
} else if (calendarEvent instanceof LessonChangeEvent) {
|
||||
new LessonChangeDialog(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()));
|
||||
//Toast.makeText(app, "Clicked "+((LessonChangeEvent) calendarEvent).getLessonChangeDate().getFormattedString(), Toast.LENGTH_SHORT).show();
|
||||
@ -434,15 +440,22 @@ public class AgendaFragment extends Fragment {
|
||||
unreadEventDates.remove((Integer) scrolledDate);
|
||||
}
|
||||
|
||||
new DayDialog(
|
||||
activity,
|
||||
App.profileId,
|
||||
dayDate,
|
||||
null,
|
||||
null
|
||||
);
|
||||
// new EventListDialogOld(getContext()).show(app, dayDate);
|
||||
new EventListDialog(
|
||||
/*new EventListDialog(
|
||||
activity,
|
||||
App.profileId,
|
||||
dayDate,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
);*/
|
||||
});
|
||||
b_calendar.progressBar.setVisibility(View.GONE);
|
||||
});
|
||||
|
52
app/src/main/res/drawable/ic_no_events.xml
Normal file
52
app/src/main/res/drawable/ic_no_events.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<!--
|
||||
~ Copyright (c) Kuba Szczodrzyński 2019-12-16.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64">
|
||||
<path
|
||||
android:pathData="M6.668,52L6.668,20L57.332,20L57.332,52C57.332,54.9453 54.9453,57.332 52,57.332L12,57.332C9.0547,57.332 6.668,54.9453 6.668,52"
|
||||
android:fillColor="#DCEDC8"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M57.332,14.668L57.332,22.668L6.668,22.668L6.668,14.668C6.668,11.7227 9.0547,9.332 12,9.332L52,9.332C54.9453,9.332 57.332,11.7227 57.332,14.668"
|
||||
android:fillColor="#4CAF50"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M48,14.668C48,16.875 46.2109,18.668 44,18.668C41.7891,18.668 40,16.875 40,14.668C40,12.457 41.7891,10.668 44,10.668C46.2109,10.668 48,12.457 48,14.668"
|
||||
android:fillColor="#2E7D32"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M24,14.668C24,16.875 22.2109,18.668 20,18.668C17.7891,18.668 16,16.875 16,14.668C16,12.457 17.7891,10.668 20,10.668C22.2109,10.668 24,12.457 24,14.668"
|
||||
android:fillColor="#2E7D32"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M44,5.332C42.5273,5.332 41.332,6.5273 41.332,8L41.332,14.668C41.332,16.1367 42.5273,17.332 44,17.332C45.4727,17.332 46.668,16.1367 46.668,14.668L46.668,8C46.668,6.5273 45.4727,5.332 44,5.332"
|
||||
android:fillColor="#B0BEC5"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M20,5.332C18.5273,5.332 17.332,6.5273 17.332,8L17.332,14.668C17.332,16.1367 18.5273,17.332 20,17.332C21.4727,17.332 22.668,16.1367 22.668,14.668L22.668,8C22.668,6.5273 21.4727,5.332 20,5.332"
|
||||
android:fillColor="#B0BEC5"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M42.3203,29.4102L30.3398,41.4063L24.6289,35.707L21.332,39.0078L30.3477,48L45.6211,32.707Z"
|
||||
android:fillColor="#4CAF50"
|
||||
android:fillAlpha="1"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
98
app/src/main/res/layout/dialog_day.xml
Normal file
98
app/src/main/res/layout/dialog_day.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) Kuba Szczodrzyński 2019-12-16.
|
||||
-->
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data>
|
||||
|
||||
</data>
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dayDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:textAppearance="@style/NavView.TextView.Title"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
tools:text="wtorek, 17 grudnia" />
|
||||
|
||||
<include
|
||||
android:id="@+id/lessonChangeContainer"
|
||||
layout="@layout/row_lesson_change_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/teacherAbsenceContainer"
|
||||
layout="@layout/row_teacher_absence_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/eventsNoData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:drawableTop="@drawable/ic_no_events"
|
||||
android:drawablePadding="16dp"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="@string/dialog_day_no_events"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Możesz wpisać wydarzenie ręcznie, używając przycisku Dodaj."
|
||||
android:gravity="center"
|
||||
android:textStyle="italic"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/eventsView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:clipToPadding="false"
|
||||
tools:visibility="gone"
|
||||
tools:listitem="@layout/event_list_item" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</layout>
|
@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/detailsLayout"
|
||||
@ -88,9 +87,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="8dp"
|
||||
tools:listitem="@layout/row_dialog_event_list_item" />
|
||||
</LinearLayout>
|
||||
|
76
app/src/main/res/layout/event_list_item.xml
Normal file
76
app/src/main/res/layout/event_list_item.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) Kuba Szczodrzyński 2019-12-15.
|
||||
-->
|
||||
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical"
|
||||
android:background="?selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/typeColor"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/unread_red_circle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/NavView.TextView.Helper"
|
||||
android:textSize="16sp"
|
||||
android:maxLines="2"
|
||||
tools:text="sprawdzian • 9:05 • historia i społeczeństwo" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/topic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/NavView.TextView.Medium"
|
||||
android:maxLines="3"
|
||||
tools:text="Rozdział II: Panowanie Piastów i Jagiellonów.Przeniesiony z 11 grudnia." />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/editButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:text="\uFC92"
|
||||
android:textSize="20sp"
|
||||
android:fontFamily="@font/community_material_font_v3_5_95_1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/addedBy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/NavView.TextView.Helper"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="middle"
|
||||
android:text="Udostępniono 10 grudnia przez Ktoś Z Twojej Klasy • 2B3T" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -1069,8 +1069,11 @@
|
||||
<string name="login_error_no_code">Podaj kod</string>
|
||||
<string name="event_list_added_by_format">Dodano %1$s przez %2$s%3$s</string>
|
||||
<string name="event_list_added_by_unknown_format">Dodano %1$s%3$s</string>
|
||||
<string name="event_list_added_by_self_format">Dodano %1$s przez Ciebie%3$s</string>
|
||||
<string name="event_list_shared_by_format">Udostępniono %1$s przez %2$s%3$s</string>
|
||||
<string name="event_list_shared_by_self_format">Udostępniono %1$s przez Ciebie%3$s</string>
|
||||
<string name="settings_theme_snowfall_text">Pada śnieg, pada śnieg</string>
|
||||
<string name="settings_theme_snowfall_subtext">Dzwonią dzwonki sań</string>
|
||||
<string name="dialog_day_no_events">Brak wydarzeń tego dnia.</string>
|
||||
<string name="dialog_day_date_format">%s, %s</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user