SlideShare a Scribd company logo
Introduction to
SOMKIAT KHITWONGWATTANA (AKE)
List View
Simple
List View
What’s List View?
• View Group แบบหนึ่งที่ใช้สำหรับแสดงข้อมูล
• แสดงข้อมูลบำงอย่ำงที่มีจำนวนหลำยๆชุด
• สำมำรถเลื่อนขึ้น-ลงได้ เพื่อดูข้อมูลที่มีทั้งหมด
List View
How It Works?
Data Adapter ListView
What is Adapter?
• ตัวกลำงที่จะทำให้ข้อมูลแสดงบน List View หรือ Spinner
• จัดข้อมูลลง Layout เพื่อแสดงใน List View หรือ Spinner
• Adapter พื้นฐำน : ArrayAdapter, BaseAdapter,
CursorAdapter, ListAdapter, SimpleAdapter และอื่นๆ
How It Works?DataSet
ListView
Data 1 + Layout = Row 1
Data 2 + Layout = Row 2
...
Data X + Layout = Row X
Adapter
How It Works?
String[] data = { “Samsung”, “LG”, “Sony”,
“Acer”, “Asus”, “Motorola”,
“Lenovo”, “Xiaomi”, “OPPO” };
Adapter
It’s Just a Layout!!
It’s Just a Layout!!
Layout
Layout
Layout
Layout
Layout
Layout Design
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent“ />
Necessary Properties
• Margin
• Padding
• Draw Selector On Top
• Cache Color Hint
• Divider
• Divider Height
• Header Dividers Enabled
• Footer Dividers Enabled
• Choice Mode
• Over Scroll Header
• Over Scroll Footer
• Scrollbars
• Scrollbars Style
• Scrollbars Always Draw Vertical Track
• Duplicate Parent State
• Over Scroll Mode
• List Selector
• ETC
Prepare Your Code
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Declare Data Source
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Declare Adapter
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Add Data Source to Adapter
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Declare List View
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Add Adapter to List View
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Check the Result
Redesign Text on List View
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Create Your Own Text
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Text View"
android:textSize="20sp"
android:textColor="#009999" />
Code (Before)
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Code (After)
import android.widget.ArrayAdapter;
...
String[] data = { “Item 1”, “Item 2”, “Item 3” };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this,
R.layout.textview, data);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
Result (Before)
Result (After)
List View
Listener
Listener
setOnItemClickListener(listener);
setOnItemLongClickListener(listener);
setOnItemSelectedListener(listener);
setOnScrollListener(listener);
Example of Listener
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Do Something
}
});
Example of Listener
List View ที่เกิด Event
View ที่เกิด Event
แถวที่เกิด Event
ID ของ Item ที่เกิด Event
parent
view
position
Id
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Do Something
}
});
Example of Listener
Custom
List View
It’s Just a Layout!!
Layout
Layout
Layout
Layout
Layout
Be Better
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
}
The type MyCustomAdapter must implement the inherited abstract method Adapter.getCount()
2 quick fixed available:
Add unimplemented methods
Make type ‘MyCostomAdapter’ abstract
Press ‘F2’ for focus
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
public int getCount() {
return 0;
}
public Object getItem(int position) {
return null;
}
public long getItemId(int position) {
return 0;
}
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
}
Main Methods
getCount จำนวนข้อมูลที่มีทั้งหมด
getItem ดึง Item ในแถวที่ต้องกำร (Item ขึ้นอยู่ประเภทของ Adapter)
getItemId ดึง ID ของ Item ในแถวที่ต้องกำร (ขึ้นอยู่กับ Adapter เช่นกัน)
getView เมื่อ View ในแถวนั้นๆถูกแสดง
What is the getView?
Create Your Layout
Text ViewImage
View
Create Your Layout
Prepare Your Image
Letter A Letter B Letter C Letter D Letter E
Letter F Letter G Letter H Letter I
Layout XML
<?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="wrap_content“
android:padding="10dp"
android:orientation="horizontal“ >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp"
android:background="#FFFFFF" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:padding="10dp"
android:background="#4BACC6" >
Layout XML
<ImageView
android:id="@+id/imageView"
android:layout_width="60dp"
android:layout_height="60dp“
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Text View"
android:textColor="#FFFFFF"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
public MyCustomAdapter(Context context, String[] strName, int[] resImage) {
}
...
...
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
public MyCustomAdapter(Context context, String[] strName, int[] resImage) {
}
...
...
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
public MyCustomAdapter(Context context, String[] strName, int[] resImage) {
this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
...
...
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
public MyCustomAdapter(Context context, String[] strName, int[] resImage) {
this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.strName = strName;
}
...
...
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
public MyCustomAdapter(Context context, String[] strName, int[] resImage) {
this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.strName = strName;
this.resImage = resImage;
}
...
...
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
...
public int getCount() {
return 0;
}
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
...
public int getCount() {
return this.strName.lenght;
}
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
...
public Object getItem(int position) {
return null;
}
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
...
public Object getItem(int position) {
return this.strName[position];
}
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
...
public View getView(int position, View convertView, ViewGroup parent) {
}
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
...
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = this.inflater.inflate(R.layout.listview_layout, parent, false);
}
}
...
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
...
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = this.inflater.inflate(R.layout.listview_layout, parent, false);
}
TextView textView = (TextView)convertView.findViewById(R.id.textView);
textView.setText(this.strName[position]);
....
}
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
...
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = this.inflater.inflate(R.layout.listview_layout, parent, false);
}
TextView textView = (TextView)convertView.findViewById(R.id.textView);
textView.setText(this.strName[position]);
ImageView imageView = (ImageView)convertView.findViewById(R.id.imageView);
imageView.setImageResource(this.resImage[position]);
...
}
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
...
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = this.inflater.inflate(R.layout.listview_layout, parent, false);
}
TextView textView = (TextView)convertView.findViewById(R.id.textView);
textView.setText(this.strName[position]);
ImageView imageView = (ImageView)convertView.findViewById(R.id.imageView);
imageView.setImageResource(this.resImage[position]);
return convertView;
}
}
Custom Your Adapter
public class MyCustomAdapter extends BaseAdapter {
LayoutInflater inflater;
String[] strName;
int[] resImage;
public MyCustomAdapter(Context context, String[] strName, int[] resImage) {
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.strName = strName;
this.resImage = resImage;
}
public int getCount() {
return this.strName.length;
}
public Object getItem(int position) {
return this.strName[position];
}
public long getItemId(int position) {
return 0;
}
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null)
convertView = this.inflater.inflate(R.layout.listview_layout, parent, false);
TextView textView = (TextView)convertView.findViewById(R.id.textView);
textView.setText(this.strName[position]);
ImageView imageView = (ImageView)convertView.findViewById(R.id.imageView);
imageView.setImageResource(this.resImage[position]);
return convertView;
}
}
Get Back to Your Activity
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DDDDDD"
tools:context="${relativePackage}.${activityClass}" >
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:divider="@null"
android:scrollbars="none"
android:scrollingCache="true"
tools:listitem="@layout/listview_layout" />
</RelativeLayout>
Code on Activity
public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
...
}
}
Code on Activity
public class MainActivity extends Activity {
String[] data = { "Letter A", "Letter B", "Letter C", "Letter D",
"Letter E", "Letter F", "Letter G", "Letter H", "Letter I"};
protected void onCreate(Bundle savedInstanceState) {
...
}
}
Code on Activity
public class MainActivity extends Activity {
String[] data = { "Letter A", "Letter B", "Letter C", "Letter D",
"Letter E", "Letter F", "Letter G", "Letter H", "Letter I"};
int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003,
R.drawable.image_004, R.drawable.image_005, R.drawable.image_006,
R.drawable.image_007, R.drawable.image_008, R.drawable.image_009};
protected void onCreate(Bundle savedInstanceState) {
...
}
}
Code on Activity
public class MainActivity extends Activity {
String[] data = { "Letter A", "Letter B", "Letter C", "Letter D",
"Letter E", "Letter F", "Letter G", "Letter H", "Letter I"};
int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003,
R.drawable.image_004, R.drawable.image_005, R.drawable.image_006,
R.drawable.image_007, R.drawable.image_008, R.drawable.image_009};
protected void onCreate(Bundle savedInstanceState) {
...
}
}
Code on Activity
public class MainActivity extends Activity {
String[] data = { "Letter A", "Letter B", "Letter C", "Letter D",
"Letter E", "Letter F", "Letter G", "Letter H", "Letter I"};
int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003,
R.drawable.image_004, R.drawable.image_005, R.drawable.image_006,
R.drawable.image_007, R.drawable.image_008, R.drawable.image_009};
protected void onCreate(Bundle savedInstanceState) {
...
MyCustomAdapter adapter = new MyCustomAdapter(this, data, resId);
}
}
Code on Activity
public class MainActivity extends Activity {
String[] data = { "Letter A", "Letter B", "Letter C", "Letter D",
"Letter E", "Letter F", "Letter G", "Letter H", "Letter I"};
int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003,
R.drawable.image_004, R.drawable.image_005, R.drawable.image_006,
R.drawable.image_007, R.drawable.image_008, R.drawable.image_009};
protected void onCreate(Bundle savedInstanceState) {
...
MyCustomAdapter adapter = new MyCustomAdapter(this, data, resId);
ListView lv = (ListView)findViewById(R.id.listView);
}
}
Code on Activity
public class MainActivity extends Activity {
String[] data = { "Letter A", "Letter B", "Letter C", "Letter D",
"Letter E", "Letter F", "Letter G", "Letter H", "Letter I"};
int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003,
R.drawable.image_004, R.drawable.image_005, R.drawable.image_006,
R.drawable.image_007, R.drawable.image_008, R.drawable.image_009};
protected void onCreate(Bundle savedInstanceState) {
...
MyCustomAdapter adapter = new MyCustomAdapter(this, data, resId);
ListView lv = (ListView)findViewById(R.id.listView);
lv.setAdapter(adapter);
}
}
Check Your Result
Assignment
1. แสดงข้อมูลอะไรก็ได้ให้อยู่ในรูปดังกล่ำว เช่น อำหำร เสื้อผ้ำ ฯลฯ
2. ข้อมูลอย่ำงน้อย 15 แถว
3. ประกอบไปด้วยภำพอย่ำงน้อยหนึ่งภำพ (ไม่ต้องใหญ่มำก)
ตัวหนังสือสองตำแหน่งที่แสดงข้อควำมต่ำงกันในแต่ละแถว
4. เก็บข้อมูลไว้ในโค๊ดแบบที่ผ่ำนมำทั้งหมดก็ได้
5. ถ้ำทำได้ ให้ลองเปลี่ยนไปเก็บข้อมูลไว้ในฐำนข้อมูล
ส่วนไฟล์ภำพเก็บไว้ในโฟลเดอร์ assets
แล้วเก็บ Path ของภำพลงในฐำนข้อมูลแทน
Hint
Image View (ScaleType CenterCrop)
Relative Layout
Horizontal Linear Layout (Background #3F000000)
Text View (Weight 1, Width 0dp) Text View
Ad

More Related Content

What's hot (20)

DynamicRecord Presentation
DynamicRecord PresentationDynamicRecord Presentation
DynamicRecord Presentation
linoj
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
Ahsanul Karim
 
List Views
List ViewsList Views
List Views
Ahsanul Karim
 
Android styles and themes
Android styles and themesAndroid styles and themes
Android styles and themes
Sourabh Sahu
 
Android ListView and Custom ListView
Android ListView and Custom ListView Android ListView and Custom ListView
Android ListView and Custom ListView
Sourabh Sahu
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)
Tâm
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
Diego Grancini
 
EAV Sytem- Magento EAV Model
EAV Sytem- Magento EAV ModelEAV Sytem- Magento EAV Model
EAV Sytem- Magento EAV Model
Khoa Truong Dinh
 
Adrotator in asp
Adrotator in aspAdrotator in asp
Adrotator in asp
Sireesh K
 
Implementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord modelsImplementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord models
Kostyantyn Stepanyuk
 
AutocompleteTextView And MultiAutoCompleteTextView
AutocompleteTextView And MultiAutoCompleteTextViewAutocompleteTextView And MultiAutoCompleteTextView
AutocompleteTextView And MultiAutoCompleteTextView
Sourabh Sahu
 
OData RESTful implementation
OData RESTful implementationOData RESTful implementation
OData RESTful implementation
Hari Wiz
 
Java Generics wildcards
Java Generics wildcardsJava Generics wildcards
Java Generics wildcards
Kohei Nozaki
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
rostislav
 
Salesforce meetup | Custom document generation
Salesforce meetup | Custom document generationSalesforce meetup | Custom document generation
Salesforce meetup | Custom document generation
Accenture Hungary
 
form view
form viewform view
form view
AbiMurugan2
 
Salesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web ComponentSalesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web Component
Accenture Hungary
 
Isotope.js
Isotope.jsIsotope.js
Isotope.js
Sem Gebresilassie
 
as400 built in function-list
as400 built in function-listas400 built in function-list
as400 built in function-list
aminem_mp
 
Create an android app for database creation using.pptx
Create an android app for database creation using.pptxCreate an android app for database creation using.pptx
Create an android app for database creation using.pptx
vishal choudhary
 
DynamicRecord Presentation
DynamicRecord PresentationDynamicRecord Presentation
DynamicRecord Presentation
linoj
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
Ahsanul Karim
 
Android styles and themes
Android styles and themesAndroid styles and themes
Android styles and themes
Sourabh Sahu
 
Android ListView and Custom ListView
Android ListView and Custom ListView Android ListView and Custom ListView
Android ListView and Custom ListView
Sourabh Sahu
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)
Tâm
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
Diego Grancini
 
EAV Sytem- Magento EAV Model
EAV Sytem- Magento EAV ModelEAV Sytem- Magento EAV Model
EAV Sytem- Magento EAV Model
Khoa Truong Dinh
 
Adrotator in asp
Adrotator in aspAdrotator in asp
Adrotator in asp
Sireesh K
 
Implementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord modelsImplementation of EAV pattern for ActiveRecord models
Implementation of EAV pattern for ActiveRecord models
Kostyantyn Stepanyuk
 
AutocompleteTextView And MultiAutoCompleteTextView
AutocompleteTextView And MultiAutoCompleteTextViewAutocompleteTextView And MultiAutoCompleteTextView
AutocompleteTextView And MultiAutoCompleteTextView
Sourabh Sahu
 
OData RESTful implementation
OData RESTful implementationOData RESTful implementation
OData RESTful implementation
Hari Wiz
 
Java Generics wildcards
Java Generics wildcardsJava Generics wildcards
Java Generics wildcards
Kohei Nozaki
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
rostislav
 
Salesforce meetup | Custom document generation
Salesforce meetup | Custom document generationSalesforce meetup | Custom document generation
Salesforce meetup | Custom document generation
Accenture Hungary
 
Salesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web ComponentSalesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web Component
Accenture Hungary
 
as400 built in function-list
as400 built in function-listas400 built in function-list
as400 built in function-list
aminem_mp
 
Create an android app for database creation using.pptx
Create an android app for database creation using.pptxCreate an android app for database creation using.pptx
Create an android app for database creation using.pptx
vishal choudhary
 

Viewers also liked (20)

Android tutorial points
Android tutorial pointsAndroid tutorial points
Android tutorial points
bsb_2209
 
Android development - ListView & Adapter
Android development - ListView & AdapterAndroid development - ListView & Adapter
Android development - ListView & Adapter
Lope Emano
 
Mengakses data dari database my sql di listview dengan json
Mengakses data dari database my sql di listview dengan jsonMengakses data dari database my sql di listview dengan json
Mengakses data dari database my sql di listview dengan json
Fanfandi Syahsyahsyah
 
Adapter & ListView & ExpandalbeListView
Adapter & ListView & ExpandalbeListViewAdapter & ListView & ExpandalbeListView
Adapter & ListView & ExpandalbeListView
Yuki Anzai
 
Understanding Android Handling of Touch Events
Understanding Android Handling of Touch EventsUnderstanding Android Handling of Touch Events
Understanding Android Handling of Touch Events
jensmohr
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
Kumar
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
Soham Patel
 
Android custom listview
Android custom listviewAndroid custom listview
Android custom listview
parmistech
 
Android Data Persistence
Android Data PersistenceAndroid Data Persistence
Android Data Persistence
Romain Rochegude
 
Post-PC: Geolocation & Maps in the Android Ecosystem
Post-PC: Geolocation & Maps in the Android EcosystemPost-PC: Geolocation & Maps in the Android Ecosystem
Post-PC: Geolocation & Maps in the Android Ecosystem
Michael Genkin
 
Whats new in Android Development Tools @ I/O Rewind Bangkok
Whats new in Android Development Tools @ I/O Rewind BangkokWhats new in Android Development Tools @ I/O Rewind Bangkok
Whats new in Android Development Tools @ I/O Rewind Bangkok
Somkiat Khitwongwattana
 
Interface Design for Mobile Application
Interface Design for Mobile ApplicationInterface Design for Mobile Application
Interface Design for Mobile Application
Somkiat Khitwongwattana
 
What's new in Google Play Services @ I/O Rewind Bangkok
What's new in Google Play Services @ I/O Rewind BangkokWhat's new in Google Play Services @ I/O Rewind Bangkok
What's new in Google Play Services @ I/O Rewind Bangkok
Somkiat Khitwongwattana
 
Session 2- day 3
Session 2- day 3Session 2- day 3
Session 2- day 3
Vivek Bhusal
 
Android Custom view
Android Custom view Android Custom view
Android Custom view
Theodore(Yongbin) Cha
 
Persistence in Android
Persistence in AndroidPersistence in Android
Persistence in Android
ma-polimi
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
Christian Melchior
 
Google android Activity lifecycle
Google android Activity lifecycle Google android Activity lifecycle
Google android Activity lifecycle
University of Potsdam
 
Smart Lock for Password @ Game DevFest Bangkok 2015
Smart Lock for Password @ Game DevFest Bangkok 2015Smart Lock for Password @ Game DevFest Bangkok 2015
Smart Lock for Password @ Game DevFest Bangkok 2015
Somkiat Khitwongwattana
 
Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2
Vinaykumar Hebballi
 
Android tutorial points
Android tutorial pointsAndroid tutorial points
Android tutorial points
bsb_2209
 
Android development - ListView & Adapter
Android development - ListView & AdapterAndroid development - ListView & Adapter
Android development - ListView & Adapter
Lope Emano
 
Mengakses data dari database my sql di listview dengan json
Mengakses data dari database my sql di listview dengan jsonMengakses data dari database my sql di listview dengan json
Mengakses data dari database my sql di listview dengan json
Fanfandi Syahsyahsyah
 
Adapter & ListView & ExpandalbeListView
Adapter & ListView & ExpandalbeListViewAdapter & ListView & ExpandalbeListView
Adapter & ListView & ExpandalbeListView
Yuki Anzai
 
Understanding Android Handling of Touch Events
Understanding Android Handling of Touch EventsUnderstanding Android Handling of Touch Events
Understanding Android Handling of Touch Events
jensmohr
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
Kumar
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
Soham Patel
 
Android custom listview
Android custom listviewAndroid custom listview
Android custom listview
parmistech
 
Post-PC: Geolocation & Maps in the Android Ecosystem
Post-PC: Geolocation & Maps in the Android EcosystemPost-PC: Geolocation & Maps in the Android Ecosystem
Post-PC: Geolocation & Maps in the Android Ecosystem
Michael Genkin
 
Whats new in Android Development Tools @ I/O Rewind Bangkok
Whats new in Android Development Tools @ I/O Rewind BangkokWhats new in Android Development Tools @ I/O Rewind Bangkok
Whats new in Android Development Tools @ I/O Rewind Bangkok
Somkiat Khitwongwattana
 
What's new in Google Play Services @ I/O Rewind Bangkok
What's new in Google Play Services @ I/O Rewind BangkokWhat's new in Google Play Services @ I/O Rewind Bangkok
What's new in Google Play Services @ I/O Rewind Bangkok
Somkiat Khitwongwattana
 
Persistence in Android
Persistence in AndroidPersistence in Android
Persistence in Android
ma-polimi
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
Christian Melchior
 
Smart Lock for Password @ Game DevFest Bangkok 2015
Smart Lock for Password @ Game DevFest Bangkok 2015Smart Lock for Password @ Game DevFest Bangkok 2015
Smart Lock for Password @ Game DevFest Bangkok 2015
Somkiat Khitwongwattana
 
Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2
Vinaykumar Hebballi
 
Ad

Similar to ListView and Custom ListView on Android Development [Thai] (20)

chp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptxchp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptx
Good490110
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
Mohammad Shaker
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_list
Vlad Kolesnyk
 
Chapter 5 - Layouts
Chapter 5 - LayoutsChapter 5 - Layouts
Chapter 5 - Layouts
Sittiphol Phanvilai
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
baabtra.com - No. 1 supplier of quality freshers
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
Mario Jorge Pereira
 
Advance Android application development workshop day 2
Advance Android application development workshop day 2Advance Android application development workshop day 2
Advance Android application development workshop day 2
cresco
 
Tips & Tricks to spice up your Android app
Tips & Tricks to spice up your Android appTips & Tricks to spice up your Android app
Tips & Tricks to spice up your Android app
Jérémie Laval
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_list
Vlad Kolesnyk
 
Anko試食会
Anko試食会Anko試食会
Anko試食会
susan335
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
Prajyot Mainkar
 
Data binding 入門淺談
Data binding 入門淺談Data binding 入門淺談
Data binding 入門淺談
awonwon
 
Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011
Johan Nilsson
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
Brenda Cook
 
android layouts
android layoutsandroid layouts
android layouts
Deepa Rani
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - Components
Visual Engineering
 
android design pattern
android design patternandroid design pattern
android design pattern
Lucas Xu
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Android UI Development
Android UI DevelopmentAndroid UI Development
Android UI Development
Jussi Pohjolainen
 
Adapter and adapter views that are used in android
Adapter and adapter views that are used in androidAdapter and adapter views that are used in android
Adapter and adapter views that are used in android
JinalBhagat2
 
chp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptxchp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptx
Good490110
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_list
Vlad Kolesnyk
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
Mario Jorge Pereira
 
Advance Android application development workshop day 2
Advance Android application development workshop day 2Advance Android application development workshop day 2
Advance Android application development workshop day 2
cresco
 
Tips & Tricks to spice up your Android app
Tips & Tricks to spice up your Android appTips & Tricks to spice up your Android app
Tips & Tricks to spice up your Android app
Jérémie Laval
 
Android tutorials8 todo_list
Android tutorials8 todo_listAndroid tutorials8 todo_list
Android tutorials8 todo_list
Vlad Kolesnyk
 
Anko試食会
Anko試食会Anko試食会
Anko試食会
susan335
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
Prajyot Mainkar
 
Data binding 入門淺談
Data binding 入門淺談Data binding 入門淺談
Data binding 入門淺談
awonwon
 
Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011
Johan Nilsson
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
Brenda Cook
 
android layouts
android layoutsandroid layouts
android layouts
Deepa Rani
 
Workshop 25: React Native - Components
Workshop 25: React Native - ComponentsWorkshop 25: React Native - Components
Workshop 25: React Native - Components
Visual Engineering
 
android design pattern
android design patternandroid design pattern
android design pattern
Lucas Xu
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Adapter and adapter views that are used in android
Adapter and adapter views that are used in androidAdapter and adapter views that are used in android
Adapter and adapter views that are used in android
JinalBhagat2
 
Ad

More from Somkiat Khitwongwattana (14)

What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022
Somkiat Khitwongwattana
 
Canvas API in Android
Canvas API in AndroidCanvas API in Android
Canvas API in Android
Somkiat Khitwongwattana
 
Get Ready for Target SDK Version 29 and 30
Get Ready for Target SDK Version 29 and 30Get Ready for Target SDK Version 29 and 30
Get Ready for Target SDK Version 29 and 30
Somkiat Khitwongwattana
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
Somkiat Khitwongwattana
 
New things that android developer should not miss in 2019
New things that android developer should not miss in 2019New things that android developer should not miss in 2019
New things that android developer should not miss in 2019
Somkiat Khitwongwattana
 
Architecture Components In Real Life Season 2
Architecture Components In Real Life Season 2Architecture Components In Real Life Season 2
Architecture Components In Real Life Season 2
Somkiat Khitwongwattana
 
Bitmap management like a boss
Bitmap management like a bossBitmap management like a boss
Bitmap management like a boss
Somkiat Khitwongwattana
 
Android Architecture Component in Real Life
Android Architecture Component in Real LifeAndroid Architecture Component in Real Life
Android Architecture Component in Real Life
Somkiat Khitwongwattana
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Somkiat Khitwongwattana
 
Deep Dive Into Repository - Android Architecture Components
Deep Dive Into Repository - Android Architecture ComponentsDeep Dive Into Repository - Android Architecture Components
Deep Dive Into Repository - Android Architecture Components
Somkiat Khitwongwattana
 
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
Somkiat Khitwongwattana
 
What's new in Android O @ Google I/O Extended Bangkok 2017
What's new in Android O @ Google I/O Extended Bangkok 2017What's new in Android O @ Google I/O Extended Bangkok 2017
What's new in Android O @ Google I/O Extended Bangkok 2017
Somkiat Khitwongwattana
 
Pokemon GO 101@Nextzy
Pokemon GO 101@NextzyPokemon GO 101@Nextzy
Pokemon GO 101@Nextzy
Somkiat Khitwongwattana
 
Advance Android Layout Walkthrough
Advance Android Layout WalkthroughAdvance Android Layout Walkthrough
Advance Android Layout Walkthrough
Somkiat Khitwongwattana
 
What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022
Somkiat Khitwongwattana
 
Get Ready for Target SDK Version 29 and 30
Get Ready for Target SDK Version 29 and 30Get Ready for Target SDK Version 29 and 30
Get Ready for Target SDK Version 29 and 30
Somkiat Khitwongwattana
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
Somkiat Khitwongwattana
 
New things that android developer should not miss in 2019
New things that android developer should not miss in 2019New things that android developer should not miss in 2019
New things that android developer should not miss in 2019
Somkiat Khitwongwattana
 
Architecture Components In Real Life Season 2
Architecture Components In Real Life Season 2Architecture Components In Real Life Season 2
Architecture Components In Real Life Season 2
Somkiat Khitwongwattana
 
Android Architecture Component in Real Life
Android Architecture Component in Real LifeAndroid Architecture Component in Real Life
Android Architecture Component in Real Life
Somkiat Khitwongwattana
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Somkiat Khitwongwattana
 
Deep Dive Into Repository - Android Architecture Components
Deep Dive Into Repository - Android Architecture ComponentsDeep Dive Into Repository - Android Architecture Components
Deep Dive Into Repository - Android Architecture Components
Somkiat Khitwongwattana
 
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
Somkiat Khitwongwattana
 
What's new in Android O @ Google I/O Extended Bangkok 2017
What's new in Android O @ Google I/O Extended Bangkok 2017What's new in Android O @ Google I/O Extended Bangkok 2017
What's new in Android O @ Google I/O Extended Bangkok 2017
Somkiat Khitwongwattana
 

Recently uploaded (20)

2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Debunking the Myths behind AI - v1, Carl Dalby
Debunking the Myths behind AI -  v1, Carl DalbyDebunking the Myths behind AI -  v1, Carl Dalby
Debunking the Myths behind AI - v1, Carl Dalby
Association for Project Management
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.
MCH
 
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
TechSoup
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
How to Add Customer Note in Odoo 18 POS - Odoo Slides
How to Add Customer Note in Odoo 18 POS - Odoo SlidesHow to Add Customer Note in Odoo 18 POS - Odoo Slides
How to Add Customer Note in Odoo 18 POS - Odoo Slides
Celine George
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.
MCH
 
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
TechSoup
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
How to Add Customer Note in Odoo 18 POS - Odoo Slides
How to Add Customer Note in Odoo 18 POS - Odoo SlidesHow to Add Customer Note in Odoo 18 POS - Odoo Slides
How to Add Customer Note in Odoo 18 POS - Odoo Slides
Celine George
 

ListView and Custom ListView on Android Development [Thai]

  • 3. What’s List View? • View Group แบบหนึ่งที่ใช้สำหรับแสดงข้อมูล • แสดงข้อมูลบำงอย่ำงที่มีจำนวนหลำยๆชุด • สำมำรถเลื่อนขึ้น-ลงได้ เพื่อดูข้อมูลที่มีทั้งหมด
  • 5. How It Works? Data Adapter ListView
  • 6. What is Adapter? • ตัวกลำงที่จะทำให้ข้อมูลแสดงบน List View หรือ Spinner • จัดข้อมูลลง Layout เพื่อแสดงใน List View หรือ Spinner • Adapter พื้นฐำน : ArrayAdapter, BaseAdapter, CursorAdapter, ListAdapter, SimpleAdapter และอื่นๆ
  • 7. How It Works?DataSet ListView Data 1 + Layout = Row 1 Data 2 + Layout = Row 2 ... Data X + Layout = Row X Adapter
  • 8. How It Works? String[] data = { “Samsung”, “LG”, “Sony”, “Acer”, “Asus”, “Motorola”, “Lenovo”, “Xiaomi”, “OPPO” }; Adapter
  • 9. It’s Just a Layout!!
  • 10. It’s Just a Layout!! Layout Layout Layout Layout Layout
  • 12. Necessary Properties • Margin • Padding • Draw Selector On Top • Cache Color Hint • Divider • Divider Height • Header Dividers Enabled • Footer Dividers Enabled • Choice Mode • Over Scroll Header • Over Scroll Footer • Scrollbars • Scrollbars Style • Scrollbars Always Draw Vertical Track • Duplicate Parent State • Over Scroll Mode • List Selector • ETC
  • 13. Prepare Your Code import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 14. Declare Data Source import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 15. Declare Adapter import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 16. Add Data Source to Adapter import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 17. Declare List View import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 18. Add Adapter to List View import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 20. Redesign Text on List View import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 21. Create Your Own Text <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="20dp" android:text="Text View" android:textSize="20sp" android:textColor="#009999" />
  • 22. Code (Before) import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 23. Code (After) import android.widget.ArrayAdapter; ... String[] data = { “Item 1”, “Item 2”, “Item 3” }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.textview, data); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter);
  • 28. Example of Listener lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Do Something } });
  • 29. Example of Listener List View ที่เกิด Event View ที่เกิด Event แถวที่เกิด Event ID ของ Item ที่เกิด Event parent view position Id lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Do Something } });
  • 32. It’s Just a Layout!! Layout Layout Layout Layout Layout
  • 34. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { ... }
  • 35. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { } The type MyCustomAdapter must implement the inherited abstract method Adapter.getCount() 2 quick fixed available: Add unimplemented methods Make type ‘MyCostomAdapter’ abstract Press ‘F2’ for focus
  • 36. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { public int getCount() { return 0; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } public View getView(int position, View convertView, ViewGroup parent) { return null; } }
  • 37. Main Methods getCount จำนวนข้อมูลที่มีทั้งหมด getItem ดึง Item ในแถวที่ต้องกำร (Item ขึ้นอยู่ประเภทของ Adapter) getItemId ดึง ID ของ Item ในแถวที่ต้องกำร (ขึ้นอยู่กับ Adapter เช่นกัน) getView เมื่อ View ในแถวนั้นๆถูกแสดง
  • 38. What is the getView?
  • 39. Create Your Layout Text ViewImage View
  • 41. Prepare Your Image Letter A Letter B Letter C Letter D Letter E Letter F Letter G Letter H Letter I
  • 42. Layout XML <?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="wrap_content“ android:padding="10dp" android:orientation="horizontal“ > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="10dp" android:background="#FFFFFF" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" android:padding="10dp" android:background="#4BACC6" >
  • 44. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { public MyCustomAdapter(Context context, String[] strName, int[] resImage) { } ... ... ... }
  • 45. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; public MyCustomAdapter(Context context, String[] strName, int[] resImage) { } ... ... ... }
  • 46. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; public MyCustomAdapter(Context context, String[] strName, int[] resImage) { this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } ... ... ... }
  • 47. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; public MyCustomAdapter(Context context, String[] strName, int[] resImage) { this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.strName = strName; } ... ... ... }
  • 48. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; public MyCustomAdapter(Context context, String[] strName, int[] resImage) { this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.strName = strName; this.resImage = resImage; } ... ... ... }
  • 49. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; ... public int getCount() { return 0; } ... }
  • 50. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; ... public int getCount() { return this.strName.lenght; } ... }
  • 51. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; ... public Object getItem(int position) { return null; } ... }
  • 52. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; ... public Object getItem(int position) { return this.strName[position]; } ... }
  • 53. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; ... public View getView(int position, View convertView, ViewGroup parent) { } ... }
  • 54. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; ... public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null) { convertView = this.inflater.inflate(R.layout.listview_layout, parent, false); } } ... }
  • 55. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { ... public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null) { convertView = this.inflater.inflate(R.layout.listview_layout, parent, false); } TextView textView = (TextView)convertView.findViewById(R.id.textView); textView.setText(this.strName[position]); .... } }
  • 56. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { ... public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null) { convertView = this.inflater.inflate(R.layout.listview_layout, parent, false); } TextView textView = (TextView)convertView.findViewById(R.id.textView); textView.setText(this.strName[position]); ImageView imageView = (ImageView)convertView.findViewById(R.id.imageView); imageView.setImageResource(this.resImage[position]); ... } }
  • 57. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { ... public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null) { convertView = this.inflater.inflate(R.layout.listview_layout, parent, false); } TextView textView = (TextView)convertView.findViewById(R.id.textView); textView.setText(this.strName[position]); ImageView imageView = (ImageView)convertView.findViewById(R.id.imageView); imageView.setImageResource(this.resImage[position]); return convertView; } }
  • 58. Custom Your Adapter public class MyCustomAdapter extends BaseAdapter { LayoutInflater inflater; String[] strName; int[] resImage; public MyCustomAdapter(Context context, String[] strName, int[] resImage) { inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.strName = strName; this.resImage = resImage; } public int getCount() { return this.strName.length; } public Object getItem(int position) { return this.strName[position]; } public long getItemId(int position) { return 0; } public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null) convertView = this.inflater.inflate(R.layout.listview_layout, parent, false); TextView textView = (TextView)convertView.findViewById(R.id.textView); textView.setText(this.strName[position]); ImageView imageView = (ImageView)convertView.findViewById(R.id.imageView); imageView.setImageResource(this.resImage[position]); return convertView; } }
  • 59. Get Back to Your Activity <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#DDDDDD" tools:context="${relativePackage}.${activityClass}" > <ListView android:id="@+id/listView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:divider="@null" android:scrollbars="none" android:scrollingCache="true" tools:listitem="@layout/listview_layout" /> </RelativeLayout>
  • 60. Code on Activity public class MainActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { ... } }
  • 61. Code on Activity public class MainActivity extends Activity { String[] data = { "Letter A", "Letter B", "Letter C", "Letter D", "Letter E", "Letter F", "Letter G", "Letter H", "Letter I"}; protected void onCreate(Bundle savedInstanceState) { ... } }
  • 62. Code on Activity public class MainActivity extends Activity { String[] data = { "Letter A", "Letter B", "Letter C", "Letter D", "Letter E", "Letter F", "Letter G", "Letter H", "Letter I"}; int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003, R.drawable.image_004, R.drawable.image_005, R.drawable.image_006, R.drawable.image_007, R.drawable.image_008, R.drawable.image_009}; protected void onCreate(Bundle savedInstanceState) { ... } }
  • 63. Code on Activity public class MainActivity extends Activity { String[] data = { "Letter A", "Letter B", "Letter C", "Letter D", "Letter E", "Letter F", "Letter G", "Letter H", "Letter I"}; int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003, R.drawable.image_004, R.drawable.image_005, R.drawable.image_006, R.drawable.image_007, R.drawable.image_008, R.drawable.image_009}; protected void onCreate(Bundle savedInstanceState) { ... } }
  • 64. Code on Activity public class MainActivity extends Activity { String[] data = { "Letter A", "Letter B", "Letter C", "Letter D", "Letter E", "Letter F", "Letter G", "Letter H", "Letter I"}; int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003, R.drawable.image_004, R.drawable.image_005, R.drawable.image_006, R.drawable.image_007, R.drawable.image_008, R.drawable.image_009}; protected void onCreate(Bundle savedInstanceState) { ... MyCustomAdapter adapter = new MyCustomAdapter(this, data, resId); } }
  • 65. Code on Activity public class MainActivity extends Activity { String[] data = { "Letter A", "Letter B", "Letter C", "Letter D", "Letter E", "Letter F", "Letter G", "Letter H", "Letter I"}; int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003, R.drawable.image_004, R.drawable.image_005, R.drawable.image_006, R.drawable.image_007, R.drawable.image_008, R.drawable.image_009}; protected void onCreate(Bundle savedInstanceState) { ... MyCustomAdapter adapter = new MyCustomAdapter(this, data, resId); ListView lv = (ListView)findViewById(R.id.listView); } }
  • 66. Code on Activity public class MainActivity extends Activity { String[] data = { "Letter A", "Letter B", "Letter C", "Letter D", "Letter E", "Letter F", "Letter G", "Letter H", "Letter I"}; int[] resId = { R.drawable.image_001, R.drawable.image_002, R.drawable.image_003, R.drawable.image_004, R.drawable.image_005, R.drawable.image_006, R.drawable.image_007, R.drawable.image_008, R.drawable.image_009}; protected void onCreate(Bundle savedInstanceState) { ... MyCustomAdapter adapter = new MyCustomAdapter(this, data, resId); ListView lv = (ListView)findViewById(R.id.listView); lv.setAdapter(adapter); } }
  • 68. Assignment 1. แสดงข้อมูลอะไรก็ได้ให้อยู่ในรูปดังกล่ำว เช่น อำหำร เสื้อผ้ำ ฯลฯ 2. ข้อมูลอย่ำงน้อย 15 แถว 3. ประกอบไปด้วยภำพอย่ำงน้อยหนึ่งภำพ (ไม่ต้องใหญ่มำก) ตัวหนังสือสองตำแหน่งที่แสดงข้อควำมต่ำงกันในแต่ละแถว 4. เก็บข้อมูลไว้ในโค๊ดแบบที่ผ่ำนมำทั้งหมดก็ได้ 5. ถ้ำทำได้ ให้ลองเปลี่ยนไปเก็บข้อมูลไว้ในฐำนข้อมูล ส่วนไฟล์ภำพเก็บไว้ในโฟลเดอร์ assets แล้วเก็บ Path ของภำพลงในฐำนข้อมูลแทน
  • 69. Hint Image View (ScaleType CenterCrop) Relative Layout Horizontal Linear Layout (Background #3F000000) Text View (Weight 1, Width 0dp) Text View