public void updateUI(boolean isSignedIn) { if (isSignedIn) { getActionBar().setTitle("My Profile"); logo.setVisibility(View.GONE); header.setVisibility(View.GONE); title.setVisibility(View.GONE); // loginTwitter.setVisibility(View.GONE); btnLoginTwitter.setVisibility(View.GONE); btnSignIn.setVisibility(View.GONE); loginNormal.setVisibility(View.GONE); authButton.setVisibility(View.GONE); btnSignOut.setVisibility(View.GONE); btnRevokeAccess.setVisibility(View.VISIBLE); btnProceed.setVisibility(View.VISIBLE); llProfileLayout.setVisibility(View.VISIBLE); } else { logo.setVisibility(View.VISIBLE); header.setVisibility(View.VISIBLE); title.setVisibility(View.VISIBLE); // loginTwitter.setVisibility(View.VISIBLE); btnLoginTwitter.setVisibility(View.VISIBLE); btnSignIn.setVisibility(View.VISIBLE); loginNormal.setVisibility(View.VISIBLE); authButton.setVisibility(View.VISIBLE); btnSignOut.setVisibility(View.GONE); btnRevokeAccess.setVisibility(View.GONE); btnProceed.setVisibility(View.GONE); llProfileLayout.setVisibility(View.GONE); } }
@Override public void onClick(View arg0) { // TODO Auto-generated method stub switch (arg0.getId()) { case R.id.loadinglayout: if (loadingRecLayout.getVisibility() == View.VISIBLE) { loadingRecLayout.setVisibility(View.GONE); } else if (loadingRecLayout.getVisibility() == View.GONE) { loadingRecLayout.setVisibility(View.VISIBLE); if (fileList.size() == 0) { noloadinghistory.setVisibility(View.VISIBLE); loadingListView.setVisibility(View.GONE); } else { noloadinghistory.setVisibility(View.GONE); loadingListView.setVisibility(View.VISIBLE); } } break; case R.id.loadedlayout: if (loadedRecLayout.getVisibility() == View.VISIBLE) { loadedRecLayout.setVisibility(View.GONE); } else if (loadedRecLayout.getVisibility() == View.GONE) { loadedRecLayout.setVisibility(View.VISIBLE); if (doneFileList.size() == 0) { noloadedhistory.setVisibility(View.VISIBLE); loadedListView.setVisibility(View.GONE); } else { noloadedhistory.setVisibility(View.GONE); loadedListView.setVisibility(View.VISIBLE); } } break; } }
private void changeVoltage(final boolean isPlus) { final int prefsIndex = mCategory.getPreferenceCount(); CustomPreference pref; String value; boolean isCurrent = false; for (int i = 0; i < prefsIndex; i++) { pref = (CustomPreference) mCategory.getPreference(i); if (pref != null) { if (isVdd) { if (isPlus) { pref.setCustomSummaryKeyPlus(25000); } else { pref.setCustomSummaryKeyMinus(25000); } } else { if (isPlus) { pref.setCustomSummaryKeyPlus(25); } else { pref.setCustomSummaryKeyMinus(25); } } value = pref.getKey(); if (value != null) { isCurrent = value.equals(mValues[i]); } } } if (isCurrent) { mButtonLayout.setVisibility(View.GONE); } else { mButtonLayout.setVisibility(View.VISIBLE); } }
private void newWait() { if (DeviceUtil.checkConnection(mContext)) { // 加载动画 progressLinear.setVisibility(View.VISIBLE); AnimationDrawable animationDrawable = (AnimationDrawable) progreView.getDrawable(); animationDrawable.start(); mRecyclerView.setVisibility(View.VISIBLE); networkInfo.setVisibility(View.GONE); initData(sessionData); } else { errorInfo.setImageDrawable(getResources().getDrawable(R.mipmap.error_nowifi)); mRecyclerView.setVisibility(View.GONE); networkInfo.setVisibility(View.VISIBLE); newLoading.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { newWait(); } }); } }
@Override public void dispatchMessage(Message msg) { findViewById(R.id.phone_study_progressLl).setVisibility(View.GONE); switch (msg.arg1) { case LVDATA_KEY: for (int i = index * 20; i < (index + 1) * 20 && i < courses.size(); i++) { if (i == courses.size() - 1) { footer.setVisibility(View.GONE); } else { if (footer.getVisibility() == View.GONE) footer.setVisibility(View.VISIBLE); } coursewares.add(courses.get(i)); } phoneStudyAdapter = new PhoneStudyAdapter( NominateActivity.this, R.layout.phone_study_listview_item, coursewares, lv, true); lv.setAdapter(phoneStudyAdapter); lv.setSelection(0); break; case NO_NET: MyTools.exitShow( NominateActivity.this, ((Activity) NominateActivity.this).getWindow().getDecorView(), "网络有问题!"); break; } }
private void initCarpoolLayout() { mSpinnerRouteLayout.setVisibility(View.VISIBLE); mSpinnerRoute.setOnItemSelectedListener( new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { ((CarpoolingInfo) host).setRoute((String) parent.getItemAtPosition(position)); } @Override public void onNothingSelected(AdapterView<?> parent) {} }); mSpinnerTemporaryLayout.setVisibility(View.VISIBLE); mSpinnerTemporaryCount.setOnItemSelectedListener( new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { host.setTemporaryCount((String) parent.getItemAtPosition(position)); } @Override public void onNothingSelected(AdapterView<?> parent) {} }); }
@TextChange(R.id.inputSearch) public void searchForMemberByPagination() { emptySearch.setVisibility(View.INVISIBLE); loading.setVisibility(View.VISIBLE); listViewMembers.setVisibility(View.INVISIBLE); firstTimeSearch = true; Runnable task = new Runnable() { public void run() { if (!waitForSearch) { waitForSearch = true; from = 0; membersList = new ArrayList<Member>(); members = new ArrayList<HashMap<String, String>>(); noMoreMembers = false; if (!inputSearch.getText().toString().isEmpty()) { searchForMembersByPaginationService(inputSearch.getText().toString()); listViewMembers.setVisibility(View.INVISIBLE); loading.setVisibility(View.VISIBLE); emptySearch.setVisibility(View.INVISIBLE); } else { listAllMembersByPaginationService(); loading.setVisibility(View.VISIBLE); listViewMembers.setVisibility(View.INVISIBLE); emptySearch.setVisibility(View.INVISIBLE); } } } }; worker.schedule(task, 2, TimeUnit.SECONDS); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.parent_layout); setTitle(getSampleTitle()); urlEditText = (EditText) findViewById(R.id.edit_url); headersEditText = (EditText) findViewById(R.id.edit_headers); bodyEditText = (EditText) findViewById(R.id.edit_body); Button runButton = (Button) findViewById(R.id.button_run); Button cancelButton = (Button) findViewById(R.id.button_cancel); LinearLayout headersLayout = (LinearLayout) findViewById(R.id.layout_headers); LinearLayout bodyLayout = (LinearLayout) findViewById(R.id.layout_body); responseLayout = (LinearLayout) findViewById(R.id.layout_response); urlEditText.setText(getDefaultURL()); bodyLayout.setVisibility(isRequestBodyAllowed() ? View.VISIBLE : View.GONE); headersLayout.setVisibility(isRequestHeadersAllowed() ? View.VISIBLE : View.GONE); runButton.setOnClickListener(onClickListener); if (isCancelButtonAllowed() && cancelButton != null) { cancelButton.setVisibility(View.VISIBLE); cancelButton.setOnClickListener(onClickListener); } }
@Override public void updateContent(PageDataBean bean) { if (bean == null) { return; } mBean = bean; // 这里传进来的数据要不就是没有初始化的,要不就是已经拿到数据的,不存在服务器错误的情况,因为这种情况不会把数据缓存 if (bean.mStatuscode == -1) { // 数据还没初始化 bgPageView.showProgress(); // 显示加载进度条 getUpdateAppData(); } else { // 直接加载缓存的数据 if (mBean.uAppList.size() > 0) { // 缓存数据 tvNotUpdate.setVisibility(View.GONE); updateLayout.setVisibility(View.VISIBLE); updateDownloadState(mBean.uAppList); adapter.update(mBean.uAppList); tvUpdateTotal.setText("(" + mBean.uAppList.size() + ")"); } else { tvNotUpdate.setVisibility(View.VISIBLE); updateLayout.setVisibility(View.GONE); } } }
public void displayResult(String result) { mModuleView.setVisibility(View.GONE); mModuleListView.setVisibility(View.GONE); mResultView.removeAllViews(); ResultView block = new ResultView(this, mResultView); block.addView("CallAPI", callAPI); block.addView("Desripton", desripton); block.addView("Result", result); // 设置actionbar、模块通用布局 LinearLayout llayout = (LinearLayout) findViewById(R.id.actionBarReturn); llayout.setVisibility(View.VISIBLE); TextView title = (TextView) findViewById(R.id.TactionBarTitle); title.setText(this.title); llayout.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { endResult(); } }); mResultView.setVisibility(View.VISIBLE); }
// 退出功能模块 public void endModule() { mModuleView.removeAllViews(); mModuleView.setVisibility(View.GONE); mResultView.setVisibility(View.GONE); mModuleListView.setVisibility(View.VISIBLE); resetMainView(); // 设置actionbar // 隐藏后退按钮,并设置为不可点击 LinearLayout llayout = (LinearLayout) findViewById(R.id.actionBarReturn); llayout.setFocusable(false); llayout.setClickable(false); llayout.setVisibility(View.GONE); TextView title = (TextView) findViewById(R.id.TactionBarTitle); EPlatform platform = getPlatform(); title.setTextColor(Color.RED); if (platform == EPlatform.ePlatform_QQ) { title.setText("MSDKDemo QQ登录中"); } else if (platform == EPlatform.ePlatform_Weixin) { title.setText("MSDKDemo 微信登录中"); } else if (platform == EPlatform.ePlatform_QQHall) { title.setText("MSDKDemo 大厅登录中"); } else { title.setText("MSDKDemo 未登录"); title.setTextColor(Color.WHITE); } }
private void initXmlViews() { txtactivityHeader = (TextView) findViewById(R.id.titleHeader); txtlat = (TextView) findViewById(R.id.addMarker_lat); txtlong = (TextView) findViewById(R.id.addMarker_long); btnCancel = (Button) findViewById(R.id.btn_markerdetail_CANCEL); btnSaveChanges = (Button) findViewById(R.id.btn_markerdetail_OK); btnDelete = (Button) findViewById(R.id.btn_markerdetail_Delete); ll = (LinearLayout) findViewById(R.id.ll_buttonHolder); btnback = (ImageButton) findViewById(R.id.title); edtContactname = (EditText) findViewById(R.id.txt_markerdetails_contactName); edtCompany = (EditText) findViewById(R.id.txt_markerdetails_company); edtAddress = (EditText) findViewById(R.id.txt_markerdetails_address); edtFarmName = (EditText) findViewById(R.id.txt_markerdetails_farmname); edtFarmId = (EditText) findViewById(R.id.txt_markerdetails_farmID); edtContactNumber = (EditText) findViewById(R.id.txt_markerdetails_contactNumber); edtCultureSystem = (EditText) findViewById(R.id.txt_markerdetails_cultureType); edtLevelOfCulture = (EditText) findViewById(R.id.txt_markerdetails_levelofCulture); edtWaterType = (EditText) findViewById(R.id.txt_markerdetails_waterType); if (Helper.variables.getGlobalVar_currentLevel(activity) != 4) { ll.setVisibility(View.GONE); } else { ll.setVisibility(View.VISIBLE); } Helper.hideKeyboardOnLoad(activity); }
private void updateLogPasswordBox(LogType type) { if (type == LogType.FOUND_IT && cache.isLogPasswordRequired()) { logPasswordBox.setVisibility(View.VISIBLE); } else { logPasswordBox.setVisibility(View.GONE); } }
private void updateTweetBox(LogType type) { if (type == LogType.FOUND_IT && Settings.isUseTwitter()) { tweetBox.setVisibility(View.VISIBLE); } else { tweetBox.setVisibility(View.GONE); } }
// 设置ListView protected void setListData(String date) { itemAccess = new ItemTableAccess(sqlHelper.getReadableDatabase()); list = itemAccess.findAnalyzeJieHuanDetail(date); itemAccess.close(); adapter = new SimpleAdapter( this, list, R.layout.list_analyzejiehuan, new String[] { "itembuydate", "jiechuprice", "huanruprice", "jieruprice", "huanchuprice" }, new int[] { R.id.tv_analyze_itembuydate, R.id.tv_analyze_jiechu, R.id.tv_analyze_huanru, R.id.tv_analyze_jieru, R.id.tv_analyze_huanchu }); listAnalyzeJieHuanDetail.setAdapter(adapter); // 设置empty if (list.size() == 0) { layNoItem.setVisibility(View.VISIBLE); } else { layNoItem.setVisibility(View.GONE); } }
@Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); // Log.i("tvinfo", msg.what + "-" + msg.obj); if (msg.what == 1) { progress.setVisibility(View.VISIBLE); title.setText("开始播放 ..."); } if (msg.what == 2) { title.setText("开始加载 ..."); } if (msg.what == 3) { title.setText("开始播放 ..."); play(prg); } if (msg.what == 4) { title.setText("加载失败 ..."); } if (msg.what == 9) { show("获取", "正在获取播放列表,请稍后..."); } if (msg.what == -100) { playmenu.setVisibility(View.GONE); } if (msg.what == 66) { if (player != null && player.isPlaying() && !isseek) { currtime.setText(Utils.longToString(player.getCurrentPosition())); playSeek.setProgress(player.getCurrentPosition() / 1000); } } }
private void createLayout() { Intent intent = getIntent(); totalPlayers = intent.getIntExtra("LOG_GAME_TOTAL_PLAYERS", 0); firstLine = (LinearLayout) findViewById(R.id.firstLine); firstLine.setOnDragListener(new MyDragListener()); CardView firstCard = (CardView) findViewById(R.id.firstCard); if (firstCard != null) { firstCard.setOnTouchListener(new MyTouchListener()); } avatarFirstLogGame = (ImageView) findViewById(R.id.avatarFirstLogGame); playerFirstNameLogGame = (TextView) findViewById(R.id.playerFirstNameLogGame); playerFirstDeckLogGame = (TextView) findViewById(R.id.playerFirstDeckLogGame); secondLine = (LinearLayout) findViewById(R.id.secondLine); secondLine.setOnDragListener(new MyDragListener()); CardView secondCard = (CardView) findViewById(R.id.secondCard); if (secondCard != null) { secondCard.setOnTouchListener(new MyTouchListener()); } avatarSecondLogGame = (ImageView) findViewById(R.id.avatarSecondLogGame); playerSecondNameLogGame = (TextView) findViewById(R.id.playerSecondNameLogGame); playerSecondDeckLogGame = (TextView) findViewById(R.id.playerSecondDeckLogGame); LinearLayout thirdLineParent = (LinearLayout) findViewById(R.id.thirdLineParent); if (totalPlayers >= 3) { thirdLine = (LinearLayout) findViewById(R.id.thirdLine); thirdLine.setOnDragListener(new MyDragListener()); CardView thirdCard = (CardView) findViewById(R.id.thirdCard); if (thirdCard != null) { thirdCard.setOnTouchListener(new MyTouchListener()); } avatarThirdLogGame = (ImageView) findViewById(R.id.avatarThirdLogGame); playerThirdNameLogGame = (TextView) findViewById(R.id.playerThirdNameLogGame); playerThirdDeckLogGame = (TextView) findViewById(R.id.playerThirdDeckLogGame); } else { if (thirdLineParent != null) { thirdLineParent.setVisibility(View.GONE); } } LinearLayout fourthLineParent = (LinearLayout) findViewById(R.id.fourthLineParent); if (totalPlayers >= 4) { fourthLine = (LinearLayout) findViewById(R.id.fourthLine); fourthLine.setOnDragListener(new MyDragListener()); CardView fourthCard = (CardView) findViewById(R.id.fourthCard); if (fourthCard != null) { fourthCard.setOnTouchListener(new MyTouchListener()); } avatarFourthLogGame = (ImageView) findViewById(R.id.avatarFourthLogGame); playerFourthNameLogGame = (TextView) findViewById(R.id.playerFourthNameLogGame); playerFourthDeckLogGame = (TextView) findViewById(R.id.playerFourthDeckLogGame); } else { if (fourthLineParent != null) { fourthLineParent.setVisibility(View.GONE); } } scrollView = (ScrollView) findViewById(R.id.scrollLogGame); }
private void setContent(int code) { switch (code) { case NAME: label_tv.setText("用 户 名 : "); code_layout.setVisibility(View.GONE); hint_tv.setText("5-20 位英文字母或数字,不区分大小写"); hint_tv.setVisibility(View.VISIBLE); break; case EMAIL: label_tv.setText("邮箱地址 : "); code_layout.setVisibility(View.GONE); hint_tv.setVisibility(View.VISIBLE); hint_tv.setText("请输入您真实有效的邮箱"); break; case PHONE: label_tv.setText("手 机 号 : "); code_layout.setVisibility(View.VISIBLE); hint_tv.setVisibility(View.GONE); hint_tv.setText("请输入有效手机号码"); input_et.setInputType(PHONE); break; default: break; } }
@AfterViews public void listAllMembersByPagination() { listAllMembersByPaginationService(); listViewMembers.setVisibility(View.INVISIBLE); loading.setVisibility(View.VISIBLE); emptySearch.setVisibility(View.INVISIBLE); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); tfGS = Typeface.createFromAsset(getAssets(), "fonts/GillSans.ttc"); ref = (Button) findViewById(R.id.btn_resources_used); disc = (Button) findViewById(R.id.btn_disc); ref.setOnClickListener(this); disc.setOnClickListener(this); ll1 = (LinearLayout) findViewById(R.id.aboutSection); ll2 = (LinearLayout) findViewById(R.id.references); ll3 = (LinearLayout) findViewById(R.id.disclaimer); ll2.setVisibility(View.GONE); ll3.setVisibility(View.GONE); currStep = 1; int childcount = ll1.getChildCount(); for (int i = 0; i < childcount; i++) { View v = ll1.getChildAt(i); if (v instanceof TextView) { TextView t = (TextView) v; t.setTypeface(tfGS); } } childcount = ll2.getChildCount(); for (int i = 0; i < childcount; i++) { View v = ll2.getChildAt(i); if (v instanceof TextView) { TextView t = (TextView) v; t.setTypeface(tfGS); } } }
@Subscribe public void onSearchForMemberByPaginationEvent(MembersSearchEvent event) { this.from += GlobalVariables.SEARCH_SIZE; loading.setVisibility(View.INVISIBLE); listViewMembers.setVisibility(View.VISIBLE); emptySearch.setVisibility(View.INVISIBLE); membersList.addAll(event.members); adapter = new TodoAdapter(getActivity(), membersList, listViewMembers, concernedMembers); listViewMembers.setAdapter(adapter); ViewHelpers.setListViewHeightBasedOnChildren(listViewMembers); listViewMembers.removeFooterView(footer); if (adapter.isEmpty()) { emptySearch.setVisibility(View.VISIBLE); } else emptySearch.setVisibility(View.INVISIBLE); if (onRefresh) { // TODO scroll to end of list listViewMembers.setSelection(lastPosition); } onRefresh = false; if (members.size() < GlobalVariables.SEARCH_SIZE) { noMoreMembers = true; } if (event.members.size() == 0) noMoreMembers = true; waitForSearch = false; }
public void showSpecialDaysFragment(View view) { if (specialDaysFragment.getVisibility() == View.GONE) { specialDaysFragment.setVisibility(View.VISIBLE); } else { specialDaysFragment.setVisibility(View.GONE); } }
private void loadVideo() { getWindow().setFormat(PixelFormat.TRANSLUCENT); mVideoView = (VideoView) findViewById(R.id.imageViewCenter); mVideoView.setMediaController(new MediaController(this)); Uri video = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.water_drop); mVideoView.setVideoURI(video); mVideoView.start(); if (isLEFT) { lp.setMargins(1200, 0, -1000, 0); mThumbnailTopLayout.setVisibility(View.GONE); mThumnailBottomLayout.setVisibility(View.GONE); } else { lp.setMargins(-640, 0, 640, 0); } mVideoView.setLayoutParams(lp); mVideoView.setClickable(true); mVideoView.setOnTouchListener( new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // System.out.println(mVideoView); // mVideoView.stopPlayback(); lp.setMargins(0, 0, 0, 0); mVideoView.setLayoutParams(lp); return true; } }); }
private void renderUserInfo(Parser_UserInfo_new parser_UserInfo_new) { if (parser_UserInfo_new == null) { return; } Parser_Text addrParText = parser_UserInfo_new.getAddr(); Parser_Text genderParText = parser_UserInfo_new.getGender(); Parser_Text nameParText = parser_UserInfo_new.getName(); leftParBtn = parser_UserInfo_new.getLeftButton(); rightParBtn = parser_UserInfo_new.getRightButton(); if (rightParBtn == null) { linebtnRight.setVisibility(View.GONE); } else { linebtnRight.setVisibility(View.VISIBLE); setButtonByAction(btnRight, rightParBtn); setButtonListener(btnRight, rightParBtn, leftParBtn); } if (leftParBtn == null) { linebtnLeft.setVisibility(View.GONE); } else { linebtnLeft.setVisibility(View.VISIBLE); setButtonByAction(btnLeft, leftParBtn); setButtonListener(btnLeft, leftParBtn, leftParBtn); } textnickName.setText(nameParText.getStr()); textPosition.setText(addrParText.getStr()); gender = genderParText.getStr(); if (gender.equals("男")) { imgGender.setBackgroundResource(R.drawable.manbtn); } else if (gender.equals("女")) { imgGender.setBackgroundResource(R.drawable.womenbtn); } }
/** * * * <pre>首次加载数据</pre> */ public void firstLoadingDatas() { rela_loading.setVisibility(View.VISIBLE); page_news_loading.setVisibility(View.VISIBLE); linear_reload.setVisibility(View.GONE); load_type = FIRST_LOAD; executorService.submit(new LoadDataThread()); }
/** * Define se o botao de SELECT e visivel. * * @param v */ private void setSelectVisible(View v) { layoutCreate.setVisibility(View.GONE); layoutSelect.setVisibility(View.VISIBLE); inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); selectButton.setEnabled(false); }
private void updateRemindersVisibility() { if (mReminderItems.size() == 0) { mRemindersContainer.setVisibility(View.GONE); } else { mRemindersContainer.setVisibility(View.VISIBLE); } }
private void showPurposeCurrency(boolean visible) { if (visible) { purpose_currency_liner.setVisibility(View.VISIBLE); } else { purpose_currency_liner.setVisibility(View.GONE); } }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.downloaded_cancel: mLinearLayout.setVisibility(View.GONE); mLinearLayout.setPadding(0, 0, 0, 0); isEditor = false; adapter.setEditorState(isEditor); break; case R.id.downloaded_sure: mLinearLayout.setVisibility(View.GONE); mLinearLayout.setPadding(0, 0, 0, 0); // Integer[] deletePositions = delList.toArray(new Integer[delList // .size()]); // // Log.i("DownloadedFragment", "删除位置的集合:"+str); delLocalFile(delList); isEditor = false; adapter.setEditorState(isEditor); break; default: break; } }
private void hideCBNotification() { if (cbNotification.isChecked()) lTime.setVisibility(View.VISIBLE); else { lTime.setVisibility(View.GONE); etTime.setText(""); } }