Ejemplo n.º 1
0
 /**
  * @Method: shareToWeiBo @Description: ����ͼƬ��΢��
  *
  * @param path ͼƬ��·��
  */
 private void shareToWeiBo(String path) {
   Log.d("���?΢�� -ͼƬ��ַ : ", path);
   Intent intent = new Intent(Intent.ACTION_SEND);
   // imagePath:����·����Ҫ���ļ���չ��
   String url = "file:///" + path;
   intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
   intent.setType("image/jpeg");
   intent.putExtra(Intent.EXTRA_TITLE, "���?΢��");
   intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
   startActivity(Intent.createChooser(intent, "���?ʽ"));
 }
Ejemplo n.º 2
0
	public void shareClick(View view) {
		Intent shareIntent = new Intent();
		shareIntent.setAction(Intent.ACTION_SEND);
		shareIntent.putExtra(Intent.EXTRA_STREAM, saveImageUri(getApplicationContext(), ScreenShot()));
		shareIntent.setType("image/png");
		startActivity(Intent.createChooser(shareIntent, "Share with..."));
	}
Ejemplo n.º 3
0
 private void startShareMediaActivity(IImage image) {
     boolean isVideo = image instanceof VideoObject;
     Intent intent = new Intent();
     intent.setAction(Intent.ACTION_SEND);
     intent.setType(image.getMimeType());
     intent.putExtra(Intent.EXTRA_STREAM, image.fullSizeImageUri());
     try {
         startActivity(Intent.createChooser(intent, getText(
                 isVideo ? R.string.sendVideo : R.string.sendImage)));
     } catch (android.content.ActivityNotFoundException ex) {
         Toast.makeText(this, isVideo
                 ? R.string.no_way_to_share_image
                 : R.string.no_way_to_share_video,
                 Toast.LENGTH_SHORT).show();
     }
 }
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.timer_layout://Layout made clickable to increase click area.
		case R.id.menu_header_time_tracker:
			if(AppUtility.getAppUtilityInstance().isConnectionEstablished()) {
				AppUtility.getAppUtilityInstance().printTimerLogs();
				Intent timerDrawerIntent = new Intent(this, TimeDrawerActivity.class);
				timerDrawerIntent.putExtra(IAppConstants.IS_APP_ON_PAUSE_STATE, false);
				timerDrawerIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				
				Object setResult =  v.getTag(R.id.menu_header_time_tracker);
				
				if(setResult != null && (setResult instanceof Integer)) {
					int requestCode = Integer.parseInt(setResult.toString());
					if ((requestCode&0xffff0000) == 0) {
						timerDrawerIntent.putExtra(IAppConstants.StoreVisitSummary.EXTRA_NOTIFY_REFRESH, requestCode );
						startActivityForResult(timerDrawerIntent, requestCode);
					} else {
						startActivity(timerDrawerIntent);
					}
				} else {
					startActivity(timerDrawerIntent);
				}
			}else {
				AppLogs.d("NavigationDrawerSliderActivity", " connection not established!!");
			}
			break;

		case R.id.tv_header_subtitle: //Set click listener to subtitle to increase clickable area.
		case R.id.ll_header_clickable_menubar:
			if (button.getVisibility() == View.VISIBLE) {
				if (isToggle) {
					final ListPopupWindow mPopupMenuWindow = new ListPopupWindow(
							this);
					mPopupMenuWindow.setAnchorView(v);
					mPopupMenuWindow.setHeight(406);
					mPopupMenuWindow.setWidth(325);
					mPopupMenuWindow.getListView();
					mPopupMenuWindow.setBackgroundDrawable(getResources()
							.getDrawable(R.drawable.bg_popover_function_nine));
					if (menuItems != null) {
						menuAdapter = new FunctionMenuAdapter(this, menuItems,
								txtHeaderTypeface);
					}
					mPopupMenuWindow.setAdapter(menuAdapter);
					mPopupMenuWindow.setVerticalOffset(15);
					mPopupMenuWindow.setHorizontalOffset(-19);
					mPopupMenuWindow
							.setOnItemClickListener(new OnItemClickListener() {

								@Override
								public void onItemClick(AdapterView<?> parent,
										View view, int position, long arg3) {
									//TODO: Call through Presenter. Currently, the "this" instance is of HomeScreenActivity, hence making local method call.
									/*mPresenter.*/OnClickSelectedItem(menuItems
											.get(position).toString());
									mPopupMenuWindow.dismiss();
									isToggle = !isToggle;
								}
							});
					mPopupMenuWindow.show();
				}
				isToggle = !isToggle;
			}
			break;
		}
	}