action

Layar tutorial part 2

SDK Version: 
M3

The first tutorial, we went through the steps to create a simple layer.
In this tutorial, we are going to explain how to include actions in this layer

Mastering Android Widget Development - Part5 - Final

SDK Version: 
M3

In this last part of the tutorial we will implement buttons to the appWidget, which will directly interact with the appWidget functionality.
We will have 2 buttons, a plus button to add one more day to the target date, and a minus button to decrease time left by one day.

First add the buttons to the countdownwidget.xml layout:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout
  3.   xmlns:android="http://schemas.android.com/apk/res/android"
  4.   android:layout_width="wrap_content"
  5.   android:layout_height="wrap_content" android:orientation="vertical">
  6.  
  7. <TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Time left"></TextView>
  8. <LinearLayout android:id="@+id/LinearLayout01"; android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal">

Syndicate content