Java Code Examples for android.widget.EditText#setVisibility()

The following examples show how to use android.widget.EditText#setVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NfcProvisioningFragment.java    From enterprise-samples with Apache License 2.0 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    // Retrieve view references
    mEditPackageName = (EditText) view.findViewById(R.id.package_name);
    mEditClassName = (EditText) view.findViewById(R.id.class_name);
    mEditLocale = (EditText) view.findViewById(R.id.locale);
    mEditTimezone = (EditText) view.findViewById(R.id.timezone);
    mEditWifiSsid = (EditText) view.findViewById(R.id.wifi_ssid);
    mEditWifiSecurityType = (EditText) view.findViewById(R.id.wifi_security_type);
    mEditWifiPassword = (EditText) view.findViewById(R.id.wifi_password);
    // Bind event handlers
    mEditPackageName.addTextChangedListener(new TextWatcherWrapper(R.id.package_name, this));
    mEditClassName.addTextChangedListener(new TextWatcherWrapper(R.id.class_name, this));
    mEditLocale.addTextChangedListener(new TextWatcherWrapper(R.id.locale, this));
    mEditTimezone.addTextChangedListener(new TextWatcherWrapper(R.id.timezone, this));
    mEditWifiSsid.addTextChangedListener(new TextWatcherWrapper(R.id.wifi_ssid, this));
    mEditWifiSecurityType.addTextChangedListener(
            new TextWatcherWrapper(R.id.wifi_security_type, this));
    mEditWifiPassword.addTextChangedListener(new TextWatcherWrapper(R.id.wifi_password, this));
    // Prior to API 23, the class name is not needed
    mEditClassName.setVisibility(Build.VERSION.SDK_INT >= 23 ? View.VISIBLE : View.GONE);
}
 
Example 2
Source File: Id3Writer.java    From QuickLyric with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onPreExecute() {
    MainActivity activity = (MainActivity) mActivity.get();

    ((DrawerLayout) activity.drawer).setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
    mFragment.get().enablePullToRefresh(true);
    activity.findViewById(R.id.refresh_fab).setEnabled(true);
    ((RefreshIcon) activity.findViewById(R.id.refresh_fab)).show();
    activity.invalidateOptionsMenu();

    ViewSwitcher viewSwitcher = activity.findViewById(R.id.switcher);
    EditText newLyrics = activity.findViewById(R.id.edit_lyrics);

    viewSwitcher.setVisibility(View.VISIBLE);
    newLyrics.setVisibility(View.GONE);
}
 
Example 3
Source File: ReplyFragment.java    From something.apk with MIT License 6 votes vote down vote up
@Override
public void viewCreated(View frag, Bundle savedInstanceState) {
    replyContent = (EditText) frag.findViewById(R.id.reply_content);
    replyTitle = (EditText) frag.findViewById(R.id.reply_title);
    replyUsername = (EditText) frag.findViewById(R.id.reply_username);
    replyContent.addTextChangedListener(this);
    if(replyType != TYPE_PM){
        replyUsername.setVisibility(View.GONE);
        replyTitle.setVisibility(View.GONE);
    }else{
        replyUsername.setVisibility(View.VISIBLE);
        replyTitle.setVisibility(View.VISIBLE);
        replyUsername.addTextChangedListener(this);
        replyTitle.addTextChangedListener(this);
    }
    replyContent.setCustomSelectionActionModeCallback(this);
    startRefresh();
}
 
Example 4
Source File: APICreds2Activity.java    From diva-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_apicreds2);
    TextView apicview = (TextView) findViewById(R.id.apic2TextView);
    EditText pintext  = (EditText) findViewById(R.id.aci2pinText);
    Button  vbutton   = (Button) findViewById(R.id.aci2button);
    Intent i = getIntent();
    boolean bcheck = i.getBooleanExtra(getString(R.string.chk_pin), true);

    if (bcheck == false) {
        // Connect to vendor cloud and send User PIN
        // Get API credentials and other confidential details of the user
        String apidetails = "TVEETER API Key: secrettveeterapikey\nAPI User name: diva2\nAPI Password: p@ssword2";
        // Display the details on the app
        apicview.setText(apidetails);
    }
    else {
        apicview.setText("Register yourself at http://payatu.com to get your PIN and then login with that PIN!");
        pintext.setVisibility(View.VISIBLE);
        vbutton.setVisibility(View.VISIBLE);
    }
}
 
Example 5
Source File: ColorPickerDialog.java    From memoir with Apache License 2.0 6 votes vote down vote up
@SuppressLint("InflateParams")
private View createExact() {
    View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_color_exact, null);

    mExactViewA = (EditText) view.findViewById(R.id.exactA);
    mExactViewR = (EditText) view.findViewById(R.id.exactR);
    mExactViewG = (EditText) view.findViewById(R.id.exactG);
    mExactViewB = (EditText) view.findViewById(R.id.exactB);

    InputFilter[] filters = new InputFilter[]{new InputFilter.LengthFilter(2)};
    mExactViewA.setFilters(filters);
    mExactViewR.setFilters(filters);
    mExactViewG.setFilters(filters);
    mExactViewB.setFilters(filters);

    mExactViewA.setVisibility(mUseOpacityBar ? View.VISIBLE : View.GONE);

    setExactColor(mInitialColor);

    mExactColorPicker = (ColorWheelView) view.findViewById(R.id.picker_exact);
    mExactColorPicker.setOldCenterColor(mInitialColor);
    mExactColorPicker.setNewCenterColor(mNewColor);

    return view;
}
 
Example 6
Source File: LyricsViewFragment.java    From QuickLyric with GNU General Public License v3.0 5 votes vote down vote up
private void startEditTagsMode() {
    ImageButton editButton = getActivity().findViewById(R.id.edit_tags_btn);
    editButton.setImageResource(R.drawable.ic_edit_anim);
    ((Animatable) editButton.getDrawable()).start();

    ((DrawerLayout) ((MainActivity) getActivity()).drawer).setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
    mRefreshLayout.setEnabled(false);
    getActivity().findViewById(R.id.refresh_fab).setEnabled(false);
    ((RefreshIcon) getActivity().findViewById(R.id.refresh_fab)).hide();
    ((Toolbar) getActivity().findViewById(R.id.toolbar)).getMenu().clear();

    ViewSwitcher viewSwitcher = getActivity().findViewById(R.id.switcher);
    EditText songTV = getActivity().findViewById(R.id.song);
    TextView artistTV = getActivity().findViewById(R.id.artist);

    EditText newLyrics = getActivity().findViewById(R.id.edit_lyrics);
    newLyrics.setTypeface(LyricsTextFactory.FontCache.get("light", getActivity()));
    newLyrics.setText(Html.fromHtml(TextUtils.isEmpty(mLyrics.getText()) ? "" : mLyrics.getText()), TextView.BufferType.EDITABLE);

    viewSwitcher.setVisibility(View.GONE);
    newLyrics.setVisibility(View.VISIBLE);

    songTV.setInputType(InputType.TYPE_CLASS_TEXT);
    artistTV.setInputType(InputType.TYPE_CLASS_TEXT);
    songTV.setBackgroundResource(R.drawable.abc_textfield_search_material);
    artistTV.setBackgroundResource(R.drawable.abc_textfield_search_material);


    if (songTV.requestFocus()) {
        InputMethodManager imm = (InputMethodManager)
                getActivity().getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.SHOW_IMPLICIT);
    }
}
 
Example 7
Source File: JavascriptAppModalDialog.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void prepare(ViewGroup layout) {
    super.prepare(layout);
    EditText prompt = (EditText) layout.findViewById(R.id.js_modal_dialog_prompt);
    prompt.setVisibility(View.VISIBLE);

    if (mDefaultPromptText.length() > 0) {
        prompt.setText(mDefaultPromptText);
        prompt.selectAll();
    }
}
 
Example 8
Source File: OverviewFormFragment.java    From CameraV with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater li, ViewGroup container, Bundle savedInstanceState)
{
	super.onCreateView(li, container, savedInstanceState);

	rootView = li.inflate(R.layout.fragment_forms_overview, container, false);

	historyHeader = rootView.findViewById(R.id.historyHeader);
	historyHeaderSubTitle = (TextView) historyHeader.findViewById(R.id.tvSubTitle);
//	showHistoryIndicator = (ImageView) rootView.findViewById(R.id.indicator);
	lvHistory = (AdapteredLinearLayout) rootView.findViewById(R.id.lvHistory);
	lvHistory.setVisibility(View.VISIBLE);
	mShowingHistory = true;
	
	notes = (TextView) rootView.findViewById(R.id.media_notes);
	notes.setText("");
	notesAnswerHolder = (EditText) rootView.findViewById(R.id.media_notes_edit); // new EditText(container.getContext());
	notesAnswerHolder.setVisibility(View.GONE);
	notesAnswerHolder.setText("");

	rlAudio = rootView.findViewById(R.id.rlAudio);
	rlAudio.setVisibility(View.GONE);
	llAudioFiles = (LinearLayout) rootView.findViewById(R.id.llAudioFiles);
	sbAudio = (SeekBar) rootView.findViewById(R.id.sbAudio);
	sbAudio.setVisibility(View.GONE);
	return rootView;
}
 
Example 9
Source File: MainActivity.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 5 votes vote down vote up
public void newData(View view) {
    EditText edit = (EditText) findViewById(R.id.EditS);
    TextView newName = (TextView) findViewById(R.id.bestName);
    TextView newScore = (TextView) findViewById(R.id.bestScore);
    TextView currScore = (TextView) findViewById(R.id.nowScore);
    newName.setText(edit.getText());
    newScore.setText(currScore.getText());
    saved.edit().putString("Name", edit.getText() + "").apply();
    saved.edit().putInt("Score", Integer.parseInt(currScore.getText() + "")).apply();
    TextView high2 = (TextView) findViewById(R.id.newHighS2);
    Button btn = (Button) findViewById(R.id.button);
    edit.setVisibility(View.INVISIBLE);
    high2.setVisibility(View.INVISIBLE);
    btn.setVisibility(View.INVISIBLE);
}
 
Example 10
Source File: UserDictionaryAddWordContents.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
UserDictionaryAddWordContents(final View view, final Bundle args) {
    mWordEditText = (EditText)view.findViewById(R.id.user_dictionary_add_word_text);
    mShortcutEditText = (EditText)view.findViewById(R.id.user_dictionary_add_shortcut);
    if (!UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
        mShortcutEditText.setVisibility(View.GONE);
        view.findViewById(R.id.user_dictionary_add_shortcut_label).setVisibility(View.GONE);
    }
    final String word = args.getString(EXTRA_WORD);
    if (null != word) {
        mWordEditText.setText(word);
        // Use getText in case the edit text modified the text we set. This happens when
        // it's too long to be edited.
        mWordEditText.setSelection(mWordEditText.getText().length());
    }
    final String shortcut;
    if (UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
        shortcut = args.getString(EXTRA_SHORTCUT);
        if (null != shortcut && null != mShortcutEditText) {
            mShortcutEditText.setText(shortcut);
        }
        mOldShortcut = args.getString(EXTRA_SHORTCUT);
    } else {
        shortcut = null;
        mOldShortcut = null;
    }
    mMode = args.getInt(EXTRA_MODE); // default return value for #getInt() is 0 = MODE_EDIT
    mOldWord = args.getString(EXTRA_WORD);
    updateLocale(args.getString(EXTRA_LOCALE));
}
 
Example 11
Source File: CCardStatementClosingDayActivity.java    From financisto with GNU General Public License v2.0 5 votes vote down vote up
/**
    * Initialize data and GUI elements.
    */
   private void initialize() {
	dbAdapter = new DatabaseAdapter(this);
	dbAdapter.open();
	
   	customCD = (RadioButton)findViewById(R.id.custom_closing_day);
   	regularCD = (RadioButton)findViewById(R.id.regular_closing_day);
   	newClosingDay = (EditText)findViewById(R.id.new_closing_day);
   	
   	customClosingDay = dbAdapter.getCustomClosingDay(accountId, periodKey);
   	if (customClosingDay>0) {
   		// select custom closing day and fill edit text
   		newClosingDay.setText(Integer.toString(customClosingDay));
   		customCD.setChecked(true);
   	} else {
   		// select regular closing day and disable edit text
   		regularCD.setChecked(true);
   		newClosingDay.setVisibility(EditText.GONE);
   	}
   	
	setLabels();
	setListeners();
	
	this.setTitle(R.string.closing_day_title);
	
	if (customClosingDay>0) {
		EditText newCD = (EditText)findViewById(R.id.new_closing_day);
		newCD.setText(Integer.toString(customClosingDay));
		// set custom closing day selected
		regularCD.setChecked(false);
		customCD.setChecked(true);
	} else {
		// set regular closing day selected
		customCD.setChecked(false);
		regularCD.setChecked(true);			
	}
}
 
Example 12
Source File: EditorFragment.java    From android-discourse with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_editor, container, false);
    mPostTitle = (TextView) view.findViewById(R.id.post_title);
    mTitleET = (EditText) view.findViewById(R.id.edit_title);
    mTitleET.setText(mTitle);
    mContentET = (EditText) view.findViewById(R.id.edit_content);
    mContentET.setText(mContent);
    mCategoriesSpinner = (Spinner) view.findViewById(R.id.edit_categories_spinner);
    mCategoriesSpinner.setAdapter(mCategoryAdapter);

    setupMarkdownViews(view);
    if (isPrivateMsg()) {
        mCategoriesSpinner.setVisibility(View.GONE);
        mPostTitle.setText(getString(R.string.send_private_msg_title, mUsername));
    } else if (isNewTopic()) {
        mPostTitle.setVisibility(View.GONE);
    } else if (isReplyTopic()) {
        mTitleET.setVisibility(View.GONE);
        mCategoriesSpinner.setVisibility(View.GONE);
        mPostTitle.setText(getString(R.string.reply_topic_title, mTopic.title));
    } else if (isReplyPost()) {
        mTitleET.setVisibility(View.GONE);
        mCategoriesSpinner.setVisibility(View.GONE);
        mPostTitle.setText(getString(R.string.reply_post_title, mPostNum, mUsername));
    } else if (isEditPost()) {
        mTitleET.setVisibility(View.GONE);
        mCategoriesSpinner.setVisibility(View.GONE);
        mPostTitle.setText(getString(R.string.edit_post_title, mPostNum, mUsername));
        mContentET.setText(R.string.loading_post_text);
    }
    return view;
}
 
Example 13
Source File: UserDictionaryAddWordContents.java    From Indic-Keyboard with Apache License 2.0 5 votes vote down vote up
UserDictionaryAddWordContents(final View view, final Bundle args) {
    mWordEditText = (EditText)view.findViewById(R.id.user_dictionary_add_word_text);
    mShortcutEditText = (EditText)view.findViewById(R.id.user_dictionary_add_shortcut);
    if (!UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
        mShortcutEditText.setVisibility(View.GONE);
        view.findViewById(R.id.user_dictionary_add_shortcut_label).setVisibility(View.GONE);
    }
    final String word = args.getString(EXTRA_WORD);
    if (null != word) {
        mWordEditText.setText(word);
        // Use getText in case the edit text modified the text we set. This happens when
        // it's too long to be edited.
        mWordEditText.setSelection(mWordEditText.getText().length());
    }
    final String shortcut;
    if (UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
        shortcut = args.getString(EXTRA_SHORTCUT);
        if (null != shortcut && null != mShortcutEditText) {
            mShortcutEditText.setText(shortcut);
        }
        mOldShortcut = args.getString(EXTRA_SHORTCUT);
    } else {
        shortcut = null;
        mOldShortcut = null;
    }
    mMode = args.getInt(EXTRA_MODE); // default return value for #getInt() is 0 = MODE_EDIT
    mOldWord = args.getString(EXTRA_WORD);
    updateLocale(args.getString(EXTRA_LOCALE));
}
 
Example 14
Source File: DetailFragment.java    From kolabnotes-android with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void initTextEditor() {
    boolean useRicheditor = Utils.getUseRicheditor(activity);

    if(useRicheditor) {
        editor = (KolabNotesRichEditor) activity.findViewById(R.id.detail_description);
        editor.setVisibility(View.VISIBLE);
        editor.setBackgroundColor(Color.TRANSPARENT);
        editor.setEditorHeight(300);
        editor.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View view, boolean b) {
                final View bar = activity.findViewById(R.id.editor_bar);
                final int visibility = bar.getVisibility();
                if (visibility == View.GONE) {
                    bar.setVisibility(View.VISIBLE);
                } else {
                    bar.setVisibility(View.GONE
                    );
                }
            }
        });
        initEditor();
    }else{
        editText = (EditText) activity.findViewById(R.id.detail_description_plain);
        editText.setVisibility(View.VISIBLE);
        editText.setMovementMethod(LinkMovementMethod.getInstance());
    }
}
 
Example 15
Source File: WifiGeneratorActivity.java    From SecScanQR with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneralHandler generalHandler = new GeneralHandler(this);
    generalHandler.loadTheme();
    setContentView(R.layout.activity_wifi_generator);

    tfSSID = (EditText) findViewById(R.id.tfSSID);
    tfPassword = (EditText) findViewById(R.id.tfPassword);
    cbHidden = (CheckBox) findViewById(R.id.cbHidden);
    btnGenerate = (Button) findViewById(R.id.btnGenerateWifi);

    btnGenerate.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            ssid = tfSSID.getText().toString().trim();
            password = tfPassword.getText().toString().trim();
            if(ssid.equals("") || (encrypt.equals("WEP") && password.equals("")) || (encrypt.equals("WPA") && password.equals(""))){
                Toast.makeText(getApplicationContext(), getResources().getText(R.string.error_geo_first), Toast.LENGTH_SHORT).show();
            } else {
                multiFormatWriter = new MultiFormatWriter();
                try{
                    if(hidden.equals("true") && encrypt.equals("nopass")) {
                        result = "WIFI:S:" + ssid + ";T:" + encrypt + ";P:;H:true;";
                    } else if (hidden.equals("false") && encrypt.equals("nopass")){
                        result = "WIFI:S:" + ssid + ";T:" + encrypt + ";P:;;";
                    } else if (hidden.matches("false")){
                        result = "WIFI:S:" + ssid + ";T:" + encrypt + ";P:" + password + ";;";
                    } else {
                        result = "WIFI:S:" + ssid + ";T:" + encrypt + ";P:" + password + ";H:true;";
                    }
                    openResultActivity();
                } catch (Exception e){
                    Toast.makeText(activity.getApplicationContext(), getResources().getText(R.string.error_generate), Toast.LENGTH_LONG).show();
                }
            }
        }
    });

    //Setup the Spinner Menu for the different formats
    Spinner formatSpinner = (Spinner) findViewById(R.id.spinner);
    Spinner encrypSpinner = (Spinner) findViewById(R.id.spinnerWifi);
    formatSpinner.setOnItemSelectedListener(this);
    encrypSpinner.setOnItemSelectedListener(this);

    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.text_formats_array, R.layout.spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    formatSpinner.setAdapter(adapter);

    adapter = ArrayAdapter.createFromResource(this, R.array.text_formats_encryption, R.layout.spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    encrypSpinner.setAdapter(adapter);

    //If the device were rotated then restore information
    if(savedInstanceState != null){
        ssid = (String) savedInstanceState.get(STATE_SSID);
        tfSSID.setText(ssid);
        password = (String) savedInstanceState.get(STATE_PASSWORD);
        tfPassword.setText(password);
        encrypt = (String) savedInstanceState.get(STATE_ENCRYPT);
        if(encrypt.equals("nopass")){
            tfPassword.setVisibility(View.GONE);
        }
        hidden = (String) savedInstanceState.get(STATE_HIDDEN);
        if(hidden.equals("false")) {
            cbHidden.setChecked(false);
        }
    }


}
 
Example 16
Source File: ServerEditFragment.java    From Plumble with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
    Settings settings = Settings.getInstance(getActivity());

    String actionName;
    switch (getAction()) {
        case ADD_ACTION:
            actionName = getString(R.string.add);
            break;
        case EDIT_ACTION:
            actionName = getString(R.string.edit);
            break;
        case CONNECT_ACTION:
            actionName = getString(R.string.connect);
            break;
        default:
            throw new RuntimeException("Unknown action " + getAction());
    }
    adb.setPositiveButton(actionName, null);
    adb.setNegativeButton(android.R.string.cancel, null);

    LayoutInflater inflater = LayoutInflater.from(getActivity());
    View view = inflater.inflate(R.layout.dialog_server_edit, null, false);

    TextView titleLabel = (TextView) view.findViewById(R.id.server_edit_name_title);
    mNameEdit = (EditText) view.findViewById(R.id.server_edit_name);
    mHostEdit = (EditText) view.findViewById(R.id.server_edit_host);
    mPortEdit = (EditText) view.findViewById(R.id.server_edit_port);
    mUsernameEdit = (EditText) view.findViewById(R.id.server_edit_username);
    mUsernameEdit.setHint(settings.getDefaultUsername());
    mPasswordEdit = (EditText) view.findViewById(R.id.server_edit_password);

    Server oldServer = getServer();
    if (oldServer != null) {
        mNameEdit.setText(oldServer.getName());
        mHostEdit.setText(oldServer.getHost());
        mPortEdit.setText(String.valueOf(oldServer.getPort()));
        mUsernameEdit.setText(oldServer.getUsername());
        mPasswordEdit.setText(oldServer.getPassword());
    }

    if (shouldIgnoreTitle()) {
        titleLabel.setVisibility(View.GONE);
        mNameEdit.setVisibility(View.GONE);
    }

    // Fixes issues with text colour on light themes with pre-honeycomb devices.
    adb.setInverseBackgroundForced(true);

    adb.setView(view);

    return adb.create();
}
 
Example 17
Source File: AccountActivity.java    From Zom-Android-XMPP with GNU General Public License v3.0 4 votes vote down vote up
private void setupUIPre ()
    {
        ((ImApp)getApplication()).setAppTheme(this);

        setContentView(R.layout.account_activity);

        getSupportActionBar().setHomeButtonEnabled(true);

        mIsNewAccount = getIntent().getBooleanExtra("register", false);

        mEditUserAccount = (EditText) findViewById(R.id.edtName);
        mEditUserAccount.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                checkUserChanged();
            }
        });

        mEditPass = (EditText) findViewById(R.id.edtPass);

        mEditPassConfirm = (EditText) findViewById(R.id.edtPassConfirm);
        mSpinnerDomains = (AutoCompleteTextView) findViewById(R.id.spinnerDomains);

        if (mIsNewAccount)
        {
            mEditPassConfirm.setVisibility(View.VISIBLE);
            mSpinnerDomains.setVisibility(View.VISIBLE);
            mEditUserAccount.setHint(R.string.account_setup_new_username);

            /*
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                    android.R.layout.simple_dropdown_item_1line, getResources().getStringArray(R.array.account_domains));
            mSpinnerDomains.setAdapter(adapter);
            */

        }

        //mRememberPass = (CheckBox) findViewById(R.id.rememberPassword);
        //mUseTor = (CheckBox) findViewById(R.id.useTor);


       // mBtnSignIn = (Button) findViewById(R.id.btnSignIn);

//        if (mIsNewAccount)
  //          mBtnSignIn.setText(R.string.btn_create_new_account);

        mBtnAdvanced = (Button) findViewById(R.id.btnAdvanced);

        /**
        mRememberPass.setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                updateWidgetState();
            }
        });*/

    }
 
Example 18
Source File: ReadingActivity.java    From IslamicLibraryAndroid with GNU General Public License v3.0 4 votes vote down vote up
private void switchEditTextToTextView(@NonNull EditText editText, @NonNull TextView textView) {
    editText.setVisibility(View.INVISIBLE);
    textView.setVisibility(View.VISIBLE);
    mPager.requestFocus();
}
 
Example 19
Source File: BblContentFragment.java    From BubbleAlert with MIT License 4 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    clickHandler = new ClickHandler(this);

    txtDialogTitle = (TextView) view.findViewById(R.id.txtDialogTitle);
    txtContent = (TextView) view.findViewById(R.id.txtContent);
    btnOk = (TextView) view.findViewById(R.id.btnOk);
    btnExit = (TextView) view.findViewById(R.id.btnExit);
    btnCancel = (TextView) view.findViewById(R.id.btnCancel);
    edtLibName = (EditText) view.findViewById(R.id.edtLibName);

    btnOk.setOnClickListener(clickHandler);
    btnExit.setOnClickListener(clickHandler);
    btnCancel.setOnClickListener(clickHandler);

    txtContent.setText(content);
    btnOk.setText(ok);
    btnCancel.setText(cancel);
    btnExit.setText(exit);
    if (!TextUtils.isEmpty(sDialogTitle)) {
        txtDialogTitle.setText(sDialogTitle);
    }

    if (btnCount == 1) {
        btnCancel.setVisibility(View.GONE);
    } else if (btnCount == 3) {
        btnExit.setVisibility(View.VISIBLE);
    }

    int visibility = hasEditText ? View.VISIBLE : View.GONE;

    edtLibName.setVisibility(visibility);
    if (!TextUtils.isEmpty(textContent)) {

        edtLibName.setText(textContent);
    }

    if (!TextUtils.isEmpty(hintText)) {

        edtLibName.setHint(hintText);
    }

    if (isMultiLineEditText) {
        edtLibName.setMaxLines(1);
        edtLibName.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);
        edtLibName.setScroller(new Scroller(getContext()));
        edtLibName.setVerticalScrollBarEnabled(true);
        edtLibName.setMovementMethod(new ScrollingMovementMethod());
    }

}
 
Example 20
Source File: AccountViewFragment.java    From zom-android-matrix with Apache License 2.0 4 votes vote down vote up
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.account_activity, container, false);


        mIsNewAccount = getIntent().getBooleanExtra("register", false);


        mEditUserAccount = (EditText) view.findViewById(R.id.edtName);
        mEditUserAccount.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                checkUserChanged();
            }
        });

        mEditPass = (EditText) view.findViewById(R.id.edtPass);

        mEditPassConfirm = (EditText) view.findViewById(R.id.edtPassConfirm);
        mSpinnerDomains = (AutoCompleteTextView) view.findViewById(R.id.spinnerDomains);

        if (mIsNewAccount)
        {
            mEditPassConfirm.setVisibility(View.VISIBLE);
            mSpinnerDomains.setVisibility(View.VISIBLE);
            mEditUserAccount.setHint(R.string.account_setup_new_username);

            ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),
                    android.R.layout.simple_dropdown_item_1line, Server.getServersText(getActivity()));
            mSpinnerDomains.setAdapter(adapter);

        }

//        mRememberPass = (CheckBox) findViewById(R.id.rememberPassword);
  //      mUseTor = (CheckBox) findViewById(R.id.useTor);


        mBtnSignIn = (Button) view.findViewById(R.id.btnSignIn);

        if (mIsNewAccount)
            mBtnSignIn.setText(R.string.btn_create_new_account);


        //mBtnAdvanced = (Button) findViewById(R.id.btnAdvanced);
       // mBtnQrDisplay = (Button) findViewById(R.id.btnQR);

        /*
        mRememberPass.setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                updateWidgetState();
            }
        });*/

        return view;

    }