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:io.v.positioning.BluetoothPositionActivity.java

private void doDiscovery() {
    Log.d(TAG, "doDiscovery()");
    setProgressBarIndeterminateVisibility(true);
    setTitle(R.string.finding_devices);//from w  w  w .  j  a  va2  s.  c  om
    findViewById(R.id.recorded_devices).setVisibility(View.VISIBLE);
    if (mBtAdapter.isDiscovering()) {
        mBtAdapter.cancelDiscovery();
    }
    mBtAdapter.startDiscovery();
}

From source file:com.kanchi.periyava.Fragments.Dashboard.java

private void init() {
    if (UserProfile.getUserProfile().isLoggedIn == false) {
        return;//from  w  w w . j av a  2 s .c  o m
    }
    rootView.findViewById(R.id.japaminfo)
            .setVisibility(UserProfile.getUserProfile().isLoggedIn == true ? View.VISIBLE : View.GONE);
    ((TextView) rootView.findViewById(R.id.japam_count_over_all))
            .setText("" + UserProfile.getUserProfile().japam_count_over_all);
    ((TextView) rootView.findViewById(R.id.japam_count_satsang))
            .setText(UserProfile.getInstance().isjoinedsatsang == false ? "Not Joined to Satsang"
                    : "" + UserProfile.getUserProfile().japam_count_satsang);
    ((TextView) rootView.findViewById(R.id.japam_count)).setText("" + UserProfile.getUserProfile().japam_count);

    final String NEW_FORMAT = "dd-MMM-yyyy";
    final String OLD_FORMAT = "yyyy-MM-dd HH:mm:ss";

    // August 12, 2010
    String oldDateString = UserProfile.getUserProfile().japam_last_updated_date;
    String newDateString = "";

    SimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);
    Date d = null;
    try {
        d = sdf.parse(oldDateString);
        sdf.applyPattern(NEW_FORMAT);
        newDateString = sdf.format(d);
    } catch (ParseException e) {
        e.printStackTrace();
    }

    ((TextView) rootView.findViewById(R.id.japam_last_updated_date)).setText(newDateString);
}

From source file:com.mtomczak.nausicaa.AlertView.java

/**
 * Sets visibility of alert text. Must be called from UI thread.
 * @param visible If true, alert will show and suppress other views.
 *///from w  w w  . j a v  a  2  s . co  m
private void setAlertVisible(boolean visible) {
    alertText.setVisibility(visible ? View.VISIBLE : View.GONE);
    childViews.setVisibility(visible ? View.GONE : View.VISIBLE);
}

From source file:de.geeksfactory.opacclient.frontend.InfoFragment.java

public void load() {
    wvInfo = (WebView) view.findViewById(R.id.wvInfo);
    TextView tvErr = (TextView) view.findViewById(R.id.tvErr);
    wvInfo.loadData(getString(R.string.loading), "text/html", null);

    try {/*from w w w. j  a  va  2  s. c o m*/
        String infoUrl = app.getLibrary().getInformation();
        if (infoUrl == null || infoUrl.equals("null")) {
            wvInfo.setVisibility(View.GONE);
            tvErr.setVisibility(View.VISIBLE);
            tvErr.setText(R.string.info_unsupported);
        } else if (infoUrl.startsWith("http")) {
            wvInfo.loadUrl(infoUrl);
        } else {
            wvInfo.loadUrl(app.getLibrary().getData().getString("baseurl") + infoUrl);
        }
    } catch (JSONException e) {
        e.printStackTrace();
        wvInfo.setVisibility(View.GONE);
        tvErr.setVisibility(View.VISIBLE);
        tvErr.setText(R.string.info_error);
    }
}

From source file:com.hybris.mobile.adapter.AddressAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.selectable_row, parent, false);
    TextView textView = (TextView) rowView.findViewById(android.R.id.text1);
    TextView textTitle = (TextView) rowView.findViewById(R.id.textTitle);

    String strName = "";

    CartDeliveryAddress address = addresses.get(position);

    if (StringUtils.isNotBlank(address.getLine1())) {
        strName = address.getLine1();/*from  w  w w  . j  a va  2 s .c o m*/
    }
    if (StringUtils.isNotBlank(address.getLine2())) {
        strName = strName + "\n" + address.getLine2();
    }
    if (StringUtils.isNotBlank(address.getTown())) {
        strName = strName + "\n" + address.getTown();
    }
    if (StringUtils.isNotBlank(address.getPostalCode())) {
        strName = strName + "\n" + address.getPostalCode();
    }
    if (address.getCountry() != null) {
        strName = strName + "\n" + address.getCountry().getName();
    }

    textTitle.setText(address.getTitle() + " " + address.getFirstName() + " " + address.getLastName());
    textTitle.setVisibility(View.VISIBLE);

    textView.setText(strName);

    return rowView;
}

From source file:com.vrem.wifianalyzer.wifi.timegraph.TimeGraphView.java

@Override
public void update(@NonNull WiFiData wiFiData) {
    Settings settings = MainContext.INSTANCE.getSettings();
    Predicate<WiFiDetail> predicate = FilterPredicate.makeOtherPredicate(settings);
    List<WiFiDetail> wiFiDetails = wiFiData.getWiFiDetails(predicate, settings.getSortBy());
    Set<WiFiDetail> newSeries = dataManager.addSeriesData(graphViewWrapper, wiFiDetails,
            settings.getGraphMaximumY());
    graphViewWrapper.removeSeries(newSeries);
    graphViewWrapper.updateLegend(settings.getTimeGraphLegend());
    graphViewWrapper.setVisibility(isSelected() ? View.VISIBLE : View.GONE);
}

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

/**
 * Populate the order summary/*from w ww. j  a  v  a  2 s  . c om*/
 *
 * @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:com.vrem.wifianalyzer.wifi.AccessPointsDetailTest.java

@Test
public void testSetViewWithWiFiDetailAsConnection() throws Exception {
    // setup//  w w w. ja  va  2  s.com
    WiFiDetail wiFiDetail = new WiFiDetail("SSID", "BSSID", "capabilities",
            new WiFiSignal(1, WiFiWidth.MHZ_20, 2), new WiFiAdditional("VendorName", "IPAddress", 22));
    // execute
    fixture.setView(mainActivity.getResources(), view, wiFiDetail, false, false);
    // validate
    validateTextViewValues(wiFiDetail, "SSID");

    validateTextViewValue(wiFiDetail.getWiFiAdditional().getIPAddress(), R.id.ipAddress);
    assertEquals(View.VISIBLE, view.findViewById(R.id.ipAddress).getVisibility());

    assertEquals(View.VISIBLE, view.findViewById(R.id.configuredImage).getVisibility());

    validateTextViewValue(
            String.format("%d%s", wiFiDetail.getWiFiAdditional().getLinkSpeed(), WifiInfo.LINK_SPEED_UNITS),
            R.id.linkSpeed);
    assertEquals(View.VISIBLE, view.findViewById(R.id.linkSpeed).getVisibility());

    validateTextViewValue(wiFiDetail.getWiFiAdditional().getVendorName(), R.id.vendor);
    assertEquals(View.VISIBLE, view.findViewById(R.id.vendor).getVisibility());

    assertEquals(View.GONE, view.findViewById(R.id.tab).getVisibility());
    assertEquals(View.GONE, view.findViewById(R.id.groupIndicator).getVisibility());

    assertEquals(View.GONE, view.findViewById(R.id.channel_frequency_range_row).getVisibility());
}

From source file:com.jaspersoft.android.jaspermobile.activities.file.HtmlFileViewFragment.java

@Override
protected void showErrorMessage() {
    errorText.setVisibility(View.VISIBLE);
}