Update driver_trip activity layout

This commit is contained in:
smithjilks
2021-06-26 22:13:18 +03:00
parent 8828613883
commit 09b2b24a4d
35 changed files with 539 additions and 135 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@@ -0,0 +1,98 @@
package com.qualis.qfood.Adapters;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.FirebaseApp;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.qualis.qfood.FoodDetailActivity;
import com.qualis.qfood.Interface.ItemClickListener;
import com.qualis.qfood.MainActivity;
import com.qualis.qfood.Model.Food;
import com.qualis.qfood.R;
import com.qualis.qfood.ViewHolder.FoodViewHolder;
import java.util.List;
public class FoodItemAdapter extends RecyclerView.Adapter {
FirebaseStorage storage;
StorageReference storageReference;
private Context context;
private List<Food> foodListItems;
public FoodItemAdapter(Context context, List<Food> foodListItems) {
this.context = context;
this.foodListItems = foodListItems;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View view = inflater.inflate(R.layout.food_item, parent, false);
return new FoodViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {
final Food foodItem = foodListItems.get(position);
((FoodViewHolder)holder).foodName.setText(foodItem.getFoodName());
((FoodViewHolder)holder).foodServing.setText("Serves: " + foodItem.getServing());
storage = FirebaseStorage.getInstance();
storageReference = storage.getReference("FoodImages/").child(foodItem.getFoodImageId() +".jpg");
storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
String imgURL = uri.toString();
Glide.with(context).load(imgURL).into(((FoodViewHolder)holder).foodImage);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
}
});
((FoodViewHolder)holder).setItemClickListener(new ItemClickListener() {
@Override
public void onClick(View view, int position, boolean isLongClick) {
Intent foodDetail= new Intent(context, FoodDetailActivity.class);
Bundle extras = new Bundle();
extras.putString("FoodId", foodListItems.get(position).getID() + "");
foodDetail.putExtras(extras);
context.startActivity(foodDetail);
}
});
}
@Override
public int getItemCount() {
return foodListItems.size();
}
}
@@ -1,7 +1,9 @@
package com.qualis.qfood.Common;
import com.qualis.qfood.Model.Food;
import com.qualis.qfood.Model.User;
public class Common {
public static User currentUser;
public static Food currentlyActiveFood;
}
@@ -7,7 +7,6 @@ import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
@@ -18,8 +17,6 @@ import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.BitmapDescriptor;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
@@ -38,9 +35,10 @@ public class DirectionsActivity extends AppCompatActivity implements OnMapReadyC
private GoogleMap mMap;
private MarkerOptions angelMarker;
private Polyline currentPolyline;
LatLng angelMarkerPosition =new LatLng(-1.320163, 36.704049);
LatLng angelMarkerPosition = new LatLng(-1.320163, 36.704049);
Location location;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -58,11 +56,14 @@ public class DirectionsActivity extends AppCompatActivity implements OnMapReadyC
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
try {
// Customise the styling of the base map using a JSON object defined
// in a raw resource file.
boolean success = googleMap.setMapStyle(
MapStyleOptions.loadRawResourceStyle(
DirectionsActivity.this, R.raw.style_json));
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
@@ -1,7 +1,9 @@
package com.qualis.qfood;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
@@ -15,10 +17,13 @@ import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.bumptech.glide.Glide;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.storage.FirebaseStorage;
@@ -27,6 +32,7 @@ import com.google.gson.Gson;
import com.qualis.qfood.Adapters.FoodItemAdapter;
import com.qualis.qfood.Model.Food;
import com.qualis.qfood.ViewHolder.FoodViewHolder;
import com.squareup.picasso.Picasso;
import org.json.JSONArray;
import org.json.JSONException;
@@ -45,9 +51,8 @@ import static com.qualis.qfood.Common.Common.currentUser;
public class FoodDetailActivity extends AppCompatActivity {
TextView foodName, foodDietType, foodServing, foodDescription, foodIngredients, foodSpecialNote;
ImageView foodImage;
ImageView food_image;
CollapsingToolbarLayout collapsingToolbarLayout;
FloatingActionButton fabFood;
@@ -67,7 +72,7 @@ public class FoodDetailActivity extends AppCompatActivity {
foodImage = (ImageView)findViewById(R.id.imgFood);
foodName = (TextView)findViewById(R.id.food_name);
foodDietType = (TextView)findViewById(R.id.food_diet_type);
foodServing = (TextView)findViewById(R.id.food_serving);
@@ -115,13 +120,14 @@ public class FoodDetailActivity extends AppCompatActivity {
}
private void getFood(String stringfoodId) {
private void getFood(String stringFoodId) {
RequestQueue requestQueue = Volley.newRequestQueue(this);
String URL = "https://02bce1164642.ngrok.io/food/" + stringfoodId;
String URL = "https://8072162f711f.ngrok.io/food/" + stringFoodId;
JsonObjectRequest jsonObjReq = new JsonObjectRequest(
Request.Method.GET, URL, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
@@ -175,23 +181,40 @@ public class FoodDetailActivity extends AppCompatActivity {
}
private void setFoodDetails(Food currentFood) {
storage = FirebaseStorage.getInstance();
storageReference = storage.getReference("FoodImages").child(currentFood.getFoodImageId() + ".jpg");
collapsingToolbarLayout.setTitle(currentFood.getFoodName());
foodName.setText(currentFood.getFoodName());
foodDietType.setText(currentFood.getDietType());
foodDietType.setText("Diet Type: " + currentFood.getDietType());
foodServing.setText("Serves: " + currentFood.getServing());
foodDescription.setText(currentFood.getDescription());
foodIngredients.setText(currentFood.getSpecialIngredients());
foodIngredients.setText(currentFood.getSpecialIngridients());
foodSpecialNote.setText(currentFood.getSpecialNote());
storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
String foodImgURL = uri.toString();
Glide.with(FoodDetailActivity.this).load(foodImgURL).into(foodImage);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
}
});
}
private void checkActiveFood() throws IOException {
RequestQueue requestQueue = Volley.newRequestQueue(this);
String URL = "https://d464d72f89df.ngrok.io/food";
String URL = "https://8072162f711f.ngrok.io/food";
JsonObjectRequest jsonObjReq = new JsonObjectRequest(
Request.Method.GET, URL, null, new Response.Listener<JSONObject>() {
@@ -273,7 +296,7 @@ public class FoodDetailActivity extends AppCompatActivity {
private void addFood(String stringfoodId) throws JSONException {
final RequestQueue requestQueue = Volley.newRequestQueue(this);
String URL = "https://d464d72f89df.ngrok.io/food/" + stringfoodId;
String URL = "https://8072162f711f.ngrok.io/food/" + stringfoodId;
String updatedAt = new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime());
@@ -0,0 +1,8 @@
package com.qualis.qfood.Interface;
import android.view.View;
public interface ItemClickListener {
void onClick(View view, int position, boolean isLongClick);
}
@@ -122,7 +122,7 @@ public class LogInActivity extends AppCompatActivity {
private void loginRequest(final String uname, final String pwd) throws JSONException {
final RequestQueue requestQueue = Volley.newRequestQueue(this);
String URL = "https://e0d803039b08.ngrok.io/api/user/login";
String URL = "https://2f66858d76cd.ngrok.io/api/user/login";
Map<String, String> dataMap = new HashMap<>();
dataMap.put("email", uname);
@@ -43,6 +43,7 @@ import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MapStyleOptions;
@@ -95,6 +96,7 @@ import java.util.List;
import java.util.Map;
import de.hdodenhof.circleimageview.CircleImageView;
import life.sabujak.roundedbutton.RoundedButton;
import static androidx.constraintlayout.widget.Constraints.TAG;
@@ -104,6 +106,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
CircleImageView imgUserProfile;
TextView txtUserEmail, txtUserName;
RoundedButton btnCancelFood;
FirebaseStorage storage;
StorageReference storageReference;
@@ -133,10 +136,10 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
FusedLocationProviderClient fusedLocationProviderClient;
private MarkerOptions angelMarker;
MarkerOptions angelMarker;
private Polyline currentPolyline;
LatLng angelMarkerPosition, myMarkerPosition;
LatLng foodPosition, myMarkerPosition;
Location userCurrentLocation;
@@ -162,11 +165,13 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
navigationView.setNavigationItemSelectedListener(this);
View headerview = navigationView.getHeaderView(0);
btnCancelFood = (RoundedButton)findViewById(R.id.btnCancelFood);
FirebaseApp.initializeApp(this);
storage = FirebaseStorage.getInstance();
angelMarkerPosition = new LatLng(-1.3204, 36.7041);
Dexter.withActivity(this)
.withPermission(Manifest.permission.ACCESS_FINE_LOCATION)
@@ -262,6 +267,22 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
btnCancelFood.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
canelFoodReservation(Common.currentlyActiveFood);
}
});
}
private void canelFoodReservation(Food currentlyActiveFood) {
RequestQueue cancelFoodRequestQueue = Volley.newRequestQueue(this);
String cancelFoodRequestURL;
}
private void updateUserLocation() {
@@ -295,11 +316,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public void updateMapsUserLocation(final Location userlocation) {
userCurrentLocation = userlocation;
angelMarker = new MarkerOptions()
.position(angelMarkerPosition)
.snippet("Grubbys")
.title("Angel");
mMap.addMarker(angelMarker);
@@ -308,23 +324,21 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
{
myMarkerPosition = new LatLng(userCurrentLocation.getLatitude(), userCurrentLocation.getLongitude());
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myMarkerPosition, 17));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myMarkerPosition, 9));
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(myMarkerPosition) // Sets the center of the map to location user
.zoom(17) // Sets the zoom
.zoom(14) // Sets the zoom
.bearing(0) // Sets the orientation of the camera to north
.tilt(40) // Sets the tilt of the camera to 30 degrees
.build(); // Creates a CameraPosition from the builder
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
new FetchURL(MainActivity.this).execute(createUrl(myMarkerPosition, angelMarker.getPosition(), "driving"), "driving");
Toast.makeText(MainActivity.this,myMarkerPosition.toString(),Toast.LENGTH_LONG).show();
}
MainActivity.this.runOnUiThread(new Runnable() {
@@ -349,7 +363,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private void getFoodData() throws IOException {
RequestQueue requestQueue = Volley.newRequestQueue(this);
String URL = "https://d464d72f89df.ngrok.io/food";
String URL = "https://8072162f711f.ngrok.io/food";
JsonObjectRequest jsonObjReq = new JsonObjectRequest(
Request.Method.GET, URL, null, new Response.Listener<JSONObject>() {
@@ -359,6 +373,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
JSONArray foodListResponse = null;
try {
foodListResponse = response.getJSONArray("data");
} catch (JSONException e) {
e.printStackTrace();
}
@@ -377,22 +392,57 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
String humanID = "" + foodItem.getHumanUserID();
String foodStatus = "" + foodItem.getStatus();
// double withinRadius = getDistanceBetweenUserLocationandFoodLocation();
///check thus code
if (humanID.equalsIgnoreCase(String.valueOf(Common.currentUser.getId())) && (foodStatus.equalsIgnoreCase("active"))) {
foodList.clear();
foodList.add(foodItem);
Float foodLat = Float.valueOf(foodList.get(0).getLocationLat());
Float foodLong = Float.valueOf(foodList.get(0).getLocationLong());
double foodLat = Double.parseDouble(foodItem.getLocationLat());
double foodLong = Double.parseDouble(foodItem.getLocationLong());
double withinRadius = getDistance(foodLat, userCurrentLocation.getLatitude(),
foodLong, userCurrentLocation.getLongitude(),0.0,0.0);
if(withinRadius <= 7000){
if (humanID.equalsIgnoreCase(String.valueOf(Common.currentUser.getId())) && (foodStatus.equalsIgnoreCase("active"))) {
foodList.clear();
foodList.add(foodItem);
btnCancelFood.setVisibility(View.VISIBLE);
foodPosition = new LatLng(foodLat,foodLong);
final LatLng angelMarkerPosition = foodPosition;
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(angelMarkerPosition != null){
angelMarker = new MarkerOptions()
.position(angelMarkerPosition)
.snippet("Grubbys")
.title("Angel")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.food_icon));
mMap.addMarker(angelMarker);
new FetchURL(MainActivity.this).execute(createUrl(myMarkerPosition, angelMarker.getPosition(), "driving"), "driving");
break;
}
}
});
break;
} else {
btnCancelFood.setVisibility(View.INVISIBLE);
foodList.add(foodItem);
}
} else {
foodList.add(foodItem);
}
} catch (JsonParseException e) {
e.printStackTrace();
@@ -530,7 +580,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
if (!success) {
Log.e(TAG, "Style parsing failed.");
}
@@ -561,7 +610,26 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
public static double getDistance(double lat1, double lat2, double lon1,
double lon2, double el1, double el2) {
final int R = 6371; // Radius of the earth
double latDistance = Math.toRadians(lat2 - lat1);
double lonDistance = Math.toRadians(lon2 - lon1);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2))
* Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = R * c * 1000; // convert to meters
double height = el1 - el2;
distance = Math.pow(distance, 2) + Math.pow(height, 2);
return Math.sqrt(distance);
}
@@ -0,0 +1,178 @@
package com.qualis.qfood.Model;
public class Food {
private long ID;
private String foodName;
private String dietType;
private String angelUserID;
private String humanUserID;
private String description;
private String specialIngridients;
private String serving;
private String SpecialNote;
private String foodImageId;
private String locationLat;
private String locationLong;
private String CreatedAt;
private String DeletedAt;
private String UpdatedAt;
private String status;
public Food() {
}
public Food(long ID, String foodName, String dietType, String angelUserID, String humanUserID, String description, String specialIngridients, String serving, String specialNote, String foodImageId, String locationLat, String locationLong, String createdAt, String deletedAt, String updatedAt, String status) {
this.ID = ID;
this.foodName = foodName;
this.dietType = dietType;
this.angelUserID = angelUserID;
this.humanUserID = humanUserID;
this.description = description;
this.specialIngridients = specialIngridients;
this.serving = serving;
this.SpecialNote = specialNote;
this.foodImageId = foodImageId;
this.locationLat = locationLat;
this.locationLong = locationLong;
this.CreatedAt = createdAt;
this.DeletedAt = deletedAt;
this.UpdatedAt = updatedAt;
this.status = status;
}
public long getID() {
return ID;
}
public void setID(long ID) {
this.ID = ID;
}
public String getFoodName() {
return foodName;
}
public void setFoodName(String foodName) {
this.foodName = foodName;
}
public String getDietType() {
return dietType;
}
public void setDietType(String dietType) {
this.dietType = dietType;
}
public String getAngelUserID() {
return angelUserID;
}
public void setAngelUserID(String angelUserID) {
this.angelUserID = angelUserID;
}
public String getHumanUserID() {
return humanUserID;
}
public void setHumanUserID(String humanUserID) {
this.humanUserID = humanUserID;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getSpecialIngridients() {
return specialIngridients;
}
public void setSpecialIngridients(String specialIngridients) {
this.specialIngridients = specialIngridients;
}
public String getServing() {
return serving;
}
public void setServing(String serving) {
this.serving = serving;
}
public String getSpecialNote() {
return SpecialNote;
}
public void setSpecialNote(String specialNote) {
this.SpecialNote = specialNote;
}
public String getFoodImageId() {
return foodImageId;
}
public void setFoodImageId(String foodImageId) {
this.foodImageId = foodImageId;
}
public String getLocationLat() {
return locationLat;
}
public void setLocationLat(String locationLat) {
this.locationLat = locationLat;
}
public String getLocationLong() {
return locationLong;
}
public void setLocationLong(String locationLong) {
this.locationLong = locationLong;
}
public String getCreatedAt() {
return CreatedAt;
}
public void setCreatedAt(String createdAt) {
this.CreatedAt = createdAt;
}
public String getDeletedAt() {
return DeletedAt;
}
public void setDeletedAt(String deletedAt) {
this.DeletedAt = deletedAt;
}
public String getUpdatedAt() {
return UpdatedAt;
}
public void setUpdatedAt(String updatedAt) {
this.UpdatedAt = updatedAt;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
@@ -87,6 +87,7 @@ public class Signup1Activity extends AppCompatActivity {
Toast.makeText(Signup1Activity.this,"Kindly fill all details to proceed",Toast.LENGTH_LONG).show();
}
else{
HashMap<String, String> mapFirstPage = new HashMap<>();
mapFirstPage.put("firstname", firstName);
mapFirstPage.put("lastname", lastName);
@@ -176,6 +176,11 @@ public class Signup2Activity extends AppCompatActivity {
@Override
public void onResponse(JSONObject response) {
Toast.makeText(Signup2Activity.this, response.toString(), Toast.LENGTH_LONG).show();
try {
signUpCheck(response);
} catch (IOException e) {
e.printStackTrace();
}
}
@@ -0,0 +1,42 @@
package com.qualis.qfood.ViewHolder;
import android.view.View;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.qualis.qfood.Interface.ItemClickListener;
import com.qualis.qfood.R;
import de.hdodenhof.circleimageview.CircleImageView;
public class FoodViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public TextView foodName, foodServing;
public CircleImageView foodImage;
private ItemClickListener itemClickListener;
public void setItemClickListener(ItemClickListener itemClickListener) {
this.itemClickListener = itemClickListener;
}
public FoodViewHolder(View itemView) {
super(itemView);
foodName = (TextView) itemView.findViewById(R.id.food_name);
foodServing = (TextView) itemView.findViewById(R.id.food_serving);
foodImage = (CircleImageView) itemView.findViewById(R.id.food_image);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View view) {
itemClickListener.onClick(view,getAdapterPosition(),false);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#020202"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z"/>
</vector>
@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#020202"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M2,17h20v2L2,19zM13.84,7.79c0.1,-0.24 0.16,-0.51 0.16,-0.79 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2c0,0.28 0.06,0.55 0.16,0.79C6.25,8.6 3.27,11.93 3,16h18c-0.27,-4.07 -3.25,-7.4 -7.16,-8.21z"/>
</vector>
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#020202"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M16.01,7L16,3h-2v4h-4V3H8v4h-0.01C7,6.99 6,7.99 6,8.99v5.49L9.5,18v3h5v-3l3.5,-3.51v-5.5c0,-1 -1,-2 -1.99,-1.99z"/>
</vector>
@@ -16,14 +16,14 @@
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_height="250dp"
android:fitsSystemWindows="true"
app:contentScrim="#0e0d0e"
app:expandedTitleTextAppearance="@android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/img_food"
android:id="@+id/imgFood"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
@@ -34,7 +34,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:title="Food Name"
android:title=""
app:layout_collapseMode="parallax"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
@@ -89,7 +89,7 @@
android:id="@+id/food_name"
android:layout_marginTop="8dp"
android:padding="8dp"
android:text="Food Name"
android:text=""
android:textColor="@color/colorPrimaryDark"
android:textSize="20sp"
android:textStyle="bold"
@@ -109,7 +109,7 @@
<TextView
android:id="@+id/food_serving"
android:text="1"
android:text=""
android:textColor="@color/colorPrimary"
android:textSize="18sp"
android:textStyle="bold"
@@ -124,7 +124,7 @@
android:lineSpacingMultiplier="1.5"
android:minLines="4"
android:padding="4dp"
android:text="Description"
android:text=""
android:textSize="14sp"
android:textColor="@android:color/black"
android:layout_width="match_parent"
@@ -154,7 +154,7 @@
android:id="@+id/food_diet_type"
android:layout_marginTop="8dp"
android:padding="8dp"
android:text="Non-Vegan"
android:text=""
android:textColor="@color/colorPrimaryDark"
android:textSize="20sp"
android:textStyle="bold"
@@ -211,7 +211,7 @@
android:lineSpacingMultiplier="1.5"
android:minLines="2"
android:padding="10dp"
android:text="Mushrooms , Soy Sauce"
android:text=""
android:textSize="14sp"
android:textColor="@android:color/black"
android:layout_width="match_parent"
@@ -235,7 +235,7 @@
android:lineSpacingMultiplier="1.5"
android:minLines="2"
android:padding="10dp"
android:text="Extra hot chiilies. Not recommended for people allergic to eggs"
android:text=""
android:textSize="14sp"
android:textColor="@android:color/black"
android:layout_width="match_parent"
+1 -2
View File
@@ -29,8 +29,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_margin="2dp"
android:src="@drawable/angel_icon_bmp"/>
android:layout_margin="2dp"/>
</LinearLayout>
<LinearLayout
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottomSheetContainer"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_margin="2dp"
android:padding="4dp"
android:orientation="vertical"
android:clickable="true"
android:background="@drawable/bottom_sheet_background"
app:behavior_hideable="false"
app:behavior_peekHeight="90dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<life.sabujak.roundedbutton.RoundedButton
android:id="@+id/btnCancelFood"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="5dp"
android:layout_gravity="end"
android:text="Cancel"
android:visibility="invisible"
android:textColor="@android:color/white"
android:textSize="13sp"
app:buttonColor="@color/colorStartButton"
app:buttonCornerRadius="15dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_food_items"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_angel_marker_background"/>
<foreground android:drawable="@mipmap/ic_angel_marker_foreground"/>
</adaptive-icon>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_angel_marker_background"/>
<foreground android:drawable="@mipmap/ic_angel_marker_foreground"/>
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

+8
View File
@@ -0,0 +1,8 @@
<resources>
<dimen name="fab_margin">16dp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
</resources>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="Q_images" path="/" />
</paths>