Skip to content
Snippets Groups Projects
Commit 2d0e23fc authored by MAUGEZ Emeline's avatar MAUGEZ Emeline
Browse files

WheelActivity working

parent 36a1c4f1
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ import com.bluehomestudio.luckywheel.LuckyWheel;
import com.bluehomestudio.luckywheel.OnLuckyWheelReachTheTarget;
import com.bluehomestudio.luckywheel.WheelItem;
import com.example.robotise.R;
import com.example.robotise.ble.DeviceControl;
import com.example.robotise.model.IngredientItem;
import com.example.robotise.model.Ingredients;
......@@ -48,7 +49,14 @@ public class WheelActivity extends AppCompatActivity {
int purple200 = ResourcesCompat.getColor(getResources(), R.color.purple_200, null);
int purple500 = ResourcesCompat.getColor(getResources(), R.color.purple_500, null);
ArrayList<Integer> colors = new ArrayList<Integer>(Arrays.asList(purple200, purple500));
ArrayList<IngredientItem> ings= Ingredients.getInstance().ings;
ArrayList<IngredientItem> ings = new ArrayList<>();
for (IngredientItem ingredientItem:Ingredients.getInstance().ings){
if (ingredientItem.bec>0){
ings.add(ingredientItem);
}
}
for(int i=0;i< ings.size();i++){
WheelItem wi = new WheelItem(colors.get(i%2),
BitmapFactory.decodeResource(getResources(), com.bluehomestudio.luckywheel.R.drawable.ic_action_name), ings.get(i).name);
......@@ -72,6 +80,8 @@ public class WheelActivity extends AppCompatActivity {
}
msg = msg.substring(0, msg.length()-1);
DeviceControl.getInstance().writeOnCommanderCocktailCharacteristic(msg);
Toast.makeText(getApplicationContext(), affichage, Toast.LENGTH_LONG).show();
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment