O'Reilly logo

Building Android UIs with Custom Views by Raimon Ràfols Montané

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

Background lines and details

Let's add it into an Android project to see the results. First let's create a very simple layout file:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    xmlns:app="http://schemas.android.com/apk/res-auto"    tools:context="com.rrafols.packt.chart.MainActivity">    <com.rrafols.packt.chart.Chart        android:layout_margin="16dp"        android:padding="10dp"        android:id="@+id/chart_view"        android:layout_width="match_parent"        android:layout_height="match_parent" /></LinearLayout>

Let's also create an empty activity that will only set this layout file as the ...

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