2019-pracownia-programowani.../Lookify/app/src/main/java/com/example/lookifyv2/Popup.java

53 lines
2.3 KiB
Java

package com.example.lookifyv2;
import android.os.Bundle;
import android.text.Html;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.bumptech.glide.Glide;
public class Popup extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_popup);
//Do strzałki powrotu w górnej części ekranu.
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ImageView productImage = findViewById(R.id.productimagedet);
TextView productCode = findViewById(R.id.productcodedet);
TextView productName = findViewById(R.id.productnamedet);
TextView productPrice = findViewById(R.id.productpricedet);
TextView productRetailer = findViewById(R.id.productretailerdet);
TextView productColour = findViewById(R.id.productcolourdet);
TextView productStyle = findViewById(R.id.productstyledet);
TextView productCollection = findViewById(R.id.productcollectiondet);
Bundle bundle = this.getIntent().getExtras();
//Do załadowania obrazka używana jest zewnętrzna biblioteka Glide.
Glide.with(this).load((String) bundle.getSerializable("productimage")).into(productImage);
productCode.setText(Html.fromHtml("<b>" + "Kod produktu:" + "</b> " + bundle.getSerializable("productcode")));
productName.setText(Html.fromHtml("<b>" + "Nazwa produktu:" + "</b> " + bundle.getSerializable("productname")));
productPrice.setText(Html.fromHtml("<b>" + "Cena:" + "</b> " + bundle.getSerializable("productprice")));
productRetailer.setText(Html.fromHtml("<b>" + "Producent:" + "</b> " + bundle.getSerializable("productretailer")));
productColour.setText(Html.fromHtml("<b>" + "Kolor:" + "</b> " + bundle.getSerializable("productcolour")));
productStyle.setText(Html.fromHtml("<b>" + "Styl:" + "</b> " + bundle.getSerializable("productstyle")));
productCollection.setText(Html.fromHtml("<b>" + "Kolekcja:" + "</b> " + bundle.getSerializable("productcollection")));
}
//Kliknięcie strzałki powrotu kończy Activity.
@Override
public boolean onSupportNavigateUp(){
finish();
return true;
}
}