| 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;
|
|
|
10 |
import androidx.fragment.app.Fragment;
|
|
|
11 |
|
| 45 |
gabriel |
12 |
import android.os.Handler;
|
|
|
13 |
import android.os.Looper;
|
| 1 |
gabriel |
14 |
import android.util.Log;
|
|
|
15 |
import android.view.LayoutInflater;
|
|
|
16 |
import android.view.Menu;
|
|
|
17 |
import android.view.MenuInflater;
|
|
|
18 |
import android.view.View;
|
|
|
19 |
import android.view.ViewGroup;
|
|
|
20 |
import android.widget.Button;
|
| 45 |
gabriel |
21 |
import android.widget.ImageView;
|
| 1 |
gabriel |
22 |
import android.widget.TextView;
|
|
|
23 |
|
|
|
24 |
import com.airbnb.lottie.LottieAnimationView;
|
|
|
25 |
import com.cesams.twogetskills.Constants;
|
|
|
26 |
import com.cesams.twogetskills.R;
|
|
|
27 |
import com.cesams.twogetskills.skeleton.ITwoGetSkills;
|
|
|
28 |
|
| 45 |
gabriel |
29 |
import java.util.Timer;
|
|
|
30 |
import java.util.TimerTask;
|
| 1 |
gabriel |
31 |
|
| 45 |
gabriel |
32 |
|
| 1 |
gabriel |
33 |
public class IntroFragment extends Fragment {
|
|
|
34 |
|
|
|
35 |
private Button buttonGetStarted;
|
|
|
36 |
private ITwoGetSkills iTwoGetSkills;
|
|
|
37 |
LottieAnimationView figura;
|
| 45 |
gabriel |
38 |
private TextView register,introtext,signin,derechos;
|
|
|
39 |
AnimationDrawable rocketAnimation;
|
|
|
40 |
ImageView rocketImage, cesa;
|
| 1 |
gabriel |
41 |
|
|
|
42 |
public IntroFragment() {
|
|
|
43 |
// Required empty public constructor
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
@Override
|
|
|
49 |
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
50 |
super.onCreate(savedInstanceState);
|
|
|
51 |
setHasOptionsMenu(true);
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
@Override
|
|
|
55 |
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
|
56 |
super.onCreateOptionsMenu(menu, inflater);
|
|
|
57 |
menu.clear();
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
@Override
|
|
|
61 |
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
62 |
Bundle savedInstanceState) {
|
|
|
63 |
// Inflate the layout for this fragment
|
|
|
64 |
return inflater.inflate(R.layout.fragment_intro, container, false);
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
@Override
|
|
|
68 |
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
|
69 |
super.onViewCreated(view, savedInstanceState);
|
|
|
70 |
|
| 45 |
gabriel |
71 |
rocketImage = view.findViewById(R.id.imageView4);
|
|
|
72 |
rocketImage.setBackgroundResource(R.drawable.animationsplash);
|
|
|
73 |
rocketAnimation = (AnimationDrawable) rocketImage.getBackground();
|
|
|
74 |
rocketAnimation.start();
|
|
|
75 |
|
| 47 |
gabriel |
76 |
buttonGetStarted = getView().findViewById(R.id.intro_button_get_started);
|
|
|
77 |
figura = getView().findViewById(R.id.animationView3); cesa=getView().findViewById(R.id.imageView2);
|
|
|
78 |
register= getView().findViewById(R.id.knowmore); introtext = getView().findViewById(R.id.intro_textview_title);
|
|
|
79 |
signin = getView().findViewById(R.id.signin_textview_communique_easily); derechos = getView().findViewById(R.id.textView19);
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
| 45 |
gabriel |
83 |
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
|
|
84 |
@Override
|
|
|
85 |
public void run() {
|
|
|
86 |
rocketAnimation.stop();
|
|
|
87 |
rocketImage.setVisibility(View.GONE);
|
|
|
88 |
|
|
|
89 |
figura.setVisibility(View.VISIBLE); derechos.setVisibility(View.VISIBLE);
|
|
|
90 |
register.setVisibility(View.VISIBLE); introtext.setVisibility(View.VISIBLE);
|
|
|
91 |
buttonGetStarted.setVisibility(View.VISIBLE); cesa.setVisibility(View.VISIBLE);
|
|
|
92 |
|
|
|
93 |
signin.setVisibility(View.VISIBLE);
|
|
|
94 |
}
|
|
|
95 |
}, 3500);
|
|
|
96 |
|
| 1 |
gabriel |
97 |
try {
|
|
|
98 |
iTwoGetSkills = (ITwoGetSkills) getActivity();
|
| 8 |
gabriel |
99 |
iTwoGetSkills.hideNavigationAndtoolbar();
|
| 45 |
gabriel |
100 |
|
| 1 |
gabriel |
101 |
} catch(ClassCastException e) {
|
|
|
102 |
new Exception("La Actividad no implementa Sign");
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
register.setOnClickListener(new View.OnClickListener() {
|
|
|
107 |
@Override
|
| 21 |
gabriel |
108 |
public void onClick(View view) {
|
|
|
109 |
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://cesams.com"));
|
|
|
110 |
startActivity(browserIntent);
|
| 1 |
gabriel |
111 |
}
|
|
|
112 |
});
|
|
|
113 |
|
|
|
114 |
buttonGetStarted.setOnClickListener(new View.OnClickListener() {
|
|
|
115 |
@Override
|
|
|
116 |
public void onClick(View view) {
|
|
|
117 |
|
|
|
118 |
iTwoGetSkills.invokeFragment(Constants.IDX_FRAGMENT_SIGNIN);
|
|
|
119 |
}
|
|
|
120 |
});
|
|
|
121 |
}
|
| 45 |
gabriel |
122 |
|
| 1 |
gabriel |
123 |
}
|