Commit 5619cc28 authored by Ishankha K.C's avatar Ishankha K.C

Merge branch 'feature/chamod_dev' into 'master'

Feature/chamod dev

See merge request !1
parents f95aa25c 227c13db
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="AppInsightsSettings"> <component name="AppInsightsSettings">
<option name="selectedTabId" value="Android Vitals" />
<option name="tabSettings"> <option name="tabSettings">
<map> <map>
<entry key="Firebase Crashlytics"> <entry key="Firebase Crashlytics">
......
...@@ -3,7 +3,20 @@ ...@@ -3,7 +3,20 @@
<component name="deploymentTargetDropDown"> <component name="deploymentTargetDropDown">
<value> <value>
<entry key="app"> <entry key="app">
<State /> <State>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="adb-AYAV6R3925006878-kh1m4J._adb-tls-connect._tcp" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2024-05-18T11:27:38.975164100Z" />
</State>
</entry> </entry>
</value> </value>
</component> </component>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
......
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,retrofit2.Response,errorBody" />
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -38,7 +38,15 @@ dependencies { ...@@ -38,7 +38,15 @@ dependencies {
implementation(libs.constraintlayout) implementation(libs.constraintlayout)
implementation(libs.navigation.fragment) implementation(libs.navigation.fragment)
implementation(libs.navigation.ui) implementation(libs.navigation.ui)
implementation(libs.activity)
implementation(libs.android.spinkit)
implementation(libs.retrofit2)
implementation(libs.convertor.gson)
implementation(libs.jackson.databind)
testImplementation(libs.junit) testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit) androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core) androidTestImplementation(libs.espresso.core)
compileOnly(libs.projectlombok)
annotationProcessor(libs.projectlombok)
} }
\ No newline at end of file
...@@ -2,16 +2,32 @@ ...@@ -2,16 +2,32 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
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.UserProfileActivity"
android:exported="false" />
<activity
android:name=".activities.DashboardActivity"
android:exported="false" />
<activity
android:name=".activities.auth.RegisterActivity"
android:exported="false" />
<activity
android:name=".activities.auth.LoginActivity"
android:exported="false" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"
......
package com.kaluwa.enterprises.babycare; package com.kaluwa.enterprises.babycare;
import static com.kaluwa.enterprises.babycare.config.TokenSaver.getToken;
import static com.kaluwa.enterprises.babycare.utils.Utils.animationChanger;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.View; import android.view.View;
import androidx.navigation.NavController; import androidx.navigation.NavController;
...@@ -13,17 +19,57 @@ import androidx.navigation.Navigation; ...@@ -13,17 +19,57 @@ import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration; import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI; import androidx.navigation.ui.NavigationUI;
import com.kaluwa.enterprises.babycare.activities.DashboardActivity;
import com.kaluwa.enterprises.babycare.activities.auth.LoginActivity;
import com.kaluwa.enterprises.babycare.config.TokenSaver;
import com.kaluwa.enterprises.babycare.databinding.ActivityMainBinding; import com.kaluwa.enterprises.babycare.databinding.ActivityMainBinding;
import com.kaluwa.enterprises.babycare.dto.AuthenticationDto;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
private final static String TAG = "MainActivity";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
Button startedBtn = findViewById(R.id.m_btn_get_started);
startedBtn.setOnClickListener(v -> {
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
animationChanger(this);
});
}
@Override
protected void onStart() {
super.onStart();
// auto login
autoLogin();
}
private void autoLogin() {
// check auth
try {
AuthenticationDto authDto = getToken(getApplicationContext());
if (authDto != null) {
Intent intent = new Intent(this, DashboardActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Toast.makeText(this, "Successfully logged in.", Toast.LENGTH_SHORT).show();
finish();
animationChanger(this);
}
} catch (JsonProcessingException e) {
Log.e(TAG, "Error: "+e.getMessage());
Toast.makeText(this, "Auto login failed.", Toast.LENGTH_SHORT).show();
}
} }
} }
\ No newline at end of file
package com.kaluwa.enterprises.babycare.activities;
import static com.kaluwa.enterprises.babycare.config.TokenSaver.clearToken;
import static com.kaluwa.enterprises.babycare.utils.Utils.animationChanger;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
import androidx.appcompat.widget.Toolbar;
import com.kaluwa.enterprises.babycare.MainActivity;
import com.kaluwa.enterprises.babycare.R;
import com.kaluwa.enterprises.babycare.activities.auth.LoginActivity;
public class DashboardActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard);
// define actionbar
defineActionbar();
}
private void defineActionbar() {
Toolbar toolbar = findViewById(R.id.b_care_action_bar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayShowTitleEnabled(false);
}
toolbar.setNavigationIcon(R.drawable.ico_menu_32);
toolbar.setNavigationOnClickListener(v -> {
// Initializing the popup menu and giving the reference as current context
PopupMenu popupMenu = new PopupMenu(this, toolbar);
popupMenu.setGravity(Gravity.BOTTOM);
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();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
animationChanger(this);
}
return true;
});
popupMenu.show();
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.user_action_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int id = item.getItemId();
if (id == R.id.user) {
Intent intent = new Intent(this, UserProfileActivity.class);
startActivity(intent);
animationChanger(this);
} else {
Toast.makeText(this, "No item.", Toast.LENGTH_SHORT).show();
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed() {
super.onBackPressed();
animationChanger(this);
}
}
\ No newline at end of file
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.utils.Utils.animationChanger;
import static com.kaluwa.enterprises.babycare.utils.Utils.disableEditText;
import static com.kaluwa.enterprises.babycare.utils.Utils.loader;
import static com.kaluwa.enterprises.babycare.utils.Utils.mobileNumberValidation;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
import androidx.appcompat.widget.Toolbar;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.ybq.android.spinkit.SpinKitView;
import com.google.gson.Gson;
import com.kaluwa.enterprises.babycare.MainActivity;
import com.kaluwa.enterprises.babycare.R;
import com.kaluwa.enterprises.babycare.config.ApiConfig;
import com.kaluwa.enterprises.babycare.dto.AuthenticationDto;
import com.kaluwa.enterprises.babycare.dto.UserDto;
import com.kaluwa.enterprises.babycare.error.ErrorDto;
import com.kaluwa.enterprises.babycare.service.UserApiService;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class UserProfileActivity extends AppCompatActivity {
private final static String TAG = "UserProfileActivity";
private EditText etFirstName, etLastName, etType, etEmail, etMobile;
private Button btnEdit, btnCancel;
private SpinKitView progressBar;
private View overlay;
private UserApiService userApiService;
private AuthenticationDto authDto;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_profile);
// define actionbar
defineActionbar();
// initialize user api service
try {
authDto = getToken(getApplicationContext());
} catch (JsonProcessingException e) {
Log.e(TAG, "Error: "+e.getMessage());
Toast.makeText(this, "Error getting token, Please refresh", Toast.LENGTH_SHORT).show();
}
userApiService = ApiConfig.getInstance().getUserApi(authDto.getTokenDto().getToken());
// progress
progressBar = findViewById(R.id.progress_bar);
overlay = findViewById(R.id.overlay);
// variables
etFirstName = findViewById(R.id.up_et_firstname);
etLastName = findViewById(R.id.up_et_lastname);
etType = findViewById(R.id.up_et_type);
etEmail = findViewById(R.id.up_et_email);
etMobile = findViewById(R.id.up_et_mobile);
// buttons
btnEdit = findViewById(R.id.l_btn_edit);
btnCancel = findViewById(R.id.l_btn_cancel);
// disable all edit texts
disableET();
AtomicBoolean enableEdit = new AtomicBoolean(false);
btnCancel.setOnClickListener(v -> {
enableEdit.set(false);
disableET();
btnCancel.setVisibility(View.GONE);
btnEdit.setText(R.string.edit_btn_value);
btnEdit.setBackgroundResource(R.drawable.positive_btn_background);
});
btnEdit.setOnClickListener(v -> {
if (!enableEdit.get()) {
enableEdit.set(true);
enableET();
btnCancel.setVisibility(View.VISIBLE);
btnEdit.setText(R.string.update_btn_value);
btnEdit.setBackgroundResource(R.drawable.green_btn_background);
} else {
// validate text
UserDto user = validate();
// call update
if (!TextUtils.isEmpty(user.getFirstName())) {
updateUser(user, enableEdit);
}
}
});
}
private void updateUser(UserDto user, AtomicBoolean enableEdit) {
loader(overlay, progressBar, true);
Call<UserDto> call = userApiService.updateUserById(authDto.getUserId(), user);
call.enqueue(new Callback<UserDto>() {
@Override
public void onResponse(Call<UserDto> call, Response<UserDto> response) {
if (response.isSuccessful()) {
enableEdit.set(false);
disableET();
btnCancel.setVisibility(View.GONE);
btnEdit.setText(R.string.edit_btn_value);
btnEdit.setBackgroundResource(R.drawable.positive_btn_background);
Toast.makeText(UserProfileActivity.this, "User details successfully updated.", Toast.LENGTH_SHORT).show();
loader(overlay, progressBar, false);
} else {
try {
Gson gson = new Gson();
assert response.errorBody() != null;
String errorBodyString = response.errorBody().string();
// Check if the error body is in JSON format
if (errorBodyString.startsWith("{")) {
ErrorDto errorDto = gson.fromJson(errorBodyString, ErrorDto.class);
Toast.makeText(UserProfileActivity.this, errorDto.getMessage(), Toast.LENGTH_LONG).show();
} else {
// If the error body is not in JSON format, display a generic error message
Log.e(TAG, errorBodyString);
Toast.makeText(UserProfileActivity.this, "An unexpected error occurred", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
Log.e(TAG, e.getMessage());
Toast.makeText(UserProfileActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
loader(overlay, progressBar, false);
}
}
@Override
public void onFailure(Call<UserDto> call, Throwable t) {
Toast.makeText(UserProfileActivity.this, "Error to Failure", Toast.LENGTH_LONG).show();
loader(overlay, progressBar, false);
}
});
}
private UserDto validate() {
UserDto userDto = new UserDto();
String firstName, lastName, mobileNumber;
firstName = etFirstName.getText().toString();
lastName = etLastName.getText().toString();
mobileNumber = etMobile.getText().toString();
if (TextUtils.isEmpty(firstName)) {
etFirstName.setError("First name is required.");
etFirstName.requestFocus();
} else if (TextUtils.isEmpty(lastName)) {
etLastName.setError("Last name is required.");
etLastName.requestFocus();
} else if (TextUtils.isEmpty(mobileNumber)) {
etMobile.setError("Mobile number is required.");
etMobile.requestFocus();
} else if (!mobileNumberValidation(mobileNumber)) {
etMobile.setError("Invalid mobile number format, use - (+94*********)");
etMobile.requestFocus();
} else {
userDto.setUserId(authDto.getUserId());
userDto.setFirstName(firstName);
userDto.setLastName(lastName);
userDto.setPhone(mobileNumber);
}
return userDto;
}
private void loadData() {
loader(overlay, progressBar, true);
Call<UserDto> call = userApiService.getUserById(authDto.getUserId());
call.enqueue(new Callback<UserDto>() {
@Override
public void onResponse(Call<UserDto> call, Response<UserDto> response) {
if (response.isSuccessful()) {
UserDto user = response.body();
etFirstName.setText(user.getFirstName());
etLastName.setText(user.getLastName());
etType.setText(!Objects.equals(user.getRole(), "USER") ? user.getRole():"PARENT");
etEmail.setText(user.getEmail());
etMobile.setText(user.getPhone());
loader(overlay, progressBar, false);
} else {
try {
Gson gson = new Gson();
assert response.errorBody() != null;
String errorBodyString = response.errorBody().string();
// Check if the error body is in JSON format
if (errorBodyString.startsWith("{")) {
ErrorDto errorDto = gson.fromJson(errorBodyString, ErrorDto.class);
Toast.makeText(UserProfileActivity.this, errorDto.getMessage(), Toast.LENGTH_LONG).show();
} else {
// If the error body is not in JSON format, display a generic error message
Log.e(TAG, errorBodyString);
Toast.makeText(UserProfileActivity.this, "An unexpected error occurred", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
Log.e(TAG, e.getMessage());
Toast.makeText(UserProfileActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
loader(overlay, progressBar, false);
}
}
@Override
public void onFailure(Call<UserDto> call, Throwable t) {
Toast.makeText(UserProfileActivity.this, "Error to Failure", Toast.LENGTH_LONG).show();
loader(overlay, progressBar, false);
}
});
}
private void disableET() {
disableEditText(etFirstName, false, this);
disableEditText(etLastName, false, this);
disableEditText(etType, false, this);
disableEditText(etEmail, false, this);
disableEditText(etMobile, false, this);
}
private void enableET() {
disableEditText(etFirstName, true, this);
disableEditText(etLastName, true, this);
disableEditText(etMobile, true, this);
}
private void defineActionbar() {
Toolbar toolbar = findViewById(R.id.b_care_action_bar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayShowTitleEnabled(false);
}
toolbar.setNavigationIcon(R.drawable.ico_menu_32);
toolbar.setNavigationOnClickListener(v -> {
// Initializing the popup menu and giving the reference as current context
PopupMenu popupMenu = new PopupMenu(this, toolbar);
popupMenu.setGravity(Gravity.BOTTOM);
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();
} else if (id == R.id.mm_app_setting) {
Toast.makeText(this, "You Clicked " + item.getTitle(), Toast.LENGTH_SHORT).show();
} else if (id == R.id.mm_logout) {
clearToken(getApplicationContext());
Toast.makeText(this, "Logout successful.", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
animationChanger(this);
}
return true;
});
popupMenu.show();
});
}
@Override
protected void onStart() {
super.onStart();
// load data
loadData();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.user_action_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int id = item.getItemId();
if (id == R.id.user) {
Intent intent = getIntent();
finish();
startActivity(intent);
animationChanger(this);
} else {
Toast.makeText(this, "No item.", Toast.LENGTH_SHORT).show();
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed() {
super.onBackPressed();
animationChanger(this);
}
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.activities.auth;
import static com.kaluwa.enterprises.babycare.config.TokenSaver.getToken;
import static com.kaluwa.enterprises.babycare.config.TokenSaver.setToken;
import static com.kaluwa.enterprises.babycare.utils.Utils.animationChanger;
import static com.kaluwa.enterprises.babycare.utils.Utils.emailAddressValidation;
import static com.kaluwa.enterprises.babycare.utils.Utils.loader;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.ybq.android.spinkit.SpinKitView;
import com.google.gson.Gson;
import com.kaluwa.enterprises.babycare.R;
import com.kaluwa.enterprises.babycare.activities.DashboardActivity;
import com.kaluwa.enterprises.babycare.activities.UserProfileActivity;
import com.kaluwa.enterprises.babycare.config.ApiConfig;
import com.kaluwa.enterprises.babycare.dto.AuthenticationDto;
import com.kaluwa.enterprises.babycare.dto.LoginRequest;
import com.kaluwa.enterprises.babycare.dto.UserDto;
import com.kaluwa.enterprises.babycare.error.ErrorDto;
import com.kaluwa.enterprises.babycare.service.AuthApiService;
import java.io.IOException;
import java.util.Objects;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class LoginActivity extends AppCompatActivity {
private static final String TAG = "LoginActivity";
private EditText etEmail, etPassword;
private Button btnLogin;
private SpinKitView progressBar;
private View overlay;
// auth api service
private final AuthApiService authApiService = ApiConfig.getInstance().getAuthApi();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
// progress
progressBar = findViewById(R.id.progress_bar);
overlay = findViewById(R.id.overlay);
TextView tvRegister = findViewById(R.id.l_tv_register);
tvRegister.setOnClickListener(v -> {
Intent intent = new Intent(this, RegisterActivity.class);
startActivity(intent);
animationChanger(this);
});
etEmail = findViewById(R.id.l_et_username);
etPassword = findViewById(R.id.l_et_password);
btnLogin = findViewById(R.id.l_btn_login);
btnLogin.setOnClickListener(v -> {
LoginRequest request = validate();
// call api()
if (!TextUtils.isEmpty(request.getEmail())) {
loader(overlay, progressBar, true);
Call<AuthenticationDto> call = authApiService.userLogin(request);
call.enqueue(new Callback<AuthenticationDto>() {
@Override
public void onResponse(Call<AuthenticationDto> call, Response<AuthenticationDto> response) {
if (response.isSuccessful()) {
AuthenticationDto authDto = response.body();
try {
setToken(getApplicationContext(), authDto);
Toast.makeText(LoginActivity.this, "Successfully logged in.", Toast.LENGTH_LONG).show();
Intent intent = new Intent(LoginActivity.this, DashboardActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
} catch (JsonProcessingException e) {
Log.e(TAG, e.getMessage());
Toast.makeText(LoginActivity.this, "Token saver error.", Toast.LENGTH_LONG).show();
}
loader(overlay, progressBar, false);
} else {
try {
Gson gson = new Gson();
assert response.errorBody() != null;
String errorBodyString = response.errorBody().string();
// Check if the error body is in JSON format
if (errorBodyString.startsWith("{")) {
ErrorDto errorDto = gson.fromJson(errorBodyString, ErrorDto.class);
Toast.makeText(LoginActivity.this, errorDto.getMessage(), Toast.LENGTH_LONG).show();
} else {
// If the error body is not in JSON format, display a generic error message
Log.e(TAG, errorBodyString);
Toast.makeText(LoginActivity.this, "An unexpected error occurred", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
Log.e(TAG, e.getMessage());
Toast.makeText(LoginActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
loader(overlay, progressBar, false);
}
}
@Override
public void onFailure(Call<AuthenticationDto> call, Throwable t) {
Toast.makeText(LoginActivity.this, "Error to Failure", Toast.LENGTH_LONG).show();
loader(overlay, progressBar, false);
}
});
}
});
}
private LoginRequest validate() {
LoginRequest request = new LoginRequest();
String email, password;
email = etEmail.getText().toString();
password = etPassword.getText().toString();
if (TextUtils.isEmpty(email)) {
etEmail.setError("Email is required.");
etEmail.requestFocus();
} else if (!emailAddressValidation(email)) {
etEmail.setError("Invalid email address, Please re-check & try again.");
etEmail.requestFocus();
} else if (TextUtils.isEmpty(password)) {
etPassword.setError("Password is required.");
etPassword.requestFocus();
} else {
request.setEmail(email);
request.setPassword(password);
}
return request;
}
@Override
public void onBackPressed() {
super.onBackPressed();
animationChanger(this);
}
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.activities.auth;
import static com.kaluwa.enterprises.babycare.utils.Utils.animationChanger;
import static com.kaluwa.enterprises.babycare.utils.Utils.emailAddressValidation;
import static com.kaluwa.enterprises.babycare.utils.Utils.loader;
import static com.kaluwa.enterprises.babycare.utils.Utils.mobileNumberValidation;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.github.ybq.android.spinkit.SpinKitView;
import com.google.gson.Gson;
import com.kaluwa.enterprises.babycare.R;
import com.kaluwa.enterprises.babycare.activities.UserProfileActivity;
import com.kaluwa.enterprises.babycare.config.ApiConfig;
import com.kaluwa.enterprises.babycare.dto.RegisterRequest;
import com.kaluwa.enterprises.babycare.dto.UserDto;
import com.kaluwa.enterprises.babycare.error.ErrorDto;
import com.kaluwa.enterprises.babycare.service.AuthApiService;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class RegisterActivity extends AppCompatActivity {
private static final String TAG = "RegisterActivity";
private EditText etFirstName, etLastName, etMobileNumber, etEmail, etPassword, etConfPassword;
private Button btnRegister;
private SpinKitView progressBar;
private View overlay;
// auth api service
private final AuthApiService authApiService = ApiConfig.getInstance().getAuthApi();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
// progress
progressBar = findViewById(R.id.progress_bar);
overlay = findViewById(R.id.overlay);
// values
etFirstName = findViewById(R.id.r_et_first_name);
etLastName = findViewById(R.id.r_et_last_name);
etMobileNumber = findViewById(R.id.r_et_mobile);
etEmail = findViewById(R.id.r_et_username);
etPassword = findViewById(R.id.r_et_password);
etConfPassword = findViewById(R.id.r_et_conf_password);
btnRegister = findViewById(R.id.r_btn_register);
btnRegister.setOnClickListener(v -> {
RegisterRequest request = validate();
// call api()
if (request.getEmail() != null) {
loader(overlay, progressBar, true);
Call<UserDto> regCall = authApiService.userRegister(request);
regCall.enqueue(new Callback<UserDto>() {
@Override
public void onResponse(Call<UserDto> call, Response<UserDto> response) {
if (response.isSuccessful()) {
UserDto userDto = response.body();
System.out.println("UserId: " + userDto.getUserId());
Toast.makeText(RegisterActivity.this, "User Registration is successful, Please login now.", Toast.LENGTH_LONG).show();
loader(overlay, progressBar, false);
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
animationChanger(RegisterActivity.this);
} else {
try {
Gson gson = new Gson();
assert response.errorBody() != null;
String errorBodyString = response.errorBody().string();
// Check if the error body is in JSON format
if (errorBodyString.startsWith("{")) {
ErrorDto errorDto = gson.fromJson(errorBodyString, ErrorDto.class);
Toast.makeText(RegisterActivity.this, errorDto.getMessage(), Toast.LENGTH_LONG).show();
} else {
// If the error body is not in JSON format, display a generic error message
Log.e(TAG, errorBodyString);
Toast.makeText(RegisterActivity.this, "An unexpected error occurred", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
Log.e(TAG, e.getMessage());
Toast.makeText(RegisterActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
loader(overlay, progressBar, false);
}
}
@Override
public void onFailure(Call<UserDto> call, Throwable t) {
Toast.makeText(RegisterActivity.this, "Error to Failure", Toast.LENGTH_LONG).show();
loader(overlay, progressBar, false);
}
});
}
});
}
private RegisterRequest validate() {
RegisterRequest request = new RegisterRequest();
String firstname, lastname, mobile, email, password, confPassword;
firstname = etFirstName.getText().toString();
lastname = etLastName.getText().toString();
mobile = etMobileNumber.getText().toString();
email = etEmail.getText().toString();
password = etPassword.getText().toString();
confPassword = etConfPassword.getText().toString();
if (TextUtils.isEmpty(firstname)) {
etFirstName.setError("First name is required.");
etFirstName.requestFocus();
} else if (TextUtils.isEmpty(lastname)) {
etLastName.setError("Last name is required.");
etLastName.requestFocus();
} else if (TextUtils.isEmpty(mobile)) {
etMobileNumber.setError("Mobile number is required.");
etMobileNumber.requestFocus();
} else if (!mobileNumberValidation(mobile)) {
etMobileNumber.setError("Invalid mobile number format, use - (+94*********)");
etMobileNumber.requestFocus();
} else if (TextUtils.isEmpty(email)) {
etEmail.setError("Email address is required.");
etEmail.requestFocus();
} else if (!emailAddressValidation(email)) {
etEmail.setError("Invalid email address, Please re-check & try again.");
etEmail.requestFocus();
} else if (TextUtils.isEmpty(password)) {
etPassword.setError("Password is required");
etPassword.requestFocus();
} else if (password.length() < 6) {
etPassword.setError("Password must be at least 6 characters long.");
etPassword.requestFocus();
} else if (!password.equals(confPassword)) {
etConfPassword.setError("Password and confirm password do not match, Please re-check & try again.");
etConfPassword.requestFocus();
} else {
request.setFirstName(firstname);
request.setLastName(lastname);
request.setPhone(mobile);
request.setEmail(email);
request.setPassword(password);
}
return request;
}
@Override
public void onBackPressed() {
super.onBackPressed();
animationChanger(this);
}
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.config;
import static com.kaluwa.enterprises.babycare.config.TokenSaver.getToken;
import com.kaluwa.enterprises.babycare.service.AuthApiService;
import com.kaluwa.enterprises.babycare.service.UserApiService;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiConfig {
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;
private static String AUTH_TOKEN = "";
private ApiConfig() {
OkHttpClient authHttpClient = new OkHttpClient.Builder().build();
retrofitAuth = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(authHttpClient)
.build();
OkHttpClient otherHttpClient = new OkHttpClient.Builder()
.addInterceptor(chain -> {
Request originalRequest = chain.request();
Request.Builder builder = originalRequest.newBuilder()
.header("Authorization", "Bearer " + AUTH_TOKEN);
Request newRequest = builder.build();
return chain.proceed(newRequest);
})
.build();
retrofitOther = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(otherHttpClient)
.build();
}
public static synchronized ApiConfig getInstance() {
if (instance == null) {
instance = new ApiConfig();
}
return instance;
}
public AuthApiService getAuthApi() {
return retrofitAuth.create(AuthApiService.class);
}
public UserApiService getUserApi(String JWTToken) {
AUTH_TOKEN = JWTToken;
return retrofitOther.create(UserApiService.class);
}
}
package com.kaluwa.enterprises.babycare.config;
import android.content.Context;
import android.content.SharedPreferences;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kaluwa.enterprises.babycare.dto.AuthenticationDto;
public class TokenSaver {
private final static String SHARED_PREF_NAME = "net.kaluwa.SHARED_PREF_NAME";
private final static String TOKEN_KEY = "net.kaluwa.TOKEN_KEY";
private static ObjectMapper objectMapper = new ObjectMapper();
public static AuthenticationDto getToken(Context c) throws JsonProcessingException {
SharedPreferences prefs = c.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
String tokenDtoString = prefs.getString(TOKEN_KEY, null);
AuthenticationDto authDto;
if (tokenDtoString != null) {
authDto = objectMapper.readValue(tokenDtoString, AuthenticationDto.class);
} else {
authDto = null;
}
return authDto;
}
public static void setToken(Context c, AuthenticationDto authDto) throws JsonProcessingException {
SharedPreferences prefs = c.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
String tokenDtoString = objectMapper.writeValueAsString(authDto);
editor.putString(TOKEN_KEY, tokenDtoString);
editor.apply();
}
public static void clearToken(Context c) {
SharedPreferences prefs = c.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.remove(TOKEN_KEY);
editor.apply();
}
}
package com.kaluwa.enterprises.babycare.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AuthenticationDto {
private Long userId;
private String firstName;
private String lastName;
private String email;
private String phone;
private String role;
private String status;
private TokenDto tokenDto;
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginRequest {
private String email;
private String password;
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegisterRequest {
private String firstName;
private String lastName;
private String phone;
private String email;
private String password;
}
package com.kaluwa.enterprises.babycare.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TokenDto {
private String tokenType;
private long expiresIn;
private String token;
private String refreshToken;
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDto {
private Long userId;
private String firstName;
private String lastName;
private String email;
private String phone;
private String role;
private String status;
}
\ No newline at end of file
package com.kaluwa.enterprises.babycare.error;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ErrorDto {
private String timestamp;
private String message;
private String error;
}
package com.kaluwa.enterprises.babycare.service;
import com.kaluwa.enterprises.babycare.dto.AuthenticationDto;
import com.kaluwa.enterprises.babycare.dto.LoginRequest;
import com.kaluwa.enterprises.babycare.dto.RegisterRequest;
import com.kaluwa.enterprises.babycare.dto.UserDto;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface AuthApiService {
@POST("auth/register")
Call<UserDto> userRegister(@Body RegisterRequest request);
@POST("auth/login")
Call<AuthenticationDto> userLogin(@Body LoginRequest request);
}
package com.kaluwa.enterprises.babycare.service;
import com.kaluwa.enterprises.babycare.dto.UserDto;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Path;
public interface UserApiService {
@GET("user/{userId}")
Call<UserDto> getUserById(@Path("userId") Long userId);
@PUT("user/{userId}")
Call<UserDto> updateUserById(@Path("userId") Long userId, @Body UserDto user);
}
package com.kaluwa.enterprises.babycare.utils;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.EditText;
import com.github.ybq.android.spinkit.SpinKitView;
import com.kaluwa.enterprises.babycare.R;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils {
public static void loader(View overlay, SpinKitView spinKitView, boolean status) {
if (status) {
overlay.setVisibility(View.VISIBLE);
spinKitView.setVisibility(View.VISIBLE);
} else {
overlay.setVisibility(View.GONE);
spinKitView.setVisibility(View.GONE);
}
}
public static boolean mobileNumberValidation(String mobileNumber) {
Pattern p = Pattern.compile("\\+94\\d\\d\\d\\d\\d\\d\\d\\d\\d");
Matcher m = p.matcher(mobileNumber);
return m.matches();
}
public static boolean emailAddressValidation(String emailAddress) {
Pattern p = Pattern.compile("[-A-Za-z0-9!#$%&'*+/=?^_`{|}~]+(?:\\.[-A-Za-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[A-Za-z0-9](?:[-A-Za-z0-9]*[A-Za-z0-9])?\\.)+[A-Za-z0-9](?:[-A-Za-z0-9]*[A-Za-z0-9])?");
Matcher m = p.matcher(emailAddress);
return m.matches();
}
public static void animationChanger(Activity c) {
c.overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
public static void disableEditText(EditText et, boolean action, Context c) {
et.setFocusable(action);
et.setClickable(action);
et.setCursorVisible(action);
if (action) {
et.setFocusableInTouchMode(true);
et.setKeyListener(new EditText(c).getKeyListener()); // Restoring the default key listener
} else {
et.setKeyListener(null);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromAlpha="0.0"
android:toAlpha="1.0"/>
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromAlpha="1.0"
android:toAlpha="0.0"/>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/cancel_dark_red"/> <!-- Change this to a darker color or any other effect you want for pressed state -->
<corners android:radius="20dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/cancel_red"/>
<corners android:radius="20dp"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="@color/transparent"/>
<stroke android:width="2dp" android:color="@color/purple"/>
<corners android:radius="10dp" />
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<solid android:color="@color/transparent"/>
<stroke android:width="1dp" android:color="@color/line_outline"/>
<corners android:radius="10dp" />
</shape>
</item>
</selector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="51.549297dp" android:viewportHeight="122" android:viewportWidth="142" android:width="60dp">
<path android:fillColor="#73108B" android:pathData="M106,10C118.92,20.33 129.08,33.31 132,50C133.58,67.84 131.19,84.14 119.96,98.63C112.01,107.83 103.43,114.7 92,119C91.22,119.32 90.44,119.64 89.63,119.97C74.47,125.2 56.57,122.9 42.13,116.79C26.96,109.36 15.77,95.7 10,80C5.05,63.7 7.17,46.38 14.69,31.31C22.28,18.22 33.88,8.31 48,3C48.78,2.68 49.56,2.36 50.37,2.03C68.22,-4.13 90.65,-0.62 106,10Z"/>
<path android:fillColor="#FDFDFE" android:pathData="M78,41C82.7,41.35 85.33,43.49 88.94,46.38C89.49,46.81 90.04,47.25 90.61,47.7C91.79,48.63 92.97,49.57 94.14,50.51C96.72,52.57 99.31,54.6 101.91,56.64C104.61,58.75 107.31,60.88 110,63C109.81,66.78 109.11,67.9 106.3,70.54C105.13,71.44 103.94,72.32 102.75,73.19C101.48,74.14 100.2,75.1 98.93,76.06C97.95,76.78 97.95,76.78 96.95,77.52C95.05,78.96 93.2,80.45 91.36,81.97C90.49,82.67 90.49,82.67 89.61,83.39C88.52,84.28 87.43,85.18 86.35,86.09C84.84,87.3 84.84,87.3 82,89C80.35,88.67 78.7,88.34 77,88C77,83.38 77,78.76 77,74C75.12,74.03 75.12,74.03 73.19,74.06C68.54,74.14 63.88,74.18 59.22,74.22C57.2,74.24 55.19,74.27 53.17,74.3C50.27,74.35 47.38,74.37 44.48,74.39C43.58,74.41 42.67,74.43 41.74,74.45C35.51,74.46 35.51,74.46 32.93,72.14C31.76,69.45 31.6,67.37 31.63,64.44C31.62,63.49 31.61,62.54 31.6,61.56C32.07,58.55 32.64,57.85 35,56C36.96,55.64 36.96,55.64 39.2,55.66C40.46,55.66 40.46,55.66 41.74,55.66C42.65,55.68 43.55,55.69 44.48,55.71C45.41,55.71 46.34,55.72 47.29,55.72C50.26,55.74 53.22,55.77 56.19,55.81C58.2,55.83 60.21,55.84 62.22,55.85C67.14,55.89 72.07,55.94 77,56C76.99,55 76.98,54 76.96,52.97C76.96,51.68 76.95,50.39 76.94,49.06C76.93,47.77 76.91,46.49 76.9,45.16C77,42 77,42 78,41Z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/success_dark_green"/> <!-- Change this to a darker color or any other effect you want for pressed state -->
<corners android:radius="20dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/success_green"/>
<corners android:radius="20dp"/>
</shape>
</item>
</selector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="500dp"
android:height="500dp"
android:viewportWidth="500"
android:viewportHeight="500">
<path
android:pathData="M236,41.6c-48.7,4.6 -91,23.8 -123.5,55.9 -21.1,20.9 -35.6,42.7 -45.6,68.4 -3.4,8.8 -3.9,9.6 -6.5,9.9 -10.1,0.9 -16.8,2.7 -25.3,6.8 -12.7,6.2 -21.9,15.2 -27.8,27.4 -5.5,11.2 -6.6,17.1 -6.1,31 0.3,8.5 1,13.1 2.6,17.4 8.4,23.1 28.7,39 52.7,41.4l6.7,0.7 3.7,9.5c8,20.3 18.4,37.6 33.4,55.6 21.5,25.6 52.6,46.9 84.9,58.2 10.2,3.6 10.9,4 13.8,8.4 7,10.5 20.8,20.3 34.5,24.4 8.2,2.5 24.8,2.5 33,-0 13.8,-4.1 27.7,-14 34.4,-24.4 2.9,-4.5 3.5,-4.9 13.1,-8.1 53.8,-18.2 98.2,-60.8 119.1,-114.1l3.7,-9.5 6.7,-0.7c15.5,-1.5 30.3,-9.1 40.4,-20.6 5.7,-6.4 12.3,-19 14.2,-27.2 1.7,-7.1 1.7,-20.9 0,-28 -0.7,-3 -3.1,-9.3 -5.4,-14 -9.5,-19.6 -28.7,-32 -53.1,-34.2 -2.6,-0.3 -3.1,-1.1 -6.5,-9.8 -23,-58.9 -72.9,-102.8 -134.6,-118.5 -7.1,-1.8 -15.2,-3.6 -18,-3.9l-5,-0.7 -19.5,30.2c-10.7,16.6 -20.7,32.3 -22.3,34.9 -7.4,12.9 -0.1,27 14,27 7,-0 10,-2.4 21.7,-16.9 10.7,-13.4 14,-15.7 20.8,-14.8 10.3,1.4 16,12.9 10.7,21.6 -5.2,8.5 -22,28 -27.1,31.4 -23.7,15.7 -55.4,7.5 -67.8,-17.6 -6.3,-12.9 -6.4,-28.7 -0.2,-40.6 1.6,-3.1 10.1,-16.7 18.7,-30.1 16.2,-25.1 17.3,-27.1 15.9,-26.8 -0.5,-0 -2.5,0.3 -4.4,0.4zM195.5,193.6c7.7,1.9 13.4,5.3 19.1,11.2 9.3,9.7 14,25.8 9.5,33 -3.3,5.2 -7.7,7.4 -13.9,6.9 -6.9,-0.5 -11.5,-4.7 -13.2,-11.9 -1.7,-6.7 -5.8,-10.8 -11.1,-10.8 -7.7,-0 -11.1,3.3 -12.8,12.2 -1.1,6.5 -3.5,9.6 -8.8,12 -5.1,2.2 -8.9,1.9 -13.9,-1.1 -7.3,-4.4 -8.3,-16.3 -2.5,-28.7 8.6,-18.4 28.4,-27.9 47.6,-22.8zM323.2,193.1c17,3.6 30.9,19 32.5,36.1 0.7,7.7 -1.3,13 -6.1,15.9 -5,3 -8.8,3.3 -14,1.1 -5.4,-2.4 -8.1,-6.4 -9,-13.2 -0.9,-7.1 -5,-11 -11.6,-11 -4,-0 -5.3,0.5 -7.8,3 -1.8,1.8 -3.4,4.9 -4.2,7.8 -1.7,7.2 -6.3,11.4 -13.2,11.9 -6.2,0.5 -10.6,-1.7 -13.9,-6.9 -4.5,-7.1 0.2,-23.3 9.4,-32.9 10.2,-10.6 23.7,-14.8 37.9,-11.8zM195,282.7c1.4,1 5,3.7 8,6.2 6.4,5.2 18.9,11.4 28,13.8 8.9,2.4 29.1,2.4 38,-0 9.1,-2.4 21.6,-8.6 28,-13.8 9,-7.3 10.1,-7.9 15.1,-7.9 6.2,-0 10.8,3.2 13.2,9.1 3.5,8.4 0.1,14.5 -13.8,24.4 -21.7,15.6 -52,22.7 -78.3,18.5 -25.2,-4.1 -55.9,-21.9 -59.3,-34.2 -1.5,-5.6 1.1,-12.2 6,-15.5 4.2,-2.8 11.5,-3.1 15.1,-0.6z"
android:fillColor="#000000"
android:strokeColor="#00000000"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp">
<path android:fillColor="@android:color/white" android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
<path android:fillColor="@android:color/white" android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp">
<path android:fillColor="@android:color/white" android:pathData="M20,9V7c0,-1.1 -0.9,-2 -2,-2h-3c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5H6C4.9,5 4,5.9 4,7v2c-1.66,0 -3,1.34 -3,3c0,1.66 1.34,3 3,3v4c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-4c1.66,0 3,-1.34 3,-3C23,10.34 21.66,9 20,9zM7.5,11.5C7.5,10.67 8.17,10 9,10s1.5,0.67 1.5,1.5S9.83,13 9,13S7.5,12.33 7.5,11.5zM16,17H8v-2h8V17zM15,13c-0.83,0 -1.5,-0.67 -1.5,-1.5S14.17,10 15,10s1.5,0.67 1.5,1.5S15.83,13 15,13z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp">
<path android:fillColor="@android:color/white" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp">
<path android:fillColor="@android:color/white" android:pathData="M7.58,4.08L6.15,2.65C3.75,4.48 2.17,7.3 2.03,10.5h2c0.15,-2.65 1.51,-4.97 3.55,-6.42zM19.97,10.5h2c-0.15,-3.2 -1.73,-6.02 -4.12,-7.85l-1.42,1.43c2.02,1.45 3.39,3.77 3.54,6.42zM18,11c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2v-5zM12,22c0.14,0 0.27,-0.01 0.4,-0.04 0.65,-0.14 1.18,-0.58 1.44,-1.18 0.1,-0.24 0.15,-0.5 0.15,-0.78h-4c0.01,1.1 0.9,2 2.01,2z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp">
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="360dp"
android:height="361dp"
android:viewportWidth="360"
android:viewportHeight="361">
<path
android:pathData="M154.5,2c-21,2 -55.2,15.1 -75.2,28.7 -17,11.5 -37.9,32.5 -49.5,49.8 -11.3,16.9 -22.1,42.7 -26.7,63.8 -2.4,10.9 -3.4,40.2 -2.1,57.7 2.2,29 16.6,63.8 37.4,90.5 8.5,10.8 26,27.5 37.6,35.8 17.1,12.1 46.2,24.8 68.5,29.9 4.3,0.9 14.5,1.3 36,1.3 29.6,-0 30.1,-0 40.1,-2.7 28.9,-7.8 50.2,-18.1 70.9,-34.3 9.2,-7.2 25,-23.2 31.8,-32.2 15.8,-20.7 27.7,-46.8 33.7,-73.8 2,-8.9 2.3,-12.8 2.3,-35 0,-28.8 -0.8,-35 -7.8,-56 -12.5,-38 -35.1,-69.1 -67.1,-92.1 -10.8,-7.8 -35.4,-20.2 -48.4,-24.4 -19.3,-6.3 -24.5,-7.1 -50,-7.5 -12.9,-0.2 -27.1,-0 -31.5,0.5zM192.5,22c30.9,2.3 56.7,12 82.4,30.8 30.4,22.3 54.5,60.4 61.7,97.2 1.4,7.4 1.8,14.2 1.8,31 0,23.9 -1.4,33.4 -7.5,50.6 -3.8,10.7 -13.4,31.4 -14.6,31.4 -0.5,-0 -2.5,-1.6 -4.4,-3.6 -5.4,-5.7 -18.4,-13.8 -34,-21.3 -14.5,-7 -39,-17.1 -41.4,-17.1 -0.7,-0 -4,2.2 -7.2,4.8 -12.6,10.5 -25.1,17.2 -35.7,19.1 -7.5,1.4 -20.6,1.4 -27.7,0.1 -3,-0.6 -9,-2.7 -13.4,-4.9 -7.6,-3.6 -22.4,-13.8 -25.4,-17.4 -0.7,-0.9 -2.2,-1.7 -3.2,-1.7 -3,-0 -31.3,11.6 -44.2,18 -14.3,7.2 -24.2,13.5 -30.8,19.7 -3.3,3.1 -5.3,4.3 -6,3.6 -1.6,-1.6 -11.4,-24.1 -14.3,-33 -4.9,-14.7 -6.7,-25.6 -7.3,-43.8 -0.4,-13 -0.2,-19.7 1.1,-28.2 3.8,-25.8 14.1,-50.5 29.9,-71.9 7.1,-9.6 25.6,-27.7 35.3,-34.7 24.6,-17.4 57.7,-28.8 85.9,-29.6 2.8,-0 11.3,0.4 19,0.9z"
android:fillColor="#ffffff"
android:strokeColor="#ffffff"/>
<path
android:pathData="M164,65.6c-3,0.8 -9.8,3.5 -15,6.1 -25.4,12.5 -42,42.5 -39.6,71.8 1.3,15.2 5.4,28.8 12.8,42.5 14.1,26 33.6,41.1 55.3,42.7 38.4,2.9 78,-51.6 72.5,-99.9 -2.1,-18.4 -9.4,-32.3 -24.2,-46.4 -13.1,-12.4 -28.5,-18.5 -46.7,-18.3 -5.3,-0 -12.1,0.7 -15.1,1.5z"
android:fillColor="#ffffff"
android:strokeColor="#ffffff"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="32dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="32dp">
<path android:fillColor="@android:color/white" android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/dark_purple"/> <!-- Change this to a darker color or any other effect you want for pressed state -->
<corners android:radius="20dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/purple"/>
<corners android:radius="20dp"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/purple"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:bottomLeftRadius="50dp" android:bottomRightRadius="50dp"/>
<stroke android:width="1dp" android:color="@color/purple"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:topLeftRadius="50dp" android:topRightRadius="50dp"/>
<stroke android:width="1dp" android:color="@color/purple"/>
</shape>
\ 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"
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=".activities.DashboardActivity">
<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">
<ImageView
android:id="@+id/forground_img"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@drawable/foreground"
android:contentDescription="foreground-image"
android:layout_centerHorizontal="true"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/forground_img"
android:text="@string/app_name"
android:textAlignment="center"
android:textColor="@color/white"
android:textAllCaps="true"
android:fontFamily="@font/inknut_antiqua_regular"
android:textSize="20sp"/>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/rl_header"
app:layout_constraintBottom_toBottomOf="@id/background"
app:layout_constraintEnd_toEndOf="@id/background"
app:layout_constraintStart_toStartOf="@id/background"
android:scrollbars="none">
<GridLayout
android:id="@+id/gridLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="3"
android:orientation="horizontal"
android:paddingTop="20dp"
android:paddingBottom="20dp"
android:layout_gravity="center_horizontal">
<LinearLayout
android:id="@+id/btn_camera"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_margin="16dp"
android:background="@drawable/positive_btn_background"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ico_camera_alt_32"
app:tint="@color/icon_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/acme_regular"
android:text="Feelings Camera"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_vocal"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_margin="16dp"
android:background="@drawable/positive_btn_background"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ico_volume_up_32"
app:tint="@color/icon_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/acme_regular"
android:text="Feelings Vocal"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_notifications"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_margin="16dp"
android:background="@drawable/positive_btn_background"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ico_notifications_active_32"
app:tint="@color/icon_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/acme_regular"
android:text="Activity Notifications"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_device_controls"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_margin="16dp"
android:background="@drawable/positive_btn_background"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ico_device_controls_32"
app:tint="@color/icon_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/acme_regular"
android:text="Device Controls"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_about_baby"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_margin="16dp"
android:background="@drawable/positive_btn_background"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ico_about_baby_32"
app:tint="@color/icon_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/acme_regular"
android:text="About Baby"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_settings"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_margin="16dp"
android:background="@drawable/positive_btn_background"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ico_settings_32"
app:tint="@color/icon_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:fontFamily="@font/acme_regular"
android:text="Settings"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</GridLayout>
</ScrollView>
</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"
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=".activities.auth.LoginActivity">
<ImageView
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"
android:src="@drawable/background"
android:contentDescription="background-image"
android:scaleType="centerCrop"
android:alpha="0.4" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/l_sv_1"
app:layout_constraintTop_toTopOf="parent"
android:textAlignment="center"
android:text="LOGIN"
android:textColor="@color/purple"
android:fontFamily="@font/poetsen_one_regular"
android:textSize="50sp"/>
<ScrollView
android:id="@+id/l_sv_1"
android:layout_width="match_parent"
android:layout_height="510dp"
android:background="@drawable/sv_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:paddingTop="50dp"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="WELCOME"
android:textColor="@color/purple"
android:fontFamily="@font/otomanopee_one_regular"
android:textSize="20sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Please Login with your information"
android:textColor="@color/black"
android:fontFamily="@font/kanit_regular"
android:textSize="15sp"
android:paddingTop="6dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/l_et_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ico_email_32"
android:inputType="textEmailAddress"
android:autofillHints="Enter Your Email address"
android:hint="Enter Your Email address"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/l_et_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ico_lock_32"
android:inputType="textPassword"
android:autofillHints="Enter Your Password"
android:hint="Enter Your Password"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/l_tv_forgot_password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/forgot_password"
android:fontFamily="@font/jeju_gothic_regular"
android:textSize="14sp"
android:textColor="@color/link_blue"
android:layout_weight="1"
/>
<TextView
android:id="@+id/l_tv_register"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/register"
android:fontFamily="@font/jeju_gothic_regular"
android:textSize="14sp"
android:textColor="@color/link_blue"
android:layout_weight="1"
android:textAlignment="viewEnd"/>
</LinearLayout>
<Button
android:id="@+id/l_btn_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="LOGIN"
android:textSize="20sp"
android:fontFamily="@font/abril_fatface_regular"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginTop="28dp"
android:background="@drawable/positive_btn_background"
android:padding="6dp"
android:textColor="@color/white"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="Or Login With"
android:fontFamily="@font/jeju_gothic_regular"
android:textColor="@color/black"
android:textSize="14sp"
android:layout_marginTop="5dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3"
android:layout_marginTop="8dp"
android:layout_gravity="center"
android:layout_marginBottom="80dp">
<ImageButton
android:layout_width="58dp"
android:layout_height="58dp"
android:src="@drawable/google_ico"
android:scaleType="centerCrop"
android:background="@color/transparent"
android:contentDescription="google button"
android:padding="4dp"/>
<ImageButton
android:layout_width="58dp"
android:layout_height="58dp"
android:src="@drawable/twitter_ico"
android:scaleType="centerCrop"
android:background="@color/transparent"
android:contentDescription="twitter button"
android:padding="4dp"/>
<ImageButton
android:layout_width="58dp"
android:layout_height="58dp"
android:src="@drawable/facebook_ico"
android:scaleType="centerCrop"
android:background="@color/transparent"
android:contentDescription="facebook button"
android:padding="4dp"/>
</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>
\ No newline at end of file
...@@ -7,5 +7,72 @@ ...@@ -7,5 +7,72 @@
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:context=".MainActivity"> tools:context=".MainActivity">
<ImageView
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"
android:src="@drawable/background"
android:contentDescription="background-image"
android:scaleType="centerCrop"
/>
<View
android:layout_width="650dp"
android:layout_height="500dp"
android:background="@drawable/purple_oval"
android:rotationY="-12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/m_tv_welcome"/>
<ImageView
android:id="@+id/forground_img"
android:layout_width="255dp"
android:layout_height="256dp"
android:src="@drawable/foreground"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/m_tv_welcome"
android:contentDescription="foreground-image" />
<TextView
android:id="@+id/m_tv_welcome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/forground_img"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/m_btn_get_started"
android:text="welcome to\nchildy"
android:textSize="50sp"
android:fontFamily="@font/poetsen_one_regular"
android:textColor="@color/white"
android:textAlignment="center"
android:layout_marginTop="60dp"/>
<Button
android:id="@+id/m_btn_get_started"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="45dp"
android:layout_marginEnd="45dp"
android:layout_marginBottom="100dp"
android:backgroundTint="@color/white"
android:fontFamily="@font/abril_fatface_regular"
android:text="Get started"
android:textColor="@color/black"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
android:drawableLeft="@drawable/get_started_ico"
android:background="@drawable/positive_btn_background"
android:padding="6dp"/>
</androidx.constraintlayout.widget.ConstraintLayout> </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"
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=".activities.auth.RegisterActivity">
<ImageView
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"
android:src="@drawable/background"
android:contentDescription="background-image"
android:scaleType="centerCrop"
android:alpha="0.4" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/r_sv_1"
app:layout_constraintTop_toTopOf="parent"
android:textAlignment="center"
android:text="REGISTER"
android:textColor="@color/purple"
android:fontFamily="@font/poetsen_one_regular"
android:textSize="50sp"/>
<ScrollView
android:id="@+id/r_sv_1"
android:layout_width="match_parent"
android:layout_height="650dp"
android:background="@drawable/sv_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:paddingTop="50dp"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="WELCOME"
android:textColor="@color/purple"
android:fontFamily="@font/otomanopee_one_regular"
android:textSize="20sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Please create a new account"
android:textColor="@color/black"
android:fontFamily="@font/kanit_regular"
android:textSize="15sp"
android:paddingTop="6dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="First Name"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/r_et_first_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:autofillHints="Enter your first name"
android:hint="Enter your first name"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Last Name"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/r_et_last_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:autofillHints="Enter your last name"
android:hint="Enter your last name"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Mobile Number"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/r_et_mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:autofillHints="Enter your mobile number (+94...)"
android:hint="Enter your mobile number (+94...)"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/r_et_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ico_email_32"
android:inputType="textEmailAddress"
android:autofillHints="Enter your email address"
android:hint="Enter your email address"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/r_et_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ico_lock_32"
android:inputType="textPassword"
android:autofillHints="Enter your password"
android:hint="Enter your password"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Confirm Password"
android:textSize="15sp"
android:textColor="@color/black"
android:fontFamily="@font/adamina_regular"/>
<EditText
android:id="@+id/r_et_conf_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ico_lock_32"
android:inputType="textPassword"
android:autofillHints="Confirm your password"
android:hint="Confirm your password"/>
</LinearLayout>
<Button
android:id="@+id/r_btn_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="REGISTER"
android:textSize="20sp"
android:fontFamily="@font/abril_fatface_regular"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginTop="28dp"
android:layout_marginBottom="80dp"
android:background="@drawable/positive_btn_background"
android:padding="6dp"
android:textColor="@color/white"/>
</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
xmlns:app="http://schemas.android.com/apk/res-auto"
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"
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=".activities.UserProfileActivity">
<include layout="@layout/appbar" />
<ImageView
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:alpha="0.4"
android:contentDescription="background-image"
android:scaleType="centerCrop"
android:src="@drawable/background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/b_care_action_bar" />
<RelativeLayout
android:id="@+id/rl_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/transparent"
android:padding="8dp"
app:layout_constraintEnd_toEndOf="@id/background"
app:layout_constraintStart_toStartOf="@id/background"
app:layout_constraintTop_toTopOf="@+id/background">
<ImageView
android:id="@+id/forground_img"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:contentDescription="foreground-image"
android:src="@drawable/icon_alt_user_pic_32" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/sv_background"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:paddingTop="10dp"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="@id/background"
app:layout_constraintEnd_toEndOf="@id/background"
app:layout_constraintStart_toStartOf="@id/background"
app:layout_constraintTop_toBottomOf="@id/rl_header">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="80dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:fontFamily="@font/inknut_antiqua_regular"
android:textSize="20sp"
android:layout_marginTop="6dp"
android:text="Profile Details"
android:textColor="@color/purple"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inknut_antiqua_regular"
android:text="First Name"
android:textColor="@color/black"
android:textSize="15sp" />
<EditText
android:id="@+id/up_et_firstname"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="text"
android:background="@drawable/et_background"
android:padding="8dp"
android:fontFamily="@font/acme_regular"
android:textColor="@color/purple"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inknut_antiqua_regular"
android:text="Last Name"
android:textColor="@color/black"
android:textSize="15sp" />
<EditText
android:id="@+id/up_et_lastname"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="text"
android:background="@drawable/et_background"
android:padding="8dp"
android:fontFamily="@font/acme_regular"
android:textColor="@color/purple"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inknut_antiqua_regular"
android:text="Birthday"
android:textColor="@color/black"
android:textSize="15sp" />
<EditText
android:id="@+id/up_et_dob"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="text"
android:background="@drawable/et_background"
android:padding="8dp"
android:fontFamily="@font/acme_regular"
android:textColor="@color/purple"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inknut_antiqua_regular"
android:text="Type"
android:textColor="@color/black"
android:textSize="15sp" />
<EditText
android:id="@+id/up_et_type"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="text"
android:background="@drawable/et_background"
android:padding="8dp"
android:fontFamily="@font/acme_regular"
android:textColor="@color/purple"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inknut_antiqua_regular"
android:text="Email Address"
android:textColor="@color/black"
android:textSize="15sp" />
<EditText
android:id="@+id/up_et_email"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="textEmailAddress"
android:background="@drawable/et_background"
android:padding="8dp"
android:fontFamily="@font/acme_regular"
android:textColor="@color/purple"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inknut_antiqua_regular"
android:text="Contact Number"
android:textColor="@color/black"
android:textSize="15sp" />
<EditText
android:id="@+id/up_et_mobile"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="text"
android:background="@drawable/et_background"
android:padding="8dp"
android:fontFamily="@font/acme_regular"
android:textColor="@color/purple"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:orientation="horizontal">
<Button
android:id="@+id/l_btn_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:layout_weight="1"
android:background="@drawable/cancel_btn_background"
android:fontFamily="@font/abril_fatface_regular"
android:text="Cancel"
android:textColor="@color/white"
android:textSize="20sp"
android:textAllCaps="false"
style="?android:attr/buttonBarButtonStyle"
android:visibility="gone"/>
<Button
android:id="@+id/l_btn_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/positive_btn_background"
android:fontFamily="@font/abril_fatface_regular"
android:text="@string/edit_btn_value"
android:textColor="@color/white"
android:textSize="20sp"
android:textAllCaps="false"
style="?android:attr/buttonBarButtonStyle" />
</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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:id="@+id/b_care_action_bar"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
</androidx.appcompat.widget.Toolbar>
\ No newline at end of file
<menu xmlns:android="http://schemas.android.com/apk/res/android" <?xml version="1.0" encoding="utf-8"?>
xmlns:app="http://schemas.android.com/apk/res-auto" <menu xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.kaluwa.enterprises.babycare.MainActivity">
<item <item
android:id="@+id/action_settings" android:id="@+id/mm_app_setting"
android:orderInCategory="100" android:title="App Settings" />
android:title="@string/action_settings"
app:showAsAction="never" /> <item
android:id="@+id/mm_device_setting"
android:title="Device Settings" />
<item
android:id="@+id/mm_logout"
android:title="Logout" />
</menu> </menu>
\ No newline at end of file
<menu 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">
<item
android:id="@+id/user"
android:icon="@drawable/ico_user_32"
android:title="User"
app:showAsAction="ifRoom" />
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" /> <background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" /> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" /> <background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" /> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<navigation 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/nav_graph"
app:startDestination="@id/FirstFragment">
<fragment
android:id="@+id/FirstFragment"
android:name="com.kaluwa.enterprises.babycare.FirstFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment" />
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="com.kaluwa.enterprises.babycare.SecondFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
</fragment>
</navigation>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple">#8147A4</color>
<color name="link_blue">#0000EE</color>
<color name="transparent">#00FFFFFF</color>
<color name="icon_color">#585AAA</color>
<color name="cancel_red">#FF0000</color>
<color name="line_outline">#959595</color>
<color name="cancel_dark_red">#CC0000</color>
<color name="success_green">#28A745</color>
<color name="success_dark_green">#218838</color>
</resources>
\ No newline at end of file
...@@ -2,4 +2,14 @@ ...@@ -2,4 +2,14 @@
<resources> <resources>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="purple">#8147A4</color>
<color name="dark_purple">#673983</color>
<color name="link_blue">#0000EE</color>
<color name="transparent">#00FFFFFF</color>
<color name="icon_color">#585AAA</color>
<color name="cancel_red">#FF0000</color>
<color name="line_outline">#959595</color>
<color name="cancel_dark_red">#CC0000</color>
<color name="success_green">#28A745</color>
<color name="success_dark_green">#218838</color>
</resources> </resources>
\ No newline at end of file
<resources> <resources>
<string name="app_name">Baby Care</string> <string name="app_name">Childy</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<!-- Strings used for fragments for navigation --> <!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string> <string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string> <string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string> <string name="next">Next</string>
<string name="previous">Previous</string> <string name="previous">Previous</string>
<string name="forgot_password"><u>Forgot Password</u></string>
<string name="lorem_ipsum"> <string name="register"><u>Register</u></string>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in scelerisque sem. Mauris <string name="login"><u>Login</u></string>
volutpat, dolor id interdum ullamcorper, risus dolor egestas lectus, sit amet mattis purus <string name="edit_btn_value">Edit</string>
dui nec risus. Maecenas non sodales nisi, vel dictum dolor. Class aptent taciti sociosqu ad <string name="update_btn_value">Update</string>
litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse blandit eleifend
diam, vel rutrum tellus vulputate quis. Aliquam eget libero aliquet, imperdiet nisl a,
ornare ex. Sed rhoncus est ut libero porta lobortis. Fusce in dictum tellus.\n\n
Suspendisse interdum ornare ante. Aliquam nec cursus lorem. Morbi id magna felis. Vivamus
egestas, est a condimentum egestas, turpis nisl iaculis ipsum, in dictum tellus dolor sed
neque. Morbi tellus erat, dapibus ut sem a, iaculis tincidunt dui. Interdum et malesuada
fames ac ante ipsum primis in faucibus. Curabitur et eros porttitor, ultricies urna vitae,
molestie nibh. Phasellus at commodo eros, non aliquet metus. Sed maximus nisl nec dolor
bibendum, vel congue leo egestas.\n\n
Sed interdum tortor nibh, in sagittis risus mollis quis. Curabitur mi odio, condimentum sit
amet auctor at, mollis non turpis. Nullam pretium libero vestibulum, finibus orci vel,
molestie quam. Fusce blandit tincidunt nulla, quis sollicitudin libero facilisis et. Integer
interdum nunc ligula, et fermentum metus hendrerit id. Vestibulum lectus felis, dictum at
lacinia sit amet, tristique id quam. Cras eu consequat dui. Suspendisse sodales nunc ligula,
in lobortis sem porta sed. Integer id ultrices magna, in luctus elit. Sed a pellentesque
est.\n\n
Aenean nunc velit, lacinia sed dolor sed, ultrices viverra nulla. Etiam a venenatis nibh.
Morbi laoreet, tortor sed facilisis varius, nibh orci rhoncus nulla, id elementum leo dui
non lorem. Nam mollis ipsum quis auctor varius. Quisque elementum eu libero sed commodo. In
eros nisl, imperdiet vel imperdiet et, scelerisque a mauris. Pellentesque varius ex nunc,
quis imperdiet eros placerat ac. Duis finibus orci et est auctor tincidunt. Sed non viverra
ipsum. Nunc quis augue egestas, cursus lorem at, molestie sem. Morbi a consectetur ipsum, a
placerat diam. Etiam vulputate dignissim convallis. Integer faucibus mauris sit amet finibus
convallis.\n\n
Phasellus in aliquet mi. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. In volutpat arcu ut felis sagittis, in finibus massa
gravida. Pellentesque id tellus orci. Integer dictum, lorem sed efficitur ullamcorper,
libero justo consectetur ipsum, in mollis nisl ex sed nisl. Donec maximus ullamcorper
sodales. Praesent bibendum rhoncus tellus nec feugiat. In a ornare nulla. Donec rhoncus
libero vel nunc consequat, quis tincidunt nisl eleifend. Cras bibendum enim a justo luctus
vestibulum. Fusce dictum libero quis erat maximus, vitae volutpat diam dignissim.
</string>
</resources> </resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Base.Theme.BabyCare" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Base.Theme.BabyCare" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your light theme here. --> <!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> --> <item name="colorPrimary">@color/purple</item>
</style> </style>
<style name="Theme.BabyCare" parent="Base.Theme.BabyCare" /> <style name="Theme.BabyCare" parent="Base.Theme.BabyCare" />
......
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">192.168.1.2</domain>
</domain-config>
</network-security-config>
...@@ -6,8 +6,14 @@ espressoCore = "3.5.1" ...@@ -6,8 +6,14 @@ espressoCore = "3.5.1"
appcompat = "1.6.1" appcompat = "1.6.1"
material = "1.12.0" material = "1.12.0"
constraintlayout = "2.1.4" constraintlayout = "2.1.4"
navigationFragment = "2.6.0" navigationFragment = "2.7.7"
navigationUi = "2.6.0" navigationUi = "2.7.7"
activity = "1.9.0"
androidSpinkit = "1.4.0"
projectLombok = "1.18.32"
retrofit2 = "2.9.0"
retrofit2Convertor = "2.9.0"
jacksonDatabind = "2.17.1"
[libraries] [libraries]
junit = { group = "junit", name = "junit", version.ref = "junit" } junit = { group = "junit", name = "junit", version.ref = "junit" }
...@@ -18,6 +24,12 @@ material = { group = "com.google.android.material", name = "material", version.r ...@@ -18,6 +24,12 @@ material = { group = "com.google.android.material", name = "material", version.r
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "navigationFragment" } navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "navigationFragment" }
navigation-ui = { group = "androidx.navigation", name = "navigation-ui", version.ref = "navigationUi" } navigation-ui = { group = "androidx.navigation", name = "navigation-ui", version.ref = "navigationUi" }
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
android-spinkit = { group = "com.github.ybq", name = "Android-SpinKit", version.ref = "androidSpinkit" }
projectlombok = { group = "org.projectlombok", name = "lombok", version.ref = "projectLombok"}
retrofit2 = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit2" }
convertor-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit2Convertor" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jacksonDatabind" }
[plugins] [plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" } androidApplication = { id = "com.android.application", version.ref = "agp" }
......
...@@ -16,6 +16,7 @@ dependencyResolutionManagement { ...@@ -16,6 +16,7 @@ dependencyResolutionManagement {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven(uri("https://jitpack.io"))
} }
} }
......
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