Swift: Firebase 3 – How to Implement Interactive Keyboard using inputAccessoryView (Ep 15)

my review point is 9/10

https://youtu.be/ky7YRh01by8?t=2m50s   keyboard가 화면에 디스플레이될때 호출되는 hook ( NSNotificationCenter, UIKeyboardWillShowNotification )

https://youtu.be/ky7YRh01by8?t=4m25s   getting keyboard height 

https://youtu.be/ky7YRh01by8?t=5m22s   change textfield location

https://youtu.be/ky7YRh01by8?t=8m42s   add animation ( changing textfield location , animateWithDuration , layoutIfNeeded)

https://youtu.be/ky7YRh01by8?t=10m46s   remove observer of notification ( 이렇게 제거하지 않으면 memory leak의 위험이 있다, viewDidDisappear , UINotificationCenter)

https://youtu.be/ky7YRh01by8?t=13m40s   collection view에서 화면을 아래로 드래그 하는 경우 하단의 키보드도 서서히 밑으로 사라지게 하는 기능을 설정하는 경우 ( 컬렉션뷰obj.keyboardDismissMode = .Interactive )

https://youtu.be/ky7YRh01by8?t=15m14s   customizing 기본 textfield와 그에 따른 view controller의 behavior ( inputAccessoryView ,  canBecomeFirstResoponder)

https://youtu.be/ky7YRh01by8?t=23m50s   화면의 orientation을 바꾸는 경우 view.frame.width는 그 크기가 바뀌지 않는다. 그러나 UIScreen.mainScreen().bounds.width는 변한다. 

자세한 내용은 실제 documentation에서 확인가능  https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-ID28

Advanced Operators

Bitwise Operators

Bitwise NOT OperatorThe bitwise NOT operator (~

Bitwise AND OperatorThe bitwise AND operator (&)

Bitwise OR Operator The bitwise OR operator (|)

Bitwise XOR Operator The bitwise XOR operator, or “exclusive OR operator” (^)

Bitwise Left and Right Shift Operators The bitwise left shift operator (<<) and bitwise right shift operator (>>)

Overflow Operators

  • Overflow addition (&+)
  • Overflow subtraction (&-)
  • Overflow multiplication (&*)

Precedence and Associativity

Operator Methods

Classes and structures can provide their own implementations of existing operators. This is known as overloading the existing operators.

Custom Operators

자세한 내용은 실제 documentation에서 확인가능  https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-ID28

Advanced Operators

Bitwise Operators

Bitwise NOT OperatorThe bitwise NOT operator (~

Bitwise AND OperatorThe bitwise AND operator (&)

Bitwise OR Operator The bitwise OR operator (|)

Bitwise XOR Operator The bitwise XOR operator, or “exclusive OR operator” (^)

Bitwise Left and Right Shift Operators The bitwise left shift operator (<<) and bitwise right shift operator (>>)

Overflow Operators

  • Overflow addition (&+)
  • Overflow subtraction (&-)
  • Overflow multiplication (&*)

Precedence and Associativity

Operator Methods

Classes and structures can provide their own implementations of existing operators. This is known as overloading the existing operators.

Custom Operators

original source:  https://developer.android.com/training/wearables/apps/layouts.html

Create Custom Notifications

ou should create notifications on the phone and let them automatically sync to the wearable.

Note: When creating custom notifications on the watch, you can use the standard notification APIs (API Level 20) instead of the Support Library.

1.Create a layout and set it as the content view for the activity that you want to display.

public void onCreate(Bundle bundle){
   ...
   setContentView(R.layout.notification_activity);
}

 2.in the Android manifest 

For example:

<activity android:name="com.example.MyDisplayActivity"
   android:exported="true"
   android:allowEmbedded="true"
   android:taskAffinity=""
   android:theme="@android:style/Theme.DeviceDefault.Light" />

3.Create a PendingIntent for the activity that you want to display. 

Intent notificationIntent = new Intent(this, NotificationActivity.class);
PendingIntent notificationPendingIntent = PendingIntent.getActivity(
       this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

4.Build a Notification and call setDisplayIntent() providing the PendingIntent. The system uses this PendingIntent to launch the activity when users view your notification.

5.Issue the notification using the notify() method.

Create Layouts with the Wear UI Library

사용자 정의 layout을 만드는데 유용한 wear 에 특화된 ui library element

  • BoxInsetLayout  A FrameLayout object that’s aware of screen shape and can box its children in the center square of a round screen.
  • ConfirmationActivity  An activity that displays confirmation animations after the user completes an action.
  • AnimationSet  A group of animations that should be played together.
  • CircularProgressLayout  A layout that provides a circular countdown timer around a child view. Typically used as an automatic timer to confirm an operation after a short delay has elapsed.
  • PagerSnapHelper  Implementation of the SnapHelper instance supporting pager style snapping in either vertical or horizontal orientation.
  • ProgressBar  Displays a bar to the user representing how far the operation has progressed; the application can change the amount of progress (modifying the length of the bar) as it moves forward.

original source:  https://developer.android.com/training/wearables/apps/layouts.html

Create Custom Notifications

ou should create notifications on the phone and let them automatically sync to the wearable.

Note: When creating custom notifications on the watch, you can use the standard notification APIs (API Level 20) instead of the Support Library.

1.Create a layout and set it as the content view for the activity that you want to display.

public void onCreate(Bundle bundle){
   ...
   setContentView(R.layout.notification_activity);
}

 2.in the Android manifest 

For example:

<activity android:name="com.example.MyDisplayActivity"
   android:exported="true"
   android:allowEmbedded="true"
   android:taskAffinity=""
   android:theme="@android:style/Theme.DeviceDefault.Light" />

3.Create a PendingIntent for the activity that you want to display. 

Intent notificationIntent = new Intent(this, NotificationActivity.class);
PendingIntent notificationPendingIntent = PendingIntent.getActivity(
       this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

4.Build a Notification and call setDisplayIntent() providing the PendingIntent. The system uses this PendingIntent to launch the activity when users view your notification.

5.Issue the notification using the notify() method.

Create Layouts with the Wear UI Library

사용자 정의 layout을 만드는데 유용한 wear 에 특화된 ui library element

  • BoxInsetLayout  A FrameLayout object that’s aware of screen shape and can box its children in the center square of a round screen.
  • ConfirmationActivity  An activity that displays confirmation animations after the user completes an action.
  • AnimationSet  A group of animations that should be played together.
  • CircularProgressLayout  A layout that provides a circular countdown timer around a child view. Typically used as an automatic timer to confirm an operation after a short delay has elapsed.
  • PagerSnapHelper  Implementation of the SnapHelper instance supporting pager style snapping in either vertical or horizontal orientation.
  • ProgressBar  Displays a bar to the user representing how far the operation has progressed; the application can change the amount of progress (modifying the length of the bar) as it moves forward.

original source:  https://developer.android.com/training/wearables/apps/layouts.html

Create Custom Notifications

ou should create notifications on the phone and let them automatically sync to the wearable.

Note: When creating custom notifications on the watch, you can use the standard notification APIs (API Level 20) instead of the Support Library.

1.Create a layout and set it as the content view for the activity that you want to display.

public void onCreate(Bundle bundle){
   ...
   setContentView(R.layout.notification_activity);
}

 2.in the Android manifest 

For example:

<activity android:name="com.example.MyDisplayActivity"
   android:exported="true"
   android:allowEmbedded="true"
   android:taskAffinity=""
   android:theme="@android:style/Theme.DeviceDefault.Light" />

3.Create a PendingIntent for the activity that you want to display. 

Intent notificationIntent = new Intent(this, NotificationActivity.class);
PendingIntent notificationPendingIntent = PendingIntent.getActivity(
       this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

4.Build a Notification and call setDisplayIntent() providing the PendingIntent. The system uses this PendingIntent to launch the activity when users view your notification.

5.Issue the notification using the notify() method.

Create Layouts with the Wear UI Library

사용자 정의 layout을 만드는데 유용한 wear 에 특화된 ui library element

  • BoxInsetLayout  A FrameLayout object that’s aware of screen shape and can box its children in the center square of a round screen.
  • ConfirmationActivity  An activity that displays confirmation animations after the user completes an action.
  • AnimationSet  A group of animations that should be played together.
  • CircularProgressLayout  A layout that provides a circular countdown timer around a child view. Typically used as an automatic timer to confirm an operation after a short delay has elapsed.
  • PagerSnapHelper  Implementation of the SnapHelper instance supporting pager style snapping in either vertical or horizontal orientation.
  • ProgressBar  Displays a bar to the user representing how far the operation has progressed; the application can change the amount of progress (modifying the length of the bar) as it moves forward.