Skip to content

Commit

Permalink
blank url is handled correctly now + prepared 1.0.1a release
Browse files Browse the repository at this point in the history
  • Loading branch information
artemperl committed Jun 5, 2017
1 parent fc86132 commit baf0e89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "de.artem.lendingwidget"
minSdkVersion 16
targetSdkVersion 25
versionCode 2
versionName "1.0.1"
versionCode 3
versionName "1.0.1a"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ class LendingWidgetConfigureActivity : AppCompatActivity() {
}

internal fun tryConnection() {
toggleViews(false)

// TODO handle https
var url = mUrlEditText.text.toString()
if (url.isBlank()) {
Toast.makeText(this, getString(R.string.error_blank_url, mUrlEditText.text), Toast.LENGTH_LONG).show()
return
}

toggleViews(false)
if (url.toLowerCase().startsWith("http://")) {
url = url.substring(7)
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<string name="error_connection">An error occured while trying to connect to %1$s</string>
<string name="error_log">Error log</string>
<string name="target_spinner_title">Conversion currency</string>
<string name="error_blank_url">Please enter a URL</string>
</resources>

0 comments on commit baf0e89

Please sign in to comment.