SlideShare a Scribd company logo
1 of 4
Download to read offline
On a cell phone form factor, ONLY the list fragment shows, or the detail fragment shows. Demo
this and clearly describe why it works. On a tablet or foldable, the list and detail are displayed
side by side. There is a bug in the starter project, describe what the defect(s) was(were). You
need to do this even if you build from scratch. Demo this on a large screen format (foldable,
tablet) and describe how it works differently than on a cell phone form factor Compete the
challenge provided in 6.7.1. Demo and describe how it works. Describe another way 6.7 .1 could
be achieved without creating the layout-w600dp file(hint: 6.7 .1 specifies creation of a Layout
for phone in landscape orientation.)
private class Bandadapter (private vat bandList: List( ) i vat layoutinflater - L Layoutinflater,
fren (parent, context) return BandHoldor(layoutinflater, parent) ? override fun
orbineviewHelese(helder: Banaliotder, position: ist) ( vat band = bandListtoosition] hotbec
;olnd(band) potder.iteavien.tag = bandide holder, itenview, setancuchlistener (oncucktistenor) +
override fun getitencount 0 : int 1 return bandList.sire + ) private elass BandHoldec(infloter:
Leyoutinflatec, parent: Viewlicosp?) : orivate vat nanelextviaw textvins Init 1
Create an app using the Primary/Detail pattern. You will provide a responsive app similar to
what is shown here on a cell phone form factor: And, on a foldable form factor: Finally, on a
phone in landscape mode (challenge from section Try 6.7.1) You can build from scratch or start
with the starter project provided in Canvas.
2. Aodralathanifent umi val band = baadlistiposifion] holder bind (band) botden.iteuviow.tog w
band. 20 holder , itenViow, setonclickistener (ancticklistener) sverride fun petitencount (): Int if
return bandist.aize 1) private olass Bandfolder (inflatec: Layoutinflater, parant: YiewGroupr) :
private vat nanefextvirw: Textvien indt 4 fun bind(colar: Catar) 1 naberextview, text = cotor, tant
package edu.piednont. cs. fragstuff import android, content. Context Netass Colochepositony 1
//3 ctass Cotoriepository private constructor(context: Context) if var colorlist: Nutabletistecplors
= autabletistofo) coepanion object 1 private var instance: Cotorfepository? = nutt fun
getinstance(context: Context) : Cotorkepository 1 if (instance ai nutt) i instance *
colorRedository (context) return instancell 1. init 1 val bands = context, reseurces,
getstringArroy (R,array, celecs) val descriptions = context, resources-getstmingAfroy (R. array.
desceiations) for ( i in bands, indices) i cotorlist, add (Color ( igi 1,1 , Dands[1], deseriptions [1])
)
s1.. cin: (4). Stin. erextrieons ef.. andcofd:Layout, height " "notch_parent"-., ch
android:text="getring/helto_olabk_fragment" /sw. si- endeoidiorientotions"verticat*... 4) -..
androidapedainge"sedp" caedroiax, censtraintlayout. widget, Constraintlayout selna:app
*hetp://achesas android, eos/agk/ras-aute? andreididen"endo/iten_tist,oantainer" andreid:
Lyout_nidth" "aatch_parent" androstelsyout_heightereatch, perent"s? candrosdx, recyclerviea,
widget, Recyoterview android:1du"piddoand_Lst"
babdtinchass - DetailFragment,kt [PrimaryDetailColorsFRagmentLikediandsinClass.app.main]
As Oetalifragment kt Androblevintenteres Af Coloch if Detaifragment kt In tragmentedetar 17
Get thit band to froa the frogsent arguaents oreugents?. Let { colorId =1t.getInt (
ARG_COLOR_IO) }1/ Gut the setected cotor color = ColorRepository.getInstance (
requireContext O) , getColor(colorid ) 1 override fun oncreateviea(inflater: Layoutinflater,
container: Viesbroup?. savediastancestate: gundie?): Viem 1 if (color 1= nut2) 1 vat
naneTextView = cootVies. findViewByIdeTextViens (A. id. cotor.ngane) nase TextView. fext =
eqlor 11 , nate descriptionfextvient text = colorll. description descriptionTextView,
setBackgroundCotoo 6 }. return rootview )
inport agorouix, appeonpat.apg. Appcenpatactivity inpart androlt, os Aundte 1eport android .05.
Parcel fmpent andrate, os, Parselable inport asdcoiox, aavigattoo, havigation isport
ahdeoldx.navigatioo.fregaent, MavkastFragnent inport androidx, navigatioe. ul.
Apptaeconfiguration inport androidx, navigation, ui. Kavigationi cosstructer (obreet: Parcet) :
this 0 i 1 override fun writeToparcet (garcel: Parcel, flags: Int) t override fon cescribesontents() t
tet t retura 0 1 companios object ceEsTeR : Parcelable.CreatorohaseAotivity i override fun
createFreaparcex(earces: Parced): Maishetivity f retura Kaindetivity (parcet) override fun
newarray(size: int): Arraystainketivity?s if ratuen erroyefnutts (size) ) everride fun
secreate(savedisstanesstate: Bunde?) f. soper; OnCretate(asvotostancestate) setconteotviaw(R,
tayout, astivity sain)
class Folor(var id: Int =0, var nane: String =m, var descrigtion: Steing x"= )
val selectedbandid = ttenviea, toi as int vat args = Bunde() 1/ heplose tist with detorts If
(eetaitfragCantainer aviv 4 // Replece List insth dotultr Y etse 1 1/ Snew dotalts on the right , 1/
Sond berdo to Rosyetervier recvelervisw, adsoter = Handdaoter (bands, oncliekL fstanse) return
pootview peivate clast handhdapter(private vol sandisti Listecotues, Anoveterview.
Adeptenchandstotderso 0 ?
tinjas
PrimaryDetailColorsfRagmentLikeBandsinClass - AndroidManifest.xml
[PrimaryDetailColorsfRagmentLikeBlandsinctass.app.mai Rium =APR
andrafotloydot_height="aoteh_perent"-> abdraid: Layevt_wiethe" natch_pacent" android:
Lorost, heightr"eateh, parent" Sertview stylez" "0stylo/eolerksae" androld: Laveot_eitthe"
weap_econtent" androsd toysut_earginfop=*3269" opertaveut,canstratistins_tatnufor-"parknt"
aens Layeut_canstraintatart_testarter.'parant" appitarovt, tonstraintrop,toresofa"barent*
tobtatestu'coter mane' /h

More Related Content

Similar to On a cell phone form factor, ONLY the list fragment shows, or the .pdf

3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsbabhishekmathuroffici
 
Navigation Architecture Component
Navigation Architecture ComponentNavigation Architecture Component
Navigation Architecture ComponentYasutaka Kawamoto
 
Building android apps with kotlin
Building android apps with kotlinBuilding android apps with kotlin
Building android apps with kotlinShem Magnezi
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom viewsMu Chun Wang
 
Pebble Watch iOS SDK Overview
Pebble Watch iOS SDK OverviewPebble Watch iOS SDK Overview
Pebble Watch iOS SDK OverviewMatthew Morey
 
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+ConFoo
 
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan s.r.o.
 
Kotlin for android developers whats new
Kotlin for android developers whats newKotlin for android developers whats new
Kotlin for android developers whats newSerghii Chaban
 
Building a Mobile App with Sencha Touch
Building a Mobile App with Sencha TouchBuilding a Mobile App with Sencha Touch
Building a Mobile App with Sencha TouchJames Pearce
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersJiaxuan Lin
 

Similar to On a cell phone form factor, ONLY the list fragment shows, or the .pdf (20)

3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
 
Minicurso Android
Minicurso AndroidMinicurso Android
Minicurso Android
 
Navigation Architecture Component
Navigation Architecture ComponentNavigation Architecture Component
Navigation Architecture Component
 
Practical
PracticalPractical
Practical
 
CORE JAVA-2
CORE JAVA-2CORE JAVA-2
CORE JAVA-2
 
Building android apps with kotlin
Building android apps with kotlinBuilding android apps with kotlin
Building android apps with kotlin
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom views
 
Pebble Watch iOS SDK Overview
Pebble Watch iOS SDK OverviewPebble Watch iOS SDK Overview
Pebble Watch iOS SDK Overview
 
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
 
Javalayout
JavalayoutJavalayout
Javalayout
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
eMan Dev Meetup: Kotlin For Android (part 03/03) 18.5.2017
 
Kotlin for android developers whats new
Kotlin for android developers whats newKotlin for android developers whats new
Kotlin for android developers whats new
 
Building a Mobile App with Sencha Touch
Building a Mobile App with Sencha TouchBuilding a Mobile App with Sencha Touch
Building a Mobile App with Sencha Touch
 
Foliumcheatsheet
FoliumcheatsheetFoliumcheatsheet
Foliumcheatsheet
 
Draw2D
Draw2DDraw2D
Draw2D
 
compose_speaker_session.pdf
compose_speaker_session.pdfcompose_speaker_session.pdf
compose_speaker_session.pdf
 
Bean Intro
Bean IntroBean Intro
Bean Intro
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
 
Node.js in 2020
Node.js in 2020Node.js in 2020
Node.js in 2020
 

More from mukeshkumawat551

Our project is a web based application targeting international studen.pdf
Our project is a web based application targeting international studen.pdfOur project is a web based application targeting international studen.pdf
Our project is a web based application targeting international studen.pdfmukeshkumawat551
 
launched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdf
launched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdflaunched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdf
launched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdfmukeshkumawat551
 
Journalize the transactions and the closing entry for net income. .pdf
Journalize the transactions and the closing entry for net income. .pdfJournalize the transactions and the closing entry for net income. .pdf
Journalize the transactions and the closing entry for net income. .pdfmukeshkumawat551
 
JCL incorporated is a major chip manufacturing firm that sells its pr.pdf
JCL incorporated is a major chip manufacturing firm that sells its pr.pdfJCL incorporated is a major chip manufacturing firm that sells its pr.pdf
JCL incorporated is a major chip manufacturing firm that sells its pr.pdfmukeshkumawat551
 
Joumalize the four summary entries on August 31 to record.pdf
Joumalize the four summary entries on August 31 to record.pdfJoumalize the four summary entries on August 31 to record.pdf
Joumalize the four summary entries on August 31 to record.pdfmukeshkumawat551
 
Mary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdf
Mary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdfMary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdf
Mary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdfmukeshkumawat551
 

More from mukeshkumawat551 (6)

Our project is a web based application targeting international studen.pdf
Our project is a web based application targeting international studen.pdfOur project is a web based application targeting international studen.pdf
Our project is a web based application targeting international studen.pdf
 
launched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdf
launched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdflaunched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdf
launched a fusillade of toxic chemin february 2023 that nearly 2 . Th.pdf
 
Journalize the transactions and the closing entry for net income. .pdf
Journalize the transactions and the closing entry for net income. .pdfJournalize the transactions and the closing entry for net income. .pdf
Journalize the transactions and the closing entry for net income. .pdf
 
JCL incorporated is a major chip manufacturing firm that sells its pr.pdf
JCL incorporated is a major chip manufacturing firm that sells its pr.pdfJCL incorporated is a major chip manufacturing firm that sells its pr.pdf
JCL incorporated is a major chip manufacturing firm that sells its pr.pdf
 
Joumalize the four summary entries on August 31 to record.pdf
Joumalize the four summary entries on August 31 to record.pdfJoumalize the four summary entries on August 31 to record.pdf
Joumalize the four summary entries on August 31 to record.pdf
 
Mary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdf
Mary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdfMary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdf
Mary Dvorak organized Mullin Enterprises, Inc., in January 2019. The .pdf
 

Recently uploaded

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

On a cell phone form factor, ONLY the list fragment shows, or the .pdf

  • 1. On a cell phone form factor, ONLY the list fragment shows, or the detail fragment shows. Demo this and clearly describe why it works. On a tablet or foldable, the list and detail are displayed side by side. There is a bug in the starter project, describe what the defect(s) was(were). You need to do this even if you build from scratch. Demo this on a large screen format (foldable, tablet) and describe how it works differently than on a cell phone form factor Compete the challenge provided in 6.7.1. Demo and describe how it works. Describe another way 6.7 .1 could be achieved without creating the layout-w600dp file(hint: 6.7 .1 specifies creation of a Layout for phone in landscape orientation.)
  • 2. private class Bandadapter (private vat bandList: List( ) i vat layoutinflater - L Layoutinflater, fren (parent, context) return BandHoldor(layoutinflater, parent) ? override fun orbineviewHelese(helder: Banaliotder, position: ist) ( vat band = bandListtoosition] hotbec ;olnd(band) potder.iteavien.tag = bandide holder, itenview, setancuchlistener (oncucktistenor) + override fun getitencount 0 : int 1 return bandList.sire + ) private elass BandHoldec(infloter: Leyoutinflatec, parent: Viewlicosp?) : orivate vat nanelextviaw textvins Init 1 Create an app using the Primary/Detail pattern. You will provide a responsive app similar to what is shown here on a cell phone form factor: And, on a foldable form factor: Finally, on a phone in landscape mode (challenge from section Try 6.7.1) You can build from scratch or start with the starter project provided in Canvas. 2. Aodralathanifent umi val band = baadlistiposifion] holder bind (band) botden.iteuviow.tog w band. 20 holder , itenViow, setonclickistener (ancticklistener) sverride fun petitencount (): Int if return bandist.aize 1) private olass Bandfolder (inflatec: Layoutinflater, parant: YiewGroupr) : private vat nanefextvirw: Textvien indt 4 fun bind(colar: Catar) 1 naberextview, text = cotor, tant package edu.piednont. cs. fragstuff import android, content. Context Netass Colochepositony 1 //3 ctass Cotoriepository private constructor(context: Context) if var colorlist: Nutabletistecplors = autabletistofo) coepanion object 1 private var instance: Cotorfepository? = nutt fun getinstance(context: Context) : Cotorkepository 1 if (instance ai nutt) i instance * colorRedository (context) return instancell 1. init 1 val bands = context, reseurces, getstringArroy (R,array, celecs) val descriptions = context, resources-getstmingAfroy (R. array. desceiations) for ( i in bands, indices) i cotorlist, add (Color ( igi 1,1 , Dands[1], deseriptions [1]) )
  • 3. s1.. cin: (4). Stin. erextrieons ef.. andcofd:Layout, height " "notch_parent"-., ch android:text="getring/helto_olabk_fragment" /sw. si- endeoidiorientotions"verticat*... 4) -.. androidapedainge"sedp" caedroiax, censtraintlayout. widget, Constraintlayout selna:app *hetp://achesas android, eos/agk/ras-aute? andreididen"endo/iten_tist,oantainer" andreid: Lyout_nidth" "aatch_parent" androstelsyout_heightereatch, perent"s? candrosdx, recyclerviea, widget, Recyoterview android:1du"piddoand_Lst" babdtinchass - DetailFragment,kt [PrimaryDetailColorsFRagmentLikediandsinClass.app.main] As Oetalifragment kt Androblevintenteres Af Coloch if Detaifragment kt In tragmentedetar 17 Get thit band to froa the frogsent arguaents oreugents?. Let { colorId =1t.getInt ( ARG_COLOR_IO) }1/ Gut the setected cotor color = ColorRepository.getInstance ( requireContext O) , getColor(colorid ) 1 override fun oncreateviea(inflater: Layoutinflater, container: Viesbroup?. savediastancestate: gundie?): Viem 1 if (color 1= nut2) 1 vat naneTextView = cootVies. findViewByIdeTextViens (A. id. cotor.ngane) nase TextView. fext = eqlor 11 , nate descriptionfextvient text = colorll. description descriptionTextView, setBackgroundCotoo 6 }. return rootview ) inport agorouix, appeonpat.apg. Appcenpatactivity inpart androlt, os Aundte 1eport android .05. Parcel fmpent andrate, os, Parselable inport asdcoiox, aavigattoo, havigation isport ahdeoldx.navigatioo.fregaent, MavkastFragnent inport androidx, navigatioe. ul. Apptaeconfiguration inport androidx, navigation, ui. Kavigationi cosstructer (obreet: Parcet) : this 0 i 1 override fun writeToparcet (garcel: Parcel, flags: Int) t override fon cescribesontents() t tet t retura 0 1 companios object ceEsTeR : Parcelable.CreatorohaseAotivity i override fun createFreaparcex(earces: Parced): Maishetivity f retura Kaindetivity (parcet) override fun newarray(size: int): Arraystainketivity?s if ratuen erroyefnutts (size) ) everride fun secreate(savedisstanesstate: Bunde?) f. soper; OnCretate(asvotostancestate) setconteotviaw(R, tayout, astivity sain) class Folor(var id: Int =0, var nane: String =m, var descrigtion: Steing x"= ) val selectedbandid = ttenviea, toi as int vat args = Bunde() 1/ heplose tist with detorts If (eetaitfragCantainer aviv 4 // Replece List insth dotultr Y etse 1 1/ Snew dotalts on the right , 1/ Sond berdo to Rosyetervier recvelervisw, adsoter = Handdaoter (bands, oncliekL fstanse) return pootview peivate clast handhdapter(private vol sandisti Listecotues, Anoveterview. Adeptenchandstotderso 0 ?
  • 4. tinjas PrimaryDetailColorsfRagmentLikeBandsinClass - AndroidManifest.xml [PrimaryDetailColorsfRagmentLikeBlandsinctass.app.mai Rium =APR andrafotloydot_height="aoteh_perent"-> abdraid: Layevt_wiethe" natch_pacent" android: Lorost, heightr"eateh, parent" Sertview stylez" "0stylo/eolerksae" androld: Laveot_eitthe" weap_econtent" androsd toysut_earginfop=*3269" opertaveut,canstratistins_tatnufor-"parknt" aens Layeut_canstraintatart_testarter.'parant" appitarovt, tonstraintrop,toresofa"barent* tobtatestu'coter mane' /h