@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.wizard_account_configure, container, false); mManualConfigButton = (Button) v.findViewById(R.id.manual_setup); mManualConfigButton.setOnClickListener(this); mNextButton = (Button) v.findViewById(R.id.next); mNextButton.setOnClickListener(this); mSelectAccountButton = (Button) v.findViewById(R.id.select_account_btn); mSelectAccountButton.setOnClickListener(this); mErrorLabel = (TextView) v.findViewById(R.id.error_label); mSettingsWarningLabel = (TextView) v.findViewById(R.id.settings_warn_label); mAccountJID = (EditText) v.findViewById(R.id.account_username); mAccountPassword = (EditText) v.findViewById(R.id.account_password); InputFilter[] orgFilters = mAccountJID.getFilters(); InputFilter[] newFilters = new InputFilter[orgFilters.length + 1]; int i; for (i = 0; i < orgFilters.length; i++) newFilters[i] = orgFilters[i]; newFilters[i] = new LoginFilter.UsernameFilterGeneric(); mAccountJID.setFilters(newFilters); mAccountJID.addTextChangedListener(mJidTextWatcher); mAccountPassword.addTextChangedListener(mPasswordTextWatcher); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) // true to disable the feature until ready v.findViewById(R.id.account_layout).setVisibility(View.GONE); return v; }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View root = inflater.inflate(R.layout.fragment_morphing, container, false); if (root == null) { return null; } View pickApp = root.findViewById(R.id.morph_pick_app); pickApp.setOnClickListener(this); View pickIcon = root.findViewById(R.id.morph_pick_icon); pickIcon.setOnClickListener(this); View share = root.findViewById(R.id.morph_share); share.setOnClickListener(this); View reset = root.findViewById(R.id.morph_reset); reset.setOnClickListener(this); View morph = root.findViewById(R.id.morph_execute); morph.setOnClickListener(this); //TODO: Figure out way to have real max length. In case we pad with spaces. InputFilter lengthFilter = new InputFilter.LengthFilter(getString(R.string.morphable_app_name).length()); InputFilter asciiFilter = new LoginFilter.PasswordFilterGMail(); // Encodes ISO-8859-1 (Extended Ascii) mName = (EditText) root.findViewById(R.id.morph_edit_name); mName.setFilters(new InputFilter[]{lengthFilter, asciiFilter}); mIcon = (ImageView) root.findViewById(R.id.morph_edit_icon); FontManager.handleFontTags(root); return root; }