From 3c5e312e8b4a48ad2db6e3ba89e60dd8402d3baf Mon Sep 17 00:00:00 2001 From: MATRIX Date: Thu, 4 Oct 2018 17:53:53 +0530 Subject: [PATCH] a bit of information changes --- Lesson1/(1).about_diffrent_views.md | 14 +++++++------- Lesson1/(2).about_xml.md | 8 ++++---- Lesson1/(3).xml_code_of_textview | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Lesson1/(1).about_diffrent_views.md b/Lesson1/(1).about_diffrent_views.md index 497a011..a3bdc8f 100644 --- a/Lesson1/(1).about_diffrent_views.md +++ b/Lesson1/(1).about_diffrent_views.md @@ -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) diff --git a/Lesson1/(2).about_xml.md b/Lesson1/(2).about_xml.md index 395b747..94599ab 100644 --- a/Lesson1/(2).about_xml.md +++ b/Lesson1/(2).about_xml.md @@ -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. diff --git a/Lesson1/(3).xml_code_of_textview b/Lesson1/(3).xml_code_of_textview index 2fa9111..de0e275 100644 --- a/Lesson1/(3).xml_code_of_textview +++ b/Lesson1/(3).xml_code_of_textview @@ -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