Skip to content

Instantly share code, notes, and snippets.

View leonguyen's full-sized avatar

Nam Nguyen leonguyen

View GitHub Profile
@leonguyen
leonguyen / gist:5325531
Last active December 15, 2015 21:28
Android Lab: Table Layout - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow>
<TextView
android:padding="3dip"
android:text="Open" />
@leonguyen
leonguyen / gist:5325537
Last active December 15, 2015 21:28
Android Lab: Table Layout - Weather - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow>
<TextView
android:layout_span="6"
android:gravity="center"
@leonguyen
leonguyen / gist:5326355
Created April 6, 2013 14:51
CodeIgniter Lab: HMVC - Foo Controller
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Foo extends MX_Controller {
public function index()
{
echo 'Hello Foo, CI Lab!';
}
}
@leonguyen
leonguyen / gist:5329563
Last active December 15, 2015 21:59
Android Lab: Relative Layout - Work - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/editTextMain"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
@leonguyen
leonguyen / gist:5329665
Last active December 15, 2015 21:59
Android Lab: Linear Layout - Login - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@leonguyen
leonguyen / gist:5329865
Last active December 15, 2015 21:59
Android Lab: Linear Layout - Register - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@leonguyen
leonguyen / gist:5331192
Last active December 15, 2015 22:09
Android Lab: Scroll View - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
@leonguyen
leonguyen / gist:5335106
Last active December 15, 2015 22:48
Android Lab: List View Activity
package com.example.androidlab;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends ListActivity {
@leonguyen
leonguyen / gist:5335460
Last active December 15, 2015 22:49
Android Lab: List View with Custom Layout - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dip"
android:textSize="16dip" >
</TextView>
@leonguyen
leonguyen / gist:5335493
Last active December 15, 2015 22:49
Android Lab: List View with Custom Layout Activity
package com.example.androidlab;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends ListActivity {