1 |
efrain |
1 |
package com.cesams.twogetskills.fragment;
|
|
|
2 |
|
|
|
3 |
import android.os.Bundle;
|
|
|
4 |
import android.view.LayoutInflater;
|
|
|
5 |
import android.view.Menu;
|
|
|
6 |
import android.view.MenuInflater;
|
|
|
7 |
import android.view.View;
|
|
|
8 |
import android.view.ViewGroup;
|
|
|
9 |
import android.widget.Button;
|
|
|
10 |
|
|
|
11 |
import androidx.annotation.NonNull;
|
|
|
12 |
import androidx.annotation.Nullable;
|
|
|
13 |
import androidx.fragment.app.Fragment;
|
|
|
14 |
|
|
|
15 |
import com.cesams.twogetskills.Constants;
|
|
|
16 |
import com.cesams.twogetskills.R;
|
|
|
17 |
import com.cesams.twogetskills.skeleton.ITwoGetSkills;
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
public class FinishTopicFragment extends Fragment {
|
|
|
21 |
|
|
|
22 |
private Button button;
|
|
|
23 |
private ITwoGetSkills iTwoGetSkills;
|
|
|
24 |
|
|
|
25 |
public FinishTopicFragment() {
|
|
|
26 |
// Required empty public constructor
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
@Override
|
|
|
30 |
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
31 |
super.onCreate(savedInstanceState);
|
|
|
32 |
setHasOptionsMenu(true);
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
@Override
|
|
|
36 |
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
|
37 |
super.onCreateOptionsMenu(menu, inflater);
|
|
|
38 |
menu.clear();
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
@Override
|
|
|
42 |
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
43 |
Bundle savedInstanceState) {
|
|
|
44 |
// Inflate the layout for this fragment
|
|
|
45 |
return inflater.inflate(R.layout.fragment_finish_topic, container, false);
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
@Override
|
|
|
49 |
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
|
50 |
super.onViewCreated(view, savedInstanceState);
|
|
|
51 |
|
|
|
52 |
try {
|
|
|
53 |
iTwoGetSkills = (ITwoGetSkills) getActivity();
|
|
|
54 |
} catch(ClassCastException e) {
|
|
|
55 |
new Exception("La Actividad no implementa Sign");
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
button = (Button) getView().findViewById(R.id.fragment_finish_topic_button);
|
|
|
59 |
button.setOnClickListener(new View.OnClickListener() {
|
|
|
60 |
@Override
|
|
|
61 |
public void onClick(View view) {
|
|
|
62 |
iTwoGetSkills.requestExecuteSyncAdapter();
|
|
|
63 |
iTwoGetSkills.invokeFragment(Constants.IDX_FRAGMENT_TOPICS);
|
|
|
64 |
}
|
|
|
65 |
});
|
|
|
66 |
}
|
|
|
67 |
}
|