int LEFT_DIAL_COMPLICATION = 0; private static final int RIGHT_DIAL_COMPLICATION = 1; public static final int[] COMPLICATION_IDS = {LEFT_DIAL_COMPLICATION, RIGHT_DIAL_COMPLICATION}; Complication ID
types // Left and right dial supported types. public static final int[][] COMPLICATION_SUPPORTED_TYPES = { {ComplicationData.TYPE_SHORT_TEXT}, {ComplicationData.TYPE_SHORT_TEXT} }; Complication supported types
when there is updated data for a complication id. */ @Override public void onComplicationDataUpdate( int complicationId, ComplicationData complicationData) { Log.d(TAG, "onComplicationDataUpdate() id: " + complicationId); mActiveComplicationDataSparseArray.put(complicationId, complicationData); invalidate(); } ComplicationData receiving
{ // Retrieve or generate your data int randomNumber = (int) Math.floor(Math.random() * 10); String randomNumberText = String.format(Locale.getDefault(), "%d!", randomNumber); Exposing data to complications Called according to update period time
complicationData = new ComplicationData.Builder( ComplicationData.TYPE_SHORT_TEXT) .setShortText(ComplicationText.plainText(randomNumberText)) .build(); break; Exposing data to complications
messages with " + sender) .setContentText("subject") .setSmallIcon(R.drawable.new_message) // 2) set the style to MessagingStyle .setStyle(new NotificationCompat.MessagingStyle( getResources().getString(R.string.reply_name)) .addMessage(messages[0]) .addMessage(messages[1]); Notifications with modern MessagingStyle set MessagingStyle