Search in sources :

Example 1 with ProfileActivity

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;
    }
}
Also used : ProfileActivity(com.moro.mtweaks.activities.tools.profile.ProfileActivity) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) SwitchCompat(androidx.appcompat.widget.SwitchCompat) Nullable(androidx.annotation.Nullable)

Aggregations

View (android.view.View)1 TextView (android.widget.TextView)1 Nullable (androidx.annotation.Nullable)1 SwitchCompat (androidx.appcompat.widget.SwitchCompat)1 ProfileActivity (com.moro.mtweaks.activities.tools.profile.ProfileActivity)1