forked from github/szkolny
[UI/Timetable] Update date selection algorithm and no lessons info. Show empty timetable info in widget.
This commit is contained in:
parent
b66bd6fec9
commit
0aae2174c1
@ -99,12 +99,6 @@
|
|||||||
__/ |
|
__/ |
|
||||||
|_
|
|_
|
||||||
-->
|
-->
|
||||||
<activity
|
|
||||||
android:name=".widgets.timetable.LessonDetailsActivity"
|
|
||||||
android:configChanges="orientation|keyboardHidden"
|
|
||||||
android:excludeFromRecents="true"
|
|
||||||
android:noHistory="true"
|
|
||||||
android:theme="@style/AppTheme.NoDisplay" />
|
|
||||||
<activity android:name=".widgets.timetable.LessonDialogActivity"
|
<activity android:name=".widgets.timetable.LessonDialogActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
|
@ -43,6 +43,8 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
super.onReceive(context, intent)
|
super.onReceive(context, intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val ignoreCancelled = true
|
||||||
|
|
||||||
override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {
|
override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {
|
||||||
val thisWidget = ComponentName(context, WidgetTimetable::class.java)
|
val thisWidget = ComponentName(context, WidgetTimetable::class.java)
|
||||||
|
|
||||||
@ -122,7 +124,7 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
val method = declaredMethods[m]
|
val method = declaredMethods[m]
|
||||||
if (method.name == "setDrawableParameters") {
|
if (method.name == "setDrawableParameters") {
|
||||||
method.isAccessible = true
|
method.isAccessible = true
|
||||||
method.invoke(views, R.id.widgetTimetableListView, true, -1, colorFilter.toInt(), mode, -1)
|
method.invoke(views, R.id.widgetTimetableBackground, true, -1, colorFilter.toInt(), mode, -1)
|
||||||
method.invoke(views, R.id.widgetTimetableHeader, true, -1, colorFilter.toInt(), mode, -1)
|
method.invoke(views, R.id.widgetTimetableHeader, true, -1, colorFilter.toInt(), mode, -1)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -185,12 +187,30 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
// search for lessons to display
|
// search for lessons to display
|
||||||
val timetableDate = Date.getToday()
|
val timetableDate = Date.getToday()
|
||||||
var checkedDays = 0
|
var checkedDays = 0
|
||||||
var lessons = lessonList.filter { it.profileId == profile.id && it.displayDate == timetableDate && it.type != Lesson.TYPE_NO_LESSONS }
|
var lessons = lessonList.filter {
|
||||||
|
it.profileId == profile.id
|
||||||
|
&& it.displayDate == timetableDate
|
||||||
|
&& it.displayEndTime > now
|
||||||
|
&& !(it.isCancelled && ignoreCancelled)
|
||||||
|
}
|
||||||
while ((lessons.isEmpty() || lessons.none {
|
while ((lessons.isEmpty() || lessons.none {
|
||||||
it.displayDate != today || (it.displayDate == today && it.displayEndTime != null && it.displayEndTime!! >= now)
|
it.type != Lesson.TYPE_NO_LESSONS
|
||||||
|
&& (it.displayDate != today
|
||||||
|
|| (it.displayDate == today
|
||||||
|
&& it.displayEndTime != null
|
||||||
|
&& it.displayEndTime!! >= now))
|
||||||
}) && checkedDays < 7) {
|
}) && checkedDays < 7) {
|
||||||
|
|
||||||
timetableDate.stepForward(0, 0, 1)
|
timetableDate.stepForward(0, 0, 1)
|
||||||
lessons = lessonList.filter { it.profileId == profile.id && it.displayDate == timetableDate && it.type != Lesson.TYPE_NO_LESSONS }
|
lessons = lessonList.filter {
|
||||||
|
it.profileId == profile.id
|
||||||
|
&& it.displayDate == timetableDate
|
||||||
|
&& !(it.isCancelled && ignoreCancelled)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lessons.isEmpty() && timetableDate.weekDay <= 5)
|
||||||
|
break
|
||||||
|
|
||||||
checkedDays++
|
checkedDays++
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +219,32 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
if (lessons.isNotEmpty())
|
if (lessons.isNotEmpty())
|
||||||
displayingDate = timetableDate
|
displayingDate = timetableDate
|
||||||
profileId = profile.id
|
profileId = profile.id
|
||||||
|
if (lessons.isEmpty()) {
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableListView, View.GONE)
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableNoTimetable, View.VISIBLE)
|
||||||
|
}
|
||||||
|
if (lessons.size == 1 && lessons[0].type == Lesson.TYPE_NO_LESSONS) {
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableListView, View.GONE)
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableNoLessons, View.VISIBLE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (lessons.isEmpty()) {
|
||||||
|
val separator = ItemWidgetTimetableModel()
|
||||||
|
separator.profileId = profile.id
|
||||||
|
separator.bigStyle = widgetConfig.bigStyle
|
||||||
|
separator.darkTheme = widgetConfig.darkTheme
|
||||||
|
separator.isNoTimetableItem = true;
|
||||||
|
models.add(separator)
|
||||||
|
}
|
||||||
|
if (lessons.size == 1 && lessons[0].type == Lesson.TYPE_NO_LESSONS) {
|
||||||
|
val separator = ItemWidgetTimetableModel()
|
||||||
|
separator.profileId = profile.id
|
||||||
|
separator.bigStyle = widgetConfig.bigStyle
|
||||||
|
separator.darkTheme = widgetConfig.darkTheme
|
||||||
|
separator.isNoLessonsItem = true;
|
||||||
|
models.add(separator)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get all events for the current date
|
// get all events for the current date
|
||||||
@ -298,13 +344,6 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
val pendingOpenIntent = PendingIntent.getActivity(app, appWidgetId, openIntent, 0)
|
val pendingOpenIntent = PendingIntent.getActivity(app, appWidgetId, openIntent, 0)
|
||||||
views.setOnClickPendingIntent(R.id.widgetTimetableHeader, pendingOpenIntent)
|
views.setOnClickPendingIntent(R.id.widgetTimetableHeader, pendingOpenIntent)
|
||||||
|
|
||||||
if (lessonList.isEmpty()) {
|
|
||||||
views.setViewVisibility(R.id.widgetTimetableLoading, View.VISIBLE)
|
|
||||||
views.setRemoteAdapter(R.id.widgetTimetableListView, Intent())
|
|
||||||
views.setTextViewText(R.id.widgetTimetableLoading, app.getString(R.string.widget_timetable_no_lessons))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
timetables!!.put(appWidgetId, models)
|
timetables!!.put(appWidgetId, models)
|
||||||
|
|
||||||
// apply the list service to the list view
|
// apply the list service to the list view
|
||||||
@ -315,7 +354,7 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
|
|
||||||
// create an intent used to display the lesson details dialog
|
// create an intent used to display the lesson details dialog
|
||||||
val intentTemplate = Intent(app, LessonDialogActivity::class.java)
|
val intentTemplate = Intent(app, LessonDialogActivity::class.java)
|
||||||
intentTemplate.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
intentTemplate.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK /*or Intent.FLAG_ACTIVITY_CLEAR_TASK*/)
|
||||||
val pendingIntentTimetable = PendingIntent.getActivity(app, appWidgetId, intentTemplate, 0)
|
val pendingIntentTimetable = PendingIntent.getActivity(app, appWidgetId, intentTemplate, 0)
|
||||||
views.setPendingIntentTemplate(R.id.widgetTimetableListView, pendingIntentTimetable)
|
views.setPendingIntentTemplate(R.id.widgetTimetableListView, pendingIntentTimetable)
|
||||||
|
|
||||||
@ -336,11 +375,8 @@ class WidgetTimetable : AppWidgetProvider() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
const val ACTION_SYNC_DATA = "ACTION_SYNC_DATA"
|
||||||
|
private const val TAG = "WidgetTimetable"
|
||||||
val ACTION_SYNC_DATA = "ACTION_SYNC_DATA"
|
|
||||||
private val TAG = "WidgetTimetable"
|
|
||||||
private val modeInt = 0
|
|
||||||
|
|
||||||
var timetables: SparseArray<List<ItemWidgetTimetableModel>>? = null
|
var timetables: SparseArray<List<ItemWidgetTimetableModel>>? = null
|
||||||
|
|
||||||
|
@ -137,21 +137,26 @@ class HomeTimetableCard(
|
|||||||
it.profileId == profile.id
|
it.profileId == profile.id
|
||||||
&& it.displayDate == timetableDate
|
&& it.displayDate == timetableDate
|
||||||
&& it.displayEndTime > now
|
&& it.displayEndTime > now
|
||||||
&& it.type != Lesson.TYPE_NO_LESSONS
|
|
||||||
&& !(it.isCancelled && ignoreCancelled)
|
&& !(it.isCancelled && ignoreCancelled)
|
||||||
}
|
}
|
||||||
while ((lessons.isEmpty() || lessons.none {
|
while ((lessons.isEmpty() || lessons.none {
|
||||||
it.displayDate != today || (it.displayDate == today && it.displayEndTime != null && it.displayEndTime!! >= now)
|
it.type != Lesson.TYPE_NO_LESSONS
|
||||||
|
&& (it.displayDate != today
|
||||||
|
|| (it.displayDate == today
|
||||||
|
&& it.displayEndTime != null
|
||||||
|
&& it.displayEndTime!! >= now))
|
||||||
}) && checkedDays < 7) {
|
}) && checkedDays < 7) {
|
||||||
|
|
||||||
timetableDate.stepForward(0, 0, 1)
|
timetableDate.stepForward(0, 0, 1)
|
||||||
lessons = allLessons.filter {
|
lessons = allLessons.filter {
|
||||||
it.profileId == profile.id
|
it.profileId == profile.id
|
||||||
&& it.displayDate == timetableDate
|
&& it.displayDate == timetableDate
|
||||||
&& it.type != Lesson.TYPE_NO_LESSONS
|
|
||||||
&& !(it.isCancelled && ignoreCancelled)
|
&& !(it.isCancelled && ignoreCancelled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lessons.isEmpty() && timetableDate.weekDay <= 5)
|
||||||
|
break
|
||||||
|
|
||||||
checkedDays++
|
checkedDays++
|
||||||
}
|
}
|
||||||
timetableDate
|
timetableDate
|
||||||
@ -164,7 +169,7 @@ class HomeTimetableCard(
|
|||||||
b.timetableLayout.visibility = View.GONE
|
b.timetableLayout.visibility = View.GONE
|
||||||
b.noTimetableLayout.visibility = View.VISIBLE
|
b.noTimetableLayout.visibility = View.VISIBLE
|
||||||
b.noLessonsLayout.visibility = View.GONE
|
b.noLessonsLayout.visibility = View.GONE
|
||||||
val weekStart = timetableDate.clone().weekStart
|
val weekStart = timetableDate.weekStart
|
||||||
b.noTimetableText.setText(
|
b.noTimetableText.setText(
|
||||||
R.string.home_timetable_no_timetable_text,
|
R.string.home_timetable_no_timetable_text,
|
||||||
weekStart.stringY_m_d
|
weekStart.stringY_m_d
|
||||||
@ -188,6 +193,7 @@ class HomeTimetableCard(
|
|||||||
b.timetableLayout.visibility = View.GONE
|
b.timetableLayout.visibility = View.GONE
|
||||||
b.noTimetableLayout.visibility = View.GONE
|
b.noTimetableLayout.visibility = View.GONE
|
||||||
b.noLessonsLayout.visibility = View.VISIBLE
|
b.noLessonsLayout.visibility = View.VISIBLE
|
||||||
|
timetableDate = timetableDate.weekStart
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,4 +25,8 @@ public class ItemWidgetTimetableModel {
|
|||||||
public List<Integer> eventColors = new ArrayList<>();
|
public List<Integer> eventColors = new ArrayList<>();
|
||||||
public boolean bigStyle = false;
|
public boolean bigStyle = false;
|
||||||
public boolean darkTheme = false;
|
public boolean darkTheme = false;
|
||||||
|
|
||||||
|
public boolean isNoTimetableItem = false;
|
||||||
|
public boolean isNoLessonsItem = false;
|
||||||
|
public boolean isNotPublicItem = false;
|
||||||
}
|
}
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
package pl.szczodrzynski.edziennik.widgets.timetable;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import pl.szczodrzynski.edziennik.App;
|
|
||||||
import pl.szczodrzynski.edziennik.MainActivity;
|
|
||||||
import pl.szczodrzynski.edziennik.R;
|
|
||||||
import pl.szczodrzynski.edziennik.utils.Themes;
|
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
|
||||||
|
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT;
|
|
||||||
|
|
||||||
public class LessonDetailsActivity extends AppCompatActivity {
|
|
||||||
public LessonDetailsActivity() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
getWindow().setBackgroundDrawable(new ColorDrawable(0));
|
|
||||||
|
|
||||||
setTheme(Themes.INSTANCE.getAppThemeNoDisplay());
|
|
||||||
|
|
||||||
App app = (App)getApplication();
|
|
||||||
Bundle extras = getIntent().getExtras();
|
|
||||||
if (app != null && extras != null) {
|
|
||||||
int profileId = extras.getInt("profileId", -1);
|
|
||||||
|
|
||||||
if (extras.getBoolean("separatorItem", false)) {
|
|
||||||
Intent i = new Intent(this, MainActivity.class)
|
|
||||||
.putExtra("fragmentId", MainActivity.DRAWER_ITEM_TIMETABLE)
|
|
||||||
.putExtra("profileId", profileId)
|
|
||||||
.addFlags(FLAG_ACTIVITY_REORDER_TO_FRONT);
|
|
||||||
app.getContext().startActivity(i);
|
|
||||||
finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Date date = Date.fromYmd(extras.getString("date", "20181109"));
|
|
||||||
Time startTime = Time.fromHms(extras.getString("startTime", "20181109"));
|
|
||||||
//Time endTime = Time.fromHms(extras.getString("endTime", "20181109"));
|
|
||||||
|
|
||||||
/* new EventListDialogOld(this, profileId)
|
|
||||||
.withDismissListener((dialog -> {
|
|
||||||
finish();
|
|
||||||
Intent intent = new Intent(app.getContext(), WidgetTimetable.class);
|
|
||||||
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
|
|
||||||
int[] ids = AppWidgetManager.getInstance(app)
|
|
||||||
.getAppWidgetIds(new ComponentName(app, WidgetTimetable.class));
|
|
||||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
|
|
||||||
app.sendBroadcast(intent);
|
|
||||||
}))
|
|
||||||
.show(app, date, startTime); */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Toast.makeText(app, R.string.error_reading_lesson_details, Toast.LENGTH_SHORT).show();
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
@ -33,6 +33,8 @@ import pl.szczodrzynski.edziennik.utils.models.Date;
|
|||||||
import pl.szczodrzynski.edziennik.utils.models.ItemWidgetTimetableModel;
|
import pl.szczodrzynski.edziennik.utils.models.ItemWidgetTimetableModel;
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||||
|
|
||||||
|
import static android.util.TypedValue.COMPLEX_UNIT_SP;
|
||||||
|
|
||||||
public class WidgetTimetableListProvider implements RemoteViewsService.RemoteViewsFactory {
|
public class WidgetTimetableListProvider implements RemoteViewsService.RemoteViewsFactory {
|
||||||
|
|
||||||
private static final String TAG = "WidgetTimetableProvider";
|
private static final String TAG = "WidgetTimetableProvider";
|
||||||
@ -149,6 +151,8 @@ public class WidgetTimetableListProvider implements RemoteViewsService.RemoteVie
|
|||||||
views.setViewVisibility(R.id.widgetTimetableProfileName, View.VISIBLE);
|
views.setViewVisibility(R.id.widgetTimetableProfileName, View.VISIBLE);
|
||||||
views.setViewVisibility(R.id.widgetTimetableContent, View.GONE);
|
views.setViewVisibility(R.id.widgetTimetableContent, View.GONE);
|
||||||
views.setTextViewText(R.id.widgetTimetableProfileName, lesson.separatorProfileName);
|
views.setTextViewText(R.id.widgetTimetableProfileName, lesson.separatorProfileName);
|
||||||
|
views.setTextViewTextSize(R.id.widgetTimetableProfileName, COMPLEX_UNIT_SP, lesson.bigStyle ? 30 : 20);
|
||||||
|
views.setTextColor(R.id.widgetTimetableProfileName, lesson.darkTheme ? 0xff000000 : 0xffffffff);
|
||||||
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.putExtra("profileId", lesson.profileId);
|
intent.putExtra("profileId", lesson.profileId);
|
||||||
@ -158,6 +162,37 @@ public class WidgetTimetableListProvider implements RemoteViewsService.RemoteVie
|
|||||||
return views;
|
return views;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lesson.isNoTimetableItem) {
|
||||||
|
views.setImageViewBitmap(R.id.widgetTimetableBackground, null);
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableProfileName, View.VISIBLE);
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableContent, View.GONE);
|
||||||
|
views.setTextViewText(R.id.widgetTimetableProfileName, context.getString(R.string.widget_timetable_short_no_timetable));
|
||||||
|
views.setTextViewTextSize(R.id.widgetTimetableProfileName, COMPLEX_UNIT_SP, lesson.bigStyle ? 26 : 18);
|
||||||
|
views.setTextColor(R.id.widgetTimetableProfileName, lesson.darkTheme ? 0xffffffff : 0xff000000);
|
||||||
|
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra("profileId", lesson.profileId);
|
||||||
|
intent.putExtra("separatorItem", true);
|
||||||
|
intent.putExtra("isNoTimetableItem", true);
|
||||||
|
views.setOnClickFillInIntent(R.id.widgetTimetableRoot, intent);
|
||||||
|
return views;
|
||||||
|
}
|
||||||
|
if (lesson.isNoLessonsItem) {
|
||||||
|
views.setImageViewBitmap(R.id.widgetTimetableBackground, null);
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableProfileName, View.VISIBLE);
|
||||||
|
views.setViewVisibility(R.id.widgetTimetableContent, View.GONE);
|
||||||
|
views.setTextViewText(R.id.widgetTimetableProfileName, context.getString(R.string.widget_timetable_short_no_lessons));
|
||||||
|
views.setTextViewTextSize(R.id.widgetTimetableProfileName, COMPLEX_UNIT_SP, lesson.bigStyle ? 26 : 18);
|
||||||
|
views.setTextColor(R.id.widgetTimetableProfileName, lesson.darkTheme ? 0xffffffff : 0xff000000);
|
||||||
|
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra("profileId", lesson.profileId);
|
||||||
|
intent.putExtra("separatorItem", true);
|
||||||
|
intent.putExtra("isNoLessonsItem", true);
|
||||||
|
views.setOnClickFillInIntent(R.id.widgetTimetableRoot, intent);
|
||||||
|
return views;
|
||||||
|
}
|
||||||
|
|
||||||
views.setViewVisibility(R.id.widgetTimetableBackground, View.VISIBLE);
|
views.setViewVisibility(R.id.widgetTimetableBackground, View.VISIBLE);
|
||||||
views.setViewVisibility(R.id.widgetTimetableProfileName, View.GONE);
|
views.setViewVisibility(R.id.widgetTimetableProfileName, View.GONE);
|
||||||
views.setViewVisibility(R.id.widgetTimetableContent, View.VISIBLE);
|
views.setViewVisibility(R.id.widgetTimetableContent, View.VISIBLE);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -65,17 +64,18 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/widgetTimetableBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/widget_background_bottom">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/widgetTimetableListView"
|
android:id="@+id/widgetTimetableListView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:divider="@color/secondaryTextLight"
|
android:divider="@color/secondaryTextLight"
|
||||||
android:background="@drawable/widget_background_bottom"
|
android:dividerHeight="1.0dip"
|
||||||
android:dividerHeight="1.0dip" ><!--#b5ffffff-->
|
tools:listitem="@layout/row_widget_timetable_item"/><!--#b5ffffff-->
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/widgetTimetableLoading"
|
android:id="@+id/widgetTimetableLoading"
|
||||||
@ -84,7 +84,34 @@
|
|||||||
android:textColor="@color/primaryTextLight"
|
android:textColor="@color/primaryTextLight"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
android:text="@string/widget_loading" />
|
android:text="@string/widget_loading"
|
||||||
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoTimetable"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextLight"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="@string/widget_timetable_no_timetable"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoLessons"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextLight"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="@string/widget_timetable_no_lessons_found"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -65,17 +64,18 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/widgetTimetableBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/widget_background_bottom">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/widgetTimetableListView"
|
android:id="@+id/widgetTimetableListView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:divider="@color/secondaryTextLight"
|
android:divider="@color/secondaryTextLight"
|
||||||
android:background="@drawable/widget_background_bottom"
|
android:dividerHeight="1.0dip"
|
||||||
android:dividerHeight="1.0dip" ><!--#b5ffffff-->
|
tools:listitem="@layout/row_widget_timetable_big_item"/><!--#b5ffffff-->
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/widgetTimetableLoading"
|
android:id="@+id/widgetTimetableLoading"
|
||||||
@ -85,7 +85,34 @@
|
|||||||
android:text="@string/widget_loading"
|
android:text="@string/widget_loading"
|
||||||
android:textColor="@color/primaryTextLight"
|
android:textColor="@color/primaryTextLight"
|
||||||
android:textSize="22sp"
|
android:textSize="22sp"
|
||||||
android:textStyle="italic" />
|
android:textStyle="italic"
|
||||||
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoTimetable"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextLight"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="@string/widget_timetable_no_timetable"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoLessons"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextLight"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="@string/widget_timetable_no_lessons_found"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -65,17 +64,18 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/widgetTimetableBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/widget_background_dark_bottom">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/widgetTimetableListView"
|
android:id="@+id/widgetTimetableListView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:divider="@color/secondaryTextDark"
|
android:divider="@color/secondaryTextDark"
|
||||||
android:background="@drawable/widget_background_dark_bottom"
|
android:dividerHeight="1.0dip"
|
||||||
android:dividerHeight="1.0dip" ><!--#b5ffffff-->
|
tools:listitem="@layout/row_widget_timetable_dark_item"/><!--#b5ffffff-->
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/widgetTimetableLoading"
|
android:id="@+id/widgetTimetableLoading"
|
||||||
@ -84,7 +84,34 @@
|
|||||||
android:textColor="@color/primaryTextDark"
|
android:textColor="@color/primaryTextDark"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
android:text="@string/widget_loading" />
|
android:text="@string/widget_loading"
|
||||||
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoTimetable"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextLight"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="@string/widget_timetable_no_timetable"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoLessons"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextLight"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="@string/widget_timetable_no_lessons_found"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -65,17 +64,18 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/widgetTimetableBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/widget_background_dark_bottom">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/widgetTimetableListView"
|
android:id="@+id/widgetTimetableListView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:divider="@color/secondaryTextDark"
|
android:divider="@color/secondaryTextDark"
|
||||||
android:background="@drawable/widget_background_dark_bottom"
|
android:dividerHeight="1.0dip"
|
||||||
android:dividerHeight="1.0dip" ><!--#b5ffffff-->
|
tools:listitem="@layout/row_widget_timetable_dark_big_item"/><!--#b5ffffff-->
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/widgetTimetableLoading"
|
android:id="@+id/widgetTimetableLoading"
|
||||||
@ -85,7 +85,34 @@
|
|||||||
android:text="@string/widget_loading"
|
android:text="@string/widget_loading"
|
||||||
android:textColor="@color/primaryTextDark"
|
android:textColor="@color/primaryTextDark"
|
||||||
android:textSize="22sp"
|
android:textSize="22sp"
|
||||||
android:textStyle="italic" />
|
android:textStyle="italic"
|
||||||
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoTimetable"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextDark"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="@string/widget_timetable_no_timetable"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/widgetTimetableNoLessons"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:textColor="@color/primaryTextDark"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="@string/widget_timetable_no_lessons_found"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -1120,4 +1120,8 @@
|
|||||||
<string name="home_timetable_no_lessons_text">Przez następne 7 dni nie ma żadnych lekcji.</string>
|
<string name="home_timetable_no_lessons_text">Przez następne 7 dni nie ma żadnych lekcji.</string>
|
||||||
<string name="home_timetable_not_public">Brak planu lekcji</string>
|
<string name="home_timetable_not_public">Brak planu lekcji</string>
|
||||||
<string name="home_timetable_not_public_text">Plan lekcji nie został opublikowany przez szkołę.\n\nSkontaktuj się z wychowawcą.</string>
|
<string name="home_timetable_not_public_text">Plan lekcji nie został opublikowany przez szkołę.\n\nSkontaktuj się z wychowawcą.</string>
|
||||||
|
<string name="widget_timetable_no_timetable">Plan lekcji nie został pobrany.\n\nOtwórz aplikację i wykonaj synchronizację, aby pobrać plan lekcji.</string>
|
||||||
|
<string name="widget_timetable_no_lessons_found">Brak lekcji przez następne 7 dni.</string>
|
||||||
|
<string name="widget_timetable_short_no_timetable">Nie pobrano planu lekcji.</string>
|
||||||
|
<string name="widget_timetable_short_no_lessons">Brak lekcji przez nast. 7 dni.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user