0% found this document useful (0 votes)
94 views4 pages

HGJHGHJG

The document describes a coffee ordering Android app. It includes a Menue activity class with methods to launch an intent for each coffee type when its button is clicked, passing the price as an extra. The activity layout contains image buttons and text for each coffee type linked to these methods, within a scroll view over a background image. Selecting a coffee button will open the MainActivity and pass the price to order that coffee.

Uploaded by

Vinayak Lokhande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views4 pages

HGJHGHJG

The document describes a coffee ordering Android app. It includes a Menue activity class with methods to launch an intent for each coffee type when its button is clicked, passing the price as an extra. The activity layout contains image buttons and text for each coffee type linked to these methods, within a scroll view over a background image. Selecting a coffee button will open the MainActivity and pass the price to order that coffee.

Uploaded by

Vinayak Lokhande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

android:id="@+id/col1umumba"

android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:backgroundTint="#000000"
android:onClick="mumbai"
android:scaleType="fitCenter"
app:srcCompat="@drawable/umumba"
tools:ignore="SpeakableTextPresentCheck" />

public class menue extends AppCompatActivity {

public static final String EXTRA_Price = "com.example.coffeeorderingapp"; //


public static final String EXTRA_NAME = "America";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menue);
}

// MainCode ===>

public void blackcofbtn(View view){


Intent intent = new Intent(this,MainActivity.class);
String price = "20";
intent.putExtra(EXTRA_Price,price);
startActivity(intent);
}

public void lattecofbtn(View view){


Intent intent = new Intent(this,MainActivity.class);
String price = "50";
intent.putExtra(EXTRA_Price,price);
startActivity(intent);
}

public void americanocofbtn(View view){


Intent intent = new Intent(this,MainActivity.class);
String price = "70";
intent.putExtra(EXTRA_Price,price);
startActivity(intent);
}

public void espressocofbtn(View view){


Intent intent = new Intent(this,MainActivity.class);
String price = "100";
intent.putExtra(EXTRA_Price,price);
startActivity(intent);
}
public void cappuccinocofbtn(View view){
Intent intent = new Intent(this,MainActivity.class);
String price = "120";
intent.putExtra(EXTRA_Price,price);
startActivity(intent);
}
}

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".menue">

<ImageView
android:id="@+id/imageView7"
android:layout_width="1110dp"
android:layout_height="1937dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/coffeepng" />

<ScrollView
android:layout_width="914dp"
android:layout_height="1638dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/textView9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:backgroundTint="#000000"
android:text="Our Coffee Menue"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="34sp"
android:textStyle="bold" />

<ImageButton
android:id="@+id/Blackcofbtn"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:onClick="blackcofbtn"
app:srcCompat="@drawable/blackcoffee"
tools:ignore="SpeakableTextPresentCheck" />

<TextView
android:id="@+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="Black for Rs.20 "
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />

<ImageButton
android:id="@+id/lattecofbtn"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:onClick="lattecofbtn"
app:srcCompat="@drawable/cofeepng"
tools:ignore="SpeakableTextPresentCheck" />

<TextView
android:id="@+id/textView11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="Latte for Rs.50"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />

<ImageButton
android:id="@+id/americanocofbtn"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:onClick="americanocofbtn"
app:srcCompat="@drawable/cofeepng"
tools:ignore="SpeakableTextPresentCheck" />

<TextView
android:id="@+id/textView14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="Americano for Rs.70"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />

<ImageButton
android:id="@+id/espressocofbtn"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:onClick="espressocofbtn"
app:srcCompat="@drawable/cofeepng"
tools:ignore="SpeakableTextPresentCheck" />

<TextView
android:id="@+id/textView15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="Espresso for Rs.100"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />

<ImageButton
android:id="@+id/cappuccinocofbtn"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:onClick="cappuccinocofbtn"
app:srcCompat="@drawable/cofeepng"
tools:ignore="SpeakableTextPresentCheck" />

<TextView
android:id="@+id/textView16"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="Cappuccino for Rs.120"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />

</LinearLayout>
</ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>

You might also like