Prices more beautiful
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package de.sebse.fuplanner.fragments.canteen;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -17,6 +18,11 @@ import de.sebse.fuplanner.tools.ui.StringViewHolder;
|
||||
public class MealAdapter extends BaseExpandableListAdapter {
|
||||
|
||||
private Day mDay = null;
|
||||
private Context mContext;
|
||||
|
||||
public MealAdapter(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChild(int groupPosition, int childPosititon) {
|
||||
@@ -90,7 +96,7 @@ public class MealAdapter extends BaseExpandableListAdapter {
|
||||
ItemViewHolder itemHolder = new ItemViewHolder(convertView);
|
||||
itemHolder.mTitle.setText(meal.getName());
|
||||
itemHolder.mSubLeft.setText(meal.getCategory());
|
||||
itemHolder.mSubRight.setText(meal.getPriceStdnt()+"/"+meal.getPriceEmply()+"/"+meal.getPriceOther());
|
||||
itemHolder.mSubRight.setText(mContext.getResources().getString(R.string.prices, meal.getPriceStdnt(), meal.getPriceEmply(), meal.getPriceOther()));
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class MealFragment extends Fragment {
|
||||
View view = inflater.inflate(R.layout.fragment_expandable_list_view, container, false);
|
||||
// Set the adapter
|
||||
ExpandableListView expandableListView = view.findViewById(R.id.list);
|
||||
adapter = new MealAdapter();
|
||||
adapter = new MealAdapter(getContext());
|
||||
expandableListView.setAdapter(adapter);
|
||||
|
||||
// Getting SwipeContainerLayout
|
||||
|
||||
@@ -45,4 +45,5 @@
|
||||
<string name="refresh">Refresh</string>
|
||||
<string name="go_to_today">Go to today</string>
|
||||
<string name="canteens">Canteens</string>
|
||||
<string name="prices">%1$.2f / %2$.2f / %3$.2f</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user