1
0
Fork 0
mirror of https://github.com/Corewala/Buran synced 2024-12-22 07:42:43 +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)) startActivity(Intent.createChooser(this, null))
} }
}else{ }else{
previousPosition = (binding.gemtextRecycler.layoutManager as LinearLayoutManager).findLastVisibleItemPosition()
//Reset input text hint after user has been searching //Reset input text hint after user has been searching
if(inSearch) { if(inSearch) {
binding.addressEdit.hint = getString(R.string.main_input_hint) 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))) //addressSpan.set(0, 9, ForegroundColorSpan(resources.getColor(R.color.protocol_address)))
binding.addressEdit.setText(state.uri.toString()) binding.addressEdit.setText(state.uri.toString())
if(!goingBack){
previousPosition = (binding.gemtextRecycler.layoutManager as LinearLayoutManager).findLastVisibleItemPosition()
}
adapter.render(state.lines) adapter.render(state.lines)
//Scroll to correct position //Scroll to correct position