Skip to content

Commit

Permalink
user ui build
Browse files Browse the repository at this point in the history
  • Loading branch information
prathviksankaliya committed Jan 26, 2023
1 parent 55132de commit 91cc0ab
Show file tree
Hide file tree
Showing 22 changed files with 578 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package com.itcraftsolution.raido.Activity;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

import android.os.Bundle;
import android.view.MenuItem;

import com.google.android.material.navigation.NavigationBarView;
import com.itcraftsolution.raido.Fragments.HomeFragment;
import com.itcraftsolution.raido.Fragments.NotificationFragment;
import com.itcraftsolution.raido.Fragments.ProfileFragment;
import com.itcraftsolution.raido.Fragments.UserCarBookFragment;
import com.itcraftsolution.raido.Fragments.UserHomeFragment;
import com.itcraftsolution.raido.Fragments.UserNotificationFragment;
import com.itcraftsolution.raido.Fragments.UserProfileFragment;
import com.itcraftsolution.raido.R;
import com.itcraftsolution.raido.databinding.ActivityUserRideBinding;

import java.util.Objects;

public class UserRideActivity extends AppCompatActivity {

private ActivityUserRideBinding binding;
Expand All @@ -14,6 +28,35 @@ public class UserRideActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityUserRideBinding.inflate(getLayoutInflater());

Objects.requireNonNull(getSupportActionBar()).hide();

getSupportFragmentManager().beginTransaction().replace(R.id.frUserMainContainer, new UserHomeFragment()).addToBackStack(null).commit();
binding.bNavUser.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Fragment temp = null;
switch (item.getItemId()) {
case R.id.userNavHome:
temp = new UserHomeFragment();
break;

case R.id.userNavNotification:
temp = new UserNotificationFragment();
break;

case R.id.userNavAddCar:
temp = new UserCarBookFragment();
break;

case R.id.userNavProfile:
temp = new UserProfileFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.frUserMainContainer, temp).addToBackStack(null).commit();
return true;
}
});
setContentView(binding.getRoot());

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.itcraftsolution.raido.Fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.itcraftsolution.raido.R;
import com.itcraftsolution.raido.databinding.FragmentUserCarBookBinding;

public class UserCarBookFragment extends Fragment {

private FragmentUserCarBookBinding binding;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentUserCarBookBinding.inflate(getLayoutInflater());

return binding.getRoot();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.itcraftsolution.raido.Fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.itcraftsolution.raido.R;
import com.itcraftsolution.raido.databinding.FragmentUserDetailRideBinding;

public class UserDetailRideFragment extends Fragment {

private FragmentUserDetailRideBinding binding;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentUserDetailRideBinding.inflate(getLayoutInflater());

return binding.getRoot();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.itcraftsolution.raido.Fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.itcraftsolution.raido.R;
import com.itcraftsolution.raido.databinding.FragmentUserHomeBinding;

public class UserHomeFragment extends Fragment {

private FragmentUserHomeBinding binding;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentUserHomeBinding.inflate(getLayoutInflater());

binding.btnSearchRide.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getParentFragmentManager().beginTransaction().replace(R.id.frUserMainContainer,
new UserDetailRideFragment()).addToBackStack(null).commit();
}
});
return binding.getRoot();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.itcraftsolution.raido.Fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.itcraftsolution.raido.R;
import com.itcraftsolution.raido.databinding.FragmentUserNotificationBinding;

public class UserNotificationFragment extends Fragment {

private FragmentUserNotificationBinding binding;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentUserNotificationBinding.inflate(getLayoutInflater());

return binding.getRoot();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.itcraftsolution.raido.Fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.itcraftsolution.raido.R;
import com.itcraftsolution.raido.databinding.FragmentUserHomeBinding;
import com.itcraftsolution.raido.databinding.FragmentUserProfileBinding;

public class UserProfileFragment extends Fragment {

private FragmentUserProfileBinding binding;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
binding = FragmentUserProfileBinding.inflate(getLayoutInflater());

return binding.getRoot();
}
}
Binary file added app/src/main/res/drawable/car.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/leftarrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/rightarrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions app/src/main/res/layout/activity_user_ride.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,27 @@
android:layout_height="match_parent"
tools:context=".Activity.UserRideActivity">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/frUserMainContainer"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bNavUser"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5"
tools:layout="@layout/fragment_notification" />

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bNavUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/_22mdp"
app:labelVisibilityMode="unlabeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/user_bottom_nav" />
</androidx.constraintlayout.widget.ConstraintLayout>
3 changes: 3 additions & 0 deletions app/src/main/res/layout/fragment_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="Add"
android:fontFamily="@font/opensansbold"
app:layout_constraintBottom_toBottomOf="@+id/textInputLayout7"
app:layout_constraintEnd_toEndOf="@+id/textInputLayout6"
app:layout_constraintTop_toTopOf="@+id/textInputLayout7" />
Expand All @@ -100,6 +101,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_16mdp"

app:layout_constraintEnd_toEndOf="@+id/btnAdd"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/textInputLayout7"
Expand All @@ -111,6 +113,7 @@
android:layout_height="wrap_content"
android:paddingVertical="@dimen/_9mdp"
android:text="Save"
android:fontFamily="@font/opensansbold"
android:layout_marginTop="@dimen/_20mdp"
app:layout_constraintEnd_toEndOf="@+id/AdminLocationChip"
app:layout_constraintStart_toStartOf="@+id/AdminLocationChip"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Upload"
android:fontFamily="@font/opensansbold"
android:padding="@dimen/_8mdp"
app:layout_constraintBottom_toBottomOf="@+id/textView5"
app:layout_constraintEnd_toEndOf="@+id/textInputLayout4"
Expand All @@ -239,6 +240,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Next"
android:fontFamily="@font/opensansbold"
android:layout_marginTop="@dimen/_20mdp"
android:paddingVertical="@dimen/_9mdp"
app:layout_constraintEnd_toEndOf="@+id/AdminCarImageUpload"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_14mdp"
android:fontFamily="@font/opensansbold"
android:gravity="center"
android:layout_marginStart="@dimen/_12mdp"
android:text="Notifications"
android:textColor="@color/black"
android:textSize="@dimen/_18font_mdp"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="@font/opensansbold"
android:gravity="center"
android:layout_marginStart="@dimen/_12mdp"
android:layout_marginEnd="@dimen/_14mdp"
android:text="Profile Details"
android:textColor="@color/black"
Expand Down Expand Up @@ -155,6 +155,7 @@
android:layout_height="wrap_content"
android:paddingVertical="@dimen/_9mdp"
android:text="Save Profile"
android:fontFamily="@font/opensansbold"
android:layout_marginTop="@dimen/_16mdp"
app:layout_constraintEnd_toEndOf="@+id/textInputLayout8"
app:layout_constraintStart_toStartOf="@+id/textInputLayout8"
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/layout/fragment_user_car_book.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fragments.UserCarBookFragment">

<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="car booked" />

</FrameLayout>
45 changes: 45 additions & 0 deletions app/src/main/res/layout/fragment_user_detail_ride.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fragments.UserDetailRideFragment">

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_14mdp"
android:layout_marginTop="@dimen/_14mdp"
android:padding="@dimen/_4mdp"
android:src="@drawable/baseline_keyboard_backspace_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textView6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_12mdp"
android:layout_marginEnd="@dimen/_14mdp"
android:fontFamily="@font/opensansbold"
android:text="Active Rides"
android:textColor="@color/black"
android:textSize="@dimen/_18font_mdp"
app:layout_constraintBottom_toBottomOf="@+id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toTopOf="@+id/imageView" />

<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_16mdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView6" />


</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit 91cc0ab

Please sign in to comment.