Compare commits
No commits in common. "main" and "v1.2.1" have entirely different histories.
2 changed files with 2 additions and 17 deletions
|
|
@ -22,8 +22,8 @@ android {
|
||||||
applicationId = "dev.n1ko.nikogpt"
|
applicationId = "dev.n1ko.nikogpt"
|
||||||
minSdk = 29 // Android 10
|
minSdk = 29 // Android 10
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 8
|
versionCode = 7
|
||||||
versionName = "1.2.2"
|
versionName = "1.2.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|
|
||||||
|
|
@ -80,10 +80,6 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
// Shared text ("Share to NikoGPT") waiting for the page to load.
|
// Shared text ("Share to NikoGPT") waiting for the page to load.
|
||||||
private var pendingShare: String? = null
|
private var pendingShare: String? = null
|
||||||
// Whether the chat's inner scroll container is at the top; pull-to-refresh
|
|
||||||
// only fires there (the WebView itself never scrolls).
|
|
||||||
@Volatile
|
|
||||||
private var webAtTop = true
|
|
||||||
// Where the camera writes the picture before it reaches the web app.
|
// Where the camera writes the picture before it reaches the web app.
|
||||||
private var pendingCameraUri: Uri? = null
|
private var pendingCameraUri: Uri? = null
|
||||||
|
|
||||||
|
|
@ -280,10 +276,6 @@ class MainActivity : AppCompatActivity() {
|
||||||
})
|
})
|
||||||
|
|
||||||
refresh.setOnRefreshListener { webView.reload() }
|
refresh.setOnRefreshListener { webView.reload() }
|
||||||
// Pull-to-refresh only when the chat list is really at the top; a
|
|
||||||
// bigger trigger distance keeps normal scrolling from reloading.
|
|
||||||
refresh.setOnChildScrollUpCallback { _, _ -> !webAtTop }
|
|
||||||
refresh.setDistanceToTriggerSync((80 * resources.displayMetrics.density).toInt())
|
|
||||||
|
|
||||||
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
|
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
|
||||||
override fun handleOnBackPressed() {
|
override fun handleOnBackPressed() {
|
||||||
|
|
@ -360,13 +352,6 @@ class MainActivity : AppCompatActivity() {
|
||||||
fun linkGoogle(clientId: String) {
|
fun linkGoogle(clientId: String) {
|
||||||
runOnUiThread { openGooglePicker(clientId, link = true) }
|
runOnUiThread { openGooglePicker(clientId, link = true) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// The web app reports the message list's scroll position, so pulling
|
|
||||||
// down only refreshes when the list really is at the top.
|
|
||||||
@JavascriptInterface
|
|
||||||
fun setAtTop(atTop: Boolean) {
|
|
||||||
webAtTop = atTop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// openGooglePicker tries the native pickers in order: Credential Manager
|
// openGooglePicker tries the native pickers in order: Credential Manager
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue