Skip to content

Commit

Permalink
Merge pull request #1010 from NYPL-Simplified/update-target-sdk
Browse files Browse the repository at this point in the history
Update target sdk and error screen
  • Loading branch information
russellcullen committed Sep 6, 2023
2 parents 09a7b0f + 8b56180 commit 336ea92
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 27 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ plugins {

ext {
android_build_tools_version = "30.0.2"
android_compile_sdk_version = 31
android_compile_sdk_version = 33
android_min_sdk_version = 24
android_target_sdk_version = 31
android_target_sdk_version = 33

// Required for some dependencies only available from our private S3
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class LocationFragment : Fragment(), LocationListener {
if (isNewYork || locationMock != null) {
locationMock?.let { location ->
activityModel.userLocationAddress =
geocoder.getFromLocation(location.latitude, location.longitude, 1)[0]
geocoder.getFromLocation(location.latitude, location.longitude, 1)?.get(0)
}

logger.debug("User navigated to the next screen")
Expand Down Expand Up @@ -230,7 +230,7 @@ class LocationFragment : Fragment(), LocationListener {

try {
if (location != null) {
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)[0]
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)!![0]
logger.debug("Region is: ${address.adminArea} ${address.countryCode} ")
binding.regionEt.setText("${address.adminArea} ${address.countryCode}", TextView.BufferType.EDITABLE)

Expand Down Expand Up @@ -292,7 +292,7 @@ class LocationFragment : Fragment(), LocationListener {
val address: Address?

try {
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)[0]
address = geocoder.getFromLocation(location.latitude, location.longitude, maxResults)!![0]
logger.debug("Region is: ${address.adminArea} ${address.countryCode} ")
binding.regionEt.setText("${address.adminArea} ${address.countryCode}", TextView.BufferType.EDITABLE)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ class AccountListRegistryFragment : Fragment(R.layout.account_list_registry) {
})

search.setOnActionExpandListener(object : OnActionExpandListener {
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
override fun onMenuItemActionExpand(item: MenuItem): Boolean {
// Do nothing
return true
}

override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
override fun onMenuItemActionCollapse(item: MenuItem): Boolean {
this@AccountListRegistryFragment.accountListAdapter.resetFilter()
return true
}
Expand Down
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 336ea92

Please sign in to comment.