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
c6a05d88
Commit
c6a05d88
authored
Oct 19, 2024
by
Ishankha K.C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connect document management api
parent
1c4c583c
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
664 additions
and
37 deletions
+664
-37
.idea/deploymentTargetSelector.xml
.idea/deploymentTargetSelector.xml
+18
-0
.idea/other.xml
.idea/other.xml
+340
-0
app/src/main/java/com/kaluwa/enterprises/babycare/activities/UserProfileActivity.java
.../enterprises/babycare/activities/UserProfileActivity.java
+7
-2
app/src/main/java/com/kaluwa/enterprises/babycare/config/ApiConfig.java
...ava/com/kaluwa/enterprises/babycare/config/ApiConfig.java
+7
-1
app/src/main/java/com/kaluwa/enterprises/babycare/constants/DocumentTypes.java
.../kaluwa/enterprises/babycare/constants/DocumentTypes.java
+9
-0
app/src/main/java/com/kaluwa/enterprises/babycare/constants/TableNames.java
...com/kaluwa/enterprises/babycare/constants/TableNames.java
+8
-0
app/src/main/java/com/kaluwa/enterprises/babycare/dialogs/AddBabyDialog.java
...om/kaluwa/enterprises/babycare/dialogs/AddBabyDialog.java
+1
-1
app/src/main/java/com/kaluwa/enterprises/babycare/dialogs/EditBabyDialog.java
...m/kaluwa/enterprises/babycare/dialogs/EditBabyDialog.java
+223
-4
app/src/main/java/com/kaluwa/enterprises/babycare/dto/BabyDto.java
...ain/java/com/kaluwa/enterprises/babycare/dto/BabyDto.java
+1
-0
app/src/main/java/com/kaluwa/enterprises/babycare/dto/UserDto.java
...ain/java/com/kaluwa/enterprises/babycare/dto/UserDto.java
+1
-0
app/src/main/java/com/kaluwa/enterprises/babycare/dto/responseDto/AuthenticationDto.java
...terprises/babycare/dto/responseDto/AuthenticationDto.java
+1
-0
app/src/main/java/com/kaluwa/enterprises/babycare/service/DocumentApiService.java
...luwa/enterprises/babycare/service/DocumentApiService.java
+23
-0
app/src/main/java/com/kaluwa/enterprises/babycare/service/UserApiService.java
...m/kaluwa/enterprises/babycare/service/UserApiService.java
+0
-7
app/src/main/res/layout/add_baby_view_layout.xml
app/src/main/res/layout/add_baby_view_layout.xml
+16
-16
app/src/main/res/layout/edit_baby_view_layout.xml
app/src/main/res/layout/edit_baby_view_layout.xml
+9
-6
No files found.
.idea/deploymentTargetSelector.xml
0 → 100644
View file @
c6a05d88
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"deploymentTargetSelector"
>
<selectionStates>
<SelectionState
runConfigName=
"app"
>
<option
name=
"selectionMode"
value=
"DROPDOWN"
/>
<DropdownSelection
timestamp=
"2024-09-03T20:20:16.727982200Z"
>
<Target
type=
"DEFAULT_BOOT"
>
<handle>
<DeviceId
pluginId=
"LocalEmulator"
identifier=
"path=D:\Softwares\toolbox\.android\.android\avd\Pixel_XL_API_29.avd"
/>
</handle>
</Target>
</DropdownSelection>
<DialogSelection
/>
</SelectionState>
</selectionStates>
</component>
</project>
\ No newline at end of file
.idea/other.xml
0 → 100644
View file @
c6a05d88
This diff is collapsed.
Click to expand it.
app/src/main/java/com/kaluwa/enterprises/babycare/activities/UserProfileActivity.java
View file @
c6a05d88
...
...
@@ -2,6 +2,8 @@ package com.kaluwa.enterprises.babycare.activities;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
config
.
TokenSaver
.
clearToken
;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
config
.
TokenSaver
.
getToken
;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
constants
.
DocumentTypes
.
IMAGE
;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
constants
.
TableNames
.
USERS
;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
utils
.
Utils
.
animationChanger
;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
utils
.
Utils
.
convertByteArrayToBitmap
;
import
static
com
.
kaluwa
.
enterprises
.
babycare
.
utils
.
Utils
.
disableEditText
;
...
...
@@ -47,6 +49,7 @@ import com.kaluwa.enterprises.babycare.dto.UserDto;
import
com.kaluwa.enterprises.babycare.dto.responseDto.AuthenticationDto
;
import
com.kaluwa.enterprises.babycare.dto.responseDto.ResponseDto
;
import
com.kaluwa.enterprises.babycare.error.ErrorDto
;
import
com.kaluwa.enterprises.babycare.service.DocumentApiService
;
import
com.kaluwa.enterprises.babycare.service.UserApiService
;
import
com.kaluwa.enterprises.babycare.utils.Utils
;
import
com.yalantis.ucrop.UCrop
;
...
...
@@ -76,6 +79,7 @@ public class UserProfileActivity extends AppCompatActivity {
private
SpinKitView
progressBar
;
private
View
overlay
;
private
UserApiService
userApiService
;
private
DocumentApiService
documentApiService
;
private
AuthenticationDto
authDto
;
private
ActivityResultLauncher
<
Intent
>
pickImageLauncher
;
private
ActivityResultLauncher
<
Intent
>
cropImageLauncher
;
...
...
@@ -96,6 +100,7 @@ public class UserProfileActivity extends AppCompatActivity {
Toast
.
makeText
(
this
,
"Error getting token, Please refresh"
,
Toast
.
LENGTH_SHORT
).
show
();
}
userApiService
=
ApiConfig
.
getInstance
().
getUserApi
(
authDto
.
getTokenDto
().
getToken
());
documentApiService
=
ApiConfig
.
getInstance
().
getDocumentApi
(
authDto
.
getTokenDto
().
getToken
());
// progress
progressBar
=
findViewById
(
R
.
id
.
progress_bar
);
...
...
@@ -204,7 +209,7 @@ public class UserProfileActivity extends AppCompatActivity {
RequestBody
requestFile
=
RequestBody
.
create
(
MediaType
.
parse
(
"image/jpeg"
),
compressedData
);
MultipartBody
.
Part
body
=
MultipartBody
.
Part
.
createFormData
(
"image"
,
"image.jpg"
,
requestFile
);
Call
<
ResponseDto
>
call
=
userApiService
.
uploadUserImage
(
authDto
.
getUserId
(),
body
);
Call
<
ResponseDto
>
call
=
documentApiService
.
uploadUserImage
(
IMAGE
,
USERS
,
authDto
.
getUniqKey
(),
body
);
call
.
enqueue
(
new
Callback
<
ResponseDto
>()
{
@Override
public
void
onResponse
(
Call
<
ResponseDto
>
call
,
Response
<
ResponseDto
>
response
)
{
...
...
@@ -243,7 +248,7 @@ public class UserProfileActivity extends AppCompatActivity {
}
private
void
loadUserProfileImage
()
{
Call
<
ResponseBody
>
call
=
userApiService
.
getImage
(
authDto
.
getUserId
());
Call
<
ResponseBody
>
call
=
documentApiService
.
getImage
(
USERS
,
authDto
.
getUniqKey
());
call
.
enqueue
(
new
Callback
<
ResponseBody
>()
{
@Override
public
void
onResponse
(
Call
<
ResponseBody
>
call
,
Response
<
ResponseBody
>
response
)
{
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/config/ApiConfig.java
View file @
c6a05d88
...
...
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
import
com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
;
import
com.kaluwa.enterprises.babycare.service.AuthApiService
;
import
com.kaluwa.enterprises.babycare.service.BabyApiService
;
import
com.kaluwa.enterprises.babycare.service.DocumentApiService
;
import
com.kaluwa.enterprises.babycare.service.UserApiService
;
import
okhttp3.OkHttpClient
;
...
...
@@ -16,7 +17,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
import
retrofit2.converter.jackson.JacksonConverterFactory
;
public
class
ApiConfig
{
private
static
final
String
BASE_URL
=
"http://192.168.
63.103
:8080/api/v1/baby-care/"
;
private
static
final
String
BASE_URL
=
"http://192.168.
1.2
:8080/api/v1/baby-care/"
;
private
static
ApiConfig
instance
;
private
static
Retrofit
retrofitAuth
=
null
;
private
static
Retrofit
retrofitOther
=
null
;
...
...
@@ -71,4 +72,9 @@ public class ApiConfig {
AUTH_TOKEN
=
JWTToken
;
return
retrofitOther
.
create
(
BabyApiService
.
class
);
}
public
DocumentApiService
getDocumentApi
(
String
JWTToken
)
{
AUTH_TOKEN
=
JWTToken
;
return
retrofitOther
.
create
(
DocumentApiService
.
class
);
}
}
app/src/main/java/com/kaluwa/enterprises/babycare/constants/DocumentTypes.java
0 → 100644
View file @
c6a05d88
package
com.kaluwa.enterprises.babycare.constants
;
public
class
DocumentTypes
{
public
static
final
String
PROFILE_IMAGE
=
"profile_image"
;
public
static
final
String
BABY_PROFILE_IMAGE
=
"baby_profile_image"
;
public
static
final
String
IMAGE
=
"image"
;
}
app/src/main/java/com/kaluwa/enterprises/babycare/constants/TableNames.java
0 → 100644
View file @
c6a05d88
package
com.kaluwa.enterprises.babycare.constants
;
public
class
TableNames
{
public
static
final
String
USERS
=
"users"
;
public
static
final
String
BABIES
=
"babies"
;
}
app/src/main/java/com/kaluwa/enterprises/babycare/dialogs/AddBabyDialog.java
View file @
c6a05d88
...
...
@@ -240,7 +240,7 @@ public class AddBabyDialog extends AppCompatDialogFragment {
etSEmergRelation
=
view
.
findViewById
(
R
.
id
.
abv_et_s_emergency_relationship
);
etSEmergConNumber
=
view
.
findViewById
(
R
.
id
.
abv_et_s_emergency_con_number
);
etNotes
=
view
.
findViewById
(
R
.
id
.
abv_et_notes
);
ibPhoto
=
view
.
findViewById
(
R
.
id
.
abv_ib_photo
);
//
ibPhoto = view.findViewById(R.id.abv_ib_photo);
switchStatus
=
view
.
findViewById
(
R
.
id
.
abv_switch_status
);
progressbar
=
view
.
findViewById
(
R
.
id
.
progress_bar
);
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/dialogs/EditBabyDialog.java
View file @
c6a05d88
This diff is collapsed.
Click to expand it.
app/src/main/java/com/kaluwa/enterprises/babycare/dto/BabyDto.java
View file @
c6a05d88
...
...
@@ -45,6 +45,7 @@ public class BabyDto {
private
String
secondaryEmergencyRelationship
;
private
String
secondaryEmergencyContactNumber
;
private
String
notes
;
private
String
uniqKey
;
private
UserDto
user
;
private
Long
userId
;
private
Long
documentId
;
...
...
app/src/main/java/com/kaluwa/enterprises/babycare/dto/UserDto.java
View file @
c6a05d88
...
...
@@ -17,5 +17,6 @@ public class UserDto {
private
String
phone
;
private
String
role
;
private
String
status
;
private
String
uniqKey
;
private
LocalDate
dob
;
}
\ No newline at end of file
app/src/main/java/com/kaluwa/enterprises/babycare/dto/responseDto/AuthenticationDto.java
View file @
c6a05d88
...
...
@@ -15,5 +15,6 @@ public class AuthenticationDto {
private
String
phone
;
private
String
role
;
private
String
status
;
private
String
uniqKey
;
private
TokenDto
tokenDto
;
}
\ No newline at end of file
app/src/main/java/com/kaluwa/enterprises/babycare/service/DocumentApiService.java
0 → 100644
View file @
c6a05d88
package
com.kaluwa.enterprises.babycare.service
;
import
com.kaluwa.enterprises.babycare.dto.responseDto.ResponseDto
;
import
okhttp3.MultipartBody
;
import
okhttp3.ResponseBody
;
import
retrofit2.Call
;
import
retrofit2.http.GET
;
import
retrofit2.http.Multipart
;
import
retrofit2.http.PUT
;
import
retrofit2.http.Part
;
import
retrofit2.http.Path
;
public
interface
DocumentApiService
{
@Multipart
@PUT
(
"document/{docType}/{table}/{uniqKey}"
)
Call
<
ResponseDto
>
uploadUserImage
(
@Path
(
"docType"
)
String
docType
,
@Path
(
"table"
)
String
table
,
@Path
(
"uniqKey"
)
String
uniqKey
,
@Part
MultipartBody
.
Part
image
);
@GET
(
"document/{table}/{uniqKey}"
)
Call
<
ResponseBody
>
getImage
(
@Path
(
"table"
)
String
table
,
@Path
(
"uniqKey"
)
String
uniqKey
);
}
app/src/main/java/com/kaluwa/enterprises/babycare/service/UserApiService.java
View file @
c6a05d88
...
...
@@ -21,11 +21,4 @@ public interface UserApiService {
@PUT
(
"user/{userId}"
)
Call
<
UserDto
>
updateUserById
(
@Path
(
"userId"
)
Long
userId
,
@Body
UserDto
user
);
@Multipart
@PUT
(
"user/image/{userId}"
)
Call
<
ResponseDto
>
uploadUserImage
(
@Path
(
"userId"
)
Long
userId
,
@Part
MultipartBody
.
Part
image
);
@GET
(
"user/image/{userId}"
)
Call
<
ResponseBody
>
getImage
(
@Path
(
"userId"
)
Long
userId
);
}
app/src/main/res/layout/add_baby_view_layout.xml
View file @
c6a05d88
...
...
@@ -77,22 +77,22 @@
android:textSize=
"16sp"
android:fontFamily=
"@font/kanit_regular"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
android:text=
"Photo"
android:fontFamily=
"@font/kanit_regular"
android:paddingStart=
"5dp"
android:paddingEnd=
"2dp"
android:paddingTop=
"6dp"
/
>
<ImageButton
android:id=
"@+id/abv_ib_photo"
android:layout_width=
"120dp"
android:layout_height=
"120dp"
android:src=
"@drawable/ic_add_32"
android:contentDescription=
"baby_uploaded_photo"
/
>
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:textSize="16sp"-->
<!-- android:text="Photo"-->
<!-- android:fontFamily="@font/kanit_regular"-->
<!-- android:paddingStart="5dp"-->
<!-- android:paddingEnd="2dp"-->
<!-- android:paddingTop="6dp"/>--
>
<!-- <ImageButton-->
<!-- android:id="@+id/abv_ib_photo"-->
<!-- android:layout_width="120dp"-->
<!-- android:layout_height="120dp"-->
<!-- android:src="@drawable/ic_add_32"-->
<!-- android:contentDescription="baby_uploaded_photo"/>--
>
<LinearLayout
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/edit_baby_view_layout.xml
View file @
c6a05d88
...
...
@@ -41,14 +41,17 @@
android:background=
"@drawable/borders"
android:padding=
"8dp"
>
<
ImageButton
<
com.google.android.material.imageview.ShapeableImageView
android:id=
"@+id/ebv_ib_photo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxHeight=
"200dp"
android:src=
"@drawable/ic_add_32"
android:layout_width=
"160dp"
android:layout_height=
"160dp"
android:maxHeight=
"160dp"
android:layout_marginTop=
"20dp"
android:layout_marginBottom=
"20dp"
android:src=
"@drawable/foreground"
app:shapeAppearanceOverlay=
"@style/RoundImage"
android:scaleType=
"centerCrop"
android:adjustViewBounds=
"true"
android:scaleType=
"centerInside"
android:layout_gravity=
"center"
android:contentDescription=
"baby_uploaded_photo"
/>
...
...
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