Commit | Line | Data |
---|---|---|
724f9857 MG |
1 | package ro.ieval.unical; |
2 | ||
3 | import android.app.Fragment; | |
4 | import android.os.Bundle; | |
5 | import android.view.LayoutInflater; | |
6 | import android.view.View; | |
7 | import android.view.ViewGroup; | |
306c1a65 | 8 | import android.widget.CompoundButton; |
361c6a28 | 9 | import android.widget.LinearLayout; |
306c1a65 MG |
10 | import android.widget.Spinner; |
11 | import android.widget.Switch; | |
12 | import android.widget.CompoundButton.OnCheckedChangeListener; | |
724f9857 MG |
13 | |
14 | public final class TrivialFragment extends Fragment { | |
88ba7fcf | 15 | public static final String ARGUMENT_LAYOUT="layout"; |
724f9857 MG |
16 | |
17 | @Override | |
18 | public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { | |
361c6a28 | 19 | |
306c1a65 | 20 | final View view=inflater.inflate(getArguments().getInt(ARGUMENT_LAYOUT), container, false); |
361c6a28 PT |
21 | final LinearLayout ll = (LinearLayout) view.findViewById(R.id.repeat_layout); |
22 | ||
23 | if(ll != null){ | |
24 | final Switch repeatSwitch = (Switch) view.findViewById(R.id.repeat_switch); | |
25 | Utils.setEnabledRecursively(ll, false); | |
26 | ||
306c1a65 MG |
27 | repeatSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() { |
28 | @Override | |
29 | public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) { | |
30 | if(isChecked) { | |
361c6a28 | 31 | Utils.setEnabledRecursively(ll, true); |
306c1a65 | 32 | }else { |
361c6a28 | 33 | Utils.setEnabledRecursively(ll, false); |
306c1a65 MG |
34 | } |
35 | } | |
36 | }); | |
37 | } | |
38 | return view; | |
39 | } | |
724f9857 | 40 | } |