Manual merge conflict bug fixes

This commit is contained in:
Clayton Wilson 2020-10-31 21:12:52 -04:00
parent a13f2d288f
commit bc66026bd3
2 changed files with 28 additions and 51 deletions

View File

@ -63,9 +63,6 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
final int listID = (int) getIntent().getSerializableExtra("listID");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
listView = findViewById(R.id.listView);
myAdapter = new MyAdapter(this, pNames, pStores, pPrices, pQuantity, pImages);
@ -78,6 +75,7 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
clearAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("clicked");
pNames.clear();
pStores.clear();
pPrices.clear();
@ -91,7 +89,9 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
catch(Exception e) {}
}
listView.setAdapter(myAdapter);
totalPrice = 0;
tvTotalPrice.setText(String.format("$%.2f", totalPrice));
myAdapter.notifyDataSetChanged();
}
});

View File

@ -1,49 +1,3 @@
<?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">
<Button
android:id="@+id/buttonClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:text="Clear All"
android:textSize="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/buttonShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginTop="10dp"
android:text="Share"
android:textSize="10dp"
app:layout_constraintStart_toEndOf="@+id/buttonClear"
app:layout_constraintTop_toTopOf="parent" />
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="1dp"
android:paddingBottom="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
@ -59,10 +13,34 @@
android:indeterminate="true"
android:visibility="gone"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/buttonClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:text="Clear All"
android:textSize="10sp"/>
<Button
android:id="@+id/buttonShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginTop="10dp"
android:text="Share"
android:textSize="10sp"/>
</LinearLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView"
android:layout_marginTop="50dp"
android:paddingBottom="20dp">
</ListView>
@ -89,5 +67,4 @@
android:text="@string/default__00_00"/>
</LinearLayout>
</RelativeLayout>