O'Reilly logo

Android Studio Cookbook by Mike van Drongelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Change projections to display KPIs in your app

We can use a different projection and the same observer pattern for displaying some KPIs. Actually that is pretty easy, as we will see in this recipe.

Getting ready

For this recipe, you need to have completed the previous one successfully.

How to do it...

We will continue working on the app from the previous recipe and we will add a new view to display the KPIs:

  1. Open the project you have worked on in the previous recipe.
  2. Add a new layout, fragment_thoughts_kpi.xml:
    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:gravity="center_horizontal" android:padding="16dp" android:layout_height="match_parent"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required