Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
Notes
Commits
adda826f
Commit
adda826f
authored
Jan 14, 2022
by
Michael Enoma
👽
Browse files
Ecloud Sync
parent
72693431
Pipeline
#157357
failed with stage
in 2 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java
View file @
adda826f
...
...
@@ -70,16 +70,6 @@ import android.widget.ProgressBar;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
foundation.e.cert4android.CustomCertManager
;
import
foundation.e.cert4android.IOnCertificateDecision
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
foundation.e.notes.R
;
import
foundation.e.notes.persistence.NoteSQLiteOpenHelper
;
import
foundation.e.notes.persistence.NoteServerSyncHelper
;
import
foundation.e.notes.util.ExceptionHandler
;
import
foundation.e.notes.util.NotesClientUtil
;
import
foundation.e.notes.util.NotesClientUtil.LoginStatus
;
import
androidx.annotation.ColorInt
;
import
androidx.appcompat.app.AppCompatActivity
;
...
...
@@ -103,7 +93,6 @@ import static android.os.Process.myPid;
public
class
ImportAccountActivity
extends
AppCompatActivity
{
public
static
final
String
SETTINGS_URL
=
"settingsUrl"
;
public
static
final
String
SETTINGS_USERNAME
=
"settingsUsername"
;
public
static
final
String
SETTINGS_PASSWORD
=
"settingsPassword"
;
...
...
@@ -116,16 +105,21 @@ public class ImportAccountActivity extends AppCompatActivity {
public
static
final
String
LOGIN_URL_DATA_KEY_VALUE_SEPARATOR
=
":"
;
public
static
final
String
WEBDAV_PATH_4_0_AND_LATER
=
"/remote.php/webdav"
;
private
SharedPreferences
preferences
=
null
;
View
urlWarnHttp
;
private
String
old_password
=
""
;
private
WebView
webView
;
private
boolean
first_run
=
false
;
private
boolean
useWebLogin
=
true
;
private
final
static
String
key_login_account
=
"login_account"
;
private
final
static
String
login_account_eelo
=
"login_account_eelo"
;
private
final
static
String
login_account_manual
=
"login_account_manual"
;
public
final
static
String
eelo_account_type
=
"e.foundation.webdav.eelo"
;
private
WebView
webView
;
private
boolean
first_run
=
false
;
private
boolean
useWebLogin
=
true
;
private
final
static
int
pick_account_request_code
=
1
;
...
...
@@ -149,6 +143,8 @@ public class ImportAccountActivity extends AppCompatActivity {
binding
=
ActivityImportAccountBinding
.
inflate
(
getLayoutInflater
());
importAccountViewModel
=
new
ViewModelProvider
(
this
).
get
(
ImportAccountViewModel
.
class
);
preferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
getApplicationContext
());
setContentView
(
binding
.
getRoot
());
...
...
@@ -172,10 +168,20 @@ public class ImportAccountActivity extends AppCompatActivity {
});
binding
.
addButton1
.
setOnClickListener
((
v
)
->
{
binding
.
addButton
1
.
setEnabled
(
false
);
binding
.
addButton
.
setEnabled
(
false
);
binding
.
status
.
setVisibility
(
View
.
GONE
);
}
try
{
AccountImporter
.
pickNewAccount
(
this
);
}
catch
(
NextcloudFilesAppNotInstalledException
e
)
{
UiExceptionManager
.
showDialogForException
(
this
,
e
);
Log
.
w
(
TAG
,
"============================================================="
);
Log
.
w
(
TAG
,
"Nextcloud app is not installed. Cannot choose account"
);
e
.
printStackTrace
();
}
catch
(
AndroidGetAccountsPermissionNotGranted
e
)
{
binding
.
addButton
.
setEnabled
(
true
);
AccountImporter
.
requestAndroidAccountPermissionsAndPickAccount
(
this
);
}
});
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment