Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
intern-amin-qms
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amin
intern-amin-qms
Commits
943b715b
Commit
943b715b
authored
Oct 16, 2025
by
Amin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create alert ui
parent
67fb3eaf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
290 additions
and
2 deletions
+290
-2
SyncActivity.java
app/src/main/java/com/example/qms/SyncActivity.java
+47
-2
alert_icon.png
app/src/main/res/drawable/alert_icon.png
+0
-0
activity_sync.xml
app/src/main/res/layout/activity_sync.xml
+1
-0
sync_alert.xml
app/src/main/res/layout/sync_alert.xml
+242
-0
No files found.
app/src/main/java/com/example/qms/SyncActivity.java
View file @
943b715b
package
com
.
example
.
qms
;
package
com
.
example
.
qms
;
import
android.app.AlertDialog
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Toast
;
import
androidx.activity.EdgeToEdge
;
import
androidx.activity.EdgeToEdge
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
...
@@ -10,6 +15,8 @@ import androidx.core.view.WindowInsetsCompat;
...
@@ -10,6 +15,8 @@ import androidx.core.view.WindowInsetsCompat;
public
class
SyncActivity
extends
AppCompatActivity
{
public
class
SyncActivity
extends
AppCompatActivity
{
private
Button
syncButton
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -20,5 +27,44 @@ public class SyncActivity extends AppCompatActivity {
...
@@ -20,5 +27,44 @@ public class SyncActivity extends AppCompatActivity {
v
.
setPadding
(
systemBars
.
left
,
systemBars
.
top
,
systemBars
.
right
,
systemBars
.
bottom
);
v
.
setPadding
(
systemBars
.
left
,
systemBars
.
top
,
systemBars
.
right
,
systemBars
.
bottom
);
return
insets
;
return
insets
;
});
});
syncButton
=
findViewById
(
R
.
id
.
sync_button
);
syncButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showAlertDialog
();
}
});
}
private
void
showAlertDialog
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setTitle
(
"Alert Title"
);
builder
.
setMessage
(
"This is a simple alert message."
);
builder
.
setCancelable
(
false
);
// User must click a button to dismiss
// Add a positive button
builder
.
setPositiveButton
(
"OK"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
Toast
.
makeText
(
SyncActivity
.
this
,
"OK clicked!"
,
Toast
.
LENGTH_SHORT
).
show
();
dialog
.
dismiss
();
// Dismiss the dialog
}
});
// Add a negative button (optional)
builder
.
setNegativeButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
Toast
.
makeText
(
SyncActivity
.
this
,
"Cancel clicked!"
,
Toast
.
LENGTH_SHORT
).
show
();
dialog
.
dismiss
();
// Dismiss the dialog
}
});
// Create and show the AlertDialog
AlertDialog
alertDialog
=
builder
.
create
();
alertDialog
.
show
();
}
}
}
}
\ No newline at end of file
app/src/main/res/drawable/alert_icon.png
0 → 100644
View file @
943b715b
1.17 KB
app/src/main/res/layout/activity_sync.xml
View file @
943b715b
...
@@ -264,6 +264,7 @@
...
@@ -264,6 +264,7 @@
</ScrollView>
</ScrollView>
<Button
<Button
android:id=
"@+id/sync_button"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:layout_height=
"64dp"
android:layout_marginBottom=
"15dp"
android:layout_marginBottom=
"15dp"
...
...
app/src/main/res/layout/sync_alert.xml
0 → 100644
View file @
943b715b
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/syncAlert"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_constraintHeight=
"wrap_content"
app:layout_constraintWidth=
"300dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingHorizontal=
"30dp"
android:paddingVertical=
"30dp"
>
<ImageView
android:layout_width=
"56dp"
android:layout_height=
"56dp"
android:layout_marginBottom=
"25dp"
android:src=
"@drawable/alert_icon"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"15dp"
android:text=
"Alert"
android:textSize=
"23sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:text=
"Please comfirm items to sync"
android:textSize=
"19sp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:layout_marginBottom=
"10dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Submit All Offline Pending Items"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginEnd=
"60dp"
/>
<com.google.android.material.checkbox.MaterialCheckBox
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:buttonTint=
"@color/primary"
app:useMaterialThemeColors=
"true"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:layout_marginBottom=
"10dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Download Details of Selected Unit"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginEnd=
"60dp"
/>
<com.google.android.material.checkbox.MaterialCheckBox
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:buttonTint=
"@color/primary"
app:useMaterialThemeColors=
"true"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:layout_marginBottom=
"10dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Active Issues Only"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginEnd=
"60dp"
/>
<com.google.android.material.checkbox.MaterialCheckBox
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:buttonTint=
"@color/primary"
app:useMaterialThemeColors=
"true"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:layout_marginBottom=
"10dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Active Issues Only (Without Images)"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginEnd=
"60dp"
/>
<com.google.android.material.checkbox.MaterialCheckBox
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:buttonTint=
"@color/primary"
app:useMaterialThemeColors=
"true"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:layout_marginBottom=
"10dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"All Issues Only (Without Images)"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginEnd=
"60dp"
/>
<com.google.android.material.checkbox.MaterialCheckBox
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:buttonTint=
"@color/primary"
app:useMaterialThemeColors=
"true"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginBottom=
"10dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Definition for:"
android:textSize=
"19sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingEnd=
"30dp"
android:text=
"“Active” - Lodge, PA, WIP Complete. “All” - Active, POA Closed."
android:textSize=
"19sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Download Selected Digital Form"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
android:layout_marginEnd=
"60dp"
/>
<com.google.android.material.checkbox.MaterialCheckBox
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:buttonTint=
"@color/primary"
app:useMaterialThemeColors=
"true"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:gravity=
"center_horizontal"
android:orientation=
"horizontal"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_marginBottom=
"20dp"
>
<Button
android:layout_width=
"165dp"
android:layout_height=
"64dp"
android:layout_marginEnd=
"10dp"
android:backgroundTint=
"@color/white"
android:clickable=
"true"
android:focusable=
"true"
android:text=
"No"
android:textColor=
"@color/primary"
android:textSize=
"19sp"
app:cornerRadius=
"27dp"
app:strokeColor=
"@color/primary"
app:strokeWidth=
"1dp"
/>
<Button
android:layout_width=
"165dp"
android:layout_height=
"64dp"
android:backgroundTint=
"@color/primary"
android:clickable=
"true"
android:focusable=
"true"
android:text=
"Yes"
android:textColor=
"@color/white"
android:textSize=
"19sp"
app:cornerRadius=
"27dp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment