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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
514 additions
and
29 deletions
+514
-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
+390
-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
<?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"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/main"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".TransactionDetails"
>
<LinearLayout
android:id=
"@+id/top_nav"
android:layout_width=
"match_parent"
android:layout_height=
"117dp"
android:background=
"@color/primary"
android:orientation=
"vertical"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"59dp"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"59dp"
>
<ImageButton
android:id=
"@+id/backButton"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_marginStart=
"16dp"
android:background=
"@null"
android:src=
"@drawable/arrow_left"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/titleText"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"A-1-1"
android:textColor=
"@color/white"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
app:layout_constraintTop_toBottomOf=
"@+id/top_nav"
app:layout_constraintBottom_toBottomOf=
"parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"21dp"
android:layout_marginTop=
"27dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:text=
"ASH20200318-128754"
android:textSize=
"21sp"
android:textStyle=
"bold"
/>
<Button
android:layout_width=
"139dp"
android:layout_height=
"wrap_content"
android:backgroundTint=
"@color/tertiary"
android:clickable=
"true"
android:elevation=
"20dp"
android:focusable=
"true"
android:text=
"Return"
android:textColor=
"@android:color/black"
android:textSize=
"17sp"
app:cornerRadius=
"40dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_marginTop=
"15dp"
>
<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=
"Unit No."
android:textSize=
"19sp"
android:textColor=
"@color/grey"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Jeremy Shaw"
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"
>
<TextView
android:layout_width=
"100dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"5dp"
android:text=
"Unit Owner"
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"
>
<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=
"30 Dec 2024, 11:30 AM"
android:textColor=
"@color/black"
android:textSize=
"20sp"
android:layout_marginStart=
"50dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginTop=
"20dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:text=
"Item List"
android:textSize=
"21sp"
android:textStyle=
"bold"
/>
<TableLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/background_border"
>
<!-- Header Row -->
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/table_background"
android:padding=
"15dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.5"
android:text=
"No."
android:textSize=
"19sp"
android:textColor=
"@color/white"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Item"
android:textSize=
"19sp"
android:textColor=
"@color/white"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:text=
"Posession"
android:textSize=
"19sp"
android:textColor=
"@color/white"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.5"
android:text=
"Qty."
android:textSize=
"19sp"
android:textColor=
"@color/white"
/>
</TableRow>
<!-- Data Row 1 -->
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingVertical=
"20dp"
android:padding=
"15dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.5"
android:textSize=
"19sp"
android:text=
"1"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textSize=
"19sp"
android:text=
"Main Door Key"
android:layout_marginEnd=
"10dp"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:textSize=
"19sp"
android:text=
"Customer Service > Owner"
android:layout_marginEnd=
"10dp"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.5"
android:textSize=
"19sp"
android:text=
"1"
/>
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginTop=
"20dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:text=
"Remarks"
android:textSize=
"21sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"For Reference"
android:textColor=
"@color/dark_grey"
android:textSize=
"20sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginTop=
"30dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:text=
"Submitted By"
android:textSize=
"21sp"
android:textStyle=
"bold"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/background_border"
android:orientation=
"horizontal"
android:padding=
"10dp"
android:gravity=
"center"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"141dp"
android:src=
"@drawable/sign"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_marginTop=
"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"
>
<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>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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