Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public interface Listener { void onUpdate(); }
public static boolean hasFailed() { return SESSION.hasFailed(); }
public static int percent() { return SESSION.percent(); }
public static long speed() { return SESSION.speed(); }
public static long etaSeconds() { return SESSION.eta(); }
public static boolean lastWasUpToDate() { return SESSION.lastWasUpToDate(); }
public static String currentDetail() { return SESSION.currentDetail(); }
public static int reconnectAttempt() { return SESSION.reconnectAttempt(); }
public static int reconnectTotal() { return SESSION.reconnectTotal(); }
public static void setListener(Listener l) { SESSION.setListener(l == null ? null : l::onUpdate); }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* ============================================================================
* Name : AddonsUpdater.java
* Author : AppDevForAll
* Copyright : Copyright (c) 2026 AppDevForAll
* Description : K2GO-503. The Code on the Go add-ons adapter for the shared ContentUpdaterView: a thin
* delegate over AddonsDownloadService (the aria2 download path) plus the module's
* strings. The whole updater UX lives in ContentUpdaterView; this just wires the module.
* ============================================================================
*/
package org.appdevforall.k2go.addons.presentation;

import android.content.Context;

import org.appdevforall.k2go.R;
import org.appdevforall.k2go.redesign.ContentUpdater;

public final class AddonsUpdater implements ContentUpdater {

public static final AddonsUpdater INSTANCE = new AddonsUpdater();

private AddonsUpdater() {}

@Override public void start(Context ctx) { AddonsDownloadService.start(ctx); }
@Override public void pause(Context ctx) { AddonsDownloadService.pause(ctx); }
@Override public void resume(Context ctx) { AddonsDownloadService.resume(ctx); }
@Override public void cancel(Context ctx) { AddonsDownloadService.cancel(ctx); }
@Override public void retry(Context ctx) { AddonsDownloadService.retry(ctx); }
@Override public void finishSession() { AddonsDownloadService.finishSession(); }

@Override public void setListener(Runnable onUpdate) {
AddonsDownloadService.Listener l = onUpdate == null ? null : onUpdate::run;
AddonsDownloadService.setListener(l);
}

@Override public boolean isRunning() { return AddonsDownloadService.isRunning(); }
@Override public boolean isPaused() { return AddonsDownloadService.isPaused(); }
@Override public boolean hasSession() { return AddonsDownloadService.hasSession(); }
@Override public boolean isComplete() { return AddonsDownloadService.isComplete(); }
@Override public boolean hasFailed() { return AddonsDownloadService.hasFailed(); }
@Override public int percent() { return AddonsDownloadService.percent(); }
@Override public long speed() { return AddonsDownloadService.speed(); }
@Override public long etaSeconds() { return AddonsDownloadService.etaSeconds(); }
@Override public int reconnectAttempt() { return AddonsDownloadService.reconnectAttempt(); }
@Override public int reconnectTotal() { return AddonsDownloadService.reconnectTotal(); }
@Override public boolean lastWasUpToDate() { return AddonsDownloadService.lastWasUpToDate(); }
@Override public String currentDetail() { return AddonsDownloadService.currentDetail(); }

@Override public boolean supportsPauseResume() { return true; }
@Override public boolean supportsSpeedEta() { return true; }

@Override public int titleRes() { return R.string.k2go_code_addons_updating; }
@Override public int doneRes() { return R.string.k2go_code_addons_update_done; }
@Override public int upToDateRes() { return R.string.k2go_code_addons_update_up_to_date; }
@Override public int failedRes() { return R.string.k2go_code_addons_update_failed; }
@Override public int cancelledRes() { return R.string.k2go_code_addons_update_cancelled; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public interface Listener { void onUpdate(); }
public static boolean hasFailed() { return SESSION.hasFailed(); }
public static int percent() { return SESSION.percent(); }
public static long speed() { return SESSION.speed(); }
public static long etaSeconds() { return SESSION.eta(); }
public static boolean lastWasUpToDate() { return SESSION.lastWasUpToDate(); }
public static String currentDetail() { return SESSION.currentDetail(); }
public static int reconnectAttempt() { return SESSION.reconnectAttempt(); }
public static int reconnectTotal() { return SESSION.reconnectTotal(); }
public static void setListener(Listener l) { SESSION.setListener(l == null ? null : l::onUpdate); }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* ============================================================================
* Name : CodeAssetsUpdater.java
* Author : AppDevForAll
* Copyright : Copyright (c) 2026 AppDevForAll
* Description : K2GO-503. The Code on the Go build-assets adapter for the shared ContentUpdaterView: a
* thin delegate over CodeAssetsDownloadService (the aria2 download path) plus the
* module's strings. The whole updater UX lives in ContentUpdaterView; this wires the
* module. Byte-for-byte the add-ons adapter with a different service and string set:
* the duplication that used to live in the Refresh views is gone.
* ============================================================================
*/
package org.appdevforall.k2go.codeassets.presentation;

import android.content.Context;

import org.appdevforall.k2go.R;
import org.appdevforall.k2go.redesign.ContentUpdater;

public final class CodeAssetsUpdater implements ContentUpdater {

public static final CodeAssetsUpdater INSTANCE = new CodeAssetsUpdater();

private CodeAssetsUpdater() {}

@Override public void start(Context ctx) { CodeAssetsDownloadService.start(ctx); }
@Override public void pause(Context ctx) { CodeAssetsDownloadService.pause(ctx); }
@Override public void resume(Context ctx) { CodeAssetsDownloadService.resume(ctx); }
@Override public void cancel(Context ctx) { CodeAssetsDownloadService.cancel(ctx); }
@Override public void retry(Context ctx) { CodeAssetsDownloadService.retry(ctx); }
@Override public void finishSession() { CodeAssetsDownloadService.finishSession(); }

@Override public void setListener(Runnable onUpdate) {
CodeAssetsDownloadService.Listener l = onUpdate == null ? null : onUpdate::run;
CodeAssetsDownloadService.setListener(l);
}

@Override public boolean isRunning() { return CodeAssetsDownloadService.isRunning(); }
@Override public boolean isPaused() { return CodeAssetsDownloadService.isPaused(); }
@Override public boolean hasSession() { return CodeAssetsDownloadService.hasSession(); }
@Override public boolean isComplete() { return CodeAssetsDownloadService.isComplete(); }
@Override public boolean hasFailed() { return CodeAssetsDownloadService.hasFailed(); }
@Override public int percent() { return CodeAssetsDownloadService.percent(); }
@Override public long speed() { return CodeAssetsDownloadService.speed(); }
@Override public long etaSeconds() { return CodeAssetsDownloadService.etaSeconds(); }
@Override public int reconnectAttempt() { return CodeAssetsDownloadService.reconnectAttempt(); }
@Override public int reconnectTotal() { return CodeAssetsDownloadService.reconnectTotal(); }
@Override public boolean lastWasUpToDate() { return CodeAssetsDownloadService.lastWasUpToDate(); }
@Override public String currentDetail() { return CodeAssetsDownloadService.currentDetail(); }

@Override public boolean supportsPauseResume() { return true; }
@Override public boolean supportsSpeedEta() { return true; }

@Override public int titleRes() { return R.string.k2go_code_assets_updating; }
@Override public int doneRes() { return R.string.k2go_code_assets_update_done; }
@Override public int upToDateRes() { return R.string.k2go_code_assets_update_up_to_date; }
@Override public int failedRes() { return R.string.k2go_code_assets_update_failed; }
@Override public int cancelledRes() { return R.string.k2go_code_assets_update_cancelled; }
}
Loading
Loading