This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--------------------------------------------- | |
// DRINK ITEMS / IMAGES ON CAROUSEL! | |
//--------------------------------------------- | |
carouselPicker1 = findViewById(R.id.carouselPicker1); | |
carouselPicker2 = findViewById(R.id.carouselPicker2); | |
carouselPicker3 = findViewById(R.id.carouselPicker3); | |
//VODKA BASED DRINKS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--------------------------------------------- | |
// DRINK SELECTORS / DRINK RECIPES | |
//--------------------------------------------- | |
//VODKA BASED DRINKS | |
carouselPicker1.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { | |
@Override | |
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--------------------------------------------- | |
// DRINK SELECTORS / DRINK RECIPES | |
//--------------------------------------------- | |
//VODKA BASED DRINKS | |
carouselPicker1.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { | |
@Override | |
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BUTTON TO INITIATE POPUP | |
public void ShowPopup(View v) { | |
TextView txtclose; | |
Button btnOrder; | |
myDialog.setContentView(R.layout.custompopup); | |
txtclose = (TextView) myDialog.findViewById(R.id.txtclose); | |
btnOrder = (Button) myDialog.findViewById(R.id.btnorder); | |
txtclose.setOnClickListener(new View.OnClickListener() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FINAL ORDER BUTTON (POPUP, SENDS DRINK ARRAY TO ARDUINO) | |
//------------------------------------------------ | |
public void onClickOrder(View view) { | |
//The Functions bellow are converting intiger values into strings which can then be written to the arduino via a Serial Connection | |
String VodkaOrder = Integer.toString(Vodka_Measure); | |
String RumOrder = Integer.toString(Rum_Measure); | |
String GinOrder = Integer.toString(Gin_Measure); | |
String WhiskeyOrder = Integer.toString(Whiskey_Measure); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.carouselpicker; | |
import android.app.Dialog; | |
import android.graphics.Color; | |
import android.graphics.drawable.ColorDrawable; | |
import android.support.v4.view.ViewPager; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; |