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
2c5c9df7
Commit
2c5c9df7
authored
Oct 17, 2025
by
Amin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add back function
parent
943b715b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
29 deletions
+124
-29
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-0
AccessItem.java
app/src/main/java/com/example/qms/AccessItem.java
+20
-0
SyncActivity.java
app/src/main/java/com/example/qms/SyncActivity.java
+34
-22
TransactionDetails.java
app/src/main/java/com/example/qms/TransactionDetails.java
+36
-0
alert_border.xml
app/src/main/res/drawable/alert_border.xml
+19
-0
activity_access_item.xml
app/src/main/res/layout/activity_access_item.xml
+1
-0
activity_transaction_details.xml
app/src/main/res/layout/activity_transaction_details.xml
+0
-0
sync_alert.xml
app/src/main/res/layout/sync_alert.xml
+11
-7
No files found.
app/src/main/AndroidManifest.xml
View file @
2c5c9df7
...
...
@@ -12,6 +12,9 @@
android:supportsRtl=
"true"
android:theme=
"@style/Theme.Qms"
>
<activity
android:name=
".TransactionDetails"
android:exported=
"false"
/>
<activity
android:name=
".AccessItem"
android:exported=
"false"
/>
<activity
...
...
app/src/main/java/com/example/qms/AccessItem.java
View file @
2c5c9df7
package
com
.
example
.
qms
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
androidx.activity.EdgeToEdge
;
import
androidx.appcompat.app.AppCompatActivity
;
...
...
@@ -10,6 +13,10 @@ import androidx.core.view.WindowInsetsCompat;
public
class
AccessItem
extends
AppCompatActivity
{
private
LinearLayout
transactionDetail
;
private
ImageButton
back_button
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -20,5 +27,17 @@ public class AccessItem extends AppCompatActivity {
v
.
setPadding
(
systemBars
.
left
,
systemBars
.
top
,
systemBars
.
right
,
systemBars
.
bottom
);
return
insets
;
});
transactionDetail
=
findViewById
(
R
.
id
.
transactionDetails
);
back_button
=
findViewById
(
R
.
id
.
backButton
);
transactionDetail
.
setOnClickListener
(
v
->
{
Intent
intent
=
new
Intent
(
AccessItem
.
this
,
TransactionDetails
.
class
);
startActivity
(
intent
);
});
back_button
.
setOnClickListener
(
v
->
{
onBackPressed
();
});
}
}
\ No newline at end of file
app/src/main/java/com/example/qms/SyncActivity.java
View file @
2c5c9df7
...
...
@@ -5,6 +5,7 @@ import android.content.DialogInterface;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.ImageButton
;
import
android.widget.Toast
;
import
androidx.activity.EdgeToEdge
;
...
...
@@ -17,6 +18,8 @@ public class SyncActivity extends AppCompatActivity {
private
Button
syncButton
;
private
ImageButton
back_button
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -29,6 +32,7 @@ public class SyncActivity extends AppCompatActivity {
});
syncButton
=
findViewById
(
R
.
id
.
sync_button
);
back_button
=
findViewById
(
R
.
id
.
backButton
);
syncButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -36,35 +40,43 @@ public class SyncActivity extends AppCompatActivity {
showAlertDialog
();
}
});
back_button
.
setOnClickListener
(
v
->
{
onBackPressed
();
});
}
private
void
showAlertDialog
()
{
// Inflate your custom layout
View
alertView
=
getLayoutInflater
().
inflate
(
R
.
layout
.
sync_alert
,
null
);
// Create the AlertDialog builder
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
builder
.
setView
(
alertView
);
// 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
}
});
// Create and show the dialog
AlertDialog
dialog
=
builder
.
create
();
dialog
.
show
();
// 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
}
});
// Optional: make dialog background rounded if your layout has rounded corners
dialog
.
getWindow
().
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
);
// Create and show the AlertDialog
AlertDialog
alertDialog
=
builder
.
create
();
alertDialog
.
show
();
// Now find the buttons from your custom layout
Button
noButton
=
alertView
.
findViewById
(
R
.
id
.
no_button
);
Button
yesButton
=
alertView
.
findViewById
(
R
.
id
.
yes_button
);
// Handle clicks
noButton
.
setOnClickListener
(
v
->
dialog
.
dismiss
());
yesButton
.
setOnClickListener
(
v
->
{
Toast
.
makeText
(
this
,
"Sync started!"
,
Toast
.
LENGTH_SHORT
).
show
();
dialog
.
dismiss
();
});
}
}
app/src/main/java/com/example/qms/TransactionDetails.java
0 → 100644
View file @
2c5c9df7
package
com
.
example
.
qms
;
import
android.os.Bundle
;
import
android.widget.ImageButton
;
import
androidx.activity.EdgeToEdge
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.core.graphics.Insets
;
import
androidx.core.view.ViewCompat
;
import
androidx.core.view.WindowInsetsCompat
;
public
class
TransactionDetails
extends
AppCompatActivity
{
private
ImageButton
back_button
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
EdgeToEdge
.
enable
(
this
);
setContentView
(
R
.
layout
.
activity_transaction_details
);
ViewCompat
.
setOnApplyWindowInsetsListener
(
findViewById
(
R
.
id
.
main
),
(
v
,
insets
)
->
{
Insets
systemBars
=
insets
.
getInsets
(
WindowInsetsCompat
.
Type
.
systemBars
());
v
.
setPadding
(
systemBars
.
left
,
systemBars
.
top
,
systemBars
.
right
,
systemBars
.
bottom
);
return
insets
;
});
back_button
=
findViewById
(
R
.
id
.
backButton
);
back_button
.
setOnClickListener
(
v
->
{
onBackPressed
();
});
}
}
\ No newline at end of file
app/src/main/res/drawable/alert_border.xml
0 → 100644
View file @
2c5c9df7
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<!-- This is the stroke you want to define -->
<stroke
android:width=
"1dp"
android:color=
"@color/card_border"
/>
<!-- Optional, round your corners -->
<corners
android:bottomLeftRadius=
"21dp"
android:topLeftRadius=
"21dp"
android:bottomRightRadius=
"21dp"
android:topRightRadius=
"21dp"
/>
<!-- Optional, fill the rest of your background with a color or gradient, use transparent if you only want the border to be displayed-->
<gradient
android:startColor=
"@android:color/white"
android:endColor=
"@android:color/white"
android:angle=
"90"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_access_item.xml
View file @
2c5c9df7
...
...
@@ -139,6 +139,7 @@
android:textStyle=
"bold"
/>
<LinearLayout
android:id=
"@+id/transactionDetails"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/background_border"
...
...
app/src/main/res/layout/activity_transaction_details.xml
0 → 100644
View file @
2c5c9df7
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/sync_alert.xml
View file @
2c5c9df7
...
...
@@ -4,8 +4,9 @@
android:id=
"@+id/syncAlert"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_constraintHeight=
"wrap_content"
app:layout_constraintWidth=
"300dp"
>
app:layout_constraintHeight=
"match_parent"
app:layout_constraintWidth=
"match_parent"
android:background=
"@drawable/alert_border"
>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -13,7 +14,8 @@
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingHorizontal=
"30dp"
android:paddingVertical=
"30dp"
>
android:paddingVertical=
"30dp"
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
android:layout_width=
"56dp"
...
...
@@ -200,19 +202,17 @@
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_marginVertical=
"20dp"
android:layout_marginBottom=
"20dp"
>
<Button
android:id=
"@+id/no_button"
android:layout_width=
"165dp"
android:layout_height=
"64dp"
android:layout_marginEnd=
"10dp"
...
...
@@ -227,6 +227,7 @@
app:strokeWidth=
"1dp"
/>
<Button
android:id=
"@+id/yes_button"
android:layout_width=
"165dp"
android:layout_height=
"64dp"
android:backgroundTint=
"@color/primary"
...
...
@@ -238,4 +239,6 @@
app:cornerRadius=
"27dp"
/>
</LinearLayout>
</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