Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
baby-monitoring-android-app
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
R24-145
baby-monitoring-android-app
Commits
3954a365
Commit
3954a365
authored
Oct 20, 2024
by
Ishankha K.C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notification Log connected
parent
94ec69b4
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
538 additions
and
5 deletions
+538
-5
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-0
app/src/main/java/com/kaluwa/enterprises/babycare/activities/ActivityLogsActivity.java
...enterprises/babycare/activities/ActivityLogsActivity.java
+240
-0
app/src/main/java/com/kaluwa/enterprises/babycare/activities/BabyDashboardActivity.java
...nterprises/babycare/activities/BabyDashboardActivity.java
+1
-0
app/src/main/java/com/kaluwa/enterprises/babycare/activities/DashboardActivity.java
...wa/enterprises/babycare/activities/DashboardActivity.java
+2
-1
app/src/main/java/com/kaluwa/enterprises/babycare/adapter/ActivityLogsAdapter.java
...uwa/enterprises/babycare/adapter/ActivityLogsAdapter.java
+62
-0
app/src/main/java/com/kaluwa/enterprises/babycare/adapter/BabyDashboardAdapter.java
...wa/enterprises/babycare/adapter/BabyDashboardAdapter.java
+1
-1
app/src/main/java/com/kaluwa/enterprises/babycare/config/ApiConfig.java
...ava/com/kaluwa/enterprises/babycare/config/ApiConfig.java
+6
-0
app/src/main/java/com/kaluwa/enterprises/babycare/dto/ActivityLogDto.java
...a/com/kaluwa/enterprises/babycare/dto/ActivityLogDto.java
+14
-0
app/src/main/java/com/kaluwa/enterprises/babycare/dto/BabyDto.java
...ain/java/com/kaluwa/enterprises/babycare/dto/BabyDto.java
+1
-3
app/src/main/java/com/kaluwa/enterprises/babycare/service/ActivityLogsApiService.java
.../enterprises/babycare/service/ActivityLogsApiService.java
+15
-0
app/src/main/java/com/kaluwa/enterprises/babycare/utils/Utils.java
...ain/java/com/kaluwa/enterprises/babycare/utils/Utils.java
+10
-0
app/src/main/res/layout/activity_logs.xml
app/src/main/res/layout/activity_logs.xml
+148
-0
app/src/main/res/layout/item_activity_log.xml
app/src/main/res/layout/item_activity_log.xml
+33
-0
app/src/main/res/values-night/colors.xml
app/src/main/res/values-night/colors.xml
+1
-0
app/src/main/res/values/colors.xml
app/src/main/res/values/colors.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
3954a365
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.BabyCare"
android:theme=
"@style/Theme.BabyCare"
tools:targetApi=
"31"
>
tools:targetApi=
"31"
>
<activity
android:name=
".activities.ActivityLogsActivity"
android:exported=
"false"
/>
<activity
<activity
android:name=
".activities.LiveFeedActivity"
android:name=
".activities.LiveFeedActivity"
android:exported=
"false"
/>
android:exported=
"false"
/>
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/activities/ActivityLogsActivity.java
0 → 100644
View file @
3954a365
This diff is collapsed.
Click to expand it.
app/src/main/java/com/kaluwa/enterprises/babycare/activities/BabyDashboardActivity.java
View file @
3954a365
...
@@ -65,6 +65,7 @@ public class BabyDashboardActivity extends AppCompatActivity implements AddBabyD
...
@@ -65,6 +65,7 @@ public class BabyDashboardActivity extends AppCompatActivity implements AddBabyD
private
BabyApiService
babyApiService
;
private
BabyApiService
babyApiService
;
private
BabyDashboardAdapter
adapter
;
private
BabyDashboardAdapter
adapter
;
private
List
<
BabyDto
>
babyDtoList
=
new
ArrayList
<>();
private
List
<
BabyDto
>
babyDtoList
=
new
ArrayList
<>();
@SuppressLint
(
"NewApi"
)
@SuppressLint
(
"NewApi"
)
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/activities/DashboardActivity.java
View file @
3954a365
...
@@ -47,7 +47,8 @@ public class DashboardActivity extends AppCompatActivity {
...
@@ -47,7 +47,8 @@ public class DashboardActivity extends AppCompatActivity {
});
});
btn3
.
setOnClickListener
(
v
->
{
btn3
.
setOnClickListener
(
v
->
{
Intent
intent
=
new
Intent
(
this
,
ActivityLogsActivity
.
class
);
startActivity
(
intent
);
});
});
btn4
.
setOnClickListener
(
v
->
{
btn4
.
setOnClickListener
(
v
->
{
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/adapter/ActivityLogsAdapter.java
0 → 100644
View file @
3954a365
package
com.kaluwa.enterprises.babycare.adapter
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.kaluwa.enterprises.babycare.R
;
import
com.kaluwa.enterprises.babycare.dto.ActivityLogDto
;
import
java.util.List
;
public
class
ActivityLogsAdapter
extends
RecyclerView
.
Adapter
<
ActivityLogsAdapter
.
ActivityLogItemHolder
>
{
private
final
static
String
TAG
=
"ActivityLogAdapter"
;
private
Context
context
;
private
List
<
ActivityLogDto
>
activityLogList
;
public
ActivityLogsAdapter
(
Context
context
,
List
<
ActivityLogDto
>
activityLogList
)
{
this
.
context
=
context
;
this
.
activityLogList
=
activityLogList
;
}
@NonNull
@Override
public
ActivityLogsAdapter
.
ActivityLogItemHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
View
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
item_activity_log
,
parent
,
false
);
return
new
ActivityLogsAdapter
.
ActivityLogItemHolder
(
view
);
}
@SuppressLint
(
"SetTextI18n"
)
@Override
public
void
onBindViewHolder
(
@NonNull
ActivityLogsAdapter
.
ActivityLogItemHolder
holder
,
int
position
)
{
ActivityLogDto
activityLogDto
=
activityLogList
.
get
(
position
);
holder
.
tvActivityLogId
.
setText
(
activityLogDto
.
getActivityLogId
().
toString
());
holder
.
tvActivityType
.
setText
(
activityLogDto
.
getActivityLogType
());
holder
.
tvDescription
.
setText
(
activityLogDto
.
getActivityLogDescription
());
}
@Override
public
int
getItemCount
()
{
return
activityLogList
.
size
();
}
public
static
class
ActivityLogItemHolder
extends
RecyclerView
.
ViewHolder
{
public
TextView
tvActivityLogId
,
tvActivityType
,
tvDescription
;
public
ActivityLogItemHolder
(
@NonNull
View
view
)
{
super
(
view
);
tvActivityLogId
=
view
.
findViewById
(
R
.
id
.
tvActivityLogId
);
tvActivityType
=
view
.
findViewById
(
R
.
id
.
tvActivityType
);
tvDescription
=
view
.
findViewById
(
R
.
id
.
tvDescription
);
}
}
}
app/src/main/java/com/kaluwa/enterprises/babycare/adapter/BabyDashboardAdapter.java
View file @
3954a365
...
@@ -59,7 +59,7 @@ public class BabyDashboardAdapter extends RecyclerView.Adapter<BabyDashboardAdap
...
@@ -59,7 +59,7 @@ public class BabyDashboardAdapter extends RecyclerView.Adapter<BabyDashboardAdap
String
sex
=
babyDto
.
getSex
();
String
sex
=
babyDto
.
getSex
();
String
notes
=
babyDto
.
getNotes
();
String
notes
=
babyDto
.
getNotes
();
Boolean
isActive
=
babyDto
.
getIsActive
();
Boolean
isActive
=
babyDto
.
getIsActive
();
InputStream
imageData
=
babyDto
.
getImageData
();
byte
[]
imageData
=
babyDto
.
getImageData
();
if
(
lastname
!=
null
)
{
if
(
lastname
!=
null
)
{
holder
.
tvBabyName
.
setText
(
firstname
+
" "
+
lastname
);
holder
.
tvBabyName
.
setText
(
firstname
+
" "
+
lastname
);
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/config/ApiConfig.java
View file @
3954a365
...
@@ -6,6 +6,7 @@ import static com.kaluwa.enterprises.babycare.constants.Configs.BASE_URL;
...
@@ -6,6 +6,7 @@ import static com.kaluwa.enterprises.babycare.constants.Configs.BASE_URL;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
;
import
com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
;
import
com.kaluwa.enterprises.babycare.service.ActivityLogsApiService
;
import
com.kaluwa.enterprises.babycare.service.AuthApiService
;
import
com.kaluwa.enterprises.babycare.service.AuthApiService
;
import
com.kaluwa.enterprises.babycare.service.BabyApiService
;
import
com.kaluwa.enterprises.babycare.service.BabyApiService
;
import
com.kaluwa.enterprises.babycare.service.DocumentApiService
;
import
com.kaluwa.enterprises.babycare.service.DocumentApiService
;
...
@@ -77,4 +78,9 @@ public class ApiConfig {
...
@@ -77,4 +78,9 @@ public class ApiConfig {
AUTH_TOKEN
=
JWTToken
;
AUTH_TOKEN
=
JWTToken
;
return
retrofitOther
.
create
(
DocumentApiService
.
class
);
return
retrofitOther
.
create
(
DocumentApiService
.
class
);
}
}
public
ActivityLogsApiService
getActivityLogsApi
(
String
JWTToken
)
{
AUTH_TOKEN
=
JWTToken
;
return
retrofitOther
.
create
(
ActivityLogsApiService
.
class
);
}
}
}
app/src/main/java/com/kaluwa/enterprises/babycare/dto/ActivityLogDto.java
0 → 100644
View file @
3954a365
package
com.kaluwa.enterprises.babycare.dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
ActivityLogDto
{
private
Long
activityLogId
;
private
String
activityLogType
;
private
String
activityLogDescription
;
}
app/src/main/java/com/kaluwa/enterprises/babycare/dto/BabyDto.java
View file @
3954a365
...
@@ -49,9 +49,7 @@ public class BabyDto {
...
@@ -49,9 +49,7 @@ public class BabyDto {
private
UserDto
user
;
private
UserDto
user
;
private
Long
userId
;
private
Long
userId
;
private
Long
documentId
;
private
Long
documentId
;
private
byte
[]
imageData
;
@JsonIgnore
private
InputStream
imageData
;
@JsonIgnore
@JsonIgnore
private
boolean
sys_validated
;
private
boolean
sys_validated
;
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/service/ActivityLogsApiService.java
0 → 100644
View file @
3954a365
package
com.kaluwa.enterprises.babycare.service
;
import
com.kaluwa.enterprises.babycare.dto.ActivityLogDto
;
import
java.util.List
;
import
retrofit2.Call
;
import
retrofit2.http.GET
;
public
interface
ActivityLogsApiService
{
@GET
(
"activity-logs"
)
Call
<
List
<
ActivityLogDto
>>
getAllActivityLogs
();
}
app/src/main/java/com/kaluwa/enterprises/babycare/utils/Utils.java
View file @
3954a365
...
@@ -223,6 +223,16 @@ public class Utils {
...
@@ -223,6 +223,16 @@ public class Utils {
}
}
}
}
public
static
Bitmap
convertByteArrayToBitmap
(
byte
[]
byteArray
)
{
try
{
return
BitmapFactory
.
decodeByteArray
(
byteArray
,
0
,
byteArray
.
length
);
}
catch
(
Exception
e
)
{
Log
.
e
(
TAG
,
"Error decoding image byte array: "
+
e
.
getMessage
());
throw
new
RuntimeException
(
"Error decoding image byte array"
);
}
}
public
static
int
dpToPx
(
Context
context
,
int
dp
)
{
public
static
int
dpToPx
(
Context
context
,
int
dp
)
{
float
density
=
context
.
getResources
().
getDisplayMetrics
().
density
;
float
density
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
Math
.
round
(
dp
*
density
);
return
Math
.
round
(
dp
*
density
);
...
...
app/src/main/res/layout/activity_logs.xml
0 → 100644
View file @
3954a365
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
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/swipeContainer"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".activities.ActivityLogsActivity"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/appbar"
/>
<ImageView
android:id=
"@+id/background"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/b_care_action_bar"
app:layout_constraintBottom_toBottomOf=
"parent"
android:src=
"@drawable/background"
android:contentDescription=
"background-image"
android:scaleType=
"centerCrop"
android:alpha=
"0.4"
/>
<RelativeLayout
android:id=
"@+id/rl_header"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/rl_background"
android:backgroundTint=
"#62178F"
app:layout_constraintTop_toTopOf=
"@+id/background"
app:layout_constraintStart_toStartOf=
"@id/background"
app:layout_constraintEnd_toEndOf=
"@id/background"
android:padding=
"8dp"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Activity Notifications"
android:textAlignment=
"center"
android:textColor=
"@color/white"
android:textAllCaps=
"true"
android:fontFamily=
"@font/inknut_antiqua_regular"
android:textSize=
"20sp"
android:gravity=
"center"
/>
</RelativeLayout>
<!-- Header Row for the Table -->
<LinearLayout
android:id=
"@+id/headerRow"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:background=
"@color/gray"
android:paddingTop=
"6dp"
android:paddingStart=
"15dp"
android:paddingEnd=
"15dp"
android:paddingBottom=
"6dp"
app:layout_constraintTop_toBottomOf=
"@id/rl_header"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.8"
android:text=
"Id"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textColor=
"@color/black"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:text=
"Activity Type"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textColor=
"@color/black"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"3"
android:text=
"Description"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textColor=
"@color/black"
/>
</LinearLayout>
<!-- RecyclerView for the Table Content -->
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_activity_notifications"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
app:layout_constraintTop_toBottomOf=
"@id/headerRow"
app:layout_constraintBottom_toBottomOf=
"@id/background"
app:layout_constraintEnd_toEndOf=
"@id/background"
app:layout_constraintStart_toStartOf=
"@id/background"
android:scrollbars=
"none"
android:paddingTop=
"6dp"
android:paddingStart=
"15dp"
android:paddingEnd=
"15dp"
android:paddingBottom=
"6dp"
/>
<TextView
android:id=
"@+id/no_content_message"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"No content available"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
<View
android:id=
"@+id/overlay"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#99D5C5DF"
android:visibility=
"gone"
android:clickable=
"true"
android:focusable=
"true"
/>
<com.github.ybq.android.spinkit.SpinKitView
android:id=
"@+id/progress_bar"
style=
"@style/SpinKitView.Large.DoubleBounce"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
app:SpinKit_Color=
"@color/purple"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:visibility=
"gone"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
\ No newline at end of file
app/src/main/res/layout/item_activity_log.xml
0 → 100644
View file @
3954a365
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:padding=
"8dp"
>
<TextView
android:id=
"@+id/tvActivityLogId"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.8"
android:text=
"Id"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tvActivityType"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:text=
"Activity Type"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tvDescription"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"3"
android:text=
"Description"
android:textSize=
"16sp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values-night/colors.xml
View file @
3954a365
...
@@ -9,4 +9,5 @@
...
@@ -9,4 +9,5 @@
<color
name=
"cancel_dark_red"
>
#CC0000
</color>
<color
name=
"cancel_dark_red"
>
#CC0000
</color>
<color
name=
"success_green"
>
#28A745
</color>
<color
name=
"success_green"
>
#28A745
</color>
<color
name=
"success_dark_green"
>
#218838
</color>
<color
name=
"success_dark_green"
>
#218838
</color>
<color
name=
"gray"
>
#D3D3D3
</color>
<!-- Light gray color -->
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
3954a365
...
@@ -12,4 +12,5 @@
...
@@ -12,4 +12,5 @@
<color
name=
"cancel_dark_red"
>
#CC0000
</color>
<color
name=
"cancel_dark_red"
>
#CC0000
</color>
<color
name=
"success_green"
>
#28A745
</color>
<color
name=
"success_green"
>
#28A745
</color>
<color
name=
"success_dark_green"
>
#218838
</color>
<color
name=
"success_dark_green"
>
#218838
</color>
<color
name=
"gray"
>
#D3D3D3
</color>
<!-- Light gray color -->
</resources>
</resources>
\ 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