您好,欢迎光临本网站![请登录][注册会员]  
文件名称: 访微信语音聊天
  所属分类: Android
  开发工具:
  文件大小: 1mb
  下载次数: 0
  上传时间: 2015-09-16
  提 供 者: alva*****
 详细说明: package com.alva.vcd; import java.util.ArrayList; import java.util.List; import com.alva.vcd.adapter.RecorderAdapter; import com.alva.vcd.pojo.Recorder; import com.alva.vcd.view.AudioRecorderButton; import com.alva.vcd.view.AudioRecorderButton.AudioFinishRecorderListener; import com.alva.vcd.view.MediaManager; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.graphics.drawable.AnimationDrawable; import android.media.MediaPlayer; import android.os.Bundle; import android.util .Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.FrameLayout; import android.widget.ListView; import android.widget.TextView; import android.os.Build; public class MainActivity extends Activity implements AudioFinishRecorderListener, OnItemClickListener { private ListView mListview; private AudioRecorderButton mAudioButton; private ArrayAdapter mAdapter; private List mDatas = new ArrayList();; private View mAnimView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chat); initViews(); initDatas(); initEvents(); } private void initViews() { mListview = (ListView) findViewById(R.id.listview_chat); mAudioButton = (AudioRecorderButton) findViewById(R.id.recorderButton); } private void initDatas() { mAudioButton.setAudioFinishRecorderListener(this); mAdapter = new RecorderAdapter(getApplicationContext(), mDatas); mListview.setAdapter(mAdapter); } private void initEvents() { mListview.setOnItemClickListener(this); } @Override public void onFinsh(float seconds, String filePath) { Recorder mRecorder = new Recorder(); mRecorder.setFilePath(filePath); mRecorder.setTime(seconds); mDatas.add(mRecorder); mAdapter.notifyDataSetChanged(); mListview.setSelection(mDatas.size() - 1); } @Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { Log.e("MediaManager", mDatas.get(arg2).getFilePath() + "sssss"); if (mAnimView != null) { mAnimView.setBackgroundResource(R.drawable.adj); mAnimView = null; } // 播放动画 mAnimView = arg1.findViewById(R.id.id_view); mAnimView.setBackgroundResource(R.drawable.play_anim); AnimationDrawable anim = (AnimationDrawable) mAnimView.getBackground(); anim.start(); // 播放音频 MediaManager.playSound(mDatas.get(arg2).getFilePath(), new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer arg0) { mAnimView.setBackgroundResource(R.drawable.adj); } }); } @Override protected void onPause() { super.onPause(); MediaManager.pause(); } @Override protected void onResume() { super.onResume(); MediaManager.resume(); } @Override protected void onDestroy() { super.onDestroy(); MediaManager.release(); } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: 微信、语音
 输入关键字,在本站1000多万海量源码库中尽情搜索: