This commit is contained in:
2023-07-26 20:49:03 +05:30
parent 8afbae1c29
commit c824482282
15 changed files with 513 additions and 15 deletions

View File

@@ -88,6 +88,8 @@ dependencies {
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.32'
implementation 'com.yarolegovich:sliding-root-nav:1.1.1'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

View File

@@ -5,15 +5,15 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:requestLegacyExternalStorage="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.SimpliTend"
@@ -22,11 +22,21 @@
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".caregiverdashboard.CaregiverDashActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".careperson_dashboard.DashBoardActivityCP"
android:exported="true"
@@ -35,6 +45,7 @@
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".welcome.activities.WelcomeActivity"
@@ -42,11 +53,6 @@
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.lib_name"
@@ -62,7 +68,6 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>

View File

@@ -0,0 +1,77 @@
package com.ssb.simplitend.caregiverdashboard;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.lifecycle.ViewModelProvider;
import android.animation.ObjectAnimator;
import android.os.Bundle;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.Toast;
import com.ssb.simplitend.R;
import com.ssb.simplitend.caregiverdashboard.mvvm.CaregiverMainViewModel;
import com.ssb.simplitend.databinding.CaregiverDashboardBinding;
import com.yarolegovich.slidingrootnav.SlidingRootNav;
import com.yarolegovich.slidingrootnav.SlidingRootNavBuilder;
import com.yarolegovich.slidingrootnav.callback.DragStateListener;
import com.yarolegovich.slidingrootnav.util.DrawerListenerAdapter;
public class CaregiverDashActivity extends AppCompatActivity implements
DragStateListener{
// view binding
protected CaregiverDashboardBinding binding;
protected CaregiverMainViewModel viewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = CaregiverDashboardBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
binding.btn.setOnClickListener(view -> {
ObjectAnimator objAnim = ObjectAnimator.ofFloat(view, "translationX", -100f);
objAnim.setDuration(100);
objAnim.start();
});
initViews();
}
private void initViews() {
// viewmodel
viewModel = new ViewModelProvider(this).get(CaregiverMainViewModel.class);
// sliding navigation bar
viewModel.slidingRootNav = null;
viewModel.slidingRootNav = new SlidingRootNavBuilder(this)
.withMenuLayout(R.layout.caregiver_dashboard_menu)
.addDragStateListener(this)
.withToolbarMenuToggle(binding.toolbar)
.inject();
}
// slide bar drag callbacks
@Override
public void onDragStart() {
binding.getRoot().setRadius(30);
}
@Override
public void onDragEnd(boolean isMenuOpened) {
if (isMenuOpened){
binding.getRoot().setRadius(30);
}else{
binding.getRoot().setRadius(0);
}
}
}

View File

@@ -0,0 +1,13 @@
package com.ssb.simplitend.caregiverdashboard.mvvm;
import androidx.lifecycle.ViewModel;
import com.yarolegovich.slidingrootnav.SlidingRootNav;
public class CaregiverMainViewModel extends ViewModel {
public SlidingRootNav slidingRootNav;
public CaregiverMainViewModel(){}
}

View File

@@ -11,21 +11,21 @@ import androidx.fragment.app.Fragment;
import androidx.navigation.Navigation;
import com.ssb.simplitend.R;
import com.ssb.simplitend.databinding.CaregiverDashboardFragmentBinding;
import com.ssb.simplitend.databinding.PatientDashboardFragmentBinding;
public class CPDashboardFragment extends Fragment {
public class PatientDashboardFragment extends Fragment {
// view binding
protected CaregiverDashboardFragmentBinding binding;
protected PatientDashboardFragmentBinding binding;
public CPDashboardFragment() {
public PatientDashboardFragment() {
// required
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = CaregiverDashboardFragmentBinding.inflate(inflater, container, false);
binding = PatientDashboardFragmentBinding.inflate(inflater, container, false);
clickEvents();

View File

@@ -0,0 +1,36 @@
package com.ssb.simplitend.customsviews;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.ssb.simplitend.R;
public class HomeBottomNav extends FrameLayout {
// constructors
public HomeBottomNav(@NonNull Context context) {
super(context);
initViews();
}
public HomeBottomNav(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initViews();
}
public HomeBottomNav(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initViews();
}
private void initViews(){
View view = inflate(getContext(), R.layout.home_bottom_nav, this);
}
}

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="390dp"
android:height="236dp"
android:viewportWidth="390"
android:viewportHeight="236">
<path
android:pathData="M0,0H390a0,0 0,0 1,0 0V216a20,20 0,0 1,-20 20H20A20,20 0,0 1,0 216V0A0,0 0,0 1,0 0Z"
android:fillColor="@color/color_accent"/>
</vector>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#C0C0C0"
android:endColor="@android:color/transparent"
android:centerColor="@android:color/transparent"
android:angle="90"
/>
</shape>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:clickable="false"
android:focusable="false"
android:weightSum="10"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:src="@drawable/ic_cg_dash_bg"
android:scaleType="fitXY"
/>
</LinearLayout>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:layout_marginTop="15dp"
/>
<com.ssb.simplitend.customsviews.HomeBottomNav
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
/>
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Animate"
android:layout_centerInParent="true"
/>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_primary"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aditya"
android:textSize="@dimen/_18ssp"
android:textColor="@color/white"
android:textStyle="bold"
android:layout_marginStart="15dp"
android:layout_centerVertical="true"
/>
</RelativeLayout>

View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/_92sdp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@android:color/transparent">
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_above="@id/ll"
android:background="@drawable/shadow_up"/>
<com.google.android.material.card.MaterialCardView
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="0dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/_60sdp"
android:weightSum="3"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
>
<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/ic_user_outline"
android:contentDescription="@string/my_patient"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_patient"
android:fontFamily="@font/nunito_regular"
android:textColor="@color/black"
android:textSize="@dimen/_11ssp"
android:layout_marginTop="5sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
>
<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:visibility="gone"
android:src="@drawable/ic_user_outline"
android:contentDescription="@string/my_patient"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_patient"
android:fontFamily="@font/nunito_regular"
android:textColor="@color/black"
android:textSize="@dimen/_11ssp"
android:layout_marginTop="5sp"
android:visibility="gone"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center"
>
<ImageView
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:src="@drawable/ic_user_outline"
android:contentDescription="@string/my_patient"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_patient"
android:fontFamily="@font/nunito_regular"
android:textColor="@color/black"
android:textSize="@dimen/_11ssp"
android:layout_marginTop="5sp"
/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<LinearLayout
android:id="@+id/ll2"
android:layout_width="match_parent"
android:layout_height="@dimen/_60sdp"
android:orientation="horizontal"
android:layout_alignParentTop="true"
android:layout_marginBottom="@dimen/_30sdp"
android:background="@android:color/transparent"
android:translationZ="1dp"
android:weightSum="3">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:visibility="gone"
android:layout_centerInParent="true"
app:cardBackgroundColor="@color/color_primary"
app:cardCornerRadius="@dimen/_25sdp"
app:cardElevation="15dp"
>
<ImageView
android:layout_width="@dimen/_30sdp"
android:layout_height="@dimen/_30sdp"
android:layout_margin="15dp"
android:src="@drawable/ic_user_outline"
app:tint="@color/white"
/>
</com.google.android.material.card.MaterialCardView>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_marginVertical="5dp"
android:visibility="visible"
app:cardBackgroundColor="@color/color_primary"
app:cardCornerRadius="@dimen/_35sdp"
app:cardElevation="5dp">
<ImageView
android:layout_width="@dimen/_30sdp"
android:layout_height="@dimen/_30sdp"
android:layout_gravity="center"
android:layout_margin="15dp"
android:src="@drawable/ic_user_outline"
app:tint="@color/white"
/>
</com.google.android.material.card.MaterialCardView>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_centerInParent="true"
app:cardBackgroundColor="@color/color_primary"
app:cardCornerRadius="@dimen/_25sdp"
app:cardElevation="15dp"
>
<ImageView
android:layout_width="@dimen/_30sdp"
android:layout_height="@dimen/_30sdp"
android:layout_margin="15dp"
android:src="@drawable/ic_user_outline"
app:tint="@color/white"
/>
</com.google.android.material.card.MaterialCardView>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@@ -6,7 +6,7 @@
<fragment
android:id="@+id/CPDashboardFragment"
android:name="com.ssb.simplitend.careperson_dashboard.fragments.CPDashboardFragment"
android:name="com.ssb.simplitend.careperson_dashboard.fragments.PatientDashboardFragment"
android:label="CPDashboardFragment" >
<action
android:id="@+id/action_CPDashboardFragment_to_chatListFragment"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="drawer_drag_margin">16dp</dimen>
</resources>

View File

@@ -235,5 +235,6 @@
<string name="something_went_wrong">Something went wrong</string>
<string name="at">at</string>
<string name="caring_for_loved_one">Caring for a loved one may be\noverwhelming....\nLet our app assist you!</string>
<string name="my_patient">My Patient</string>
</resources>