Skip to content

a bit of information changes #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Lesson1/(1).about_diffrent_views.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Whatever we see in any android app is considered as a VIEW. Generally, an android app is a collection of more than one views i.e. you get text, images, buttons, etc. on any application. For example, the logging page of facebook app consists of various views such as facebook logo(ImageView), text field to enter username and password(EditText), login button(Buttons), create new account(Button), etc. These view combinedly make a great looking app like facebook. So here we will try to look onto some of these views.
In android, there are many types of views :
Whatever we see in any android app is considered as a VIEW. Generally, an android app is a collection of more than one views i.e. you get text, images, buttons, e.t.c.. For example, the logging page of facebook app consists of various views such as facebook's logo (ImageView), text field to enter username and password (EditText), login button (Button), create new account (Button), etc. These view combinedly make a great looking app like facebook. So here we will try to look onto some of these views.
In android, there are many types of views, some of them are :
**(1). ImageView :** A view consisting of images.
**(2). TextView :** A view consisting of texts.
**(3). EditText :** Used to enter some text by the user.
**(4). Button :** Clicked to perform some action.
**(5). CheckBox :** Used to select more than one option from a list of available options.
**(6). ImageButton :** Image used as button i.e. clickable image.
**(3). EditText :** A view i.e. used to enter some text by the user.
**(4). Button :** A view which is clicked to perform some action.
**(5). CheckBox :** A view used to select more than one option from a list of available options.
**(6). ImageButton :** A view in which image is used as a button i.e. clickable image.
Here is an example of the 3 views in android :
![View Example](https://github.com/mishra3452/BasicsOfAndroidUserInterface/blob/master/Lesson1/view.png)

Now try to identify the views present in the below image :
Now try to identify the views present in the image below :

![Question](https://github.com/mishra3452/BasicsOfAndroidUserInterface/blob/master/Lesson1/viewQuestion.png)

8 changes: 4 additions & 4 deletions Lesson1/(2).about_xml.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**Layout**
A layout defines the structure for a user interface in your app.
All elements in the layout are built using a hierarchy of View and ViewGroup objects. A View usually draws something the user can see and interact with. Whereas a ViewGroup is an invisible container that defines the layout structure for View and other ViewGroup objects, as shown in figure.(We will see more about ViewGroup)
A layout defines the structure of a user interface in your application.
All elements in the layout are built using a hierarchy of Views and ViewGroup objects. A View usually draws something the user can see and interact with. Whereas a ViewGroup is an invisible container that defines the layout structure for Views and other ViewGroup objects, as shown in figure.(We will see more about ViewGroup)
![ViewGroup](https://github.com/mishra3452/BasicsOfAndroidUserInterface/blob/master/Lesson1/viewgroup_2x.png)
So, to make it very simple we can say that android uses certain type of technique called XML(Extensible Markup Language) to define all these type of Views and ViewGroups.Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.
You can also use Android Studio's Layout Editor to build your XML layout using a drag-and-drop interface.
So, to make it very simple we can say that android uses certain types of technique called XML(Extensible Markup Language) to define all these types of Views and ViewGroup Objects. Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.
You can also use Android Studio's Layout Editor to build your XML layout using a drag-and-drop feature.
16 changes: 8 additions & 8 deletions Lesson1/(3).xml_code_of_textview
Original file line number Diff line number Diff line change
@@ -6,19 +6,19 @@ Here is a sample code for using a text view i.e. using a text part in your mobil
android:text="I am learning xml"
android:textSize="30sp" />

So, lets understand the meaning of above code :
By using "android:layout_width" we are giving the width of the TextView. Here we have give it match_parent.
By using match_parent, we are giving the space occupied by your parent. For example, if the parent of TextView is having width
equals 10dp(dp means density pixel-a unit of measurement) then the TextView will match it's parent's width i.e. 10dp. In this case
So, lets understand the meaning of the above code :
By using "android:layout_width" we are giving the width to the TextView. Here we have given it match_parent.
By using match_parent, we are giving the space occupied by its parent. For example, if the parent of TextView is having width
equals 10dp (dp means density pixel - a unit of measurement) then the TextView will match it's parent's width i.e. 10dp. In this case
both parent and child will have the same width. In our example, since there is no parent so by default mobile's screen width will
be considered as the width of parent and hence the width of the TextView.
be considered as the width of the parent and hence the width of the TextView.

Now if we use "wrap_content" then the width of the TextView will depend upon the text present i.e. for smaller text width will be
small and for larger text width will be large. By simple meaning, wrap_content will wrap around the content(text for TextView).
Now if we use "wrap_content" then the width of the TextView will depend upon the text present in it i.e. for smaller text width will be
small and for larger text width will be large. By simple meaning, wrap_content will wrap around the content (text in the TextView).

By using "android:text", we can put some text in our TextView (here we are putting "I am learning xml").

By using "android:textSize", we are giving the size of text present in the TextView(sp is another unit which stands for Scale Independent Pixel).
By using "android:textSize", we are giving the size of text present in the TextView (sp is another unit which stands for Scale Independent Pixel).

You can find the view or the output of this code in the lesson folder as xml-textview.png