Swift: Firebase 3 – How to Load Entire Chat Log per User (Ep 12)

my review point is 8/10

https://youtu.be/azFjJZxZP6M?t=1m40s   table view에서 하나의 row를 선택한경우 ( didSelectRowAtIndexPath ) 

https://youtu.be/azFjJZxZP6M?t=10m38s   UICollectionViewDelegateFlowLayout 사용하여 collection view 스타일 수정하기 

https://youtu.be/azFjJZxZP6M?t=10m45s   collection view cell size 설정하기 

https://youtu.be/azFjJZxZP6M?t=12m   firebase에서 여러개의 데이터를 가져오는 방법

https://youtu.be/azFjJZxZP6M   collection view cell 을 만드는 방법

https://youtu.be/azFjJZxZP6M?t=22m22s   collection view 에 cell view를 등록하는 방법

https://youtu.be/azFjJZxZP6M?t=27m40s   collection view 를 드래그 해서 바운스 되게 하는 작업

Swift: FB Messenger – How to create a Tab Bar Menu, Cell Highlights, NSDate formats

my review point is 9/10


https://youtu.be/VgvruodC9BU?t=2m15s   tabbar controller 추가하기 

https://youtu.be/VgvruodC9BU?t=10m25s   cell highlight (사용자가 cell선택시 하이라이트 되게한다. highlighted 프로퍼티를 이용한다.)

https://youtu.be/VgvruodC9BU?t=14m45s   date format 변경하기 

my review point is 9/10

chatting app의 메시지 표시창 구성의 기본을 알수 있음.

https://youtu.be/hz1h_ColGy0?t=5m29s   NSDate()을 이용한 시간 변경

https://youtu.be/hz1h_ColGy0?t=7m   core data sorting

https://youtu.be/hz1h_ColGy0?t=8m   core data predicate 

https://youtu.be/hz1h_ColGy0?t=14m45s   array sort (using ‘compare’ method )

https://youtu.be/hz1h_ColGy0?t=17m10s   collection view controller에서 cell을 선택한 경우 다른 controller로 연결되게 하는 작업 (programticallay)

https://youtu.be/hz1h_ColGy0?t=20m10s   collection view 내용, 모양 변경 (programmatically)

my review point is 9/10

chatting app의 메시지 표시창 구성의 기본을 알수 있음.

https://youtu.be/hz1h_ColGy0?t=5m29s   NSDate()을 이용한 시간 변경

https://youtu.be/hz1h_ColGy0?t=7m   core data sorting

https://youtu.be/hz1h_ColGy0?t=8m   core data predicate 

https://youtu.be/hz1h_ColGy0?t=14m45s   array sort (using ‘compare’ method )

https://youtu.be/hz1h_ColGy0?t=17m10s   collection view controller에서 cell을 선택한 경우 다른 controller로 연결되게 하는 작업 (programticallay)

https://youtu.be/hz1h_ColGy0?t=20m10s   collection view 내용, 모양 변경 (programmatically)

original source :http://www.androiddocs.com/training/wearables/notifications/voice-input.html

Receiving Voice Input in a Notification

If you have handheld notifications that include an action to input text, such as reply to an email, it should normally launch an activity on the handheld device to input the text. However, when your notification appears on a wearable, there is no keyboard input, so you can let users dictate a reply or provide pre-defined text messages using RemoteInput.

When users reply with voice or select one of the available messages, the system attaches the text response to the Intentyou specified for the notification action and sends that intent to your handheld app.

Define the Voice Input

To create an action that supports voice input, create an instance of

RemoteInput.Builder

that you can add to your notification action. This class’s constructor accepts a string that the system uses as the key for the voice input, which you’ll later use to retrieve the text of the input in your handheld app.For example, here’s how to create a

RemoteInput

object that provides a custom label for the voice input prompt:

// Key for the string that's delivered in the action's intent
private static final String EXTRA_VOICE_REPLY = "extra_voice_reply";

String replyLabel = getResources().getString(R.string.reply_label);

RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
       .setLabel(replyLabel)
       .build();



Add Pre-defined Text Responses

setChoices()

res/values/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
   <string-array name="reply_choices">
       <item>Yes</item>
       <item>No</item>
       <item>Maybe</item>
   </string-array>
</resources>
public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
...
String replyLabel = getResources().getString(R.string.reply_label);
String[] replyChoices = getResources().getStringArray(R.array.reply_choices);

RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
       .setLabel(replyLabel)
       .setChoices(replyChoices)
       .build();



Add the Voice Input as a Notification Action

// Create an intent for the reply action
Intent replyIntent = new Intent(this, ReplyActivity.class);
PendingIntent replyPendingIntent =
       PendingIntent.getActivity(this, 0, replyIntent,
               PendingIntent.FLAG_UPDATE_CURRENT);

// Create the reply action and add the remote input
NotificationCompat.Action action =
       new NotificationCompat.Action.Builder(R.drawable.ic_reply_icon,
               getString(R.string.label), replyPendingIntent)
               .addRemoteInput(remoteInput)
               .build();

// Build the notification and add the action via WearableExtender
Notification notification =
       new NotificationCompat.Builder(mContext)
               .setSmallIcon(R.drawable.ic_message)
               .setContentTitle(getString(R.string.title))
               .setContentText(getString(R.string.content))
               .extend(new WearableExtender().addAction(action))
               .build();

// Issue the notification
NotificationManagerCompat notificationManager =
       NotificationManagerCompat.from(mContext);
notificationManager.notify(notificationId, notification);

Receiving the Voice Input as a String

(notification은 sync와는 달리 일방통행이라고 하지만 reply action intent를 통해 reply message를 전달 받을수 있다. )

To receive the user’s transcribed message in the activity you declared in the reply action’s intent, call

getResultsFromIntent()

, passing in the “Reply” action’s intent. This method returns a

Bundle

that contains the text response. You can then query the

Bundle

to obtain the response.

Note:

Do not use

Intent.getExtras()

to obtain the voice result, because the voice input is stored as

ClipData

. The

getResultsFromIntent()

method provides a convenient way to receive a character sequence without having to process the

ClipData

yourself.

/**
* Obtain the intent that started this activity by calling
* Activity.getIntent() and pass it into this method to
* get the associated voice input string.
*/

private CharSequence getMessageText(Intent intent) {
   Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
   if (remoteInput != null) {
       return remoteInput.getCharSequence(EXTRA_VOICE_REPLY);
   }
   return null;
}

original source :http://www.androiddocs.com/training/wearables/notifications/voice-input.html

Receiving Voice Input in a Notification

If you have handheld notifications that include an action to input text, such as reply to an email, it should normally launch an activity on the handheld device to input the text. However, when your notification appears on a wearable, there is no keyboard input, so you can let users dictate a reply or provide pre-defined text messages using RemoteInput.

When users reply with voice or select one of the available messages, the system attaches the text response to the Intentyou specified for the notification action and sends that intent to your handheld app.

Define the Voice Input

To create an action that supports voice input, create an instance of

RemoteInput.Builder

that you can add to your notification action. This class’s constructor accepts a string that the system uses as the key for the voice input, which you’ll later use to retrieve the text of the input in your handheld app.For example, here’s how to create a

RemoteInput

object that provides a custom label for the voice input prompt:

// Key for the string that's delivered in the action's intent
private static final String EXTRA_VOICE_REPLY = "extra_voice_reply";

String replyLabel = getResources().getString(R.string.reply_label);

RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
       .setLabel(replyLabel)
       .build();



Add Pre-defined Text Responses

setChoices()

res/values/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
   <string-array name="reply_choices">
       <item>Yes</item>
       <item>No</item>
       <item>Maybe</item>
   </string-array>
</resources>
public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
...
String replyLabel = getResources().getString(R.string.reply_label);
String[] replyChoices = getResources().getStringArray(R.array.reply_choices);

RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
       .setLabel(replyLabel)
       .setChoices(replyChoices)
       .build();



Add the Voice Input as a Notification Action

// Create an intent for the reply action
Intent replyIntent = new Intent(this, ReplyActivity.class);
PendingIntent replyPendingIntent =
       PendingIntent.getActivity(this, 0, replyIntent,
               PendingIntent.FLAG_UPDATE_CURRENT);

// Create the reply action and add the remote input
NotificationCompat.Action action =
       new NotificationCompat.Action.Builder(R.drawable.ic_reply_icon,
               getString(R.string.label), replyPendingIntent)
               .addRemoteInput(remoteInput)
               .build();

// Build the notification and add the action via WearableExtender
Notification notification =
       new NotificationCompat.Builder(mContext)
               .setSmallIcon(R.drawable.ic_message)
               .setContentTitle(getString(R.string.title))
               .setContentText(getString(R.string.content))
               .extend(new WearableExtender().addAction(action))
               .build();

// Issue the notification
NotificationManagerCompat notificationManager =
       NotificationManagerCompat.from(mContext);
notificationManager.notify(notificationId, notification);

Receiving the Voice Input as a String

(notification은 sync와는 달리 일방통행이라고 하지만 reply action intent를 통해 reply message를 전달 받을수 있다. )

To receive the user’s transcribed message in the activity you declared in the reply action’s intent, call

getResultsFromIntent()

, passing in the “Reply” action’s intent. This method returns a

Bundle

that contains the text response. You can then query the

Bundle

to obtain the response.

Note:

Do not use

Intent.getExtras()

to obtain the voice result, because the voice input is stored as

ClipData

. The

getResultsFromIntent()

method provides a convenient way to receive a character sequence without having to process the

ClipData

yourself.

/**
* Obtain the intent that started this activity by calling
* Activity.getIntent() and pass it into this method to
* get the associated voice input string.
*/

private CharSequence getMessageText(Intent intent) {
   Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
   if (remoteInput != null) {
       return remoteInput.getCharSequence(EXTRA_VOICE_REPLY);
   }
   return null;
}