private void afterSetContentView_() { layLoginLogo = ((LinearLayout) findViewById(id.layLoginLogo)); edTxtLoginPassword = ((EditText) findViewById(id.edTxtLoginPassword)); edTxtLoginId = ((EditText) findViewById(id.edTxtLoginId)); txtLoginNotice = ((TextView) findViewById(id.txtLoginNotice)); layLoginForm = ((LinearLayout) findViewById(id.layLoginForm)); { View view = findViewById(id.btnLogin); if (view != null) { view.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { LoginActivity_.this.doLogIn(); } }); } } { View view = findViewById(id.txtSignup); if (view != null) { view.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { LoginActivity_.this.doSignUp(); } }); } } initLoginForm(); }
@Override public void applySelfActionBar() { if (parentActivity == null) { return; } ActionBar actionBar = parentActivity.getSupportActionBar(); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setCustomView(R.layout.settings_do_action_layout); View cancelButton = actionBar.getCustomView().findViewById(R.id.cancel_button); cancelButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { finishFragment(); } }); doneButton = actionBar.getCustomView().findViewById(R.id.done_button); doneButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { if (firstNameField.getText().length() != 0) { saveName(); finishFragment(); } } }); }
private void initView(View layout) { lamp = layout.findViewById(R.id.v_lamp); menuLv = (ListView) layout.findViewById(R.id.lv_menu); subjectLv = (ListView) layout.findViewById(R.id.lv_subject); foldBtn = layout.findViewById(R.id.ll_title_sp); foldContent = layout.findViewById(R.id.ll_lv_sp); RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) foldBtn.getLayoutParams(); lp.leftMargin = location[0]; lp.topMargin = location[1]; foldBtn.setLayoutParams(lp); foldBtn.setOnClickListener(this); lamp.setOnClickListener(this); menuAdapter = new DataAdapter(getActivity().getBaseContext()); menuAdapter.setData(allocateData()); menuLv.setAdapter(menuAdapter); menuLv.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { menuAdapter.checked(i); subjectAdapter.setData(allocateSubject()); subjectAdapter.notifyDataSetChanged(); } }); subjectAdapter = new DataAdapter(getActivity().getBaseContext()); subjectAdapter.checked(-1); subjectAdapter.setData(allocateSubject()); subjectLv.setAdapter(subjectAdapter); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_create); tvRecipientError = (TextView) findViewById(R.id.tv_recipient_error); etRecipientId = (EditText) findViewById(R.id.et_recipient_id); etRecipientId.addTextChangedListener(this); btnContinue = (Button) findViewById(R.id.btn_check_recipient); btnContinue.setOnClickListener(this); tvProgress = (TextView) findViewById(R.id.tv_progress); vInitial = findViewById(R.id.v_initial); vProgress = findViewById(R.id.v_progress); vConfirm = findViewById(R.id.v_confirm); tvRecipientName = (TextView) findViewById(R.id.tv_recipient_name); tvRecipientEmail = (TextView) findViewById(R.id.tv_recipient_email); btnPint = findViewById(R.id.btn_pint); btnPint.setOnClickListener(this); btnCoffee = findViewById(R.id.btn_coffee); btnCoffee.setOnClickListener(this); btnSend = findViewById(R.id.btn_send); btnSend.setOnClickListener(this); btnSend.setEnabled(false); goToInitial(false); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textStatus = (TextView) findViewById(R.id.textStatus); new DataClass(getApplicationContext()); buttonOpenClose = (Button) findViewById(R.id.buttonMainLoginStart); buttonOpenClose.setOnClickListener(this); View buttonOpenRecord = findViewById(R.id.buttonMainOpenRecord); buttonOpenRecord.setOnClickListener(this); View buttonAddHealthPromotion = findViewById(R.id.buttonHealthPromotions); buttonAddHealthPromotion.setOnClickListener(this); View buttonOpenKnowledge = findViewById(R.id.buttonMainKnowledge); buttonOpenKnowledge.setOnClickListener(this); choId = 0; textStatus.setText("enter your name and click open"); // Create Folder for Resource materials File folder = new File(DataClass.getApplicationFolderPath()); if (!folder.exists()) { folder.mkdir(); } folder = new File(DataClass.getApplicationFolderPath() + "hp"); if (!folder.exists()) { folder.mkdir(); } }
private void setupPlaybackTextViews(View view, PlaybackPanel playbackPanel) { if (mAlbum != null || (mQuery != null && !TextUtils.isEmpty(mQuery.getAlbum().getName())) || (mPlaylistEntry != null && !TextUtils.isEmpty(mPlaylistEntry.getQuery().getAlbum().getName()))) { View v = ViewUtils.ensureInflation(view, R.id.view_album_button_stub, R.id.view_album_button); TextView viewAlbumButtonText = (TextView) v.findViewById(R.id.textview); viewAlbumButtonText.setText( TomahawkApp.getContext().getString(R.string.view_album).toUpperCase()); String cacheKey; if (mAlbum != null) { cacheKey = mAlbum.getCacheKey(); } else if (mQuery != null) { cacheKey = mQuery.getAlbum().getCacheKey(); } else { cacheKey = mPlaylistEntry.getAlbum().getCacheKey(); } v.setOnClickListener(constructAlbumNameClickListener(cacheKey)); } if (mAlbum != null || mQuery != null || mPlaylistEntry != null || mArtist != null) { View artistNameButton = playbackPanel.findViewById(R.id.artist_name_button); String cacheKey; if (mAlbum != null) { cacheKey = mAlbum.getArtist().getCacheKey(); } else if (mQuery != null) { cacheKey = mQuery.getArtist().getCacheKey(); } else if (mPlaylistEntry != null) { cacheKey = mPlaylistEntry.getArtist().getCacheKey(); } else { cacheKey = mArtist.getCacheKey(); } artistNameButton.setOnClickListener(constructArtistNameClickListener(cacheKey)); } }
private void showSuggestionsOptIn() { mSuggestionsOptInPrompt = LayoutInflater.from(mContext) .inflate(R.layout.awesomebar_suggestion_prompt, (LinearLayout) getView(), false); GeckoTextView promptText = (GeckoTextView) mSuggestionsOptInPrompt.findViewById(R.id.suggestions_prompt_title); promptText.setText( getResources().getString(R.string.suggestions_prompt, mSearchEngines.get(0).name)); Tab tab = Tabs.getInstance().getSelectedTab(); if (tab != null) promptText.setPrivateMode(tab.isPrivate()); final View yesButton = mSuggestionsOptInPrompt.findViewById(R.id.suggestions_prompt_yes); final View noButton = mSuggestionsOptInPrompt.findViewById(R.id.suggestions_prompt_no); OnClickListener listener = new OnClickListener() { @Override public void onClick(View v) { // Prevent the buttons from being clicked multiple times (bug 816902) yesButton.setOnClickListener(null); noButton.setOnClickListener(null); setSuggestionsEnabled(v == yesButton); } }; yesButton.setOnClickListener(listener); noButton.setOnClickListener(listener); mSuggestionsOptInPrompt.setVisibility(View.GONE); ((LinearLayout) getView()).addView(mSuggestionsOptInPrompt, 0); }
@Override public void bind(final Finder finder, final T target, Object source) { View view; view = finder.findRequiredView(source, 2131427462, "field 'mWebView'"); target.mWebView = finder.castView(view, 2131427462, "field 'mWebView'"); view = finder.findRequiredView(source, 2131427408, "field 'editText'"); target.editText = finder.castView(view, 2131427408, "field 'editText'"); view = finder.findRequiredView(source, 2131427411, "field 'mExpressionWidgt'"); target.mExpressionWidgt = finder.castView(view, 2131427411, "field 'mExpressionWidgt'"); view = finder.findRequiredView(source, 2131427410, "field 'mExprBtn' and method 'onClickExprBtn'"); target.mExprBtn = finder.castView(view, 2131427410, "field 'mExprBtn'"); view.setOnClickListener( new butterknife.internal.DebouncingOnClickListener() { @Override public void doClick(android.view.View p0) { target.onClickExprBtn(); } }); view = finder.findRequiredView(source, 2131427375, "field 'mRootContainer'"); target.mRootContainer = finder.castView(view, 2131427375, "field 'mRootContainer'"); view = finder.findRequiredView(source, 2131427407, "field 'mCommentOperateLo'"); target.mCommentOperateLo = finder.castView(view, 2131427407, "field 'mCommentOperateLo'"); view = finder.findRequiredView(source, 2131427463, "field 'mToolBar'"); target.mToolBar = view; view = finder.findRequiredView(source, 2131427409, "method 'senAction'"); view.setOnClickListener( new butterknife.internal.DebouncingOnClickListener() { @Override public void doClick(android.view.View p0) { target.senAction(); } }); }
// NewItemDialogFragment is called by the AddNewFragment Fragment @Nullable @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View theView = inflater.inflate(R.layout.fragment_change_item_dialog, container, false); View saveItemChangesBtn = theView.findViewById(R.id.saveItemChangesBtn); saveItemChangesBtn.setOnClickListener(this); saveItemChangesBtn.hasFocus(); View cancelItemChangesBtn = theView.findViewById(R.id.cancelItemChangesBtn); cancelItemChangesBtn.setOnClickListener(this); View deleteItemBtn = theView.findViewById(R.id.deleteItemBtn); deleteItemBtn.setOnClickListener(this); args = getArguments(); editItemTextField = (EditText) theView.findViewById(R.id.editItemText); editItemTextField.setText(args.getString("EditItemText")); // setup the dialog Dialog dialog = getDialog(); dialog.setTitle("Edit " + args.getString("EditItemType")); dialog.setCanceledOnTouchOutside(false); return theView; }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splitbill); TippyTipperApplication appState = ((TippyTipperApplication) this.getApplication()); splitBill(appState.service.getNumberOfPeople()); View btn_add_person = findViewById(R.id.btn_add_person); btn_add_person.setOnClickListener( new OnClickListener() { public void onClick(View v) { addPerson(); FlurryAgent.onEvent("Add Person Button"); } }); View btn_remove_person = findViewById(R.id.btn_remove_person); btn_remove_person.setOnClickListener( new OnClickListener() { public void onClick(View v) { removePerson(); FlurryAgent.onEvent("Remove Person Button"); } }); }
private void init() { setId(R.id.pathview); setLayoutParams(toolbarLayoutParams()); from(getContext()).inflate(R.layout.widget_pathview, this, true); mPathContainer = (PathHorizontalScrollView) findViewById(R.id.pathview_path_container); mButtonRight = findViewById(R.id.pathview_button_right); View buttonManualLeft = findViewById(R.id.pathview_manual_button_left); View buttonManualRight = findViewById(R.id.pathview_manual_button_right); mManualText = (EditText) findViewById(R.id.pathview_manual_text); mButtonRight.setOnClickListener(mSwitchToManualOnClickListener); buttonManualLeft.setOnClickListener(mCloseManualInputClickListener); buttonManualRight.setOnClickListener(mApplyManualInputClickListener); mManualText.setOnEditorActionListener(mOnEditorActionListener); mManualText.setCustomSelectionActionModeCallback(mEditorActionModeCallback); // XML doesn't always work mManualText.setInputType(TYPE_TEXT_VARIATION_URI | TYPE_TEXT_FLAG_NO_SUGGESTIONS); scheduleSetRightEdgeRangeListener(); // Setup CheatSheets setup(mButtonRight); setup(buttonManualRight); setup(buttonManualLeft); }
private void render() { mMessageCenter = findViewById(R.id.mycity_message); mSelectGameView = (TextView) findViewById(R.id.mycity_select_game); mMyRole = (TextView) findViewById(R.id.mycity_role); mMyWarehose = (TextView) findViewById(R.id.mycity_warehouse); mMyOrder = (TextView) findViewById(R.id.mycity_order); mSettings = (TextView) findViewById(R.id.mycity_settings); mLogoutButton = (Button) findViewById(R.id.button_logout); mMsgCenter = this.findViewById(R.id.message); mMsgCenter.setOnClickListener(this); mMsgNum = (TextView) this.findViewById(R.id.message_num); mMsgImgView = (ImageView) this.findViewById(R.id.navigationbar_drawable_left); mMsgImgView.setOnClickListener(this); mMessageCenter.setOnClickListener(this); mSelectGameView.setOnClickListener(this); mMyRole.setOnClickListener(this); mMyWarehose.setOnClickListener(this); mMyOrder.setOnClickListener(this); mSettings.setOnClickListener(this); mLogoutButton.setOnClickListener(this); mMsgCenter.setOnClickListener(this); mGameIcon = (ImageView) findViewById(R.id.game_icon); mGameInfo = (TextView) findViewById(R.id.game_name); mImageLoader = new ImageLoader(this, Config.CHANNEL_PIC_DIR, true); }
@Override public void onViewChanged(HasViews hasViews) { mMoney = ((EditText) hasViews.findViewById(id.ed_addOtherCost_money)); mContent = ((EditText) hasViews.findViewById(id.ed_addOtherCost_content)); { View view = hasViews.findViewById(id.btn_addOtherCost_reset); if (view != null) { view.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { AddOtherCostActivity_.this.clickListener(view); } }); } } { View view = hasViews.findViewById(id.btn_addOtherCost_ok); if (view != null) { view.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { AddOtherCostActivity_.this.clickListener(view); } }); } } initData(); }
@Override public void bind(final Finder finder, final T target, Object source) { View view; view = finder.findRequiredView(source, 16908298, "field 'list'"); target.list = finder.castView(view, 16908298, "field 'list'"); view = finder.findRequiredView(source, 16908292, "field 'empty'"); target.empty = finder.castView(view, 16908292, "field 'empty'"); view = finder.findRequiredView(source, 2131624039, "field 'chat'"); target.chat = finder.castView(view, 2131624039, "field 'chat'"); view = finder.findRequiredView(source, 2131624040, "method 'sendMessage'"); view.setOnClickListener( new butterknife.internal.DebouncingOnClickListener() { @Override public void doClick(android.view.View p0) { target.sendMessage(); } }); view = finder.findRequiredView(source, 2131624041, "method 'launchVideoChat'"); view.setOnClickListener( new butterknife.internal.DebouncingOnClickListener() { @Override public void doClick(android.view.View p0) { target.launchVideoChat(); } }); target.buttons = Finder.listOf( finder.<android.widget.Button>findRequiredView(source, 2131624040, "field 'buttons'"), finder.<android.widget.Button>findRequiredView(source, 2131624041, "field 'buttons'")); }
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); aboutme = mView.findViewById(R.id.about); aboutme.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View arg0) { Intent intent = new Intent(getActivity(), AboutMe.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); getActivity().overridePendingTransition(R.anim.push_left_in, R.anim.push_left_in); } }); lastedVersion = mView.findViewById(R.id.vision_check); lastedVersion.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View arg0) { UpdateManager manager = new UpdateManager(getActivity()); // 检查软件更新 try { manager.checkUpdate(); } catch (NotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); }
private void initView(Context context) { mContext = context; View.inflate(context, R.layout.super_vodeo_player_layout, this); mSuperVideoView = (SuperVideoView) findViewById(R.id.video_view); mMediaController = (MediaController) findViewById(R.id.controller); mProgressBarView = findViewById(R.id.progressbar); mCloseBtnView = findViewById(R.id.video_close_view); mTvBtnView = findViewById(R.id.video_share_tv_view); mDLNARootLayout = findViewById(R.id.rel_dlna_root_layout); mMediaController.setMediaControl(mMediaControl); mSuperVideoView.setOnTouchListener(mOnTouchVideoListener); setDLNAButton(false); setCloseButton(false); mDLNARootLayout.setVisibility(GONE); showProgressView(false); mDLNARootLayout.setOnClickListener(mOnClickListener); mDLNARootLayout.findViewById(R.id.txt_dlna_exit).setOnClickListener(mOnClickListener); mCloseBtnView.setOnClickListener(mOnClickListener); mTvBtnView.setOnClickListener(mOnClickListener); mProgressBarView.setOnClickListener(mOnClickListener); mAllVideo = new ArrayList<>(); }
public void inject(Finder finder, T t, Object obj) { View view = (View) finder.m7732a(obj, 2131755423, "field 'letsStart' and method 'onLetsStartClicked'"); t.f4489a = (Button) finder.m7731a(view, 2131755423, "field 'letsStart'"); view.setOnClickListener(new ViewInjector(this, t)); view = (View) finder.m7732a( obj, 2131755425, "field 'countryEditText' and method 'startCountryListActivity'"); t.f4490b = (EditText) finder.m7731a(view, 2131755425, "field 'countryEditText'"); view.setOnClickListener(new ViewInjector(this, t)); t.f4491c = (EditText) finder.m7731a( (View) finder.m7732a(obj, 2131755427, "field 'phoneEditText'"), 2131755427, "field 'phoneEditText'"); t.f4492d = (EditText) finder.m7731a( (View) finder.m7732a(obj, 2131755426, "field 'dialingCodeEditText'"), 2131755426, "field 'dialingCodeEditText'"); t.f4493e = (ScrollView) finder.m7731a( (View) finder.m7732a(obj, 2131755424, "field 'scrollView'"), 2131755424, "field 'scrollView'"); }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View view = findViewById(R.id.button_1); view.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(MainActivity.this, PieChartActivity.class)); } }); view = findViewById(R.id.button_2); view.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(MainActivity.this, ChipActivity.class)); } }); view = findViewById(R.id.button_3); view.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(MainActivity.this, ViewPagerActivity.class)); } }); }
private void updateLayout() { setContentView(R.layout.alarm_clock); mAlarmsList = (ListView) findViewById(R.id.alarms_list); AlarmTimeAdapter adapter = new AlarmTimeAdapter(this, mCursor); mAlarmsList.setAdapter(adapter); mAlarmsList.setVerticalScrollBarEnabled(true); mAlarmsList.setOnItemClickListener(this); mAlarmsList.setOnCreateContextMenuListener(this); View addAlarm = findViewById(R.id.add_alarm); addAlarm.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { addNewAlarm(); } }); // Make the entire view selected when focused. addAlarm.setOnFocusChangeListener( new View.OnFocusChangeListener() { public void onFocusChange(View v, boolean hasFocus) { v.setSelected(hasFocus); } }); View doneButton = findViewById(R.id.done); if (doneButton != null) { doneButton.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { finish(); } }); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View button1 = findViewById(R.id.CallAction1); View button2 = findViewById(R.id.CallAction2); View button3 = findViewById(R.id.CallAction3); // TODO それぞれ、Broadcast を受け取ったら Log.v(String, String) を利用して、ログ出力にどの Action を受信したかを表示する処理を書くこと button1.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO ここに、ACTION_FIRST を呼び出す処理を書く } }); button2.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO ここに、ACTION_SECOND を呼び出す処理を書く } }); button3.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO ここに、ACTION_THIRD を呼び出す処理を書く } }); }
private void loadData(Uri dataUri) { mDataUri = dataUri; Log.i(Constants.TAG, "mDataUri: " + mDataUri.toString()); mActionEncrypt.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { encrypt(mDataUri); } }); mActionCertify.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { certify(mDataUri); } }); mActionEdit.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { editKey(mDataUri); } }); mUserIdsAdapter = new ViewKeyUserIdsAdapter(getActivity(), null, 0); mUserIds.setAdapter(mUserIdsAdapter); // Prepare the loaders. Either re-connect with an existing ones, // or start new ones. getLoaderManager().initLoader(LOADER_ID_UNIFIED, null, this); getLoaderManager().initLoader(LOADER_ID_USER_IDS, null, this); }
private void buildCustomActionBarTitle(Bundle savedInstanceState) { View title = getLayoutInflater().inflate(R.layout.maintimelineactivity_title_layout, null); titleText = (TextView) title.findViewById(R.id.tv_title); clickToTop = title.findViewById(R.id.tv_click_to_top); clickToTop.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { scrollCurrentListViewToTop(); } }); View write = title.findViewById(R.id.btn_write); write.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = WriteWeiboActivity.newIntent(GlobalContext.getInstance().getAccountBean()); startActivity(intent); } }); ActionBar.LayoutParams layoutParams = new ActionBar.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.RIGHT); getActionBar().setCustomView(title, layoutParams); getActionBar().setDisplayShowCustomEnabled(true); }
private void initView(Context context) { inflate(context, R.layout.zz_video_player_controller, this); View rlPlayPause = findViewById(R.id.rl_play_pause); mIvPlayPause = (ImageView) findViewById(R.id.iv_play_pause); mTvCurrentTime = (TextView) findViewById(R.id.tv_current_time); mTvTotalTime = (TextView) findViewById(R.id.tv_total_time); mCsb = (CustomSeekBar) findViewById(R.id.csb); setProgressLayerDrawables( R.drawable.zz_player_shape_default_background, R.drawable.zz_player_shape_default_second_progress, R.drawable.zz_player_shape_default_progress); mProgressLayerDrawable = new LayerDrawable(mProgressLayers); mCsb.setProgressDrawable(mProgressLayerDrawable); View rlToggleExpandable = findViewById(R.id.rl_toggle_expandable); mIvToggleExpandable = (ImageView) findViewById(R.id.iv_toggle_expandable); rlPlayPause.setOnClickListener(this); rlToggleExpandable.setOnClickListener(this); mIvPlayPause.setOnClickListener(this); mCsb.setOnSeekBarChangeListener(this); }
public PredictionsAdapterViewHolder(View view) { super(view); mBackground = view.findViewById(R.id.list_item_background); mSwipeLeft = view.findViewById(R.id.list_item_bg_swipe_left); mSwipeRight = view.findViewById(R.id.list_item_bg_swipe_right); mContainer = view.findViewById(R.id.list_item_container); mQuestion = (TextView) view.findViewById(R.id.list_item_prediction_question); mDetail = (TextView) view.findViewById(R.id.list_item_prediction_detail); mAnswer = (TextView) view.findViewById(R.id.list_item_prediction_answer); mCredence = (TextView) view.findViewById(R.id.list_item_prediction_credence); mCreationDate = (TextView) view.findViewById(R.id.list_item_prediction_creation_date); mActionRight = view.findViewById(R.id.list_item_expanded_button_right); mActionWrong = view.findViewById(R.id.list_item_expanded_button_wrong); mActionReopen = view.findViewById(R.id.list_item_expanded_button_reopen); mActionDelete = view.findViewById(R.id.list_item_expanded_button_delete); view.setOnClickListener(this); view.setOnLongClickListener(this); if (mActionRight != null && mActionWrong != null && mActionReopen != null && mActionDelete != null) { (mResultFilter == PredictionsFragment.RESULT_FILTER_WRONG ? mActionWrong : mResultFilter == PredictionsFragment.RESULT_FILTER_RIGHT ? mActionRight : mActionReopen) .setVisibility(View.GONE); mActionRight.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { dismiss(PredictionsAdapterViewHolder.this, SWIPE_DIRECTION_RIGHT); } }); mActionWrong.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { dismiss(PredictionsAdapterViewHolder.this, SWIPE_DIRECTION_WRONG); } }); mActionReopen.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { reopen(PredictionsAdapterViewHolder.this); } }); mActionDelete.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { delete(PredictionsAdapterViewHolder.this); } }); } mLongClickDialog = makeLongClickDialog(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.drinklistview); View left = findViewById(R.id.left_button); left.setOnClickListener(this); View events = findViewById(R.id.events_button); events.setOnClickListener(this); View right = findViewById(R.id.right_button); right.setOnClickListener(this); Intent thisIntent = getIntent(); bar = thisIntent.getIntExtra("_bar", 0); // day = thisIntent.getIntExtra("_day", 0); bar = thisIntent.getIntExtra( "_bar", 0); // gets the intent that started this mess and gets an extra value that was passed // called _bar. // 0 is the default argument is nothing is passed. day = thisIntent.getIntExtra("_day", 0); // same idea as above. fillList(); }
/** * Set the draggable view portion. Use to null, to allow the whole panel to be draggable * * @param dragView A view that will be used to drag the panel. */ public void setDragView(View dragView) { if (mDragView != null) { mDragView.setOnClickListener(null); } mDragView = dragView; if (mDragView != null) { mDragView.setClickable(true); mDragView.setFocusable(false); mDragView.setFocusableInTouchMode(false); mDragView.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { if (!isEnabled() || !isTouchEnabled()) return; if (mSlideState != PanelState.EXPANDED && mSlideState != PanelState.ANCHORED) { if (mAnchorPoint < 1.0f) { setPanelState(PanelState.ANCHORED); } else { setPanelState(PanelState.EXPANDED); } } else { setPanelState(PanelState.COLLAPSED); } } }); ; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (isFinishing()) return; setContentView(R.layout.fingerprint_viewer); integrator = new IntentIntegrator(this); Intent intent = getIntent(); account = getAccount(intent); user = getUser(intent); if (AccountManager.getInstance().getAccount(account) == null || user == null) { Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND); finish(); return; } if (savedInstanceState != null) { remoteFingerprint = savedInstanceState.getString(SAVED_REMOTE_FINGERPRINT); localFingerprint = savedInstanceState.getString(SAVED_LOCAL_FINGERPRINT); } else { remoteFingerprint = OTRManager.getInstance().getRemoteFingerprint(account, user); localFingerprint = OTRManager.getInstance().getLocalFingerprint(account); } verifiedView = (CheckBox) findViewById(R.id.verified); verifiedView.setOnCheckedChangeListener(this); scanView = findViewById(R.id.scan); scanView.setOnClickListener(this); showView = findViewById(R.id.show); showView.setOnClickListener(this); copyView = findViewById(R.id.copy); copyView.setOnClickListener(this); isUpdating = false; }
private void initTopControls() { View configureMap = mapActivity.findViewById(R.id.map_layers_button); layersHud = createHudButton((ImageView) configureMap, R.drawable.map_layer_dark) .setIconsId(R.drawable.map_layer_dark, R.drawable.map_layer_night) .setBg(R.drawable.btn_inset_circle_trans, R.drawable.btn_inset_circle_night); controls.add(layersHud); configureMap.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { notifyClicked(); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP); } }); View compass = mapActivity.findViewById(R.id.map_compass_button); compassHud = createHudButton((ImageView) compass, R.drawable.map_compass) .setIconColorId(0) .setBg(R.drawable.btn_inset_circle_trans, R.drawable.btn_inset_circle_night); compassHud.compass = true; controls.add(compassHud); compass.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { notifyClicked(); mapActivity.getMapViewTrackingUtilities().switchRotateMapMode(); } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test_activities); View firstButton = findViewById(R.id.first_btn); firstButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(TestActivities.this, TestActivityFirst.class); startActivity(intent); // transaction animation overridePendingTransition(R.anim.slide_in_bottom, R.anim.slide_out_bottom); } }); View secondButton = findViewById(R.id.second_btn); secondButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(TestActivities.this, TestActivitySecond.class); startActivity(intent); overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); } }); }
@Override protected void onFinishInflate() { super.onFinishInflate(); cbKind = V.get(this, R.id.cbKind); tCurrentDate = V.get(this, R.id.tCurrentDate); bPrev = V.get(this, R.id.bPrev); bNext = V.get(this, R.id.bNext); bReload = V.get(this, R.id.bReload); cbKind.setAdapter(adapter = new DevotionKindAdapter()); cbKind.setOnItemSelectedListener( new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected( final AdapterView<?> parent, final View view, final int position, final long id) { listener.cbKind_itemSelected(adapter.getItem(position)); } @Override public void onNothingSelected(final AdapterView<?> parent) {} }); bPrev.setOnClickListener(v -> listener.bPrev_click()); bNext.setOnClickListener(v -> listener.bNext_click()); bReload.setOnClickListener( v -> { listener.bReload_click(); closeDrawer(); }); }