@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setting_portraitshow);
    iv_photo = (ImageView) findViewById(R.id.iv_photo);
    animateFirstListener = new AnimateFirstDisplayListener();
    imageLoader = ImageLoader.getInstance();
    imageLoader.init(ImageLoaderConfiguration.createDefault(SettingPortraitShowActivity.this));
    options =
        new DisplayImageOptions.Builder()
            .showStubImage(R.drawable.moren_touxiang_1)
            .showImageForEmptyUri(R.drawable.moren_touxiang_1)
            .showImageOnFail(R.drawable.moren_touxiang_1)
            .cacheInMemory(true)
            .cacheOnDisc(true)
            .displayer(new SimpleBitmapDisplayer())
            .build();

    ll_portraitshow = (LinearLayout) findViewById(R.id.ll_portraitshow);
    ll_portraitshow.setOnClickListener(this);
    AccountInfo accountInfo = AccountInfo.getInstance(ActiveAccount.getInstance(this).getUID());
    if (this.getIntent().getExtras() != null) {
      FileInputStream fis;
      try {
        fis = new FileInputStream(this.getIntent().getExtras().getString("path"));
        Bitmap bitmap = BitmapFactory.decodeStream(fis);
        iv_photo.setImageBitmap(bitmap);
      } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    } else if (accountInfo != null) {
      imageLoader.displayImage(
          accountInfo.headimageurl,
          iv_photo,
          options,
          animateFirstListener,
          ActiveAccount.getInstance(this).getUID(),
          0);
    }
  }
Пример #2
0
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   Log.d(TAG, "onDestory in");
   try {
     if (mMediaPlayer != null) {
       mMediaPlayer.release();
       mEffects.release();
       mMediaPlayer = null;
       mEffects = null;
       isPlayerNeedToPlay = false;
       isPlayerPrepared = false;
     }
     BitmapUtils.releaseBmp(videoCoverBmp);
     BitmapUtils.releaseBmp(thumbBmp);
     BitmapUtils.releaseBmps(mBmps);
   } catch (Exception e) {
     e.printStackTrace();
   }
   super.onDestroy();
 }
Пример #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_diary_praise);

    diaryID = getIntent().getStringExtra("diaryID");

    userID = ActiveAccount.getInstance(ZApplication.getInstance()).getUID();
    ai = AccountInfo.getInstance(userID);
    ZDialog.show(R.layout.progressdialog, true, true, this);
    Requester2.getDiaryForwardUsers(getHandler(), diaryID, null, null);

    otherUserID = getIntent().getStringExtra(INTENT_ACTION_USERID);

    isShowAllPraise = false;
    inflater = LayoutInflater.from(this);
    findViewById(R.id.iv_back).setOnClickListener(this);
    listView = (PullToRefreshListView) findViewById(R.id.lv_activity_diary_praise);
    listView.setOnRefreshListener(this);
    dpList = new ArrayList<GsonResponse2.getDiaryForwardUsers>();

    lv = listView.getRefreshableView();
  }
Пример #4
0
 @Override
 protected void onStop() {
   // TODO Auto-generated method stub
   CmmobiClickAgentWrapper.onStop(this);
   super.onStop();
 }
Пример #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_video);

    videoLayout = (FrameLayout) findViewById(R.id.fl_edit_diary_video);
    dm = getResources().getDisplayMetrics();
    Log.d(TAG, "width = " + dm.widthPixels + " height = " + dm.heightPixels);
    LinearLayout.LayoutParams params =
        new LinearLayout.LayoutParams(dm.widthPixels, dm.widthPixels);
    videoLayout.setLayoutParams(params);

    montageView = (VideoMontageView) findViewById(R.id.vv_edit_video_montageview);
    gridView = (GridView) findViewById(R.id.gv_edit_video_montage_imgs);
    adapter = new ImageAdapter(this);
    gridView.setAdapter(adapter);

    ivVideoCover = (ImageView) findViewById(R.id.iv_video_preview);

    loadVideoData();

    videoCoverPath = myDiary.getVideoCoverPath();
    ViewTreeObserver vto2 = ivVideoCover.getViewTreeObserver();
    vto2.addOnGlobalLayoutListener(
        new OnGlobalLayoutListener() {
          @Override
          public void onGlobalLayout() {
            if (videoCoverPath != null) {
              Log.d(
                  TAG,
                  "loadVideoData videoFrontCoverPath = "
                      + videoCoverPath
                      + " url = "
                      + myDiary.getVideoCoverUrl());
              ivVideoCover.setVisibility(View.VISIBLE);
              int height = ivVideoCover.getMeasuredHeight();
              int width = ivVideoCover.getMeasuredWidth();
              Log.d(TAG, "measuredwidth = " + width + " measuredheight = " + height);
              videoCoverBmp = BitmapUtils.readBitmapAutoSize(videoCoverPath, width, height);
              if (videoCoverBmp != null) {
                Log.d(
                    TAG,
                    "width = "
                        + videoCoverBmp.getWidth()
                        + " height = "
                        + videoCoverBmp.getHeight());
              }
            } else {
              ivVideoCover.setImageBitmap(null);
            }

            if (videoCoverBmp != null) {
              curAngle = mMediaPlayer.getCurrentOrientation();
              ivVideoCover.setImageBitmap(
                  BitmapUtils.rotate(videoCoverBmp, (360 - curAngle) % 360, true));
              ivVideoCover.setVisibility(View.VISIBLE);
            }
            ivVideoCover.getViewTreeObserver().removeGlobalOnLayoutListener(this);
          }
        });

    ivPlay = (ImageView) findViewById(R.id.iv_video_play);
    ivPlay.setOnClickListener(this);
    findViewById(R.id.fl_edit_diary_video).setOnClickListener(this);
    montageSave = (ImageView) findViewById(R.id.iv_edit_video_save);
    montageDelete = (ImageView) findViewById(R.id.iv_edit_video_delete);
    montageSave.setOnClickListener(this);
    montageDelete.setOnClickListener(this);

    ivBack = (ImageView) findViewById(R.id.iv_edit_diary_back);
    ivDone = (ImageView) findViewById(R.id.iv_edit_diary_save);
    ivUndo = (ImageView) findViewById(R.id.iv_edit_diary_undo);

    ivCover = (ImageView) findViewById(R.id.iv_edit_video_cover);
    flCoverSetted = (RelativeLayout) findViewById(R.id.fl_edit_video_cover_setted);
    ivCoverSetted = (ImageView) findViewById(R.id.iv_edit_video_cover_setted);

    findViewById(R.id.iv_edit_video_rotate).setOnClickListener(this);

    ivCover.setOnClickListener(this);
    flCoverSetted.setOnClickListener(this);
    flCoverSetted.setVisibility(View.GONE);

    ivBack.setOnClickListener(this);
    ivDone.setOnClickListener(this);
    ivUndo.setOnClickListener(this);
    ivUndo.setEnabled(false);
    ivDone.setEnabled(false);

    setMontageEnable(false);
  }
 @Override
 public void onPause() {
   super.onPause();
   UmengclickAgentWrapper.onPause(this);
   CmmobiClickAgentWrapper.onPause(this);
 }
 @Override
 public void onStop() {
   super.onStop();
   CmmobiClickAgentWrapper.onStop(this);
 }
Пример #8
0
 @Override
 protected void onDestroy() {
   persistMsg();
   super.onDestroy();
 }
Пример #9
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.dialog_login_main_looklook);
  }