Example usage for android.view View VISIBLE

List of usage examples for android.view View VISIBLE

Introduction

In this page you can find the example usage for android.view View VISIBLE.

Prototype

int VISIBLE

To view the source code for android.view View VISIBLE.

Click Source Link

Document

This view is visible.

Usage

From source file:com.manning.androidhacks.hack026.SectionAdapter.java

@Override
public View getView(int position, View view, ViewGroup parent) {
    if (view == null) {
        view = activity.getLayoutInflater().inflate(R.layout.list_item, parent, false);
    }/*from  w w  w. j a va  2s.co m*/
    TextView header = (TextView) view.findViewById(R.id.header);
    String label = getItem(position);
    if (position == 0 || getItem(position - 1).charAt(0) != label.charAt(0)) {
        header.setVisibility(View.VISIBLE);
        header.setText(label.substring(0, 1));
    } else {
        header.setVisibility(View.GONE);
    }
    return super.getView(position, view, parent);
}

From source file:at.bitfire.davdroid.syncadapter.LoginURLFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.login_url, container, false);

    // protocol selection spinner
    textHttpWarning = (TextView) v.findViewById(R.id.http_warning);

    spnrScheme = (Spinner) v.findViewById(R.id.login_scheme);
    spnrScheme.setOnItemSelectedListener(new OnItemSelectedListener() {
        @Override/*from w  w  w.  ja v a  2s  .  c  om*/
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            String scheme = parent.getAdapter().getItem(position).toString();
            textHttpWarning.setVisibility(scheme.equals("https://") ? View.GONE : View.VISIBLE);
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
        }
    });
    spnrScheme.setSelection(1); // HTTPS

    // other input fields
    editBaseURI = (EditText) v.findViewById(R.id.login_host_path);
    editBaseURI.addTextChangedListener(this);

    editUserName = (EditText) v.findViewById(R.id.userName);
    editUserName.addTextChangedListener(this);

    editPassword = (EditText) v.findViewById(R.id.password);
    editPassword.addTextChangedListener(this);

    checkboxPreemptive = (CheckBox) v.findViewById(R.id.auth_preemptive);

    // hook into action bar
    setHasOptionsMenu(true);

    return v;
}

From source file:com.privacity.PerfilActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_perfil_view);
    com = new ConexionSiabra(this);

    descripcion = this.getIntent().getStringExtra("descripcion");
    codigo = this.getIntent().getStringExtra("codigo");
    usuario = this.getIntent().getStringExtra("usuario");
    permisos = this.getIntent().getStringExtra("permisos");
    agregado = this.getIntent().getStringExtra("agregado");
    botonCancelar = findViewById(R.id.cancelarBtt);
    botonAceptar = findViewById(R.id.aceptarBtt);
    //Hacemos invisible los botones que no queremos utilizar.
    if (agregado.equals("True"))
        botonCancelar.setVisibility(View.VISIBLE);
    else/*  w  ww  .j  av  a2 s.c  o m*/
        botonAceptar.setVisibility(View.VISIBLE);

    TextView txtUsuario = (TextView) findViewById(R.id.autorTxt);
    txtUsuario.setText(usuario);
    TextView txtCodigo = (TextView) findViewById(R.id.codigoTxt);
    txtCodigo.setText(codigo);
    TextView txtDescripcion = (TextView) findViewById(R.id.descripcionTxt);
    txtDescripcion.setText(descripcion);
    TextView txtPermisos = (TextView) findViewById(R.id.permisosTxt);
    // txtPermisos.setText(permisosToString());
    txtPermisos.setText(permisosToReadable());
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
    }
}

From source file:at.bitfire.davdroid.mirakel.syncadapter.LoginURLFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.login_url, container, false);

    // protocol selection spinner
    textHttpWarning = (TextView) v.findViewById(R.id.http_warning);

    Spinner spnrScheme = (Spinner) v.findViewById(R.id.login_scheme);
    spnrScheme.setOnItemSelectedListener(new OnItemSelectedListener() {
        @Override//ww w.j a  va 2  s.  c  o  m
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            scheme = parent.getAdapter().getItem(position).toString();
            textHttpWarning.setVisibility(scheme.equals("https://") ? View.GONE : View.VISIBLE);
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
            scheme = null;
        }
    });
    spnrScheme.setSelection(1); // HTTPS

    // other input fields
    editBaseURI = (EditText) v.findViewById(R.id.login_host_path);
    editBaseURI.addTextChangedListener(this);

    editUserName = (EditText) v.findViewById(R.id.userName);
    editUserName.addTextChangedListener(this);

    editPassword = (EditText) v.findViewById(R.id.password);
    editPassword.addTextChangedListener(this);

    checkboxPreemptive = (CheckBox) v.findViewById(R.id.auth_preemptive);

    // hook into action bar
    setHasOptionsMenu(true);

    return v;
}

From source file:com.aikidonord.fragments.FragmentDate.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_date, null /*container, false*/);

    View rlLoading = view.findViewById(R.id.loadingPanel);
    //View listView = view.getListView();

    if (VerifConnexion.isOnline(this.getActivity())) {
        rlLoading.setVisibility(View.VISIBLE);

        // on va fair l'impasse l dessus vu que je ne suis pas bien sr
        // de la manire dont il faut oprer tant que la vue n'a pas t renvoye.
        //listView.setVisibility(View.GONE);
        this.lancementAsync();
    } else {/*from  ww w  .j a va  2  s. c  o  m*/

        AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create();
        alertDialog.setTitle(getResources().getString(R.string.app_name));
        alertDialog.setMessage(getResources().getString(R.string.no_network));
        alertDialog.setIcon(R.drawable.ic_launcher);
        alertDialog.setCancelable(false);
        alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.close),
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // if this button is clicked, close
                        // current activity
                        FragmentDate.this.getActivity().finish();
                    }
                });
        alertDialog.show();
    }

    return view;
}

From source file:com.aikidonord.fragments.FragmentLieu.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_lieu, null /*container, false*/);

    View rlLoading = view.findViewById(R.id.loadingPanel);
    //View listView = view.getListView();

    if (VerifConnexion.isOnline(this.getActivity())) {
        rlLoading.setVisibility(View.VISIBLE);

        // on va fair l'impasse l dessus vu que je ne suis pas bien sr
        // de la manire dont il faut oprer tant que la vue n'a pas t renvoye.
        //listView.setVisibility(View.GONE);
        this.lancementAsync();
    } else {//ww  w  . j ava 2 s  . com

        AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create();
        alertDialog.setTitle(getResources().getString(R.string.app_name));
        alertDialog.setMessage(getResources().getString(R.string.no_network));
        alertDialog.setIcon(R.drawable.ic_launcher);
        alertDialog.setCancelable(false);
        alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.close),
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // if this button is clicked, close
                        // current activity
                        FragmentLieu.this.getActivity().finish();
                    }
                });
        alertDialog.show();
    }

    return view;
}

From source file:com.aikidonord.fragments.FragmentType.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_type, null /*container, false*/);

    View rlLoading = view.findViewById(R.id.loadingPanel);
    //View listView = view.getListView();

    if (VerifConnexion.isOnline(this.getActivity())) {
        rlLoading.setVisibility(View.VISIBLE);

        // on va fair l'impasse l dessus vu que je ne suis pas bien sr
        // de la manire dont il faut oprer tant que la vue n'a pas t renvoye.
        //listView.setVisibility(View.GONE);
        this.lancementAsync();
    } else {/*from   ww w  .  j a  va2 s  .c  o m*/

        AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create();
        alertDialog.setTitle(getResources().getString(R.string.app_name));
        alertDialog.setMessage(getResources().getString(R.string.no_network));
        alertDialog.setIcon(R.drawable.ic_launcher);
        alertDialog.setCancelable(false);
        alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.close),
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // if this button is clicked, close
                        // current activity
                        FragmentType.this.getActivity().finish();
                    }
                });
        alertDialog.show();
    }

    return view;
}

From source file:com.analysedesgeeks.android.PodcastActivity.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_podcast);

    final FeedItem msg = rssService.getLastFeed().get(position);

    title.setText(msg.title);//  ww w .j a v  a 2  s .  c om
    date.setText(msg.formattedDate);

    String descriptionStr = msg.description;
    descriptionStr = StringEscapeUtils.unescapeHtml(descriptionStr);
    descriptionStr = descriptionStr.replace("- ", "<br>- ");
    descriptionStr = descriptionStr.replaceAll(
            "<img src=\"http://feeds.feedburner.com/~r/LanalyseDesGeeks.*height=\"1\" width=\"1\"/>", "");

    description.setText(Html.fromHtml(descriptionStr));

    playButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(final View v) {
            podcastPlayer.setVisibility(View.VISIBLE);
            podcastPlayer.setDisplayedChild(LOADING_INDEX);
            new PlayTask().execute();
        }
    });

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

From source file:net.grappendorf.doitlater.TaskEditorActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.task_editor);
    setResult(RESULT_CANCELED);/*  w  w  w  .  j  av a2 s. co  m*/
    String taskId = getIntent().getStringExtra("taskId");
    taskListId = getIntent().getStringExtra("taskListId");
    completed = (CheckBox) findViewById(R.id.completed);
    title = (EditText) findViewById(R.id.title);
    dueDate = (EditText) findViewById(R.id.due_date);
    notes = (EditText) findViewById(R.id.notes);
    insertPosition = (Spinner) findViewById(R.id.insert_position);
    insertPosition.setVisibility(taskId == null ? View.VISIBLE : View.GONE);
    if (taskId != null) {
        ((DoItLaterApplication) getApplication()).getTaskManager().getTask(taskListId, taskId, this,
                new Handler() {
                    @Override
                    public void handleMessage(Message msg) {
                        task = (Task) msg.obj;
                        updateCompletedView();
                        updateTitleView();
                        updateDueDateView();
                        updateNotesView();
                    }
                });
    } else {
        ((Button) findViewById(R.id.save)).setText(R.string.create);
        task = new Task();
    }
}

From source file:Main.java

public static Animation getExpandViewAnimation(final View view, int duration) {

    view.measure(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    final int targetHeight = view.getMeasuredHeight();

    view.getLayoutParams().height = 0;//from ww  w.j  a  v a 2 s  . co  m
    view.setVisibility(View.VISIBLE);
    Animation animation = new Animation() {
        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            view.getLayoutParams().height = interpolatedTime == 1 ? RelativeLayout.LayoutParams.WRAP_CONTENT
                    : (int) (targetHeight * interpolatedTime);
            view.requestLayout();
        }

        @Override
        public boolean willChangeBounds() {
            return true;
        }
    };

    // 1dp/ms
    // animation.setDuration((int) (targetHeight /
    // view.getContext().getResources().getDisplayMetrics().density));
    animation.setDuration(duration);
    return animation;
}