hello guys welcome back to coding cafe
my name is Muhammad Ali so we have
created InDesign this admin can take the
activity and now we have to define and
cause these buttons or you can say
initialize it on our admin category dot
Java file so what I am going to do here
is that you can simply say a private
image view and first of all we have
t-shirts for t-shirts and in female
glasses and sweaters ok so let's do that
so t-shirts category ok and then we have
sports t-shirts email addresses and then
we have sweaters after that we have the
glasses first bags hats caps and shoes
so we can say glasses hats and caps then
we have valid bags and purses shoes
headphones hand fries then we have
laptops watches and mobile phones so
yeah that's it and let me tell you once
again that is user click on this t-shirt
then it basically means that it will
display all the t-shirts I mean for the
users ok as you know now it is the admin
panel when user click and when an admin
click here on this t-shirt then this
basically means that the admin can add
any kind of t-shirt inside this category
ok and the same for the laptops that is
Apple laptop MacBook Pro and then Dell
laptops HP laptops whatever I mean
different kind of laptops will be under
this category
so when a user click on any item from
this category
let's say this laptop then we will send
the user to the activity which is called
admin add new product activity so first
let me write this then we will do that
so if I user click on t-shirts dots at
onclicklistener
new onclicklistener so we can create an
intent we can give it a name as intent
equals to new intent we are on the admin
category activity dot this we want to
send the user to the add new product
activity dot class and we have to pass
this category category name with ste
shirts okay to the next activity so then
we will allow an admin to add new
different products under each and
specific category on the add new product
activity so we can say intend dot put
extra and we will have category this
will be the name so see at EEG or by
category and we will pass the value to
it which will be t-shirts t-shirts
please use the Sam Nance okay because if
you use different names then you will
become you will be confused in the in
the upcoming tutorials
that is what basically this means so my
suggestion for you guys is to use the
same names which I am writing here and
after that we can simply start the tube
for the intent and the same we will do
for all these buttons okay I mean the
second button is for t-shirts okay so
here we can simply say Sport t-shirts
got set on click listener
new on click listener and what you gonna
do is to simply copy this intent from
here and first that here and what we
gonna do next
is instead of this we can simply say
sports t-shirts so this is our sports
t-shirt category and we will store these
values these variables inside the
firebase database and the help of this
we will will cleave these data from the
firebase database and the same we will
do for the female and sweaters so let's
copy past this and we can simply change
this to female dresses either click on
that we can simply say female and
instead of giving it this name you can
also give it some square so this will be
both other sports t-shirts and then we
have female dresses and now let's go be
pass this for these sweaters and the
name of this will be sweaters and let's
go be best this the next one is glassier
and hats and so we can say glasses dot
set onclicklistener and change this to
glossy
now let's beautiful we had sent caps and
here we can say hats caps this is the
category name and now next one is well
it's bags purses okay so here we can say
well it's bags and purses then the next
one is for the shoes so we can simply
say shoes and change this to shoes
hatsune hands-free and then the next one
is the laptops so we can simply sell
laptops first let me check the name of
these views laptops watches and mobile
phones so here we can say laptops change
this category to laptops watch is saying
this tooth watches and then the last one
is the mobile phones so we can simply
say mobile phones so yeah that's it and
what we gonna do is now go to the admin
add new product activity and here we
have to receive the value from I mean
the category name from the admin
category activity okay I mean this thing
which we are sending from here so come
here and here we need to create a
variable string type which will in which
we will store this okay so you can say
private string and we can give it an MS
category name and now here inside this
one create we can simply say a category
name equals two to get intent dot get
extra dot get and here we need to pass
the same value which is this one okay
category so copy this category and past
that here dot two string so this is
basically the key you can say okay and
this contain a value which is I mean any
value that this one which the user will
click that is let's say for the
clickonce for sports t-shirts then this
will pass this sports t-shirts category
name here okay and we are storing it
inside this category name so for now we
are just going to display it in a
message so that we can see either it is
working or not okay so I can simply pass
this category name here so yeah that's
it and if you remember go to the login
activity and here when the admin login
we were sending the user to the
administrative read directly so we are
not going to send the user there okay
first you send the user to the category
activity later on we will also add
further new cool functionalities but for
now this is necessary okay here are the
important functionalities so here you
can see when we say if parent divinium
dot equals to admins okay for in case of
login so it's everything password in
user phone is correct then we are
sending the user to the admitted new
product activity so remove this and here
we can see we pass this admin category
activity so yeah that's it
and now so before we test the app what I
am going to do is first we have to
initialize or you can say give a
reference to all these image views okay
and we forgot to do it at the start so
here you can see we have said the click
list and okay but first we have to give
a reference to all these image views I
mean we have to do it by using their IDs
so what I am going to do here I can
simply say t-shirts equals to image view
find view by ID or dot ID dot t-shirts
let's copy past this or the remaining
ones so then we have sports t-shirts and
the ID for this is by the lamp sports
t-shirts then we have female tresses
changes to female dresses then we have
sweaters so again say sweaters and
change these two sweaters now let's copy
past this or the remaining ones I mean
so then we have glasses and it is by the
ID for this is glasses okay then we have
had and caps where it's bags purses and
then the shoes and now let's do the last
one which is had food headphones
then we have laptops and the ID for this
is laptop PC then we have watches and
mobile fools so against watches watches
and then mobile phones so yeah that's it
and now we are ready to test the app so
let's and yeah so the app is running now
successfully let's login I am an admin
and admin phone number then the password
is admin now let's log in the admin okay
so we are on the category activity okay
here are the categories now what the
admin will do let's say admin want to
add a new product ok under which
category left off let's say MacBook Pro
ok so he will simply click on this
laptop icon and here you can see laptops
ok and now let's say that main click on
mobile fool any mobile phone so here you
can see this is the category name ok and
then if a user click on this one so the
category name for dishes had food and
hand fees ok hatsune and hands-free and
then for if I user click on shoes and
here you can see shoes so what we will
do is by using this category name we
will the admin will add a new product
under each specific degree here so you
will work on that in the next tutorial
and we will allow an admin to add new
products different products like let's
say different left of HP laptops MacBook
Pro and Dell laptops under this category
which is for laptops ok here you can see
that so yeah that's it for this video
and if anyone is new to our channel then
please subscribe our channel for in cafe
thumbs up for this video and don't
forget to follow me on my Twitter
instead
and sell book account by this username
so we are take care of yourself Aaron
bye for now