ContriHUB / Just-Share

Android app that enables quick transfer of photos, videos, documents, and audio files using WiFiDirect and Bluetooth.
MIT License
0 stars 5 forks source link

Fix Wi-Fi Direct File Transfer UI to Display Real-Time Progress Using Broadcast Channel #7

Open SaiDheerajPeketi opened 5 days ago

SaiDheerajPeketi commented 5 days ago

🐛Bug-Report

Expected behavior

The Wi-Fi Direct file transfer UI should display the progress of the files being transferred in real-time. The progress should be dynamically updated as data is received through a broadcast channel. The UI should be consistent with the Bluetooth transfer progress activity, displaying the percentage of file transfer completion, file size, and estimated time remaining.

Current behavior

The current Wi-Fi Direct file transfer UI is not displaying any progress information during file transfers. Even though progress updates are being received through the broadcast channel, they are not being reflected in the UI. This creates confusion for the user, as there is no indication of transfer status or completion.

Steps to reproduce

  1. Initiate a file transfer via Wi-Fi Direct.
  2. Observe the file transfer UI, which remains empty and does not show any progress.
  3. Check the broadcast messages for progress updates, which are being received but not displayed.

Possible Solution

  1. Use Broadcast to Capture Progress: Ensure that the broadcast receiver is correctly capturing progress updates for Wi-Fi Direct transfers. The broadcast messages should include data such as bytes transferred, total file size, and percentage completion.

  2. UI Updates: Leverage the same composable that is used for the Bluetooth file transfer progress. This will maintain UI consistency across both transfer modes (Bluetooth and Wi-Fi Direct).

  3. Bind Data to UI: Bind the data received from the broadcast receiver to the UI so that the progress bar and other relevant information are updated dynamically. Ensure the progress updates are triggered on the main thread to avoid UI thread issues.

  4. Testing: Verify that the same logic used in the Bluetooth progress activity works correctly with Wi-Fi Direct. Ensure that progress is displayed, updated in real-time, and the final transfer status (success/failure) is handled properly.

Context

This issue occurs in the Wi-Fi Direct file transfer UI, where the file transfer progress is not being displayed despite progress updates being available via the broadcast channel.