예제 #1
0
 private void showShare() {
   final String text =
       String.format(getString(R.string.share_text_full_total), appPreference.getTotalNumber());
   //        ScreenshotUtils.shotBitmap(MainActivity.this, shareFileName);
   //        Animation animation = AnimationUtils.loadAnimation(getApplicationContext(),
   // R.anim.fade_out);
   //        animation.setAnimationListener(new Animation.AnimationListener() {
   //            @Override
   //            public void onAnimationStart(Animation animation) {
   //            }
   //
   //            @Override
   //            public void onAnimationEnd(Animation animation) {
   //
   //            }
   //
   //            @Override
   //            public void onAnimationRepeat(Animation animation) {
   //
   //            }
   //        });
   //        share.startAnimation(animation);
   takeScreenshot();
   Utils.share(
       MainActivity.this, MainActivity.this.getString(R.string.app_name), text, shareFileName);
 }
예제 #2
0
  private void sendToWeChat() {
    final String text =
        String.format(getString(R.string.share_text_full_total), appPreference.getTotalNumber());
    ScreenshotUtils.shotBitmap2(this, shareFileName);
    weChatUtils.createAppendReq2(this.getString(R.string.app_name), text, shareFileName);

    Intent intent = new Intent();
    intent.setClass(this, me.pjq.pushup.activity.SendToWXActivity.class);
    startActivity(intent);

    Utils.overridePendingTransitionRight2Left(this);
  }
예제 #3
0
  /**
   * Defines a default (dummy) share intent to initialize the action provider. However, as soon as
   * the actual content to be used in the intent is known or changes, you must update the share
   * intent by again calling mShareActionProvider.setShareIntent()
   */
  private Intent updateShareIntent() {
    if (null == appPreference) {
      return null;
    }

    final String text =
        String.format(getString(R.string.share_text_full_total), appPreference.getTotalNumber());
    takeScreenshot();
    Intent intent =
        Utils.getShareIntent(
            MainActivity.this, MainActivity.this.getString(R.string.app_name), text, shareFileName);

    if (null != mShareActionProvider) {
      //            mShareActionProvider.setShareIntent(Utils.getShareRawIntent(this));
      mShareActionProvider.setShareIntent(intent);
    }

    return intent;
  }