Example usage for android.view View GONE

List of usage examples for android.view View GONE

Introduction

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

Prototype

int GONE

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

Click Source Link

Document

This view is invisible, and it doesn't take any space for layout purposes.

Usage

From source file:com.hybris.mobile.app.commerce.helper.OrderHelper.java

/**
 * Populate the order summary//w  w  w  . j  av  a2s.com
 *
 * @param order
 */
public static void createOrderSummary(Activity activity, Order order) {

    LinearLayout mOrderSummaryItemsLayout;
    TextView mOrderSummaryItems;
    TextView mOrderSummarySubtotal;
    TextView mOrderSummarySavings;
    TextView mOrderSummaryTax;
    TextView mOrderSummaryShipping;
    TextView mOrderSummaryTotal;
    TextView mOrderSummaryPromotion;
    TableRow mOrderSummarySavingsRow;

    // order summary
    mOrderSummaryItemsLayout = (LinearLayout) activity.findViewById(R.id.order_summary_items_layout);
    mOrderSummaryItems = (TextView) activity.findViewById(R.id.order_summary_items);
    mOrderSummarySubtotal = (TextView) activity.findViewById(R.id.order_summary_subtotal);
    mOrderSummarySavings = (TextView) activity.findViewById(R.id.order_summary_savings);
    mOrderSummaryTax = (TextView) activity.findViewById(R.id.order_summary_tax);
    mOrderSummaryShipping = (TextView) activity.findViewById(R.id.order_summary_shipping);
    mOrderSummaryTotal = (TextView) activity.findViewById(R.id.order_summary_total);
    mOrderSummaryPromotion = (TextView) activity.findViewById(R.id.order_summary_promotion);
    mOrderSummarySavingsRow = (TableRow) activity.findViewById(R.id.order_summary_savings_row);

    if (order != null) {

        populatePromotions(order);

        // Display total price
        if (order.getTotalPrice() != null) {
            mOrderSummaryTotal.setText(order.getTotalPrice().getFormattedValue());
        }

        // Display subtotal price
        if (order.getSubTotal() != null) {
            mOrderSummarySubtotal.setText(order.getSubTotal().getFormattedValue());
        }

        // Display tax price
        if (order.getTotalTax() != null) {
            mOrderSummaryTax.setText(order.getTotalTax().getFormattedValue());
        }

        // Display delivery method cost
        if (order.getDeliveryCost() != null) {
            mOrderSummaryShipping.setText(order.getDeliveryCost().getFormattedValue());
        }

        if (order.getAppliedOrderPromotions() != null && !order.getAppliedOrderPromotions().isEmpty()) {
            if (StringUtils.isNotBlank(order.getOrderDiscounts().getFormattedValue())) {
                mOrderSummarySavingsRow.setVisibility(View.VISIBLE);
                mOrderSummarySavings.setText(order.getOrderDiscounts().getFormattedValue());
            }
        }

        if (order.getAppliedOrderPromotions() != null || order.getAppliedProductPromotions() != null) {
            if (order.getAppliedProductPromotions() != null && !order.getAppliedProductPromotions().isEmpty()) {
                mOrderSummaryPromotion.setVisibility(View.VISIBLE);
                // Nb order Promotion
                StringBuffer promotion = new StringBuffer();

                if (order.getAppliedOrderPromotions() != null && !order.getAppliedOrderPromotions().isEmpty()) {
                    for (PromotionResult orderPromotion : order.getAppliedOrderPromotions()) {
                        promotion.append(orderPromotion.getDescription()).append("\n");
                    }
                }

                mOrderSummaryPromotion.setText(promotion);
            } else {
                mOrderSummaryPromotion.setVisibility(View.GONE);
            }
        } else {
            mOrderSummaryPromotion.setVisibility(View.GONE);
            mOrderSummarySavingsRow.setVisibility(View.GONE);
        }

        // Nb items
        mOrderSummaryItemsLayout.setVisibility(View.VISIBLE);
        mOrderSummaryItems
                .setText(activity.getString(R.string.order_summary_items, order.getDeliveryItemsQuantity()));
    }
}

From source file:eu.e43.impeller.account.LoginActivity.java

private void showView(final View which) {
    m_loginStatusView.setVisibility(which == m_loginStatusView ? View.VISIBLE : View.GONE);
    m_loginFormView.setVisibility(which == m_loginFormView ? View.VISIBLE : View.GONE);
    m_webView.setVisibility(which == m_webView ? View.VISIBLE : View.GONE);
}

From source file:de.fahrgemeinschaft.EditRideFragment3.java

public void setRide(Ride ride) {
    try {/*from w  ww  .jav a2s. c o m*/
        JSONObject d = ride.getDetails();
        if (!d.isNull(CONTACT.EMAIL))
            email.text.setText(d.getString(CONTACT.EMAIL));
        else {
            email.text.setText(prefs.getString(CONTACT.EMAIL, prefs.getString(ProfileFragment.LOGIN, EMPTY)));
        }
        if (!d.isNull(CONTACT.LANDLINE))
            land.text.setText(d.getString(CONTACT.LANDLINE));
        else {
            land.text.setText(prefs.getString(CONTACT.LANDLINE, EMPTY));
        }
        if (!d.isNull(CONTACT.MOBILE))
            mobile.text.setText(d.getString(CONTACT.MOBILE));
        else {
            mobile.text.setText(prefs.getString(CONTACT.MOBILE, EMPTY));
        }
        if (ride.getMode().equals(Ride.Mode.TRAIN)) {
            plate.setVisibility(View.GONE);
        } else {
            plate.setVisibility(View.VISIBLE);
            if (!d.isNull(CONTACT.PLATE)) {
                plate.text.setText(d.getString(CONTACT.PLATE));
            } else {
                plate.text.setText(prefs.getString(CONTACT.PLATE, EMPTY));
            }
        }
        name.text.setText(prefs.getString(ProfileFragment.LASTNAME, EMPTY));
        if (d.isNull(FahrgemeinschaftConnector.PRIVACY))
            d.put(FahrgemeinschaftConnector.PRIVACY, new JSONObject());
        JSONObject p = d.getJSONObject(FahrgemeinschaftConnector.PRIVACY);
        if (!p.isNull(CONTACT.EMAIL))
            email.setPrivacy(p.getInt(CONTACT.EMAIL)); // 'm'
        else
            setPublic(email, p, CONTACT.EMAIL);
        if (!p.isNull(CONTACT.LANDLINE))
            land.setPrivacy(p.getInt(CONTACT.LANDLINE));
        else
            setPublic(land, p, CONTACT.LANDLINE);
        if (!p.isNull(CONTACT.MOBILE))
            mobile.setPrivacy(p.getInt(CONTACT.MOBILE));
        else
            setPublic(mobile, p, CONTACT.MOBILE);
        if (!p.isNull(CONTACT.PLATE))
            plate.setPrivacy(p.getInt(CONTACT.PLATE));
        else
            setPublic(plate, p, CONTACT.PLATE);
        if (!p.isNull(NAME))
            name.setPrivacy(p.getInt(NAME));
        else
            setPublic(name, p, NAME);
    } catch (JSONException e) {
        e.printStackTrace();
    }
}

From source file:com.andrewshu.android.reddit.threads.BitmapManager.java

public void fetchBitmapOnThread(final String urlString, final ImageView imageView,
        final ProgressBar indeterminateProgressBar, final Activity act) {
    SoftReference<Bitmap> ref = mCache.get(urlString);
    if (ref != null && ref.get() != null) {
        imageView.setImageBitmap(ref.get());
        return;/*from   w w  w .  j a va2 s .  c o  m*/
    }

    final Runnable progressBarShow = new Runnable() {
        public void run() {
            if (indeterminateProgressBar != null) {
                imageView.setVisibility(View.GONE);
                indeterminateProgressBar.setVisibility(View.VISIBLE);
            }
        }
    };
    final Runnable progressBarHide = new Runnable() {
        public void run() {
            if (indeterminateProgressBar != null) {
                indeterminateProgressBar.setVisibility(View.GONE);
                imageView.setVisibility(View.VISIBLE);
            }
        }
    };

    final Handler handler = new Handler() {
        @Override
        public void handleMessage(Message message) {
            if (indeterminateProgressBar != null && act != null)
                act.runOnUiThread(progressBarHide);
            imageView.setImageBitmap((Bitmap) message.obj);
        }
    };

    Thread thread = new Thread() {
        @Override
        public void run() {
            if (indeterminateProgressBar != null && act != null)
                act.runOnUiThread(progressBarShow);
            Bitmap bitmap = fetchBitmap(urlString);
            Message message = handler.obtainMessage(1, bitmap);
            handler.sendMessage(message);
        }
    };
    thread.start();
}

From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_browser.video.SignVideoFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    Log.d(TAG, "onActivityCreated");
    super.onActivityCreated(savedInstanceState);
    final Sign sign = getArguments().getParcelable(SIGN_TO_SHOW);
    Validate.notNull(sign, "No sign to show provided via fragment arguments.");
    this.signVideoName.setText(sign.getNameLocaleDe());
    this.signVideoMnemonic.setText(sign.getMnemonic());
    try {// w  w  w .ja  v  a2s  . c o  m
        setupVideoView(sign, SOUND.ON, CONTROLS.SHOW);
    } catch (VideoSetupException ex) {
        this.signVideoName.setText(getString(R.string.videoError));
        this.signVideoMnemonic.setVisibility(View.GONE);
        this.clickVideoToShowControls.setVisibility(View.GONE);
        this.signVideoExceptionMessage.setText(ex.getMessage());
        this.signVideoExceptionMessage.setVisibility(View.VISIBLE);
        this.progressBar.setVisibility(View.GONE);
    }
}

From source file:com.QuarkLabs.BTCeClient.fragments.ActiveOrdersFragment.java

@Override
public void onLoaderReset(Loader<JSONObject> loader) {
    mListView.setAdapter(null);
    mNoItems.setVisibility(View.GONE);
    mListView.setEmptyView(mLoadingView);
}

From source file:com.miz.mizuu.fragments.FanartSearchFragment.java

@Override
public void onViewCreated(View v, Bundle savedInstanceState) {
    super.onViewCreated(v, savedInstanceState);

    mProgressBar = (ProgressBar) v.findViewById(R.id.progress);
    if (mImageUrls.size() > 0)
        mProgressBar.setVisibility(View.GONE); // Hack to remove the ProgressBar on orientation change

    mGridView = (GridView) v.findViewById(R.id.gridView);
    mAdapter = new ImageAdapter(getActivity());
    mGridView.setAdapter(mAdapter);//from w w  w.j a v a 2 s .  c  o m

    mGridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            // Create the download Service
            Intent downloadService = new Intent(getActivity(), DownloadImageService.class);
            downloadService.putExtra(DownloadImageService.CONTENT_ID, mTmdbId);
            downloadService.putExtra(DownloadImageService.IMAGE_URL, mImageUrls.get(arg2));
            downloadService.putExtra(DownloadImageService.IMAGE_TYPE,
                    DownloadImageService.IMAGE_TYPE_MOVIE_BACKDROP);
            getActivity().startService(downloadService);

            // End the browser Activity
            getActivity().finish();
        }
    });

    mJson = getArguments().getString("json");
    loadJson(getArguments().getString("baseUrl"));
}

From source file:com.codebutler.farebot.fragment.CardTripsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_card_trips, null);

    List<Trip> trips = new ArrayList<>();
    if (mTransitData.getTrips() != null && mTransitData.getTrips().length > 0) {
        for (Trip t : mTransitData.getTrips()) {
            trips.add(t);// ww  w.ja  v a2 s .c om
        }
    }

    // This is for "legacy" implementations which have a separate list of refills.
    if (mTransitData.getRefills() != null && mTransitData.getRefills().length > 0) {
        for (Refill r : mTransitData.getRefills()) {
            trips.add(new RefillTrip(r));
        }
    }

    // Explicitly sort these events
    Collections.sort(trips, new Trip.Comparator());

    if (trips.size() > 0) {
        setListAdapter(new UseLogListAdapter(getActivity(), trips.toArray(new Trip[trips.size()])));
    } else {
        view.findViewById(android.R.id.list).setVisibility(View.GONE);
        view.findViewById(R.id.error_text).setVisibility(View.VISIBLE);
    }

    return view;
}

From source file:net.olejon.mdapp.NotificationsFromSlvAdapter.java

@Override
public void onBindViewHolder(NotificationViewHolder viewHolder, int i) {
    try {/*from   w  w  w  .j a v a  2 s  .c om*/
        final JSONObject notificationsJsonObject = mNotifications.getJSONObject(i);

        viewHolder.title.setText(notificationsJsonObject.getString("title"));
        viewHolder.date.setText(notificationsJsonObject.getString("date"));
        viewHolder.type.setText(notificationsJsonObject.getString("type"));
        viewHolder.message.setText(notificationsJsonObject.getString("message"));

        final String title = notificationsJsonObject.getString("title");
        final String uri = notificationsJsonObject.getString("uri");

        if (uri.equals("")) {
            viewHolder.uriSeparator.setVisibility(View.GONE);
            viewHolder.uri.setVisibility(View.GONE);
        } else {
            viewHolder.uriSeparator.setVisibility(View.VISIBLE);
            viewHolder.uri.setVisibility(View.VISIBLE);

            viewHolder.title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (uri.matches("^https?://.*?\\.pdf$")) {
                        mTools.downloadFile(title, uri);
                    } else {
                        Intent intent = new Intent(mContext, MainWebViewActivity.class);
                        intent.putExtra("title", title);
                        intent.putExtra("uri", uri);
                        mContext.startActivity(intent);
                    }
                }
            });

            viewHolder.uri.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (uri.matches("^https?://.*?\\.pdf$")) {
                        mTools.downloadFile(title, uri);
                    } else {
                        Intent intent = new Intent(mContext, MainWebViewActivity.class);
                        intent.putExtra("title", title);
                        intent.putExtra("uri", uri);
                        mContext.startActivity(intent);
                    }
                }
            });
        }

        animateView(viewHolder.card, i);
    } catch (Exception e) {
        Log.e("NotificationsFromSlv", Log.getStackTraceString(e));
    }
}

From source file:com.siso.app.adapter.MarketListAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder listItemView = null;/*w w  w .  ja  va  2  s.  co m*/
    if (convertView == null) {
        convertView = listContainer.inflate(this.itemViewResource, null, false);
        listItemView = new ViewHolder();
        listItemView.content = (TextView) convertView.findViewById(R.id.marketList_title);
        listItemView.priceTextView = (TextView) convertView.findViewById(R.id.marketList_price);
        listItemView.username = (TextView) convertView.findViewById(R.id.marketList_username);
        listItemView.imageView = (ImageView) convertView.findViewById(R.id.marketList_img);
        listItemView.linearLayout = (LinearLayout) convertView.findViewById(R.id.nearby);
        listItemView.likeButton = (LinearLayout) convertView.findViewById(R.id.item_goods_like);
        listItemView.likeCount = (TextView) convertView.findViewById(R.id.item_goods_like_text);
        listItemView.viewCount = (TextView) convertView.findViewById(R.id.item_goods_viewcount);
        listItemView.likeImageButton = (ImageButton) convertView.findViewById(R.id.item_goods_like_btn);
        if (type == 1) {
            listItemView.username.setVisibility(View.GONE);
            listItemView.linearLayout.setVisibility(View.VISIBLE);
            listItemView.schoolname = (TextView) convertView.findViewById(R.id.marketList_schoolname);
            listItemView.distance = (TextView) convertView.findViewById(R.id.marketList_distance);
        }
        convertView.setTag(listItemView);
    } else {
        listItemView = (ViewHolder) convertView.getTag();
    }

    final GoodsEntity tmpGoodsEntity = listItems.get(position);
    listItemView.content.setText(tmpGoodsEntity.getGoodTitle());
    listItemView.priceTextView.setText("" + tmpGoodsEntity.getGoodPrice());
    listItemView.username.setText(tmpGoodsEntity.getUserName());
    if (type == 1) {
        listItemView.schoolname.setText("?[" + tmpGoodsEntity.getSchoolName() + "]");
        listItemView.distance.setText(tmpGoodsEntity.getDistance() + "Km");
    }
    if (tmpGoodsEntity.isLike()) {
        listItemView.likeImageButton.setBackgroundResource(R.drawable.liked);
    }
    listItemView.likeCount.setText(tmpGoodsEntity.getLikeCount() + "");
    listItemView.viewCount.setText(tmpGoodsEntity.getViewCount() + "");

    listItemView.likeButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (MyApplication.userInfo == null) {
                Toast.makeText(context, context.getResources().getString(R.string.has_no_login),
                        Toast.LENGTH_SHORT).show();
                return;
            }

            ImageButton imageButton = (ImageButton) view.findViewById(R.id.item_goods_like_btn);
            TextView likeCount = (TextView) view.findViewById(R.id.item_goods_like_text);
            if (tmpGoodsEntity.isLike()) {
                postData(tmpGoodsEntity.getId(), "delete");
                tmpGoodsEntity.setLike(false);
                imageButton.setBackgroundResource(R.drawable.like);
                String textString = likeCount.getText().toString();
                if (textString != null) {
                    likeCount.setText(Integer.parseInt(textString) - 1 + "");
                }
            } else {
                postData(tmpGoodsEntity.getId(), "add");
                tmpGoodsEntity.setLike(true);
                imageButton.setBackgroundResource(R.drawable.liked);
                String textString = likeCount.getText().toString();
                if (textString != null) {
                    likeCount.setText(Integer.parseInt(textString) + 1 + "");
                }
            }

        }
    });

    if (tmpGoodsEntity.getGoodImages() != null) {
        Picasso picasso = Picasso.with(listItemView.imageView.getContext());
        picasso.load(CommonUtils.getFirstImg(tmpGoodsEntity.getGoodImages()))
                .placeholder(R.drawable.ic_img_loading).into(listItemView.imageView);
    } else {
        listItemView.imageView.setBackgroundResource(R.drawable.ic_img_loading);
    }

    return convertView;
}