translated app to russian
This commit is contained in:
		@@ -1,6 +1,5 @@
 | 
			
		||||
package org.foxarmy.barcodescannerforemployees
 | 
			
		||||
 | 
			
		||||
import android.util.Log
 | 
			
		||||
import org.foxarmy.barcodescannerforemployees.dataclasses.AbstractProduct
 | 
			
		||||
 | 
			
		||||
class Parser constructor() {
 | 
			
		||||
@@ -14,9 +13,6 @@ class Parser constructor() {
 | 
			
		||||
                val found = foundByRegex.groupValues[0]
 | 
			
		||||
                text = text.replace(found, "")
 | 
			
		||||
                netWeight = stripNetWeight(found)
 | 
			
		||||
//                when (found.lowercase().strip()) {
 | 
			
		||||
//                    "кг" -> netWeight *= 1000
 | 
			
		||||
//                    "мл" -> netWeight /= 1000
 | 
			
		||||
//                }
 | 
			
		||||
                return Triple(text, netWeight, found)
 | 
			
		||||
            }
 | 
			
		||||
@@ -46,7 +42,6 @@ class Parser constructor() {
 | 
			
		||||
 | 
			
		||||
            else -> { -1 }
 | 
			
		||||
        }
 | 
			
		||||
        Log.d("QWERTYUIOP", "Unit: ${strippedUnit}, number: ${unitNumber}")
 | 
			
		||||
 | 
			
		||||
        return AbstractProduct(0, "", name, netWeight, "", 0, unitNumber)
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -103,21 +103,21 @@ class AddAbstractProductActivity : AppCompatActivity() {
 | 
			
		||||
            val productName = productNameText.text.toString()
 | 
			
		||||
            val netWeight = netWeightText.text
 | 
			
		||||
            if (abstractProduct == null && (!this::pictureFile.isInitialized || !pictureFile.exists())) {
 | 
			
		||||
                Toast.makeText(this, "Please, make a picture of a product!", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.product_picture_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                return@setOnClickListener
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (barcode == "") {
 | 
			
		||||
                Toast.makeText(this, "Please, scan barcode on a product", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.product_barcode_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                return@setOnClickListener
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (productName == "") {
 | 
			
		||||
                Toast.makeText(this, "Please, write a name of a product!", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.product_name_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                return@setOnClickListener
 | 
			
		||||
            }
 | 
			
		||||
            if (netWeight.toString() == "" || netWeight.toString().toDoubleOrNull() == null) {
 | 
			
		||||
                Toast.makeText(this, "Please, write a valid net weight of a product!", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.product_net_weight_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            val db = DBStorageController(this).writableDatabase
 | 
			
		||||
@@ -294,14 +294,14 @@ class AddAbstractProductActivity : AppCompatActivity() {
 | 
			
		||||
                    getPicture()
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                Toast.makeText(this, "I need permission in order to take a picture", Toast.LENGTH_LONG).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.camera_permission_for_picture_request), Toast.LENGTH_LONG).show()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    private val scanLauncher = registerForActivityResult(ScanContract()) { result: ScanIntentResult ->
 | 
			
		||||
        run {
 | 
			
		||||
            if (result.contents == null) {
 | 
			
		||||
                Toast.makeText(this, "Cancelled", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.cancelled), Toast.LENGTH_SHORT).show()
 | 
			
		||||
            } else {
 | 
			
		||||
                scanningBarcode = false
 | 
			
		||||
                val scannedBarcode = result.contents
 | 
			
		||||
@@ -314,7 +314,7 @@ class AddAbstractProductActivity : AppCompatActivity() {
 | 
			
		||||
    private fun prepareBarcodeScanner() {
 | 
			
		||||
        val options = ScanOptions()
 | 
			
		||||
        options.setDesiredBarcodeFormats(ScanOptions.EAN_13)
 | 
			
		||||
        options.setPrompt("Scan barcode of a product")
 | 
			
		||||
        options.setPrompt(getString(R.string.scan_barcode_of_a_product))
 | 
			
		||||
        options.setCameraId(0)
 | 
			
		||||
        options.setBeepEnabled(false)
 | 
			
		||||
        options.setBarcodeImageEnabled(true)
 | 
			
		||||
 
 | 
			
		||||
@@ -131,11 +131,11 @@ class AddProductActivity : AppCompatActivity() {
 | 
			
		||||
 | 
			
		||||
        saveProductButton.setOnClickListener {
 | 
			
		||||
            if (expiryDateOverShelfLife == null) {
 | 
			
		||||
                Toast.makeText(this, "Please, choose and fill in shelf life or expiry date.", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.shell_life_or_expiry_date_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                return@setOnClickListener
 | 
			
		||||
            }
 | 
			
		||||
            if (product!!.dateOfProduction == 0.toLong()) {
 | 
			
		||||
                Toast.makeText(this, "Please, choose date of production.", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.date_of_production_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                return@setOnClickListener
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@@ -145,13 +145,13 @@ class AddProductActivity : AppCompatActivity() {
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                if (product!!.dateOfExpiry == 0.toLong()) {
 | 
			
		||||
                    Toast.makeText(this, "Please, choose date of expiry.", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                    Toast.makeText(this, getString(R.string.expiry_date_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                    return@setOnClickListener
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (product!!.amount == 0) {
 | 
			
		||||
                Toast.makeText(this, "Please, specify an amount of product.", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.product_amount_request), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                return@setOnClickListener
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@@ -180,10 +180,10 @@ class AddProductActivity : AppCompatActivity() {
 | 
			
		||||
            shelfLifeTextView.visibility = View.VISIBLE
 | 
			
		||||
        }
 | 
			
		||||
        val dateOfProductionParsed = SimpleDateFormat("dd.MM.yyyy").format(Date(product!!.dateOfProduction * 1000))
 | 
			
		||||
        findViewById<TextView>(R.id.dateOfProductionTextView).text = "Date of production: $dateOfProductionParsed"
 | 
			
		||||
        findViewById<TextView>(R.id.dateOfProductionTextView).text = "${getString(R.string.date_of_production)}: $dateOfProductionParsed"
 | 
			
		||||
 | 
			
		||||
        val expiryDateParsed = SimpleDateFormat("dd.MM.yyyy").format(Date(product!!.dateOfExpiry * 1000))
 | 
			
		||||
        expiryDateTextView.text = "Expiry date: $expiryDateParsed"
 | 
			
		||||
        expiryDateTextView.text = "${getString(R.string.expiry_date)}: $expiryDateParsed"
 | 
			
		||||
 | 
			
		||||
        if (amountTextEdit.text.toString() == "") {
 | 
			
		||||
            amountTextEdit.setText(product!!.amount.toString())
 | 
			
		||||
@@ -219,14 +219,14 @@ class AddProductActivity : AppCompatActivity() {
 | 
			
		||||
            if (isGranted) {
 | 
			
		||||
                prepareBarcodeScanner()
 | 
			
		||||
            } else {
 | 
			
		||||
                Toast.makeText(this, "I need permission in order to take a picture", Toast.LENGTH_LONG).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.camera_permission_for_scanning_request), Toast.LENGTH_LONG).show()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    private val scanLauncher = registerForActivityResult(ScanContract()) { result: ScanIntentResult ->
 | 
			
		||||
        run {
 | 
			
		||||
            if (result.contents == null) {
 | 
			
		||||
                Toast.makeText(this, "Cancelled", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                Toast.makeText(this, getString(R.string.cancelled), Toast.LENGTH_SHORT).show()
 | 
			
		||||
            } else {
 | 
			
		||||
                val scannedBarcode = result.contents
 | 
			
		||||
                abstractProduct = DBStorageController(this).findAbstractProductByBarcode(DBStorageController(this).readableDatabase, scannedBarcode)
 | 
			
		||||
@@ -239,7 +239,7 @@ class AddProductActivity : AppCompatActivity() {
 | 
			
		||||
    private fun prepareBarcodeScanner() {
 | 
			
		||||
        val options = ScanOptions()
 | 
			
		||||
        options.setDesiredBarcodeFormats(ScanOptions.EAN_13)
 | 
			
		||||
        options.setPrompt("Scan barcode of a product")
 | 
			
		||||
        options.setPrompt(getString(R.string.scan_barcode_of_a_product))
 | 
			
		||||
        options.setCameraId(0)
 | 
			
		||||
        options.setBeepEnabled(false)
 | 
			
		||||
        options.setBarcodeImageEnabled(true)
 | 
			
		||||
 
 | 
			
		||||
@@ -69,9 +69,9 @@ class MainActivity : AppCompatActivity() {
 | 
			
		||||
    private fun setupViewPager(viewpager: ViewPager) {
 | 
			
		||||
        adapter = ViewPagerAdapter(supportFragmentManager)
 | 
			
		||||
 | 
			
		||||
        adapter.addFragment(CategoriesFragment(), "Categories")
 | 
			
		||||
        adapter.addFragment(StorageFragment(), "Storage")
 | 
			
		||||
        adapter.addFragment(ShelfFragment(), "Shelf")
 | 
			
		||||
        adapter.addFragment(CategoriesFragment(), getString(R.string.categories_title))
 | 
			
		||||
        adapter.addFragment(StorageFragment(), getString(R.string.storage_title))
 | 
			
		||||
        adapter.addFragment(ShelfFragment(), getString(R.string.shelf_title))
 | 
			
		||||
        //TODO: settings fragments
 | 
			
		||||
 | 
			
		||||
        // setting adapter to view pager.
 | 
			
		||||
@@ -99,24 +99,24 @@ class MainActivity : AppCompatActivity() {
 | 
			
		||||
                when (fragment::class.simpleName.toString()) {
 | 
			
		||||
                    "StorageFragment" -> {
 | 
			
		||||
                        AlertDialog.Builder(this)
 | 
			
		||||
                            .setMessage("Deleting an abstract product will also delete ALL the products, that belong to it. Do you want to proceed?")
 | 
			
		||||
                            .setPositiveButton("Yes") { _: DialogInterface, _: Int ->
 | 
			
		||||
                            .setMessage(getString(R.string.deleting_abstract_product_warning))
 | 
			
		||||
                            .setPositiveButton(getString(R.string.yes)) { _: DialogInterface, _: Int ->
 | 
			
		||||
                                val storageFragment = fragment as StorageFragment
 | 
			
		||||
                                storageFragment.removeSelected()
 | 
			
		||||
                            }
 | 
			
		||||
                            .setNegativeButton("No") { _: DialogInterface, _: Int ->
 | 
			
		||||
                            .setNegativeButton(getString(R.string.no)) { _: DialogInterface, _: Int ->
 | 
			
		||||
 | 
			
		||||
                            }.show()
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    "CategoriesFragment" -> {
 | 
			
		||||
                        AlertDialog.Builder(this)
 | 
			
		||||
                            .setMessage("Deleting a category will also delete ALL the products, that belong to that category. Do you want to proceed?")
 | 
			
		||||
                            .setPositiveButton("Yes") { _: DialogInterface, _: Int ->
 | 
			
		||||
                            .setMessage(getString(R.string.deleting_category_warning))
 | 
			
		||||
                            .setPositiveButton(getString(R.string.yes)) { _: DialogInterface, _: Int ->
 | 
			
		||||
                                val categoriesFragment = fragment as CategoriesFragment
 | 
			
		||||
                                categoriesFragment.removeSelected()
 | 
			
		||||
                            }
 | 
			
		||||
                            .setNegativeButton("No") { _: DialogInterface, _: Int ->
 | 
			
		||||
                            .setNegativeButton(getString(R.string.no)) { _: DialogInterface, _: Int ->
 | 
			
		||||
 | 
			
		||||
                            }.show()
 | 
			
		||||
                    }
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ class CategoriesFragment : Fragment() {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!deleted) {
 | 
			
		||||
            Toast.makeText(requireContext(), "Nothing to delete", Toast.LENGTH_SHORT).show()
 | 
			
		||||
            Toast.makeText(requireContext(), getString(R.string.nothing_to_delete), Toast.LENGTH_SHORT).show()
 | 
			
		||||
        }
 | 
			
		||||
        updateContent()
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -69,13 +69,13 @@ class ShelfFragment : Fragment() {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!updated) {
 | 
			
		||||
            Toast.makeText(requireContext(), "Nothing to update", Toast.LENGTH_SHORT).show()
 | 
			
		||||
            Toast.makeText(requireContext(), getString(R.string.nothing_to_update), Toast.LENGTH_SHORT).show()
 | 
			
		||||
        }
 | 
			
		||||
        updateContent()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private fun fillUpSortBySpinner() {
 | 
			
		||||
        val sorts = mutableListOf("Name", "Category", "Freshness", "Date of production", "Date of expiry")
 | 
			
		||||
        val sorts = resources.getStringArray(R.array.product_sort_types)
 | 
			
		||||
 | 
			
		||||
        val arrayAdapter =
 | 
			
		||||
            ArrayAdapter(requireContext(), androidx.appcompat.R.layout.support_simple_spinner_dropdown_item, sorts)
 | 
			
		||||
@@ -109,13 +109,13 @@ class ShelfFragment : Fragment() {
 | 
			
		||||
 | 
			
		||||
            var orderBy: String = ""
 | 
			
		||||
 | 
			
		||||
            when (binding.spinner.selectedItem) {
 | 
			
		||||
                "Name" -> {
 | 
			
		||||
            when (binding.spinner.selectedItemPosition) {
 | 
			
		||||
                0 -> {
 | 
			
		||||
                    orderBy =
 | 
			
		||||
                        "(SELECT ${AbstractProductContract.AbstractProductEntry.PRODUCT_NAME} FROM ${AbstractProductContract.AbstractProductEntry.TABLE_NAME} WHERE ${BaseColumns._ID} = ${ProductContract.ProductEntry.ABSTRACT_PRODUCT_ID}) ASC"
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                "Category" -> {
 | 
			
		||||
                1 -> {
 | 
			
		||||
                    orderBy =
 | 
			
		||||
                        "(SELECT ${AbstractProductContract.AbstractProductEntry.CATEGORY} FROM ${AbstractProductContract.AbstractProductEntry.TABLE_NAME} WHERE ${BaseColumns._ID} = ${ProductContract.ProductEntry.ABSTRACT_PRODUCT_ID}) ASC"
 | 
			
		||||
                }
 | 
			
		||||
@@ -126,11 +126,11 @@ class ShelfFragment : Fragment() {
 | 
			
		||||
//                        "(SELECT ( (julianday(${ProductContract.ProductEntry.EXPIRY_DATE}) - julianday('now', 'localtime')) / (julianday(${ProductContract.ProductEntry.EXPIRY_DATE}) - julianday(${ProductContract.ProductEntry.DATE_OF_PRODUCTION})) )) ASC"
 | 
			
		||||
//                }
 | 
			
		||||
 | 
			
		||||
                "Date of production" -> {
 | 
			
		||||
                3 -> {
 | 
			
		||||
                    orderBy = "${ProductContract.ProductEntry.DATE_OF_PRODUCTION} ASC"
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                "Date of expiry" -> {
 | 
			
		||||
                4 -> {
 | 
			
		||||
                    orderBy = "${ProductContract.ProductEntry.EXPIRY_DATE} ASC"
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -151,7 +151,7 @@ class ShelfFragment : Fragment() {
 | 
			
		||||
 | 
			
		||||
                    val product = Product(productId, abstractProductId, amount, dateOfProduction, dateOfExpiry)
 | 
			
		||||
 | 
			
		||||
                    if (binding.spinner.selectedItem == "Freshness") {
 | 
			
		||||
                    if (binding.spinner.selectedItemPosition == 2) { //freshness
 | 
			
		||||
                        products.add(product)
 | 
			
		||||
                    } else {
 | 
			
		||||
                        val productView = ProductView(
 | 
			
		||||
@@ -200,7 +200,7 @@ class ShelfFragment : Fragment() {
 | 
			
		||||
 | 
			
		||||
            if (!deleted) {
 | 
			
		||||
                activity!!.runOnUiThread {
 | 
			
		||||
                    Toast.makeText(requireContext(), "Nothing to delete", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                    Toast.makeText(requireContext(), getString(R.string.nothing_to_delete), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            updateContent()
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,6 @@ package org.foxarmy.barcodescannerforemployees.fragments
 | 
			
		||||
import android.content.Intent
 | 
			
		||||
import android.os.Bundle
 | 
			
		||||
import android.provider.BaseColumns
 | 
			
		||||
import android.util.Log
 | 
			
		||||
import android.view.LayoutInflater
 | 
			
		||||
import android.view.View
 | 
			
		||||
import android.view.ViewGroup
 | 
			
		||||
@@ -56,8 +55,7 @@ class StorageFragment : Fragment() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private fun fillUpSortBySpinner() {
 | 
			
		||||
        val sorts = mutableListOf("Name", "Category")
 | 
			
		||||
 | 
			
		||||
        val sorts = resources.getStringArray(R.array.abstract_product_sort_types)
 | 
			
		||||
        val arrayAdapter = ArrayAdapter(requireContext(), androidx.appcompat.R.layout.support_simple_spinner_dropdown_item, sorts)
 | 
			
		||||
        arrayAdapter.setDropDownViewResource(androidx.appcompat.R.layout.support_simple_spinner_dropdown_item)
 | 
			
		||||
        binding.spinner.adapter = arrayAdapter
 | 
			
		||||
@@ -81,7 +79,7 @@ class StorageFragment : Fragment() {
 | 
			
		||||
 | 
			
		||||
            if (!deleted) {
 | 
			
		||||
                activity!!.runOnUiThread {
 | 
			
		||||
                    Toast.makeText(requireContext(), "Nothing to delete", Toast.LENGTH_SHORT).show()
 | 
			
		||||
                    Toast.makeText(requireContext(), getString(R.string.nothing_to_delete), Toast.LENGTH_SHORT).show()
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            updateContent()
 | 
			
		||||
@@ -121,11 +119,11 @@ class StorageFragment : Fragment() {
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
            var orderBy: String = ""
 | 
			
		||||
            when(binding.spinner.selectedItem) {
 | 
			
		||||
                "Name" -> {
 | 
			
		||||
            when(binding.spinner.selectedItemPosition) {
 | 
			
		||||
                0 -> {
 | 
			
		||||
                    orderBy = "${AbstractProductContract.AbstractProductEntry.PRODUCT_NAME} ASC"
 | 
			
		||||
                }
 | 
			
		||||
                "Category" -> {
 | 
			
		||||
                1 -> {
 | 
			
		||||
                    orderBy = "${AbstractProductContract.AbstractProductEntry.CATEGORY} ASC"
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ class ProductView: LinearLayout {
 | 
			
		||||
        productLifeSpan.text = "${SimpleDateFormat("dd.MM.yyyy").format(Date(product.dateOfProduction*1000))}-${SimpleDateFormat("dd.MM.yyyy").format(Date(product.dateOfExpiry*1000))}"
 | 
			
		||||
        productFreshnessTextView.text =
 | 
			
		||||
        if (product.freshness == Double.NEGATIVE_INFINITY || product.freshness == Double.POSITIVE_INFINITY || product.freshness < 0) {
 | 
			
		||||
            "Expired"
 | 
			
		||||
            context.getString(R.string.expired)
 | 
			
		||||
        } else {
 | 
			
		||||
            "${DecimalFormat("#.#").format(product.freshness*100)}%"
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintBottom_toTopOf="@+id/netWeight"
 | 
			
		||||
                app:layout_constraintHorizontal_bias="0.5"
 | 
			
		||||
                android:visibility="visible" android:hint="@string/product_name_label" android:textColorHint="#737373"
 | 
			
		||||
                android:visibility="visible" android:hint="@string/productName" android:textColorHint="#737373"
 | 
			
		||||
                android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/barcodeTextEdit"/>
 | 
			
		||||
        <EditText
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
 
 | 
			
		||||
@@ -24,13 +24,13 @@
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/abstractProductView" android:layout_marginTop="16dp"/>
 | 
			
		||||
        <TextView
 | 
			
		||||
                android:text="Date of production:"
 | 
			
		||||
                android:text="@string/date_of_production"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content" android:id="@+id/dateOfProductionTextView"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/scanButton"
 | 
			
		||||
                android:layout_marginTop="16dp" app:layout_constraintStart_toStartOf="parent"/>
 | 
			
		||||
        <Button
 | 
			
		||||
                android:text="Select"
 | 
			
		||||
                android:text="@string/select"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content" android:id="@+id/selectDateOfProductionButton"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/scanButton"
 | 
			
		||||
@@ -43,11 +43,11 @@
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent" android:layout_marginTop="16dp"
 | 
			
		||||
                android:orientation="horizontal" android:id="@+id/radioGroup">
 | 
			
		||||
            <RadioButton
 | 
			
		||||
                    android:text="Expiry date"
 | 
			
		||||
                    android:text="@string/expiry_date"
 | 
			
		||||
                    android:layout_width="match_parent"
 | 
			
		||||
                    android:layout_height="wrap_content" android:id="@+id/expiryDateRadio"/>
 | 
			
		||||
            <RadioButton
 | 
			
		||||
                    android:text="Shelf life"
 | 
			
		||||
                    android:text="@string/shelf_life"
 | 
			
		||||
                    android:layout_width="match_parent"
 | 
			
		||||
                    android:layout_height="wrap_content" android:id="@+id/shelfLifeRadio"/>
 | 
			
		||||
        </RadioGroup>
 | 
			
		||||
@@ -80,11 +80,11 @@
 | 
			
		||||
                app:layout_constraintStart_toEndOf="@+id/expiryDateTextView" android:layout_marginStart="16dp"
 | 
			
		||||
                android:visibility="invisible"/>
 | 
			
		||||
        <TextView
 | 
			
		||||
                android:text="Amount"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content" android:id="@+id/amountText"
 | 
			
		||||
                app:layout_constraintTop_toBottomOf="@+id/shelfLifeTextEdit"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="16dp"/>
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="16dp"
 | 
			
		||||
                android:text="@string/amount"/>
 | 
			
		||||
        <EditText
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
 
 | 
			
		||||
@@ -8,13 +8,12 @@
 | 
			
		||||
            android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
                android:text="Sort by"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="0dp" android:id="@+id/sortByTextView"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                app:layout_constraintTop_toTopOf="parent"
 | 
			
		||||
                app:layout_constraintBottom_toTopOf="@+id/scrollView" android:textAlignment="center"
 | 
			
		||||
        />
 | 
			
		||||
                android:text="@string/sort_by"/>
 | 
			
		||||
        <Spinner
 | 
			
		||||
                android:layout_width="0dp"
 | 
			
		||||
                android:layout_height="32dp" android:id="@+id/spinner"
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
            android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
                android:text="Sort by"
 | 
			
		||||
                android:text="@string/sort_by"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="0dp" android:id="@+id/sortByTextView"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										80
									
								
								app/src/main/res/values-ru/strings.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										80
									
								
								app/src/main/res/values-ru/strings.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,80 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<resources>
 | 
			
		||||
    <string name="app_name">СканнерШтрихкодовДляРаботников</string>
 | 
			
		||||
    <string name="action_settings">Настройки</string>
 | 
			
		||||
    <string name="first_fragment_label">Добавить продукт</string>
 | 
			
		||||
    <string name="second_fragment_label">Продукты</string>
 | 
			
		||||
    <string name="scan_label">Сканировать</string>
 | 
			
		||||
    <string name="netWeight">Вес нетто</string>
 | 
			
		||||
    <string name="saveButton">Сохранить</string>
 | 
			
		||||
    <string name="takePicture">Сфотографировать</string>
 | 
			
		||||
    <string name="productName">Имя продукта</string>
 | 
			
		||||
    <string name="productType">Тип продукта</string>
 | 
			
		||||
    <string name="imageOfAProduct">Изображение продукта</string>
 | 
			
		||||
    <string name="sample_product_name">Пример имени продукта</string>
 | 
			
		||||
    <string name="sample_product_net_weight">100</string>
 | 
			
		||||
    <string name="sample_unit">г</string>
 | 
			
		||||
    <string name="sample_category">Пример категории</string>
 | 
			
		||||
    <string name="title_activity_fullscreen">Полноэкранный режим</string>
 | 
			
		||||
    <string name="fullscreen_image">Полноэкранное изображение</string>
 | 
			
		||||
    <string name="delete_menu">Удалить предмет(ы)</string>
 | 
			
		||||
    <string name="update_menu">Изменить предмет(ы)</string>
 | 
			
		||||
    <string name="update">Обновить</string>
 | 
			
		||||
    <string name="delete">Удалить</string>
 | 
			
		||||
    <string name="category">Категория</string>
 | 
			
		||||
    <string name="date_of_production">Дата производства</string>
 | 
			
		||||
    <string name="expiry_date">Годен до</string>
 | 
			
		||||
    <string name="select">Выбрать</string>
 | 
			
		||||
    <string name="shelf_life">Срок годности</string>
 | 
			
		||||
    <string name="amount">Количество</string>
 | 
			
		||||
    <string name="sort_by">Сортировать по</string>
 | 
			
		||||
    <string name="kilogram">кг</string>
 | 
			
		||||
    <string name="gram">г</string>
 | 
			
		||||
    <string name="liter">л</string>
 | 
			
		||||
    <string name="milliliter">мл</string>
 | 
			
		||||
    <string name="pieces">шт</string>
 | 
			
		||||
    <string name="product_picture_request">Пожалуйста, сфотографируйте продукт!</string>
 | 
			
		||||
    <string name="product_barcode_request">Пожалуйста, отсканируйте штрихкод на продукте!</string>
 | 
			
		||||
    <string name="product_name_request">Пожалуйста, напишите название продукта</string>
 | 
			
		||||
    <string name="product_net_weight_request">Пожалуйста, впишите верный вес нетто продукта</string>
 | 
			
		||||
    <string name="camera_permission_for_picture_request">Требуется разрешение на доступ к камере для снятия
 | 
			
		||||
        изображения
 | 
			
		||||
    </string>
 | 
			
		||||
    <string name="cancelled">Отменено</string>
 | 
			
		||||
    <string name="scan_barcode_of_a_product">Простанируйте штрихкод продукта</string>
 | 
			
		||||
    <string name="shell_life_or_expiry_date_request">Пожалуйста, выберите и заполните срок годности или годен до
 | 
			
		||||
    </string>
 | 
			
		||||
    <string name="date_of_production_request">Пожалуйста, выберите дату производства</string>
 | 
			
		||||
    <string name="expiry_date_request">Пожалуйста, выберите годен до</string>
 | 
			
		||||
    <string name="product_amount_request">Пожалуйста, укажите количество продукта</string>
 | 
			
		||||
    <string name="camera_permission_for_scanning_request">Требуется разрешение на доступ к камере для сканирования
 | 
			
		||||
        штрихкода
 | 
			
		||||
    </string>
 | 
			
		||||
    <string name="categories_title">Категории</string>
 | 
			
		||||
    <string name="storage_title">Склад</string>
 | 
			
		||||
    <string name="shelf_title">Полка</string>
 | 
			
		||||
    <string name="deleting_abstract_product_warning">Удаление абстрактного продукта приведёт к удалению ВСЕХ продуктов
 | 
			
		||||
        на полке, которые к нему принадлежат. Вы хотите продолжить?
 | 
			
		||||
    </string>
 | 
			
		||||
    <string name="deleting_category_warning">Удаление категории приведёт к удалению ВСЕХ продуктов, принадлежащих к ней.
 | 
			
		||||
        Вы хотите продолжить?
 | 
			
		||||
    </string>
 | 
			
		||||
    <string name="yes">Да</string>
 | 
			
		||||
    <string name="no">Нет</string>
 | 
			
		||||
    <string name="nothing_to_delete">Нечего удалять</string>
 | 
			
		||||
    <string name="nothing_to_update">Нечего обновлять</string>
 | 
			
		||||
    <string name="expired">Просрочено</string>
 | 
			
		||||
    <string name="barcode">Штрихкод</string>
 | 
			
		||||
    <string-array name="product_sort_types">
 | 
			
		||||
        <item>Имя</item>
 | 
			
		||||
        <item>Категория</item>
 | 
			
		||||
        <item>Свежесть</item>
 | 
			
		||||
        <item>Дата производства</item>
 | 
			
		||||
        <item>Годен до</item>
 | 
			
		||||
    </string-array>
 | 
			
		||||
 | 
			
		||||
    <string-array name="abstract_product_sort_types">
 | 
			
		||||
        <item>Имя</item>
 | 
			
		||||
        <item>Категория</item>
 | 
			
		||||
    </string-array>
 | 
			
		||||
</resources>
 | 
			
		||||
@@ -3,10 +3,7 @@
 | 
			
		||||
    <string name="action_settings">Settings</string>
 | 
			
		||||
    <string name="first_fragment_label">Add new product</string>
 | 
			
		||||
    <string name="second_fragment_label">Products</string>
 | 
			
		||||
    <string name="scan_label">Scan</string>
 | 
			
		||||
    <string name="previous">Previous</string>
 | 
			
		||||
    <string name="product_name_label">Product name</string>
 | 
			
		||||
    <string name="netWeight">Net weight (g)</string>
 | 
			
		||||
    <string name="netWeight">Net weight</string>
 | 
			
		||||
    <string name="saveButton">Save</string>
 | 
			
		||||
    <string name="takePicture">Take picture</string>
 | 
			
		||||
    <string name="productName">Product name</string>
 | 
			
		||||
@@ -17,16 +14,18 @@
 | 
			
		||||
    <string name="sample_unit">g</string>
 | 
			
		||||
    <string name="sample_category">Sample category</string>
 | 
			
		||||
    <string name="title_activity_fullscreen">FullscreenActivity</string>
 | 
			
		||||
    <string name="dummy_button">Dummy Button</string>
 | 
			
		||||
    <string name="dummy_content">DUMMY\nCONTENT</string>
 | 
			
		||||
    <string name="fullscreen_image">Fullscreen image</string>
 | 
			
		||||
    <string name="next">Next</string>
 | 
			
		||||
    <string name="delete_menu">Delete item(s)…</string>
 | 
			
		||||
    <string name="update_menu">Update item</string>
 | 
			
		||||
    <string name="update">update</string>
 | 
			
		||||
    <string name="delete">delete</string>
 | 
			
		||||
    <string name="category">Category</string>
 | 
			
		||||
    <string name="date_of_production">Date of production</string>
 | 
			
		||||
    <string name="expiry_date">Expiry date</string>
 | 
			
		||||
    <string name="select">Select</string>
 | 
			
		||||
    <string name="shelf_life">Shelf life</string>
 | 
			
		||||
    <string name="amount">Amount</string>
 | 
			
		||||
    <string name="sort_by">Sort by</string>
 | 
			
		||||
 | 
			
		||||
<!--  Unit names  -->
 | 
			
		||||
    <string name="kilogram">kg</string>
 | 
			
		||||
@@ -34,4 +33,46 @@
 | 
			
		||||
    <string name="liter">l</string>
 | 
			
		||||
    <string name="milliliter">ml</string>
 | 
			
		||||
    <string name="pieces">pc</string>
 | 
			
		||||
    
 | 
			
		||||
    <string name="product_picture_request">Please, make a picture of a product!</string>
 | 
			
		||||
    <string name="product_barcode_request">Please, scan barcode on a product</string>
 | 
			
		||||
    <string name="product_name_request">Please, write a name of a product!</string>
 | 
			
		||||
    <string name="product_net_weight_request">"Please, write a valid net weight of a product!"</string>
 | 
			
		||||
    <string name="camera_permission_for_picture_request">I need permission in order to take a picture</string>
 | 
			
		||||
    <string name="cancelled">Cancelled</string>
 | 
			
		||||
    <string name="scan_barcode_of_a_product">Scan barcode of a product</string>
 | 
			
		||||
 | 
			
		||||
    <string name="shell_life_or_expiry_date_request">Please, choose and fill in shelf life or expiry date.</string>
 | 
			
		||||
    <string name="date_of_production_request">Please, choose date of production.</string>
 | 
			
		||||
    <string name="expiry_date_request">Please, choose expiry date.</string>
 | 
			
		||||
    <string name="product_amount_request">Please, specify an amount of product.</string>
 | 
			
		||||
    <string name="camera_permission_for_scanning_request">I need permission in order to scan a barcode</string>
 | 
			
		||||
 | 
			
		||||
    <string name="categories_title">Categories</string>
 | 
			
		||||
    <string name="storage_title">Storage</string>
 | 
			
		||||
    <string name="shelf_title">Shelf</string>
 | 
			
		||||
 | 
			
		||||
    <string name="deleting_abstract_product_warning">Deleting an abstract product will also delete ALL the products, that belong to it. Do you want to proceed?</string>
 | 
			
		||||
    <string name="deleting_category_warning">Deleting a category will also delete ALL the products, that belong to that category. Do you want to proceed?</string>
 | 
			
		||||
    <string name="yes">Yes</string>
 | 
			
		||||
    <string name="no">No</string>
 | 
			
		||||
 | 
			
		||||
    <string name="nothing_to_delete">Nothing to delete</string>
 | 
			
		||||
    <string name="nothing_to_update">Nothing to update</string>
 | 
			
		||||
    <string-array name="product_sort_types">
 | 
			
		||||
        <item>Name</item>
 | 
			
		||||
        <item>Category</item>
 | 
			
		||||
        <item>Freshness</item>
 | 
			
		||||
        <item>Date of production</item>
 | 
			
		||||
        <item>Expiry date</item>
 | 
			
		||||
    </string-array>
 | 
			
		||||
 | 
			
		||||
    <string-array name="abstract_product_sort_types">
 | 
			
		||||
        <item>Name</item>
 | 
			
		||||
        <item>Category</item>
 | 
			
		||||
    </string-array>
 | 
			
		||||
 | 
			
		||||
    <string name="expired">Expired</string>
 | 
			
		||||
    <string name="barcode">Barcode</string>
 | 
			
		||||
    <string name="scan_label">Scan</string>
 | 
			
		||||
</resources>
 | 
			
		||||
		Reference in New Issue
	
	Block a user