Proyectos de Subversion Android Microlearning - Inconcert

Rev

Rev 7 | Rev 9 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7 Rev 8
Línea 33... Línea 33...
33
import android.os.Bundle;
33
import android.os.Bundle;
34
import android.view.Menu;
34
import android.view.Menu;
35
import android.view.MenuItem;
35
import android.view.MenuItem;
36
import android.view.View;
36
import android.view.View;
37
import android.view.animation.AnticipateInterpolator;
37
import android.view.animation.AnticipateInterpolator;
-
 
38
import android.view.inputmethod.InputMethodManager;
38
import android.widget.PopupMenu;
39
import android.widget.PopupMenu;
39
import android.widget.ProgressBar;
40
import android.widget.ProgressBar;
40
import android.widget.TextView;
41
import android.widget.TextView;
Línea 54... Línea 55...
54
import com.cesams.twogetskills.inconcert.dao.SyncDao;
55
import com.cesams.twogetskills.inconcert.dao.SyncDao;
55
import com.cesams.twogetskills.inconcert.dao.TopicDao;
56
import com.cesams.twogetskills.inconcert.dao.TopicDao;
56
import com.cesams.twogetskills.inconcert.dao.UserExtendedDao;
57
import com.cesams.twogetskills.inconcert.dao.UserExtendedDao;
57
import com.cesams.twogetskills.inconcert.dao.UserLogDao;
58
import com.cesams.twogetskills.inconcert.dao.UserLogDao;
58
import com.cesams.twogetskills.inconcert.entity.UserExtended;
59
import com.cesams.twogetskills.inconcert.entity.UserExtended;
-
 
60
import com.cesams.twogetskills.inconcert.fragment.BiometricOptions;
59
import com.cesams.twogetskills.inconcert.fragment.CapsuleFragment;
61
import com.cesams.twogetskills.inconcert.fragment.CapsuleFragment;
60
import com.cesams.twogetskills.inconcert.fragment.CompanyFragment;
62
import com.cesams.twogetskills.inconcert.fragment.CompanyFragment;
61
import com.cesams.twogetskills.inconcert.fragment.FinishCapsuleFragment;
63
import com.cesams.twogetskills.inconcert.fragment.FinishCapsuleFragment;
62
import com.cesams.twogetskills.inconcert.fragment.FinishTopicFragment;
64
import com.cesams.twogetskills.inconcert.fragment.FinishTopicFragment;
63
import com.cesams.twogetskills.inconcert.fragment.GalleryFragment;
65
import com.cesams.twogetskills.inconcert.fragment.GalleryFragment;
Línea 239... Línea 241...
239
 
241
 
240
            mNavigationView.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
242
            mNavigationView.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
241
                @Override
243
                @Override
Línea -... Línea 244...
-
 
244
                public boolean onNavigationItemSelected(@NonNull MenuItem item) {
-
 
245
 
Línea 242... Línea 246...
242
                public boolean onNavigationItemSelected(@NonNull MenuItem item) {
246
                    //Ocultamos el teclado para mejor experiencia
Línea 243... Línea 247...
243
 
247
                    hideKeyboard(mNavigationView);
244
 
248
 
Línea 355... Línea 359...
355
 
359
 
356
 
360
 
Línea -... Línea 361...
-
 
361
            }
-
 
362
    }
-
 
363
 
-
 
364
    public void hideKeyboard(View view) {
-
 
365
 
-
 
366
        try {
-
 
367
            InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
-
 
368
            inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
-
 
369
        } catch (Exception e) {
-
 
370
            e.printStackTrace();
357
            }
371
        }
358
    }
372
    }
359
 
373
 
Línea 360... Línea 374...
360
    @Override
374
    @Override
Línea 371... Línea 385...
371
 
385
 
372
    @Override
386
    @Override
373
    public boolean onOptionsItemSelected(MenuItem item) {
387
    public boolean onOptionsItemSelected(MenuItem item) {
374
        if (item.getItemId()==R.id.action_notifications) {// Toast.makeText(this, "Abriendo centro de notificaciones", Toast.LENGTH_LONG).show();
388
        if (item.getItemId()==R.id.action_notifications) {// Toast.makeText(this, "Abriendo centro de notificaciones", Toast.LENGTH_LONG).show();
-
 
389
            invokeFragment(Constants.IDX_FRAGMENT_NOTIFICATION);
-
 
390
            //Ocultamos el teclado para mejor experiencia
375
            invokeFragment(Constants.IDX_FRAGMENT_NOTIFICATION);
391
            hideKeyboard(mNavigationView);
376
        }
392
        }
377
        return true;
393
        return true;
Línea 378... Línea 394...
378
    }
394
    }
Línea 402... Línea 418...
402
            }
418
            }
Línea 403... Línea 419...
403
 
419
 
404
 
420
 
-
 
421
        } else {
-
 
422
            if(preference.getFragmentIdxActive() == 0) {
-
 
423
                if(preference.getBiometricLogin())
-
 
424
                {
-
 
425
                    hideNavigationAndtoolbar();
-
 
426
                    invokeFragment(Constants.IDX_FRAGMENT_BIOMETRIC);
405
        } else {
427
                }
-
 
428
                else{
-
 
429
                invokeFragment(Constants.IDX_FRAGMENT_WELCOME); //La pantalla principal ahora es Welcome, no Topic
406
            if(preference.getFragmentIdxActive() == 0) {
430
                }
-
 
431
 
-
 
432
            } else {
-
 
433
                if(preference.getBiometricLogin())
-
 
434
                {
-
 
435
                    hideNavigationAndtoolbar();
-
 
436
                    invokeFragment(Constants.IDX_FRAGMENT_BIOMETRIC);
407
                invokeFragment(Constants.IDX_FRAGMENT_WELCOME); //La pantalla principal ahora es Welcome, no Topic
437
                }else
408
            } else {
438
                {
-
 
439
                invokeFragment(preference.getFragmentIdxActive());
409
                invokeFragment(preference.getFragmentIdxActive());
440
            }
Línea 410... Línea 441...
410
            }
441
            }
Línea 411... Línea 442...
411
        }
442
        }
Línea 1014... Línea 1045...
1014
                     add = true;
1045
                     add = true;
1015
                     fragment = new SigninFragment();
1046
                     fragment = new SigninFragment();
1016
                 }
1047
                 }
1017
                break;
1048
                break;
Línea -... Línea 1049...
-
 
1049
 
-
 
1050
            case Constants.IDX_FRAGMENT_BIOMETRIC:
-
 
1051
                // badgenotification.setVisibility(View.GONE);
-
 
1052
 
-
 
1053
                // getSupportActionBar().hide();
-
 
1054
                if(fragmentHashMap.containsKey(fragmentKeyNuevo)) {
-
 
1055
                    fragment = fragmentHashMap.get(fragmentKeyNuevo);
-
 
1056
                } else {
-
 
1057
                    add = true;
-
 
1058
                    fragment = new BiometricOptions();
-
 
1059
                }
-
 
1060
                break;
1018
 
1061
 
1019
            case Constants.IDX_FRAGMENT_TOPICS :
1062
            case Constants.IDX_FRAGMENT_TOPICS :
Línea 1020... Línea 1063...
1020
              //  badgenotification.setVisibility(View.GONE);
1063
              //  badgenotification.setVisibility(View.GONE);
1021
 
1064