1
0
Fork 0
mirror of https://github.com/Corewala/Buran synced 2024-12-21 23:32:40 +00:00

Fixed previousPosition when not through onLink

This commit is contained in:
Corewala 2022-07-09 13:27:27 -04:00
parent 679c3bd0be
commit 4c94bd97e4

View file

@ -107,7 +107,6 @@ class GemActivity : AppCompatActivity() {
startActivity(Intent.createChooser(this, null))
}
}else{
previousPosition = (binding.gemtextRecycler.layoutManager as LinearLayoutManager).findLastVisibleItemPosition()
//Reset input text hint after user has been searching
if(inSearch) {
binding.addressEdit.hint = getString(R.string.main_input_hint)
@ -699,6 +698,10 @@ class GemActivity : AppCompatActivity() {
//addressSpan.set(0, 9, ForegroundColorSpan(resources.getColor(R.color.protocol_address)))
binding.addressEdit.setText(state.uri.toString())
if(!goingBack){
previousPosition = (binding.gemtextRecycler.layoutManager as LinearLayoutManager).findLastVisibleItemPosition()
}
adapter.render(state.lines)
//Scroll to correct position