Vendor Login and Terms Overview
Vendor Login and Terms Overview
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
tvTc=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
startActivity(new Intent([Link],t_and_c.class));
}
});
b1=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),[Link]));
}
});
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate([Link],menu);
return [Link](menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch ([Link]())
{
case [Link]:
startActivity(new Intent([Link],[Link]));
break;
case [Link]:
startActivity(new Intent([Link],[Link]));
break;
}
return [Link](item);
}
}
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="59dp"
android:background="@drawable/button_style"
android:text="Are you a Vendor ?"
android:textColor="#fff"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.833" />
<TextView
android:id="@+id/textViewTandC"
android:layout_width="290dp"
android:layout_height="58dp"
android:gravity="center"
android:text="By Proceeding you agree with the Terms and conditions"
android:textColor="#4703C6"
android:textSize="15dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.937"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.976" />
<TextView
android:id="@+id/textView14"
android:layout_width="301dp"
android:layout_height="104dp"
android:gravity="center"
android:text="BookWorm"
android:textColor="#fff"
android:textSize="40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.67" />
</[Link]>
SELLER LOGIN
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
//import [Link];
//import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText edmail;
ProgressDialog pdg;
TextInputEditText edpass;
TextView Forgot;
TextView textforgot;
Button loginVendor;
@Override
edmail=findViewById([Link]);
edpass=findViewById([Link]);
textforgot=findViewById([Link]);
Forgot=findViewById([Link]);
loginVendor=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
[Link]([Link], "Sucess", Toast.LENGTH_LONG).show();
startActivity(new Intent(getApplicationContext(),[Link]));
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
String mail=[Link]().toString();
String pass=[Link]().toString();
startActivity(it);
[Link]("");
[Link]("");
}
else{
[Link]([Link], "No user found ", Toast.LENGTH_SHORT).show();
}
}
}).addOnSuccessListener(new OnSuccessListener<AuthResult>() {
@Override
public void onSuccess(AuthResult authResult) {
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
[Link]([Link], [Link](), Toast.LENGTH_SHORT).show();
}
});
}
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
startActivity(new Intent([Link],[Link]));
}
});
}
}
<[Link]
android:layout_width="396dp"
android:layout_height="232dp"
app:cardBackgroundColor="#F8F5F5"
app:cardCornerRadius="20dp"
app:cardElevation="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<EditText
android:id="@+id/editTextmail"
android:layout_width="match_parent"
android:layout_height="78dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:drawableLeft="@drawable/ic_baseline_email_24"
android:ems="10"
android:hint=" Email"
android:inputType="textPersonName"
android:maxLength="20"
android:minHeight="48dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.223" />
<[Link]
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="122dp"
android:layout_marginTop="100dp"
app:boxBackgroundColor="@color/purple_500"
app:boxBackgroundMode="outline"
app:counterEnabled="true"
app:counterMaxLength="8"
app:endIconMode="password_toggle"
app:helperText="Required"
app:helperTextEnabled="true"
app:helperTextTextColor="#E10909"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.392"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.374">
<[Link]
android:id="@+id/editTextInputLayout"
android:layout_width="match_parent"
android:layout_height="70dp"
android:drawableLeft="@drawable/ic_baseline_lock_24"
android:hint="Enter a password"
android:inputType="textPassword" />
</[Link]>
</[Link]>
<!-- </[Link]>-->
<Button
android:id="@+id/buttonlogin"
android:layout_width="287dp"
android:layout_height="41dp"
android:background="@drawable/button_style"
android:text="Login"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.863" />
<TextView
android:id="@+id/textView2"
android:layout_width="345dp"
android:layout_height="56dp"
android:gravity="center"
android:text="LOGIN"
android:textSize="30dp"
android:textColor="#fff"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.066" />
<TextView
android:id="@+id/forgotpassword"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginBottom="4dp"
android:gravity="center"
android:textStyle="bold"
android:maxLength="10"
android:text="Sign Up"
android:textColor="#FFFFFF"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/textViewForgot"
android:layout_width="171dp"
android:layout_height="31dp"
android:gravity="right"
android:text="Forgot Password ?"
android:textColor="#E4172FF6"
android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.933"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.744" />
</[Link]>
Forgot Password
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText mailf;
EditText num_fetch;
Button fetchPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_forgotpassword);
mailf=findViewById([Link]);
fetchPassword=findViewById([Link]);
num_fetch=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
// [Link]([Link], "success", Toast.LENGTH_SHORT).show();
DatabaseReference ref=[Link]().getReference("Vendor1");
[Link](num_fetch.getText().toString()).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
String mail=[Link]("email").getValue().toString();
if([Link]([Link]().toString())) {
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
});
<EditText
android:id="@+id/editTextQuestion1Security"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:background="@drawable/edittextsyle"
android:inputType="textPersonName"
android:minHeight="48dp"
android:hint="Where did your parents meet ?"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.177" />
<EditText
android:id="@+id/editTextQuestion3Security"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittextsyle"
android:inputType="textPersonName"
android:minHeight="48dp"
android:hint="Which is your favorite form of exercise ?"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/buttonQuestionCheck"
android:layout_width="262dp"
android:layout_height="61dp"
android:background="@drawable/button_style"
android:text="Verify"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.436"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.786" />
<EditText
android:id="@+id/editTextQuestion2Security"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittextsyle"
android:ems="10"
android:hint="What was your secreet food ?"
android:inputType="textPersonName"
android:minHeight="48dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.388"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.313" />
<TextView
android:id="@+id/textViewDetails"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Your Password will be visible here"
android:gravity="center"
android:textSize="20dp"
android:textColor="#fff"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.602" />
<Button
android:id="@+id/buttonChange"
android:layout_width="327dp"
android:layout_height="60dp"
android:background="@drawable/button_style"
android:text="Change password"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonQuestionCheck" />
</[Link]>
Change Password / Verify
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
//import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_password_question);
Intent it=getIntent();
String number=[Link]("phno");
// [Link](this, "login sucessfull", Toast.LENGTH_SHORT).show();
DatabaseReference dbr=[Link]().getReference();
verify=findViewById([Link]);
edques1=findViewById([Link].editTextQuestion1Security);
edques2=findViewById([Link].editTextQuestion2Security);
edques3=findViewById([Link].editTextQuestion3Security);
Detail=findViewById([Link]);
ChangePassword=(Button) findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
progressDialog=new ProgressDialog([Link]());
[Link]("Fetching password");
[Link]("Fetching password please wait");
[Link](false);
[Link]();
String ques1F=[Link]().toString().trim();
String ques2F=[Link]().toString();
String ques3F=[Link]().toString();
[Link]([Link], number, Toast.LENGTH_SHORT).show();
DatabaseReference
reference=[Link]().getReference("Vendor1").child(number);
[Link](new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if([Link]()) {
String ques1V = [Link]("ques1").getValue([Link]).trim();
String ques2V=[Link]("ques2").getValue([Link]).trim();
String ques3V=[Link]("ques3").getValue([Link]).trim();
if([Link](ques1V) && [Link](ques2V) &&[Link](ques3V))
{
// [Link]([Link], "success",
Toast.LENGTH_SHORT).show();
[Link]();
String pwd=[Link]("password").getValue([Link]);
[Link](pwd);
}
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
startActivity(new Intent([Link], [Link]));
}
});
Change Password
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText password1,password2;
EditText phoneNumber;
Button change;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_change_password);
password1=findViewById([Link].editTextChangePassword1);
password2=findViewById([Link].editTextChangePassword2);
change=findViewById([Link]);
phoneNumber=findViewById([Link].editTextChangePassword3);
[Link](new [Link]() {
@Override
public void onClick(View v) {
String pass1=[Link]().toString();
String pass2=[Link]().toString();
String phone=[Link]().toString();
}
}
<EditText
android:id="@+id/editTextChangePassword1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:background="@drawable/edittextsyle"
android:hint="Enter password"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.282" />
<EditText
android:id="@+id/editTextChangePassword2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:background="@drawable/edittextsyle"
android:hint="Enter Confirm password"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/buttonChangePass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_style"
android:text="Change password"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.852" />
<EditText
android:id="@+id/editTextChangePassword3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:background="@drawable/edittextsyle"
android:inputType="textPersonName"
android:hint="Enter your phoneNumber"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.422"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.677" />
</[Link]>
Package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
binding = [Link](getLayoutInflater());
setContentView([Link]());
Fragment Home
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].project2.R;
import [Link];
import [Link];
import [Link].project2.contact_support;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
[Link](new [Link]() {
@Override
public void onClick(View v) {
startActivity(new Intent(getContext(), contact_support.class));
}
});
rcv=binding.RecyclerView1;
[Link](new LinearLayoutManager(getContext()));
[Link](adapter);
// [Link](getContext(), "Hello Recycler Toast", Toast.LENGTH_SHORT).show();
setHasOptionsMenu(true);
[Link]();
// [Link]();
return root;
}
@Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
[Link]([Link],menu);
MenuItem item=[Link]([Link].search_menu);
SearchView searchView=(SearchView)[Link]();
[Link](new [Link]() {
@Override
public boolean onQueryTextSubmit(String query) {
processSearch(query);
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
processSearch(newText);
return false;
}
});
[Link](menu, inflater);
}
DatabaseReference vendorRef =
[Link]().getReference().child("Products");
FirebaseRecyclerOptions<VendorModal> options = new
[Link]<VendorModal>()
.setQuery([Link]("BookName").startAt(msg).endAt(msg+"\uf8ff"),
[Link])
.build();
adapter=new VendorAdapter(options,getContext());
[Link]();
[Link](adapter);
}
}
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<[Link]
android:id="@+id/floatingActionButton"
android:layout_width="58dp"
android:layout_height="63dp"
android:clickable="true"
android:elevation="34dp"
android:gravity="center"
android:src="@drawable/ic_baseline_contact_support_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.954"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.854" />
<[Link]
android:id="@+id/RecyclerView1"
android:layout_width="match_parent"
android:layout_height="740dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.928"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />
</[Link]>
<[Link]
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="#74FAFAFA"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<fragment
android:id="@+id/nav_host_fragment_activity_home_page_vendor"
android:name="[Link]"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
app:navGraph="@navigation/mobile_navigation">
</fragment>
</[Link]>
*BOOKS WILL APPEAR IN THE RECYCLER VIEW THEN ON CLICK ON THE OF THE ITEM BELOW
IS THE XML CODE
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/book_detail"
tools:context=".PageDetailsVendor">
<TextView
android:id="@+id/TextBookTitleDetails"
android:layout_width="match_parent"
android:layout_height="68dp"
android:gravity="center"
android:text="BooK Title"
android:textColor="#FFFFFF"
android:textSize="33dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.351" />
<[Link]
android:id="@+id/ShapeAbleImageView"
android:layout_width="253dp"
android:layout_height="157dp"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:strokeWidth="2dp" />
<TextView
android:id="@+id/BookAuthorDetails"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="128dp"
android:gravity="center"
android:text="Book Author"
android:textColor="#fff"
android:textSize="17dp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ShapeAbleImageView" />
<TextView
android:id="@+id/VendorPhNumberDetails"
android:layout_width="223dp"
android:layout_height="57dp"
android:layout_marginBottom="16dp"
android:drawableLeft="@drawable/ic_baseline_local_phone_24"
android:gravity="left"
android:text="Seller Number"
android:textColor="#fff"
android:textSize="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.867"
app:layout_constraintStart_toStartOf="parent" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
app:layout_constraintBottom_toTopOf="@+id/VendorPhNumberDetails"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:orientation="vertical">
<TextView
android:id="@+id/textViewDescDetail"
android:layout_width="match_parent"
android:layout_height="294dp"
android:text="Content"
android:textColor="#fff"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.804" />
</LinearLayout>
</ScrollView>
</[Link]>
THE JAVA CODE OF THE ABOVE
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_page_details_vendor);
Intent FetchIntent=getIntent();
String desc=[Link]("Desc").toString();
String imgpath=[Link]("imgPath");
String auth=[Link]("auth");
String B_name=[Link]("Title");
String contact=[Link]("phone");
TextView descView=findViewById([Link]);
TextView bookName=findViewById([Link]);
TextView bookAuth=findViewById([Link]);
TextView SellerNum=findViewById([Link]);
ShapeableImageView img=findViewById([Link]);
[Link](B_name);
[Link](auth);
[Link](contact);
[Link](desc);
[Link](new [Link]() {
@Override
public void onClick(View v) {
Intent dial=new Intent(Intent.ACTION_DIAL);
[Link]([Link]("tel: +91"+contact));
startActivity(dial);
}
});
[Link](this, "success", Toast.LENGTH_SHORT).show();
[Link]().load(imgpath).into(img);
}
}
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].project2.R;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
inventory=[Link];
[Link](new [Link]() {
@Override
public void onClick(View v) {
// [Link](getContext(), "Inventory", Toast.LENGTH_SHORT).show();
[Link](getContext(),"Sucess!",Toasty.LENGTH_SHORT,true).show();
startActivity(new Intent(getContext(), [Link]));
}
});
@Override
public void onDestroyView() {
[Link]();
binding = null;
}
}
XML ADD PRODUCT
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".[Link]">
<ImageButton
android:id="@+id/buttonInventory"
android:layout_width="415dp"
android:layout_height="374dp"
android:layout_marginBottom="364dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/add_product_trolly" />
<ImageView
android:id="@+id/buttonAddproduct"
android:layout_width="417dp"
android:layout_height="353dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonInventory"
app:layout_constraintVertical_bias="0.6"
app:srcCompat="@drawable/trolly_invetory" />
<TextView
android:id="@+id/textView4"
android:layout_width="233dp"
android:layout_height="129dp"
android:layout_marginTop="56dp"
android:text="Inventory"
android:textColor="#fff"
android:textSize="45dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.161"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView13"
android:layout_width="176dp"
android:layout_height="98dp"
android:gravity="center"
android:text="ADD New Product"
android:textColor="#fff"
android:textSize="23dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.974" />
</[Link]>
INVENTORY(JAVA CODE)
package [Link].project2;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class inventory extends AppCompatActivity {
Button inventorySeller;
EditText phno;
EditText password;
ProgressDialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_inventory);
inventorySeller=findViewById([Link]);
phno=findViewById([Link]);
password=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
if ([Link]().toString().isEmpty() ||
[Link]().toString().isEmpty()) {
[Link]([Link], "Enter all details", Toast.LENGTH_SHORT).show();
} else {
dialog = new ProgressDialog([Link]);
[Link]("Logging In");
[Link]("Logging you in");
[Link](false);
[Link]();
if ([Link]().toString().length() == 10) {
DatabaseReference reference =
[Link]().getReference("Vendor1").child([Link]().toString());
[Link](new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if ([Link]()) {
String pwd = [Link]().toString();
String phoneNumber = [Link]();
String pwdV = [Link]("password").getValue().toString();
if ([Link]([Link]().toString()) &&
[Link](pwdV)) {
[Link]([Link], "Success", Toast.LENGTH_SHORT,
true).show();
Intent it = new Intent([Link], [Link]);
[Link]("phone_number", phoneNumber);
[Link]();
startActivity(it);
} else {
[Link]();
[Link]([Link], "Password is incorrect",
Toast.LENGTH_SHORT, true).show();
}
} else {
[Link]();
[Link]([Link], "Number Not found ",
Toast.LENGTH_SHORT).show();
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
// [Link]([Link], "Failure", Toast.LENGTH_SHORT).show();
}
});
} else {
[Link]([Link], "The number is incorrect",
Toast.LENGTH_SHORT).show();
}
}
}
});
}
}
XML (CODE)
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:background="@drawable/details_class"
android:layout_height="match_parent"
tools:context=".inventory">
<[Link]
android:layout_width="376dp"
android:layout_height="378dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:cardElevation="20dp"
app:cardCornerRadius="27dp">
<[Link]
android:layout_width="376dp"
android:layout_height="378dp"
android:background="#157FEF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.542"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.459">
<Button
android:id="@+id/buttonInventoryDetails"
android:layout_width="266dp"
android:layout_height="58dp"
android:background="@drawable/button_style"
android:text="Fetch inventory"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.409"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.909" />
<EditText
android:id="@+id/editTextPhoneNumberInventory"
android:layout_width="365dp"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ems="10"
android:textColor="#fff"
android:hint="Please Enter your Phone Number (Seller)"
android:inputType="phone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.2" />
<[Link]
android:layout_width="374dp"
android:layout_height="wrap_content"
app:helperText="Enter your password"
app:endIconMode="password_toggle"
app:counterEnabled="true"
app:counterMaxLength="9"
app:passwordToggleEnabled="true"
android:elevation="20dp"
app:boxBackgroundMode="outline"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<[Link]
android:id="@+id/inventoryPasswrd"
android:layout_width="match_parent"
android:textColor="#fff"
android:layout_height="wrap_content"
android:hint="Enter your password"
/>
</[Link]>
</[Link]>
</[Link]>
</[Link]>