Tag Archives: Padding

Flutter Tutorials – Form Validation (Android and iOS)

By | January 5, 2019

Hello friends, In this article I am gonna show you how you can do Form Validation in a very simple way in Flutter. Below is the demo of the app we are going to build App Demo   Watch Video Tutorial   Explanation Here in this demo, I will have two TextformField and a Button and we will… Read More »

GridView Demo in Flutter

By | October 10, 2018

Hi Friends, Today we will see how to implement GridView in Flutter.     We are going to use this service for the data First we will create a Model for the Grid Cell [java] class HomeCellVO { int id; String title; String icon; HomeCellVO({this.id, this.title, this.icon}); factory HomeCellVO.fromJson(Map<String, dynamic> json) { return HomeCellVO( id: json[‘id’] as int,… Read More »

ng-repeat Simple Demo in Angular JS with filter

By | September 15, 2017

ng-repeat. Example [html] <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <head> <title>Angular JS NG-Repeat Directive</title> <style> table { border-collapse: collapse; } table, td, th { border: 1px solid black; padding: 5px; } </style> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <script> var app = angular.module("MyModule", []); app.controller("MyController", function($scope){ $scope.title = "Records"; var employees… Read More »

How to create transparency without using image in Android?

By | February 4, 2013

Transparency in a background of a View in android can be achieved in two ways. 1. By providing a transparent image. 2. By providing an XML that has as shape with end, starting and middle color. This is a sample XML that creates a transparency. bg_gradiant.xml [xml] <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape> <gradient android:endColor ="#FFFFFF" android:startColor="#AA2F1701"… Read More »

How will you create a custom Notification in Android with a custom Layout?

By | September 15, 2012

This sample application does that. First create an xml for your notification. custom_notification.xml [xml] <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" > <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_marginRight="10dp" /> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/image" style="Custom Notification Title" /> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/image" android:layout_below="@id/title" style="Custom Notification Text" /> </RelativeLayout> [/xml] Now the java code. [java] package com.coderzheaven.customnotification; import android.app.Activity;… Read More »

How to create a Slide from Left animation while deleting a row from a ListView in Android?

By | September 12, 2012

Hello all…… I have written a lost of posts on Listviews. You can see that by just searching Listviews in my site. Today I will show you how to create a slide out animation while we delete a row from a ListView. So this is the xml that contains the ListView. Let it be in the main.xml main.xml… Read More »

ListView with Sections in android.

By | February 24, 2012

Hello all………. We have seen many posts about ListViews like creating a listview, adding data to it, customizing a listview etc. Take a look at some of these examples 1. Single Selection ListView in android 2. Flitering a ListView using an input from an EditText in Android. 3. How to create a custom ListView in android? 4. Android… Read More »

Single Selection ListView in android

By | January 8, 2012

Hello all….. In today’s post I will show you how to create a single selection list in android. Here is the main.xml [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@android:id/list" android:cacheColorHint="#00000000" android:scrollbars="none" android:fadingEdge="vertical" android:soundEffectsEnabled="true" android:dividerHeight="1px" android:padding="5dip" android:smoothScrollbar="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="false" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:layout_marginBottom="10dip" android:layout_weight="1"/> </LinearLayout> [/xml] Now this line in the java file creates the… Read More »

How to use shapes in android? A simple example.

By | October 23, 2011

In android with shapes we can create beautiful layouts. Lets look at an example. Create an xml named “gradient.xml” in your drawable folder and copy this code into it. [xml] <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:angle="0" android:startColor="#000000" android:endColor="#000000" android:centerColor="#97CF4D" /> </shape> [/xml] Now the main layout file main.xml [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout01" android:orientation="vertical"… Read More »

Merge two layout xml in android

By | June 26, 2011

Merging layout is an excellent feature in android. Separate xml can be included in a single xml. For this first i create a main.xml file [xml] <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:text="Account" android:id="@+id/account" android:layout_below="@+id/title" android:padding="10dip" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:layout_height="wrap_content" > </TextView> <EditText android:id="@+id/youtube_feed_TF" android:hint="Username" android:layout_marginLeft="10dip" android:inputType="textEmailAddress" android:layout_below="@+id/account" android:layout_centerHorizontal="true" android:layout_width="fill_parent" android:padding="10dip" android:layout_height="wrap_content" ></EditText> <include layout="@layout/footer2button"/> </RelativeLayout> [/xml] In the bottom… Read More »