NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Show toast when no updates are available.

Open Isira-Seneviratne opened this issue 2 years ago • 8 comments

What is it?

  • [ ] Bugfix (user facing)
  • [x] Feature (user facing)
  • [ ] Codebase improvement (dev facing)
  • [ ] Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Display a toast if no new versions of NewPipe are available when checking for updates.

Before/After Screenshots/Screen Record

  • Before:
  • After:

Fixes the following issue(s)

  • Fixes #

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

Isira-Seneviratne avatar Jul 21 '22 02:07 Isira-Seneviratne

Wouldn't this show every time the app is launched? That would be pretty annoying, I think.

TacoTheDank avatar Jul 21 '22 06:07 TacoTheDank

I agree with @TacoTheDank, it makes little sense to me to show a notification if there is no update available, plus it would be quite irritating. What problem are you trying to solve by this PR @Isira-Seneviratne?

triallax avatar Jul 21 '22 14:07 triallax

I agree with @TacoTheDank, it makes little sense to me to show a notification if there is no update available, plus it would be quite irritating. What problem are you trying to solve by this PR @Isira-Seneviratne?

The idea was to show some feedback if no update was available, since at the moment nothing is shown if the app is up-to-date.

Isira-Seneviratne avatar Jul 21 '22 14:07 Isira-Seneviratne

I think that would be more suited for a update check button/page perhaps.

triallax avatar Jul 21 '22 14:07 triallax

I would not show a notification, but rather a toast. A toast saying "Checking for updates..." is already shown when the "check for updates" button is pressed (settings > updates). I agree with the others that this info should not be shown when the check was performed automatically.

TobiGr avatar Jul 21 '22 15:07 TobiGr

@TobiGr Yeah, I'll make that change.

Isira-Seneviratne avatar Jul 22 '22 14:07 Isira-Seneviratne

I get the following error, probably the wrong thread or context are used?

java.lang.NullPointerException: Can't toast on a thread that has not called Looper.prepare()
        at ...
        at org.schabi.newpipe.NewVersionWorker.compareAppVersionAndShowNotification(NewVersionWorker.kt:49)

Yeah, it seems like the fix is to use a Handler or Executor to show the toast.

By the way, how can I check for updates in the debug build?

Isira-Seneviratne avatar Aug 06 '22 22:08 Isira-Seneviratne

By the way, how can I check for updates in the debug build?

I would assume that debug builds are for debugging, and that update checking isn't needed for them.

TacoTheDank avatar Aug 11 '22 19:08 TacoTheDank

By the way, how can I check for updates in the debug build?

I would assume that debug builds are for debugging, and that update checking isn't needed for them.

Right, my bad. I'll check with a release build. It's been a while since I made changes to the update process.

Isira-Seneviratne avatar Aug 11 '22 22:08 Isira-Seneviratne

btw. a rebase is required. I just pulled the latest translations from weblate.

To the maintainer merging this PR: please make sure to sync weblate once this PR is merged

TobiGr avatar Oct 09 '22 18:10 TobiGr

I merged weblate into dev, then rebased this PR onto dev, then I'm merging it.

Stypox avatar Dec 04 '22 11:12 Stypox