diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index bfa2c456dc..ea4e449167 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -112,6 +112,9 @@
android:name="org.thoughtcrime.securesms.loki.redesign.activities.DisplayNameActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/pn_option_background_deselect_transition.xml b/res/drawable/pn_option_background_deselect_transition.xml
new file mode 100644
index 0000000000..7fcb8e1160
--- /dev/null
+++ b/res/drawable/pn_option_background_deselect_transition.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/pn_option_background_select_transition.xml b/res/drawable/pn_option_background_select_transition.xml
new file mode 100644
index 0000000000..21c58cf71d
--- /dev/null
+++ b/res/drawable/pn_option_background_select_transition.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/res/drawable/pn_option_background_selected.xml b/res/drawable/pn_option_background_selected.xml
new file mode 100644
index 0000000000..56d1ed983a
--- /dev/null
+++ b/res/drawable/pn_option_background_selected.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout-sw400dp/activity_pn_mode.xml b/res/layout-sw400dp/activity_pn_mode.xml
new file mode 100644
index 0000000000..8edc9267df
--- /dev/null
+++ b/res/layout-sw400dp/activity_pn_mode.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/activity_pn_mode.xml b/res/layout/activity_pn_mode.xml
new file mode 100644
index 0000000000..25f868d1f8
--- /dev/null
+++ b/res/layout/activity_pn_mode.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 958e2a8bd1..374020fd95 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -26,6 +26,8 @@
#3F4146
#99FFFFFF
#1F1F1F
+ #1B1B1B
+ #212121
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 3ed8a9a187..16ed23c8fe 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -32,6 +32,7 @@
56dp
8dp
4dp
+ 8dp
8dp
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c32f241721..b04ec955a5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1670,5 +1670,13 @@
Are you sure you want to leave this group?
Are you sure you want to delete this conversation?
Conversation deleted
+ Push Notifications
+ There are two ways Session can handle push notifications. Make sure to read the descriptions carefully before you choose.
+ Firebase Cloud Messaging
+ Session will use the Firebase Cloud Messaging service to receive push notifications. You’ll be notified of new messages reliably and immediately. Using FCM means that this device will communicate directly with Google’s servers to retrieve push notifications, which will expose your IP address to Google. Your messages will still be onion-routed and end-to-end encrypted, so the contents of your messages will remain completely private.
+ Background Polling
+ Session will occasionally check for new messages in the background. This guarantees full privacy protection, but message notifications may be significantly delayed.
+ Recommended
+ Please Pick an Option
diff --git a/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt b/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt
new file mode 100644
index 0000000000..9e2e2c1b6b
--- /dev/null
+++ b/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt
@@ -0,0 +1,77 @@
+package org.thoughtcrime.securesms.loki.redesign.activities
+
+import android.graphics.drawable.TransitionDrawable
+import android.os.Bundle
+import android.support.annotation.DrawableRes
+import android.view.View
+import android.widget.LinearLayout
+import kotlinx.android.synthetic.main.activity_display_name.registerButton
+import kotlinx.android.synthetic.main.activity_pn_mode.*
+import network.loki.messenger.R
+import org.thoughtcrime.securesms.BaseActionBarActivity
+import org.thoughtcrime.securesms.loki.redesign.utilities.setUpActionBarSessionLogo
+
+class PNModeActivity : BaseActionBarActivity() {
+ private var selectedOptionView: LinearLayout? = null
+
+ // region Lifecycle
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setUpActionBarSessionLogo()
+ setContentView(R.layout.activity_pn_mode)
+ fcmOptionView.setOnClickListener { toggleFCM() }
+ backgroundPollingOptionView.setOnClickListener { toggleBackgroundPolling() }
+ registerButton.setOnClickListener { register() }
+ }
+ // endregion
+
+ // region Animation
+ private fun performTransition(@DrawableRes transitionID: Int, subject: View) {
+ val drawable = resources.getDrawable(transitionID, theme) as TransitionDrawable
+ subject.background = drawable
+ drawable.startTransition(250)
+ }
+ // endregion
+
+ // region Interaction
+ private fun toggleFCM() {
+ when (selectedOptionView) {
+ null -> {
+ performTransition(R.drawable.pn_option_background_select_transition, fcmOptionView)
+ selectedOptionView = fcmOptionView
+ }
+ fcmOptionView -> {
+ performTransition(R.drawable.pn_option_background_deselect_transition, fcmOptionView)
+ selectedOptionView = null
+ }
+ backgroundPollingOptionView -> {
+ performTransition(R.drawable.pn_option_background_select_transition, fcmOptionView)
+ performTransition(R.drawable.pn_option_background_deselect_transition, backgroundPollingOptionView)
+ selectedOptionView = fcmOptionView
+ }
+ }
+ }
+
+ private fun toggleBackgroundPolling() {
+ when (selectedOptionView) {
+ null -> {
+ performTransition(R.drawable.pn_option_background_select_transition, backgroundPollingOptionView)
+ selectedOptionView = backgroundPollingOptionView
+ }
+ backgroundPollingOptionView -> {
+ performTransition(R.drawable.pn_option_background_deselect_transition, backgroundPollingOptionView)
+ selectedOptionView = null
+ }
+ fcmOptionView -> {
+ performTransition(R.drawable.pn_option_background_select_transition, backgroundPollingOptionView)
+ performTransition(R.drawable.pn_option_background_deselect_transition, fcmOptionView)
+ selectedOptionView = backgroundPollingOptionView
+ }
+ }
+ }
+
+ private fun register() {
+ // TODO: Implement
+ }
+ // endregion
+}
\ No newline at end of file