Shaky skips the feedback form after the bottom sheet was dismissed

Aperta Adatta ai principianti
#103 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, java
Ambito
mobile

Direzione di ricerca

Leggi launchShakeBottomSheet del delegate, che imposta isBottomSheetFlowActive = true, poi onDataReady/doStartFeedbackFlow, dove il flag viene azzerato solo dopo un flow di sheet inviato, e l'handler della riga Dismiss nel bottom sheet. Riproduci con l'app di esempio: «Avvia il bottom sheet manualmente», «Dismiss», poi «Avvia il feedback manualmente». Fatto significa che il OnCancelListener dello sheet azzera il flag, la riga Dismiss chiama cancel(), le righe che avviano il flow chiamano ancora dismiss(), e il flow manuale raggiunge FeedbackActivity.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

On main (ca3e5f0), with the default delegate (shouldUseBottomSheet() returns true):

  1. Shake, or call startShakeBottomSheetFlowManually(). The bottom sheet opens.
  2. Close it without picking a row: tap "Dismiss", press back, tap outside or swipe it down.
  3. Call shaky.startFeedbackFlow(), which the README suggests for starting the flow without a shake.

Expected: FeedbackActivity opens and the user can write a message.

Actual: after the screenshot is collected, delegate.submit() is called right away with no message and a null title. With EmailShakeDelegate that opens the mail app with only the screenshot attached.

launchShakeBottomSheet sets isBottomSheetFlowActive = true when it shows the sheet. The flag is only cleared in onDataReady after a sheet flow has submitted. If the sheet is closed without a choice, nothing clears it, so the next doStartFeedbackFlow() from startFeedbackFlow() takes the sheet branch in onDataReady. The sample app shows it too: tap "Manually launch bottom sheet", tap "Dismiss", then tap "Manually start feedback".

I have a small fix: clear the flag in an OnCancelListener on the sheet, and make the Dismiss row call cancel() instead of dismiss(). The row taps that start a flow still call dismiss(), so their path is unchanged. A plain dismiss listener would not work: the row tap broadcasts first and the dismiss callback would clear the flag before onDataReady reads it.

Lingua principale
Java
Stelle
162
Fork
59
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linkedin/shaky-android

Tutte le issue di linkedin/shaky-android

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.