示例#1
0
  public static MyLocationInfo getInstance(Context c) {
    if (ins == null) {
      ins = new MyLocationInfo();
    }

    if (c != null) {
      ins.context = c;
    }

    return ins;
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_voice_detail);

    detailMainFragment = new EditVoiceDetailMainFragment();
    tagFragment = new EditMediaTagFragment();
    posFragment = new EditMediaPositionFragment();
    soundFragment = new EditMediaBeautifySoundFragment();
    textFragment = new EditMediaTextInputFragment();
    mainFragment = new EditVoiceMainFragment();
    montageFragment = new EditVoiceMontageFragment();
    soundtrackFragment = new EditMediaSoundtrackFragment();

    fm = getSupportFragmentManager();

    ivBack = (ImageView) findViewById(R.id.iv_back);
    ivDone = (ImageView) findViewById(R.id.iv_edit_done);
    ivBack.setOnClickListener(this);
    ivDone.setOnClickListener(this);

    myLocInfo = MyLocationInfo.getInstance(this);
    myLoc = myLocInfo.getLocation();

    initView(this);

    mMapView = (MyMapView) findViewById(R.id.bmv_activity_edit_voice_detail_position);
    mMapView.setVisibility(View.GONE);
    myPositionLayout = (MyPositionLayout) findViewById(R.id.rl_activity_edit_media_my_position);
    myPositionLayout.setVisibility(View.GONE);
    myPositionLayout.setWillNotDraw(false);
    myPositionTv = (TextView) findViewById(R.id.tv_edit_media_myposition);
    myPositionTv.setVisibility(View.GONE);

    mainLayout = (RelativeLayout) findViewById(R.id.rl_activity_edit_voice_main);
    mainLayout.setOnClickListener(this);
    detailMainLayout = (LinearLayout) findViewById(R.id.ll_activity_edit_voice_detail_main);
    thumbView = (ImageView) findViewById(R.id.iv_edit_voice_thumbnails);
    thumbView.setOnClickListener(this);
    //		recPlayerView = (ImageView) findViewById(R.id.iv_edit_long_rec_player);
    //		recPlayerView.setOnClickListener(this);

    diaryUUID = getIntent().getStringExtra(DiaryDetailActivity.INTENT_ACTION_DIARY_UUID);
    diaryString = getIntent().getStringExtra(DiaryDetailActivity.INTENT_ACTION_DIARY_STRING);

    initAttachs();

    tvAudioDuration = (TextView) findViewById(R.id.tv_edit_voice_duration);
    if (mainAudioDuration != null) {
      tvAudioDuration.setText(
          EditVoiceMainFragment.convertTimeFormartMS("0")
              + "/"
              + EditVoiceMainFragment.convertTimeFormartMS(mainAudioDuration));
    }

    loadAudioData();

    ivPlay = (ImageView) findViewById(R.id.iv_edit_voice_play);
    ivPlay.setOnClickListener(this);

    playProcess = (SeekBar) findViewById(R.id.sk_edit_voice_seekbar);
    playProcess.setMax(100);
    playProcess.setProgress(0);
    seekBarBg = (ImageView) findViewById(R.id.v_seekbar_background);
    ViewTreeObserver vto2 = seekBarBg.getViewTreeObserver();
    vto2.addOnGlobalLayoutListener(
        new OnGlobalLayoutListener() {

          @Override
          public void onGlobalLayout() {
            // TODO Auto-generated method stub
            seekBarLength = seekBarBg.getMeasuredWidth();
          }
        });

    llXiaLa = (LinearLayout) findViewById(R.id.ll_edit_diary_style);
    llXiaLa.setOnClickListener(this);
    diaryEditStyle = (TextView) findViewById(R.id.tv_edit_name);
    inflater = LayoutInflater.from(this);
    rlTitleBar = findViewById(R.id.rl_title);

    handler = new Handler(this);

    if (mainAudioPath == null) {
      thumbView.setVisibility(View.INVISIBLE);
      thumbView.setClickable(false);
    }
    goToPage(FRAGMENT_DETAIL_MAIN_VIEW, false);
    getWindow()
        .setSoftInputMode(
            WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN
                | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

    overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
  }