mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
signup link in authorisation dialog has gone
This commit is contained in:
parent
b4a219aefe
commit
8af170cd9b
5 changed files with 2 additions and 63 deletions
|
@ -67,26 +67,6 @@
|
|||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:id="@+id/authentication_signup_box"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/authentication_signup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textColor="#0000ff"
|
||||
android:textStyle="bold"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/link"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -69,11 +69,8 @@ public class AuthenticationActivity extends Activity {
|
|||
static final String USERNAME_KEY = "username";
|
||||
static final String PASSWORD_KEY = "password";
|
||||
static final String ERROR_KEY = "error";
|
||||
static final String SHOW_SIGNUP_LINK_KEY = "showSignupLink";
|
||||
static final String CUSTOM_AUTH_KEY = "customAuth";
|
||||
|
||||
static final int RESULT_SIGNUP = RESULT_FIRST_USER;
|
||||
|
||||
static class CredentialsCreator implements ZLNetworkManager.CredentialsCreator {
|
||||
private final Activity myActivity;
|
||||
private final int myCode;
|
||||
|
@ -153,7 +150,6 @@ public class AuthenticationActivity extends Activity {
|
|||
final String area = intent.getStringExtra(AREA_KEY);
|
||||
final String username = intent.getStringExtra(USERNAME_KEY);
|
||||
final String error = intent.getStringExtra(ERROR_KEY);
|
||||
final boolean showSignupLink = intent.getBooleanExtra(SHOW_SIGNUP_LINK_KEY, false);
|
||||
myCustomAuthentication = intent.getBooleanExtra(CUSTOM_AUTH_KEY, false);
|
||||
myOnSuccessRunnable = ourOnSuccessRunnableMap.remove(intent.getLongExtra(RUNNABLE_KEY, -1));
|
||||
|
||||
|
@ -184,20 +180,6 @@ public class AuthenticationActivity extends Activity {
|
|||
|
||||
setError(error);
|
||||
|
||||
if (showSignupLink) {
|
||||
findViewById(R.id.authentication_signup_box).setVisibility(View.VISIBLE);
|
||||
final TextView signupView = (TextView)findViewById(R.id.authentication_signup);
|
||||
signupView.setText(myResource.getResource("register").getValue());
|
||||
signupView.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
setResult(RESULT_SIGNUP, Util.intentByLink(new Intent(), myLink));
|
||||
finish();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
findViewById(R.id.authentication_signup_box).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
final ZLResource buttonResource = ZLResource.resource("dialog").getResource("button");
|
||||
|
||||
myOkButton = findButton(R.id.authentication_ok_button);
|
||||
|
|
|
@ -389,9 +389,6 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
|
|||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case NetworkLibraryActivity.CUSTOM_AUTHENTICATION_CODE:
|
||||
Util.processCustomAuthentication(this, resultCode, data);
|
||||
break;
|
||||
case NetworkLibraryActivity.SIGNUP_CODE:
|
||||
Util.processSignup(myBook.Link, resultCode, data);
|
||||
break;
|
||||
|
|
|
@ -55,8 +55,7 @@ import org.geometerplus.android.fbreader.network.action.*;
|
|||
|
||||
public class NetworkLibraryActivity extends BaseActivity implements NetworkView.EventListener {
|
||||
protected static final int BASIC_AUTHENTICATION_CODE = 1;
|
||||
protected static final int CUSTOM_AUTHENTICATION_CODE = 2;
|
||||
protected static final int SIGNUP_CODE = 3;
|
||||
protected static final int SIGNUP_CODE = 2;
|
||||
|
||||
private static final String ACTIVITY_BY_TREE_KEY = "ActivityByTree";
|
||||
|
||||
|
@ -332,9 +331,6 @@ public class NetworkLibraryActivity extends BaseActivity implements NetworkView.
|
|||
case BASIC_AUTHENTICATION_CODE:
|
||||
myCredentialsCreator.onDataReceived(resultCode, intent);
|
||||
break;
|
||||
case CUSTOM_AUTHENTICATION_CODE:
|
||||
Util.processCustomAuthentication(this, resultCode, intent);
|
||||
break;
|
||||
case SIGNUP_CODE:
|
||||
Util.processSignup(((NetworkCatalogTree)getCurrentTree()).Item.Link, resultCode, intent);
|
||||
break;
|
||||
|
|
|
@ -85,25 +85,9 @@ public abstract class Util implements UserRegistrationConstants {
|
|||
final Intent intent = intentByLink(new Intent(activity, AuthenticationActivity.class), link);
|
||||
AuthenticationActivity.registerRunnable(intent, onSuccess);
|
||||
intent.putExtra(AuthenticationActivity.USERNAME_KEY, mgr.UserNameOption.getValue());
|
||||
if (isRegistrationSupported(activity, link)) {
|
||||
intent.putExtra(AuthenticationActivity.SHOW_SIGNUP_LINK_KEY, true);
|
||||
}
|
||||
intent.putExtra(AuthenticationActivity.SCHEME_KEY, "https");
|
||||
intent.putExtra(AuthenticationActivity.CUSTOM_AUTH_KEY, true);
|
||||
activity.startActivityForResult(intent, NetworkLibraryActivity.CUSTOM_AUTHENTICATION_CODE);
|
||||
}
|
||||
|
||||
static void processCustomAuthentication(final Activity activity, int resultCode, Intent data) {
|
||||
final INetworkLink link = linkByIntent(data);
|
||||
if (link == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (resultCode) {
|
||||
case AuthenticationActivity.RESULT_SIGNUP:
|
||||
runRegistrationDialog(activity, link);
|
||||
break;
|
||||
}
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
||||
static void processSignup(INetworkLink link, int resultCode, Intent data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue