mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-12-18 08:32:24 +03:00
#21 hitting the back arrow on the top left causes a strange animation and all the fields to be deleted –> highly annoying
This commit is contained in:
parent
990d8f682c
commit
5283b7682f
1 changed files with 16 additions and 1 deletions
|
@ -37,6 +37,7 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
private EditText field_username = null;
|
||||
private EditText field_password = null;
|
||||
private Button btn_submit = null;
|
||||
private boolean first_run = false;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -46,6 +47,11 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
preferences = PreferenceManager
|
||||
.getDefaultSharedPreferences(getApplicationContext());
|
||||
|
||||
if (preferences.getBoolean(SettingsActivity.SETTINGS_FIRST_RUN, true)) {
|
||||
first_run = true;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
}
|
||||
|
||||
field_url = (EditText) findViewById(R.id.settings_url);
|
||||
field_username = (EditText) findViewById(R.id.settings_username);
|
||||
field_password = (EditText) findViewById(R.id.settings_password);
|
||||
|
@ -94,12 +100,21 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||
url = "https://" + url;
|
||||
}
|
||||
Log.v("Note", "URL: " + url);
|
||||
new LoginValidatorAsyncTask().execute(url, username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent pressing back button on first run
|
||||
*/
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (!first_run) {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
/************************************ Async Tasks ************************************/
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue