Example usage for android.widget ImageView setVisibility

List of usage examples for android.widget ImageView setVisibility

Introduction

In this page you can find the example usage for android.widget ImageView setVisibility.

Prototype

@RemotableViewMethod
    @Override
    public void setVisibility(int visibility) 

Source Link

Usage

From source file:email.schaal.ocreader.view.drawer.TreeItemDrawerItem.java

@NonNull
private ImageView getImageView(BaseViewHolder viewHolder) {
    ImageView imageView = (ImageView) viewHolder.itemView
            .findViewById(com.mikepenz.materialdrawer.R.id.material_drawer_icon);
    imageView.setVisibility(View.VISIBLE);
    return imageView;
}

From source file:org.mariotaku.twidere.adapter.UserAutoCompleteAdapter.java

@Override
public void bindView(View view, Context context, Cursor cursor) {
    if (mCursorClosed)
        return;/*w w w .  j  a  v a 2  s. com*/

    final ImageView image_view = (ImageView) view.findViewById(android.R.id.icon);
    image_view.setVisibility(mDisplayProfileImage ? View.VISIBLE : View.GONE);
    if (mDisplayProfileImage && mProfileImageLoader != null) {
        final String profile_image_url_string = cursor.getString(mProfileImageUrlIdx);
        mProfileImageLoader.displayImage(parseURL(cursor.getString(mProfileImageUrlIdx)), image_view);
        if (mDisplayHiResProfileImage) {
            mProfileImageLoader.displayImage(
                    parseURL(getBiggerTwitterProfileImage(profile_image_url_string, mForceSSLConnection)),
                    image_view);
        } else {
            mProfileImageLoader.displayImage(
                    parseURL(getNormalTwitterProfileImage(profile_image_url_string, mForceSSLConnection)),
                    image_view);
        }
    }
    super.bindView(view, context, cursor);
}

From source file:sh.ftp.rocketninelabs.meditationassistant.AboutActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTheme(getMeditationAssistant().getMATheme());
    getActionBar().setDisplayHomeAsUpEnabled(true);
    setContentView(R.layout.activity_about);

    TextView txtAboutAppName = (TextView) findViewById(R.id.txtAboutAppName);
    TextView txtAboutAppVersion = (TextView) findViewById(R.id.txtAboutAppVersion);

    if (BuildConfig.FLAVOR.equals("free")) {
        txtAboutAppName.setText(getString(R.string.appName));
    } else {//from w  ww.  j  ava2  s  .  co  m
        txtAboutAppName.setText(getString(R.string.appNameShort));
    }

    PackageInfo pInfo;
    try {
        pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
        txtAboutAppVersion.setText(String.format(getString(R.string.version), pInfo.versionName));
    } catch (PackageManager.NameNotFoundException e) {
        txtAboutAppVersion.setVisibility(View.GONE);
        e.printStackTrace();
    }

    LinearLayout layAbout = (LinearLayout) findViewById(R.id.layAbout);
    layAbout.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View arg0) {
            ImageView charis = (ImageView) findViewById(R.id.charis);
            charis.setVisibility(View.VISIBLE);
            charis.startAnimation(AnimationUtils.loadAnimation(getApplicationContext(), R.anim.spin));
            return true;
        }
    });

    getMeditationAssistant().utility.initializeTracker(this);
}

From source file:com.freshdigitable.udonroad.ffab.ActionIndicatorView.java

public void onActionSelected(Direction direction) {
    if (direction == Direction.UNDEFINED) {
        return;//  w w w . j  av a 2s .c om
    }
    for (ImageView ic : icons.values()) {
        ic.setVisibility(INVISIBLE);
    }

    if (direction.isOnAxis()) {
        translationTo(direction, TransCoefs.ORIGIN);
    } else {
        final Drawable drawable = drawables.get(direction);
        if (drawable != null) {
            final Direction neighbor = direction.getBothNeighbor()[0];
            icons.get(neighbor).setImageDrawable(drawable);
            translationTo(neighbor, TransCoefs.ORIGIN);
            return;
        }
        if (direction == Direction.UP_RIGHT) {
            translationTo(Direction.UP, TransCoefs.SECOND_QUAD);
            translationTo(Direction.RIGHT, TransCoefs.FORTH_QUAD);
        } else if (direction == Direction.DOWN_RIGHT) {
            translationTo(Direction.RIGHT, TransCoefs.FIRST_QUAD);
            translationTo(Direction.DOWN, TransCoefs.THIRD_QUAD);
        } else if (direction == Direction.DOWN_LEFT) {
            translationTo(Direction.LEFT, TransCoefs.SECOND_QUAD);
            translationTo(Direction.DOWN, TransCoefs.FORTH_QUAD);
        } else if (direction == Direction.UP_LEFT) {
            translationTo(Direction.UP, TransCoefs.FIRST_QUAD);
            translationTo(Direction.LEFT, TransCoefs.THIRD_QUAD);
        }
    }
}

From source file:edu.berkeley.boinc.attach.SelectionListAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    View v = convertView;//w w  w.  j av  a2 s  .  co m

    LayoutInflater vi = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    final ProjectListEntry listItem = entries.get(position);

    v = vi.inflate(R.layout.attach_project_list_layout_listitem, null);
    TextView name = (TextView) v.findViewById(R.id.name);
    TextView description = (TextView) v.findViewById(R.id.description);
    TextView summary = (TextView) v.findViewById(R.id.summary);
    CheckBox cb = (CheckBox) v.findViewById(R.id.cb);
    LinearLayout textWrapper = (LinearLayout) v.findViewById(R.id.text_wrapper);

    if (listItem.am) {
        // element is account manager
        name.setText(activity.getString(R.string.attachproject_acctmgr_header));
        description.setText(activity.getString(R.string.attachproject_acctmgr_list_desc));
        cb.setVisibility(View.GONE);
        summary.setVisibility(View.GONE);
        ImageView button = (ImageView) v.findViewById(R.id.am_button_image);
        button.setVisibility(View.VISIBLE);
        OnClickListener listener = new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (Logging.DEBUG)
                    Log.d(Logging.TAG, "SelectionListAdapter: account manager clicked.");
                AcctMgrFragment dialog = new AcctMgrFragment();
                dialog.setReturnToMainActivity(); // configure, so dialog returns to main activity when finished
                dialog.show(activity.getSupportFragmentManager(),
                        activity.getString(R.string.attachproject_acctmgr_header));
            }
        };
        v.setOnClickListener(listener);
        name.setOnClickListener(listener);
        description.setOnClickListener(listener);
        button.setOnClickListener(listener);
    } else {
        // element is project option
        name.setText(listItem.info.name);
        description.setText(listItem.info.generalArea);
        summary.setText(listItem.info.summary);
        cb.setChecked(listItem.checked);
        cb.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                listItem.checked = !listItem.checked;
            }
        });
        textWrapper.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (Logging.DEBUG)
                    Log.d(Logging.TAG,
                            "SelectionListAdapter: onProjectClick open info for: " + listItem.info.name);

                ProjectInfoFragment dialog = ProjectInfoFragment.newInstance(listItem.info);
                dialog.show(activity.getSupportFragmentManager(), "ProjectInfoFragment");
            }
        });

    }
    return v;
}

From source file:com.battlelancer.seriesguide.ui.dialogs.AddDialogFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View layout = inflater.inflate(R.layout.add_dialog, null);
    final SearchResult show = getArguments().getParcelable("show");

    // title and description
    ((TextView) layout.findViewById(R.id.title)).setText(show.title);
    ((TextView) layout.findViewById(R.id.description)).setText(show.overview);

    // buttons/*from   w w w.j ava2 s  .  c  om*/
    Button dontAddButton = (Button) layout.findViewById(R.id.buttonNegative);
    dontAddButton.setText(R.string.dont_add_show);
    dontAddButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            dismiss();
        }
    });
    Button addButton = (Button) layout.findViewById(R.id.buttonPositive);
    addButton.setText(R.string.action_shows_add);
    addButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            mListener.onAddShow(show);
            dismiss();
        }
    });

    // poster
    if (DisplaySettings.isVeryLargeScreen(getActivity())) {
        if (show.poster != null) {
            ImageView posterView = (ImageView) layout.findViewById(R.id.poster);
            posterView.setVisibility(View.VISIBLE);
            ServiceUtils.getPicasso(getActivity()).load(show.poster).into(posterView);
        }
    }

    return layout;
}

From source file:org.computeforcancer.android.attach.SelectionListAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    View v = convertView;//from  w ww  .  ja  va  2s . c o  m

    LayoutInflater vi = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    final ProjectListEntry listItem = entries.get(position);

    v = vi.inflate(R.layout.attach_project_list_layout_listitem, null);
    TextView name = (TextView) v.findViewById(R.id.name);
    TextView description = (TextView) v.findViewById(R.id.description);
    TextView summary = (TextView) v.findViewById(R.id.summary);
    CheckBox cb = (CheckBox) v.findViewById(R.id.cb);
    LinearLayout textWrapper = (LinearLayout) v.findViewById(R.id.text_wrapper);

    if (listItem.am) {
        // element is account manager
        name.setText(activity.getString(R.string.attachproject_acctmgr_header));
        description.setText(activity.getString(R.string.attachproject_acctmgr_list_desc));
        cb.setVisibility(View.GONE);
        summary.setVisibility(View.GONE);
        ImageView button = (ImageView) v.findViewById(R.id.am_button_image);
        button.setVisibility(View.VISIBLE);
        OnClickListener listener = new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (Logging.DEBUG)
                    Log.d(Logging.TAG, "SelectionListAdapter: account manager clicked.");
                AcctMgrFragment dialog = new AcctMgrFragment();
                dialog.setReturnToMainActivity(); // configure, so dialog returns to main activity when finished
                dialog.show(activity.getSupportFragmentManager(),
                        activity.getString(R.string.attachproject_acctmgr_header));
            }
        };
        v.setOnClickListener(listener);
        name.setOnClickListener(listener);
        description.setOnClickListener(listener);
        button.setOnClickListener(listener);
    } else {
        // element is project option
        name.setText(listItem.info.name);
        description.setText(listItem.info.generalArea);
        summary.setText(listItem.info.summary);
        if ("World Community Grid".equalsIgnoreCase(listItem.info.name)) {
            cb.setChecked(true);
        } else {
            cb.setChecked(listItem.checked);
        }
        cb.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                listItem.checked = !listItem.checked;
            }
        });
        textWrapper.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (Logging.DEBUG)
                    Log.d(Logging.TAG,
                            "SelectionListAdapter: onProjectClick open info for: " + listItem.info.name);

                ProjectInfoFragment dialog = ProjectInfoFragment.newInstance(listItem.info);
                dialog.show(activity.getSupportFragmentManager(), "ProjectInfoFragment");
            }
        });

    }
    return v;
}

From source file:zjut.soft.finalwork.fragment.LeftFragment.java

private void selectedItemWithArrow(int id) {
    ImageView[] ivs = new ImageView[] { iv1, iv2, iv3, iv4, iv5 };
    // // ww  w  . j  av  a 2 s .  c  o m
    for (ImageView iv : ivs) {
        iv.setVisibility(View.INVISIBLE);
    }

    switch (id) {
    case R.id.sliding_activity_user_manage:
        iv1.setVisibility(View.VISIBLE);
        break;
    case R.id.sliding_activity_query_system:
        iv2.setVisibility(View.VISIBLE);
        break;
    case R.id.sliding_activity_pay_query:
        iv3.setVisibility(View.VISIBLE);
        break;
    case R.id.sliding_activity_unregister_user:
        iv5.setVisibility(View.VISIBLE);
        break;
    case R.id.sliding_activity_about_us:
        iv4.setVisibility(View.VISIBLE);
        break;
    }
}

From source file:com.samknows.measurement.activity.SamKnowsActivating.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activating);
    Util.initializeFonts(this);
    Util.overrideFonts(this, findViewById(android.R.id.content));

    /*//from  w  w  w .  j  a  v a  2  s. c  o m
     * {"type":"mainprogress", "value":"42"} {"type":"activating"}
     * {"type":"download"} {"type":"inittests", "total":"24",
     * "finished":"21", "currentbest":"london", "besttime": "25 ms"}
     * {"type":"completed"}
     */

    handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            TextView tv;

            JSONObject message_json;
            if (msg.obj == null) {
                return;
            }
            message_json = (JSONObject) msg.obj;

            try {
                String type = message_json.getString(UIUpdate.JSON_TYPE);

                if (type == UIUpdate.JSON_MAINPROGRESS) {
                    String value = message_json.getString(UIUpdate.JSON_VALUE);
                    ProgressBar progressbar = (ProgressBar) findViewById(R.id.activation_progress);
                    int progress = Integer.parseInt(value);
                    progressbar.setProgress(progress);
                } else if (type == UIUpdate.JSON_ACTIVATED) {
                    ProgressBar pb = (ProgressBar) findViewById(R.id.activating_progress);
                    pb.setVisibility(View.GONE);
                    ImageView iv = (ImageView) findViewById(R.id.activating_complete);
                    iv.setVisibility(View.VISIBLE);
                } else if (type == UIUpdate.JSON_DOWNLOADED) {
                    ProgressBar pb = (ProgressBar) findViewById(R.id.download_progress);
                    pb.setVisibility(View.GONE);
                    ImageView iv = (ImageView) findViewById(R.id.download_complete);
                    iv.setVisibility(View.VISIBLE);
                } else if (type == UIUpdate.JSON_INITTESTS) {
                    String total = message_json.getString(UIUpdate.JSON_TOTAL);
                    String finished = message_json.getString(UIUpdate.JSON_FINISHED);
                    String currentbest = message_json.getString(UIUpdate.JSON_CURRENTBEST);
                    String besttime = message_json.getString(UIUpdate.JSON_BESTTIME);
                    tv = (TextView) findViewById(R.id.currentbest);
                    tv.setText(currentbest);
                    tv = (TextView) findViewById(R.id.besttime);
                    tv.setText(besttime);
                    tv = (TextView) findViewById(R.id.server_status);
                    tv.setText(finished + " " + getString(R.string.of) + " " + total);

                } else if (type == UIUpdate.JSON_COMPLETED) {
                    LoginHelper.openMainScreen(SamKnowsActivating.this);
                    SamKnowsActivating.this.finish();
                }

            } catch (JSONException e) {
                Logger.e(SamKnowsActivating.class, "Error in parsing JSONObject: " + e.getMessage());

            }

        }
    };
    if (MainService.registerHandler(handler)) {
        Logger.d(this, "handler registered");
    } else {
        Logger.d(this, "MainService is not executing");
        LoginHelper.openMainScreen(SamKnowsActivating.this);
        SamKnowsActivating.this.finish();

    }
}

From source file:transponders.transmob.TutorialFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.tutorial_fragment, container, false);

    Button button = (Button) rootView.findViewById(R.id.finish_tut_button);

    int density = getResources().getDisplayMetrics().densityDpi;
    if (density <= DisplayMetrics.DENSITY_HIGH) {
        button.setMinimumHeight(60);// w  ww .  j a v a  2  s .  c  om
    }

    ImageView previousArrow = (ImageView) rootView.findViewById(R.id.previous_arrow);
    previousArrow.setVisibility(View.INVISIBLE);
    previousArrow.setOnClickListener(this);

    ImageView nextArrow = (ImageView) rootView.findViewById(R.id.next_arrow);
    nextArrow.setOnClickListener(this);

    // Set the title view to show the page number.
    ((TextView) rootView.findViewById(R.id.tutorial_title))
            .setText(getString(R.string.title_template_step, mPageNumber + 1));

    ImageView tutorialImage = (ImageView) rootView.findViewById(R.id.tutorial_image);

    switch (mPageNumber + 1) {
    case 1:
        break;
    case 2:
        tutorialImage.setImageResource(R.drawable.tut3);
        break;
    case 3:
        tutorialImage.setImageResource(R.drawable.tut4);
        break;
    case 4:
        tutorialImage.setImageResource(R.drawable.tut5);
        break;
    case 5:
        tutorialImage.setImageResource(R.drawable.tut1);
        break;
    default:
        break;
    }

    if (mPageNumber + 1 > 1) {
        previousArrow.setVisibility(View.VISIBLE);
    }

    if (mPageNumber + 1 == NearbyStops.NUM_PAGES) {
        button.setVisibility(View.VISIBLE);
        nextArrow.setVisibility(View.INVISIBLE);
        button.setOnClickListener(this);
    }

    return rootView;
}