Example usage for android.view View equals

List of usage examples for android.view View equals

Introduction

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

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:com.jana.android.ui.impl.viewmodel.ImagePagerAdapter.java

@Override
public boolean isViewFromObject(View view, Object obj) {
    return view.equals(obj);
}

From source file:com.andrewchelladurai.simplebible.ChapterFragment.java

@Override
public void onClick(View v) {
    if (v.equals(fabBookmark)) {
        bookmarkButtonClicked();/*w ww . j a v a2  s  . com*/
    } else if (v.equals(fabShare)) {
        mPresenter.shareButtonClicked();
    } else if (v.equals(fabReset)) {
        boolean cleared = mPresenter.resetButtonClicked();
        if (cleared) {
            refresh();
        }
    }
}

From source file:org.chatsecure.pushdemo.MainActivity.java

@Override
public void onClick(View v) {
    if (v.equals(signOut)) {
        dataProvider.clear();/*from  ww w .  j av a 2 s .c  o m*/
        client.setAccount(null);
        register();
        drawer.closeDrawers();
    }
}

From source file:com.ruesga.rview.wizard.WizardPageFragment.java

@SuppressWarnings("unchecked")
public void triggerAllValidators(View source) {
    boolean isValidated = true;

    // Check the source of the event in first place
    Pair<ValidatorObserver, Validator[]> p = mValidators.get(source);
    if (p != null) {
        Validator failed = null;/*from w w  w .  j  av a  2 s.c o m*/
        for (Validator validator : p.second) {
            if (!validator.validate(source)) {
                // Validation error
                isValidated = false;
                failed = validator;
                break;
            }
        }
        onViewValidated(source, failed);
    }

    // And all the rest of the views
    if (isValidated) {
        for (View v : mValidators.keySet()) {
            if (v.equals(source)) {
                continue;
            }
            p = mValidators.get(v);
            for (Validator validator : p.second) {
                if (!validator.validate(v)) {
                    // Validation error
                    isValidated = false;
                    break;
                }
            }
        }
    }

    mIsValidated = isValidated;
    notifyValidationChanged();
}

From source file:com.eurecalab.eureca.fragments.SettingsFragment.java

@Override
public void onClick(View v) {
    if (v.equals(apply)) {
        boolean reverse = reverseColor.isChecked();

        int color = (Integer) colorSpinner.getSelectedItem();

        new ThemeSwitcher(getActivity()).changeToTheme(color, reverse);

        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putInt(getString(R.string.saved_color), color);
        editor.putBoolean(getString(R.string.saved_reverse), reverse);
        editor.commit();/*  w ww. j ava  2s. c  o m*/
    } else if (v.equals(signOutButton)) {
        Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(new ResultCallback<Status>() {
            @Override
            public void onResult(Status status) {
                Intent intent = new Intent(getActivity(), LoginActivity.class);
                getActivity().startActivity(intent);
                getActivity().finish();
            }
        });
        gs.setAuthenticatedUser(null);
    } else if (v.equals(upgrade)) {
        upgradePro();
    }
}

From source file:net.ustyugov.jtalk.activity.vcard.SetVcardActivity.java

@Override
public void onClick(View v) {
    if (v.equals(clear)) {
        bytes = null;/*from   ww  w .  ja  v a  2s .c o  m*/
        av.setImageBitmap(null);
    } else if (v.equals(load)) {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        intent.setType("image/*");
        startActivityForResult(Intent.createChooser(intent, null), IMAGE);
    }
}

From source file:com.andremion.louvre.preview.PreviewAdapter.java

@Override
public boolean isViewFromObject(View view, Object object) {
    return object instanceof ViewHolder && view.equals(((ViewHolder) object).itemView);
}

From source file:in.blogspot.anselmbros.torchie.ui.fragment.SettingsFragment.java

@Override
public void onClick(View v) {
    if (v.equals(ll_choose_lang)) {
        showDialogLangSelect();
    }
}

From source file:org.borderstone.tagtags.widgets.BGPSWidget.java

@Override
public void onClick(View v) {
    if (v.equals(btnGPS) && gpsButtonActive) {
        if (locationManager != null) {
            updateData(coordinates);//  w w  w .  j a  va 2 s.co m

            killLocationManager();

            setGPSButtonEnabled(false);
            Toast.makeText(getContext(), "Saved coordinates.", Toast.LENGTH_SHORT).show();
        } else {
            startLocationListener();

            lblCoordinates.setText("...");
        }
    }
}

From source file:org.borderstone.tagtags.widgets.BGPSWidget.java

@Override
public boolean onLongClick(View v) {
    if (v.equals(btnGPS) && !gpsButtonActive) {
        new BWarningDialog(getContext(), "Yes", "No", "Do you really want to look for a new location?",
                new WarningMessageListener() {
                    @Override//from www. ja va 2 s. c  o m
                    public void acceptWarning(boolean tf) {
                        if (tf) {
                            setGPSButtonEnabled(true);
                            startLocationListener();
                        }
                    }
                });
    }

    return false;
}