|
@@ -5,7 +5,9 @@ import android.content.Context;
|
5
|
5
|
import android.content.DialogInterface;
|
6
|
6
|
import android.content.Intent;
|
7
|
7
|
import android.os.Bundle;
|
|
8
|
+import android.support.design.widget.CoordinatorLayout;
|
8
|
9
|
import android.support.design.widget.NavigationView;
|
|
10
|
+import android.support.design.widget.Snackbar;
|
9
|
11
|
import android.support.multidex.MultiDex;
|
10
|
12
|
import android.support.v4.app.FragmentManager;
|
11
|
13
|
import android.support.v4.widget.DrawerLayout;
|
|
@@ -75,6 +77,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
75
|
77
|
@BindView(R.id.nav_view)
|
76
|
78
|
NavigationView _navigationView;
|
77
|
79
|
|
|
80
|
+ @BindView(R.id.coordinatorLayout)
|
|
81
|
+ CoordinatorLayout _coordinatorLayout;
|
|
82
|
+
|
78
|
83
|
private LoginButton _btnLogin;
|
79
|
84
|
|
80
|
85
|
private TextView _textUserName;
|
|
@@ -171,6 +176,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
171
|
176
|
|
172
|
177
|
@Override
|
173
|
178
|
public void onError(FacebookException error) {
|
|
179
|
+// Snackbar.make(_coordinatorLayout, error.toString(), Snackbar.LENGTH_LONG).show();
|
174
|
180
|
Toast.makeText(MainActivity.this, error.toString(), Toast.LENGTH_LONG).show();
|
175
|
181
|
}
|
176
|
182
|
});
|
|
@@ -400,6 +406,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
400
|
406
|
public void execute(final String data) {
|
401
|
407
|
progressDialog.dismiss();
|
402
|
408
|
if (data == null) {
|
|
409
|
+// Snackbar.make(_coordinatorLayout, R.string.encryption_empty, Snackbar.LENGTH_LONG).show();
|
403
|
410
|
Toast.makeText(MainActivity.this, R.string.encryption_empty, Toast.LENGTH_LONG).show();
|
404
|
411
|
return;
|
405
|
412
|
}
|
|
@@ -408,9 +415,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
408
|
415
|
public void execute(String password) {
|
409
|
416
|
UsersSettingsDbo settingsDbo = UsersSettingsBusiness.decryptSettings(data, password);
|
410
|
417
|
if (settingsDbo == null) {
|
|
418
|
+// Snackbar.make(_coordinatorLayout, R.string.encryption_bad_password, Snackbar.LENGTH_LONG).show();
|
411
|
419
|
Toast.makeText(MainActivity.this, R.string.encryption_bad_password, Toast.LENGTH_LONG).show();
|
412
|
420
|
}
|
413
|
421
|
else {
|
|
422
|
+// Snackbar.make(_coordinatorLayout, R.string.settings_restored, Snackbar.LENGTH_LONG).show();
|
414
|
423
|
Toast.makeText(MainActivity.this, R.string.settings_restored, Toast.LENGTH_LONG).show();
|
415
|
424
|
STSBusiness.setUserSettings(MainActivity.this, settingsDbo);
|
416
|
425
|
goToHome();
|
|
@@ -422,6 +431,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
422
|
431
|
@Override
|
423
|
432
|
public void execute(LuPromiseError data) {
|
424
|
433
|
progressDialog.dismiss();
|
|
434
|
+// Snackbar.make(_coordinatorLayout, data.toString(), Snackbar.LENGTH_LONG).show();
|
425
|
435
|
Toast.makeText(MainActivity.this, data.toString(), Toast.LENGTH_LONG).show();
|
426
|
436
|
}
|
427
|
437
|
});
|
|
@@ -446,12 +456,14 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
446
|
456
|
@Override
|
447
|
457
|
public void execute(LuVoidDbo data) {
|
448
|
458
|
progressDialog.dismiss();
|
|
459
|
+// Snackbar.make(_coordinatorLayout, R.string.settings_backed_up, Snackbar.LENGTH_LONG).show();
|
449
|
460
|
Toast.makeText(MainActivity.this, R.string.settings_backed_up, Toast.LENGTH_LONG).show();
|
450
|
461
|
}
|
451
|
462
|
}, new LuConsumer<LuPromiseError>() {
|
452
|
463
|
@Override
|
453
|
464
|
public void execute(LuPromiseError data) {
|
454
|
465
|
progressDialog.dismiss();
|
|
466
|
+// Snackbar.make(_coordinatorLayout, data.toString(), Snackbar.LENGTH_LONG).show();
|
455
|
467
|
Toast.makeText(MainActivity.this, data.toString(), Toast.LENGTH_LONG).show();
|
456
|
468
|
}
|
457
|
469
|
});
|