use of com.moro.mtweaks.activities.tools.profile.ProfileActivity in project MTweaks-KernelAdiutorMOD by morogoku.
the class ApplyOnBootFragment method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (getActivity() instanceof ProfileActivity) {
View rootView = inflater.inflate(R.layout.fragment_description, container, false);
TextView title = rootView.findViewById(R.id.title);
TextView summary = rootView.findViewById(R.id.summary);
title.setText(getString(R.string.apply_on_boot));
summary.setText(getString(R.string.apply_on_boot_not_available));
return rootView;
} else {
View rootView = inflater.inflate(R.layout.fragment_apply_on_boot, container, false);
final String category = getArguments().getString(INTENT_CATEGORY);
SwitchCompat switcher = rootView.findViewById(R.id.switcher);
switcher.setChecked(AppSettings.getBoolean(category, false, getActivity()));
switcher.setOnCheckedChangeListener((buttonView, isChecked) -> AppSettings.saveBoolean(category, isChecked, getActivity()));
return rootView;
}
}
Aggregations