Showing posts with label Components. Show all posts
Showing posts with label Components. Show all posts

Sunday, 18 November 2012

Drag & drop elements in ADVANCED


Today we are discussing about the drag & drop elements in ADVANCED.In the bellow figure show the elements in ADVANCED.



requestFocus & View
  • The class in view represents basic building blocks for the user interface.

  • A view is responsible  for event handling and drawing.

  • View is used to create interactive UI components.

  • The default code is given bellow.

    <requestFocus />

    <View
        android:id="@+id/view1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


ViewStub

  • A ViewStub is used to inflate layout resources at runtime.
  • A ViewStub is becoming visible  when inflate() is invoked.

  • The default code is given bellow.


<ViewStub
        android:id="@+id/viewStub1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
/>


GestureOverlayView

  • GestureOverlayView  is a transparency overlay for giving input that is placed on the top of other widgets.
  • The default code is given bellow.

      <android.gesture.GestureOverlayView
        android:id="@+id/gestureOverlayView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </android.gesture.GestureOverlayView>


SurfaceView

  • SurfaceView is used to provide a dedicated surface for drawing  embedded inside of a view.
  • The default code is given bellow.

   <SurfaceView
        android:id="@+id/surfaceView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
   />


ZoomButton

  • ZoomButton is used to zooming anything depends on the place where it is placed/
  • The default code is given bellow.
   <ZoomButton
        android:id="@+id/zoomButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/btn_plus"
   />
    

ZoomControls

  • ZoomControls is used for both zoom in and zoom out.
  • It is mainly used in image applications.
  • The default code is given bellow.
      <ZoomControls
        android:id="@+id/zoomControls1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
    />


DialFilter

  • The deafult code is shown bellow.


    <DialerFilter
        android:id="@+id/dialerFilter1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <EditText
            android:id="@android:id/hint"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Hint" >

            <requestFocus />
        </EditText>

        <EditText
            android:id="@android:id/primary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/hint"
            android:text="Primary" />

    </DialerFilter>

TwoLineItemList
  • A view group with two children is used in ListViews.
  • The default code is given bellow.
   <TwoLineListItem
        android:id="@+id/twoLineListItem1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
  />

AbsoluteLayout
  • An absolute layout is used to specify locations of its childrens
  • It is less flexible and hard to maintain.
  • The default code is given bellow.
  <AbsoluteLayout
        android:id="@+id/absoluteLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </AbsoluteLayout>

Saturday, 17 November 2012

Drag & drop elements in TRANSITION


Today we are discussing about the drag & drop elements in TRANSITIONS.Lets check it out the following given bellow.



Image Switcher

  • Image Switcher is used for to switch between two images and makes a way to transition with suitable animation.
  • The default code is given bellow.
    <ImageSwitcher
        android:id="@+id/imageSwitcher1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </ImageSwitcher>

Text Switcher
  • As like the image switcher,Text Switcher is used for switch or animate one text into another text form.
  • The default code is given bellow.
    <TextSwitcher
        android:id="@+id/textSwitcher1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </TextSwitcher>

View Animator
  • View animator is used perform animations between two image or text view.
  • The default code is given bellow.
    <ViewAnimator
        android:id="@+id/viewAnimator1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewAnimator>

View Flipper
  • View Flipper is used to animate between two or more views.
  • Only one child can be shown at a time.
  • It is possible to flip automatically between each of the child at regular intervals.
  • The default code is shown bellow.
    <ViewFlipper
        android:id="@+id/viewFlipper1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewFlipper>

View Switcher
  • A View Switcher is used only to have two child views and  which only shows one at a time.
  • The default code is given bellow.

    <ViewSwitcher
        android:id="@+id/viewSwitcher1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ViewSwitcher>


In the next we will learn the elements in ADVANCED, CUSTOM & LIBRARY VIEWS

Friday, 16 November 2012

Drag & drop elements in IMAGES & MEDIA


Drag & drop elements in IMAGES & MEDIA



Today we are discussing about the drag & drop elements in IMAGES & MEDIA.Lets check it out int he following given bellow.




Image View

  • Image view is used to display images such as icons.

  • It can load images from any of the sources like content provider or resources.
  • The default code is given bellow.
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" 
    />

Image Button

  • Image button is used for the same purpose of button,but in image button we can add image.
  • It can load images from sources like resources or from content provider.
  • The default code is given bellow.
    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" 
/>


GALLERY

  • A gallery is a view that shows the items in a horizontally scrolling list as center-locked manner.

  • Gallery view must uses Gallery.LayoutParams as their layout parameter type.
  • The default code is given bellow.
     <Gallery
        android:id="@+id/gallery1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
     />

Media Controller


  • The Media Controller is used for controlling for a MediaPlayer which typically contains the buttons "Play/Pause","Fast-Forward","Rewind" and progress slider.

  • Media Controller will create a set of controls and put it into window which is floating above your application.
  • The default code is given bellow.
    <MediaController
        android:id="@+id/mediaController1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    </MediaController>


Video View


  • Video view is used for displaying a video file and a  video view is able to load images from various sources.
  • The default code is given bellow.
   <VideoView
        android:id="@+id/videoView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
   />



Thursday, 15 November 2012

Drag & drop elements in Time & Date




Today we are discussing about the drag & drop elements in TIME & DATE.The TIME& DATE elements in ANDROID are given bellow.




Pickers


  • Android provides time and date picker for choosing the time and date in the android applications.
  • The user can set time and date by using this two pickers.

  • Time picker provides control for selecting each part of time  such as hour,minute and AM or PM.
  • The default code is given bellow.
        <TimePicker
        android:id="@+id/timePicker1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
     />



  • Date picker provides control for selecting month,day and year.
  • The default code is given bellow.
         <DatePicker
        android:id="@+id/datePicker1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
     />




Chronometer


  • Chronometer class that shows a simple timer. 
  • The default code is given bellow.

      <Chronometer
        android:id="@+id/chronometer1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Chronometer" 
      />


Analog Clock

  • This widget in Time & Date shows an analog clock with 2 hands for hours and minutes.
  • The default code is given bellow.
    <AnalogClock
        android:id="@+id/analogClock1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    />


Digital Clock

  • This widget show time in hours,minute and seconds in digital form
  • The default code is given bellow.
    <DigitalClock
        android:id="@+id/digitalClock1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="DigitalClock"
    />
  

Wednesday, 14 November 2012

Drag & drop elements in LAYOUT





Today we are discussing about the drag & drop elements in LAYOUT.The layout elements in ANDROID are given bellow.




Linear Layout


  • It is a view group which aligns all the children in a single directrion,ie.horizontally or vertically.

  • The developer can specify the layout direction by using android:orientation attribute.

  • There are 2 types of linear layout.They are linear layout(horizontally) and linear layout(vertically).
  • The default code is given bellow.

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
    </LinearLayout>



Relative Layout


  • Relative layout is a layout where posotions of the children can be described related to to the parent or each other.
  • Relative layout whose height can be set to WRAP_CONTENT and ALIGN_PARENT_BOTTOM for child.
  • The default code is given bellow.

    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </RelativeLayout>


FrameLayout


  • Frame Layout is designed to use block out an area on the screen for displaying a single item.

  • Frame Layout is mainly used for holding a single child view.
  • The default code is given bellow.

    <FrameLayout
        android:id="@+id/frameLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </FrameLayout>

Fragments


  • Fragments in layout represents portion or behaviour of user interface in an Activity.

  • We can combine multiple fragments in a single activity to build a multi pane user interface.

  • Fragments can reuse in multiple activity.

Table Layout
  • Table layout arranges its chidren elements into columns and rows.

  • A Table Layout consist of number of rows and columns.
  • It does not show the table border.
  • The default code is given bellow.
    <TableLayout
            android:id="@+id/tableLayout1"
              android:layout_width="match_parent"
                android:layout_height="wrap_content" >
                    <TableRow
                          android:id="@+id/tableRow1"
                            android:layout_width="wrap_content"
                              android:layout_height="wrap_content" >
                            </TableRow>
                                <TableRow
                                      android:id="@+id/tableRow2"
                                        android:layout_width="wrap_content"
                                          android:layout_height="wrap_content" >
                                        </TableRow>
                                            <TableRow
                                                  android:id="@+id/tableRow3"
                                                    android:layout_width="wrap_content"
                                                      android:layout_height="wrap_content" >
                                                    </TableRow>
                                                        <TableRow
                                                              android:id="@+id/tableRow4"
                                                                android:layout_width="wrap_content"
                                                                  android:layout_height="wrap_content" >
                                                                </TableRow>
                                                              </TableLayout>
                                                              
                                                            Table Row


                                                            • Table Row arranges its children elements horizontally.
                                                            • It is always used as a child of Table Layout.
                                                            • The default code is given bellow.

                                                                <TableRow
                                                                    android:id="@+id/tableRow1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >
                                                                </TableRow>


                                                            Tuesday, 13 November 2012

                                                            Drag & drop elements in Composite


                                                            Today we are discussing about the drag & drop elements in COMPOSITE.The composite elements in ANDROID are given bellow.


                                                            ListView

                                                            • A list view is a list of scrollable items in a group

                                                            • The List view items are automatically inserting the elements into the list using an adapter that enter the source content from database or array.
                                                            • The default code is given bellow.
                                                                <ListView
                                                                    android:id="@+id/listView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >
                                                                </ListView>



                                                            Expandable List

                                                            • The Expandable List view which shows items in vertically scrolling 2 level list view manner.
                                                            • It allows users to expand individually each list into another list.
                                                            • Expandable List shows an indicator besides each item having child elements.
                                                            • The default code is given bellow.


                                                                   <ExpandableListView
                                                                    android:id="@+id/expandableListView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >
                                                                </ExpandableListView>



                                                            Grid View

                                                            • Grid view shows items in two dimensional scrolling format.

                                                            • Items in the Grid View are comes from ListAdapter which is associated with the view.

                                                            • Grid view is mainly used for displaying items in a thumbnails format.
                                                            • The default code is given bellow.


                                                            ScrollView

                                                            • The scroll view helps to scroll and view the content fronm top to bottom or bottom to top 

                                                            • Scroll View is a frame layout which having the ability to scroll entire contents.

                                                            • ScrollView only support for vertical scrolling.
                                                            • The default code is given bellow.
                                                                <ScrollView
                                                                    android:id="@+id/scrollView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >

                                                                    <LinearLayout
                                                                        android:id="@+id/linearLayout1"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent" >
                                                                    </LinearLayout>
                                                                </ScrollView>
                                                               

                                                            Horizontal ScrollView


                                                            • HorizontalScrollView is only support for horizontal scrolling.
                                                            • The default code is given bellow.
                                                                  <HorizontalScrollView
                                                                    android:id="@+id/horizontalScrollView1"
                                                                    android:layout_width="wrap_content"
                                                                    android:layout_height="wrap_content" >

                                                                    <LinearLayout
                                                                        android:id="@+id/linearLayout1"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent"
                                                                        android:orientation="horizontal" >
                                                                    </LinearLayout>
                                                                </HorizontalScrollView>


                                                            Sliding Drawer


                                                            • Sliding drawer allows users to drag contents horizontally or vertically and user to drag by a handle to bring contents in the screen.
                                                            • Sliding Drawer should only used inside of Frame Layout.
                                                            • The default code is given bellow.
                                                                <SlidingDrawer
                                                                    android:id="@+id/slidingDrawer1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="match_parent"
                                                                    android:content="@+id/content"
                                                                    android:handle="@+id/handle" >

                                                                    <Button
                                                                        android:id="@+id/handle"
                                                                        android:layout_width="wrap_content"
                                                                        android:layout_height="wrap_content"
                                                                        android:text="Handle" />

                                                                    <LinearLayout
                                                                        android:id="@+id/content"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent" >
                                                                    </LinearLayout>
                                                                </SlidingDrawer>


                                                            WebView
                                                            • A web view is used for displaying web pages.

                                                            • Web View uses Webkit rendering engine to display web pages.

                                                            • Web View having the methods to zoom in and zoom out,navigate forward and backward and having text search capability.

                                                            • The default code is given bellow.
                                                            <WebView
                                                                    android:id="@+id/webView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="match_parent"

                                                             />

                                                            TabHost

                                                            • Container for a tabbed window view. 
                                                            • This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page.
                                                            •  The individual elements are typically controlled using this container object, rather than setting values on the child elements themselves.
                                                            • The default code is given bellow.
                                                                   <TabHost
                                                                    android:id="@android:id/tabhost"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="match_parent" >

                                                                    <LinearLayout
                                                                        android:id="@+id/linearLayout1"
                                                                        android:layout_width="match_parent"
                                                                        android:layout_height="match_parent"
                                                                        android:orientation="vertical" >

                                                                        <TabWidget
                                                                            android:id="@android:id/tabs"
                                                                            android:layout_width="match_parent"
                                                                            android:layout_height="wrap_content" >
                                                                        </TabWidget>

                                                                        <FrameLayout
                                                                            android:id="@android:id/tabcontent"
                                                                            android:layout_width="match_parent"
                                                                            android:layout_height="match_parent" >

                                                                            <LinearLayout
                                                                                android:id="@+id/tab1"
                                                                                android:layout_width="match_parent"
                                                                                android:layout_height="match_parent" >
                                                                            </LinearLayout>

                                                                            <LinearLayout
                                                                                android:id="@+id/tab2"
                                                                                android:layout_width="match_parent"
                                                                                android:layout_height="match_parent" >
                                                                            </LinearLayout>

                                                                            <LinearLayout
                                                                                android:id="@+id/tab3"
                                                                                android:layout_width="match_parent"
                                                                                android:layout_height="match_parent" >
                                                                            </LinearLayout>
                                                                        </FrameLayout>
                                                                    </LinearLayout>
                                                                </TabHost>



                                                            Monday, 12 November 2012

                                                            Drag & Drop elemenets in Text Field




                                                            In this chapter we are going to learn about the drag and drop elements in the Text Field.The Above figure shows the following elements.

                                                            The different types of Text Fields are the following given bellow.

                                                            PlainText
                                                            • It is used for entering plain text.
                                                            • The default code is given bellow.

                                                                <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content" >

                                                                    <requestFocus />
                                                                </EditText>



                                                            Password(numeric)

                                                            • It is used for entering numeric password.
                                                            • The default code is given bellow.
                                                                 <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="numberPassword" >

                                                                    <requestFocus />
                                                                </EditText>


                                                            Postal Address
                                                            •  It is used for entering the postal address.
                                                            • The default code is given bellow.
                                                                <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="textPostalAddress" >

                                                                    <requestFocus />
                                                                </EditText>


                                                            Date
                                                            • It is used for entering date.
                                                            • The default code is given bellow.

                                                                   <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="date" >

                                                                    <requestFocus />
                                                                </EditText>



                                                            Number(Decimal
                                                            • It is used for entering decimal numbers.
                                                            • The default code is given bellow.
                                                                   <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="numberDecimal" >

                                                                    <requestFocus />
                                                                </EditText>


                                                            Person Name

                                                            • It is used for entering the person name.
                                                            • The default code is given bellow.
                                                                   <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="textPersonName" >

                                                                    <requestFocus />
                                                                </EditText>
                                                              

                                                            E-mail
                                                            • It is used for entering e-mail id.
                                                            • The default code is given bellow.
                                                                 <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="textEmailAddress" >

                                                                    <requestFocus />
                                                                </EditText>



                                                            Multi-line Text

                                                            • It is used for entering multi-line text.
                                                            • The default code is given bellow.
                                                                   <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="textMultiLine" >

                                                                    <requestFocus />
                                                                </EditText>
                                                               

                                                            Number

                                                            • It is used to enter integer numbers.
                                                            • The default code is given bellow.

                                                                   <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="number" >

                                                                    <requestFocus />
                                                                </EditText>
                                                             
                                                            AutoComplete Textview

                                                            • It is used as a auto complete text view.
                                                            • The default code is given bellow.


                                                            Password

                                                            •   It is used for text password.
                                                            •  The default code is given bellow.
                                                                   <EditText

                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="textPassword" >

                                                                    <requestFocus />
                                                                </EditText>


                                                            Phone
                                                            • It is used for entering phone number.
                                                            • The default code is given bellow.
                                                                <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="phone" >

                                                                    <requestFocus />
                                                                </EditText>



                                                            Time
                                                            • It is used for entering the time.
                                                            • The default code is given bellow.
                                                                  <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="time" >

                                                                    <requestFocus />
                                                                </EditText>


                                                            Number(Signed)

                                                            • It is used for entering signed numbers like +,-,*..etc.
                                                            • The default code is given bellow.
                                                                  <EditText
                                                                    android:id="@+id/editText1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:inputType="numberSigned" >

                                                                    <requestFocus />
                                                                </EditText>


                                                            MultiAuto Complete TextView

                                                            • It is used as a muti purpose auto complete textview.
                                                            • The default code is given bellow.


                                                                <MultiAutoCompleteTextView
                                                                    android:id="@+id/multiAutoCompleteTextView1"
                                                                    android:layout_width="match_parent"
                                                                    android:layout_height="wrap_content"
                                                                    android:text="MultiAutoCompleteTextView" >

                                                                    <requestFocus />
                                                                </MultiAutoCompleteTextView>


                                                            THIS IS FEATURED POST 1 TITLE

                                                            THIS IS FEATURED POST 1 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Quas molestias excepturi
                                                            THIS IS FEATURED POST 2 TITLE

                                                            THIS IS FEATURED POST 2 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Impedit quo minus id
                                                            THIS IS FEATURED POST 3 TITLE

                                                            THIS IS FEATURED POST 3 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Voluptates repudiandae kon
                                                            THIS IS FEATURED POST 4 TITLE

                                                            THIS IS FEATURED POST 4 TITLE

                                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam

                                                            Mauris euismod rhoncus tortor