Commit 845443a8 by Paktalin

order details activity created

parent dc9497ac
......@@ -31,6 +31,7 @@
<activity android:name=".CollectionActivity"/>
<activity android:name=".OrderActivity"/>
<activity android:name=".QueryResultsActivity"/>
<activity android:name=".OrderDetailsActivity"/>
</application>
</manifest>
\ No newline at end of file
package com.example.paktalin.lavina;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
/**
* Created by Paktalin on 14/05/2018.
*/
public class OrderDetailsActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_details);
}
}
package com.example.paktalin.lavina.adapters;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -8,6 +9,7 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.paktalin.lavina.MainActivity;
import com.example.paktalin.lavina.R;
import com.example.paktalin.lavina.WineBottle;
......@@ -19,10 +21,12 @@ public class WineAdapterMain extends BaseAdapter {
private LayoutInflater inflater;
private WineBottle[] wines;
Context context;
public WineAdapterMain(Context context, WineBottle[] wines) {
this.wines = wines;
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.context = context;
}
@Override
......@@ -54,6 +58,14 @@ public class WineAdapterMain extends BaseAdapter {
((TextView)convertView.findViewById(R.id.wine_shop)).setText(bottle.getPrice());
((ImageView)convertView.findViewById(R.id.wine_image)).setImageBitmap(bottle.getImage());
convertView.findViewById(R.id.button_order).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, MainActivity.class);
context.startActivity(intent);
}
});
return convertView;
}
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout>
\ 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