Fragments vs. CustomViews

Fragments vs. CustomViews

A quick talk showing the pros of use CustomViews instead Fragments to create our Android apps

Jorge Garrido

January 30, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

15 slides
  1. #BADGlightningTalks 2018 Manual instantiation MyFragment fragment = MyFragment.newInstance(index); FragmentTransaction ft

    = getFragmentManager().beginTransaction(); ft.replace(R.id.parent, fragment); ft.commit(); MyCustomView customView = new MyCustomView(context); parentView.removeAllViews(); parentView.add(customView);
  2. #BADGlightningTalks 2018 Embedding in xml <fragment android:name="my.package.MyFragment" android:id="@+id/my_fragment" android:layout_width="match_parent" android:layout_height="match_parent"

    /> <my.package.MyCustomView android:id="@+id/my_view" android:layout_width="match_parent" android:layout_height="match_parent" />
  3. #BADGlightningTalks 2018 Create your own! Or use a router library

    like: Kartographer, Cicerone, Naviganto, Mortar, there are many!

More Decks by Jorge Garrido

Other Decks in Programming