Getting back mainactivity and adding categories
This commit is contained in:
		| @@ -49,6 +49,8 @@ dependencies { | ||||
|     androidTestImplementation(libs.androidx.junit) | ||||
|     androidTestImplementation(libs.androidx.espresso.core) | ||||
|  | ||||
|     implementation("com.google.android.material:1.2.0") | ||||
|  | ||||
|     // Barcode scanning API | ||||
|     implementation (libs.barcode.scanning) | ||||
| // CameraX library | ||||
|   | ||||
| @@ -37,7 +37,7 @@ | ||||
|  | ||||
|         <provider | ||||
|                 android:name="androidx.core.content.FileProvider" | ||||
|                 android:authorities="com.google.firebase.components.activities.StorageActivity.provider;com.google.firebase.components.activities.FullscreenActivity.provider;com.google.firebase.components.activities.AddProductActivity.provider" | ||||
|                 android:authorities="com.google.firebase.components.activities.MainActivity.provider;com.google.firebase.components.activities.FullscreenActivity.provider;com.google.firebase.components.activities.AddProductActivity.provider" | ||||
|                 android:exported="false" | ||||
|                 android:grantUriPermissions="true"> | ||||
|             <meta-data | ||||
| @@ -51,7 +51,7 @@ | ||||
|         </meta-data> | ||||
|  | ||||
|         <activity | ||||
|                 android:name=".activities.StorageActivity" | ||||
|                 android:name=".activities.MainActivity" | ||||
|                 android:exported="true" | ||||
|                 android:theme="@style/Theme.BarcodeScannerForEmployees"> | ||||
|             <intent-filter> | ||||
|   | ||||
| @@ -19,7 +19,7 @@ import org.foxarmy.barcodescannerforemployees.databinding.ActivityStorageBinding | ||||
| import org.foxarmy.barcodescannerforemployees.fragments.StorageFragment | ||||
| import org.foxarmy.barcodescannerforemployees.views.AbstractProductView | ||||
| 
 | ||||
| class StorageActivity : AppCompatActivity() { | ||||
| class MainActivity : AppCompatActivity() { | ||||
| 
 | ||||
|     private lateinit var appBarConfiguration: AppBarConfiguration | ||||
|     private lateinit var binding: ActivityStorageBinding | ||||
| @@ -0,0 +1,70 @@ | ||||
| package org.foxarmy.barcodescannerforemployees.fragments | ||||
|  | ||||
| import android.os.Bundle | ||||
| import android.view.LayoutInflater | ||||
| import android.view.View | ||||
| import android.view.ViewGroup | ||||
| import androidx.fragment.app.Fragment | ||||
| import org.foxarmy.barcodescannerforemployees.R | ||||
|  | ||||
| class CategoriesFragment : Fragment() { | ||||
|     override fun onCreate(savedInstanceState: Bundle?) { | ||||
|         super.onCreate(savedInstanceState) | ||||
|     } | ||||
|  | ||||
|     override fun onCreateView( | ||||
|         inflater: LayoutInflater, container: ViewGroup?, | ||||
|         savedInstanceState: Bundle? | ||||
|     ): View? { | ||||
|         // Inflate the layout for this fragment | ||||
|         return inflater.inflate(R.layout.fragment_categories, container, false) | ||||
|     } | ||||
|  | ||||
|     override fun onResume() { | ||||
|         super.onResume() | ||||
|  | ||||
| //        updateContent() | ||||
|     } | ||||
|  | ||||
| //    public fun updateContent() { | ||||
| // | ||||
| //        val grv = getView()?.findViewById<GridLayout>(R.id.contentGridLayout) | ||||
| //        grv?.removeAllViews() | ||||
| // | ||||
| //        val db = DBStorageController(requireContext()).readableDatabase | ||||
| //        val projection = arrayOf( | ||||
| //            BaseColumns._ID, | ||||
| //            ProductContract.ProductEntry.PRODUCT_NAME, | ||||
| //            ProductContract.ProductEntry.PRODUCT_NET_WEIGHT, | ||||
| //            ProductContract.ProductEntry.IMAGE_FILENAME | ||||
| //        ) | ||||
| // | ||||
| //        val cursor = db.query(ProductContract.ProductEntry.TABLE_NAME, projection, null, null, null, null, null) | ||||
| // | ||||
| //        with (cursor) { | ||||
| //            while(moveToNext()) { | ||||
| //                val productId = getInt(getColumnIndexOrThrow(BaseColumns._ID)) | ||||
| //                val productName = getString(getColumnIndexOrThrow(ProductContract.ProductEntry.PRODUCT_NAME)) | ||||
| //                val netWeight = getDouble(getColumnIndexOrThrow(ProductContract.ProductEntry.PRODUCT_NET_WEIGHT)) | ||||
| //                val productImageHash = getString(getColumnIndexOrThrow(ProductContract.ProductEntry.IMAGE_FILENAME)) | ||||
| // | ||||
| //                val product = AbstractProduct(productId, productName, netWeight, productImageHash, 1) | ||||
| // | ||||
| //                generateThumbnailForImage(context!!, productImageHash) | ||||
| // | ||||
| //                val abstractProduct = AbstractProductView( | ||||
| //                    requireActivity(), | ||||
| //                    requireContext(), | ||||
| //                    product | ||||
| //                ) | ||||
| //                grv?.addView(abstractProduct) | ||||
| //            } | ||||
| //        } | ||||
| //    } | ||||
|  | ||||
|     override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||||
|         super.onViewCreated(view, savedInstanceState) | ||||
|  | ||||
| //        updateContent() | ||||
|     } | ||||
| } | ||||
| @@ -6,7 +6,7 @@ | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:fitsSystemWindows="true" | ||||
|         tools:context=".activities.StorageActivity"> | ||||
|         tools:context=".activities.MainActivity"> | ||||
| 
 | ||||
|     <androidx.constraintlayout.widget.ConstraintLayout | ||||
|             android:layout_width="match_parent" | ||||
| @@ -16,5 +16,5 @@ | ||||
|             app:layout_constraintTop_toTopOf="parent" | ||||
|             app:layout_constraintBottom_toBottomOf="parent" | ||||
|             app:defaultNavHost="true" | ||||
|             app:navGraph="@navigation/nav_graph_storage"/> | ||||
|             app:navGraph="@navigation/nav_graph_main"/> | ||||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||||
							
								
								
									
										13
									
								
								app/src/main/res/layout/fragment_categories.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/src/main/res/layout/fragment_categories.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <FrameLayout 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" | ||||
|              android:id="@+id/fragment_storage" | ||||
|              tools:context=".fragments.CategoriesFragment"> | ||||
|     <ScrollView | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:id="@+id/categoriesLayout"> | ||||
|     </ScrollView> | ||||
| </FrameLayout> | ||||
| @@ -1,7 +1,7 @@ | ||||
| <menu 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" | ||||
|       tools:context="org.foxarmy.barcodescannerforemployees.activities.StorageActivity"> | ||||
|       tools:context="org.foxarmy.barcodescannerforemployees.activities.MainActivity"> | ||||
|     <item android:id="@+id/action_settings" | ||||
|           android:title="@string/action_settings" | ||||
|           android:orderInCategory="100" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user