Uh online git repository this github thing and file new input import from version control git so again file new project from version control git and control v test it which creates a point and it’s correct uh now let’s see the folder let’s let this move away for the folder we don’t save it in android weekly series i’m going to save it in android weekly series and then let’s create a folder here called tool and dice app 6 and ok so yeah this is where you want to save it so basically select any folder of your choice and copy the url here then click on clone and then you can open this this new window and it downloads everything so if there’s any questions again on on how do we do this be sure to leave it on on on youtube and my youtube channel so now the same thing is it just downloaded the master branch for us so from the online the github repo branches it is only downloading master download starter code because currently it doesn’t we don’t have any to do’s so download starter code check out us so again on the bottom right must i mean click on this starter code.
Check out as then select the same name okay and now you get these to do’s and you know click on click on this and expand all so you can see all the 24 how many 22 to those that we have in this in this app so uh now let’s walk over the setup of the app so let’s expand app java the package name and here you have two activities main activity and a dice activity right this is a dice activity so when you click back here this is the main activity so these are the two activities that we have and under res so app res under here under layout we can have the two layout files for activities actually in school main which is empty now because we’re going to implement implement it and the next thing is activity and it’s called dice which is again empty so it’s giving this so force layout refresh is some error on android studio [Music] so maybe we can cancel show layout decorations and do it again so yeah this some small errors usually come on android studio which we can close these files and reopen it see if it fixes it no so it’s fine over time it will be fixed at some point.
Uh yeah we can just usually this poster layout refresh or closing the files and opening it again works but it’s not so anyway so now uh let’s start to plan our stuff so first in our activity underscore main let us create our layout so if you see our layout for the home page we have two text views and two buttons so uh it’s this one so actually i have the solution code here so we can uh yeah this is the home page so there are two text views and then two buttons so let’s create this layout today we’re going to learn some new uh layout uh things here so text view one text view so i’ll go a little quick with this so because we have covered this in week one and many weeks so two text views and two buttons now the thing is how do we lay out these buttons all right still it’s giving some problem let’s leave it how do we lay out these buttons so if you note here we need the buttons to be in the middle of the screen right in the middle and some space between the buttons so one trick of doing it is using instead of you know constraining this like individually is to make them a group.
And move the group around so how so to put these both in a group one cool skill that you can learn is in layouts there’s this linear layout horizontally so add it to the screen because these two buttons are in a horizontal list right like in a horizontal line so now put the buttons inside this group and now you can for this linear layout you see these two buttons are inside the linear layout now set the width of the linear layout to wrap context wrap content i mean so now you can move this oh not the button i mean move the let me select this i can move it just move the button so click on this yeah you can do this for now there’s a fix as you give it some size but basically what you want to do is wrap content so now this is a group now you can center this you know horizontally and you center the buttons horizontally so this is some layer tricks that i’m going over now we need to add some space between these buttons so click on any one button and add a right margin to this button.
So search for margin this layout margin expand this add a right margin to this button so you’ll get some space between these buttons right so margin end or margin-right preferably is ended now start and left mean kind of the same thing and right and end mean kind of the same thing we do best always start and end instead of right and left that’s because of when you use the right to left layout languages like Arabic it’s um it converts start to actually write yeah movement of this will confuse more people I’m already thinking folks have tuned out I really don’t let me make it as easy as possible let’s keep it fun add the right margin add something like a 16 dB more or 32 dB now you see these this group is centered and the button is also in the group.
So we have these two buttons now uh select this text to default now one click one question here am i not doing some something that i shouldn’t be doing we just learned it now you figure it out yes we shouldn’t do hardcore red strings so in our values string.xml file here you see we have said uh all of these should be there so let us create string let’s call this so i created the names here so you can use these names default label and to give a value so put the closing you know this less than sign great i mean greater than sign and here you can type in default let’s create one for trendy it’s a string in friendly underscore label and for the value tr en e1 friendly now you can create multiple strings of xml file for different languages but now we that now that you understood the concept of always using string.xml file so you can convert it for different languages um but we are not going to do it for now but you can it’s it’s uh it’s always good now here don’t do this type in your default you see this the string that you just created now click it this one don’t put button type in tr end one friendly label.