Android Open Source - vlcamera Share Activity






From Project

Back to project page vlcamera.

License

The source code is released under:

Apache License

If you think the Android project vlcamera listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ktmt.vlcamera.activities;
/* w  ww  .j  av  a2 s.com*/
import com.ktmt.vlcamera.R;
import com.ktmt.vlcamera.activities.helper.ShareActivityHelper;
import com.ktmt.vlcamera.custom.BaseActivity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

public class ShareActivity extends BaseActivity implements
    View.OnClickListener {
  
  private static final String TAG = "ShareActivity";
  
  private ImageButton mFacebookShare;
  private ImageButton mSaveToDir;
  private Bitmap mToSaveBmp;
  private ShareActivityHelper mActivityHelper;
  
  /** default stuffs **/
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
        
    setContentView(R.layout.activity_share);
    ImageView view = (ImageView) findViewById(R.id.share_preview);
    mToSaveBmp = getBaseApplication().getRawBitmap();
    mActivityHelper = new ShareActivityHelper(this, mToSaveBmp);
    view.setImageBitmap(mToSaveBmp);
    
    mFacebookShare = (ImageButton) findViewById(R.id.btn_share_facebook);
    mSaveToDir = (ImageButton) findViewById(R.id.btn_saveto_dir);
    
    mFacebookShare.setOnClickListener(this);
    mSaveToDir.setOnClickListener(this);
  }

  /** event handle stuffs **/
  @Override
  public void onClick(View view) {
    int id = view.getId();
    
    if (id == R.id.btn_share_facebook) {
      mActivityHelper.shareToFacebook();
    } else if (id == R.id.btn_saveto_dir) {
      if (mToSaveBmp == null) { 
        Log.v(TAG, "save bitmap is null");
        finish();
      }
      mActivityHelper.saveToDir();
      finish();
    } else {
      finish();
    }
  }
}




Java Source Code List

com.ktmt.vlcamera.activities.EditActivity.java
com.ktmt.vlcamera.activities.MenuActivity.java
com.ktmt.vlcamera.activities.ShareActivity.java
com.ktmt.vlcamera.activities.SplashActivity.java
com.ktmt.vlcamera.activities.StampChooseActivity.java
com.ktmt.vlcamera.activities.helper.EditActivityHelper.java
com.ktmt.vlcamera.activities.helper.MenuActivityHelper.java
com.ktmt.vlcamera.activities.helper.ShareActivityHelper.java
com.ktmt.vlcamera.activities.helper.StampChooseActivityHelper.java
com.ktmt.vlcamera.common.vlCameraBitmapUtils.java
com.ktmt.vlcamera.common.vlCameraConstant.java
com.ktmt.vlcamera.custom.BaseActivity.java
com.ktmt.vlcamera.custom.BaseApplication.java
com.ktmt.vlcamera.custom.DraggableImageView.java
com.ktmt.vlcamera.custom.ImageViewNameMap.java
com.ktmt.vlcamera.model.BitmapOperationMap.java
com.ktmt.vlcamera.model.DraggableBitmap.java
com.ktmt.vlcamera.model.DraggableText.java