projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1088 from owncloud/updated_docs_about_target_of_PRs
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
ui
/
dialog
/
CredentialsDialogFragment.java
diff --git
a/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java
b/src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java
index
080316b
..
c12b9dd
100644
(file)
--- a/
src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java
+++ b/
src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java
@@
-1,5
+1,7
@@
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@
-17,7
+19,6
@@
package com.owncloud.android.ui.dialog;
package com.owncloud.android.ui.dialog;
-import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AuthenticatorActivity;
@@
-26,6
+27,7
@@
import android.app.Dialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.os.Bundle;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.os.Bundle;
+import android.support.v4.app.DialogFragment;
import android.text.InputType;
import android.view.WindowManager.LayoutParams;
import android.webkit.HttpAuthHandler;
import android.text.InputType;
import android.view.WindowManager.LayoutParams;
import android.webkit.HttpAuthHandler;
@@
-39,7
+41,7
@@
import android.widget.LinearLayout;
* Dialog to input authentication credentials
*
*/
* Dialog to input authentication credentials
*
*/
-public class CredentialsDialogFragment extends
Sherlock
DialogFragment
+public class CredentialsDialogFragment extends DialogFragment
implements DialogInterface.OnClickListener {
private WebView mWebView = null;
implements DialogInterface.OnClickListener {
private WebView mWebView = null;
@@
-58,9
+60,11
@@
public class CredentialsDialogFragment extends SherlockDialogFragment
* @param handler HttpAuthHandler
* @return Dialog ready to show
*/
* @param handler HttpAuthHandler
* @return Dialog ready to show
*/
- public static CredentialsDialogFragment newInstanceForCredentials(WebView webView, HttpAuthHandler handler) {
+ public static CredentialsDialogFragment newInstanceForCredentials(WebView webView,
+ HttpAuthHandler handler) {
if (handler == null) {
if (handler == null) {
- throw new IllegalArgumentException("Trying to create instance with parameter handler == null");
+ throw new IllegalArgumentException("Trying to create instance with parameter handler" +
+ " == null");
}
CredentialsDialogFragment frag = new CredentialsDialogFragment();
frag.mHandler = handler;
}
CredentialsDialogFragment frag = new CredentialsDialogFragment();
frag.mHandler = handler;
@@
-73,16
+77,16
@@
public class CredentialsDialogFragment extends SherlockDialogFragment
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Create field for username
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Create field for username
- mUsernameET = new EditText(get
Sherlock
Activity());
- mUsernameET.setHint(get
Sherlock
Activity().getText(R.string.auth_username));
+ mUsernameET = new EditText(getActivity());
+ mUsernameET.setHint(getActivity().getText(R.string.auth_username));
// Create field for password
// Create field for password
- mPasswordET = new EditText(get
Sherlock
Activity());
- mPasswordET.setHint(get
Sherlock
Activity().getText(R.string.auth_password));
+ mPasswordET = new EditText(getActivity());
+ mPasswordET.setHint(getActivity().getText(R.string.auth_password));
mPasswordET.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
// Prepare LinearLayout for dialog
mPasswordET.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
// Prepare LinearLayout for dialog
- LinearLayout ll = new LinearLayout(get
Sherlock
Activity());
+ LinearLayout ll = new LinearLayout(getActivity());
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(mUsernameET);
ll.addView(mPasswordET);
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(mUsernameET);
ll.addView(mPasswordET);
@@
-92,8
+96,8
@@
public class CredentialsDialogFragment extends SherlockDialogFragment
setRetainInstance(true);
Builder authDialog = new AlertDialog
setRetainInstance(true);
Builder authDialog = new AlertDialog
- .Builder(get
Sherlock
Activity())
- .setTitle(get
Sherlock
Activity().getText(R.string.saml_authentication_required_text))
+ .Builder(getActivity())
+ .setTitle(getActivity().getText(R.string.saml_authentication_required_text))
.setView(ll)
.setCancelable(false)
.setPositiveButton(R.string.common_ok, this)
.setView(ll)
.setCancelable(false)
.setPositiveButton(R.string.common_ok, this)