Small fixes

This commit is contained in:
Jan-Lk Else 2016-12-24 22:15:50 +01:00
parent 2bf858dd0a
commit 8a74d9025c
4 changed files with 9 additions and 4 deletions

BIN
apks/1.1.1.apk Normal file

Binary file not shown.

View File

@ -8,8 +8,8 @@ android {
applicationId "telegra.ph"
minSdkVersion 15
targetSdkVersion 25
versionCode 6
versionName "1.1"
versionCode 7
versionName "1.1.1"
resConfigs "en"
}
buildTypes {

View File

@ -36,7 +36,7 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
if (accessToken().isNullOrBlank()) Api().createAccount { accessToken ->
if (accessToken != null) saveAccessToken(accessToken)
}
if (intent.action == Intent.ACTION_VIEW && !intent.dataString.isNullOrBlank() && intent.dataString.contains("telegra.ph")) loadPage(intent.dataString.split("/").last())
if (intent.action == Intent.ACTION_VIEW && intent.dataString.contains("telegra.ph")) loadPage(intent.dataString.split("/").last())
else loadEditor()
}
@ -182,6 +182,7 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
MaterialDialog.Builder(this)
.title(R.string.name_question)
.input(getString(R.string.name_hint), if (isEdit) currentPage?.author_name ?: authorName() ?: "" else authorName() ?: "", { dialog, name ->
if (!isEdit) saveAuthorName(name.toString())
if (isEdit) Api().editPage(accessToken(), currentPage?.path, json, title.toString(), name.toString()) { success, page ->
if (success) showPage(page)
else showError()
@ -244,7 +245,7 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
MaterialDialog.Builder(this)
.title(R.string.title_question)
.input(getString(R.string.title_hint), "", { dialog, input ->
addBookmark("${(if (webView?.url != "about:blank") webView?.url ?: currentUrl else currentUrl).split("/").last()}xxx;xxx$input")
addBookmark("${currentUrl.split("/").last()}xxx;xxx$input")
})
.show()
true

View File

@ -10,6 +10,10 @@ buildscript {
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.13.0'
}
allprojects {
repositories {
jcenter()