diff --git a/Listify/app/src/main/AndroidManifest.xml b/Listify/app/src/main/AndroidManifest.xml
index d6e08aa..9de69e3 100644
--- a/Listify/app/src/main/AndroidManifest.xml
+++ b/Listify/app/src/main/AndroidManifest.xml
@@ -34,7 +34,7 @@
-
+
\ No newline at end of file
diff --git a/Listify/app/src/main/java/com/example/listify/List.java b/Listify/app/src/main/java/com/example/listify/List.java
new file mode 100644
index 0000000..ae251ea
--- /dev/null
+++ b/Listify/app/src/main/java/com/example/listify/List.java
@@ -0,0 +1,76 @@
+package com.example.listify;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class List extends AppCompatActivity {
+ ListView listView;
+ String listName = "Sample List";
+ String[] pNames = {"Half-gallon organic whole milk"};
+ String[] pStores = {"Kroger"};
+ String[] pPrices = {"$5.00"};
+ int[] pImages = {R.drawable.milk};
+
+ //List(String name) {
+ // listName = name;
+ //}
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_list);
+
+ listView = findViewById(R.id.listView);
+
+ MyAdapter myAdapter = new MyAdapter(this, pNames, pStores, pPrices, pImages);
+ listView.setAdapter(myAdapter);
+ }
+
+ class MyAdapter extends ArrayAdapter {
+ Context context;
+ String[] pNames;
+ String[] pStores;
+ String[] pPrices;
+ int[] pImages;
+
+ MyAdapter (Context c, String[] names, String[] stores, String[] prices, int[] images) {
+ super(c, R.layout.listproduct, R.id.productView, names);
+ context = c;
+ pNames = names;
+ pStores = stores;
+ pPrices = prices;
+ pImages = images;
+ }
+
+ @NonNull
+ @Override
+ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
+ LayoutInflater layoutInflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ View listproduct = layoutInflater.inflate(R.layout.listproduct, parent,false);
+
+ ImageView image = listproduct.findViewById(R.id.imageView);
+ TextView name = listproduct.findViewById(R.id.productView);
+ TextView store = listproduct.findViewById(R.id.storeView);
+ TextView price = listproduct.findViewById(R.id.priceView);
+
+ image.setImageResource(pImages[position]);
+ name.setText(pNames[position]);
+ store.setText(pStores[position]);
+ price.setText(pPrices[position]);
+
+ return listproduct;
+ }
+ }
+}
diff --git a/Listify/app/src/main/java/com/example/listify/MainActivity.java b/Listify/app/src/main/java/com/example/listify/MainActivity.java
index 99ff02d..0e8061b 100644
--- a/Listify/app/src/main/java/com/example/listify/MainActivity.java
+++ b/Listify/app/src/main/java/com/example/listify/MainActivity.java
@@ -59,8 +59,10 @@ public class MainActivity extends AppCompatActivity {
//------------------------------------------------------------------------------------------//
- boolean testAPI = true;
+
+ boolean testAPI = false;
//----------------------------------API Testing---------------------------------------------//
+
if (testAPI) {
AuthManager authManager = new AuthManager();
try {
@@ -109,18 +111,16 @@ public class MainActivity extends AppCompatActivity {
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
-// FloatingActionButton fab = findViewById(R.id.fab);
-// fab.setOnClickListener(new View.OnClickListener() {
-// @Override
-// public void onClick(View view) {
-// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
-// .setAction("Action", null).show();
-// }
-// });
+ /*FloatingActionButton fab = findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
+ }
+ });*/
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
- // Passing each menu ID as a set of Ids because each
- // menu should be considered as top level destinations.
+ // Passing each menu ID as a set of Ids because each menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
.setDrawerLayout(drawer)
@@ -128,14 +128,12 @@ public class MainActivity extends AppCompatActivity {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
-
// Handle search button click
ImageButton searchButton = (ImageButton) findViewById(R.id.searchButton);
searchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, SearchResults.class);
-
// Send user to SearchResults activity
startActivity(intent);
overridePendingTransition(R.anim.enter_from_left, R.anim.exit_from_left);
@@ -144,13 +142,12 @@ public class MainActivity extends AppCompatActivity {
});
}
-// @Override
-// public boolean onCreateOptionsMenu(Menu menu) {
-// // Inflate the menu; this adds items to the action bar if it is present.
-// getMenuInflater().inflate(R.menu.main, menu);
-// return true;
-// }
-
+ /*@Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ //Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.main, menu);
+ return true;
+ }*/
@Override
public boolean onSupportNavigateUp() {
diff --git a/Listify/app/src/main/java/com/example/listify/ui/LoginPage.java b/Listify/app/src/main/java/com/example/listify/ui/LoginPage.java
index 3be1966..04682b0 100644
--- a/Listify/app/src/main/java/com/example/listify/ui/LoginPage.java
+++ b/Listify/app/src/main/java/com/example/listify/ui/LoginPage.java
@@ -55,8 +55,8 @@ public class LoginPage extends AppCompatActivity {
try {
authManager.signIn(email, password);
- //Intent intent = new Intent(LoginPage.this, LoginPage.class);
- //startActivity(intent);
+ Intent intent = new Intent(LoginPage.this, MainActivity.class);
+ startActivity(intent);
}
catch(Exception ex) {
//Display "Incorrect email or password" message
diff --git a/Listify/app/src/main/java/com/example/listify/ui/SignupPage.java b/Listify/app/src/main/java/com/example/listify/ui/SignupPage.java
index cc56bc5..ac9aa3c 100644
--- a/Listify/app/src/main/java/com/example/listify/ui/SignupPage.java
+++ b/Listify/app/src/main/java/com/example/listify/ui/SignupPage.java
@@ -68,8 +68,8 @@ public class SignupPage extends AppCompatActivity implements CodePage.CodeDialog
else {
try {
authManager.confirmSignUp(code);
- //Intent intent = new Intent(SignupPage.this, MainActivity.class);
- //startActivity(intent);
+ Intent intent = new Intent(SignupPage.this, MainActivity.class);
+ startActivity(intent);
}
catch (Exception e) {
//Remove user from database
diff --git a/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java b/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java
index 46dcb73..2bb4814 100644
--- a/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java
+++ b/Listify/app/src/main/java/com/example/listify/ui/home/HomeFragment.java
@@ -14,17 +14,29 @@ import com.example.listify.R;
public class HomeFragment extends Fragment {
private Button toLoginPage;
+ private Button toListPage;
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_home, container, false);
+
toLoginPage = (Button) root.findViewById(R.id.button1);
toLoginPage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- Intent intent = new Intent(HomeFragment.this.getActivity(), com.example.listify.ui.SignupPage.class);
+ Intent intent = new Intent(HomeFragment.this.getActivity(), com.example.listify.ui.LoginPage.class);
startActivity(intent);
}
});
+
+ toListPage = (Button) root.findViewById(R.id.button2);
+ toListPage.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(HomeFragment.this.getActivity(), com.example.listify.List.class);
+ startActivity(intent);
+ }
+ });
+
return root;
}
}
\ No newline at end of file
diff --git a/Listify/app/src/main/res/drawable/milk.png b/Listify/app/src/main/res/drawable/milk.png
new file mode 100644
index 0000000..5ebd687
Binary files /dev/null and b/Listify/app/src/main/res/drawable/milk.png differ
diff --git a/Listify/app/src/main/res/drawable/placeholder.png b/Listify/app/src/main/res/drawable/placeholder.png
new file mode 100644
index 0000000..9db0c3a
Binary files /dev/null and b/Listify/app/src/main/res/drawable/placeholder.png differ
diff --git a/Listify/app/src/main/res/layout/activity_list.xml b/Listify/app/src/main/res/layout/activity_list.xml
new file mode 100644
index 0000000..65c12f4
--- /dev/null
+++ b/Listify/app/src/main/res/layout/activity_list.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Listify/app/src/main/res/layout/format_list.xml b/Listify/app/src/main/res/layout/format_list.xml
deleted file mode 100644
index 8e2ba7b..0000000
--- a/Listify/app/src/main/res/layout/format_list.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Listify/app/src/main/res/layout/fragment_home.xml b/Listify/app/src/main/res/layout/fragment_home.xml
index ac1b34e..054c57e 100644
--- a/Listify/app/src/main/res/layout/fragment_home.xml
+++ b/Listify/app/src/main/res/layout/fragment_home.xml
@@ -10,32 +10,39 @@
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginEnd="1dp"
- android:layout_marginRight="1dp"
- android:layout_marginTop="29dp"
- android:text="Button"
- app:layout_constraintEnd_toEndOf="@+id/switch2"
- app:layout_constraintTop_toBottomOf="@+id/switch2" />
+ android:layout_marginBottom="25dp"
+ android:layout_marginStart="1dp"
+ android:text="Log in"
+ app:layout_constraintBottom_toTopOf="@+id/button2"
+ app:layout_constraintStart_toStartOf="@+id/button2" />
-
+ android:layout_marginBottom="148dp"
+ android:text="List"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent" />
+
+
+ app:layout_constraintStart_toStartOf="parent" />
\ No newline at end of file
diff --git a/Listify/app/src/main/res/layout/listproduct.xml b/Listify/app/src/main/res/layout/listproduct.xml
new file mode 100644
index 0000000..a4d65fe
--- /dev/null
+++ b/Listify/app/src/main/res/layout/listproduct.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file