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>



2 comments:

Roney Joseph said...

Ooh
Drag & drop is enough

How much elements are there

Anonymous said...

nice