import android.os.Handler;\r
import android.os.IBinder;\r
import android.preference.PreferenceManager;\r
+import android.support.v4.app.DialogFragment;\r
import android.support.v4.app.Fragment;\r
import android.support.v4.app.FragmentManager;\r
import android.support.v4.app.FragmentTransaction;\r
import android.widget.TextView.OnEditorActionListener;\r
import android.widget.Toast;\r
\r
-import com.actionbarsherlock.app.SherlockDialogFragment;\r
import com.owncloud.android.MainApp;\r
import com.owncloud.android.R;\r
import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;\r
/// Identifier of operation in progress which result shouldn't be lost \r
private long mWaitingForOpId = Long.MAX_VALUE;\r
\r
- private final String BASIC_TOKEN_TYPE = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());\r
- private final String OAUTH_TOKEN_TYPE = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());\r
+ private final String BASIC_TOKEN_TYPE = AccountTypeUtils.getAuthTokenTypePass(\r
+ MainApp.getAccountType());\r
+ private final String OAUTH_TOKEN_TYPE = AccountTypeUtils.getAuthTokenTypeAccessToken(\r
+ MainApp.getAccountType());\r
private final String SAML_TOKEN_TYPE =\r
AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType());\r
\r
protected void onCreate(Bundle savedInstanceState) {\r
//Log_OC.wtf(TAG, "onCreate init");\r
super.onCreate(savedInstanceState);\r
- getWindow().requestFeature(Window.FEATURE_NO_TITLE);\r
+\r
+ // Workaround, for fixing a problem with Android Library Suppor v7 19\r
+ //getWindow().requestFeature(Window.FEATURE_NO_TITLE);\r
+ if (getSupportActionBar() != null) {\r
+ getSupportActionBar().hide();\r
+\r
+ getSupportActionBar().setDisplayHomeAsUpEnabled(false);\r
+ getSupportActionBar().setDisplayShowHomeEnabled(false);\r
+ getSupportActionBar().setDisplayShowTitleEnabled(false);\r
+ }\r
\r
mIsFirstAuthAttempt = true;\r
\r
Intent getServerInfoIntent = new Intent();\r
getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
getServerInfoIntent.putExtra(\r
- OperationsService.EXTRA_SERVER_URL,\r
- normalizeUrlSuffix(uri)\r
+ OperationsService.EXTRA_SERVER_URL,\r
+ normalizeUrlSuffix(uri)\r
);\r
if (mOperationsServiceBinder != null) {\r
mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);\r
dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);\r
\r
/// validate credentials accessing the root folder\r
- OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBasicCredentials(username, password);\r
+ OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBasicCredentials(username,\r
+ password);\r
accessRootFolder(credentials);\r
}\r
\r
\r
} catch (AccountNotFoundException e) {\r
Log_OC.e(TAG, "Account " + mAccount + " was removed!", e);\r
- Toast.makeText(this, R.string.auth_account_does_not_exist, Toast.LENGTH_SHORT).show();\r
+ Toast.makeText(this, R.string.auth_account_does_not_exist,\r
+ Toast.LENGTH_SHORT).show();\r
finish();\r
}\r
}\r
url = "http://" + url;\r
}\r
}\r
- \r
+\r
url = normalizeUrlSuffix(url);\r
}\r
return (url != null ? url : "");\r
Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);\r
\r
/// validate token accessing to root folder / getting session\r
- OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBearerCredentials(mAuthToken);\r
+ OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBearerCredentials(\r
+ mAuthToken);\r
accessRootFolder(credentials);\r
\r
} else {\r
\r
} catch (AccountNotFoundException e) {\r
Log_OC.e(TAG, "Account " + mAccount + " was removed!", e);\r
- Toast.makeText(this, R.string.auth_account_does_not_exist, Toast.LENGTH_SHORT).show();\r
+ Toast.makeText(this, R.string.auth_account_does_not_exist,\r
+ Toast.LENGTH_SHORT).show();\r
finish();\r
}\r
}\r
response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);\r
\r
if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
- equals(mAuthTokenType)) { \r
+ equals(mAuthTokenType)) {\r
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
// the next line is necessary, notifications are calling directly to the \r
// AuthenticatorActivity to update, without AccountManager intervention\r
mAuthToken = sessionCookie;\r
getRemoteUserNameOperation(sessionCookie, true);\r
Fragment fd = getSupportFragmentManager().findFragmentByTag(SAML_DIALOG_TAG);\r
- if (fd != null && fd instanceof SherlockDialogFragment) {\r
- Dialog d = ((SherlockDialogFragment)fd).getDialog();\r
+ if (fd != null && fd instanceof DialogFragment) {\r
+ Dialog d = ((DialogFragment)fd).getDialog();\r
if (d != null && d.isShowing()) {\r
d.dismiss();\r
}\r
\r
private void dismissDialog(String dialogTag){\r
Fragment frag = getSupportFragmentManager().findFragmentByTag(dialogTag);\r
- if (frag != null && frag instanceof SherlockDialogFragment) {\r
- SherlockDialogFragment dialog = (SherlockDialogFragment) frag;\r
+ if (frag != null && frag instanceof DialogFragment) {\r
+ DialogFragment dialog = (DialogFragment) frag;\r
dialog.dismiss();\r
}\r
}\r
mIsFirstAuthAttempt = true;\r
}\r
\r
-\r
}\r