Main activity layout file
The layout file for the main activity, activity_main.xml
is pretty simple. All it contains is the WearableListView
component defined in the layout. As we mentioned earlier, the WearableListView
component is an optimized version of the ListView
method that is suitable for small screen devices. It handles all the scrolling and transitions needed while scrolling:
<?xml version="1.0" encoding="utf-8"?><android.support.wearable.view.WearableListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/action_list" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="none" android:dividerHeight="0dp"/>
When you launch the app using an Android Wear emulator, you should see the app listed with a custom launch icon, as shown in the following screenshot. Please note the icons for various device resolutions are placed in the app/src/main/res/mipmap-*
folders: