Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kotlin season 1 - Part 12 RecyclerView 소개

TaeHwan
November 09, 2016
27

kotlin season 1 - Part 12 RecyclerView 소개

2016년 유데미 Kotlin 강의를 공개합니다.

영상 : https://www.youtube.com/watch?v=xBvUZy3H-dc

2회 분은 유데미에서 확인 가능합니다.
http://bit.ly/2UpaJUR

TaeHwan

November 09, 2016
Tweet

Transcript

  1. ࢠ೒ ௏٘ח!!! • ࢠ೒ ௏٘ח github ࠳۠஖ : 07-RecyclerView •

    https://github.com/taehwandev/Kotlin-Udemy-Sample/tree/ 07-RecyclerView ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 2
  2. য়ט ೡ ࠗ࠙ • ListView ࣗѐ • RecyclerView ࣗѐ •

    LayoutManager • RecyclerView ࢠ೒ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 3
  3. ListView੄ ੢੼ • Android API 1ࠗఠ ࢎਊ੉ оמ • рױೠ

    ഋక੄ ܻझ౟৬ getView੄ ࣻ੿ਵ۽ ழझథ View ੘ࢿ оמ • ழझథ Viewܳ ੘ࢿೡ ٸ ArrayAdapterਸ ࢎਊೡ ࣻ ੓ਵݴ, ArrayListܳ ӝࠄ੸ਵ۽ ࢎਊೞӝী ߹ب੄ ୊ܻ ࠛ೙ਃ • Header/Footerਸ ӝࠄ੸ਵ۽ ನೣ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 5
  4. ListView੄ ױ੼ • ܻझ౟ীח ೠ ѐ ੉࢚੄ Viewо ೙ਃೠ ҃਋о

    ੓૑݅ ழझథਵ۽ ੘ সೞӝ औ૑ ঋ਺ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 6
  5. ListView੄ ױ੼ • ܻझ౟ীח ೠ ѐ ੉࢚੄ Viewо ೙ਃೠ ҃਋о

    ੓૑݅ ழझథਵ۽ ੘ সೞӝ औ૑ ঋ਺ • ViewHolder ಁఢਸ ъઁ੸ਵ۽ ࢎਊೞ૑ח ঋਵ޲۽ Ҋ࠺ਊ੄ findViewByIdਸ ݒߣ ഐ୹ೞѱ ؽ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 7
  6. ListView੄ ViewHolder ಁఢ੉ ੸ਊغ૑ ঋ਷ ҃਋ @Override public View getView(final

    int position, View convertView, ViewGroup parent) { View rowView = inflater.inflate(R.layout.item_list, null); TextView tv = (TextView) rowView.findViewById(R.id.text); tv.setText(result[position]); return rowView; } ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 8
  7. ListView੄ ViewHolder ಁఢ੉ ੸ਊغ૑ ঋ਷ ҃਋ • getViewо ই੉మ੄ ࣻ݅ఀ

    ഐ୹ • scrollਸ ೡ ٸ݃׮ getViewо زੌೞѱ ഐ୹ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 9
  8. ListView੄ ViewHolder ಁఢ ੸ਊೠ ҃਋ @Override public View getView(final int

    position, View convertView, ViewGroup parent) { if (convertView == null) { rootView = inflater.inflate(R.layout.item_list, null); Holder holder = new Holder(); holder.tv = (TextView) rowView.findViewById(R.id.text); rootView.setTag(viewHolder); } else { rootView = convertView; holder = (Holder) rootView.getTag(); } holder.tv.setText(result[position]); return rootView; } ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 11
  9. ListView੄ ViewHolder ಁఢ ੸ਊೠ ҃਋ • Viewܳ ೠ ߣ݅ ࢤࢿ

    • Ҋ࠺ਊ੄ findViewByIdਸ ݒߣ ഐ୹ೞ૑ ঋѱ ػ׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 12
  10. RecyclerViewח? • Android Lollipopࠗఠ ੸ਊ • API 21ࠗఠ ࢎਊ оמೠ

    RecyclerView৬ v7ࠗఠ ࢎਊ оמೠ Support Libraryо ੓׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 17
  11. RecyclerView ࣗѐ • RecyclerViewח LayoutManagerܳ ా೧ࢲ View Ӓܻח ߑߨਸ ੿

    ੄ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 18
  12. RecyclerView ࣗѐ • RecyclerView.Adapterীࢲ Data੄ ViewHolder ੿੄ী ٮۄࢲ UI о

    ࢶఖغҊ, ੉ܳ ಴അ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 19
  13. LayoutManager • ListViewী ؘ੉ఠܳ ࠁৈ઱ӝ ਤೠ ੿੄ • LinearLayoutManager •

    GridLayoutManager • StaggeredGridLayoutManager • ппਸ ࢚ࣘ߉ই ੿੄ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 21
  14. RecyclerView - ੢੼ • onCreateViewHolderਸ ా೧ࢲ Viewܳ ୭ୡ ೠߣ ࢤࢿ

    • onBindViewHolderਸ ా೧ ই੉మ੄ Viewܳ јन • ই੉మ ܻझ౟ܳ ૒੽ ҳഅೡ ࣻ ੓׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 26
  15. RecyclerView - ױ੼ • ListViewীࢲח Header/Footerਸ ӝࠄਵ۽ ઁҕ • RecyclerViewח

    ViewTypeਸ ੿੄೧ࢲ ૒੽ ҳഅ೧ঠ ೣ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 27
  16. ଵҊ੗ܐ • Creating Lists and Cards • RecyclerView • RecyclerView.Adapter

    • Android ListView ࢎਊೞӝ • Android RecyclerView ࣗѐ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 31
  17. ׮਺਷ • Retrofit ࣗѐ • Flickr API ରࣁ؀ উ٘۽੉٘ ѐߊ

    ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 32