mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-02-21 14:04:45 +01:00
[Dialog/Events] Make new event list dialog.
This commit is contained in:
parent
47d395de71
commit
d1265dc1f2
@ -84,24 +84,44 @@ class LessonFull(profileId: Int, id: Long) : Lesson(profileId, id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
val changeSubjectName: String
|
private fun changeText(actual: String?, old: String?): String {
|
||||||
get() {
|
val first = when (type) {
|
||||||
val first = when (type) {
|
TYPE_CHANGE, TYPE_CANCELLED, TYPE_SHIFTED_SOURCE -> old
|
||||||
TYPE_CHANGE, TYPE_CANCELLED, TYPE_SHIFTED_SOURCE -> oldSubjectName
|
else -> actual
|
||||||
else -> subjectName
|
|
||||||
}
|
|
||||||
|
|
||||||
val second = when (type) {
|
|
||||||
TYPE_CHANGE -> subjectName
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
|
|
||||||
return when (second) {
|
|
||||||
null -> first ?: ""
|
|
||||||
else -> "$first -> $second"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val second = when (type) {
|
||||||
|
TYPE_CHANGE -> actual
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
|
||||||
|
return when (second) {
|
||||||
|
null -> first ?: ""
|
||||||
|
first -> second
|
||||||
|
else -> "$first -> $second"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val changeSubjectName: String
|
||||||
|
get() = changeText(subjectName, oldSubjectName)
|
||||||
|
|
||||||
|
val isSubjectNameChanged: Boolean
|
||||||
|
get() = type == TYPE_CHANGE && subjectName != oldSubjectName
|
||||||
|
|
||||||
|
|
||||||
|
val changeTeacherName: String
|
||||||
|
get() = changeText(teacherName, oldTeacherName)
|
||||||
|
|
||||||
|
val isTeacherNameChanged: Boolean
|
||||||
|
get() = type == TYPE_CHANGE && teacherName != oldTeacherName
|
||||||
|
|
||||||
|
|
||||||
|
val changeClassroom: String
|
||||||
|
get() = changeText(classroom, oldClassroom)
|
||||||
|
|
||||||
|
val isClassroomChanged: Boolean
|
||||||
|
get() = type == TYPE_CHANGE && classroom != oldClassroom
|
||||||
|
|
||||||
// metadata
|
// metadata
|
||||||
var seen: Boolean = false
|
var seen: Boolean = false
|
||||||
var notified: Boolean = false
|
var notified: Boolean = false
|
||||||
|
@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Kacper Ziubryniewicz 2019-11-30
|
||||||
|
*/
|
||||||
|
|
||||||
|
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.data.db.modules.events.EventFull
|
||||||
|
import pl.szczodrzynski.edziennik.databinding.RowDialogEventListItemBinding
|
||||||
|
import pl.szczodrzynski.edziennik.utils.Utils.bs
|
||||||
|
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||||
|
|
||||||
|
class EventListAdapter(
|
||||||
|
val context: Context,
|
||||||
|
val eventList: List<EventFull>,
|
||||||
|
val parentDialog: EventListDialog
|
||||||
|
) : RecyclerView.Adapter<EventListAdapter.ViewHolder>() {
|
||||||
|
|
||||||
|
private val app by lazy { context.applicationContext as App }
|
||||||
|
|
||||||
|
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)
|
||||||
|
return ViewHolder(view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||||
|
val event = eventList[position]
|
||||||
|
|
||||||
|
holder.apply {
|
||||||
|
b.eventListItemRoot.background.colorFilter = when (event.type) {
|
||||||
|
Event.TYPE_HOMEWORK -> PorterDuffColorFilter((0xffffffff).toInt(), PorterDuff.Mode.CLEAR)
|
||||||
|
else -> PorterDuffColorFilter(event.color, PorterDuff.Mode.MULTIPLY)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.eventListItemStartTime.text = if (event.startTime == null) app.getString(R.string.event_all_day) else event.startTime?.stringHM
|
||||||
|
b.eventListItemTeamName.text = bs(event.teamName)
|
||||||
|
b.eventListItemTeacherName.text = app.getString(R.string.concat_2_strings, bs(null, event.teacherFullName, "\n"), bs(event.subjectLongName))
|
||||||
|
b.eventListItemAddedDate.text = Date.fromMillis(event.addedDate).formattedStringShort
|
||||||
|
b.eventListItemType.text = event.typeName
|
||||||
|
b.eventListItemTopic.text = event.topic
|
||||||
|
b.eventListItemHomework.visibility = if (event.type == Event.TYPE_HOMEWORK) View.VISIBLE else View.GONE
|
||||||
|
b.eventListItemSharedBy.text = app.getString(R.string.event_shared_by_format, if (event.sharedBy == "self") app.getString(R.string.event_shared_by_self) else event.sharedByName)
|
||||||
|
b.eventListItemSharedBy.visibility = if (event.sharedByName.isNullOrBlank()) View.GONE else View.VISIBLE
|
||||||
|
|
||||||
|
b.eventListItemEdit.visibility = if (event.addedManually) View.VISIBLE else View.GONE
|
||||||
|
b.eventListItemEdit.setOnClickListener {
|
||||||
|
parentDialog.dismiss()
|
||||||
|
|
||||||
|
EventManualV2Dialog(
|
||||||
|
context as MainActivity,
|
||||||
|
event.profileId,
|
||||||
|
editingEvent = event,
|
||||||
|
onShowListener = parentDialog.onShowListener,
|
||||||
|
onDismissListener = parentDialog.onDismissListener
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = eventList.size
|
||||||
|
|
||||||
|
class ViewHolder(val b: RowDialogEventListItemBinding) : RecyclerView.ViewHolder(b.root)
|
||||||
|
}
|
@ -3,14 +3,15 @@ package pl.szczodrzynski.edziennik.ui.dialogs.event;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.mikepenz.iconics.view.IconicsImageView;
|
import com.mikepenz.iconics.view.IconicsImageView;
|
||||||
import com.mikepenz.iconics.view.IconicsTextView;
|
import com.mikepenz.iconics.view.IconicsTextView;
|
||||||
|
|
||||||
@ -20,21 +21,21 @@ import pl.szczodrzynski.edziennik.App;
|
|||||||
import pl.szczodrzynski.edziennik.R;
|
import pl.szczodrzynski.edziennik.R;
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.events.Event;
|
import pl.szczodrzynski.edziennik.data.db.modules.events.Event;
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull;
|
import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull;
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
|
||||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||||
|
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||||
|
|
||||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK;
|
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK;
|
||||||
import static pl.szczodrzynski.edziennik.utils.Utils.bs;
|
import static pl.szczodrzynski.edziennik.utils.Utils.bs;
|
||||||
import static pl.szczodrzynski.edziennik.utils.Utils.d;
|
import static pl.szczodrzynski.edziennik.utils.Utils.d;
|
||||||
|
|
||||||
public class EventListAdapter extends RecyclerView.Adapter<EventListAdapter.ViewHolder> {
|
public class EventListAdapterOld extends RecyclerView.Adapter<EventListAdapterOld.ViewHolder> {
|
||||||
private static final String TAG = "EventListAdapter";
|
private static final String TAG = "EventListAdapterOld";
|
||||||
private Context context;
|
private Context context;
|
||||||
private List<EventFull> examList;
|
private List<EventFull> examList;
|
||||||
private EventListDialog parentDialog;
|
private EventListDialogOld parentDialog;
|
||||||
|
|
||||||
//getting the context and product list with constructor
|
//getting the context and product list with constructor
|
||||||
public EventListAdapter(Context mCtx, List<EventFull> examList, EventListDialog parentDialog) {
|
public EventListAdapterOld(Context mCtx, List<EventFull> examList, EventListDialogOld parentDialog) {
|
||||||
this.context = mCtx;
|
this.context = mCtx;
|
||||||
this.examList = examList;
|
this.examList = examList;
|
||||||
this.parentDialog = parentDialog;
|
this.parentDialog = parentDialog;
|
||||||
@ -42,15 +43,15 @@ public class EventListAdapter extends RecyclerView.Adapter<EventListAdapter.View
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public EventListAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public EventListAdapterOld.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
//inflating and returning our view holder
|
//inflating and returning our view holder
|
||||||
LayoutInflater inflater = LayoutInflater.from(context);
|
LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
View view = inflater.inflate(R.layout.row_dialog_event_list_item, parent, false);
|
View view = inflater.inflate(R.layout.row_dialog_event_list_item, parent, false);
|
||||||
return new EventListAdapter.ViewHolder(view);
|
return new EventListAdapterOld.ViewHolder(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull EventListAdapter.ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull EventListAdapterOld.ViewHolder holder, int position) {
|
||||||
App app = (App) context.getApplicationContext();
|
App app = (App) context.getApplicationContext();
|
||||||
|
|
||||||
EventFull event = examList.get(position);
|
EventFull event = examList.get(position);
|
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Kacper Ziubryniewicz 2019-11-30
|
||||||
|
*/
|
||||||
|
|
||||||
|
package pl.szczodrzynski.edziennik.ui.dialogs.event
|
||||||
|
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.view.View
|
||||||
|
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.data.db.modules.timetable.Lesson
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.modules.timetable.LessonFull
|
||||||
|
import pl.szczodrzynski.edziennik.databinding.DialogEventListBinding
|
||||||
|
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||||
|
import pl.szczodrzynski.edziennik.utils.models.Time
|
||||||
|
import kotlin.coroutines.CoroutineContext
|
||||||
|
|
||||||
|
class EventListDialog(
|
||||||
|
val activity: AppCompatActivity,
|
||||||
|
val profileId: Int,
|
||||||
|
val date: Date,
|
||||||
|
val time: Time? = null,
|
||||||
|
val onShowListener: ((tag: String) -> Unit)? = null,
|
||||||
|
val onDismissListener: ((tag: String) -> Unit)? = null
|
||||||
|
) : CoroutineScope {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val TAG = "EventListDialog"
|
||||||
|
}
|
||||||
|
|
||||||
|
private lateinit var job: Job
|
||||||
|
override val coroutineContext: CoroutineContext
|
||||||
|
get() = job + Dispatchers.Main
|
||||||
|
|
||||||
|
private val app by lazy { activity.application as App }
|
||||||
|
private lateinit var b: DialogEventListBinding
|
||||||
|
private lateinit var dialog: AlertDialog
|
||||||
|
|
||||||
|
private var lesson: LessonFull? = null
|
||||||
|
|
||||||
|
init {
|
||||||
|
run {
|
||||||
|
if (activity.isFinishing)
|
||||||
|
return@run
|
||||||
|
job = Job()
|
||||||
|
onShowListener?.invoke(TAG)
|
||||||
|
b = DialogEventListBinding.inflate(activity.layoutInflater)
|
||||||
|
|
||||||
|
dialog = MaterialAlertDialogBuilder(activity)
|
||||||
|
.setTitle(date.formattedString + (time?.let { ", " + it.stringHM } ?: ""))
|
||||||
|
.setView(b.root)
|
||||||
|
.setPositiveButton(R.string.close) { dialog, _ -> dialog.dismiss() }
|
||||||
|
.setNeutralButton(R.string.add) { _, _ ->
|
||||||
|
EventManualV2Dialog(
|
||||||
|
activity,
|
||||||
|
lesson?.profileId ?: profileId,
|
||||||
|
lesson,
|
||||||
|
onShowListener = onShowListener,
|
||||||
|
onDismissListener = onDismissListener
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.setOnDismissListener {
|
||||||
|
onDismissListener?.invoke(TAG)
|
||||||
|
}
|
||||||
|
.show()
|
||||||
|
|
||||||
|
app.db.timetableDao().getForDate(profileId, date).observe(activity, Observer { lessons ->
|
||||||
|
lesson = lessons.firstOrNull { it.displayStartTime == time }
|
||||||
|
update()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun dismiss() = dialog.dismiss()
|
||||||
|
|
||||||
|
private fun update() {
|
||||||
|
b.eventListLessonDetails.visibility = if (lesson == null) View.GONE else View.VISIBLE
|
||||||
|
|
||||||
|
if (lesson != null) {
|
||||||
|
dialog.setTitle(if (time == null) date.formattedString else (lesson?.displaySubjectName
|
||||||
|
?: date.formattedString) + ", " + time.stringHM)
|
||||||
|
|
||||||
|
b.eventListLessonDate.text = app.getString(R.string.date_time_format, date.formattedString, "")
|
||||||
|
|
||||||
|
if (lesson?.type == Lesson.TYPE_CANCELLED) {
|
||||||
|
b.eventListLessonChange.text = app.getString(R.string.lesson_cancelled)
|
||||||
|
b.eventListLessonChange.setTypeface(null, Typeface.BOLD_ITALIC)
|
||||||
|
b.eventListTeacher.visibility = View.GONE
|
||||||
|
b.eventListClassroom.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
b.eventListLessonChange.text = lesson?.changeSubjectName
|
||||||
|
b.eventListLessonChange.setTypeface(null, Typeface.ITALIC)
|
||||||
|
b.eventListLessonChange.visibility = if (lesson?.isSubjectNameChanged == true) View.VISIBLE else View.GONE
|
||||||
|
|
||||||
|
b.eventListTeacher.text = lesson?.changeTeacherName
|
||||||
|
b.eventListTeacher.setTypeface(null, if (lesson?.isTeacherNameChanged == true) Typeface.ITALIC else Typeface.NORMAL)
|
||||||
|
|
||||||
|
b.eventListClassroom.text = lesson?.changeClassroom
|
||||||
|
b.eventListClassroom.setTypeface(null, if (lesson?.isClassroomChanged == true) Typeface.ITALIC else Typeface.NORMAL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
b.eventListView.apply {
|
||||||
|
setHasFixedSize(false)
|
||||||
|
isNestedScrollingEnabled = true
|
||||||
|
layoutManager = LinearLayoutManager(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
app.db.eventDao().getAllByDateTime(profileId, date, time).observe(activity, Observer { events ->
|
||||||
|
if (events.isNullOrEmpty()) {
|
||||||
|
b.eventListView.visibility = View.GONE
|
||||||
|
b.textNoEvents.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
val adapter = EventListAdapter(activity, events, this)
|
||||||
|
b.eventListView.adapter = adapter
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -8,14 +8,14 @@ import android.view.View;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.lifecycle.LifecycleOwner;
|
import androidx.lifecycle.LifecycleOwner;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
|
|
||||||
import pl.szczodrzynski.edziennik.App;
|
import pl.szczodrzynski.edziennik.App;
|
||||||
import pl.szczodrzynski.edziennik.R;
|
import pl.szczodrzynski.edziennik.R;
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange;
|
import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange;
|
||||||
@ -26,16 +26,16 @@ import pl.szczodrzynski.edziennik.ui.dialogs.teacherabsence.TeacherAbsenceDialog
|
|||||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||||
|
|
||||||
public class EventListDialog {
|
public class EventListDialogOld {
|
||||||
private App app;
|
private App app;
|
||||||
private Context context;
|
private Context context;
|
||||||
private int profileId;
|
private int profileId;
|
||||||
|
|
||||||
public EventListDialog(Context context) {
|
public EventListDialogOld(Context context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.profileId = App.profileId;
|
this.profileId = App.profileId;
|
||||||
}
|
}
|
||||||
public EventListDialog(Context context, int profileId) {
|
public EventListDialogOld(Context context, int profileId) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.profileId = profileId;
|
this.profileId = profileId;
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ public class EventListDialog {
|
|||||||
public boolean callDismissListener = true;
|
public boolean callDismissListener = true;
|
||||||
private LessonFull lesson;
|
private LessonFull lesson;
|
||||||
|
|
||||||
public EventListDialog withDismissListener(DialogInterface.OnDismissListener dismissListener) {
|
public EventListDialogOld withDismissListener(DialogInterface.OnDismissListener dismissListener) {
|
||||||
this.dismissListener = dismissListener;
|
this.dismissListener = dismissListener;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ public class EventListDialog {
|
|||||||
dialogView.findViewById(R.id.textNoEvents).setVisibility(View.VISIBLE);
|
dialogView.findViewById(R.id.textNoEvents).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
EventListAdapter adapter = new EventListAdapter(context, events, this);
|
EventListAdapterOld adapter = new EventListAdapterOld(context, events, this);
|
||||||
examsView.setAdapter(adapter);
|
examsView.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -194,6 +194,8 @@ class EventManualV2Dialog(
|
|||||||
b.teamDropdown.select(it.teamId)
|
b.teamDropdown.select(it.teamId)
|
||||||
b.subjectDropdown.select(it.subjectId)
|
b.subjectDropdown.select(it.subjectId)
|
||||||
b.teacherDropdown.select(it.teacherId)
|
b.teacherDropdown.select(it.teacherId)
|
||||||
|
b.topic.setText(it.topic)
|
||||||
|
b.shareSwitch.isChecked = true
|
||||||
b.typeDropdown.select(it.type)?.let { item ->
|
b.typeDropdown.select(it.type)?.let { item ->
|
||||||
customColor = (item.tag as EventType).color
|
customColor = (item.tag as EventType).color
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ public class AgendaFragment extends Fragment {
|
|||||||
int scrolledDate = Date.fromCalendar(calendar).getValue();
|
int scrolledDate = Date.fromCalendar(calendar).getValue();
|
||||||
if (unreadEventDates.contains(scrolledDate)) {
|
if (unreadEventDates.contains(scrolledDate)) {
|
||||||
AsyncTask.execute(() -> app.db.eventDao().setSeenByDate(App.profileId, Date.fromYmd(intToStr(scrolledDate)), true));
|
AsyncTask.execute(() -> app.db.eventDao().setSeenByDate(App.profileId, Date.fromYmd(intToStr(scrolledDate)), true));
|
||||||
unreadEventDates.remove(unreadEventDates.indexOf(scrolledDate));
|
unreadEventDates.remove((Integer) scrolledDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,9 +319,23 @@ public class AgendaFragment extends Fragment {
|
|||||||
public void onEventSelected(CalendarEvent calendarEvent) {
|
public void onEventSelected(CalendarEvent calendarEvent) {
|
||||||
if (calendarEvent instanceof BaseCalendarEvent) {
|
if (calendarEvent instanceof BaseCalendarEvent) {
|
||||||
if (!calendarEvent.isPlaceholder() && !calendarEvent.isAllDay()) {
|
if (!calendarEvent.isPlaceholder() && !calendarEvent.isAllDay()) {
|
||||||
new EventListDialog(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()), Time.fromMillis(calendarEvent.getStartTime().getTimeInMillis()), true);
|
// new EventListDialogOld(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()), Time.fromMillis(calendarEvent.getStartTime().getTimeInMillis()), true);
|
||||||
|
new EventListDialog(
|
||||||
|
activity,
|
||||||
|
App.profileId,
|
||||||
|
Date.fromCalendar(calendarEvent.getInstanceDay()),
|
||||||
|
Time.fromMillis(calendarEvent.getStartTime().getTimeInMillis()),
|
||||||
|
null,
|
||||||
|
null);
|
||||||
} else {
|
} else {
|
||||||
new EventListDialog(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()));
|
// new EventListDialogOld(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()));
|
||||||
|
new EventListDialog(
|
||||||
|
activity,
|
||||||
|
App.profileId,
|
||||||
|
Date.fromCalendar(calendarEvent.getInstanceDay()),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
} else if (calendarEvent instanceof LessonChangeEvent) {
|
} else if (calendarEvent instanceof LessonChangeEvent) {
|
||||||
new LessonChangeDialog(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()));
|
new LessonChangeDialog(activity).show(app, Date.fromCalendar(calendarEvent.getInstanceDay()));
|
||||||
@ -403,10 +417,18 @@ public class AgendaFragment extends Fragment {
|
|||||||
int scrolledDate = dayDate.getValue();
|
int scrolledDate = dayDate.getValue();
|
||||||
if (unreadEventDates.contains(scrolledDate)) {
|
if (unreadEventDates.contains(scrolledDate)) {
|
||||||
AsyncTask.execute(() -> app.db.eventDao().setSeenByDate(App.profileId, Date.fromYmd(intToStr(scrolledDate)), true));
|
AsyncTask.execute(() -> app.db.eventDao().setSeenByDate(App.profileId, Date.fromYmd(intToStr(scrolledDate)), true));
|
||||||
unreadEventDates.remove(unreadEventDates.indexOf(scrolledDate));
|
unreadEventDates.remove((Integer) scrolledDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
new EventListDialog(getContext()).show(app, dayDate);
|
// new EventListDialogOld(getContext()).show(app, dayDate);
|
||||||
|
new EventListDialog(
|
||||||
|
activity,
|
||||||
|
App.profileId,
|
||||||
|
dayDate,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
});
|
});
|
||||||
b_calendar.progressBar.setVisibility(View.GONE);
|
b_calendar.progressBar.setVisibility(View.GONE);
|
||||||
});
|
});
|
||||||
|
@ -224,8 +224,8 @@ class HomeTimetableCard(
|
|||||||
|
|
||||||
private val LessonFull?.subjectSpannable: CharSequence
|
private val LessonFull?.subjectSpannable: CharSequence
|
||||||
get() = if (this == null) "?" else when {
|
get() = if (this == null) "?" else when {
|
||||||
isCancelled -> displaySubjectName.asStrikethroughSpannable()
|
isCancelled -> displaySubjectName?.asStrikethroughSpannable() ?: "?"
|
||||||
isChange -> displaySubjectName.asItalicSpannable()
|
isChange -> displaySubjectName?.asItalicSpannable() ?: "?"
|
||||||
else -> displaySubjectName ?: "?"
|
else -> displaySubjectName ?: "?"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,16 +5,17 @@ import android.graphics.PorterDuff;
|
|||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.cardview.widget.CardView;
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.mikepenz.iconics.IconicsColor;
|
import com.mikepenz.iconics.IconicsColor;
|
||||||
import com.mikepenz.iconics.IconicsDrawable;
|
import com.mikepenz.iconics.IconicsDrawable;
|
||||||
import com.mikepenz.iconics.IconicsSize;
|
import com.mikepenz.iconics.IconicsSize;
|
||||||
@ -27,11 +28,11 @@ import pl.szczodrzynski.edziennik.R;
|
|||||||
import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull;
|
import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull;
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange;
|
import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange;
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull;
|
import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull;
|
||||||
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog;
|
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialogOld;
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
|
||||||
import pl.szczodrzynski.edziennik.utils.SpannableHtmlTagHandler;
|
import pl.szczodrzynski.edziennik.utils.SpannableHtmlTagHandler;
|
||||||
import pl.szczodrzynski.edziennik.utils.Themes;
|
import pl.szczodrzynski.edziennik.utils.Themes;
|
||||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||||
|
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||||
|
|
||||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK;
|
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK;
|
||||||
|
|
||||||
@ -159,7 +160,7 @@ public class TimetableAdapter extends RecyclerView.Adapter<TimetableAdapter.View
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.timetableItemCard.setOnClickListener(v -> new EventListDialog(context).show(app, lessonDate, lesson.startTime));
|
holder.timetableItemCard.setOnClickListener(v -> new EventListDialogOld(context).show(app, lessonDate, lesson.startTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,13 +11,13 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import pl.szczodrzynski.edziennik.App;
|
import pl.szczodrzynski.edziennik.App;
|
||||||
import pl.szczodrzynski.edziennik.R;
|
|
||||||
import pl.szczodrzynski.edziennik.MainActivity;
|
import pl.szczodrzynski.edziennik.MainActivity;
|
||||||
|
import pl.szczodrzynski.edziennik.R;
|
||||||
import pl.szczodrzynski.edziennik.WidgetTimetable;
|
import pl.szczodrzynski.edziennik.WidgetTimetable;
|
||||||
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog;
|
import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialogOld;
|
||||||
|
import pl.szczodrzynski.edziennik.utils.Themes;
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||||
import pl.szczodrzynski.edziennik.utils.Themes;
|
|
||||||
|
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT;
|
import static android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ public class LessonDetailsActivity extends AppCompatActivity {
|
|||||||
Time startTime = Time.fromHms(extras.getString("startTime", "20181109"));
|
Time startTime = Time.fromHms(extras.getString("startTime", "20181109"));
|
||||||
//Time endTime = Time.fromHms(extras.getString("endTime", "20181109"));
|
//Time endTime = Time.fromHms(extras.getString("endTime", "20181109"));
|
||||||
|
|
||||||
new EventListDialog(this, profileId)
|
new EventListDialogOld(this, profileId)
|
||||||
.withDismissListener((dialog -> {
|
.withDismissListener((dialog -> {
|
||||||
finish();
|
finish();
|
||||||
Intent intent = new Intent(app.getContext(), WidgetTimetable.class);
|
Intent intent = new Intent(app.getContext(), WidgetTimetable.class);
|
||||||
|
@ -1,99 +1,98 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<layout>
|
||||||
android:layout_width="match_parent"
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/detailsLayout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
<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="24dp"
|
|
||||||
android:layout_marginRight="24dp"
|
|
||||||
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="24dp"
|
|
||||||
android:layout_marginRight="24dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/eventListLessonDetails"
|
android:id="@+id/detailsLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="24dp"
|
|
||||||
android:layout_marginRight="24dp"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<include
|
||||||
android:id="@+id/eventListLessonDate"
|
android:id="@+id/lessonChangeContainer"
|
||||||
|
layout="@layout/row_lesson_change_item"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="21 października 2018, 9:05" />
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_marginLeft="24dp"
|
||||||
|
android:layout_marginRight="24dp"
|
||||||
|
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="24dp"
|
||||||
|
android:layout_marginRight="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/eventListLessonDetails"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="24dp"
|
||||||
|
android:layout_marginRight="24dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListLessonDate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="21 października 2018, 9:05" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListLessonChange"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="italic"
|
||||||
|
tools:text="Lekcja odwołana" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListTeacher"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="italic"
|
||||||
|
tools:text="Jan Kowalski -> John Doe" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListClassroom"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="italic"
|
||||||
|
tools:text="029 informatyczna -> 016 językowa" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/eventListLessonChange"
|
android:id="@+id/textNoEvents"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_margin="32dp"
|
||||||
|
android:text="@string/dialog_event_list_no_data"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
tools:text="Lekcja odwołana" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/eventListTeacher"
|
android:id="@+id/eventListView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="italic"
|
android:layout_marginTop="8dp"
|
||||||
tools:text="Jan Kowalski -> John Doe" />
|
android:clipToPadding="false"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
<TextView
|
android:paddingTop="8dp"
|
||||||
android:id="@+id/eventListClassroom"
|
android:paddingRight="24dp"
|
||||||
android:layout_width="match_parent"
|
android:paddingBottom="8dp"
|
||||||
android:layout_height="wrap_content"
|
tools:listitem="@layout/row_dialog_event_list_item" />
|
||||||
android:textStyle="italic"
|
|
||||||
tools:text="029 informatyczna -> 016 językowa" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
<TextView
|
</layout>
|
||||||
android:id="@+id/textNoEvents"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_margin="32dp"
|
|
||||||
android:text="@string/dialog_event_list_no_data"
|
|
||||||
android:textStyle="italic"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/eventListView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:paddingLeft="24dp"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingRight="24dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
tools:listitem="@layout/row_dialog_event_list_item" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:agendaCalendar="http://schemas.android.com/apk/res-auto"
|
xmlns:agendaCalendar="http://schemas.android.com/apk/res-auto">
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -33,8 +32,5 @@
|
|||||||
agendaCalendar:layout_constraintTop_toTopOf="parent"
|
agendaCalendar:layout_constraintTop_toTopOf="parent"
|
||||||
agendaCalendar:layout_constraintVertical_bias="1.0" >
|
agendaCalendar:layout_constraintVertical_bias="1.0" >
|
||||||
</com.github.tibolte.agendacalendarview.AgendaCalendarView>
|
</com.github.tibolte.agendacalendarview.AgendaCalendarView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -1,166 +1,165 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout>
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:orientation="vertical">
|
||||||
app:cardCornerRadius="8dp"
|
|
||||||
app:cardElevation="4dp">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/eventListItemRoot"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_rounded_8dp_outline"
|
android:layout_margin="5dp"
|
||||||
android:padding="8dp">
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout"
|
android:id="@+id/eventListItemRoot"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:background="@drawable/bg_rounded_8dp_outline"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:padding="8dp">
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<com.mikepenz.iconics.view.IconicsTextView
|
||||||
|
android:id="@+id/eventListItemClock"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="{cmd-clock}"
|
||||||
|
tools:text=" "
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/eventListItemTeamName" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListItemStartTime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/eventListItemClock"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/eventListItemTeamName"
|
||||||
|
tools:text="startTime" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListItemAddedDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView9"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView9"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/event_added_time"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/eventListItemClock" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListItemTeamName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="TextView" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListItemTeacherName"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/eventListItemEdit"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/eventListItemHomework"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="TextView\nTextView" />
|
||||||
|
|
||||||
|
<com.mikepenz.iconics.view.IconicsImageView
|
||||||
|
android:id="@+id/eventListItemEdit"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:iiv_color="?android:textColorSecondary"
|
||||||
|
app:iiv_icon="cmd-pencil"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:srcCompat="@android:drawable/ic_partial_secure" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListItemType"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/eventListItemTeacherName"
|
||||||
|
tools:text="zadanie domowe" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/eventListItemTopic"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Medium"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:autoLink="all"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/eventListItemType"
|
||||||
|
tools:text="TextView" />
|
||||||
|
|
||||||
<com.mikepenz.iconics.view.IconicsTextView
|
<com.mikepenz.iconics.view.IconicsTextView
|
||||||
android:id="@+id/eventListItemClock"
|
android:id="@+id/eventListItemSharedBy"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="{cmd-clock}"
|
android:layout_marginStart="8dp"
|
||||||
tools:text=" "
|
android:layout_marginLeft="8dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_marginTop="8dp"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/eventListItemTeamName" />
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
tools:text="{cmd-share-variant} przez Jan Kowalski"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/eventListItemTopic" />
|
||||||
|
|
||||||
<TextView
|
<com.mikepenz.iconics.view.IconicsImageView
|
||||||
android:id="@+id/eventListItemStartTime"
|
android:id="@+id/eventListItemHomework"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="32dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="32dp"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="8dp"
|
||||||
app:layout_constraintStart_toEndOf="@+id/eventListItemClock"
|
android:visibility="gone"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/eventListItemTeamName"
|
app:iiv_color="?android:textColorSecondary"
|
||||||
tools:text="startTime" />
|
app:iiv_icon="cmd-home"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/eventListItemTeacherName"
|
||||||
<TextView
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||||
android:id="@+id/eventListItemAddedDate"
|
app:layout_constraintTop_toTopOf="@+id/eventListItemTeacherName"
|
||||||
android:layout_width="wrap_content"
|
tools:src="@android:drawable/star_big_on" />
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView9"
|
|
||||||
tools:text="TextView" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView9"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/event_added_time"
|
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/eventListItemClock" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/eventListItemTeamName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:text="TextView" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:id="@+id/eventListItemTeacherName"
|
</layout>
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/eventListItemEdit"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/eventListItemHomework"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:text="TextView\nTextView" />
|
|
||||||
|
|
||||||
<com.mikepenz.iconics.view.IconicsImageView
|
|
||||||
android:id="@+id/eventListItemEdit"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:visibility="visible"
|
|
||||||
app:iiv_color="?android:textColorSecondary"
|
|
||||||
app:iiv_icon="cmd-pencil"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:srcCompat="@android:drawable/ic_partial_secure" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/eventListItemType"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/eventListItemTeacherName"
|
|
||||||
tools:text="zadanie domowe" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/eventListItemTopic"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:textAppearance="@style/NavView.TextView.Medium"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:autoLink="all"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/eventListItemType"
|
|
||||||
tools:text="TextView" />
|
|
||||||
|
|
||||||
<com.mikepenz.iconics.view.IconicsTextView
|
|
||||||
android:id="@+id/eventListItemSharedBy"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
tools:text="{cmd-share-variant} przez Jan Kowalski"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/eventListItemTopic" />
|
|
||||||
|
|
||||||
<com.mikepenz.iconics.view.IconicsImageView
|
|
||||||
android:id="@+id/eventListItemHomework"
|
|
||||||
android:layout_width="32dp"
|
|
||||||
android:layout_height="32dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:iiv_color="?android:textColorSecondary"
|
|
||||||
app:iiv_icon="cmd-home"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/eventListItemTeacherName"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/eventListItemTeacherName"
|
|
||||||
tools:src="@android:drawable/star_big_on" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
@ -1056,4 +1056,5 @@
|
|||||||
<string name="home_timetable_lesson_not_started">Za chwilę: %s</string>
|
<string name="home_timetable_lesson_not_started">Za chwilę: %s</string>
|
||||||
<string name="home_timetable_lessons_remaining">Pozostało lekcji: %d - do %s</string>
|
<string name="home_timetable_lessons_remaining">Pozostało lekcji: %d - do %s</string>
|
||||||
<string name="grade_subject_format">z %s</string>
|
<string name="grade_subject_format">z %s</string>
|
||||||
|
<string name="concat_2_strings" translatable="false">%s%s</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user