Proyectos de Subversion Android Microlearning - Nuevo Interface

Rev

Rev 54 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 gabriel 1
package com.cesams.twogetskills.fragment;
2
 
21 gabriel 3
import android.content.Intent;
45 gabriel 4
import android.graphics.drawable.AnimationDrawable;
21 gabriel 5
import android.net.Uri;
1 gabriel 6
import android.os.Bundle;
7
 
8
import androidx.annotation.NonNull;
9
import androidx.annotation.Nullable;
56 gabriel 10
import androidx.constraintlayout.widget.ConstraintLayout;
1 gabriel 11
import androidx.fragment.app.Fragment;
12
 
45 gabriel 13
import android.os.Handler;
14
import android.os.Looper;
1 gabriel 15
import android.util.Log;
16
import android.view.LayoutInflater;
17
import android.view.Menu;
18
import android.view.MenuInflater;
19
import android.view.View;
20
import android.view.ViewGroup;
21
import android.widget.Button;
45 gabriel 22
import android.widget.ImageView;
1 gabriel 23
import android.widget.TextView;
54 gabriel 24
import android.widget.Toast;
1 gabriel 25
 
26
import com.airbnb.lottie.LottieAnimationView;
27
import com.cesams.twogetskills.Constants;
28
import com.cesams.twogetskills.R;
29
import com.cesams.twogetskills.skeleton.ITwoGetSkills;
30
 
45 gabriel 31
import java.util.Timer;
32
import java.util.TimerTask;
1 gabriel 33
 
45 gabriel 34
 
1 gabriel 35
public class IntroFragment extends Fragment {
36
 
37
    private Button buttonGetStarted;
38
    private ITwoGetSkills iTwoGetSkills;
56 gabriel 39
    int stepper=0;
40
    private TextView introtext,signin,knowmore,derechos,appname;
41
    ImageView lamp,logotwoget,logointro;
1 gabriel 42
 
43
    public IntroFragment() {
44
        // Required empty public constructor
45
    }
46
 
47
 
48
 
49
    @Override
50
    public void onCreate(@Nullable Bundle savedInstanceState) {
51
        super.onCreate(savedInstanceState);
52
        setHasOptionsMenu(true);
53
    }
54
 
55
    @Override
56
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
57
        super.onCreateOptionsMenu(menu, inflater);
58
        menu.clear();
59
    }
60
 
61
    @Override
62
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
63
                             Bundle savedInstanceState) {
64
        // Inflate the layout for this fragment
65
        return inflater.inflate(R.layout.fragment_intro, container, false);
66
    }
67
 
68
    @Override
69
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
70
        super.onViewCreated(view, savedInstanceState);
71
 
45 gabriel 72
 
56 gabriel 73
 
74
        lamp=view.findViewById(R.id.imageView5); appname=view.findViewById(R.id.appnameintro);
75
        logotwoget=view.findViewById(R.id.imageView2);
47 gabriel 76
        buttonGetStarted = getView().findViewById(R.id.intro_button_get_started);
56 gabriel 77
        logointro=view.findViewById(R.id.logointro);
47 gabriel 78
 
56 gabriel 79
        introtext = getView().findViewById(R.id.intro_textview_title);
80
        signin = getView().findViewById(R.id.signin_textview_communique_easily);
47 gabriel 81
 
45 gabriel 82
        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
83
            @Override
84
            public void run() {
85
 
86
 
56 gabriel 87
                logotwoget.setVisibility(View.GONE);
88
                logointro.setVisibility(View.VISIBLE);
89
                appname.setVisibility(View.VISIBLE);
90
                lamp.setVisibility(View.VISIBLE);
91
                lamp.setImageResource(R.drawable.micro);
92
                introtext.setVisibility(View.VISIBLE);
93
                buttonGetStarted.setVisibility(View.VISIBLE); //cesa.setVisibility(View.VISIBLE);
45 gabriel 94
                signin.setVisibility(View.VISIBLE);
56 gabriel 95
 
45 gabriel 96
            }
56 gabriel 97
        }, 4000);
45 gabriel 98
 
56 gabriel 99
 
100
 
1 gabriel 101
        try {
102
            iTwoGetSkills = (ITwoGetSkills) getActivity();
8 gabriel 103
            iTwoGetSkills.hideNavigationAndtoolbar();
45 gabriel 104
 
1 gabriel 105
        } catch(ClassCastException e) {
106
            new Exception("La Actividad no implementa Sign");
107
        }
108
 
109
 
110
        buttonGetStarted.setOnClickListener(new View.OnClickListener() {
111
            @Override
112
            public void onClick(View view) {
113
 
56 gabriel 114
                stepper=stepper+1;
115
                if(stepper==1){
116
                    introtext.setText(R.string.intro_capsule);
117
                    signin.setText(R.string.intro_capsule_text);
118
                    lamp.setImageResource(R.drawable.conocimiento);
119
 
120
                }
121
                if(stepper==2)
122
                {
123
                    introtext.setText(R.string.intro_innovation);
124
                    signin.setText(R.string.intro_innova_text);
125
                    lamp.setImageResource(R.drawable.innova);
126
                    buttonGetStarted.setText("Empezar");
127
                }
128
                if(stepper==3 || stepper>3)
129
                {
130
 
131
                        iTwoGetSkills.invokeFragment(Constants.IDX_FRAGMENT_SIGNIN);
132
 
133
                }
134
 
1 gabriel 135
            }
136
        });
137
    }
45 gabriel 138
 
56 gabriel 139
}