From f0595248b6e9129dd378da2eb4f1c06b7fa2b443 Mon Sep 17 00:00:00 2001 From: shivshankar9 Date: Sun, 17 Nov 2024 22:15:11 +0530 Subject: [PATCH 1/3] test-1 --- .../bigdatanyze/ems1/DashboardFragment.java | 2 +- .../ems1/EditBusinessProfileActivity.java | 2 +- .../ems1/InvoicePreviewActivity.java | 6 +- .../ems1/ViewInvoicesActivity.java | 185 ++++++++++++++-- .../ems1/database/AppDatabase.java | 2 +- .../com/bigdatanyze/ems1/model/Invoice.java | 7 +- .../com/bigdatanyze/ems1/util/PdfUtils.java | 207 ++++++++++++++++++ .../res/layout/activity_view_invoices.xml | 132 +++-------- .../main/res/layout/fragment_dashboard.xml | 2 +- app/src/main/res/menu/menu_search.xml | 7 + 10 files changed, 415 insertions(+), 137 deletions(-) create mode 100644 app/src/main/java/com/bigdatanyze/ems1/util/PdfUtils.java create mode 100644 app/src/main/res/menu/menu_search.xml diff --git a/app/src/main/java/com/bigdatanyze/ems1/DashboardFragment.java b/app/src/main/java/com/bigdatanyze/ems1/DashboardFragment.java index a9d86fd..f0f1a01 100644 --- a/app/src/main/java/com/bigdatanyze/ems1/DashboardFragment.java +++ b/app/src/main/java/com/bigdatanyze/ems1/DashboardFragment.java @@ -82,4 +82,4 @@ private void setupBottomNavigation() { private List getRecentActivities() { return Arrays.asList("Added item A", "Removed item B", "Updated item C"); } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/bigdatanyze/ems1/EditBusinessProfileActivity.java b/app/src/main/java/com/bigdatanyze/ems1/EditBusinessProfileActivity.java index a77661b..694f3b7 100644 --- a/app/src/main/java/com/bigdatanyze/ems1/EditBusinessProfileActivity.java +++ b/app/src/main/java/com/bigdatanyze/ems1/EditBusinessProfileActivity.java @@ -104,4 +104,4 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten Toast.makeText(this, "Image selection failed", Toast.LENGTH_SHORT).show(); } } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/bigdatanyze/ems1/InvoicePreviewActivity.java b/app/src/main/java/com/bigdatanyze/ems1/InvoicePreviewActivity.java index 4a9d031..9bdbc97 100644 --- a/app/src/main/java/com/bigdatanyze/ems1/InvoicePreviewActivity.java +++ b/app/src/main/java/com/bigdatanyze/ems1/InvoicePreviewActivity.java @@ -115,11 +115,11 @@ public void onChanged(BusinessProfile businessProfile) { if (businessProfile != null) { businessName = businessProfile.getBusinessName(); businessAddress = businessProfile.getCompanyAddress(); - businessCityStateZip = businessProfile.getEmail() + ", " + businessProfile.getEmail() + ", " + businessProfile.getEmail(); + businessCityStateZip = businessProfile.getPhoneNumber() + ", " + businessProfile.getEmail() + ", " + businessProfile.getEmail(); businessEmail = businessProfile.getEmail(); businessPhone = "Phone: " + businessProfile.getPhoneNumber(); businessNameTextView.setText(businessProfile.getBusinessName()); // Update with business name } - }} + }} }); // Set up button listeners @@ -142,6 +142,7 @@ private void checkStoragePermissions() { } } + /** * Generates the PDF of the invoice with improved layout and design. */ @@ -292,7 +293,6 @@ private void generatePdf() { pdfDocument.close(); // Close the PDF document } } - /** * Formats the file path to be more user-friendly. * diff --git a/app/src/main/java/com/bigdatanyze/ems1/ViewInvoicesActivity.java b/app/src/main/java/com/bigdatanyze/ems1/ViewInvoicesActivity.java index 88f6aa9..1cae062 100644 --- a/app/src/main/java/com/bigdatanyze/ems1/ViewInvoicesActivity.java +++ b/app/src/main/java/com/bigdatanyze/ems1/ViewInvoicesActivity.java @@ -1,27 +1,52 @@ package com.bigdatanyze.ems1; +import android.Manifest; import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; import android.os.Bundle; +import android.os.Environment; import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; +import android.widget.SearchView; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import androidx.core.content.FileProvider; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.bigdatanyze.ems1.adapter.InvoiceAdapter; import com.bigdatanyze.ems1.model.Invoice; +import com.bigdatanyze.ems1.util.PdfUtils; import com.bigdatanyze.ems1.viewmodel.InvoiceViewModel; +import com.itextpdf.text.Document; +import com.itextpdf.text.DocumentException; +import com.itextpdf.text.Paragraph; +import com.itextpdf.text.pdf.PdfWriter; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; public class ViewInvoicesActivity extends AppCompatActivity implements InvoiceAdapter.OnInvoiceClickListener { + private static final int REQUEST_WRITE_STORAGE = 112; // Request code for storage permission + private RecyclerView invoicesRecyclerView; private InvoiceAdapter invoiceAdapter; private InvoiceViewModel invoiceViewModel; - private TextView totalSalesTextView; // TextView for total sales - private TextView noInvoicesTextView; // TextView to show 'No invoices found' + private TextView totalSalesTextView; + private TextView noInvoicesTextView; + private List allInvoices = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { @@ -29,11 +54,22 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_view_invoices); totalSalesTextView = findViewById(R.id.total_sales_text_view); + totalSalesTextView.setTextColor(getResources().getColor(android.R.color.holo_green_dark)); // Set total sales text color to green + invoicesRecyclerView = findViewById(R.id.invoices_recycler_view); invoicesRecyclerView.setLayoutManager(new LinearLayoutManager(this)); - noInvoicesTextView = findViewById(R.id.no_invoices_text_view); // Add this TextView in your XML layout file + noInvoicesTextView = findViewById(R.id.no_invoices_text_view); + + // Request storage permission if not granted + if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_WRITE_STORAGE); + } else { + setupViewModel(); + } + } + private void setupViewModel() { // Initialize ViewModel invoiceViewModel = new ViewModelProvider(this).get(InvoiceViewModel.class); @@ -41,12 +77,13 @@ protected void onCreate(Bundle savedInstanceState) { invoiceViewModel.getAllInvoices().observe(this, invoices -> { try { if (invoices != null && !invoices.isEmpty()) { - // Hide "No invoices found" message noInvoicesTextView.setVisibility(View.GONE); invoicesRecyclerView.setVisibility(View.VISIBLE); Log.d("ViewInvoicesActivity", "Number of invoices fetched: " + invoices.size()); + allInvoices = invoices; // Keep a reference to all invoices for search filtering + if (invoiceAdapter == null) { invoiceAdapter = new InvoiceAdapter(this, invoices, this); invoicesRecyclerView.setAdapter(invoiceAdapter); @@ -56,25 +93,22 @@ protected void onCreate(Bundle savedInstanceState) { updateTotalSales(invoices); } else { - // If no invoices are found showNoInvoicesMessage(); } } catch (Exception e) { - Log.e("ViewInvoicesActivity", "Error while fetching invoices: " + e.getMessage(), e); + Log.e("ViewInvoicesActivity", "Error fetching invoices: " + e.getMessage(), e); showNoInvoicesMessage(); } }); } - // Show "No Invoices to View" when no invoices are available private void showNoInvoicesMessage() { - invoicesRecyclerView.setVisibility(View.GONE); // Hide the RecyclerView - noInvoicesTextView.setVisibility(View.VISIBLE); // Show 'No invoices found' message + invoicesRecyclerView.setVisibility(View.GONE); + noInvoicesTextView.setVisibility(View.VISIBLE); noInvoicesTextView.setText("No Invoices to View"); - totalSalesTextView.setText("Total Sales: $0.00"); // Reset total sales to zero + totalSalesTextView.setText("Total Sales: $0.00"); } - // Update total sales if invoices are available private void updateTotalSales(List invoices) { double totalSales = 0.0; for (Invoice invoice : invoices) { @@ -83,18 +117,125 @@ private void updateTotalSales(List invoices) { totalSalesTextView.setText(String.format("Total Sales: $%.2f", totalSales)); } - // Handle invoice click events @Override public void onInvoiceClick(Invoice invoice) { - try { - Toast.makeText(this, "Invoice Clicked: " + invoice.getInvoiceNumber(), Toast.LENGTH_SHORT).show(); - - Intent intent = new Intent(this, PDFViewerActivity.class); - intent.putExtra("invoiceId", invoice.getId()); - startActivity(intent); - } catch (Exception e) { - Log.e("ViewInvoicesActivity", "Error opening invoice: " + e.getMessage(), e); - Toast.makeText(this, "Error opening invoice.", Toast.LENGTH_SHORT).show(); + if (invoice == null) { + Toast.makeText(this, "Invoice is null.", Toast.LENGTH_SHORT).show(); + return; + } + + // Define the path where the PDF should be saved + File pdfDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "Finverge"); + if (!pdfDir.exists()) { + pdfDir.mkdirs(); // Create the directory if it doesn't exist + } + + File pdfFile = new File(pdfDir, "Invoice_" + invoice.getInvoiceNumber() + ".pdf"); + + // Check if the PDF already exists + if (pdfFile.exists()) { + // Open the existing PDF + openGeneratedPDF(pdfFile); + } else { + try { + // Generate and save the PDF + generateInvoicePdf(invoice, pdfFile); + + // Open the newly created PDF + openGeneratedPDF(pdfFile); + } catch (Exception e) { + Log.e("ViewInvoicesActivity", "Error generating PDF: " + e.getMessage(), e); + Toast.makeText(this, "Error generating PDF.", Toast.LENGTH_SHORT).show(); + } + } + } + + // Method to generate the PDF + private void generateInvoicePdf(Invoice invoice, File pdfFile) throws DocumentException, IOException { + // Create a new Document + Document document = new Document(); + + // Create the PDF writer to write to the specified file + PdfWriter.getInstance(document, new FileOutputStream(pdfFile)); + + // Open the document to start writing content + document.open(); + + // Add content to the document + document.add(new Paragraph("Invoice")); + document.add(new Paragraph("Invoice Number: " + invoice.getInvoiceNumber())); + document.add(new Paragraph("Customer Name: " + invoice.getCustomerName())); + document.add(new Paragraph("Total Amount: $" + invoice.getTotalAmount())); + document.add(new Paragraph("Date: " + invoice.getDate())); + + // Close the document once done + document.close(); + + Log.d("ViewInvoicesActivity", "PDF created at: " + pdfFile.getAbsolutePath()); + } + + // Method to open the generated PDF file + private void openGeneratedPDF(File pdfFile) { + Uri pdfUri = FileProvider.getUriForFile( + this, + getApplicationContext().getPackageName() + ".fileprovider", + pdfFile + ); + + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(pdfUri, "application/pdf"); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + + startActivity(intent); + } + + + // Add search functionality in the menu + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.menu_search, menu); // Inflate the search menu + + MenuItem searchItem = menu.findItem(R.id.action_search); + SearchView searchView = (SearchView) searchItem.getActionView(); + + // Set up the search query listener + searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + @Override + public boolean onQueryTextSubmit(String query) { + return false; + } + + @Override + public boolean onQueryTextChange(String newText) { + filterInvoices(newText); // Filter invoices as the user types + return true; + } + }); + return true; + } + + // Filter invoices based on search query + private void filterInvoices(String query) { + List filteredInvoices = new ArrayList<>(); + for (Invoice invoice : allInvoices) { + if (invoice.getInvoiceNumber().toLowerCase().contains(query.toLowerCase()) || + invoice.getCustomerName().toLowerCase().contains(query.toLowerCase())) { + filteredInvoices.add(invoice); + } + } + invoiceAdapter.updateInvoices(filteredInvoices); + } + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if (requestCode == REQUEST_WRITE_STORAGE) { + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + setupViewModel(); // Reinitialize the ViewModel if permission is granted + } else { + Toast.makeText(this, "Storage permission is required to generate PDFs.", Toast.LENGTH_SHORT).show(); + } } } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/bigdatanyze/ems1/database/AppDatabase.java b/app/src/main/java/com/bigdatanyze/ems1/database/AppDatabase.java index ad57611..e24986c 100644 --- a/app/src/main/java/com/bigdatanyze/ems1/database/AppDatabase.java +++ b/app/src/main/java/com/bigdatanyze/ems1/database/AppDatabase.java @@ -15,7 +15,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -@Database(entities = {Employee.class, Expense.class, Invoice.class, InvoiceItem.class, Party.class, Item.class, BusinessProfile.class}, version = 8, exportSchema = false) +@Database(entities = {Employee.class, Expense.class, Invoice.class, InvoiceItem.class, Party.class, Item.class, BusinessProfile.class}, version = 9, exportSchema = false) @TypeConverters({Converters.class}) // Register the Converters class here public abstract class AppDatabase extends RoomDatabase { diff --git a/app/src/main/java/com/bigdatanyze/ems1/model/Invoice.java b/app/src/main/java/com/bigdatanyze/ems1/model/Invoice.java index 2ac80ea..0889316 100644 --- a/app/src/main/java/com/bigdatanyze/ems1/model/Invoice.java +++ b/app/src/main/java/com/bigdatanyze/ems1/model/Invoice.java @@ -11,7 +11,7 @@ import com.bigdatanyze.ems1.util.Converters; @Entity(tableName = "invoice") -public class Invoice { +public class Invoice extends BusinessProfile { @PrimaryKey(autoGenerate = true) private int id; @@ -118,4 +118,7 @@ public void setNotes(String notes) { public String getFormattedAmount() { return String.format("$%.2f", totalAmount); } -} + + + +} \ No newline at end of file diff --git a/app/src/main/java/com/bigdatanyze/ems1/util/PdfUtils.java b/app/src/main/java/com/bigdatanyze/ems1/util/PdfUtils.java new file mode 100644 index 0000000..ced7dd7 --- /dev/null +++ b/app/src/main/java/com/bigdatanyze/ems1/util/PdfUtils.java @@ -0,0 +1,207 @@ +package com.bigdatanyze.ems1.util; + +import android.content.Context; +import android.content.Intent; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.pdf.PdfDocument; +import android.net.Uri; +import android.os.Environment; +import android.widget.Toast; + +import androidx.core.content.FileProvider; + +import com.bigdatanyze.ems1.model.Invoice; +import com.bigdatanyze.ems1.model.InvoiceItem; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + +public class PdfUtils { + public static void generateInvoicePdf(Context context, Invoice invoice) { + + // Initialize PDF document + PdfDocument pdfDocument = new PdfDocument(); + PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(600, 900, 1).create(); + PdfDocument.Page page = pdfDocument.startPage(pageInfo); + + // Canvas and Paint objects + Canvas canvas = page.getCanvas(); + Paint paint = new Paint(); + Paint titlePaint = new Paint(); + titlePaint.setTextSize(16); + titlePaint.setFakeBoldText(true); + + + // Set margins + int marginLeft = 20; + int marginRight = 580; + int yPosition = 25; // Top margin + + // Draw "Tax Invoice" heading, centered + Paint taxInvoicePaint = new Paint(); + taxInvoicePaint.setTextSize(18); + taxInvoicePaint.setFakeBoldText(true); + taxInvoicePaint.setTextAlign(Paint.Align.CENTER); + + // Center the text + float canvasWidth = canvas.getWidth(); + canvas.drawText("Tax Invoice", canvasWidth / 2, yPosition, taxInvoicePaint); + yPosition += 30; + + // Draw business profile details + canvas.drawText(invoice.getBusinessName(), marginLeft, yPosition, titlePaint); + yPosition += 20; + canvas.drawText(invoice.getCompanyAddress(), marginLeft, yPosition, paint); + yPosition += 20; + canvas.drawText(invoice.getPhoneNumber(), marginLeft, yPosition, paint); + yPosition += 20; + canvas.drawText(invoice.getEmail(), marginLeft, yPosition, paint); + yPosition += 20; + canvas.drawText(invoice.getPhoneNumber(), marginLeft, yPosition, paint); + yPosition += 25; + + // Draw horizontal line under header + paint.setStyle(Paint.Style.STROKE); + canvas.drawLine(marginLeft, yPosition, marginRight, yPosition, paint); + paint.setStyle(Paint.Style.FILL); + yPosition += 20; + + // Billing details header + titlePaint.setTextSize(14); + canvas.drawText("Billing Details", marginLeft, yPosition, titlePaint); + yPosition += 20; + + // Draw invoice details + paint.setTextSize(12); + canvas.drawText("Invoice Number: " + invoice.getInvoiceNumber(), marginLeft, yPosition, paint); + yPosition += 20; + canvas.drawText("Date: " + invoice.getDate(), marginLeft, yPosition, paint); + yPosition += 20; + canvas.drawText("Customer: " + invoice.getCustomerName(), marginLeft, yPosition, paint); + yPosition += 20; + canvas.drawText("Contact: " + invoice.getCustomerContact(), marginLeft, yPosition, paint); + yPosition += 25; + + // Shipping address header + canvas.drawText("Shipping Address", marginLeft, yPosition, titlePaint); + yPosition += 20; + canvas.drawText("123 Shipping Street", marginLeft, yPosition, paint); // Replace with dynamic shipping address if needed + yPosition += 20; + canvas.drawText("City, State, ZIP", marginLeft, yPosition, paint); // Replace with dynamic shipping city, state, ZIP + yPosition += 20; + canvas.drawText("Phone: (987) 654-3210", marginLeft, yPosition, paint); // Replace with dynamic shipping phone if needed + yPosition += 30; + + // Item list header + titlePaint.setTextSize(14); + canvas.drawText("Item Name", marginLeft, yPosition, titlePaint); + canvas.drawText("Quantity", 200, yPosition, titlePaint); + canvas.drawText("Unit Price", 300, yPosition, titlePaint); + canvas.drawText("Amount", 400, yPosition, titlePaint); + yPosition += 15; + + // Draw a horizontal line under the item list header + paint.setStyle(Paint.Style.STROKE); + canvas.drawLine(marginLeft, yPosition, marginRight, yPosition, paint); + paint.setStyle(Paint.Style.FILL); + yPosition += 20; + + // Draw the items + for (InvoiceItem item : invoice.getItems()) { + canvas.drawText(item.getItemName(), marginLeft, yPosition, paint); + canvas.drawText(String.valueOf(item.getQuantity()), 200, yPosition, paint); + canvas.drawText(String.format("%.2f", item.getUnitPrice()), 300, yPosition, paint); + canvas.drawText(String.format("%.2f", item.getTotalPrice()), 400, yPosition, paint); + yPosition += 20; + } + + // Draw total amount and additional notes + yPosition += 30; + canvas.drawText("Total Amount: " + String.format("%.2f", invoice.getTotalAmount()), marginLeft, yPosition, titlePaint); + yPosition += 20; + canvas.drawText(invoice.getNotes(), marginLeft, yPosition, paint); + yPosition += 40; + + // Draw terms and conditions + titlePaint.setTextSize(12); + canvas.drawText("Terms and Conditions", marginLeft, yPosition, titlePaint); + yPosition += 20; + paint.setTextSize(10); + canvas.drawText("1. Payment is due within 30 days.", marginLeft, yPosition, paint); + yPosition += 15; + canvas.drawText("2. Late payments may incur additional charges.", marginLeft, yPosition, paint); + yPosition += 15; + canvas.drawText("3. Goods sold are not refundable.", marginLeft, yPosition, paint); + yPosition += 20; + + // Finish the page + pdfDocument.finishPage(page); + + // Save the PDF in the Finverge folder in Documents + File directory = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "Finverge"); + if (!directory.exists()) { + boolean mkdirs = directory.mkdirs(); // Create the directory if it doesn't exist + if (!mkdirs) { + Toast.makeText(context, "Failed to create directory", Toast.LENGTH_SHORT).show(); + pdfDocument.close(); + return; + } + } + + // Define the file path inside the Finverge folder + String fileName = "Invoice_" + invoice.getInvoiceNumber() + ".pdf"; + File file = new File(directory, fileName); + String filePath = file.getAbsolutePath(); + + try (FileOutputStream outputStream = new FileOutputStream(file)) { + // Write PDF content to file + pdfDocument.writeTo(outputStream); + Toast.makeText(context, "PDF saved to: " + filePathFormatted(file.getAbsolutePath()), Toast.LENGTH_LONG).show(); + + // Open the PDF after saving + openPdf(context, filePath); + } catch (IOException e) { + // Handle exception + Toast.makeText(context, "Error saving PDF: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + e.printStackTrace(); + } finally { + pdfDocument.close(); // Close the PDF document + } + } + + private static void openPdf(Context context, String filePath) { + File pdfFile = new File(filePath); + Uri pdfUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", pdfFile); + + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(pdfUri, "application/pdf"); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + + try { + context.startActivity(intent); + } catch (Exception e) { + Toast.makeText(context, "No application available to view PDF", Toast.LENGTH_SHORT).show(); + } + } + + /** + * Formats the file path to be more user-friendly. + * + * @param path The absolute file path. + * @return Formatted file path string. + */ + private static String filePathFormatted(String path) { + // Replace the absolute path with a more readable format + // For example: /storage/emulated/0/Documents/Finverge/Invoice_12345.pdf + // can be shown as Documents/Finverge/Invoice_12345.pdf + File file = new File(path); + String[] parts = file.getAbsolutePath().split("/Documents/"); + if (parts.length > 1) { + return "Documents/" + parts[1]; + } else { + return path; + } + } +} diff --git a/app/src/main/res/layout/activity_view_invoices.xml b/app/src/main/res/layout/activity_view_invoices.xml index 3efd1c1..8beb74b 100644 --- a/app/src/main/res/layout/activity_view_invoices.xml +++ b/app/src/main/res/layout/activity_view_invoices.xml @@ -1,122 +1,42 @@ - - - - - - - + + android:textSize="18sp" + android:textColor="@android:color/holo_green_dark" + android:textStyle="bold" /> - - + - - - - - - - - - - - - - + android:text="No Invoices to View" + android:visibility="gone" /> - + + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone" /> - + - - + android:text="Business Name" + android:textSize="16sp" + android:textStyle="bold" + android:visibility="visible" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml index 704e294..7a5e106 100644 --- a/app/src/main/res/layout/fragment_dashboard.xml +++ b/app/src/main/res/layout/fragment_dashboard.xml @@ -108,4 +108,4 @@ android:layout_height="wrap_content" android:background="#1F1F1F" app:menu="@menu/bottom_navigation_menu" /> - + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_search.xml b/app/src/main/res/menu/menu_search.xml new file mode 100644 index 0000000..a8be30f --- /dev/null +++ b/app/src/main/res/menu/menu_search.xml @@ -0,0 +1,7 @@ + + + From a173306a76bb158678fdb5dc02a242aae59502b2 Mon Sep 17 00:00:00 2001 From: shivshankar9 Date: Mon, 18 Nov 2024 22:16:01 +0530 Subject: [PATCH 2/3] working till saleview --- .idea/deploymentTargetDropDown.xml | 4 +- .idea/emulatorDisplays.xml | 9 +- .../com/bigdatanyze/ems1/MainActivity.java | 140 ++++++++++-------- .../ems1/ViewInvoicesActivity.java | 57 +++---- .../layout/activity_edit_business_profile.xml | 8 +- 5 files changed, 107 insertions(+), 111 deletions(-) diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 594f789..2bd46c9 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -7,11 +7,11 @@ - + - + \ No newline at end of file diff --git a/.idea/emulatorDisplays.xml b/.idea/emulatorDisplays.xml index aec0ee7..468e661 100644 --- a/.idea/emulatorDisplays.xml +++ b/.idea/emulatorDisplays.xml @@ -28,13 +28,12 @@