Skip to content

Removed hardcoded strings from Java files #2847

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class AttendeeViewModel(
mutableSignedIn.value = false
mutableUser.value = null
}) {
Timber.e(it, "Failure Logging out!")
Timber.e(it, resource.getString(R.string.failue_log_out))
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ class AttendeeViewModel(
mutableRedirectToProfile.value = true
}
}
Timber.e(it, "Fail on creating pending order")
Timber.e(it, resource.getString(R.string.failed_pending_order))
})
}

Expand All @@ -200,7 +200,7 @@ class AttendeeViewModel(
mutableTicketSoldOut.value = true
} else {
mutableMessage.value = resource.getString(R.string.create_attendee_fail_message)
Timber.d(it, "Failed")
Timber.d(it,resource.getString(R.string.attendee_failed))
mutableTicketSoldOut.value = false
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AuthViewModel(
mutableProgress.value = false
}.subscribe({
mutableStatus.value = !it.result
Timber.d("Success!")
Timber.d(resource.getString(R.string.success))
}, {
mutableError.value = resource.getString(R.string.error)
Timber.d(it, "Failed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class EditProfileFragment : Fragment(), ComplexBackPressFragment {
// create temp file
try {

val tempAvatar = File(context?.cacheDir, "tempAvatar")
val tempAvatar = File(context?.cacheDir, getString(R.string.avatar))
if (tempAvatar.exists()) {
tempAvatar.delete()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ProfileViewModel(
mutableUpdatedPassword.value = newPassword
}
}, {
if (it.message.toString() == "HTTP 400 BAD REQUEST")
if (it.message.toString() == resource.getString(R.string.bad_request))
mutableMessage.value = resource.getString(R.string.incorrect_old_password_message)
else mutableMessage.value = resource.getString(R.string.change_password_fail_message)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class WelcomeFragment : Fragment() {
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
geoLocationViewModel.configure()
} else {
Snackbar.make(rootView, "Cannot fetch location!", Snackbar.LENGTH_SHORT).show()
Snackbar.make(rootView, getString(R.string.cannot_fetch_location), Snackbar.LENGTH_SHORT).show()
rootView.locationProgressBar.isVisible = false
}
}
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<string name="weekend">This weekend</string>
<string name="month">In the next month</string>
<string name="what_time">What time works?</string>
<string name="pick_date">Pick a date...</string>
<string name="pick_date">Pick a date</string>
<string name="no_search_results">Hmmm, we\'\re not getting\nany results. Our bad - try\nanother search</string>
<string name="event_details">Event details</string>
<string name="download_ticket">Download Ticket</string>
Expand Down Expand Up @@ -538,6 +538,13 @@
<string name="tick">tick</string>
<string name="general_settings_and_support">General Settings and Support</string>
<string name="dialog_message">This mobile app is still in its prototype stage with many features being experimental. We currently recommend using this app only for testing.</string>
<string name="attendee_failed">Failed</string>
<string name="failed_pending_order">Fail on creating pending order</string>
<string name="failue_log_out">Failure Logging out!</string>
<string name="success">Success!</string>
<string name="avatar">tempAvatar</string>
<string name="bad_request">HTTP 400 BAD REQUEST</string>
<string name="cannot_fetch_location">Cannot fetch location!</string>


</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0'
classpath "gradle.plugin.com.github.b3er.local.properties:local-properties-plugin:1.1"
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 11 23:14:47 IST 2020
#Wed Apr 14 23:34:11 IST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip