Commit 725f86da authored by Amin's avatar Amin

fix access item margin

parent c6043783
...@@ -2,6 +2,7 @@ package com.example.qms; ...@@ -2,6 +2,7 @@ package com.example.qms;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
...@@ -46,8 +47,6 @@ public class SyncActivity extends AppCompatActivity { ...@@ -46,8 +47,6 @@ public class SyncActivity extends AppCompatActivity {
}); });
} }
private void showAlertDialog() { private void showAlertDialog() {
...@@ -65,7 +64,7 @@ public class SyncActivity extends AppCompatActivity { ...@@ -65,7 +64,7 @@ public class SyncActivity extends AppCompatActivity {
// Optional: make dialog background rounded if your layout has rounded corners // Optional: make dialog background rounded if your layout has rounded corners
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent); dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
// Now find the buttons from your custom layout // Find buttons from custom layout
Button noButton = alertView.findViewById(R.id.no_button); Button noButton = alertView.findViewById(R.id.no_button);
Button yesButton = alertView.findViewById(R.id.yes_button); Button yesButton = alertView.findViewById(R.id.yes_button);
...@@ -73,10 +72,22 @@ public class SyncActivity extends AppCompatActivity { ...@@ -73,10 +72,22 @@ public class SyncActivity extends AppCompatActivity {
noButton.setOnClickListener(v -> dialog.dismiss()); noButton.setOnClickListener(v -> dialog.dismiss());
yesButton.setOnClickListener(v -> { yesButton.setOnClickListener(v -> {
Toast.makeText(this, "Sync started!", Toast.LENGTH_SHORT).show(); // Dismiss the first alert
dialog.dismiss(); dialog.dismiss();
// Then show the success dialog
new AlertDialog.Builder(this)
.setTitle("Success")
.setMessage("Data sync completed.\n" +
"- Success: 0, Failed: 0")
.setPositiveButton("OK", (successDialog, which) -> {
// Dismiss the success alert
successDialog.dismiss();
})
.show();
}); });
} }
} }
...@@ -358,6 +358,62 @@ ...@@ -358,6 +358,62 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:paddingBottom="15dp">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="Date:"
android:textSize="19sp"
android:textColor="@color/grey"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="15 Nov 2024"
android:textColor="@color/black"
android:textSize="20sp"
android:layout_marginStart="50dp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="20dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="Name:"
android:textSize="19sp"
android:textColor="@color/grey" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="John Snow"
android:textColor="@color/black"
android:textSize="20sp"
android:layout_marginStart="50dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:paddingBottom="30dp"> android:paddingBottom="30dp">
<TextView <TextView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment