mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
Topup action: activity instead of menu
This commit is contained in:
parent
9ed62240a5
commit
318f947b6a
11 changed files with 176 additions and 151 deletions
|
@ -44,8 +44,6 @@ import org.geometerplus.android.fbreader.api.PluginApi;
|
|||
abstract class Util implements UserRegistrationConstants {
|
||||
private static final String REGISTRATION_ACTION =
|
||||
"android.fbreader.action.NETWORK_LIBRARY_REGISTER";
|
||||
static final String TOPUP_ACTION =
|
||||
"android.fbreader.action.network.TOPUP";
|
||||
|
||||
private static boolean testService(Activity activity, String action, String url) {
|
||||
return url != null && PackageUtil.canBeStarted(activity, new Intent(action, Uri.parse(url)), true);
|
||||
|
@ -197,22 +195,6 @@ abstract class Util implements UserRegistrationConstants {
|
|||
return infos != null && infos.size() > 0;
|
||||
}
|
||||
|
||||
static void runTopupDialog(Activity activity, INetworkLink link, String url) {
|
||||
try {
|
||||
final Intent intent = new Intent(TOPUP_ACTION, Uri.parse(url));
|
||||
final NetworkAuthenticationManager mgr = link.authenticationManager();
|
||||
if (mgr != null) {
|
||||
for (Map.Entry<String,String> entry : mgr.getTopupData().entrySet()) {
|
||||
intent.putExtra(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
if (PackageUtil.canBeStarted(activity, intent, true)) {
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
}
|
||||
}
|
||||
|
||||
static void openInBrowser(Context context, String url) {
|
||||
if (url != null) {
|
||||
url = NetworkLibrary.Instance().rewriteUrl(url, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue