Commit 9d4716df authored by Ishankha K.C's avatar Ishankha K.C

add device contacts

parent 65f7e087
......@@ -340,10 +340,16 @@ public class ActivityLogsActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -48,10 +48,16 @@ public class ApplicationSettingsActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -186,10 +186,16 @@ public class BabyDashboardActivity extends AppCompatActivity implements AddBabyD
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -85,10 +85,16 @@ public class DashboardActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -44,10 +44,16 @@ public class DeviceControlsActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -180,10 +180,16 @@ public class LiveFeedActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -67,10 +67,16 @@ public class LiveVocalActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -82,10 +82,16 @@ public class SettingsActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -481,10 +481,16 @@ public class UserProfileActivity extends AppCompatActivity {
popupMenu.getMenuInflater().inflate(R.menu.menu_main, popupMenu.getMenu());
popupMenu.setOnMenuItemClickListener(item -> {
int id = item.getItemId();
if (id == R.id.mm_device_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
if (id == R.id.mm_dashboard) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
animationChanger(this);
finish();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
animationChanger(this);
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
......
......@@ -9,6 +9,7 @@ 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.BabyApiService;
import com.kaluwa.enterprises.babycare.service.ContactInfoService;
import com.kaluwa.enterprises.babycare.service.DocumentApiService;
import com.kaluwa.enterprises.babycare.service.UserApiService;
......@@ -83,4 +84,9 @@ public class ApiConfig {
AUTH_TOKEN = JWTToken;
return retrofitOther.create(ActivityLogsApiService.class);
}
public ContactInfoService getContactInfoApi(String JWTToken) {
AUTH_TOKEN = JWTToken;
return retrofitOther.create(ContactInfoService.class);
}
}
package com.kaluwa.enterprises.babycare.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ContactInfoDto {
private Long contactInfoId;
private String contactName;
private String contactNo;
private String type;
private UserDto user;
private Long userId;
}
package com.kaluwa.enterprises.babycare.service;
import com.kaluwa.enterprises.babycare.dto.ContactInfoDto;
import com.kaluwa.enterprises.babycare.dto.responseDto.ResponseDto;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
public interface ContactInfoService {
@POST("contact-info")
Call<ContactInfoDto> createContactInfo(@Body ContactInfoDto contactInfoDto);
@GET("contact-info/user-id/{userId}/{type}")
Call<ContactInfoDto> getContactInfoByUserIdAndType(@Path("userId") Long userId, @Path("type") String type);
@PUT("contact-info/{contactInfoId}")
Call<ContactInfoDto> updateContactInfo(@Path("contactInfoId") Long contactInfoId, @Body ContactInfoDto contactInfoDto);
@DELETE("contact-info/{userId}/{type}")
Call<ResponseDto> deleteContactInfoByUserIdAndType(@Path("userId") Long userId, @Path("type") String type);
}
......@@ -126,4 +126,26 @@
</ScrollView>
<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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Contact Information"
android:textColor="@color/purple"
android:textStyle="bold"
android:fontFamily="@font/jeju_gothic_regular"
android:textSize="18sp"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dark_purple"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="4dp"
android:background="@drawable/borders"
android:padding="8dp">
<EditText
android:id="@+id/aci_et_cont_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/contact_name"
android:inputType="textPersonName"
android:textSize="16sp"
android:fontFamily="@font/kanit_regular" />
<EditText
android:id="@+id/aci_et_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/mobile_number_req"
android:inputType="textPersonName"
android:textSize="16sp"
android:fontFamily="@font/kanit_regular"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
<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>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/mm_dashboard"
android:title="Dashboard" />
<item
android:id="@+id/mm_app_setting"
android:title="App Settings" />
<item
android:id="@+id/mm_device_setting"
android:title="Device Settings" />
<item
android:id="@+id/mm_logout"
android:title="Logout" />
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Childy</string>
<string name="action_settings">Settings</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="forgot_password"><u>Forgot Password</u></string>
<string name="register"><u>Register</u></string>
<string name="login"><u>Login</u></string>
<string name="edit_btn_value">Edit</string>
<string name="update_btn_value">Update</string>
<string name="first_name_req">First name<font color="#FF0000"> *</font></string>
<string name="email_req">Email<font color="#FF0000"> *</font></string>
<string name="password_req">Password<font color="#FF0000"> *</font></string>
......@@ -9,4 +21,7 @@
<string name="last_name_label">Last name</string>
<string name="birth_date_req">Birth date<font color="#FF0000"> *</font></string>
<string name="sex">Sex<font color="#FF0000"> *</font></string>
<string name="about">A child is a human being between the stages of birth and puberty, or between the developmental periods of infancy and puberty. It may also refer to an unborn human being. The legal definition of a child generally refers to a minor, which is a person younger than the age of majority.</string>
<string name="version">Version 0.1</string>
<string name="contact_name">Contact Name<font color="#FF0000"> *</font></string>
</resources>
\ No newline at end of file
......@@ -22,4 +22,5 @@
<string name="sex">Sex<font color="#FF0000"> *</font></string>
<string name="about">A child is a human being between the stages of birth and puberty, or between the developmental periods of infancy and puberty. It may also refer to an unborn human being. The legal definition of a child generally refers to a minor, which is a person younger than the age of majority.</string>
<string name="version">Version 0.1</string>
<string name="contact_name">Contact Name<font color="#FF0000"> *</font></string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment