Skip to content

Convert Plaid to use AndroidX #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 21, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Temporarily comment out plusAssign usage. App runs now
  • Loading branch information
tiembo committed Oct 12, 2018
commit d2cefa384448f4d3fb92dec0ade25d9bd87efb63
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import android.text.Spannable
import android.text.SpannableString
import android.text.SpannableStringBuilder
import android.text.style.AlignmentSpan
import androidx.core.text.plusAssign
import androidx.core.text.toSpannable
import io.plaidapp.about.R
import io.plaidapp.about.domain.model.Library
Expand Down Expand Up @@ -62,20 +61,20 @@ internal class AboutViewModel @Inject constructor(
)

val about1 = SpannableString(resources.getString(R.string.about_plaid_1))
about1 += AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER)
// about1 += AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the plus overload was removed in 1.0.0.
If I remember correctly, they removed it because of a low API usability. you couldn't tell what that plus would really do.
We should create an extension function to Spannable, doing the functionality that used to be here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported over plusAssign extension function from android-ktx


val about2 = getSpannableFromMarkdown(
R.string.about_plaid_2,
linksColor,
highlightColor
)
about2 += AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER)
// about2 += AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER)

val about3 = getSpannableFromMarkdown(
R.string.about_plaid_3,
linksColor, highlightColor
)
about3 += AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER)
// about3 += AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER)
spannableFrom(about0, "\n\n", about1, "\n", about2, "\n\n", about3)
}
}
Expand Down