fix: 退定无效果 && update: 酒水 #14
|
@ -3,8 +3,6 @@
|
|||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/SCOS.iml" filepath="$PROJECT_DIR$/SCOS.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/SCOS.iml" filepath="$PROJECT_DIR$/SCOS.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
|
|
@ -115,8 +115,15 @@ public class BaseFoodFragment extends Fragment {
|
|||
public void onClick(View v) {
|
||||
int postion = holder.getAdapterPosition();
|
||||
Food food = mFoodList.get(postion);
|
||||
Toast.makeText(v.getContext(),"点菜成功",Toast.LENGTH_SHORT).show();
|
||||
holder.food_btn.setText("退点");
|
||||
|
||||
if(holder.food_btn.getText().equals("退点")){
|
||||
Toast.makeText(v.getContext(),"退点成功",Toast.LENGTH_SHORT).show();
|
||||
holder.food_btn.setText("点菜");
|
||||
}else{
|
||||
Toast.makeText(v.getContext(),"点菜成功",Toast.LENGTH_SHORT).show();
|
||||
holder.food_btn.setText("退点");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return holder;
|
||||
|
|
|
@ -7,6 +7,8 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import es.source.code.model.Food;
|
||||
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
|
@ -15,6 +17,13 @@ public class DrinkFoodFragment extends BaseFoodFragment {
|
|||
|
||||
@Override
|
||||
public void initFoods() {
|
||||
|
||||
for (int i = 0;i < 3;i++){
|
||||
Food coldFood = new Food(R.drawable.ic_wine,"10","啤酒");
|
||||
foodlist.add(coldFood);
|
||||
Food coldFood_2 = new Food(R.drawable.ic_wine,"20","红酒");
|
||||
foodlist.add(coldFood_2);
|
||||
Food coldFood_3 = new Food(R.drawable.ic_wine,"30","茅台");
|
||||
foodlist.add(coldFood_3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
app/src/main/res/drawable/ic_wine.png
Normal file
BIN
app/src/main/res/drawable/ic_wine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Loading…
Reference in New Issue
Block a user