Commit a47bafc7 by Paktalin

fixed logic of submitting order

parent 845443a8
package com.example.paktalin.lavina; package com.example.paktalin.lavina;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.View;
/** /**
* Created by Paktalin on 07/05/2018. * Created by Paktalin on 07/05/2018.
...@@ -13,5 +15,13 @@ public class MapActivity extends AppCompatActivity { ...@@ -13,5 +15,13 @@ public class MapActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map); setContentView(R.layout.activity_map);
(findViewById(R.id.button_ok)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MapActivity.this, OrderDetailsActivity.class);
startActivity(intent);
}
});
} }
} }
...@@ -9,7 +9,7 @@ import android.widget.BaseAdapter; ...@@ -9,7 +9,7 @@ import android.widget.BaseAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.example.paktalin.lavina.MainActivity; import com.example.paktalin.lavina.MapActivity;
import com.example.paktalin.lavina.R; import com.example.paktalin.lavina.R;
import com.example.paktalin.lavina.WineBottle; import com.example.paktalin.lavina.WineBottle;
...@@ -61,7 +61,7 @@ public class WineAdapterMain extends BaseAdapter { ...@@ -61,7 +61,7 @@ public class WineAdapterMain extends BaseAdapter {
convertView.findViewById(R.id.button_order).setOnClickListener(new View.OnClickListener() { convertView.findViewById(R.id.button_order).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(context, MainActivity.class); Intent intent = new Intent(context, MapActivity.class);
context.startActivity(intent); context.startActivity(intent);
} }
}); });
......
...@@ -41,7 +41,9 @@ ...@@ -41,7 +41,9 @@
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="20dp"> android:layout_margin="20dp"
android:layout_toEndOf="@+id/image"
android:layout_toRightOf="@+id/image">
<TextView <TextView
android:id="@+id/restaurant_name" android:id="@+id/restaurant_name"
...@@ -69,11 +71,21 @@ ...@@ -69,11 +71,21 @@
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:id="@+id/image"
android:layout_width="180dp" android:layout_width="180dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/wine_info1"/>
<Button
android:id="@+id/button_ok"
android:layout_width="10dp"
android:layout_height="20dp"
android:background="@drawable/arrow_right"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:background="@drawable/wine_info1"/> android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/red_background">
<RelativeLayout
android:id="@+id/header"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@android:color/transparent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Order details"
android:textColor="@android:color/white"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textSize="20dp"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/header"
android:background="@android:color/white">
<TextView
android:id="@+id/grab_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Grab your order in Meat & Wine withing two days"
android:textColor="@color/colorPrimaryDark"
android:layout_centerHorizontal="true"
android:padding="10dp"/>
<ImageView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="150dp"
android:src="@drawable/map_cut"
android:layout_below="@id/grab_order"/>
<RelativeLayout
android:id="@+id/order_info"
android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout>
\ No newline at end of file </RelativeLayout>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/map"
android:text="Langhe Nebbiolo Bric Cenciurio 2016"/>
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/map"
android:text="€13.50"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment