mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-21 19:44:45 +01:00
Add a view of free days to the timetable (#57)
* Fix Timetable freeze when app was killed * Add views for free days
This commit is contained in:
parent
e274949257
commit
c3803b1c96
@ -131,14 +131,6 @@ public class Day {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getIsFreeDay() {
|
|
||||||
return this.isFreeDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsFreeDay(boolean isFreeDay) {
|
|
||||||
this.isFreeDay = isFreeDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To-many relationship, resolved on first access (and after reset).
|
* To-many relationship, resolved on first access (and after reset).
|
||||||
* Changes to to-many relations are not persisted, make changes to the target entity.
|
* Changes to to-many relations are not persisted, make changes to the target entity.
|
||||||
@ -205,6 +197,14 @@ public class Day {
|
|||||||
myDao.update(this);
|
myDao.update(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getIsFreeDay() {
|
||||||
|
return this.isFreeDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsFreeDay(boolean isFreeDay) {
|
||||||
|
this.isFreeDay = isFreeDay;
|
||||||
|
}
|
||||||
|
|
||||||
/** called by internal mechanisms, do not call yourself. */
|
/** called by internal mechanisms, do not call yourself. */
|
||||||
@Generated(hash = 1409317752)
|
@Generated(hash = 1409317752)
|
||||||
public void __setDaoSession(DaoSession daoSession) {
|
public void __setDaoSession(DaoSession daoSession) {
|
||||||
|
@ -25,6 +25,10 @@ public class BasePresenter<V extends BaseContract.View> implements BaseContract.
|
|||||||
view = null;
|
view = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isViewAttached() {
|
||||||
|
return view != null;
|
||||||
|
}
|
||||||
|
|
||||||
public final RepositoryContract getRepository() {
|
public final RepositoryContract getRepository() {
|
||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
@ -22,15 +22,6 @@ public class LoginPresenter extends BasePresenter<LoginContract.View>
|
|||||||
super(repository);
|
super(repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
if (loginAsync != null) {
|
|
||||||
loginAsync.cancel(true);
|
|
||||||
loginAsync = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attemptLogin(String email, String password, String symbol) {
|
public void attemptLogin(String email, String password, String symbol) {
|
||||||
getView().resetViewErrors();
|
getView().resetViewErrors();
|
||||||
@ -57,7 +48,9 @@ public class LoginPresenter extends BasePresenter<LoginContract.View>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartAsync() {
|
public void onStartAsync() {
|
||||||
getView().showLoginProgress(true);
|
if (isViewAttached()) {
|
||||||
|
getView().showLoginProgress(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -90,7 +83,9 @@ public class LoginPresenter extends BasePresenter<LoginContract.View>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCanceledAsync() {
|
public void onCanceledAsync() {
|
||||||
getView().showLoginProgress(false);
|
if (isViewAttached()) {
|
||||||
|
getView().showLoginProgress(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEmailValid(String email) {
|
private boolean isEmailValid(String email) {
|
||||||
@ -140,4 +135,13 @@ public class LoginPresenter extends BasePresenter<LoginContract.View>
|
|||||||
}
|
}
|
||||||
return correct;
|
return correct;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
if (loginAsync != null) {
|
||||||
|
loginAsync.cancel(true);
|
||||||
|
loginAsync = null;
|
||||||
|
}
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,9 @@ public class GradesPresenter extends BasePresenter<GradesContract.View>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCanceledRefreshAsync() {
|
public void onCanceledRefreshAsync() {
|
||||||
getView().hideRefreshingBar();
|
if (isViewAttached()) {
|
||||||
|
getView().hideRefreshingBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -138,13 +140,14 @@ public class GradesPresenter extends BasePresenter<GradesContract.View>
|
|||||||
} else {
|
} else {
|
||||||
getView().updateAdapterList(headerItems);
|
getView().updateAdapterList(headerItems);
|
||||||
getView().showNoItem(false);
|
getView().showNoItem(false);
|
||||||
listener.onFragmentIsReady();
|
|
||||||
}
|
}
|
||||||
|
listener.onFragmentIsReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
isFirstSight = false;
|
||||||
|
|
||||||
if (refreshTask != null) {
|
if (refreshTask != null) {
|
||||||
refreshTask.cancel(true);
|
refreshTask.cancel(true);
|
||||||
refreshTask = null;
|
refreshTask = null;
|
||||||
@ -153,5 +156,6 @@ public class GradesPresenter extends BasePresenter<GradesContract.View>
|
|||||||
loadingTask.cancel(true);
|
loadingTask.cancel(true);
|
||||||
loadingTask = null;
|
loadingTask = null;
|
||||||
}
|
}
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.github.wulkanowy.ui.main.timetable;
|
package io.github.wulkanowy.ui.main.timetable;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import butterknife.BindColor;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||||
@ -73,6 +75,15 @@ public class TimetableHeaderItem
|
|||||||
@BindView(R.id.timetable_header_alert_image)
|
@BindView(R.id.timetable_header_alert_image)
|
||||||
ImageView alert;
|
ImageView alert;
|
||||||
|
|
||||||
|
@BindView(R.id.timetable_header_free_name)
|
||||||
|
TextView freeName;
|
||||||
|
|
||||||
|
@BindColor(R.color.secondary_text)
|
||||||
|
int secondaryColor;
|
||||||
|
|
||||||
|
@BindColor(R.color.free_day)
|
||||||
|
int backgroundFreeDay;
|
||||||
|
|
||||||
HeaderViewHolder(View view, FlexibleAdapter adapter) {
|
HeaderViewHolder(View view, FlexibleAdapter adapter) {
|
||||||
super(view, adapter);
|
super(view, adapter);
|
||||||
view.setOnClickListener(this);
|
view.setOnClickListener(this);
|
||||||
@ -83,6 +94,14 @@ public class TimetableHeaderItem
|
|||||||
dayName.setText(StringUtils.capitalize(item.getDayName()));
|
dayName.setText(StringUtils.capitalize(item.getDayName()));
|
||||||
date.setText(item.getDate());
|
date.setText(item.getDate());
|
||||||
alert.setVisibility(isSubItemNewMovedInOrChanged(subItems) ? View.VISIBLE : View.INVISIBLE);
|
alert.setVisibility(isSubItemNewMovedInOrChanged(subItems) ? View.VISIBLE : View.INVISIBLE);
|
||||||
|
freeName.setVisibility(item.isFreeDay() ? View.VISIBLE : View.INVISIBLE);
|
||||||
|
freeName.setText(item.getFreeDayName());
|
||||||
|
|
||||||
|
if (item.isFreeDay()) {
|
||||||
|
((FrameLayout) getContentView()).setForeground(null);
|
||||||
|
getContentView().setBackgroundColor(backgroundFreeDay);
|
||||||
|
dayName.setTextColor(secondaryColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSubItemNewMovedInOrChanged(List<TimetableSubItem> subItems) {
|
private boolean isSubItemNewMovedInOrChanged(List<TimetableSubItem> subItems) {
|
||||||
|
@ -98,10 +98,12 @@ public class TimetablePresenter extends BasePresenter<TimetableContract.View>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
isFirstSight = false;
|
||||||
|
|
||||||
if (loadingTask != null) {
|
if (loadingTask != null) {
|
||||||
loadingTask.cancel(true);
|
loadingTask.cancel(true);
|
||||||
loadingTask = null;
|
loadingTask = null;
|
||||||
}
|
}
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,11 @@ public interface TimetableTabContract {
|
|||||||
|
|
||||||
void hideRefreshingBar();
|
void hideRefreshingBar();
|
||||||
|
|
||||||
|
void showNoItem(boolean show);
|
||||||
|
|
||||||
void showProgressBar(boolean show);
|
void showProgressBar(boolean show);
|
||||||
|
|
||||||
|
void setFreeWeekName(String text);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Presenter extends BaseContract.Presenter<View> {
|
interface Presenter extends BaseContract.Presenter<View> {
|
||||||
|
@ -9,6 +9,7 @@ import android.support.v7.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 java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -25,7 +26,9 @@ import io.github.wulkanowy.ui.base.BaseFragment;
|
|||||||
public class TimetableTabFragment extends BaseFragment implements TimetableTabContract.View,
|
public class TimetableTabFragment extends BaseFragment implements TimetableTabContract.View,
|
||||||
SwipeRefreshLayout.OnRefreshListener {
|
SwipeRefreshLayout.OnRefreshListener {
|
||||||
|
|
||||||
private static final String ARGUMENT_KEY = "Date";
|
private static final String ARGUMENT_KEY = "date";
|
||||||
|
|
||||||
|
private static final String SAVED_KEY = "isSelected";
|
||||||
|
|
||||||
private boolean isPrimary = false;
|
private boolean isPrimary = false;
|
||||||
|
|
||||||
@ -40,6 +43,12 @@ public class TimetableTabFragment extends BaseFragment implements TimetableTabCo
|
|||||||
@BindView(R.id.timetable_tab_fragment_progress_bar)
|
@BindView(R.id.timetable_tab_fragment_progress_bar)
|
||||||
View progressBar;
|
View progressBar;
|
||||||
|
|
||||||
|
@BindView(R.id.timetable_tab_fragment_no_item_container)
|
||||||
|
View noItemView;
|
||||||
|
|
||||||
|
@BindView(R.id.timetable_tab_fragment_no_item_name)
|
||||||
|
TextView noItemName;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
TimetableTabContract.Presenter presenter;
|
TimetableTabContract.Presenter presenter;
|
||||||
|
|
||||||
@ -56,6 +65,14 @@ public class TimetableTabFragment extends BaseFragment implements TimetableTabCo
|
|||||||
return fragmentTab;
|
return fragmentTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (savedInstanceState != null) {
|
||||||
|
isSelected = savedInstanceState.getBoolean(SAVED_KEY, isSelected);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
@ -104,6 +121,11 @@ public class TimetableTabFragment extends BaseFragment implements TimetableTabCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setFreeWeekName(String text) {
|
||||||
|
noItemName.setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
presenter.onRefresh();
|
presenter.onRefresh();
|
||||||
@ -124,6 +146,11 @@ public class TimetableTabFragment extends BaseFragment implements TimetableTabCo
|
|||||||
progressBar.setVisibility(show ? View.VISIBLE : View.INVISIBLE);
|
progressBar.setVisibility(show ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showNoItem(boolean show) {
|
||||||
|
noItemView.setVisibility(show ? View.VISIBLE : View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
public void setSelected(boolean selected) {
|
public void setSelected(boolean selected) {
|
||||||
isSelected = selected;
|
isSelected = selected;
|
||||||
}
|
}
|
||||||
@ -136,6 +163,12 @@ public class TimetableTabFragment extends BaseFragment implements TimetableTabCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
outState.putBoolean(SAVED_KEY, isSelected);
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
isPrimary = false;
|
isPrimary = false;
|
||||||
|
@ -26,6 +26,8 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
|
|
||||||
private String date;
|
private String date;
|
||||||
|
|
||||||
|
private String freeWeekName;
|
||||||
|
|
||||||
private boolean isFirstSight = false;
|
private boolean isFirstSight = false;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@ -37,6 +39,7 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
public void onStart(TimetableTabContract.View view, boolean isPrimary) {
|
public void onStart(TimetableTabContract.View view, boolean isPrimary) {
|
||||||
super.onStart(view);
|
super.onStart(view);
|
||||||
getView().showProgressBar(true);
|
getView().showProgressBar(true);
|
||||||
|
getView().showNoItem(false);
|
||||||
onFragmentSelected(isPrimary);
|
onFragmentSelected(isPrimary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +73,9 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCanceledRefreshAsync() {
|
public void onCanceledRefreshAsync() {
|
||||||
// do nothing
|
if (isViewAttached()) {
|
||||||
|
getView().hideRefreshingBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -100,9 +105,15 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
|
|
||||||
headerItems = new ArrayList<>();
|
headerItems = new ArrayList<>();
|
||||||
|
|
||||||
|
boolean isFreeWeek = true;
|
||||||
|
|
||||||
for (Day day : dayList) {
|
for (Day day : dayList) {
|
||||||
TimetableHeaderItem headerItem = new TimetableHeaderItem(day);
|
TimetableHeaderItem headerItem = new TimetableHeaderItem(day);
|
||||||
|
|
||||||
|
if (isFreeWeek) {
|
||||||
|
isFreeWeek = day.isFreeDay();
|
||||||
|
}
|
||||||
|
|
||||||
List<Lesson> lessonList = day.getLessons();
|
List<Lesson> lessonList = day.getLessons();
|
||||||
|
|
||||||
List<TimetableSubItem> subItems = new ArrayList<>();
|
List<TimetableSubItem> subItems = new ArrayList<>();
|
||||||
@ -115,6 +126,11 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
headerItem.setExpanded(false);
|
headerItem.setExpanded(false);
|
||||||
headerItems.add(headerItem);
|
headerItems.add(headerItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFreeWeek) {
|
||||||
|
freeWeekName = dayList.get(4).getFreeDayName();
|
||||||
|
headerItems = new ArrayList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -124,7 +140,12 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEndLoadingAsync(boolean result, Exception exception) {
|
public void onEndLoadingAsync(boolean result, Exception exception) {
|
||||||
getView().updateAdapterList(headerItems);
|
if (headerItems.isEmpty()) {
|
||||||
|
getView().showNoItem(true);
|
||||||
|
getView().setFreeWeekName(freeWeekName);
|
||||||
|
} else {
|
||||||
|
getView().updateAdapterList(headerItems);
|
||||||
|
}
|
||||||
getView().showProgressBar(false);
|
getView().showProgressBar(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +161,6 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
|
||||||
isFirstSight = false;
|
isFirstSight = false;
|
||||||
|
|
||||||
if (refreshTask != null) {
|
if (refreshTask != null) {
|
||||||
@ -151,5 +171,6 @@ public class TimetableTabPresenter extends BasePresenter<TimetableTabContract.Vi
|
|||||||
loadingTask.cancel(true);
|
loadingTask.cancel(true);
|
||||||
loadingTask = null;
|
loadingTask = null;
|
||||||
}
|
}
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,18 +19,18 @@
|
|||||||
android:layout_below="@+id/grade_fragment_no_item_text"
|
android:layout_below="@+id/grade_fragment_no_item_text"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:contentDescription="@string/activity_dashboard_text"
|
|
||||||
android:minHeight="100dp"
|
android:minHeight="100dp"
|
||||||
android:minWidth="100dp"
|
android:minWidth="100dp"
|
||||||
android:tint="@android:color/black"
|
android:tint="@android:color/black"
|
||||||
app:srcCompat="@drawable/ic_menu_grade_26dp" />
|
app:srcCompat="@drawable/ic_menu_grade_26dp"
|
||||||
|
tools:ignore="contentDescription" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/grade_fragment_no_item_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="46dp"
|
android:layout_marginTop="46dp"
|
||||||
android:text="@string/fragment_no_grades"
|
android:text="@string/fragment_no_grades"
|
||||||
android:id="@+id/grade_fragment_no_item_text"
|
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/timetable_tab_fragment_container"
|
android:id="@+id/timetable_tab_fragment_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -18,6 +19,45 @@
|
|||||||
android:indeterminate="true" />
|
android:indeterminate="true" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/timetable_tab_fragment_no_item_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/timetable_tab_fragment_no_item_image"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/timetable_tab_fragment_no_item_text"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:minHeight="100dp"
|
||||||
|
android:minWidth="100dp"
|
||||||
|
android:tint="@android:color/black"
|
||||||
|
app:srcCompat="@drawable/ic_menu_timetable_24dp"
|
||||||
|
tools:ignore="contentDescription" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/timetable_tab_fragment_no_item_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="46dp"
|
||||||
|
android:text="@string/info_free_week"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/timetable_tab_fragment_no_item_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_below="@id/timetable_tab_fragment_no_item_image"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:layout_marginTop="15dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/timetable_tab_fragment_swipe_refresh"
|
android:id="@+id/timetable_tab_fragment_swipe_refresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
android:layout_below="@+id/grade_header_subject_text"
|
android:layout_below="@+id/grade_header_subject_text"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textColor="#4C4C4C"
|
android:textColor="@color/secondary_text"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -43,7 +43,7 @@
|
|||||||
android:layout_toEndOf="@+id/grade_header_average_text"
|
android:layout_toEndOf="@+id/grade_header_average_text"
|
||||||
android:layout_toRightOf="@+id/grade_header_average_text"
|
android:layout_toRightOf="@+id/grade_header_average_text"
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textColor="#4C4C4C"
|
android:textColor="@color/secondary_text"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -1,51 +1,71 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_border"
|
android:background="@drawable/ic_border"
|
||||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
android:foreground="?attr/selectableItemBackgroundBorderless">
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingTop="@dimen/activity_vertical_margin">
|
|
||||||
|
|
||||||
<TextView
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/timetable_header_day"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="wrap_content"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentStart="true"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
android:layout_marginEnd="15dp"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:layout_marginRight="15dp"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:layout_toLeftOf="@id/timetable_header_alert_image"
|
android:paddingTop="@dimen/activity_vertical_margin">
|
||||||
android:layout_toStartOf="@+id/timetable_header_alert_image"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textSize="19sp" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/timetable_header_date"
|
android:id="@+id/timetable_header_day"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_below="@+id/timetable_header_day"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginRight="15dp"
|
||||||
android:maxLines="1"
|
android:layout_toLeftOf="@id/timetable_header_alert_image"
|
||||||
android:text="@string/app_name"
|
android:layout_toStartOf="@+id/timetable_header_alert_image"
|
||||||
android:textColor="#4C4C4C"
|
android:ellipsize="end"
|
||||||
android:textSize="14sp" />
|
android:maxLines="1"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textSize="19sp" />
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/timetable_header_alert_image"
|
android:id="@+id/timetable_header_date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_below="@+id/timetable_header_day"
|
||||||
app:srcCompat="@drawable/ic_exclamation_24dp"
|
android:layout_marginTop="5dp"
|
||||||
tools:ignore="contentDescription" />
|
android:maxLines="1"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/secondary_text"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
<TextView
|
||||||
|
android:id="@+id/timetable_header_free_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="180dp"
|
||||||
|
android:layout_marginStart="180dp"
|
||||||
|
android:gravity="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/secondary_text"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/timetable_header_alert_image"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:srcCompat="@drawable/ic_exclamation_24dp"
|
||||||
|
tools:ignore="contentDescription" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</FrameLayout>
|
@ -61,7 +61,7 @@
|
|||||||
android:layout_alignStart="@id/timetable_subItem_lesson"
|
android:layout_alignStart="@id/timetable_subItem_lesson"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="@string/grades_text"
|
android:text="@string/grades_text"
|
||||||
android:textColor="#4C4C4C"
|
android:textColor="@color/secondary_text"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -77,7 +77,7 @@
|
|||||||
android:layout_toRightOf="@+id/timetable_subItem_time"
|
android:layout_toRightOf="@+id/timetable_subItem_time"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="@string/grades_text"
|
android:text="@string/grades_text"
|
||||||
android:textColor="#4C4C4C"
|
android:textColor="@color/secondary_text"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tool:ignore="all"/>
|
tool:ignore="all"/>
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
|
|
||||||
<string name="info_average_grades">Średnia: %1$.2f</string>
|
<string name="info_average_grades">Średnia: %1$.2f</string>
|
||||||
<string name="info_no_average">Brak średniej</string>
|
<string name="info_no_average">Brak średniej</string>
|
||||||
|
<string name="info_free_week">Brak lekcji w tym tygodniu</string>
|
||||||
<string name="timetable_subitem_room">Sala %s</string>
|
<string name="timetable_subitem_room">Sala %s</string>
|
||||||
|
|
||||||
<plurals name="numberOfGradesPlurals">
|
<plurals name="numberOfGradesPlurals">
|
||||||
|
@ -10,5 +10,7 @@
|
|||||||
<color name="three_grade">#FFE68C</color>
|
<color name="three_grade">#FFE68C</color>
|
||||||
<color name="two_grade">#CE9AD2</color>
|
<color name="two_grade">#CE9AD2</color>
|
||||||
<color name="one_grade">#d32f2f</color>
|
<color name="one_grade">#d32f2f</color>
|
||||||
|
<color name="secondary_text">#4c4c4c</color>
|
||||||
<color name="default_grade">#cdcdcd</color>
|
<color name="default_grade">#cdcdcd</color>
|
||||||
|
<color name="free_day">#eee</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
|
|
||||||
<string name="info_average_grades">Average: %1$.2f</string>
|
<string name="info_average_grades">Average: %1$.2f</string>
|
||||||
<string name="info_no_average">No average</string>
|
<string name="info_no_average">No average</string>
|
||||||
|
<string name="info_free_week">No lesson in this week</string>
|
||||||
<string name="error_host_offline">Technical break</string>
|
<string name="error_host_offline">Technical break</string>
|
||||||
|
|
||||||
<string name="timetable_subitem_room">Room %s</string>
|
<string name="timetable_subitem_room">Room %s</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user