Skip to content

Commit

Permalink
Replace report button with copy directing user to library support
Browse files Browse the repository at this point in the history
  • Loading branch information
russellcullen committed Sep 5, 2023
1 parent 9d16f45 commit 8b56180
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.style.StyleSpan
import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator
import org.nypl.simplified.android.ktx.supportActionBar
import org.nypl.simplified.reports.Reports
import org.slf4j.LoggerFactory

/**
Expand Down Expand Up @@ -49,7 +47,6 @@ class ErrorPageFragment : Fragment(R.layout.error_page) {
private lateinit var errorDetails: TextView
private lateinit var errorStepsList: RecyclerView
private lateinit var parameters: ErrorPageParameters
private lateinit var sendButton: Button

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand All @@ -58,8 +55,6 @@ class ErrorPageFragment : Fragment(R.layout.error_page) {
view.findViewById(R.id.errorDetails)
this.errorStepsList =
view.findViewById(R.id.errorSteps)
this.sendButton =
view.findViewById(R.id.errorSendButton)

this.parameters =
this.arguments!!.getSerializable(PARAMETERS_ID)
Expand Down Expand Up @@ -97,18 +92,6 @@ class ErrorPageFragment : Fragment(R.layout.error_page) {
override fun onStart() {
super.onStart()
this.configureToolbar()

this.sendButton.isEnabled = true
this.sendButton.setOnClickListener {
this.sendButton.isEnabled = false

Reports.sendReportsDefault(
context = requireContext(),
address = parameters.emailAddress,
subject = parameters.subject,
body = parameters.report
)
}
}

private fun configureToolbar() {
Expand Down
6 changes: 3 additions & 3 deletions simplified-ui-errorpage/src/main/res/layout/error_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
</LinearLayout>
</androidx.core.widget.NestedScrollView>

<Button
android:id="@+id/errorSendButton"
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="16dp"
android:text="@string/errorSendReport" />
android:text="Contact the email listed under your library's account page (under Settings/Accounts) for assistance."
/>
</LinearLayout>

0 comments on commit 8b56180

Please sign in to comment.