Bug fixing and Canteen grouping
This commit is contained in:
@@ -2,24 +2,35 @@ package de.sebse.fuplanner.fragments.canteen;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.StringRes;
|
||||||
import android.support.v7.widget.RecyclerView;
|
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 java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
import de.sebse.fuplanner.services.Canteen.types.Day;
|
import de.sebse.fuplanner.services.Canteen.types.Day;
|
||||||
import de.sebse.fuplanner.services.Canteen.types.Meal;
|
import de.sebse.fuplanner.services.Canteen.types.Meal;
|
||||||
import de.sebse.fuplanner.tools.Preferences;
|
import de.sebse.fuplanner.tools.Preferences;
|
||||||
import de.sebse.fuplanner.tools.ui.ItemViewHolder;
|
import de.sebse.fuplanner.tools.logging.Logger;
|
||||||
import de.sebse.fuplanner.tools.ui.MealViewHolder;
|
import de.sebse.fuplanner.tools.ui.MealViewHolder;
|
||||||
|
import de.sebse.fuplanner.tools.ui.StringViewHolder;
|
||||||
|
|
||||||
class MealAdapter extends RecyclerView.Adapter<MealViewHolder> {
|
class MealAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
private String[] CATEGORY_KEYS = new String[]{"Essen", "Aktionen", "Beilagen", "Desserts", "Salate", "Suppen", "Vorspeisen"};
|
||||||
|
@StringRes
|
||||||
|
private int[] CATEGORY_VALS = new int[]{R.string.meals, R.string.special_meals, R.string.side_dishes, R.string.desserts, R.string.salats, R.string.soups, R.string.starters};
|
||||||
|
@StringRes
|
||||||
|
private int CATEGORY_OTHER = R.string.others;
|
||||||
|
private ArrayList<Object> matchings = new ArrayList<>();
|
||||||
|
|
||||||
private Day mDay = null;
|
private Day mDay = null;
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
private Logger log = new Logger(this);
|
||||||
|
|
||||||
public MealAdapter(Context context) {
|
public MealAdapter(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -27,16 +38,25 @@ class MealAdapter extends RecyclerView.Adapter<MealViewHolder> {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public MealViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
|
||||||
|
if (viewType == 0) {
|
||||||
View view = LayoutInflater.from(viewGroup.getContext())
|
View view = LayoutInflater.from(viewGroup.getContext())
|
||||||
.inflate(R.layout.list_canteen_items, viewGroup, false);
|
.inflate(R.layout.list_canteen_items, viewGroup, false);
|
||||||
return new MealViewHolder(view);
|
return new MealViewHolder(view);
|
||||||
|
} else {
|
||||||
|
View view = LayoutInflater.from(viewGroup.getContext())
|
||||||
|
.inflate(R.layout.list_all_caption, viewGroup, false);
|
||||||
|
return new StringViewHolder(view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull MealViewHolder viewHolder, int i) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
log.d(position, holder.getItemViewType(), getItemViewType(position));
|
||||||
|
if (holder.getItemViewType() == 0) {
|
||||||
|
MealViewHolder viewHolder = ((MealViewHolder) holder);
|
||||||
viewHolder.reset();
|
viewHolder.reset();
|
||||||
Meal meal = getItem(i);
|
Meal meal = getMeal(position);
|
||||||
viewHolder.mTitle.setText(meal.getName());
|
viewHolder.mTitle.setText(meal.getName());
|
||||||
String value;
|
String value;
|
||||||
switch (Preferences.getString(mContext, R.array.pref_price_group)) {
|
switch (Preferences.getString(mContext, R.array.pref_price_group)) {
|
||||||
@@ -67,21 +87,32 @@ class MealAdapter extends RecyclerView.Adapter<MealViewHolder> {
|
|||||||
viewHolder.mIconVegetarian.setVisibility(meal.getVegan() == Meal.VEGAN_VEGETERIAN ? View.VISIBLE : View.GONE);
|
viewHolder.mIconVegetarian.setVisibility(meal.getVegan() == Meal.VEGAN_VEGETERIAN ? View.VISIBLE : View.GONE);
|
||||||
viewHolder.mIconBio.setVisibility((meal.getCertificates() & Meal.CERT_BIO) != 0 ? View.VISIBLE : View.GONE);
|
viewHolder.mIconBio.setVisibility((meal.getCertificates() & Meal.CERT_BIO) != 0 ? View.VISIBLE : View.GONE);
|
||||||
viewHolder.mIconMsc.setVisibility((meal.getCertificates() & Meal.CERT_MSC) != 0 ? View.VISIBLE : View.GONE);
|
viewHolder.mIconMsc.setVisibility((meal.getCertificates() & Meal.CERT_MSC) != 0 ? View.VISIBLE : View.GONE);
|
||||||
|
} else {
|
||||||
|
log.d(holder);
|
||||||
|
StringViewHolder viewHolder = ((StringViewHolder) holder);
|
||||||
|
viewHolder.mString.setText(getHeading(position));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Meal getItem(int groupPosition) {
|
|
||||||
if (this.mDay != null)
|
|
||||||
return this.mDay.get(groupPosition);
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
|
return matchings.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
return matchings.get(position) instanceof String ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Meal getMeal(int position) {
|
||||||
if (this.mDay != null)
|
if (this.mDay != null)
|
||||||
return this.mDay.size();
|
return this.mDay.get((Integer) matchings.get(position));
|
||||||
else
|
else
|
||||||
return 0;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeading(int position) {
|
||||||
|
return (String) matchings.get(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDay(Day day) {
|
public void setDay(Day day) {
|
||||||
@@ -90,6 +121,38 @@ class MealAdapter extends RecyclerView.Adapter<MealViewHolder> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setDay() {
|
public void setDay() {
|
||||||
|
HashMap<String, ArrayList<Integer>> map = new HashMap<>();
|
||||||
|
for (int i = 0; i < this.mDay.size(); i++) {
|
||||||
|
String category = this.mDay.get(i).getCategory();
|
||||||
|
boolean found = false;
|
||||||
|
for (String category_key : CATEGORY_KEYS) {
|
||||||
|
if (category_key.equals(category)) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) category = "---";
|
||||||
|
ArrayList<Integer> list = map.get(category);
|
||||||
|
if (list == null) {
|
||||||
|
list = new ArrayList<>();
|
||||||
|
map.put(category, list);
|
||||||
|
}
|
||||||
|
list.add(i);
|
||||||
|
}
|
||||||
|
matchings.clear();
|
||||||
|
for (int i = 0; i < CATEGORY_KEYS.length; i++) {
|
||||||
|
ArrayList<Integer> list = map.get(CATEGORY_KEYS[i]);
|
||||||
|
if (list != null) {
|
||||||
|
matchings.add(mContext.getString(CATEGORY_VALS[i]));
|
||||||
|
matchings.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ArrayList<Integer> list = map.get("---");
|
||||||
|
if (list != null) {
|
||||||
|
matchings.add(mContext.getString(CATEGORY_OTHER));
|
||||||
|
matchings.addAll(list);
|
||||||
|
}
|
||||||
|
Logger.n(this).d(matchings, map);
|
||||||
this.notifyDataSetChanged();
|
this.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ import de.sebse.fuplanner.services.KVV.types.Modules;
|
|||||||
import de.sebse.fuplanner.tools.UtilsDate;
|
import de.sebse.fuplanner.tools.UtilsDate;
|
||||||
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
|
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
|
||||||
import de.sebse.fuplanner.tools.ui.ItemViewHolder;
|
import de.sebse.fuplanner.tools.ui.ItemViewHolder;
|
||||||
|
import de.sebse.fuplanner.tools.ui.StringViewHolder;
|
||||||
|
|
||||||
class ModDetailEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
class ModDetailEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
private static final int TYPE_HEADER = 0;
|
private static final int TYPE_HEADER = 0;
|
||||||
@@ -61,7 +62,7 @@ class ModDetailEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||||||
case TYPE_HEADER:
|
case TYPE_HEADER:
|
||||||
view = LayoutInflater.from(parent.getContext())
|
view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_all_caption, parent, false);
|
.inflate(R.layout.list_all_caption, parent, false);
|
||||||
return new HeaderViewHolder(view);
|
return new StringViewHolder(view);
|
||||||
case TYPE_ITEM:
|
case TYPE_ITEM:
|
||||||
view = LayoutInflater.from(parent.getContext())
|
view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_all_items, parent, false);
|
.inflate(R.layout.list_all_items, parent, false);
|
||||||
@@ -87,13 +88,13 @@ class ModDetailEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||||||
Pair<Integer, Integer> data = mPositionalData.get(position);
|
Pair<Integer, Integer> data = mPositionalData.get(position);
|
||||||
switch (data.first) {
|
switch (data.first) {
|
||||||
case TYPE_HEADER:
|
case TYPE_HEADER:
|
||||||
HeaderViewHolder h = (HeaderViewHolder) holder;
|
StringViewHolder h = (StringViewHolder) holder;
|
||||||
switch (data.second) {
|
switch (data.second) {
|
||||||
case SECTION_PAST:
|
case SECTION_PAST:
|
||||||
h.mCaption.setText(R.string.past_events);
|
h.mString.setText(R.string.past_events);
|
||||||
break;
|
break;
|
||||||
case SECTION_UPCOMING:
|
case SECTION_UPCOMING:
|
||||||
h.mCaption.setText(R.string.upcoming_events);
|
h.mString.setText(R.string.upcoming_events);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -145,27 +146,4 @@ class ModDetailEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||||||
return mValue.events.sizePast();
|
return mValue.events.sizePast();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HeaderViewHolder extends CustomViewHolder {
|
|
||||||
final TextView mCaption;
|
|
||||||
|
|
||||||
HeaderViewHolder(View view) {
|
|
||||||
super(view);
|
|
||||||
mCaption = view.findViewById(R.id.caption);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return super.toString() + " '" + mCaption.getText() + "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import de.sebse.fuplanner.R;
|
|||||||
import de.sebse.fuplanner.services.KVV.types.Gradebook;
|
import de.sebse.fuplanner.services.KVV.types.Gradebook;
|
||||||
import de.sebse.fuplanner.services.KVV.types.Modules;
|
import de.sebse.fuplanner.services.KVV.types.Modules;
|
||||||
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
|
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
|
||||||
|
import de.sebse.fuplanner.tools.ui.StringViewHolder;
|
||||||
|
|
||||||
class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
private static final int TYPE_TOTAL = 0;
|
private static final int TYPE_TOTAL = 0;
|
||||||
@@ -58,7 +59,7 @@ class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
case TYPE_TOTAL:
|
case TYPE_TOTAL:
|
||||||
view = LayoutInflater.from(parent.getContext())
|
view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_all_caption, parent, false);
|
.inflate(R.layout.list_all_caption, parent, false);
|
||||||
return new HeaderViewHolder(view);
|
return new StringViewHolder(view);
|
||||||
case TYPE_GRADE:
|
case TYPE_GRADE:
|
||||||
view = LayoutInflater.from(parent.getContext())
|
view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_moddetails_gradebook, parent, false);
|
.inflate(R.layout.list_moddetails_gradebook, parent, false);
|
||||||
@@ -85,8 +86,8 @@ class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
Pair<Integer, Integer> data = mPositionalData.get(position);
|
Pair<Integer, Integer> data = mPositionalData.get(position);
|
||||||
switch (data.first) {
|
switch (data.first) {
|
||||||
case TYPE_TOTAL:
|
case TYPE_TOTAL:
|
||||||
HeaderViewHolder h = (HeaderViewHolder) holder;
|
StringViewHolder h = (StringViewHolder) holder;
|
||||||
h.mCaption.setText(h.mView.getResources().getString(R.string.current_percentage, mValue.getGradebookPercent()*100));
|
h.mString.setText(h.mView.getResources().getString(R.string.current_percentage, mValue.getGradebookPercent()*100));
|
||||||
break;
|
break;
|
||||||
case TYPE_GRADE:
|
case TYPE_GRADE:
|
||||||
int index = data.second / 1024;
|
int index = data.second / 1024;
|
||||||
@@ -118,20 +119,6 @@ class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HeaderViewHolder extends CustomViewHolder {
|
|
||||||
final TextView mCaption;
|
|
||||||
|
|
||||||
HeaderViewHolder(View view) {
|
|
||||||
super(view);
|
|
||||||
mCaption = view.findViewById(R.id.caption);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return super.toString() + " '" + mCaption.getText() + "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private class GradebookViewHolder extends RecyclerView.ViewHolder {
|
private class GradebookViewHolder extends RecyclerView.ViewHolder {
|
||||||
private final TextView mGrade;
|
private final TextView mGrade;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import de.sebse.fuplanner.tools.UtilsDate;
|
|||||||
import de.sebse.fuplanner.tools.logging.Logger;
|
import de.sebse.fuplanner.tools.logging.Logger;
|
||||||
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
|
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
|
||||||
import de.sebse.fuplanner.tools.ui.ItemViewHolder;
|
import de.sebse.fuplanner.tools.ui.ItemViewHolder;
|
||||||
|
import de.sebse.fuplanner.tools.ui.StringViewHolder;
|
||||||
|
|
||||||
class ModDetailOverviewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
class ModDetailOverviewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
private static final int MAX_ITEMS_PER_PREVIEW = 2;
|
private static final int MAX_ITEMS_PER_PREVIEW = 2;
|
||||||
@@ -77,7 +78,7 @@ class ModDetailOverviewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||||||
case TYPE_HEADER:
|
case TYPE_HEADER:
|
||||||
view = LayoutInflater.from(parent.getContext())
|
view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_all_caption, parent, false);
|
.inflate(R.layout.list_all_caption, parent, false);
|
||||||
return new HeaderViewHolder(view);
|
return new StringViewHolder(view);
|
||||||
case TYPE_DESCRIPTION:
|
case TYPE_DESCRIPTION:
|
||||||
view = LayoutInflater.from(parent.getContext())
|
view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_moddetails_description, parent, false);
|
.inflate(R.layout.list_moddetails_description, parent, false);
|
||||||
@@ -111,19 +112,19 @@ class ModDetailOverviewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||||||
Pair<Integer, Object> data = mPositionalData.get(position);
|
Pair<Integer, Object> data = mPositionalData.get(position);
|
||||||
switch (data.first) {
|
switch (data.first) {
|
||||||
case TYPE_HEADER:
|
case TYPE_HEADER:
|
||||||
HeaderViewHolder h = (HeaderViewHolder) holder;
|
StringViewHolder h = (StringViewHolder) holder;
|
||||||
switch ((Integer) data.second) {
|
switch ((Integer) data.second) {
|
||||||
case ModulePart.DESCRIPTION:
|
case ModulePart.DESCRIPTION:
|
||||||
h.mCaption.setText(R.string.description);
|
h.mString.setText(R.string.description);
|
||||||
break;
|
break;
|
||||||
case ModulePart.ANNOUNCEMENT:
|
case ModulePart.ANNOUNCEMENT:
|
||||||
h.mCaption.setText(h.mView.getResources().getString(R.string.announcements_count, getAnnounceCount()));
|
h.mString.setText(h.mView.getResources().getString(R.string.announcements_count, getAnnounceCount()));
|
||||||
break;
|
break;
|
||||||
case ModulePart.ASSIGNMENT:
|
case ModulePart.ASSIGNMENT:
|
||||||
h.mCaption.setText(h.mView.getResources().getString(R.string.assignments_count, getAssignmentCount()));
|
h.mString.setText(h.mView.getResources().getString(R.string.assignments_count, getAssignmentCount()));
|
||||||
break;
|
break;
|
||||||
case ModulePart.EVENT:
|
case ModulePart.EVENT:
|
||||||
h.mCaption.setText(h.mView.getResources().getString(R.string.upcoming_events_count, getEventsCount()));
|
h.mString.setText(h.mView.getResources().getString(R.string.upcoming_events_count, getEventsCount()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -221,19 +222,7 @@ class ModDetailOverviewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HeaderViewHolder extends CustomViewHolder {
|
|
||||||
final TextView mCaption;
|
|
||||||
|
|
||||||
HeaderViewHolder(View view) {
|
|
||||||
super(view);
|
|
||||||
mCaption = view.findViewById(R.id.caption);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return super.toString() + " '" + mCaption.getText() + "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class DescriptionViewHolder extends CustomViewHolder {
|
class DescriptionViewHolder extends CustomViewHolder {
|
||||||
final ExpandableTextView mText;
|
final ExpandableTextView mText;
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package de.sebse.fuplanner.services.KVV;
|
package de.sebse.fuplanner.services.KVV;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.Html;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
|
|
||||||
import net.htmlparser.jericho.Source;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -108,7 +107,7 @@ class KVVModuleList extends HTTPService {
|
|||||||
}
|
}
|
||||||
String type = site.getJSONObject("props").getString("kvv_coursetype");
|
String type = site.getJSONObject("props").getString("kvv_coursetype");
|
||||||
String description = site.getString("description");
|
String description = site.getString("description");
|
||||||
description = new Source(description).getRenderer().toString();
|
description = String.valueOf(Html.fromHtml(description));
|
||||||
String id = site.getString("id");
|
String id = site.getString("id");
|
||||||
modules.addModule(semester, lvNumbers, title, lecturers, type, description, id);
|
modules.addModule(semester, lvNumbers, title, lecturers, type, description, id);
|
||||||
}
|
}
|
||||||
@@ -224,7 +223,7 @@ class KVVModuleList extends HTTPService {
|
|||||||
String id = site.getString("announcementId");
|
String id = site.getString("announcementId");
|
||||||
String title = site.getString("title");
|
String title = site.getString("title");
|
||||||
String text = site.getString("body");
|
String text = site.getString("body");
|
||||||
text = new Source(text).getRenderer().toString();
|
text = String.valueOf(Html.fromHtml(text));
|
||||||
String createdBy = site.getString("createdByDisplayName");
|
String createdBy = site.getString("createdByDisplayName");
|
||||||
long createdOn = site.getLong("createdOn");
|
long createdOn = site.getLong("createdOn");
|
||||||
|
|
||||||
@@ -293,7 +292,7 @@ class KVVModuleList extends HTTPService {
|
|||||||
String id = site.getString("id");
|
String id = site.getString("id");
|
||||||
String title = site.getString("title");
|
String title = site.getString("title");
|
||||||
String instructions = site.getString("instructions");
|
String instructions = site.getString("instructions");
|
||||||
instructions = new Source(instructions).getRenderer().toString();
|
instructions = String.valueOf(Html.fromHtml(instructions));
|
||||||
long dueTime = site.getJSONObject("dueTime").getLong("time");
|
long dueTime = site.getJSONObject("dueTime").getLong("time");
|
||||||
String gradebookItemName = site.optString("gradebookItemName", null);
|
String gradebookItemName = site.optString("gradebookItemName", null);
|
||||||
String gradeScale = site.getString("gradeScale");
|
String gradeScale = site.getString("gradeScale");
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ public abstract class DateSortedList<T> extends ArrayList<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T get(int index) {
|
public T get(int index) {
|
||||||
if (split < 0)
|
//if (split < 0)
|
||||||
sort();
|
// sort();
|
||||||
if (reversed())
|
if (reversed())
|
||||||
index = size() - index - 1;
|
index = size() - index - 1;
|
||||||
return super.get(index);
|
return super.get(index);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/caption"
|
android:id="@+id/string"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/text_margin"
|
android:layout_margin="@dimen/text_margin"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
app:outer_view="@layout/list_canteen_header"
|
app:outer_view="@layout/list_canteen_header"
|
||||||
app:inner_view="@layout/list_canteen_body"
|
app:inner_view="@layout/list_canteen_body"
|
||||||
app:animationDuration="300"
|
app:animationDuration="300"
|
||||||
app:startExpanded="true" />
|
app:startExpanded="false" />
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
app:icon="@drawable/ic_event"
|
app:icon="@drawable/ic_event"
|
||||||
|
|||||||
@@ -53,4 +53,12 @@
|
|||||||
<string name="pref_price_group_title">Canteen Price Group</string>
|
<string name="pref_price_group_title">Canteen Price Group</string>
|
||||||
<string name="pref_price_group_summary">Only show specific price category</string>
|
<string name="pref_price_group_summary">Only show specific price category</string>
|
||||||
<string name="pref_price_group_dialog">Price Group Selection</string>
|
<string name="pref_price_group_dialog">Price Group Selection</string>
|
||||||
|
<string name="meals">Meals</string>
|
||||||
|
<string name="special_meals">Special meals</string>
|
||||||
|
<string name="side_dishes">Side Dishes</string>
|
||||||
|
<string name="desserts">Desserts</string>
|
||||||
|
<string name="salats">Salats</string>
|
||||||
|
<string name="soups">Soups</string>
|
||||||
|
<string name="starters">Starters</string>
|
||||||
|
<string name="others">Others</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user