quran / quran_android

a quran reading application for android
http://android.quran.com
GNU General Public License v3.0
1.95k stars 881 forks source link

Fix: Scroll state in retained in the partial translation mode #2643

Closed ikerfah closed 3 months ago

ikerfah commented 3 months ago

Fixes #2598 Retain scroll state in partial translation mode

The issue was with the call to scrollTo(0, 0) within the setAyahs(), so basically when the Ayahs are set the scroll is rested to 0,0.

Removing scrollTo(0, 0) persists the scroll position since InlineTranslationView extends ScrollView and it saves the scroll state out of the box. but this introduce a new problem which is when you select a different ayah then the scroll will not be rested. to fix this I added a flag called ayahHasBeenChanged to reset the scroll to 0,0 when ayah is changed

github-actions[bot] commented 3 months ago
OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │           compressed           │          uncompressed          
          ├───────────┬───────────┬────────┼───────────┬───────────┬────────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
      dex │  20.3 MiB │  20.3 MiB │ +404 B │  65.5 MiB │  65.5 MiB │ +684 B 
     arsc │   2.2 MiB │   2.2 MiB │    0 B │   2.2 MiB │   2.2 MiB │    0 B 
 manifest │   5.6 KiB │   5.6 KiB │    0 B │  27.1 KiB │  27.1 KiB │    0 B 
      res │   1.6 MiB │   1.6 MiB │    0 B │   1.8 MiB │   1.8 MiB │    0 B 
    asset │ 404.2 KiB │ 404.2 KiB │    0 B │ 678.6 KiB │ 678.6 KiB │    0 B 
    other │ 188.6 KiB │ 188.6 KiB │   -3 B │ 385.6 KiB │ 385.6 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  24.7 MiB │  24.7 MiB │ +401 B │  70.6 MiB │  70.6 MiB │ +684 B 
github-actions[bot] commented 3 months ago
OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │           compressed           │          uncompressed          
          ├───────────┬───────────┬────────┼───────────┬───────────┬────────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
      dex │  20.3 MiB │  20.3 MiB │ +230 B │  65.5 MiB │  65.5 MiB │ +584 B 
     arsc │   2.2 MiB │   2.2 MiB │    0 B │   2.2 MiB │   2.2 MiB │    0 B 
 manifest │   5.6 KiB │   5.6 KiB │    0 B │  27.1 KiB │  27.1 KiB │    0 B 
      res │   1.6 MiB │   1.6 MiB │    0 B │   1.8 MiB │   1.8 MiB │    0 B 
    asset │ 404.2 KiB │ 404.2 KiB │    0 B │ 678.6 KiB │ 678.6 KiB │    0 B 
    other │ 188.6 KiB │ 188.6 KiB │   -3 B │ 385.6 KiB │ 385.6 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  24.7 MiB │  24.7 MiB │ +227 B │  70.6 MiB │  70.6 MiB │ +584 B