Submit Search
Upload
آموزش ساخت لیست در اندروید - آموزشگاه پارمیس مشهد
•
Download as PPTX, PDF
•
3 likes
•
1,013 views
P
parmistech
Follow
آموزش ساخت لیست در اندروید هدف از ایجاد لیست در اندروید چگونگی کار با لیست ها در اندروید
Read less
Read more
Education
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 10
Download now
Recommended
Software testing
Software testing
Behrouz Bakhtiari
android_test_approach
android_test_approach
Sadegh Saberi
automated+software+testing+tools.pdf
automated+software+testing+tools.pdf
empite
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
Andrii Dzynia
Android custom listview
Android custom listview
parmistech
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
Recommended
Software testing
Software testing
Behrouz Bakhtiari
android_test_approach
android_test_approach
Sadegh Saberi
automated+software+testing+tools.pdf
automated+software+testing+tools.pdf
empite
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
Andrii Dzynia
Android custom listview
Android custom listview
parmistech
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More Related Content
Featured
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
Featured
(20)
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
آموزش ساخت لیست در اندروید - آموزشگاه پارمیس مشهد
1.
یدواندر دری شرسفالیست
یکایجادشزآمو Parmistech.com Ehsan Ghorbannezhad Android Programming - 2014
2.
list_row_selector.xml <?xml version="1.0" encoding="utf-8"?> <selector
xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/list_row_bg" android:state_pressed="false" android:state_selected="false"/> <item android:drawable="@drawable/list_row_bg_hover" android:state_pressed="true"/> <item android:drawable="@drawable/list_row_bg_hover" android:state_pressed="false" android:state_selected="true"/> </selector> فایلیک بریمرورselectorانتخاب هنگام درلیستهایآیتم کردت هایالیتایرب Parmistech.com
3.
<RelativeLayout >
<ImageView android:id="@+id/thumbnail" /> <TextView android:id="@+id/title" /> <TextView android:id="@+id/rating"/> <TextView android:id="@+id/genre" /> <TextView android:id="@+id/releaseYear" /> </RelativeLayout> Parmistech.com
4.
public class MainActivity
extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); List<Movie> movieList = createMovieList(); ListView = (ListView) findViewById(R.id.list); CustomListAdapter adapter = new CustomListAdapter(this, movieList); listView.setAdapter(adapter); } } Parmistech.com
5.
public class CustomListAdapter
extends BaseAdapter { private final Context _context; private final LayoutInflater _ inflater; private List<Movie> _items; } نکته:LayoutInflaterساختن برایسیستمی سرویسیک(کردنپر)یکنوع ازی شViewفایلروی ازxmlمتناظرش. نکته:BaseAdapterمی را ،هایش متدازی بعضیساز پیاده وآنازبردن ارثطریق ازی سفارشآداپتریک ساختامکانکه پایهکالسیکدهد. Parmistech.com
6.
@Override public int getCount()
{ return _items == null ? 0 : items.size(); } @Override public Object getItem(int position) { return items == null ? null : items.get(position); } @Override public long getItemId(int position) { return items == null ? 0 : items.get(position).getId(); } کالساز نچوBaseAdapterلذا بردیمثرامجبوری نویسزبابه4میباشیممتد.مهمتر همهاز مرچهامتد گردد می معرفیبعداسالید درکهاست. نکته:Positionاستلیست درون عنصر موقعیت،میدهد اررقما اختیار در متدهااین در اندرویدکهای.یک،صفرم عنصرمثلنوم غیره یا.نام باکالساین در کهلیستعناصر بهمیتوانیم موقعیتشمارهاینداشتن باماItemsباشیمداشتهی دسترس ،اند شدهتعریف (متدطریقازgetلیستروی بر) Parmistech.com
7.
@Override public View getView(int
position, View convertView, ViewGroup parent) { if (convertView == null) convertView = inflater.inflate(R.layout.list_row, null); // now we can find our item_layout controls - for example: ImageView thumb = (ImageView) convertView.findViewById(R.id.thumbnail); TextView title = (TextView) convertView.findViewById(R.id.title); // whatever we want to bind to our controls - for example : title.setText(item.get(position).getTitle(); return convertView; { مرچها متد یساز پیاده:()getView نکته:convertViewکنید فرضچیست؟15داریدنمایشایربآیتم.لحظههر درشماموبایلصفحه5نمایشمیتواند ار تا دهد.دارندکردناسکرولبه نیازمابقی.متد درgetViewتنها5convertViewمیشودساخته.همیناز لیستمابقیایرب 5میشودعوض تنهاآندروناطالعات کهاینصورت بهمیشود استفادهتا.شرطلذاnullدیگرششم عنصرایرب بودنFalse نداریم مجدد ساختبه نیاز وبرمیگرداند. Parmistech.com
8.
@Override public View getView(int
position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) convertView = inflater.inflate(R.layout.list_row, null); holder = new ViewHolder (); holder.title = (TextView) convertView.findViewById(R.id.title); convertView.setTag(holder); } else holder = (ViewHolder ) view.getTag(); hloder.title.setText(item.get(position).getTitle(); return convertView; { متد تر امندرکا یساز پیاده()getView نکته: دستورsetTagیکینگهدارایربholderدرconvertViewاست شده استفاده خودشبامتناظر.دستورsetTagمتد اریچیزخواستیم هرجاکه استعامی(دیتاتایپیازهرنوع)درviewمیکنیم استفادهنگهداریممان. *باآشنایی ایربViewHolderنمایید مشاهده اربعدیاسالید. Parmistech.com
9.
static class
ViewHolder { TextView title; TextView genre; TextView releaseYear; TextView rating; ImageView thumb; } کالسViewHolder نکته:ViewHolderاستیکسان هاآیتمیهمه قالب چیست؟.بجایما ،قبلمثالطبقاگر15convertView،5میسازیم تا. هر در باید ارچ15ارآیتمآن هایلکنتربارfindهمان ایرب فقطاینکاربجایکنیم؟5میدهیمانجامار کاراین تا.کالسیکاینکارایرب وی سفارشstaticنامبهViewHolderمیسازیم. کالسیفرتعViewHolderمیشودتعریف داخلیبصورت(inner class)کالس بدنهداخل دریعنی CustomLisAdapterمتدازخارجالبته وgetView! Parmistech.com
10.
//inside getView
Animation animation = AnimationUtils.loadAnimation(context, (position > lastPosition ) ? R.anim.up_from_bottom : R.anim.down_from_top); v.startAnimation(animation); lastPosition = pos; متددرGetViewروی بر ارانیمیشن میتوانconvertViewکرد اجرا. نکته:private int lastPosition = -1;کالس ابتدای درارCustomListAdapterکنید اضافه. نکته:up_from_bottomوdown_from_topپسوندباانیمیشن فایل دونامxmlپوشهدرکهآستanimداخل پوشهresگیرد اررقباید. انیمیشنیکاز نمونهیک: <?xml version="1.0" encoding="utf-8"?> <translate android:fromXDelta="90%" android:toXDelta="0%" android:fromYDelta="0%" android:toYDelta="0%" android:duration="400" /> Parmistech.com
Download now