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" 
   />



0 comments: