Skip to content

Commit

Permalink
Added details to opening and closing screen (#63)
Browse files Browse the repository at this point in the history
Updated app text
  • Loading branch information
zsweigart authored May 20, 2020
1 parent f5174b4 commit 5063ffb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
16 changes: 2 additions & 14 deletions app/src/main/java/com/plaid/linksample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import android.view.MenuItem
import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.plaid.link.Plaid
import com.plaid.linkbase.models.configuration.LinkConfiguration
import com.plaid.linkbase.models.configuration.PlaidProduct
Expand All @@ -30,14 +29,7 @@ class MainActivity : AppCompatActivity() {
PlaidLinkResultHandler(
requestCode = LINK_REQUEST_CODE,
onSuccess = {
result.text = getString(
R.string.content_success,
it.publicToken,
it.linkConnectionMetadata.accounts[0].accountId,
it.linkConnectionMetadata.accounts[0].accountName,
it.linkConnectionMetadata.institutionId,
it.linkConnectionMetadata.institutionName
)
result.text = getString(R.string.content_success, it.publicToken)
},
onCancelled = {
result.text = getString(
Expand All @@ -51,12 +43,8 @@ class MainActivity : AppCompatActivity() {
onExit = {
result.text = getString(
R.string.content_exit,
it.displayMessage,
it.errorCode,
it.errorMessage,
it.linkExitMetadata.institutionId,
it.linkExitMetadata.institutionName,
it.linkExitMetadata.status
it.errorCode
)
}
)
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center" />
android:gravity="start|center"
android:text="@string/landing_text"
android:autoLink="all"/>

<com.google.android.material.button.MaterialButton
android:id="@+id/open_link"
Expand Down
27 changes: 24 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,32 @@
<string name="app_name">Link demo</string>
<string name="title_activity_main">Link demo</string>
<string name="title_activity_main_java">Link demo (java)</string>
<string name="content_success">Public Token:\n%1$s\n\n Account Id:\n%2$s\n\n Account Name:\n%3$s\n\n Institution Id:\n%4$s\n\n Institution Name:\n%5$s</string>
<string name="content_success">
You did it! See, that wasn’t so hard :)

\n\nThe next step is adding the Link Android SDK to your app.

\n\n1) This is your public token: <b>%1$s</b>
\n2) Send this key to your server to exchange it for an access token and get access to your data
\n3) Visit <a href="http://plaid.com/docs/link/android">http://plaid.com/docs/link/android</a> for more information on how to integrate
\n4) Ready for the big leagues? Unlock production access by visiting <a href="http://plaid.com/contact">http://plaid.com/contact</a></string>
<string name="content_cancelled">Institution Id:\n%1$s\n\n Institution Name:\n%2$s\n\n Link Session Id:\n%3$s\n\n Status:\n%4$s</string>
<string name="content_exit">Display Message:\n%1$s\n\n Error Code:\n%2$s\n\n Error Message:\n%3$s\n\n Institution Id:\n%4$s\n\n Institution Name:\n%5$s\n\n Status:\n%6$s</string>
<string name="content_exit">
Uh-oh! It seems something went wrong:\n\"%1$s\"

\n\nVisit <a href="https://plaid.com/docs/#errors">https://plaid.com/docs/#errors</a> for more information on the error code below
\nError Code: <b>%2$s</b>
</string>
<string name="content_exception">Exception Class:\n%1$s\n\n Exception Message:\n%2$s</string>
<string name="landing_text">
Welcome to the sample app. It will show you how Link Android SDK can integrate with your own app. We hope you’ll find that:\n
\n\t&#8226; It’s easy to integrate, with fewer lines than webviews
\n\t&#8226; It features enhanced security and a type-safe API
\n\t&#8226; It supports all Link flows, including oauth
\n\t&#8226; You’ll get monthly updates from Plaid
\n\t&#8226; You can get support directly from the Plaid team
</string>
<string name="open_java">Open Java demo</string>
<string name="open_kotlin">Open Kotlin demo</string>
<string name="open_link">Open Link</string>
</resources>
</resources>

0 comments on commit 5063ffb

Please sign in to comment.