Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EditResto Activity Java Code :
- package com.example.gypsy;
- import static android.content.ContentValues.TAG;
- import android.app.Activity;
- import android.content.Intent;
- import android.content.pm.PackageManager;
- import android.net.Uri;
- import android.os.Bundle;
- import android.provider.MediaStore;
- import android.util.Log;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.ImageView;
- import android.widget.LinearLayout;
- import androidx.activity.result.ActivityResultLauncher;
- import androidx.activity.result.contract.ActivityResultContracts;
- import androidx.annotation.NonNull;
- import androidx.appcompat.app.AppCompatActivity;
- import androidx.core.app.ActivityCompat;
- import androidx.core.content.ContextCompat;
- import androidx.fragment.app.FragmentManager;
- import androidx.fragment.app.FragmentTransaction;
- import androidx.viewpager2.widget.ViewPager2;
- import com.google.android.gms.tasks.Task;
- import com.google.android.gms.tasks.Tasks;
- import com.google.android.material.floatingactionbutton.FloatingActionButton;
- import com.google.android.material.textfield.TextInputEditText;
- import com.google.android.material.textfield.TextInputLayout;
- import com.google.firebase.auth.FirebaseAuth;
- import com.google.firebase.auth.FirebaseUser;
- import com.google.firebase.database.DataSnapshot;
- import com.google.firebase.database.DatabaseError;
- import com.google.firebase.database.DatabaseReference;
- import com.google.firebase.database.FirebaseDatabase;
- import com.google.firebase.database.Query;
- import com.google.firebase.database.ValueEventListener;
- import com.google.firebase.storage.FirebaseStorage;
- import com.google.firebase.storage.StorageReference;
- import com.google.firebase.storage.UploadTask;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.concurrent.atomic.AtomicBoolean;
- import java.util.concurrent.atomic.AtomicInteger;
- import android.Manifest;
- import android.content.pm.PackageManager;
- import android.widget.Toast;
- public class EditRestoActivity extends AppCompatActivity {
- private FirebaseStorage storage;
- private StorageReference storageReference;
- private FirebaseDatabase database;
- private DatabaseReference databaseReference;
- private FirebaseAuth auth;
- private FirebaseUser currentUser;
- private List<Uri> imageUris = new ArrayList<>();
- private Uri imageUri;
- private ActivityResultLauncher<Intent> galleryLauncher;
- private FloatingActionButton uploadButton;
- private TextInputEditText restoNameEditText;
- private TextInputEditText restoAddressEditText;
- private TextInputEditText restoDescriptionEditText;
- private TextInputEditText restoContactEditText;
- private TextInputEditText restoEmailEditText;
- private TextInputEditText cancellationPolicyEditText;
- private TextInputEditText amenityEditText;
- private TextInputEditText gcashNumberET;
- private TextInputEditText gcashNameET;
- private Button postButton, cancelButton;
- private String userId;
- private RestoImageSliderAdapter adapter;
- private ViewPager2 viewPager;
- private LinearLayout dotsLayout;
- private ImageView[] dots;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_edit_resto);
- viewPager = findViewById(R.id.viewPager);
- dotsLayout = findViewById(R.id.dotsLayout);
- uploadButton = findViewById(R.id.uploadButton);
- restoNameEditText = findViewById(R.id.restoNameEditText);
- restoAddressEditText = findViewById(R.id.restoAddressEditText);
- restoDescriptionEditText = findViewById(R.id.restoDescriptionEditText);
- restoContactEditText = findViewById(R.id.restoContactEditText);
- restoEmailEditText = findViewById(R.id.restoEmailEditText);
- amenityEditText = findViewById(R.id.amenityEditText);
- cancellationPolicyEditText = findViewById(R.id.cancellationPolicyEditText);
- gcashNumberET = findViewById(R.id.gcashNumber);
- gcashNameET = findViewById(R.id.gcashName);
- postButton = findViewById(R.id.postButton);
- cancelButton = findViewById(R.id.cancelButton);
- TextInputEditText latitudeEditText = findViewById(R.id.latitudeEditText);
- TextInputEditText longitudeEditText = findViewById(R.id.longitudeEditText);
- auth = FirebaseAuth.getInstance();
- currentUser = auth.getCurrentUser();
- userId = currentUser.getUid();
- storage = FirebaseStorage.getInstance();
- storageReference = storage.getReference();
- database = FirebaseDatabase.getInstance();
- databaseReference = database.getReference();
- // adapter para sa multiple images ng resto, slider
- adapter = new RestoImageSliderAdapter(this,imageUris, viewPager,dotsLayout);
- // yung dots nag-iindicate ng pang ilang images na, parang sa ig
- dotsLayout = findViewById(R.id.dotsLayout);
- viewPager.setAdapter(adapter);
- adapter.updateDotsIndicator(0);
- viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
- @Override
- public void onPageSelected(int position) {
- super.onPageSelected(position);
- adapter.updateDotsIndicator(position);
- }
- });
- galleryLauncher = registerForActivityResult(
- new ActivityResultContracts.StartActivityForResult(),
- result -> {
- if (result.getResultCode() == Activity.RESULT_OK) {
- Intent data = result.getData();
- if (data != null && data.getData() != null) {
- imageUri = data.getData();
- imageUris.add(imageUri);
- adapter.notifyDataSetChanged();
- }
- }
- }
- );
- uploadButton.setOnClickListener(v -> openGallery());
- // button "save changes" mapopost na sa tourist interface
- postButton.setOnClickListener(v -> {
- String restoName = restoNameEditText.getText().toString();
- String restoAddress = restoAddressEditText.getText().toString();
- String restoDescription = restoDescriptionEditText.getText().toString();
- String restoContact = restoContactEditText.getText().toString();
- String restoEmail = restoEmailEditText.getText().toString();
- String cancellationPolicy = cancellationPolicyEditText.getText().toString();
- String amenitiesResto = amenityEditText.getText().toString();
- String gcashNumber = gcashNumberET.getText().toString();
- String gcashName = gcashNameET.getText().toString();
- String latitude = latitudeEditText.getText().toString(); // Get latitude
- String longitude = longitudeEditText.getText().toString(); // Get longitude
- checkIfExists(userId, restoName, restoAddress, restoDescription, restoContact, restoEmail,
- cancellationPolicy, imageUri, amenitiesResto, gcashNumber, gcashName, Double.parseDouble(latitude), Double.parseDouble(longitude));
- // back to RestoEditFrag, or yung read-only, na nakaretrieve na
- Intent intent = new Intent(this, MainActivity3.class);
- intent.putExtra("frag", "RestoEditFragment");
- startActivity(intent);
- });
- retrieve(userId);
- cancelButton.setOnClickListener(v -> {
- RestoEditFragment restoEditFragment = new RestoEditFragment();
- FragmentManager fragmentManager = getSupportFragmentManager();
- FragmentTransaction transaction = fragmentManager.beginTransaction();
- transaction.replace(R.id.container, restoEditFragment);
- transaction.addToBackStack(null);
- transaction.commit();
- });
- dots(0); // para lang to sa dots sa image slider
- viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
- @Override
- public void onPageSelected(int position) {
- super.onPageSelected(position);
- dots(position);
- }
- });
- }
- // if nag eexist na yung user sa "hotels", di na pwede mag generate ng new set of data, para iwas doble doeble
- private void checkIfExists(String userId, String restoName, String restoAddress, String restoDescription, String restoContact,
- String restoEmail, String cancellationPolicy, Uri imageUri, String amenitiesResto, String gcashNumber, String gcashName, double latitude, double longitude) {
- DatabaseReference restoRef = databaseReference.child("restaurants");
- Query query = restoRef.orderByChild("user_id").equalTo(userId);
- query.addListenerForSingleValueEvent(new ValueEventListener() {
- @Override
- public void onDataChange(@NonNull com.google.firebase.database.DataSnapshot dataSnapshot) {
- if (dataSnapshot.exists()) {
- String existingRestoId = dataSnapshot.getChildren().iterator().next().getKey();
- // Filter out URLs and keep only local file URIs in imageUris
- List<Uri> localImageUris = new ArrayList<>();
- for (Uri uri : imageUris) {
- if (uri.getScheme() == null) { // Check if it's a local file URI
- localImageUris.add(uri);
- }
- }
- update(restoName, restoAddress, restoDescription, localImageUris, restoContact, restoEmail, cancellationPolicy,
- existingRestoId, amenitiesResto, gcashNumber, gcashName, latitude, longitude);
- adapter.setUris(localImageUris);
- adapter.notifyDataSetChanged();
- Log.d(TAG, "Resto exists for user: " + userId);
- } else {
- create(userId, restoName, restoAddress, restoDescription, restoContact, restoEmail, cancellationPolicy,
- imageUris, amenitiesResto, gcashNumber, gcashName, latitude, longitude);
- adapter.setUris(imageUris);
- adapter.notifyDataSetChanged();
- Log.d(TAG, "Resto does not exist for user: " + userId);
- }
- }
- @Override
- public void onCancelled(@NonNull DatabaseError databaseError) {
- Log.e("check", "error" + databaseError.getMessage());
- }
- });
- }
- private void create(String userId, String restoName, String restoAddress, String restoDescription, String restoContact,
- String restoEmail, String cancellationPolicy, List<Uri> imageUris, String amenitiesResto,
- String gcashNumber, String gcashName, double latitude, double longitude) {
- DatabaseReference restosRef = databaseReference.child("restaurants");
- DatabaseReference restoRef = restosRef.push();
- String restoId = restoRef.getKey();
- List<String> imageUrls = new ArrayList<>();
- AtomicInteger uploadCount = new AtomicInteger(0);
- AtomicBoolean hasUploadFailed = new AtomicBoolean(false);
- List<UploadTask> uploadTasks = new ArrayList<>();
- List<Task<Uri>> uploadUriTasks = new ArrayList<>();
- for (int i = 0; i < imageUris.size(); i++) {
- final int finalIndex = i;
- Uri imageUri = imageUris.get(i);
- StorageReference imageRef = storageReference.child("restaurant_images/" + restoId + "/image" + (i + 1));
- Log.d(TAG, "Image Storage Reference: " + imageRef.toString());
- UploadTask uploadTask = imageRef.putFile(imageUri);
- uploadTask.addOnFailureListener(new MyFailureListener());
- uploadTasks.add(uploadTask);
- Task<Uri> uploadUriTask = uploadTask.continueWithTask(task -> {
- if (!task.isSuccessful()) {
- throw task.getException();
- }
- return imageRef.getDownloadUrl();
- });
- uploadUriTasks.add(uploadUriTask);
- }
- Task<List<Uri>> allUploadsTask = Tasks.whenAllSuccess(uploadUriTasks);
- allUploadsTask.addOnSuccessListener(downloadUris -> {
- for (Uri downloadUri : downloadUris) {
- String imageUrl = downloadUri.toString();
- imageUrls.add(imageUrl);
- }
- if (!hasUploadFailed.get()) {
- save(restoId, imageUrls, restoName, restoAddress, restoDescription, restoContact, restoEmail,
- cancellationPolicy, amenitiesResto, gcashNumber, gcashName, latitude,longitude);
- adapter.setUris(imageUris);
- adapter.notifyDataSetChanged();
- } else {
- Log.e(TAG, "Image upload failed.");
- }
- }).addOnFailureListener(e -> {
- Log.e(TAG, "Failed to upload images: " + e.getMessage());
- hasUploadFailed.set(true);
- for (int j = 0; j < uploadTasks.size(); j++) {
- UploadTask remainingUploadTask = uploadTasks.get(j);
- if (remainingUploadTask != null && !remainingUploadTask.isComplete()) {
- remainingUploadTask.cancel();
- }
- }
- });
- }
- private void update(String restoName, String restoAddress, String restoDescription, List<Uri> localImageUris,
- String restoContact, String restoEmail, String cancellationPolicy, String restoId, String amenitiesResto,
- String gcashNumber, String gcashName, double latitude, double longitude) {
- DatabaseReference restosRef = databaseReference.child("restaurants");
- Query query = restosRef.orderByChild("user_id").equalTo(userId);
- query.addListenerForSingleValueEvent(new ValueEventListener() {
- @Override
- public void onDataChange(@NonNull com.google.firebase.database.DataSnapshot dataSnapshot) {
- if (dataSnapshot.exists()) {
- for (com.google.firebase.database.DataSnapshot childSnapshot : dataSnapshot.getChildren()) {
- String restoId = childSnapshot.getKey();
- DatabaseReference restoRef = restosRef.child(restoId);
- restoRef.child("name").setValue(restoName);
- restoRef.child("address").setValue(restoAddress);
- restoRef.child("description").setValue(restoDescription);
- restoRef.child("contact").setValue(restoContact);
- restoRef.child("email").setValue(restoEmail);
- restoRef.child("cancellationPolicy").setValue(cancellationPolicy);
- restoRef.child("amenities").setValue(amenitiesResto);
- restoRef.child("gcashNumber").setValue(gcashNumber);
- restoRef.child("gcashName").setValue(gcashName);
- restoRef.child("latitude").setValue(latitude);
- restoRef.child("longitude").setValue(longitude);
- List<String> existingImageUrls = new ArrayList<>();
- DataSnapshot imagesSnapshot = childSnapshot.child("images");
- for (DataSnapshot imageSnapshot : imagesSnapshot.getChildren()) {
- String imageUrl = imageSnapshot.getValue(String.class);
- existingImageUrls.add(imageUrl);
- }
- List<String> newImageUrls = new ArrayList<>();
- for (int i = 0; i < localImageUris.size(); i++) {
- Uri imageUri = localImageUris.get(i);
- StorageReference imageRef = storageReference.child("restaurant_images/" + restoId + "/image" + (i + 1));
- // Upload the image and get the download URL
- UploadTask uploadTask = imageRef.putFile(imageUri);
- uploadTask.addOnSuccessListener(taskSnapshot -> {
- // Handle the image upload success and get the download URL
- imageRef.getDownloadUrl().addOnSuccessListener(downloadUri -> {
- String newImageUrl = downloadUri.toString();
- newImageUrls.add(newImageUrl);
- // Check if all new images have been uploaded
- if (newImageUrls.size() == localImageUris.size()) {
- // Update the 'images' node with the new URLs
- Map<String, Object> imagesMap = new HashMap<>();
- for (int j = 0; j < newImageUrls.size(); j++) {
- imagesMap.put("image" + (j + 1), newImageUrls.get(j));
- }
- // Remove extra URLs if any
- for (int k = localImageUris.size() + 1; k <= existingImageUrls.size(); k++) {
- imagesMap.put("image" + k, null);
- }
- // Update the 'images' node with the modified URLs
- restoRef.child("images").updateChildren(imagesMap);
- adapter.setUris(localImageUris);
- adapter.notifyDataSetChanged();
- }
- });
- });
- // Handle the image upload failure
- uploadTask.addOnFailureListener(new MyFailureListener());
- }
- }
- }
- }
- @Override
- public void onCancelled(@NonNull DatabaseError databaseError) {
- Log.e("update", "error" + databaseError.getMessage());
- }
- });
- }
- private void openGallery() {// lalagyan natin to ng permission first
- Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
- galleryLauncher.launch(galleryIntent);
- Log.d(TAG, "opening gallery with URI: " + imageUri);
- }
- // always save changes
- private void save(String restoId, List<String> imageUrls, String restoName, String restoAddress, String restoDescription,
- String restoContact, String restoEmail, String cancellationPolicy, String amenitiesResto,
- String gcashNumber, String gcashName, double latitude, double longitude) {
- DatabaseReference restosRef = databaseReference.child("restaurants");
- DatabaseReference restoRef = restosRef.child(restoId);
- restoRef.child("name").setValue(restoName);
- restoRef.child("address").setValue(restoAddress);
- restoRef.child("description").setValue(restoDescription);
- restoRef.child("contact").setValue(restoContact);
- restoRef.child("email").setValue(restoEmail);
- restoRef.child("cancellationPolicy").setValue(cancellationPolicy);
- restoRef.child("user_id").setValue(userId);
- restoRef.child("amenities").setValue(amenitiesResto);
- restoRef.child("gcashNumber").setValue(gcashNumber);
- restoRef.child("gcashName").setValue(gcashName);
- restoRef.child("latitude").setValue(latitude);
- restoRef.child("longitude").setValue(longitude);
- Map<String, Object> imagesMap = new HashMap<>();
- for (int i = 0; i < imageUrls.size(); i++) {
- imagesMap.put("image" + (i + 1), imageUrls.get(i));
- }
- restoRef.child("images").setValue(imagesMap);
- }
- // then reretrieve natin sa mga edit texts
- private void retrieve(String userId) {
- DatabaseReference restoRef = databaseReference.child("restaurants");
- Query query = restoRef.orderByChild("user_id").equalTo(userId);
- query.addListenerForSingleValueEvent(new ValueEventListener() {
- @Override
- public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
- if (dataSnapshot.exists()) {
- DataSnapshot restoSnapshot = dataSnapshot.getChildren().iterator().next();
- String title = restoSnapshot.child("name").getValue(String.class);
- String restoAddress = restoSnapshot.child("address").getValue(String.class);
- String description = restoSnapshot.child("description").getValue(String.class);
- String restoContact = restoSnapshot.child("contact").getValue(String.class);
- String restoEmail = restoSnapshot.child("email").getValue(String.class);
- String cancellationPolicy = restoSnapshot.child("cancellationPolicy").getValue(String.class);
- String amenitiesResto = restoSnapshot.child("amenities").getValue(String.class);
- String gcashNumber = restoSnapshot.child("gcashNumber").getValue(String.class);
- String gcashName = restoSnapshot.child("gcashName").getValue(String.class);
- Double latitudeDouble = restoSnapshot.child("latitude").getValue(Double.class);
- Double longitudeDouble = restoSnapshot.child("longitude").getValue(Double.class);
- // Check for null before invoking toString()
- String latitude = (latitudeDouble != null) ? latitudeDouble.toString() : "defaultLatitude";
- String longitude = (longitudeDouble != null) ? longitudeDouble.toString() : "defaultLongitude";
- Log.d(TAG, "Retrieved Latitude: " + latitude);
- Log.d(TAG, "Retrieved Longitude: " + longitude);
- List<String> imageUrls = new ArrayList<>();
- DataSnapshot imagesSnapshot = restoSnapshot.child("images");
- for (DataSnapshot imageSnapshot : imagesSnapshot.getChildren()) {
- String imageUrl = imageSnapshot.getValue(String.class);
- imageUrls.add(imageUrl);
- }
- restoNameEditText.setText(title);
- restoDescriptionEditText.setText(description);
- restoAddressEditText.setText(restoAddress);
- restoContactEditText.setText(restoContact);
- restoEmailEditText.setText(restoEmail);
- cancellationPolicyEditText.setText(cancellationPolicy);
- amenityEditText.setText(amenitiesResto);
- gcashNumberET.setText(gcashNumber);
- gcashNameET.setText(gcashName);
- TextInputEditText longitudeEditText = findViewById(R.id.longitudeEditText);
- TextInputEditText latitudeEditText = findViewById(R.id.latitudeEditText);
- longitudeEditText.setText(String.valueOf(latitude));
- latitudeEditText.setText(String.valueOf(longitude));
- imageUris.clear();
- imageUris.clear();
- for (String imageUrl : imageUrls) {
- imageUris.add(Uri.parse(imageUrl));
- }
- adapter.setUris(imageUris);
- adapter.notifyDataSetChanged();
- }
- }
- @Override
- public void onCancelled(@NonNull DatabaseError databaseError) {
- Log.e("retrieve", "error" + databaseError.getMessage());
- }
- });
- }
- private void dots(int position) {// again for dots lang nung image slider
- dots = new ImageView[imageUris.size()];
- dotsLayout.removeAllViews();
- for (int i = 0; i < dots.length; i++) {
- dots[i] = new ImageView(this);
- dots[i].setImageDrawable(ContextCompat.getDrawable(this, R.drawable.dots_unselected));
- LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.WRAP_CONTENT
- );
- params.setMargins(8, 0, 8, 0);
- dotsLayout.addView(dots[i], params);
- }
- if (dots.length > 0) {
- dots[position].setImageDrawable(ContextCompat.getDrawable(this, R.drawable.dots_selected));
- }
- }
- }
- XML :
- <?xml version="1.0" encoding="utf-8"?>
- <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/basecolor2"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:app1="http://schemas.android.com/tools"
- android:fillViewport="true">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/viewPager"
- android:layout_width="match_parent"
- android:layout_height="300dp"
- android:background="@drawable/image_placeholder">
- </androidx.viewpager2.widget.ViewPager2>
- <LinearLayout
- android:id="@+id/dotsLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal"/>
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:baselineAlignBottom="false"
- android:clickable="true"
- app:fabSize="normal"
- android:src="@drawable/add_photo"
- android:id="@+id/uploadButton"
- app:layout_anchor="@id/appbar"
- android:layout_gravity="end"
- android:layout_marginRight="45dp"
- android:backgroundTint="@color/contrastcolor2"/>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/restoNameInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Restaurant Name">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/restoNameEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:inputType="text" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/restoAddressInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Location">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/restoAddressEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:inputType="text" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Latitude">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/latitudeEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="15dp"
- android:textSize="18sp"
- android:inputType="numberDecimal" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Longitude">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/longitudeEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="15dp"
- android:textSize="18sp"
- android:inputType="numberDecimal" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/restoDescriptionInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Description">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/restoDescriptionEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:inputType="textMultiLine" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/restoContactInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Contact Number">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/restoContactEditText"
- android:layout_width="match_parent"
- android:textSize="18sp"
- android:layout_height="wrap_content"
- android:inputType="phone" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/restoEmailInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Email Address">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/restoEmailEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:inputType="textEmailAddress" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/amenityInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Add Amenity">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/amenityEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:inputType="text" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/cancellationPolicyInputLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginVertical="5dp"
- android:hint="Cancellation Policy">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/cancellationPolicyEditText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:inputType="textMultiLine" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="Gcash Number"
- android:layout_marginVertical="5dp"
- app:counterEnabled="true">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/gcashNumber"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:padding="15dp"
- android:inputType="textMultiLine" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="Gcash Name"
- android:layout_marginVertical="5dp"
- app:counterEnabled="true">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/gcashName"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:inputType="textMultiLine"
- android:padding="15dp"
- android:textSize="18sp" />
- </com.google.android.material.textfield.TextInputLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <androidx.appcompat.widget.AppCompatButton
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="50dp"
- android:layout_gravity="start"
- android:gravity="center"
- android:text="Save Changes"
- android:id="@+id/postButton"
- android:textSize="15sp"
- android:padding="7dp"
- android:textColor="@color/white"
- android:layout_marginTop="8dp"
- android:layout_marginRight="10dp"
- android:layout_marginLeft="10dp"
- android:background="@drawable/gradient4" />
- <androidx.appcompat.widget.AppCompatButton
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="50dp"
- android:layout_gravity="start"
- android:gravity="center"
- android:text="Cancel"
- android:id="@+id/cancelButton"
- android:textSize="15sp"
- android:padding="7dp"
- android:textColor="@color/white"
- android:layout_marginTop="8dp"
- android:layout_marginRight="10dp"
- android:layout_marginLeft="10dp"
- android:background="@drawable/gradient4" />
- </LinearLayout>
- </LinearLayout>
- </ScrollView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement