Search in sources :

Example 96 with LayoutInflater

use of android.view.LayoutInflater in project openkit-android by OpenKit.

the class OKSocialLeaderboardFragment method getFBLoginRow.

private View getFBLoginRow() {
    LayoutInflater inflater = this.getActivity().getLayoutInflater();
    int fbLoginRowID = getResources().getIdentifier("io_openkit_list_fb_login", "layout", getActivity().getPackageName());
    View fbLoginRow = inflater.inflate(fbLoginRowID, null);
    int loginButtonID = getResources().getIdentifier("io_openkit_fbSignInButton", "id", getActivity().getPackageName());
    Button fbLoginButton = (Button) fbLoginRow.findViewById(loginButtonID);
    fbLoginButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            loginToFacebook(false);
        }
    });
    return fbLoginRow;
}
Also used : Button(android.widget.Button) LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 97 with LayoutInflater

use of android.view.LayoutInflater in project openkit-android by OpenKit.

the class OKSocialLeaderboardFragment method getHeaderView.

private View getHeaderView(String headerText) {
    LayoutInflater inflater = this.getActivity().getLayoutInflater();
    int listHeaderViewId, listHeaderTextViewId;
    listHeaderTextViewId = getResources().getIdentifier("headerTextView", "id", getActivity().getPackageName());
    listHeaderViewId = getResources().getIdentifier("list_simple_header", "layout", getActivity().getPackageName());
    //Inflate the list headerview
    View listHeaderView = inflater.inflate(listHeaderViewId, null);
    TextView listHeaderTextView = (TextView) listHeaderView.findViewById(listHeaderTextViewId);
    listHeaderTextView.setText(headerText);
    return listHeaderView;
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 98 with LayoutInflater

use of android.view.LayoutInflater in project OpenMEAP by OpenMEAP.

the class MainActivity method createLoginFormDialog.

private Dialog createLoginFormDialog() {
    Context mContext = this;
    final Dialog dialog = new Dialog(mContext);
    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
    final View layout = inflater.inflate(R.layout.login_form, (ViewGroup) findViewById(R.id.login_form_container));
    dialog.setContentView(layout);
    dialog.setTitle("Authentication Prompt");
    String infoText = loginFormCallback.getInfoText();
    TextView infoTextView = (TextView) layout.findViewById(R.id.info);
    infoTextView.setText(infoText);
    Button proceedButton = (Button) layout.findViewById(R.id.proceed);
    proceedButton.setOnClickListener(new OnClickListener() {

        public void onClick(View view) {
            EditText passwordText = (EditText) layout.findViewById(R.id.password);
            EditText usernameText = (EditText) layout.findViewById(R.id.username);
            CheckBox rememberBox = (CheckBox) layout.findViewById(R.id.remember);
            loginFormCallback.onProceed(usernameText.getEditableText().toString(), passwordText.getEditableText().toString(), rememberBox.isChecked());
            loginFormCallback = null;
            if (!rememberBox.isChecked()) {
                usernameText.setText("");
                passwordText.setText("");
            }
            dialog.dismiss();
        }
    });
    Button cancelButton = (Button) layout.findViewById(R.id.cancel);
    cancelButton.setOnClickListener(new OnClickListener() {

        public void onClick(View view) {
            EditText passwordText = (EditText) layout.findViewById(R.id.password);
            EditText usernameText = (EditText) layout.findViewById(R.id.username);
            CheckBox rememberBox = (CheckBox) layout.findViewById(R.id.remember);
            loginFormCallback.onCancel();
            loginFormCallback = null;
            if (!rememberBox.isChecked()) {
                usernameText.setText("");
                passwordText.setText("");
            }
            dialog.dismiss();
        }
    });
    EditText usernameText = (EditText) layout.findViewById(R.id.username);
    usernameText.requestFocus();
    return dialog;
}
Also used : Context(android.content.Context) EditText(android.widget.EditText) Button(android.widget.Button) Dialog(android.app.Dialog) CheckBox(android.widget.CheckBox) LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) OmWebView(com.openmeap.thinclient.OmWebView)

Example 99 with LayoutInflater

use of android.view.LayoutInflater in project Signal-Android by WhisperSystems.

the class WebRtcCallControls method initialize.

private void initialize() {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.webrtc_call_controls, this, true);
    this.speakerButton = ViewUtil.findById(this, R.id.speakerButton);
    this.bluetoothButton = ViewUtil.findById(this, R.id.bluetoothButton);
    this.audioMuteButton = ViewUtil.findById(this, R.id.muteButton);
    this.videoMuteButton = ViewUtil.findById(this, R.id.video_mute_button);
}
Also used : LayoutInflater(android.view.LayoutInflater)

Example 100 with LayoutInflater

use of android.view.LayoutInflater in project Signal-Android by WhisperSystems.

the class AttachmentTypeSelectorAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View view;
    if (convertView == null) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        view = inflater.inflate(R.layout.icon_list_item, parent, false);
    } else {
        view = convertView;
    }
    TextView text = (TextView) view.findViewById(R.id.text1);
    ImageView image = (ImageView) view.findViewById(R.id.icon);
    text.setText(getItem(position).getTitle());
    image.setImageResource(getItem(position).getResource());
    return view;
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

LayoutInflater (android.view.LayoutInflater)1227 View (android.view.View)743 TextView (android.widget.TextView)570 ImageView (android.widget.ImageView)242 ViewGroup (android.view.ViewGroup)127 Context (android.content.Context)123 ListView (android.widget.ListView)115 LinearLayout (android.widget.LinearLayout)102 AdapterView (android.widget.AdapterView)94 RecyclerView (android.support.v7.widget.RecyclerView)87 Intent (android.content.Intent)81 DialogInterface (android.content.DialogInterface)74 AlertDialog (android.app.AlertDialog)71 FrameLayout (android.widget.FrameLayout)48 TypedArray (android.content.res.TypedArray)43 OnClickListener (android.view.View.OnClickListener)40 Button (android.widget.Button)40 Bundle (android.os.Bundle)39 Activity (android.app.Activity)38 AlertDialog (android.support.v7.app.AlertDialog)37