Example usage for android.widget LinearLayout setVisibility

List of usage examples for android.widget LinearLayout setVisibility

Introduction

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

Prototype

@RemotableViewMethod
public void setVisibility(@Visibility int visibility) 

Source Link

Document

Set the visibility state of this view.

Usage

From source file:com.money.manager.ex.home.HomeFragment.java

private void setUpMigrationButton(View view) {
    // check if there is a database at the old location.
    final DatabaseMigrator14To20 migrator = new DatabaseMigrator14To20(getActivity());
    boolean legacyDataExists = migrator.legacyDataExists();

    // hide option if there is no old database.
    if (!legacyDataExists)
        return;/*from  ww w .  ja v  a  2 s.  c  om*/

    // otherwise show the options
    LinearLayout panel = (LinearLayout) view.findViewById(R.id.panelMigration);
    panel.setVisibility(View.VISIBLE);

    // e events, etc.

    Button migrateDatabaseButton = (Button) view.findViewById(R.id.buttonMigrateDatabase);
    if (migrateDatabaseButton != null) {
        if (!migrator.legacyDataExists()) {

            // add handler
            OnClickListener migrateClickListener = new OnClickListener() {
                @Override
                public void onClick(View view) {
                    boolean migrationSuccess = migrator.migrateLegacyDatabase();
                    if (migrationSuccess) {
                        Toast.makeText(getActivity(), R.string.database_migrate_14_to_20_success,
                                Toast.LENGTH_LONG).show();
                    } else {
                        Toast.makeText(getActivity(), R.string.database_migrate_14_to_20_failure,
                                Toast.LENGTH_LONG).show();
                    }
                }
            };
            migrateDatabaseButton.setOnClickListener(migrateClickListener);
        } else {
            // hide migration notification.
            RobotoTextView textMigrate = (RobotoTextView) view.findViewById(R.id.textMigrateDatabase);
            textMigrate.setVisibility(View.GONE);

            migrateDatabaseButton.setVisibility(View.GONE);
        }

    }
}

From source file:com.dm.material.dashboard.candybar.activities.CandyBarMainActivity.java

private void initNavigationViewHeader() {
    String imageUrl = getResources().getString(R.string.navigation_view_header);
    String titleText = getResources().getString(R.string.navigation_view_header_title);
    View header = mNavigationView.getHeaderView(0);
    ImageView image = (ImageView) header.findViewById(R.id.header_image);
    LinearLayout container = (LinearLayout) header.findViewById(R.id.header_title_container);
    TextView title = (TextView) header.findViewById(R.id.header_title);
    TextView version = (TextView) header.findViewById(R.id.header_version);

    if (titleText.length() == 0) {
        container.setVisibility(View.GONE);
    } else {/*w w  w . ja  v a2 s . c  om*/
        title.setText(titleText);
        try {
            String versionText = "v" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
            version.setText(versionText);
        } catch (Exception ignored) {
        }
    }

    if (ColorHelper.isValidColor(imageUrl)) {
        image.setBackgroundColor(Color.parseColor(imageUrl));
        return;
    }

    if (!URLUtil.isValidUrl(imageUrl)) {
        imageUrl = "drawable://" + DrawableHelper.getResourceId(this, imageUrl);
    }

    ImageLoader.getInstance().displayImage(imageUrl, new ImageViewAware(image),
            ImageConfig.getDefaultImageOptions(true), new ImageSize(720, 720), null, null);
}

From source file:com.example.zf_android.trade.ApplyDetailActivity.java

private void hideItem(String key) {
    LinearLayout item = (LinearLayout) mContainer.findViewWithTag(key);
    item.setVisibility(View.GONE);
}

From source file:com.example.zf_android.trade.ApplyDetailActivity.java

private void showItem(String key) {
    LinearLayout item = (LinearLayout) mContainer.findViewWithTag(key);
    item.setVisibility(View.VISIBLE);
}

From source file:com.salmannazir.filemanager.businesslogic.EventHandler.java

public void handleMultiSelectButton() {
    if (multi_select_flag) {
        mListAdapter.removeMultiSelect(true);

    } else {//from w w w  .  j a  v  a2 s.  c o m
        LinearLayout hidden_layout = (LinearLayout) ((Activity) mContext).findViewById(R.id.hidden_buttons);

        multi_select_flag = true;
        hidden_layout.setVisibility(LinearLayout.VISIBLE);
    }
}

From source file:org.glucosio.android.activity.MainActivity.java

public void checkIfEmptyLayout() {
    LinearLayout emptyLayout = (LinearLayout) findViewById(R.id.activity_main_empty_layout);
    ViewPager pager = (ViewPager) findViewById(R.id.activity_main_pager);

    if (presenter.isdbEmpty()) {
        pager.setVisibility(View.GONE);
        tabLayout.setVisibility(View.GONE);
        emptyLayout.setVisibility(View.VISIBLE);

        bottomSheetAddDialogView = getLayoutInflater().inflate(R.layout.fragment_add_bottom_dialog_disabled,
                null);//from  w  w  w.java 2  s.  c om

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            if (getResources().getConfiguration().orientation == 1) {
                // If Portrait choose vertical curved line
                ImageView arrow = (ImageView) findViewById(R.id.activity_main_arrow);
                arrow.setBackground(getResources().getDrawable(R.drawable.curved_line_vertical));
            } else {
                // Else choose horizontal one
                ImageView arrow = (ImageView) findViewById(R.id.activity_main_arrow);
                arrow.setBackground((getResources().getDrawable(R.drawable.curved_line_horizontal)));
            }
        }
    } else {
        pager.setVisibility(View.VISIBLE);
        emptyLayout.setVisibility(View.GONE);
        bottomSheetAddDialogView = getLayoutInflater().inflate(R.layout.fragment_add_bottom_dialog, null);
    }
}

From source file:com.github.colorchief.colorchief.MainActivity.java

public void cancelButtonClick(View view) {
    LinearLayout overlayColorControl = (LinearLayout) findViewById(R.id.overlayColorControl);
    overlayColorControl.setVisibility(LinearLayout.INVISIBLE);
}

From source file:com.jamsuni.jamsunicodescan.MainActivity.java

public void displayBookInfo(BookInfo bookInfo) {

    barcodeValue.setVisibility(View.GONE);

    LinearLayout llBookInfo = (LinearLayout) findViewById(R.id.llBookInfo);
    llBookInfo.setVisibility(View.VISIBLE);
    TextView tvTitle = (TextView) findViewById(R.id.tvBookTitle);
    TextView tvAuthor = (TextView) findViewById(R.id.tvAuthor);
    TextView tvPublisher = (TextView) findViewById(R.id.tvPublisher);
    TextView tvPrice = (TextView) findViewById(R.id.tvPrice);
    TextView tvISBN = (TextView) findViewById(R.id.tvISBN);
    TextView tvPubDate = (TextView) findViewById(R.id.tvPubDate);
    TextView tvDesc = (TextView) findViewById(R.id.tvDesc);
    tvTitle.setText(bookInfo.getTitle());
    tvAuthor.setText(bookInfo.getAuthor());
    tvPublisher.setText(bookInfo.getPublisher());
    tvPrice.setText(bookInfo.getPrice());
    tvPubDate.setText(bookInfo.getPubdate());
    tvISBN.setText(bookInfo.getIsbn());//  ww  w.  j  a  v  a2 s.  c o m
    tvDesc.setText(bookInfo.getDesc());
}

From source file:com.sentaroh.android.BluetoothWidget.Log.LogFileListDialogFragment.java

private void setContextButtonSelecteMode(LogFileListAdapter lfm_adapter) {
    final TextView dlg_title = (TextView) mDialog.findViewById(R.id.log_file_list_dlg_title);
    String sel = "" + lfm_adapter.getItemSelectedCount() + "/" + lfm_adapter.getCount();
    dlg_title.setText(sel);//from   w ww.  ja  v a2s  . c o m

    final ImageButton dlg_done = (ImageButton) mDialog.findViewById(R.id.log_file_list_dlg_done);
    dlg_done.setVisibility(ImageButton.VISIBLE);

    LinearLayout ll_prof = (LinearLayout) mDialog.findViewById(R.id.log_context_view);
    LinearLayout ll_delete = (LinearLayout) ll_prof.findViewById(R.id.log_context_button_delete_view);
    LinearLayout ll_share = (LinearLayout) ll_prof.findViewById(R.id.log_context_button_share_view);
    LinearLayout ll_rotate_log = (LinearLayout) ll_prof.findViewById(R.id.log_context_button_rotate_log_view);
    LinearLayout ll_select_all = (LinearLayout) ll_prof.findViewById(R.id.log_context_button_select_all_view);
    LinearLayout ll_unselect_all = (LinearLayout) ll_prof
            .findViewById(R.id.log_context_button_unselect_all_view);

    ll_rotate_log.setVisibility(LinearLayout.GONE);

    boolean deletable_log_selected = false;
    for (int i = 0; i < lfm_adapter.getCount(); i++) {
        if (lfm_adapter.getItem(i).isChecked && !lfm_adapter.getItem(i).isCurrentLogFile) {
            deletable_log_selected = true;
            break;
        }
    }
    if (deletable_log_selected)
        ll_delete.setVisibility(LinearLayout.VISIBLE);
    else
        ll_delete.setVisibility(LinearLayout.GONE);

    if (lfm_adapter.getItemSelectedCount() > 0)
        ll_share.setVisibility(LinearLayout.VISIBLE);
    else
        ll_share.setVisibility(LinearLayout.GONE);

    ll_select_all.setVisibility(LinearLayout.VISIBLE);
    if (lfm_adapter.isAnyItemSelected())
        ll_unselect_all.setVisibility(LinearLayout.VISIBLE);
    else
        ll_unselect_all.setVisibility(LinearLayout.GONE);
}

From source file:com.jamsuni.jamsunicodescan.MainActivity.java

public void displayProductInfo(ProductInfo productInfo) {

    barcodeValue.setVisibility(View.GONE);

    LinearLayout llProductInfo = (LinearLayout) findViewById(R.id.llProductInfo);
    llProductInfo.setVisibility(View.VISIBLE);

    TextView tvTitle = (TextView) findViewById(R.id.tvProdutTitle);
    TextView tvManu = (TextView) findViewById(R.id.tvManufacturer);
    TextView tvSeller = (TextView) findViewById(R.id.tvSeller);
    TextView tvPubDate = (TextView) findViewById(R.id.tvProductPubDate);
    TextView tvDesc = (TextView) findViewById(R.id.tvProductDesc);
    tvTitle.setText(productInfo.getTitle());
    tvManu.setText(productInfo.getManufacturer());
    tvSeller.setText(productInfo.getSeller());
    tvPubDate.setText(productInfo.getPubdate());
    tvDesc.setText(productInfo.getDesc());
}