Posts

Showing posts with the label Grid View

Android Layouts [UPADTED 2019]

Image
A layout defines the structure for a user interface in your app, such as in an activity. 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 1. Figure 1. Illustration of a view hierarchy, which defines a UI layout The View objects are usually called "widgets" and can be one of many subclasses, such as Button or TextView . The ViewGroup objects are usually called "layouts" can be one of many types that provide a different layout structure, such as LinearLayout or ConstraintLayout . You can declare a layout in two ways: Declare UI elements in XML . 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 ...

Android Fullscreen Image Slider with Swipe and Zoom Gestures

Image
This tutorial explains how to build your own image gallery browser in your android applications with swipe and pinch zooming functionality. This article is combination of three separate concepts such as Grid View, Swiping and Pinch Gesture in one project. Creating new project 1 . Create new project in Eclipse IDE from  File ⇒ New ⇒ Android Application Project  and fill all the required details. I kept my package name as com.yourname.imageslider and main activity name as  GridViewActivity.java App Constant Class I am creating a app constant class file to store static variables which will be used across application. In this way you don’t have modify much code if you want to change app configuration. 2 . In order to maintaining good project structure I am creating a separate package for storing this kind of helper classes.  Right click on src ⇒ New ⇒ Package  and name it as  your_package_name.helper . (So my helper package becomes...