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:org.kei.android.phone.cellhistory.fragments.RecorderFragment.java

@Override
public void onClick(final View v) {
    if (v.equals(toggleOnOff)) {
        if (toggleOnOff.isChecked()) {
            getActivity().startService(new Intent(getActivity(), RecorderService.class));
        } else {// w w  w . ja  v a2 s .c  o m
            stopProcess();
        }
    }
}

From source file:io.github.hidroh.materialistic.DrawerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setContentView(R.layout.activity_drawer);
    mDrawer = findViewById(R.id.drawer);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerAccount = (TextView) findViewById(R.id.drawer_account);
    mDrawerLogout = findViewById(R.id.drawer_logout);
    mDrawerUser = findViewById(R.id.drawer_user);
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.open_drawer,
            R.string.close_drawer) {/*w  ww .j  a va  2 s. c  o m*/
        @Override
        public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);
            if (drawerView.equals(mDrawer) && mPendingNavigation != null) {
                final Intent intent = new Intent(DrawerActivity.this, mPendingNavigation);
                if (mPendingNavigationExtras != null) {
                    intent.putExtras(mPendingNavigationExtras);
                    mPendingNavigationExtras = null;
                }
                // TODO M bug https://code.google.com/p/android/issues/detail?id=193822
                intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                startActivity(intent);
                mPendingNavigation = null;
            }
        }
    };
    mDrawerLayout.addDrawerListener(mDrawerToggle);
    PreferenceManager.getDefaultSharedPreferences(this)
            .registerOnSharedPreferenceChangeListener(mLoginListener);
    setUpDrawer();
    setUsername();
}

From source file:com.monmonja.library.fragment.RateAppDialogFragment.java

@Override
public void onClick(View v) {
    SharedPreferences sharedPreferences = PreferenceManager
            .getDefaultSharedPreferences(v.getContext().getApplicationContext());
    SharedPreferences.Editor editor = sharedPreferences.edit();
    if (v.equals(mDisableRateBtn)) {
        editor.putBoolean(PlayServiceUtils.PREF_RATE_APP_ENABLE, false);
        editor.apply();//from   w w  w.  j a  va 2s .c o m
        dismiss();
    } else if (v.equals(mRateBtn)) {
        editor.putBoolean(PlayServiceUtils.PREF_RATE_APP_ENABLE, false);
        editor.apply();
        dismiss();

        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse(mMarketUri));
        v.getContext().startActivity(intent);
    }
}

From source file:org.exoplatform.ui.social.SelectedImageActivity.java

public void onClick(View view) {
    if (view.equals(okButton)) {
        if (filePath != null) {
            if (DocumentActivity._documentActivityInstance != null) {
                DocumentActivity._documentActivityInstance._sdcard_temp_dir = filePath;
                DocumentActivity._documentActivityInstance.uploadFile();
            } else
                ComposeMessageActivity.addImageToMessage(file);
        }//  w  w  w . j a  v  a2 s.c om

    }

    if (view.equals(removeButton)) {
        if (modeId == EDIT_MODE) {
            ComposeMessageActivity.removeImageFromMessage();
        }
        if (modeId == SELECT_MODE) {
            backToGallery();
        }
    }
    finish();

}

From source file:org.kevoree.platform.android.boot.view.ManagerUI.java

@Override
public void removeView(View view) {

    if (view == null) {
        return;//from  www .j a  va 2 s  . co  m
    }

    Log.i("Request remove view", "");
    LinkedList<ActionBar.Tab> newtabs = new LinkedList<ActionBar.Tab>();
    for (ActionBar.Tab tab : tabs) {
        LinearLayout tabLayout = (LinearLayout) tab.getTag();
        int childcount = tabLayout.getChildCount();
        for (int i = 0; i < childcount; i++) {
            View v = tabLayout.getChildAt(i);
            if (v != null) {
                if (v.equals(view)) {
                    tabLayout.removeView(view);
                }
            }
        }
        Log.i("Remove view " + tab.getText(), " " + ((LinearLayout) tab.getTag()).getChildCount());
        if (((LinearLayout) tab.getTag()).getChildCount() == 0) {
            if (tab.getPosition() == selectedTab) {
                selectedTab = ktab;
            }
            ctx.getSupportActionBar().removeTab(tab);
        } else {
            newtabs.add(tab);
        }
    }
    tabs.clear();
    tabs.addAll(newtabs);
    notifyObservers(this);
}

From source file:ca.psiphon.ploggy.FragmentComposeMessage.java

@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, view, menuInfo);
    if (view.equals(mPictureThumbnail)) {
        getActivity().getMenuInflater().inflate(R.menu.compose_message_picture_context, menu);
    }//from  w ww. java 2  s .  c o  m
}

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

public void onClick(View view) {
    if (view.equals(mSearchButton)) {
        searchButtonClicked();/*  ww w .  j a  va2 s  . c o  m*/
    } else if (view.equals(mResetButton)) {
        mPresenter.resetButtonClicked();
    } else if (view.equals(mBookmarkButton)) {
        bookmarkButtonClicked();
    } else if (view.equals(mShareButton)) {
        mPresenter.shareButtonClicked();
    } else {
        Log.e(TAG, "onClick: " + getString(R.string.how_am_i_here));
    }
}

From source file:br.com.brolam.cloudvision.ui.MainActivity.java

@Override
public void onClick(View view) {
    if (view.equals(this.fabAdd)) {
        NoteVisionActivity.newNoteVision(this, NOTE_VISION_REQUEST_COD);
        this.appAnalyticsHelper.logNoteVisionAdd(TAG);
    }//  w ww.  ja  v a 2 s  .co  m
}

From source file:com.example.tt.pullrefresh.widget.HeaderRefreshLayout.java

private void ensureTarget() {
    // Don't bother getting the parent height if the parent hasn't been laid
    // out yet./*from   w  w w  .j  ava2s.  c  om*/
    if (targetView == null) {
        for (int i = 0; i < getChildCount(); i++) {
            View child = getChildAt(i);
            if (!child.equals(header)) {
                targetView = child;
                break;
            }
        }
    }
}

From source file:jp.co.recruit_lifestyle.android.widget.BeerSwipeRefreshLayout.java

private void ensureTarget() {
    if (mTarget == null) {
        for (int i = 0; i < getChildCount(); i++) {
            View child = getChildAt(i);
            if (!child.equals(mBeerView)) {
                mTarget = child;/* w  w  w . j a v a2s  .  c  o  m*/
                break;
            }
        }
    }

    if (mTarget == null) {
        throw new IllegalStateException("This view must have at least one AbsListView");
    }
}