@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = getActivity().getLayoutInflater().inflate(R.layout.cuc_multi_selection_layout, null); mDirectoriesMap = new HashMap<String, Boolean>(); mRefreshBtn = (ImageView) rootView.findViewById(R.id.cuc_multi_selection_refresh_iv); mRefreshBtn.setVisibility(View.INVISIBLE); mListView = (ListView) rootView.findViewById(R.id.cuc_multi_selection_lv); mListView.setFastScrollEnabled(true); mUpLayout = (RelativeLayout) rootView.findViewById(R.id.cuc_multi_selection_up_layout); mCurrentDirText = (TextView) rootView.findViewById(R.id.cuc_multi_selection_current_directory_txt); mUpLayout.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { try { getDir(new File(mCurrentDir).getParentFile().getCanonicalPath()); } catch (Exception e) { e.printStackTrace(); } } }); mRootDir = Environment.getExternalStorageDirectory().getAbsolutePath().toString(); mCurrentDir = mRootDir; // Get a list of all the selected directory paths (will be empty if this is the first run). mSelectedDirList = CameraUploadDBHelper.getInstance().getCustomDirList(); // Get a list of all the directory paths that are currently stored in the DB. for (int i = 0; i < mSelectedDirList.size(); i++) { // Filter out any double slashes. String path = mSelectedDirList.get(i); if (path.contains("//")) { path.replace("//", "/"); } mDirectoriesMap.put(path, true); } // Get the folder hierarchy of the selected directory. getDir(mRootDir); mListView.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int index, long arg3) { String newPath = mDirectoryPathsList.get(index); getDir(newPath); } }); return rootView; }
/** 绑定点击事件 */ private void bindListeners() { container_menu.setOnClickListener(this); btn_set_mode_voice.setOnClickListener(this); buttonSetModeKeyboard.setOnClickListener(this); btnMore.setOnClickListener(this); mEditTextContent.setOnClickListener(this); mEditTextContent.addTextChangedListener(new MyTextWatcher()); }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getActivity().getIntent().getExtras() != null) { idSession = getActivity().getIntent().getExtras().getLong(UIUtils.MESSAGE); typeSession = getActivity().getIntent().getExtras().getString(UIUtils.TYPE); } else { // On gere le cas ou on tourne l'écran en restorant les états de la vue idSession = savedInstanceState.getLong("ID_SESSION"); ; typeSession = savedInstanceState.getString("TYPE_SESSION"); } Conference conference = null; // On recupere la session concernee if (TypeFile.lightningtalks.name().equals(typeSession)) { conference = ConferenceFacade.getInstance().getLightningtalk(getActivity(), idSession); } else { conference = ConferenceFacade.getInstance().getTalk(getActivity(), idSession); } List<Membre> speakers = new ArrayList<Membre>(); for (Long id : conference.getSpeakers()) { Membre membre = MembreFacade.getInstance().getMembre(getActivity(), TypeFile.members.name(), id); if (membre != null) { speakers.add(membre); } } // On affiche les liens que si on a recuperer des choses if (!speakers.isEmpty()) { // On utilisait auparavant une liste pour afficher ces éléments dans la page mais cette liste // empêche d'avoir un ScrollView englobant pour toute la page. Nous utilisons donc un tableau linearLayoutRoot = (LinearLayout) mInflater.inflate(R.layout.fragment_linear, mRootView, false); // On vide les éléments linearLayoutRoot.removeAllViews(); // On ajoute un table layout TableLayout.LayoutParams tableParams = new TableLayout.LayoutParams( TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT); TableLayout tableLayout = new TableLayout(getActivity().getBaseContext()); tableLayout.setLayoutParams(tableParams); for (final Membre membre : speakers) { RelativeLayout row = (RelativeLayout) mInflater.inflate(R.layout.person_item, null); row.setBackgroundResource(R.drawable.row_transparent_background); // Dans lequel nous allons ajouter le contenu que nous faisons mappé dans userName = (TextView) row.findViewById(R.id.person_user_name); descriptif = (TextView) row.findViewById(R.id.person_shortdesciptif); level = (TextView) row.findViewById(R.id.person_level); profileImage = (ImageView) row.findViewById(R.id.person_user_image); userName.setText(membre.getCompleteName()); if (membre.getShortdesc() != null) { descriptif.setText(membre.getShortdesc().trim()); } if (membre.getLevel() != null && !membre.getLevel().isEmpty()) { level.setText("[" + membre.getLevel().trim() + "]"); } // Recuperation de l'mage liee au profil Bitmap image = FileUtils.getImageProfile(getActivity(), membre); if (image == null) { profileImage.setImageDrawable(getResources().getDrawable(R.drawable.person_image_empty)); } else { // On regarde dans les images embarquees profileImage.setImageBitmap(image); } row.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Map<String, Object> parameters = new HashMap<String, Object>(2); parameters.put(UIUtils.MESSAGE, membre.getId()); parameters.put(UIUtils.TYPE, TypeFile.speaker); UIUtils.startActivity(MembreActivity.class, getActivity(), parameters); } }); tableLayout.addView(row); } linearLayoutRoot.addView(tableLayout); mRootView.addView(linearLayoutRoot); } }
/** * This method makes header menu bar visible to user. */ public void displayHeaderMenuBar() { button = mHeaderRelativeLayout.findViewById(R.id.bt_header_dropdown_menu_icon); mHeaderRelativeLayout = (RelativeLayout) mHeaderRelativeLayout.findViewById(R.id.ll_header_clickable_menubar); mHeaderRelativeLayout.setOnClickListener(this); mPresenter.displayHeaderMenuBar(button); }
private void initListener() { ibtn_title_back.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { finish(); TXWLApplication.getInstance().popStack(AddBankCardActivity.this); } }); rl_bank_name.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { // 跳转到银行卡列表 用startActivityForResult取回选择的银行 Intent intent = new Intent(AddBankCardActivity.this, BankSelectionActivity.class); startActivityForResult(intent, Constant.RequestCode); } }); ibtn_submit_next.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { TXWLProgressDialog.createDialog(AddBankCardActivity.this); TXWLProgressDialog.setMessage("支付中..."); try { token = beiFuHttpPost.getToken(); } catch (Exception e) { } // 放在这里做测试 // boundBankCard(); // 完成1元支付,跳转到支付成功界面 String vericode = et_vericode.getText().toString(); if (!"".equals(vericode)) { if (token != null) { new BeiFuPayPhishingKey().execute(); } } else { TXWLProgressDialog.Dismiss(); TXWLApplication.getInstance().showTextToast("验证码还未获取,请稍等"); } } }); btn_vericode.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { if (!verification()) { Log.d("billno -->", billno); // 获取验证码 beiFuHttpPost = new BeiFuHttpPost(); beiFuHttpPost.execute( billno, name, idcard, bankid, phone, cz_money, PreferenceUtils.getUserId() + "", bank_code); MyCountDownTimer mc = new MyCountDownTimer(60000, 1000); mc.start(); btn_vericode.setEnabled(false); // TXWLApplication.getInstance().showTextToast("获取验证码后请不要再修改信息"); } } }); et_user_ban.addTextChangedListener(textwatcher); et_vericode.addTextChangedListener(vericodewatcher); }
@Override protected void onCreate(Bundle arg0) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(arg0); setContentView(R.layout.commoditydetail); fruitbean = (FruitBean) getIntent().getSerializableExtra("fruitdetail"); // test2 = (ImageView) findViewById(R.id.test2); // BitmapUtil.getInstance().download(ServerId.serveradress, fruitbean.fruitimage, test2); evaluation = (RelativeLayout) findViewById(R.id.evaluation); back = (LinearLayout) findViewById(R.id.back); shoppingcart = (LinearLayout) findViewById(R.id.shoppingcart); addshoppingcart = (Button) findViewById(R.id.addshoppingcart); buyrightnow = (Button) findViewById(R.id.buyrightnow); minus = (TextView) findViewById(R.id.minus); plus = (TextView) findViewById(R.id.plus); count = (TextView) findViewById(R.id.count); commodityname = (TextView) findViewById(R.id.commodityname); commodityname.setText(fruitbean.getProduct_name()); commodityprice = (TextView) findViewById(R.id.commodityprice); commodityprice.setText("¥" + fruitbean.getPrice()); evaluationcount = (TextView) findViewById(R.id.evaluationcount); int num = SharedPrefsUtil.getValue(this, fruitbean.getProduct_id() + "", 0); evaluationcount.setText("" + num); collectioncheckbox = (CheckBox) findViewById(R.id.collectioncheckbox); collectioncheckbox.setOnCheckedChangeListener( new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton arg0, boolean arg1) { if (arg1) { HttpParams params = new HttpParams(); params.put("userId", getGson().fromJson(getSp().getString("uid", ""), String.class)); params.put("product_id", fruitbean.getProduct_id()); HttpClientUtils.getInstance() .post( ServerId.serveradress, ServerId.addproductCollection, params, new AsyncHttpResponseHandler() { @Override public void onSuccess(JSONObject jsonObject) { System.out.println("addshopjsonObject = " + jsonObject.toString()); } }); } else { HttpParams params = new HttpParams(); params.put("userId", getGson().fromJson(getSp().getString("uid", ""), String.class)); params.put("product_id", fruitbean.getProduct_id()); HttpClientUtils.getInstance() .post( ServerId.serveradress, ServerId.deleteCollection, params, new AsyncHttpResponseHandler() {}); } } }); minus.setOnClickListener(this); plus.setOnClickListener(this); evaluation.setOnClickListener(this); back.setOnClickListener(this); shoppingcart.setOnClickListener(this); buyrightnow.setOnClickListener(this); addshoppingcart.setOnClickListener(this); }