diff --git a/FunctionRealize/Record/RecordActivity.java b/FunctionRealize/Record/RecordActivity.java
deleted file mode 100644
index da17df6..0000000
--- a/FunctionRealize/Record/RecordActivity.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.record;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.View;
-import android.media.MediaRecorder;
-import android.os.Environment;
-import android.view.Window;
-import android.widget.Button;
-import android.widget.Toast;
-import java.io.File;
-import java.io.IOException;
-
-@SuppressLint("Registered")
-public class RecordActivity extends Activity implements View.OnClickListener {
-
- Button startRecording, stopRecording, pauseRecording;//开始录音、停止录音、释放资源
- MediaRecorder recorder;
- File audioFile; //录音保存的文件
- boolean isRecoding = false;// true 表示正在录音
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- setContentView(R.layout.activity_main);
- init();
- initListener();
- }
-
- //初始化
- public void init() {
- stopRecording = (Button) this.findViewById(R.id.btn_stop);
- startRecording = (Button) this.findViewById(R.id.btn_play);
- pauseRecording = (Button) this.findViewById(R.id.btn_pause);
- if (!path.exists()) {
- path.mkdirs();
- }
- }
- //初始化麦克风
- private void InitMedia(){
- recorder = new MediaRecorder();
- recorder.setAudioSource(MediaRecorder.AudioSource.MIC);//设置播放源 麦克风
- recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB); //设置输入格式 3gp
- recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); //设置编码AMR
- }
- //设置监听器
- public void initListener() {
- startRecording.setOnClickListener(this);
- stopRecording.setOnClickListener(this);
- pauseRecording.setOnClickListener(this);
- }
-
- //此处还应该对手机进行下判断,判断下手机里面有没有内存卡
- //保存在SD卡下MediaRecorderTest文件夹中
- File path = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/MediaRecorderTest");
-
- //录音
- public void recod() {
- InitMedia();
- int i = (int) (Math.random() * 10000);
- String a = Integer.toString(i);
- String b = "Voice";
- String FileName = b + a;
- try {
- audioFile = new File(path, FileName + ".aac");
- //audioFile=new File(path,"ycc.aac");
- if (audioFile.exists()) {
- audioFile.delete();
- }
- audioFile.createNewFile();//创建文件
-
- } catch (Exception e) {
- throw new RuntimeException("Couldn't create recording audio file", e);
- }
-
- recorder.setOutputFile(audioFile.getAbsolutePath()); //设置输出文件
-
- try {
- recorder.prepare();
- } catch (IllegalStateException e) {
- throw new RuntimeException("IllegalStateException on MediaRecorder.prepare", e);
- } catch (IOException e) {
- throw new RuntimeException("IOException on MediaRecorder.prepare", e);
- }
- isRecoding = true;
- recorder.start();
- }
-
-
- public void onClick(View v) {
- //开始录音
- while (true){
- if (v == startRecording) {
- Toast.makeText(RecordActivity.this, "开始录音", Toast.LENGTH_SHORT).show();
- recod();
- break;
- }
-
- if (v == pauseRecording) {
-
- }
- //停止录音
- if (v == stopRecording) {
- if (isRecoding) {
- Toast.makeText(RecordActivity.this, "录音结束,文件已存至/MediaRecorderTest", Toast.LENGTH_SHORT).show();
- recorder.stop();//调用stop之后recorder会被清空,再次录音要再次初始化recorder
- break;
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/database/v/app/build.gradle b/database/v/app/build.gradle
deleted file mode 100644
index c70e692..0000000
--- a/database/v/app/build.gradle
+++ /dev/null
@@ -1,45 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 27
- defaultConfig {
- applicationId "com.example.cici.voice"
- minSdkVersion 18
- targetSdkVersion 27
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-}
-
-dependencies {
- implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation 'com.android.support.constraint:constraint-layout:1.1.2'
- implementation 'com.android.support:design:27.1.1'
- testImplementation 'junit:junit:4.12'
- implementation 'com.lzy.widget:ninegridview:0.2.0'
- //图片选择包
- implementation 'com.makeramen:roundedimageview:2.3.0'
- //圆形头像库
- implementation fileTree(include: ['*.jar'], dir: 'libs')
- //图片显示包
- implementation 'com.github.bumptech.glide:glide:3.7.0'
- //缓存图片包
- implementation 'com.lzy.widget:imagepicker:+'
- //沉浸
- //3.5.5:请务必查看下面注释[1]
- implementation 'cn.bmob.android:bmob-sdk:3.5.5'
-
- //如果你想应用能够兼容Android6.0,请添加此依赖(org.apache.http.legacy.jar)
- implementation 'cn.bmob.android:http-legacy:1.0'
- implementation files('libs/picasso-2.5.2.jar')
- implementation 'com.github.ybq:Android-SpinKit:1.1.0'
- implementation 'com.android.support:support-v13:27.1.1'
-}
diff --git a/database/v/app/libs/MobCommons-2018.1128.1916.jar b/database/v/app/libs/MobCommons-2018.1128.1916.jar
deleted file mode 100644
index def8c9a..0000000
Binary files a/database/v/app/libs/MobCommons-2018.1128.1916.jar and /dev/null differ
diff --git a/database/v/app/libs/MobTools-2018.1128.1916.jar b/database/v/app/libs/MobTools-2018.1128.1916.jar
deleted file mode 100644
index 5a03eef..0000000
Binary files a/database/v/app/libs/MobTools-2018.1128.1916.jar and /dev/null differ
diff --git a/database/v/app/libs/SDKWrapper-2018.0801.1824.jar b/database/v/app/libs/SDKWrapper-2018.0801.1824.jar
deleted file mode 100644
index 121c4b8..0000000
Binary files a/database/v/app/libs/SDKWrapper-2018.0801.1824.jar and /dev/null differ
diff --git a/database/v/app/libs/SMSSDK-3.3.0.jar b/database/v/app/libs/SMSSDK-3.3.0.jar
deleted file mode 100644
index 8d028e0..0000000
Binary files a/database/v/app/libs/SMSSDK-3.3.0.jar and /dev/null differ
diff --git a/database/v/app/libs/picasso-2.5.2.jar b/database/v/app/libs/picasso-2.5.2.jar
deleted file mode 100644
index 6acbaa1..0000000
Binary files a/database/v/app/libs/picasso-2.5.2.jar and /dev/null differ
diff --git a/database/v/app/src/main/AndroidManifest.xml b/database/v/app/src/main/AndroidManifest.xml
deleted file mode 100644
index cc9602b..0000000
--- a/database/v/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/java/com/example/cici/MyApplication.java b/database/v/app/src/main/java/com/example/cici/MyApplication.java
deleted file mode 100644
index bcc24c3..0000000
--- a/database/v/app/src/main/java/com/example/cici/MyApplication.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.example.cici;
-
-import android.app.Application;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.widget.ImageView;
-
-import com.bumptech.glide.Glide;
-import com.example.cici.utils.ImageLoader;
-import com.example.cici.voice.R;
-import com.lzy.imagepicker.ImagePicker;
-import com.lzy.imagepicker.view.CropImageView;
-import com.lzy.ninegrid.NineGridView;
-
-import cn.bmob.v3.Bmob;
-
-public class MyApplication extends Application {
- @Override
- public void onCreate() {
- super.onCreate();
- Bmob.initialize(this, "eb215dfb2a8a94afc9c871f4394c3b23");
- NineGridView.setImageLoader(new GlideImageLoader());
- ImagePicker imagePicker = ImagePicker.getInstance();
- imagePicker.setImageLoader(new ImageLoader()); //设置图片加载器
- imagePicker.setShowCamera(true); //显示拍照按钮
- imagePicker.setCrop(true); //允许裁剪(单选才有效)
- imagePicker.setSaveRectangle(true); //是否按矩形区域保存
- imagePicker.setSelectLimit(9); //选中数量限制
- imagePicker.setStyle(CropImageView.Style.RECTANGLE); //裁剪框的形状
- imagePicker.setFocusWidth(800); //裁剪框的宽度。单位像素(圆形自动取宽高最小值)
- imagePicker.setFocusHeight(800); //裁剪框的高度。单位像素(圆形自动取宽高最小值)
- imagePicker.setOutPutX(1000);//保存文件的宽度。单位像素
- imagePicker.setOutPutY(1000);//保存文件的高度。单位像素
- }
- private class GlideImageLoader implements NineGridView.ImageLoader {
- @Override
- public void onDisplayImage(Context context, ImageView imageView, String url) {
- Glide.with(context).load(url)//
- .placeholder(R.drawable.ic_default_image)//
- .error(R.drawable.ic_default_image)//
- .into(imageView);
-
- }
- @Override
- public Bitmap getCacheImage(String url) {
- return null;
- }
- }
-
-
-}
diff --git a/database/v/app/src/main/java/com/example/cici/adapter/CommentAdapter.java b/database/v/app/src/main/java/com/example/cici/adapter/CommentAdapter.java
deleted file mode 100644
index 4707e97..0000000
--- a/database/v/app/src/main/java/com/example/cici/adapter/CommentAdapter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.example.cici.adapter;
-
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.TextView;
-
-import com.example.cici.bean.Comment;
-import com.example.cici.voice.R;
-import com.makeramen.roundedimageview.RoundedImageView;
-import com.squareup.picasso.Picasso;
-
-import java.util.ArrayList;
-
-public class CommentAdapter extends BaseAdapter {
- private ArrayList list;
- private Context context;
-
- public CommentAdapter(ArrayList list, Context context) {
- this.list = list;
- this.context = context;
- }
-
- @Override
- public int getCount() {
- return list.size();
- }
-
- @Override
- public Object getItem(int i) {
- return list.get(i);
- }
-
- @Override
- public long getItemId(int i) {
- return i;
- }
-
- @Override
- public View getView(int i, View view, ViewGroup viewGroup) {
- ViewHolder holder;
- if (view == null) {
- view = LayoutInflater.from(context).inflate(R.layout.comm_item, null);
- holder = new ViewHolder();
- holder.tvName = (TextView) view.findViewById(R.id.tv_comm_author);
- holder.head = view.findViewById(R.id.comment_item_icon);
- holder.tvTime = (TextView) view.findViewById(R.id.comm_time);
- holder.tvContent = (TextView) view.findViewById(R.id.tv_comm_content);
-
- view.setTag(holder);
- } else {
- holder = (ViewHolder) view.getTag();
- }
- final Comment comment=list.get(i);
- String mycontent = list.get(i).getContent();
- if (mycontent == null || mycontent.length() <= 0) {
- holder.tvContent.setVisibility(View.GONE);
- } else {
- holder.tvContent.setVisibility(View.VISIBLE);
- holder.tvContent.setText(mycontent);
- }
- holder.tvName.setText(list.get(i).getName());
- holder.tvTime.setText(list.get(i).getUpdatedAt());
- Picasso.with(context).load(list.get(i).getUserHead()).into(holder.head);
-
- return view;
- }
- class ViewHolder{
- TextView tvName;
- TextView tvContent;
- TextView tvTime;
- RoundedImageView head;
-
-
-
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/adapter/MyAdapter.java b/database/v/app/src/main/java/com/example/cici/adapter/MyAdapter.java
deleted file mode 100644
index 78aeb01..0000000
--- a/database/v/app/src/main/java/com/example/cici/adapter/MyAdapter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.example.cici.adapter;
-
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-
-import com.example.cici.bean.Post;
-import com.example.cici.voice.R;
-import com.lzy.ninegrid.ImageInfo;
-import com.lzy.ninegrid.NineGridView;
-import com.lzy.ninegrid.preview.NineGridViewClickAdapter;
-import com.squareup.picasso.Picasso;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MyAdapter extends BaseAdapter {
- private List list;
- private Context context;
-
- public MyAdapter(Context context, List list) {
- this.context = context;
- this.list = list;
- }
-
- public void addPost(List list) {
- this.list = list;
-
- }
-
- @Override
- public int getCount() {
- if (list == null)
- return 0;
- else
- return list.size();
- }
-
- @Override
- public Object getItem(int i) {
- return list.get(i);
- }
-
- @Override
- public long getItemId(int i) {
- return i;
- }
-
- @Override
- public View getView(int i, View view, ViewGroup viewGroup) {
- ViewHolder holder;
- if (view == null) {
- view = LayoutInflater.from(context).inflate(R.layout.item_post, null);
- holder = new ViewHolder();
- holder.name = (TextView) view.findViewById(R.id.post_username);
- holder.time = (TextView) view.findViewById(R.id.post_time);
- holder.content = (TextView) view.findViewById(R.id.post_content);
- holder.icon = (ImageView) view.findViewById(R.id.headIcon);
- holder.nineGrid = (NineGridView) view.findViewById(R.id.post_nineGrid);
- view.setTag(holder);
- } else {
- holder = (ViewHolder) view.getTag();
- }
- Picasso.with(context).load(list.get(i).getUserIcon()).into(holder.icon);
- String mycontent = list.get(i).getContent();
- if (mycontent == null || mycontent.length() <= 0) {
- holder.content.setVisibility(View.GONE);
- } else {
- holder.content.setVisibility(View.VISIBLE);
- holder.content.setText(mycontent);
- }
- holder.name.setText(list.get(i).getUserName());
- holder.time.setText(list.get(i).getTime());
- if (list.get(i).isHaveIcon()) {//判断是否有图片
- ArrayList imageInfo = new ArrayList<>();
- for (int j = 0; j < list.get(i).getHeadImgUrl().size(); j++) {
- ImageInfo info = new ImageInfo();
- info.setThumbnailUrl(list.get(i).getHeadImgUrl().get(j));
- info.setBigImageUrl(list.get(i).getHeadImgUrl().get(j));
- imageInfo.add(info);
- }
- holder.nineGrid.setAdapter(new NineGridViewClickAdapter(context, imageInfo));
- } else {
- holder.nineGrid.setVisibility(View.GONE);
- }
- return view;
- }
-
- private class ViewHolder {
- private TextView name;
- private TextView time;
- private TextView content;
- private ImageView icon;
- private com.lzy.ninegrid.NineGridView nineGrid;
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/bean/Comment.java b/database/v/app/src/main/java/com/example/cici/bean/Comment.java
deleted file mode 100644
index 4347dc0..0000000
--- a/database/v/app/src/main/java/com/example/cici/bean/Comment.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.example.cici.bean;
-
-
-import cn.bmob.v3.BmobObject;
-
-public class Comment extends BmobObject {
- /**
- * 评论内容
- */
- private static final long serialVersionUID = 1L;
- private String content;
- private User user;
- private Post post;
- private String name;
- private String time;
- private String userHead;
-
- public String getUserHead() {
- return userHead;
- }
-
- public void setUserHead(String userHead) {
- this.userHead = userHead;
- }
-
- public String getTime() {
- return time;
- }
-
- public void setTime(String time) {
- this.time = time;
- }
-
- public User getUser() {
- return user;
- }
-
- public void setUser(User user) {
- this.user = user;
- }
-
- public Post getPost() {
- return post;
- }
-
- public void setPost(Post post) {
- this.post = post;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getContent() {
- return content;
- }
- public void setContent(String content) {
- this.content = content;
- }
-
-}
diff --git a/database/v/app/src/main/java/com/example/cici/bean/Post.java b/database/v/app/src/main/java/com/example/cici/bean/Post.java
deleted file mode 100644
index d96e7ef..0000000
--- a/database/v/app/src/main/java/com/example/cici/bean/Post.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.example.cici.bean;
-
-import java.util.List;
-
-import cn.bmob.v3.BmobObject;
-
-public class Post extends BmobObject {
- private String userIcon; //头像
- private String userName; // 名字
- private String content; // 说说内容
- private List headImgUrl; //图片的URL集合
- private boolean haveIcon; //判断是否有图片
- private Integer praise;//点赞
- private String time;//发表时间
-
- public String getTime() {
- return time;
- }
-
- public void setTime(String time) {
- this.time = time;
- }
-
- public Integer getPraise() {
- return praise;
- }
-
- public void setPraise(Integer praise) {
- this.praise = praise;
- }
-
- public String getUserIcon() {
- return userIcon;
- }
-
- public void setUserIcon(String userIcon) {
- this.userIcon = userIcon;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getContent() {
- return content;
- }
-
- public void setContent(String content) {
- this.content = content;
- }
-
- public List getHeadImgUrl() {
- return headImgUrl;
- }
-
- public void setHeadImgUrl(List headImgUrl) {
- this.headImgUrl = headImgUrl;
- }
-
- public boolean isHaveIcon() {
- return haveIcon;
- }
-
- public void setHaveIcon(boolean haveIcon) {
- this.haveIcon = haveIcon;
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/bean/User.java b/database/v/app/src/main/java/com/example/cici/bean/User.java
deleted file mode 100644
index 14d9670..0000000
--- a/database/v/app/src/main/java/com/example/cici/bean/User.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.example.cici.bean;
-
-import cn.bmob.v3.BmobUser;
-import cn.bmob.v3.datatype.BmobFile;
-import cn.bmob.v3.datatype.BmobRelation;
-
-public class User extends BmobUser {
- private BmobRelation collect;
- private String sex;
- private String img_url;
- private BmobFile photo;
- private BmobRelation myPost;
- private String head;
- private String birthday;
- private String phone;
-
-
- public User() {
- }
-
- public String getHead() {
- return head;
- }
-
- public void setHead(String head) {
- this.head = head;
- }
-
- public String getImg_url() {
- return img_url;
- }
-
- public void setImg_url(String img_url) {
- this.img_url = img_url;
- }
-
- public String getSex() {
- return sex;
- }
-
- public void setSex(String sex) {
- this.sex = sex;
- }
-
-
- public BmobFile getPhoto() {
- return photo;
- }
-
- public void setPhoto(BmobFile photo) {
- this.photo = photo;
- }
-
-
- public BmobRelation getCollect() {
- return collect;
- }
-
- public void setCollect(BmobRelation collect) {
- this.collect = collect;
- }
-
- public BmobRelation getMyPost() {
- return myPost;
- }
-
- public void setMyPost(BmobRelation myPost) {
- this.myPost = myPost;
- }
-
-
-
-
- public String getBirthday() {
- return birthday;
- }
-
- public void setBirthday(String birthday) {
- this.birthday = birthday;
- }
-
- public String getPhone() {
- return phone;
- }
-
- public void setPhone(String phone) {
- this.phone = phone;
- }
-
-
-}
-
-
diff --git a/database/v/app/src/main/java/com/example/cici/utils/CircleTransform.java b/database/v/app/src/main/java/com/example/cici/utils/CircleTransform.java
deleted file mode 100644
index 93db9b4..0000000
--- a/database/v/app/src/main/java/com/example/cici/utils/CircleTransform.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.example.cici.utils;
-
-import android.graphics.Bitmap;
-
-/**
- * Created by Andream on 2017/10/19.
- * 图片裁剪正方形类
- */
-
-public class CircleTransform {
- /**
- * @param bitmap 原图
- * @param edgeLength 希望得到的正方形部分的边长
- * @return 缩放截取正中部分后的位图。
- */
- public static Bitmap centerSquareScaleBitmap(Bitmap bitmap, int edgeLength)
- {
- if(null == bitmap || edgeLength <= 0)
- {
- return null;
- }
-
- Bitmap result = bitmap;
- int widthOrg = bitmap.getWidth();
- int heightOrg = bitmap.getHeight();
-
- if(widthOrg > edgeLength && heightOrg > edgeLength)
- {
- //压缩到一个最小长度是edgeLength的bitmap
- int longerEdge = (int)(edgeLength * Math.max(widthOrg, heightOrg) / Math.min(widthOrg, heightOrg));
- int scaledWidth = widthOrg > heightOrg ? longerEdge : edgeLength;
- int scaledHeight = widthOrg > heightOrg ? edgeLength : longerEdge;
- Bitmap scaledBitmap;
-
- try{
- scaledBitmap = Bitmap.createScaledBitmap(bitmap, scaledWidth, scaledHeight, true);
- }
- catch(Exception e){
- return null;
- }
-
- //从图中截取正中间的正方形部分。
- int xTopLeft = (scaledWidth - edgeLength) / 2;
- int yTopLeft = (scaledHeight - edgeLength) / 2;
-
- try{
- result = Bitmap.createBitmap(scaledBitmap, xTopLeft, yTopLeft, edgeLength, edgeLength);
- scaledBitmap.recycle();
- }
- catch(Exception e){
- return null;
- }
- }
-
- return result;
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/utils/GradScrollView.java b/database/v/app/src/main/java/com/example/cici/utils/GradScrollView.java
deleted file mode 100644
index 4a324b4..0000000
--- a/database/v/app/src/main/java/com/example/cici/utils/GradScrollView.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.example.cici.utils;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.ScrollView;
-
-/**
- * Created by Andream on 2017/10/19.
- * 自定义滑动框
- */
-public class GradScrollView extends ScrollView {
-
- public interface ScrollViewListener {
-
- void onScrollChanged(GradScrollView scrollView, int x, int y,
- int oldx, int oldy);
-
- }
-
- private ScrollViewListener scrollViewListener = null;
-
- public GradScrollView(Context context) {
- super(context);
- }
-
- public GradScrollView(Context context, AttributeSet attrs,
- int defStyle) {
- super(context, attrs, defStyle);
- }
-
- public GradScrollView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public void setScrollViewListener(ScrollViewListener scrollViewListener) {
- this.scrollViewListener = scrollViewListener;
- }
-
- @Override
- protected void onScrollChanged(int x, int y, int oldx, int oldy) {
- super.onScrollChanged(x, y, oldx, oldy);
- if (scrollViewListener != null) {
- scrollViewListener.onScrollChanged(this, x, y, oldx, oldy);
- }
- }
-}
-
diff --git a/database/v/app/src/main/java/com/example/cici/utils/ImageLoader.java b/database/v/app/src/main/java/com/example/cici/utils/ImageLoader.java
deleted file mode 100644
index d76ec28..0000000
--- a/database/v/app/src/main/java/com/example/cici/utils/ImageLoader.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.example.cici.utils;
-
-import android.app.Activity;
-import android.net.Uri;
-import android.widget.ImageView;
-
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.load.engine.DiskCacheStrategy;
-
-import java.io.File;
-
-/**
- * Created by Andream on 2017/10/19.
- *
- */
-
-public class ImageLoader implements com.lzy.imagepicker.loader.ImageLoader{
-
- @Override
- public void displayImage(Activity activity, String path, ImageView imageView, int width, int height) {
- Glide.with(activity) //配置上下文
- .load(Uri.fromFile(new File(path))) //设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
- .diskCacheStrategy(DiskCacheStrategy.ALL)//缓存全尺寸
- .into(imageView);
- }
-
- @Override
- public void displayImagePreview(Activity activity, String path, ImageView imageView, int width, int height) {
- Glide.with(activity) //配置上下文
- .load(Uri.fromFile(new File(path))) //设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
- .diskCacheStrategy(DiskCacheStrategy.ALL)//缓存全尺寸
- .into(imageView);
- }
-
- @Override
- public void clearMemoryCache() {
- }
-}
\ No newline at end of file
diff --git a/database/v/app/src/main/java/com/example/cici/utils/MyListview.java b/database/v/app/src/main/java/com/example/cici/utils/MyListview.java
deleted file mode 100644
index d9c24ce..0000000
--- a/database/v/app/src/main/java/com/example/cici/utils/MyListview.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.example.cici.utils;
-
-/**
- * Created by Andream on 2017/10/19.
- * 自定义listview
- */
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.ListView;
-
-public class MyListview extends ListView {
-
- public MyListview(Context context) {
- // TODO Auto-generated method stub
- super(context);
- }
-
- public MyListview(Context context, AttributeSet attrs) {
- // TODO Auto-generated method stub
- super(context, attrs);
- }
-
- public MyListview(Context context, AttributeSet attrs, int defStyle) {
- // TODO Auto-generated method stub
- super(context, attrs, defStyle);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- // TODO Auto-generated method stub
- int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
- MeasureSpec.AT_MOST);
- super.onMeasure(widthMeasureSpec, expandSpec);
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/utils/TimeCountUtil.java b/database/v/app/src/main/java/com/example/cici/utils/TimeCountUtil.java
deleted file mode 100644
index 1dacb26..0000000
--- a/database/v/app/src/main/java/com/example/cici/utils/TimeCountUtil.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.example.cici.utils;
-
-import android.os.CountDownTimer;
-import android.widget.Button;
-
-
-public class TimeCountUtil extends CountDownTimer {
- private Button mButton;
-
- public TimeCountUtil(Button button, long millisInFuture, long countDownInterval) {
- super(millisInFuture, countDownInterval);
- this.mButton = button;
- }
-
- @Override
- public void onTick(long millisUntilFinished) {
- // 按钮不可用
- mButton.setEnabled(false);
- String showText = millisUntilFinished / 1000 + "秒后可重新发送";
- mButton.setText(showText);
- }
-
- @Override
- public void onFinish() {
- // 按钮设置可用
- mButton.setEnabled(true);
- mButton.setText("重新获取验证码");
- }
-}
\ No newline at end of file
diff --git a/database/v/app/src/main/java/com/example/cici/voice/CommentActivity.java b/database/v/app/src/main/java/com/example/cici/voice/CommentActivity.java
deleted file mode 100644
index 03f071a..0000000
--- a/database/v/app/src/main/java/com/example/cici/voice/CommentActivity.java
+++ /dev/null
@@ -1,387 +0,0 @@
-package com.example.cici.voice;
-
-import android.content.Context;
-import android.content.Intent;
-import android.support.v7.app.AlertDialog;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.bumptech.glide.Glide;
-import com.example.cici.adapter.CommentAdapter;
-import com.example.cici.bean.Comment;
-import com.example.cici.bean.Post;
-import com.example.cici.bean.User;
-import com.example.cici.utils.MyListview;
-import com.example.cici.voice.R;
-import com.lzy.ninegrid.ImageInfo;
-import com.lzy.ninegrid.NineGridView;
-import com.lzy.ninegrid.preview.NineGridViewClickAdapter;
-import com.makeramen.roundedimageview.RoundedImageView;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import cn.bmob.v3.BmobQuery;
-import cn.bmob.v3.BmobUser;
-import cn.bmob.v3.datatype.BmobPointer;
-import cn.bmob.v3.exception.BmobException;
-import cn.bmob.v3.listener.FindListener;
-import cn.bmob.v3.listener.SaveListener;
-import cn.bmob.v3.listener.UpdateListener;
-
-public class CommentActivity extends AppCompatActivity implements View.OnClickListener{
- private float mFirstY;
- private float mCurrentY;
- private int direction;
- private int mTouchSlop;
- private ArrayList list = new ArrayList();
- private CommentAdapter adapter;
- private MyListview listView;
- RoundedImageView head;
- private Post post = new Post();
- TextView tv_name, tv_time, tv_content,tv_good;
- private NineGridView nineGridView;
- private Button btn_reply;
- private EditText repy_content,ed_comm;
- private User user;
- private String obj;
- private AlertDialog al;
- private ArrayList picList = new ArrayList<>();
- private LinearLayout ly_opte,area_commit;
- private ImageView et_reply,back_deal,comm_share,comm_del;//返回
- private Boolean isHaven;//是否存在图片
- private String auhthor_url;//帖子作者id
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_comment);
- init();
- initListener();
- getUrl();
- }
- /*
- 初始化数据
- */
- void init() {
-
- listView = findViewById(R.id.mylv);
- tv_name = findViewById(R.id.tv_comment_username);
- tv_time = findViewById(R.id.tv_comment_time);
- tv_content = findViewById(R.id.tv_comment_content);
- tv_good = findViewById(R.id.item_good_comment);
- head = findViewById(R.id.comment_friend_icon);
- btn_reply = findViewById(R.id.btn_comm);
- repy_content = findViewById(R.id.ed_comm);
- nineGridView = findViewById(R.id.comm_nine);
- area_commit=findViewById(R.id.area_commit);
- back_deal=findViewById(R.id.back_deal);
- et_reply=findViewById(R.id.comm_repy);
- ly_opte = findViewById(R.id.ly_opte);
- comm_share=findViewById(R.id.comm_share);
- comm_del=findViewById(R.id.comm_del);
- tv_name.setText(getIntent().getStringExtra("username"));
- tv_time.setText(getIntent().getStringExtra("time"));
- tv_content.setText(getIntent().getStringExtra("content"));
- String headurl = getIntent().getStringExtra("head");
- tv_good.setText(getIntent().getStringExtra("goods"));
- obj = getIntent().getStringExtra("obj");
- if (getIntent().getStringExtra("isHaven").equals("true")){
- isHaven=true;
- }
- post.setObjectId(obj);
- Glide.with(CommentActivity.this).load(headurl).into(head);
- user = BmobUser.getCurrentUser(User.class);
-
- if (getIntent().getStringArrayListExtra("infoList") == null) {
- nineGridView.setVisibility(View.GONE);
- } else {
- picList = getIntent().getStringArrayListExtra("infoList");
- initPics(picList);
- }
-
- findComments();
- adapter = new CommentAdapter(list, this);
- listView.setAdapter(adapter);
- btn_reply.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- //评论
- String content = repy_content.getText().toString();
- publishComment(content);
- }
- });
-
- }
- void initListener(){
- et_reply.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- reply2();
- }
- });
- tv_good.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- updates();//点赞
- }
- });
- back_deal.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- CommentActivity.this.finish();//关闭详情页
- }
- });
- comm_share.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- share();
- }
- });
- comm_del.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- //删除帖子
- del();
- }
- });
- }
- private void toast(String date) {
- Toast.makeText(this, date, Toast.LENGTH_SHORT).show();
- }
-
-
- private void publishComment(String content) {
-
- if (user == null) {
- toast("发表评论前请先登陆");
- return;
- } else if (TextUtils.isEmpty(content)) {
- toast("发表评论不能为空");
- return;
- }
- showDialog_com();
- final Comment comment = new Comment();
-
- comment.setContent(content);
- comment.setPost(post);
- comment.setUser(user);
- comment.setName(user.getUsername());
- comment.setTime(getTime());
- comment.setUserHead(user.getHead());
- comment.save(new SaveListener() {
- @Override
- public void done(String s, BmobException e) {
- if (e == null) {
- al.dismiss();
- findComments();
- toast("评论成功");
- adapter.notifyDataSetInvalidated();
-
- repy_content.setText("");
- } else {
- toast(e.toString());
- al.dismiss();
- }
- }
- });
-
- }
-
- /*
- 查询评论
- */
- private void findComments() {
- showDialog();
- BmobQuery query = new BmobQuery();
- list.clear();
- Post post = new Post();
- post.setObjectId(obj);
- query.addWhereEqualTo("post", new BmobPointer(post));
- query.include("user,,author,post.author,comment.time,comment.user");
- query.findObjects(new FindListener() {
- @Override
- public void done(List arg0, BmobException e) {
- if (e == null) {
-
- list.addAll(arg0);
- //com_num = list.size();
- al.dismiss();
- adapter.notifyDataSetInvalidated();
-
- } else {
- al.dismiss();
- toast("查询评论失败" + e.toString());
- adapter.notifyDataSetChanged();
- }
- }
- });
- }
-
- /*
- 获取时间
- */
- public String getTime() {
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日 hh点");
- Date curDate = new Date(System.currentTimeMillis());//获取当前时间
- return formatter.format(curDate);
- }
-
- private void showDialog_com() {
- LayoutInflater inflater = getLayoutInflater();
- al = new AlertDialog.Builder(this)
- .setTitle("回复评论中...")
- .setView(R.layout.dialog_com)
- .show();
-
- }
- /*
- 隐藏输入框
- */
- private void hideSoftInput(){
- InputMethodManager imm = (InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE);
-
- imm.hideSoftInputFromWindow(ed_comm.getWindowToken(), 0);
- }
- /*
- 加载帖子图片集合
- */
- public void initPics(List picList) {
-
- if (picList.size() > 0) {//判断是否有图片
- ArrayList imageInfo = new ArrayList<>();
- for (int j = 0; j < picList.size(); j++) {
- ImageInfo info = new ImageInfo();
- info.setThumbnailUrl(picList.get(j));
- info.setBigImageUrl(picList.get(j));
- imageInfo.add(info);
- }
- nineGridView.setAdapter(new NineGridViewClickAdapter(CommentActivity.this, imageInfo));
- } else {
- nineGridView.setVisibility(View.GONE);
- }
- }
- /*
- 弹出输入框
- */
- public void reply2(){
- repy_content.requestFocus();
- InputMethodManager imm = (InputMethodManager) repy_content.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
- }
- /*
- 删除帖子
- */
- private void del(){
- Post p = new Post();
- p.setObjectId(obj);
- if (this.user.getObjectId().equals(auhthor_url)){
- p.delete(new UpdateListener() {
- @Override
- public void done(BmobException e) {
- if(e==null){
- toast("删除成功");
- CommentActivity.this.finish();
- }else{
- toast("失败:"+e.getMessage()+","+e.getErrorCode());
- }
- }
- });
- }else {
- toast("您无权限删除别人发的帖子哦");
- }
-
-
- }
-
-
- /*
- 获取帖子作者信息objid
- */
- public void getUrl() {
- final String[] obj_info = {""};
- final BmobQuery query = new BmobQuery();
- query.addWhereEqualTo("username", tv_name.getText().toString());
- query.findObjects(new FindListener() {
- @Override
- public void done(List list, BmobException e) {
- al.dismiss();
- for (BmobUser data : list) {
- obj_info[0] = data.getObjectId();
- auhthor_url = obj_info[0];
- }
- }
-
- });
- }
- /*
- 点赞
- */
- public void updates() {
- Post post = new Post();
- post.setObjectId(obj);
- // TODO Auto-generated method stub
- post.increment("praise");
- //不知道什么原因点赞后图片会显消失,所以标记一下
- post.setHaveIcon(isHaven);
- post.update(new UpdateListener() {
- @Override
- public void done(BmobException e) {
- if (e == null) {
- toast("点赞成功!");
-
- } else {
- toast("点赞失败!");
- }
- }
- });
-
- }
- /*
- 分享
- */
- public void share(){
- Intent intent=new Intent(Intent.ACTION_SEND);
- intent.setType("text/*");
- intent.putExtra(Intent.EXTRA_SUBJECT, "分享");
- intent.putExtra(Intent.EXTRA_TEXT,tv_content.getText().toString() +"_"+tv_name.getText()+"_ _来自朋友圈");
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(Intent.createChooser(intent, "分享"));
- }
-
- /*
- 加载框
- */
- private void showDialog() {
- // 首先得到整个View
- LayoutInflater inflater = getLayoutInflater();
- al = new AlertDialog.Builder(this)
- .setCancelable(false)
- .setTitle("数据装载中...")
- .setView(R.layout.dialog_com)
- .setCancelable(true)
- .show();
-
- }
-
- @Override
- public void onClick(View view) {
- switch(view.getId()){
- case R.id.ed_comm:
- reply2();
- break;
- }
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/voice/EditActivity.java b/database/v/app/src/main/java/com/example/cici/voice/EditActivity.java
deleted file mode 100644
index e74a298..0000000
--- a/database/v/app/src/main/java/com/example/cici/voice/EditActivity.java
+++ /dev/null
@@ -1,273 +0,0 @@
-package com.example.cici.voice;
-
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.BaseAdapter;
-import android.widget.EditText;
-import android.widget.GridView;
-import android.widget.ImageView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.example.cici.voice.R;
-import com.example.cici.bean.Post;
-import com.example.cici.utils.CircleTransform;
-import com.example.cici.utils.ImageLoader;
-import com.lzy.imagepicker.ImagePicker;
-import com.lzy.imagepicker.bean.ImageItem;
-import com.lzy.imagepicker.ui.ImageGridActivity;
-import com.lzy.ninegrid.ImageInfo;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import cn.bmob.v3.BmobUser;
-import cn.bmob.v3.datatype.BmobFile;
-import cn.bmob.v3.exception.BmobException;
-import cn.bmob.v3.listener.SaveListener;
-import cn.bmob.v3.listener.UploadBatchListener;
-
-
-public class EditActivity extends AppCompatActivity {
- private EditText et_send;
- private GridView publishGridView;
- private GridAdapter gridAdapter;
- private TextView tv_upload,tv_cancle;
- private int size = 0;
- private String content;
- private BmobUser user;
- private ArrayList imageItems;
- ProgressDialog dialog = null;//进度条
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.layout_edit);
-
- intiView();
- }
-
- private void intiView() {
- et_send= (EditText) findViewById(R.id.et_content);
- tv_upload= (TextView) findViewById(R.id.tv_send);
- tv_cancle=findViewById(R.id.tv_cancle);
- user=BmobUser.getCurrentUser();
- publishGridView= (GridView) findViewById(R.id.publishGridView);
- gridAdapter = new GridAdapter();
- publishGridView.setAdapter(gridAdapter);
-
- findViewById(R.id.tv_send).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- content = et_send.getText().toString();
-
- if (content.length() < 1 && size == 0) {
- toast("发表不能为空");
- } else {
- tv_upload.setEnabled(false);
-
-
- tv_upload_database();
-
- }
- }
- });
- tv_cancle.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- EditActivity.this.finish();
- }
- });
- }
-
- /**
- * 上传图片
- */
- private void tv_upload_database() {
- //隐藏软硬盘
- InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
-
- toast("发布中...");
- String username=user.getUsername();
- final Post post = new Post();
- post.setContent(content);
- post.setUserName(username);
- post.setPraise(0);
- post.setTime(getTime());
- post.setUserIcon(getIntent().getStringExtra("headUrl"));
- if (size == 0) {
- post.setHaveIcon(false);
- post.save(new SaveListener() {
- @Override
- public void done(String s, BmobException e) {
- if(e==null)
- {
- et_send.setText("");
- toast("yes!发表成功");
- finish();
-
- }else {
- toast("失败"+e.toString());
- }
- }
- });
- return;
- }
- size = 0;
- final String[] filePaths = new String[imageItems.size()];
- for (int i = 0; i < imageItems.size(); i++) {
- filePaths[i] = imageItems.get(i).path;
- }
- dialog = new ProgressDialog(EditActivity.this);
- dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
- dialog.setTitle("上传图片中...");
- dialog.setIndeterminate(false);
- dialog.setCancelable(true);
- dialog.setCanceledOnTouchOutside(false);
- dialog.show();
- BmobFile.uploadBatch(filePaths, new UploadBatchListener() {
- @Override
- public void onSuccess(List list, List list1) {
- if (list1.size() == filePaths.length) {//如果数量相等,则代表文件全部上传完成
- post.setHeadImgUrl(list1);
- post.setHaveIcon(true);
- post.save(new SaveListener() {
- @Override
- public void done(String s, BmobException e) {
-
- if (e == null) {
- toast("发表成功");
- finish();
-
- }
- }
- });
- }
- }
-
- @Override
- public void onProgress(int i, int i1, int i2, int i3) {
- dialog.setProgress(i2);
- }
-
- @Override
- public void onError(int i, String s) {
- dialog.dismiss();
- }
- });
-
- }
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
- if (data != null && requestCode == 100) {
- ArrayList imageInfo = new ArrayList<>();
- imageItems = (ArrayList) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
- gridAdapter.notifyDataSetChanged();
- size=imageItems.size();
- } else {
- toast("没有选择图片");
- }
- }
- }
- private class GridAdapter extends BaseAdapter {
- public GridAdapter() {
- }
-
- @Override
- public int getCount() {
- if (imageItems == null)
- return 1;
- else
- return imageItems.size()+1;
- }
-
- @Override
- public Object getItem(int i) {
- return imageItems.get(i);
- }
-
- @Override
- public long getItemId(int i) {
- return i;
- }
-
- @Override
- public View getView(final int i, View view, ViewGroup viewGroup) {
- GridAdapter.ViewHolder holder = null;
- if (view == null) {
- holder = new GridAdapter.ViewHolder();
- view = LayoutInflater.from(EditActivity.this).inflate(R.layout.grid_layout, null);
- holder.image_voice = (ImageView) view.findViewById(R.id.gird_img);
- view.setTag(holder);
- } else {
- holder = (GridAdapter.ViewHolder) view.getTag();
- }
- if (imageItems == null) {
- holder.image_voice.setImageResource(R.mipmap.add_icon);
- } else {
- if (i == imageItems.size()) {
- holder.image_voice.setImageResource(R.mipmap.add_icon);
- } else {
- File file = new File(imageItems.get(i).path);
- if (file.exists()) {
- Bitmap bm = BitmapFactory.decodeFile(imageItems.get(i).path);
- holder.image_voice.setImageBitmap(CircleTransform.centerSquareScaleBitmap(bm,100));
- }
- }
- }
- holder.image_voice.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if ((imageItems != null && i == imageItems.size()) || imageItems == null) {
- addImage();
- }
- }
- });
- return view;
- }
-
- class ViewHolder {
- private ImageView image_voice;
- }
- }
- /**
- * 添加图片哦
- */
- private void addImage() {
- ImagePicker imagePicker = ImagePicker.getInstance();
- imagePicker.setImageLoader(new ImageLoader());
- imagePicker.setMultiMode(true); //多选
- imagePicker.setShowCamera(true); //显示拍照按钮
- imagePicker.setSelectLimit(6); //最多选择X张
- imagePicker.setCrop(false); //不进行裁剪
- Intent intent = new Intent(EditActivity.this, ImageGridActivity.class);
- startActivityForResult(intent, 100);
- }
- /*
- 获取时间
- */
- public String getTime() {
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
- Date curDate = new Date(System.currentTimeMillis());//获取当前时间
- return formatter.format(curDate);
- }
- //Toast
- private void toast(String date){
- Toast.makeText(this, date, Toast.LENGTH_SHORT).show();
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/voice/LoginActivity.java b/database/v/app/src/main/java/com/example/cici/voice/LoginActivity.java
deleted file mode 100644
index 7d5b011..0000000
--- a/database/v/app/src/main/java/com/example/cici/voice/LoginActivity.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package com.example.cici.voice;
-
-import android.content.Intent;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.Toast;
-
-import com.example.cici.voice.R;
-import com.example.cici.bean.User;
-
-import java.util.List;
-
-import cn.bmob.v3.BmobQuery;
-import cn.bmob.v3.BmobUser;
-import cn.bmob.v3.exception.BmobException;
-import cn.bmob.v3.listener.FindListener;
-import cn.bmob.v3.listener.SaveListener;
-
-public class LoginActivity extends AppCompatActivity {
- private EditText log_user,log_pasd;
- private BmobUser user;
- private Button btn_log,btn_reg;
- String name,password;
- boolean ishave=false;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_login);
- log_user = (EditText) findViewById(R.id.et_username);
- log_pasd = (EditText) findViewById(R.id.et_pwd);
- btn_log=findViewById(R.id.btn_login);
- user=BmobUser.getCurrentUser();
- if (user!=null){
- Intent intent = new Intent();
- intent.setClass(LoginActivity.this, MainActivity.class);
- startActivity(intent);
- finish();
- }
- btn_log.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- login();
- }
- });
-
- }
-
-
- public void toast(String msg) {
- Toast.makeText(LoginActivity.this, msg, Toast.LENGTH_SHORT).show();
- }
- private void login() {
- // TODO Auto-generated method stub
- name=log_user.getText().toString();
- password=log_pasd.getText().toString();
- if (name.isEmpty()) {
- toast("用户名为空");
- return;
- }
- if (password.isEmpty()) {
- toast("密码为空");
- return;
- }
- // isChecked = true;
-
-
- User user = new User();
- user.setUsername(name);
- user.setPassword(password);
- user.login(new SaveListener() {
- @Override
- public void done(BmobUser bmobUser, BmobException e) {
- if(e==null){
- toast("登录成功!");
- Intent intent = new Intent();
- intent.setClass(LoginActivity.this, MainActivity.class);
- startActivity(intent);
- finish();
- }else{
- toast("登录失败! " + e.toString());
- }
- }
- });
-
-
-
- }
- public void OnMyRegistClick(View v) {
- Intent intent=new Intent(LoginActivity.this,RegisterActivity.class);
- //intent.putExtra("info", "No66778899");
- LoginActivity.this.startActivity(intent);
- }
-
- /**
- * Jump to reset password interface
- * @param
- */
- /* public void OnMyResPwdClick(View v){
- Intent intent=new Intent(LoginActivity.this,ResPwdActivity.class);
- LoginActivity.this.startActivity(intent);
- }*/
-
-
- private boolean isHaveUser(String user){
-
- BmobQuery query = new BmobQuery();
- query.addWhereEqualTo("username", user);
- query.findObjects(new FindListener() {
- @Override
- public void done(List object, BmobException e) {
- if(e==null){
- toast("查询用户成功:"+object.size());
-
- ishave=true;
- }else{
- toast("查询用户信息失败:" + e.getMessage());
- }
- }
- });
- return ishave;
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/voice/MainActivity.java b/database/v/app/src/main/java/com/example/cici/voice/MainActivity.java
deleted file mode 100644
index 6343bf9..0000000
--- a/database/v/app/src/main/java/com/example/cici/voice/MainActivity.java
+++ /dev/null
@@ -1,410 +0,0 @@
-package com.example.cici.voice;
-
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.graphics.Color;
-import android.support.v4.widget.SwipeRefreshLayout;
-import android.support.v7.app.AlertDialog;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewTreeObserver;
-import android.widget.AdapterView;
-import android.widget.ImageView;
-import android.widget.RelativeLayout;
-import android.widget.Toast;
-
-import com.bumptech.glide.Glide;
-import com.example.cici.adapter.MyAdapter;
-import com.example.cici.bean.Post;
-import com.example.cici.bean.User;
-import com.example.cici.utils.GradScrollView;
-import com.example.cici.utils.ImageLoader;
-import com.example.cici.utils.MyListview;
-import com.lzy.imagepicker.ImagePicker;
-import com.lzy.imagepicker.bean.ImageItem;
-import com.lzy.imagepicker.ui.ImageGridActivity;
-import com.lzy.ninegrid.ImageInfo;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import cn.bmob.v3.BmobQuery;
-import cn.bmob.v3.BmobUser;
-import cn.bmob.v3.datatype.BmobFile;
-import cn.bmob.v3.exception.BmobException;
-import cn.bmob.v3.listener.FindListener;
-import cn.bmob.v3.listener.QueryListener;
-import cn.bmob.v3.listener.UpdateListener;
-import cn.bmob.v3.listener.UploadFileListener;
-
-public class MainActivity extends AppCompatActivity implements View.OnClickListener, GradScrollView.ScrollViewListener {
-
- private ImageView backGroundImg;
- private GradScrollView scrollView;
- private RelativeLayout spaceTopChange;
- private int height;
- private MyAdapter adapter;
- private List list;
- private MyListview lv;
- private SwipeRefreshLayout refresh;
- private AlertDialog al;
- private com.makeramen.roundedimageview.RoundedImageView userIcon;
- private String headUrl = "";
- private ArrayList imageItems;
- private BmobUser user;
- private String head_url_res = "";//获得后的头像url
- private String post_obj = "123";//查询帖子用户obiId
- private String post_head = "1234";//查询帖子用户头像地址url
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- intiView();
- intiData(0);
- getUserInfo();
- initListeners();
- lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
- intentToComm(i);
- }
- });
- }
-
-
- /**
- * 初始化控件
- */
- private void intiView() {
-
- findViewById(R.id.add).setOnClickListener(this);
- findViewById(R.id.back).setOnClickListener(this);
- lv = (MyListview) findViewById(R.id.lv);
- userIcon = findViewById(R.id.userIcon);
- user = BmobUser.getCurrentUser();
- backGroundImg = (ImageView) findViewById(R.id.headBkg);
- backGroundImg.setFocusable(true);
- backGroundImg.setFocusableInTouchMode(true);
- backGroundImg.requestFocus();
- scrollView = (GradScrollView) findViewById(R.id.scrollview);
- spaceTopChange = (RelativeLayout) findViewById(R.id.spaceTopChange);
- list = new ArrayList<>();
- adapter = new MyAdapter(MainActivity.this, list);
- lv.setAdapter(adapter);
- //点击头像的处理,我这里是注销与切换用户,我下边写了更换头像的方法,根据自己情况选择
- userIcon.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- quit();
- }
- });
-
- }
-
- /**
- * 查询数据
- */
- private void intiData(int tag) {
- if (tag == 0) {
- showDialog();
- }
-
- list.clear();
- BmobQuery query = new BmobQuery<>();
- query.order("-createdAt");
- query.setLimit(20);
- query.findObjects(new FindListener() {
- @Override
- public void done(List lists, BmobException e) {
- if (e == null) {
-
- /* for (int i=0;i 0 && y <= height - 10) { //滑动距离小于banner图的高度时,设置背景和字体颜色颜色透明度渐变
- float scale = (float) y / height;
- float alpha = (255 * scale);
- spaceTopChange.setBackgroundColor(Color.argb((int) alpha, 130, 117, 140));
- } else { //滑动到banner下面设置普通颜色
- spaceTopChange.setBackgroundColor(Color.parseColor("#584f60"));
- }
- }
-/*
- 传递数据到详情页
- */
-public void intentToComm(int i){
- //传递数据到评论页面
- Intent intent = new Intent(MainActivity.this, CommentActivity.class);
- intent.putExtra("username", list.get(i).getUserName());
- intent.putExtra("content", list.get(i).getContent());
- intent.putExtra("time", list.get(i).getCreatedAt());
- intent.putExtra("head", list.get(i).getUserIcon());
- Boolean isHaven=list.get(i).isHaveIcon();
- if (isHaven){
- intent.putExtra("isHaven","true");
- }else {
- intent.putExtra("isHaven","false");
- }
-
- String good = list.get(i).getPraise().toString();
- intent.putExtra("goods", good);
-
- //如果帖子没有图片就做处理 传入空
- if (list.get(i).getHeadImgUrl() != null) {
- intent.putStringArrayListExtra("infoList", (ArrayList) list.get(i).getHeadImgUrl());
- } else {
- intent.putStringArrayListExtra("infoList", null);
-
- }
- intent.putExtra("obj", list.get(i).getObjectId());
- // intent.putExtra("urlList", (Parcelable) list.get(i).getHeadImgUrl());
-
- startActivity(intent);
-}
- public void showDialog() {
- LayoutInflater inflater = getLayoutInflater();
-
- al = new AlertDialog.Builder(this)
- .setTitle("提示")
- .setView(R.layout.dialog)
-
- .show();
-
- }
-
- /**
- * 添加头像哦 这个自己按情况选择是否使用
- */
- private void addHead() {
- ImagePicker imagePicker = ImagePicker.getInstance();
- imagePicker.setImageLoader(new ImageLoader());
- imagePicker.setMultiMode(false); //多选
- imagePicker.setSelectLimit(1); //最多选择X张
- imagePicker.setCrop(true); //不进行裁剪
- Intent intent = new Intent(MainActivity.this, ImageGridActivity.class);
- startActivityForResult(intent, 100);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
- if (data != null && requestCode == 100) {
- ArrayList imageInfo = new ArrayList<>();
- imageItems = (ArrayList) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
- changeHead();
- } else {
- toast("没有选择图片");
- }
- }
- }
-
- /*
- 获取图片url然后上传
- */
- public void changeHead() {
- final String[] filePaths = new String[imageItems.size()];
- for (int i = 0; i < imageItems.size(); i++) {
- filePaths[i] = imageItems.get(i).path;
- headUrl = filePaths[0];
- final User users = new User();
- final BmobFile bmobFile = new BmobFile(new File(headUrl));
- bmobFile.uploadblock(new UploadFileListener() {
-
- @Override
- public void done(BmobException e) {
- if (e == null) {
- users.setHead(bmobFile.getFileUrl());
- users.update(user.getObjectId(), new UpdateListener() {
- @Override
- public void done(BmobException e) {
- if (e == null) {
- toast("修改成功");
-
- }
- }
- });
- } else {
- toast("上传失败:" + e.getMessage());
- }
-
- }
-
- @Override
- public void onProgress(Integer value) {
- // 返回的上传进度(百分比)
- }
- });
-
-
- }
-
- }
-
- /*
- 获取用户信息
- */
- public void getUserInfo() {
- BmobQuery query = new BmobQuery();
- query.getObject(user.getObjectId(), new QueryListener() {
-
- @Override
- public void done(User object, BmobException e) {
- if (e == null) {
- //获得USER的信息
- head_url_res = object.getHead();
- Glide.with(MainActivity.this).load(object.getHead()).into(userIcon);
-
- } else {
-
- }
- }
-
- });
- }
-
- /*
- 根据用户名查询id
- */
- public String queryHeadByName(String usernameq) {
- final String[] res = {""};
- BmobQuery query = new BmobQuery();
- query.addWhereEqualTo("username", usernameq);
- query.findObjects(new FindListener() {
- @Override
- public void done(List object, BmobException e) {
- if (e == null) {
- res[0] = object.get(0).getObjectId();
-
- } else {
- toast("更新用户信息失败:" + e.getMessage());
- }
- }
- });
-
- return res[0];
- }
-
- /*
- 根据用户id获取头像
- */
- public String getHeadUrl(String objId) {
- final String[] res_head = {""};
- BmobQuery query = new BmobQuery();
- query.getObject(objId, new QueryListener() {
-
- @Override
- public void done(User object, BmobException e) {
- if (e == null) {
- //获得USER的信息
- res_head[0] = object.getHead();
-
-
- } else {
-
- }
- }
-
- });
- return res_head[0];
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- intiData(1);
- }
-
- //Toast
- private void toast(String date) {
- Toast.makeText(this, date, Toast.LENGTH_SHORT).show();
- }
- /*
- 注销操作
- */
- public void quit(){
- al = new AlertDialog.Builder(this)
- .setTitle("确定注销吗")
- .setPositiveButton("确定", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- BmobUser.logOut(); //清除缓存用户对象
- toast("注销成功");
- Intent intent = new Intent();
- intent.setClass(MainActivity.this, LoginActivity.class);
- startActivity(intent);
- finish();
- }
- })
- .setNegativeButton("取消",null)
- .show();
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/voice/RegisterActivity.java b/database/v/app/src/main/java/com/example/cici/voice/RegisterActivity.java
deleted file mode 100644
index c10d041..0000000
--- a/database/v/app/src/main/java/com/example/cici/voice/RegisterActivity.java
+++ /dev/null
@@ -1,348 +0,0 @@
-package com.example.cici.voice;
-
-import java.util.Calendar;
-
-import android.content.Intent;
-import android.os.Handler;
-import android.os.Message;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.ImageView;
-import android.widget.RadioButton;
-import android.text.TextUtils;
-import android.widget.TextView;
-import android.widget.Toast;
-import android.util.Log;
-import android.widget.DatePicker;
-import android.app.DatePickerDialog;
-import android.app.DatePickerDialog.OnDateSetListener;
-
-import com.bumptech.glide.Glide;
-import com.example.cici.voice.R;
-import com.example.cici.bean.User;
-import com.example.cici.utils.ImageLoader;
-import com.example.cici.utils.TimeCountUtil;
-import com.lzy.imagepicker.ImagePicker;
-import com.lzy.imagepicker.bean.ImageItem;
-import com.lzy.imagepicker.ui.ImageGridActivity;
-import com.lzy.ninegrid.ImageInfo;
-
-import java.io.File;
-import java.util.ArrayList;
-
-import cn.bmob.v3.datatype.BmobFile;
-import cn.bmob.v3.exception.BmobException;
-import cn.bmob.v3.listener.SaveListener;
-import cn.bmob.v3.listener.UploadFileListener;
-
-import cn.smssdk.EventHandler;
-import cn.smssdk.SMSSDK;
-
-public class RegisterActivity extends AppCompatActivity implements View.OnClickListener{
- private EditText reg_user,reg_pasd;
- String name,password,male,famale,birthday;
- private String head_url_res = "";//获得后的头像url
- private ImageView userIcon;
- private ArrayList imageItems;
- private EditText edit_phone;
- private EditText edit_cord;
- private EditText editPwd;
- private EditText editName;
- private TextView now;
- private Button btn_getCord;
- private Button btn_register;
- private RadioButton mMaleRb;
- private RadioButton mFamaleRb;
- private String phone_number;
- private String cord_number;
- EventHandler eventHandler;
- private TimeCountUtil mTimeCountUtil;
- private int time=60;
- private boolean flag=true;
- private TextView tvShowDialog;
- private Calendar cal;
- private int year,month,day;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.regist);
- getDate();
-
- getId();
-
- mTimeCountUtil = new TimeCountUtil(btn_getCord, 60000, 1000);
- eventHandler = new EventHandler() {
- public void afterEvent(int event, int result, Object data) {
- Message msg=new Message();
- msg.arg1=event;
- msg.arg2=result;
- msg.obj=data;
- handler.sendMessage(msg);
- }
- };
-
- SMSSDK.registerEventHandler(eventHandler);
-
- }
-
-
- private void getDate() {
- cal=Calendar.getInstance();
- year=cal.get(Calendar.YEAR); //获取年月日时分秒
- Log.i("wxy","year"+year);
- month=cal.get(Calendar.MONTH); //获取到的月份是从0开始计数
- day=cal.get(Calendar.DAY_OF_MONTH);
- }
-
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- SMSSDK.unregisterEventHandler(eventHandler);
- }
-
- /**
- * 使用Handler来分发Message对象到主线程中,处理事件
- */
- Handler handler=new Handler()
- {
- @Override
- public void handleMessage(Message msg) {
- super.handleMessage(msg);
- int event=msg.arg1;
- int result=msg.arg2;
- Object data=msg.obj;
- if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
- if(result == SMSSDK.RESULT_COMPLETE) {
- boolean smart = (Boolean)data;
- if(smart) {
- Toast.makeText(getApplicationContext(),"该手机号已经注册过,请重新输入",
- Toast.LENGTH_LONG).show();
- edit_phone.requestFocus();
- return;
- }
- }
- }
- if(result==SMSSDK.RESULT_COMPLETE)
- {
-
- if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
- Toast.makeText(getApplicationContext(), "验证码输入正确",
- Toast.LENGTH_LONG).show();
- changeHead();
- }
- }
- else
- {
- if(flag)
- {
- btn_getCord.setVisibility(View.VISIBLE);
- Toast.makeText(getApplicationContext(),"验证码获取失败请重新获取", Toast.LENGTH_LONG).show();
- edit_phone.requestFocus();
- }
- else
- {
- Toast.makeText(getApplicationContext(),"验证码输入错误", Toast.LENGTH_LONG).show();
- }
- }
-
- }
-
- };
- private void getId()
- {
- userIcon = findViewById(R.id.reg_head);
- userIcon.setOnClickListener(this);
- edit_phone=findViewById(R.id.editPhone);
- edit_cord=findViewById(R.id.editCode);
- btn_getCord=findViewById(R.id.btnGetcord);
- btn_register=findViewById(R.id.btnRegist);
- editPwd = findViewById(R.id.editPwd);
- editName=findViewById(R.id.editName);
- mMaleRb = findViewById(R.id.male);
- mFamaleRb = findViewById(R.id.famle);
- tvShowDialog= findViewById(R.id.tvShowDialog);
- tvShowDialog.setOnClickListener(this);
- btn_getCord.setOnClickListener(this);
- btn_register.setOnClickListener(this);
- }
-
-
- public void onClick(View v)
- {
- switch (v.getId())
- {
- case R.id.btnGetcord:
- if(judPhone())//去掉左右空格获取字符串
- {
- mTimeCountUtil.start();
- SMSSDK.getVerificationCode("86",phone_number);
- edit_cord.requestFocus();
- }
- break;
- case R.id.btnRegist:
- if(judCord())
- {
- SMSSDK.submitVerificationCode("86", phone_number, cord_number);
- }
- flag=false;
- break;
- case R.id.tvShowDialog:
- OnDateSetListener listener=new OnDateSetListener() {
-
- @Override
- public void onDateSet(DatePicker arg0, int year, int month, int day) {
- tvShowDialog.setText(year+"-"+(++month)+"-"+day); //将选择的日期显示到TextView中,因为之前获取month直接使用,所以不需要+1,这个地方需要显示,所以+1
- }
- };
- DatePickerDialog dialog=new DatePickerDialog(RegisterActivity.this, 0,listener,year,month,day);//后边三个参数为显示dialog时默认的日期,月份从0开始,0-11对应1-12个月
- dialog.show();
- break;
- case R.id.reg_head:
- addHead();
- break;
- default:
- break;
- }
- }
-
- private boolean judPhone()
- {
- if(TextUtils.isEmpty(edit_phone.getText().toString().trim()))
- {
- Toast.makeText(RegisterActivity.this,"请输入您的电话号码",Toast.LENGTH_LONG).show();
- edit_phone.requestFocus();
- return false;
- }
- else if(edit_phone.getText().toString().trim().length()!=11)
- {
- Toast.makeText(RegisterActivity.this,"您的电话号码位数不正确",Toast.LENGTH_LONG).show();
- edit_phone.requestFocus();
- return false;
- }
- else
- {
- phone_number=edit_phone.getText().toString().trim();
- String num="[1][358]\\d{9}";
- if(phone_number.matches(num))
- return true;
- else
- {
- Toast.makeText(RegisterActivity.this,"请输入正确的手机号码",Toast.LENGTH_LONG).show();
- return false;
- }
- }
- }
-
- private boolean judCord()
- {
- judPhone();
- if(TextUtils.isEmpty(edit_cord.getText().toString().trim()))
- {
- Toast.makeText(RegisterActivity.this,"请输入您的验证码",Toast.LENGTH_LONG).show();
- edit_cord.requestFocus();
- return false;
- }
- else if(edit_cord.getText().toString().trim().length()!=4)
- {
- Toast.makeText(RegisterActivity.this,"您的验证码位数不正确",Toast.LENGTH_LONG).show();
- edit_cord.requestFocus();
-
- return false;
- }
- else
- {
- cord_number=edit_cord.getText().toString().trim();
- return true;
- }
-
- }
-
- /**
- * 添加头像哦
- */
- private void addHead() {
- ImagePicker imagePicker = ImagePicker.getInstance();
- imagePicker.setImageLoader(new ImageLoader());
- imagePicker.setMultiMode(false); //多选
- imagePicker.setSelectLimit(1); //最多选择X张
- imagePicker.setCrop(true); //不进行裁剪
- Intent intent = new Intent(RegisterActivity.this, ImageGridActivity.class);
- startActivityForResult(intent, 100);
- }
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
- if (data != null && requestCode == 100) {
- ArrayList imageInfo = new ArrayList<>();
- imageItems = (ArrayList) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
- String[] filePaths = new String[imageItems.size()];
- filePaths[0] = imageItems.get(0).path;
- head_url_res = filePaths[0];
- Glide.with(RegisterActivity.this).load(head_url_res).into(userIcon);
- } else {
- toast("没有选择图片");
- }
- }
- }
- /*
- 获取图片url然后上传
- */
- public void changeHead() {
- name =editName.getText().toString();
- password=editPwd.getText().toString();
- phone_number=edit_phone.getText().toString();
- birthday=tvShowDialog.getText().toString();
- male=mMaleRb.getText().toString();
- famale=mFamaleRb.getText().toString();
- final String[] filePaths = new String[imageItems.size()];
- for (int i = 0; i < imageItems.size(); i++) {
- filePaths[i] = imageItems.get(i).path;
- head_url_res = filePaths[0];
- toast("注册中请稍等...");
- final BmobFile bmobFile = new BmobFile(new File(head_url_res));
- bmobFile.uploadblock(new UploadFileListener() {
- @Override
- public void done(BmobException e) {
- if (e==null){
- User user = new User();
- user.setUsername(name);
- user.setPassword(password);
- if(mMaleRb.isChecked()) user.setSex(male);
- else user.setSex(famale);
- user.setBirthday(birthday);
- user.setPhone(phone_number);
- user.setHead(bmobFile.getFileUrl());
- user.signUp(new SaveListener() {
- @Override
- public void done(User s, BmobException e) {
- if(e==null){
- toast("注册成功:" +s.toString());
- Intent intent = new Intent();
- intent.setClass(RegisterActivity.this, MainActivity.class);
- startActivity(intent);
- finish();
- }else{
- toast("注册失败,可能用户名已存在" );
- }
- }
- });
-
- }
- }
- });
-
-
- }
-
- }
-
-
- public void toast(String msg) {
- Toast.makeText(RegisterActivity.this, msg, Toast.LENGTH_SHORT).show();
- }
-}
diff --git a/database/v/app/src/main/java/com/example/cici/voice/ResPwdActivity.java b/database/v/app/src/main/java/com/example/cici/voice/ResPwdActivity.java
deleted file mode 100644
index 739a7ef..0000000
--- a/database/v/app/src/main/java/com/example/cici/voice/ResPwdActivity.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.example.cici.voice;
-
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.Toast;
-
-import java.util.List;
-
-import cn.bmob.v3.BmobQuery;
-import cn.bmob.v3.BmobUser;
-import cn.bmob.v3.exception.BmobException;
-import cn.bmob.v3.listener.FindListener;
-
-
-public class ResPwdActivity extends AppCompatActivity {
- private EditText editUsername;
- private EditText editPwd;
- private EditText editResPwd;
- private String name,password;
- private Button btnConfirm;
- boolean ishave=false;
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.res_password);
- editUsername = findViewById(R.id.editName);
- editPwd = findViewById(R.id.editPwd);
- editResPwd = findViewById(R.id.editResPwd);
- btnConfirm = findViewById(R.id.btnConfirm);
- }
-
- /**
- * confirm event
- * @param v
- */
- public void OnMyConfirmClick(View v) {
- confirmInfo();
- }
-
- /**
- * confirm event
- */
- private void confirmInfo() {
- name=editUsername.getText().toString();
- if(TextUtils.isEmpty(editUsername.getText().toString().trim())|| TextUtils.isEmpty(editPwd.getText().toString()) || TextUtils.isEmpty(editResPwd.getText().toString())){
- Toast.makeText(this, "账号或密码不能为空!", Toast.LENGTH_SHORT).show();
- return;
- }
- if(!editPwd.getText().toString().equals(editResPwd.getText().toString())) {
- Toast.makeText(this, "输入密码不正确!", Toast.LENGTH_SHORT).show();
- return;
- }
- isHaveUser(name);
- if(ishave){
- Toast.makeText(this, "密码重置成功!", Toast.LENGTH_SHORT).show();
- this.finish();
- }
-
- else{
- new AlertDialog.Builder(this)
- .setTitle("提示")
- .setMessage("该用户不存在,请到注册界面进行注册!")
- .setPositiveButton("确定", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- setResult(RESULT_OK);
- Intent intent=new Intent(ResPwdActivity.this,RegisterActivity.class);
- ResPwdActivity.this.startActivity(intent);
- }
- })
- .setNegativeButton("取消", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- return;
- }
- })
- .show();
- }
- }
- private boolean isHaveUser(String user){
-
- BmobQuery query = new BmobQuery();
- query.addWhereEqualTo("username", user);
- query.findObjects(new FindListener() {
- @Override
- public void done(List object, BmobException e) {
- if(e==null){
-
- ishave=true;
-
- }
- }
- });
- return ishave;
- }
- public void toast(String msg) {
- Toast.makeText(ResPwdActivity.this, msg, Toast.LENGTH_SHORT).show();
- }
-}
diff --git a/database/v/app/src/main/res/layout/activity_comment.xml b/database/v/app/src/main/res/layout/activity_comment.xml
deleted file mode 100644
index 1e8e59f..0000000
--- a/database/v/app/src/main/res/layout/activity_comment.xml
+++ /dev/null
@@ -1,230 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/activity_login.xml b/database/v/app/src/main/res/layout/activity_login.xml
deleted file mode 100644
index f3c525a..0000000
--- a/database/v/app/src/main/res/layout/activity_login.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/res/layout/activity_main.xml b/database/v/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index c2bc5fd..0000000
--- a/database/v/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/res/layout/comm_item.xml b/database/v/app/src/main/res/layout/comm_item.xml
deleted file mode 100644
index cb9fef0..0000000
--- a/database/v/app/src/main/res/layout/comm_item.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/content_main.xml b/database/v/app/src/main/res/layout/content_main.xml
deleted file mode 100644
index b3c8f5b..0000000
--- a/database/v/app/src/main/res/layout/content_main.xml
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/dialog.xml b/database/v/app/src/main/res/layout/dialog.xml
deleted file mode 100644
index 89355b5..0000000
--- a/database/v/app/src/main/res/layout/dialog.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/dialog_com.xml b/database/v/app/src/main/res/layout/dialog_com.xml
deleted file mode 100644
index c6a3657..0000000
--- a/database/v/app/src/main/res/layout/dialog_com.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/res/layout/grid_layout.xml b/database/v/app/src/main/res/layout/grid_layout.xml
deleted file mode 100644
index 353696e..0000000
--- a/database/v/app/src/main/res/layout/grid_layout.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/head.xml b/database/v/app/src/main/res/layout/head.xml
deleted file mode 100644
index a9c550d..0000000
--- a/database/v/app/src/main/res/layout/head.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/item_post.xml b/database/v/app/src/main/res/layout/item_post.xml
deleted file mode 100644
index f1ec552..0000000
--- a/database/v/app/src/main/res/layout/item_post.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/layout_edit.xml b/database/v/app/src/main/res/layout/layout_edit.xml
deleted file mode 100644
index 56b3e9a..0000000
--- a/database/v/app/src/main/res/layout/layout_edit.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/login.xml b/database/v/app/src/main/res/layout/login.xml
deleted file mode 100644
index 08ee87d..0000000
--- a/database/v/app/src/main/res/layout/login.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/res/layout/main_item.xml b/database/v/app/src/main/res/layout/main_item.xml
deleted file mode 100644
index 81cf6fd..0000000
--- a/database/v/app/src/main/res/layout/main_item.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/app/src/main/res/layout/regist.xml b/database/v/app/src/main/res/layout/regist.xml
deleted file mode 100644
index 0b53e48..0000000
--- a/database/v/app/src/main/res/layout/regist.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/res/layout/res_password.xml b/database/v/app/src/main/res/layout/res_password.xml
deleted file mode 100644
index 1d94481..0000000
--- a/database/v/app/src/main/res/layout/res_password.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/database/v/app/src/main/res/mipmap-hdpi/add.png b/database/v/app/src/main/res/mipmap-hdpi/add.png
deleted file mode 100644
index 6b16138..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/add.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/add_icon.png b/database/v/app/src/main/res/mipmap-hdpi/add_icon.png
deleted file mode 100644
index 2154f66..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/add_icon.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/add_space.png b/database/v/app/src/main/res/mipmap-hdpi/add_space.png
deleted file mode 100644
index 63ed2c5..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/add_space.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/addpost.png b/database/v/app/src/main/res/mipmap-hdpi/addpost.png
deleted file mode 100644
index f5b2623..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/addpost.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/bg.png b/database/v/app/src/main/res/mipmap-hdpi/bg.png
deleted file mode 100644
index 55b574e..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/bg.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/blur.png b/database/v/app/src/main/res/mipmap-hdpi/blur.png
deleted file mode 100644
index e7adcf5..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/blur.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/camera.png b/database/v/app/src/main/res/mipmap-hdpi/camera.png
deleted file mode 100644
index d222ec3..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/camera.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/choosehead.png b/database/v/app/src/main/res/mipmap-hdpi/choosehead.png
deleted file mode 100644
index b604796..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/choosehead.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/defhead.png b/database/v/app/src/main/res/mipmap-hdpi/defhead.png
deleted file mode 100644
index 2f95c68..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/defhead.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/del.png b/database/v/app/src/main/res/mipmap-hdpi/del.png
deleted file mode 100644
index 1e56cd6..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/del.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/down_arrow.png b/database/v/app/src/main/res/mipmap-hdpi/down_arrow.png
deleted file mode 100644
index 9f66d63..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/down_arrow.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/good_black.png b/database/v/app/src/main/res/mipmap-hdpi/good_black.png
deleted file mode 100644
index 4ed3514..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/good_black.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/ic_launcher.png b/database/v/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index c133a0c..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/database/v/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index 1b52399..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/icon.png b/database/v/app/src/main/res/mipmap-hdpi/icon.png
deleted file mode 100644
index 1f1fabb..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/icon.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/left_arrow.png b/database/v/app/src/main/res/mipmap-hdpi/left_arrow.png
deleted file mode 100644
index 68f1f33..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/left_arrow.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/phone.png b/database/v/app/src/main/res/mipmap-hdpi/phone.png
deleted file mode 100644
index 94c80b4..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/phone.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/say.png b/database/v/app/src/main/res/mipmap-hdpi/say.png
deleted file mode 100644
index 6652b7e..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/say.png and /dev/null differ
diff --git a/database/v/app/src/main/res/mipmap-hdpi/shape.png b/database/v/app/src/main/res/mipmap-hdpi/shape.png
deleted file mode 100644
index e7b78b9..0000000
Binary files a/database/v/app/src/main/res/mipmap-hdpi/shape.png and /dev/null differ
diff --git a/database/v/app/src/main/res/values/colors.xml b/database/v/app/src/main/res/values/colors.xml
deleted file mode 100644
index f896bf6..0000000
--- a/database/v/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- #584f60
- #584f60
- #584f60
- #fff
- #383636
-
diff --git a/database/v/app/src/main/res/values/dimens.xml b/database/v/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 59a0b0c..0000000
--- a/database/v/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- 16dp
-
diff --git a/database/v/app/src/main/res/values/strings.xml b/database/v/app/src/main/res/values/strings.xml
deleted file mode 100644
index a3d6f41..0000000
--- a/database/v/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
- 音之轨迹
- 登录
- 忘记密码
- 开始注册
- 注册
- 重置密码
- 确认
-
diff --git a/database/v/app/src/main/res/values/styles.xml b/database/v/app/src/main/res/values/styles.xml
deleted file mode 100644
index ff60123..0000000
--- a/database/v/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/database/v/.gitignore b/recoder/.gitignore
similarity index 100%
rename from database/v/.gitignore
rename to recoder/.gitignore
diff --git a/database/v/.idea/codeStyles/Project.xml b/recoder/.idea/codeStyles/Project.xml
similarity index 100%
rename from database/v/.idea/codeStyles/Project.xml
rename to recoder/.idea/codeStyles/Project.xml
diff --git a/database/v/.idea/dbnavigator.xml b/recoder/.idea/dbnavigator.xml
similarity index 100%
rename from database/v/.idea/dbnavigator.xml
rename to recoder/.idea/dbnavigator.xml
diff --git a/database/v/.idea/gradle.xml b/recoder/.idea/gradle.xml
similarity index 100%
rename from database/v/.idea/gradle.xml
rename to recoder/.idea/gradle.xml
diff --git a/database/v/.idea/misc.xml b/recoder/.idea/misc.xml
similarity index 100%
rename from database/v/.idea/misc.xml
rename to recoder/.idea/misc.xml
diff --git a/database/v/.idea/runConfigurations.xml b/recoder/.idea/runConfigurations.xml
similarity index 100%
rename from database/v/.idea/runConfigurations.xml
rename to recoder/.idea/runConfigurations.xml
diff --git a/database/v/app/.gitignore b/recoder/app/.gitignore
similarity index 100%
rename from database/v/app/.gitignore
rename to recoder/app/.gitignore
diff --git a/recoder/app/build.gradle b/recoder/app/build.gradle
new file mode 100644
index 0000000..3b15d45
--- /dev/null
+++ b/recoder/app/build.gradle
@@ -0,0 +1,29 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 27
+ defaultConfig {
+ applicationId "com.example.mediarecorde"
+ minSdkVersion 15
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:27.1.1'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation 'com.android.support:support-v4:27.1.1'
+}
diff --git a/database/v/app/proguard-rules.pro b/recoder/app/proguard-rules.pro
similarity index 100%
rename from database/v/app/proguard-rules.pro
rename to recoder/app/proguard-rules.pro
diff --git a/database/v/app/src/androidTest/java/com/example/cici/voice/ExampleInstrumentedTest.java b/recoder/app/src/androidTest/java/com/example/mediarecorde/ExampleInstrumentedTest.java
similarity index 84%
rename from database/v/app/src/androidTest/java/com/example/cici/voice/ExampleInstrumentedTest.java
rename to recoder/app/src/androidTest/java/com/example/mediarecorde/ExampleInstrumentedTest.java
index 7650229..bd591ab 100644
--- a/database/v/app/src/androidTest/java/com/example/cici/voice/ExampleInstrumentedTest.java
+++ b/recoder/app/src/androidTest/java/com/example/mediarecorde/ExampleInstrumentedTest.java
@@ -1,4 +1,4 @@
-package com.example.cici.voice;
+package com.example.mediarecorde;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
- assertEquals("com.example.cici.voice", appContext.getPackageName());
+ assertEquals("com.example.mediarecorde", appContext.getPackageName());
}
}
diff --git a/recoder/app/src/main/AndroidManifest.xml b/recoder/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..32b362f
--- /dev/null
+++ b/recoder/app/src/main/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recoder/app/src/main/java/com/example/mediarecorde/MAdapter.java b/recoder/app/src/main/java/com/example/mediarecorde/MAdapter.java
new file mode 100644
index 0000000..0cb4ea8
--- /dev/null
+++ b/recoder/app/src/main/java/com/example/mediarecorde/MAdapter.java
@@ -0,0 +1,46 @@
+package com.example.mediarecorde;
+
+import java.util.ArrayList;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+public class MAdapter extends BaseAdapter {
+ private LayoutInflater inflater;
+ private Context mContext;
+ private ArrayList list;
+ private TextView tv;
+
+ public MAdapter(Context c, ArrayList i) {
+ this.mContext = c;
+ this.list = i;
+ inflater = LayoutInflater.from(c);
+ }
+
+ @Override
+ public int getCount() {
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return list.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ convertView = inflater.inflate(R.layout.item, null);
+ tv = (TextView) convertView.findViewById(R.id.tv);
+ tv.setText(list.get(position));
+ return convertView;
+ }
+}
diff --git a/recoder/app/src/main/java/com/example/mediarecorde/MainActivity.java b/recoder/app/src/main/java/com/example/mediarecorde/MainActivity.java
new file mode 100644
index 0000000..29e4542
--- /dev/null
+++ b/recoder/app/src/main/java/com/example/mediarecorde/MainActivity.java
@@ -0,0 +1,535 @@
+package com.example.mediarecorde;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Timer;
+import java.util.TimerTask;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.AdapterView.OnItemClickListener;
+import android.app.Activity;
+import android.media.MediaPlayer;
+import android.media.MediaPlayer.OnCompletionListener;
+import android.media.MediaRecorder;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+
+public class MainActivity extends Activity implements OnClickListener,
+ OnItemClickListener {
+ // 语音文件
+ private String fileName = null;
+ // 音频文件保存的路径
+ private String path = "";
+ // 界面控件z
+ private Button startRecord;// 开始录音
+ private Button startPlay;// 开始播放
+ private Button stopRecord;// 完成录音
+ private Button stopPlay;// 停止播放
+ private TextView time;// 计时显示
+ private ListView mListView;// 音频文件列表
+ private MAdapter mAdapter;
+ private Button delete;// 删除按钮
+ private Button pausePlay;// 暂停播放
+
+ // 语音操作对象
+ private MediaPlayer mPlayer = null;// 播放器
+ private MediaRecorder mRecorder = null;// 录音器
+ private boolean isPause = false;// 当前录音是否处于暂停状态
+ private boolean isPausePlay = false;// 当前播放器是否处于暂停状态
+ private ArrayList mList = new ArrayList();// 待合成的录音片段
+ private ArrayList list = new ArrayList();// 已合成的录音片段
+ private String deleteStr = null; // 列表中要删除的文件名
+ private Timer timer;
+ private String playFileName = null;// 选中的播放文件
+ // 相关变量
+ private int second = 0;
+ private int minute = 0;
+ private int hour = 0;
+ private View whichSelecte = null;// 记录被选中的Item
+ private long limitTime = 0;// 录音文件最短事件1秒
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ // 初始化录音列表
+ initList();
+ // 初始化控件
+ initView();
+ }
+
+ // 初始化界面
+ private void initView() {
+ delete = (Button) findViewById(R.id.delete);
+ delete.setOnClickListener(this);
+ // 对按钮的可点击事件的控制是保证不出现空指针的重点!!
+ delete.setEnabled(false);
+ pausePlay = (Button) findViewById(R.id.pausePlay);
+ pausePlay.setOnClickListener(this);
+ pausePlay.setEnabled(false);
+ startRecord = (Button) findViewById(R.id.startRecord);
+ startRecord.setOnClickListener(this);
+ stopRecord = (Button) findViewById(R.id.stopRecord);
+ stopRecord.setOnClickListener(this);
+ stopRecord.setEnabled(false);
+ startPlay = (Button) findViewById(R.id.startPlay);
+ startPlay.setOnClickListener(this);
+ startPlay.setEnabled(false);
+ stopPlay = (Button) findViewById(R.id.stopPlay);
+ stopPlay.setOnClickListener(this);
+ stopPlay.setEnabled(false);
+ time = (TextView) findViewById(R.id.time);
+ mListView = (ListView) findViewById(R.id.listview);
+ mAdapter = new MAdapter(this, list);
+ mListView.setAdapter(mAdapter);
+ mListView.setOnItemClickListener(this);
+ }
+
+ // 初始化录音列表
+ private void initList() {
+ path = Environment.getExternalStorageDirectory().getAbsolutePath()
+ + "/Anhry/" + getPackageName() + "/Record";
+ // 判断SD卡是否存在
+ if (!Environment.getExternalStorageState().equals(
+ Environment.MEDIA_MOUNTED)) {
+ Toast.makeText(this, "SD卡状态异常,无法获取录音列表!", Toast.LENGTH_LONG).show();
+ } else {
+ // 根据后缀名进行判断、获取文件夹中的音频文件
+ File file = new File(path);
+ File files[] = file.listFiles();
+ if (files != null) {
+ for (int i = 0; i < files.length; i++) {
+ if (files[i].getName().indexOf(".") >= 0) {
+ // 只取.amr .mp3
+ // .mp4 文件
+ String fileStr = files[i].getName().substring(
+ files[i].getName().indexOf("."));
+ if (fileStr.toLowerCase().equals(".mp3")
+ || fileStr.toLowerCase().equals(".amr")
+ || fileStr.toLowerCase().equals(".mp4"))
+ list.add(files[i].getName());
+ }
+ }
+ }
+ }
+ }
+
+ // 设置点击事件
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.startRecord:// 开始录音
+ // 判断SD卡是否存在
+ if (!Environment.getExternalStorageState().equals(
+ Environment.MEDIA_MOUNTED)) {
+ Toast.makeText(this, "SD卡状态异常,请检查后重试!", Toast.LENGTH_LONG)
+ .show();
+ break;
+ }
+ // 开始录音
+ startRecord();
+ // 录音计时
+ recordTime();
+ break;
+ case R.id.stopRecord:// 完成录音
+ if (isPause) {
+ // 完成录音
+ stopRecord();
+ } else {
+ // 暂停录音
+ try {
+ pauseRecord();
+ } catch (InterruptedException e) {
+ // 当一个线程处于等待,睡眠,或者占用,也就是说阻塞状态,而这时线程被中断就会抛出这类错误
+ // 上百次测试还未发现这个异常,但是需要捕获
+ e.printStackTrace();
+ }
+ }
+ break;
+ case R.id.startPlay:
+ // 播放录音
+ playRecord();
+ break;
+ case R.id.stopPlay:
+ // 停止播放
+ startPlay.setEnabled(true);
+ stopPlay.setEnabled(false);
+ startRecord.setEnabled(true);
+ pausePlay.setEnabled(false);
+ if (mPlayer != null) {
+ // 释放资源
+ // 对MediaPlayer多次使用而不释放资源就会出现MediaPlayer create faild 的异常
+ mPlayer.release();
+ mPlayer = null;
+ }
+ delete.setEnabled(true);
+ break;
+ case R.id.delete:
+ // 删除录音文件
+ deleteRecord();
+ break;
+ case R.id.pausePlay:
+ // 暂停播放
+ if (isPausePlay) {
+ pausePlay.setText("暂停播放");
+ pausePlay.setEnabled(true);
+ isPausePlay = false;
+ mPlayer.start();
+ } else {
+ if (mPlayer != null) {
+ mPlayer.pause();
+ }
+ pausePlay.setText("继续播放");
+ pausePlay.setEnabled(true);
+ isPausePlay = true;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ // 判断点击事件的时间间隔
+ // 点击速度过快,比如在同一秒中点击三次,只会产生一个录音文件,因为命名一样。
+ private boolean limitTime() {
+ limitTime = System.currentTimeMillis() - limitTime;
+ if (limitTime >= 1100) {
+ limitTime = System.currentTimeMillis();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ // 删除录音文件
+ private void deleteRecord() {
+ // 删除所选中的录音文件
+ File file = new File(playFileName);
+ if (file.exists()) {
+ file.delete();
+ list.remove(deleteStr);
+ mAdapter.notifyDataSetChanged();
+ time.setText("");
+ } else {
+ list.remove(deleteStr);
+ mAdapter.notifyDataSetChanged();
+ }
+ startPlay.setEnabled(false);
+ playFileName = null;
+ delete.setEnabled(false);
+ startRecord.setEnabled(true);
+ time.setText("您本次的录音时长为: 00:00:00");
+ }
+
+ // 播放录音
+ private void playRecord() {
+ // 对按钮的可点击事件的控制是保证不出现空指针的重点!!
+ startRecord.setEnabled(false);
+ delete.setEnabled(false);
+ stopPlay.setEnabled(true);
+ startPlay.setEnabled(false);
+ pausePlay.setEnabled(true);
+ if (mPlayer != null) {
+ mPlayer.release();
+ mPlayer = null;
+ }
+ mPlayer = new MediaPlayer();
+ // 播放完毕的监听
+ mPlayer.setOnCompletionListener(new OnCompletionListener() {
+
+ @Override
+ public void onCompletion(MediaPlayer mp) {
+ // 播放完毕改变状态,释放资源
+ mPlayer.release();
+ mPlayer = null;
+ startRecord.setEnabled(true);
+ startPlay.setEnabled(true);
+ stopPlay.setEnabled(false);
+ delete.setEnabled(true);
+ pausePlay.setEnabled(false);
+ }
+ });
+ try {
+ // 播放所选中的录音
+ mPlayer.setDataSource(playFileName);
+ mPlayer.prepare();
+ mPlayer.start();
+ } catch (Exception e) {
+ // 若出现异常被捕获后,同样要释放掉资源
+ // 否则程序会不稳定,不适合正式项目上使用
+ if (mPlayer != null) {
+ mPlayer.release();
+ mPlayer = null;
+ }
+ Toast.makeText(this, "播放失败,可返回重试!", Toast.LENGTH_LONG).show();
+ stopPlay.setEnabled(false);
+ delete.setEnabled(true);
+ pausePlay.setEnabled(false);
+ }
+ }
+
+ // 完成录音
+ private void stopRecord() {
+ mRecorder.release();
+ mRecorder = null;
+ isPause = false;
+ startRecord.setEnabled(true);
+ startRecord.setText("开始录音");
+ stopRecord.setEnabled(false);
+ timer.cancel();
+ // 最后合成的音频文件
+ fileName = path + "/" + getTime() + ".amr";
+ String fileName1 = getTime() + ".amr";
+ FileOutputStream fileOutputStream = null;
+ try {
+ fileOutputStream = new FileOutputStream(fileName);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ FileInputStream fileInputStream = null;
+ try {
+ for (int i = 0; i < mList.size(); i++) {
+ File file = new File(mList.get(i));
+ // 把因为暂停所录出的多段录音进行读取
+ fileInputStream = new FileInputStream(file);
+ byte[] mByte = new byte[fileInputStream.available()];
+ int length = mByte.length;
+ // 第一个录音文件的前六位是不需要删除的
+ if (i == 0) {
+ while (fileInputStream.read(mByte) != -1) {
+ fileOutputStream.write(mByte, 0, length);
+ }
+ }
+ // 之后的文件,去掉前六位
+ else {
+ while (fileInputStream.read(mByte) != -1) {
+
+ fileOutputStream.write(mByte, 6, length - 6);
+ }
+ }
+ }
+ list.add(fileName1);
+ mAdapter.notifyDataSetChanged();
+ } catch (Exception e) {
+ // 这里捕获流的IO异常,万一系统错误需要提示用户
+ e.printStackTrace();
+ Toast.makeText(this, "录音合成出错,请重试!", Toast.LENGTH_LONG).show();
+ } finally {
+ try {
+ fileOutputStream.flush();
+ fileInputStream.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // 录音结束 、时间归零
+ minute = 0;
+ hour = 0;
+ second = 0;
+ }
+ // 不管合成是否成功、删除录音片段
+ for (int i = 0; i < mList.size(); i++) {
+ File file = new File(mList.get(i));
+ if (file.exists()) {
+ file.delete();
+ }
+ }
+
+ }
+
+ // 暂停录音
+ private void pauseRecord() throws InterruptedException {
+ if (System.currentTimeMillis()-limitTime<1100) {
+ //录音文件不得低于一秒钟
+ Toast.makeText(this, "录音时间长度不得低于1秒钟!", Toast.LENGTH_SHORT).show();
+ return ;
+ }
+ stopRecord.setEnabled(true);
+ mRecorder.stop();
+ mRecorder.release();
+ timer.cancel();
+ isPause = true;
+ // 将录音片段加入列表
+ mList.add(fileName);
+ startRecord.setEnabled(true);
+ startRecord.setText("继续录音");
+ stopRecord.setText("完成录音");
+ }
+
+ // 开始录音
+ private void startRecord() {
+ stopRecord.setText("暂停录音");
+ startRecord.setText("录音中...");
+ startRecord.setEnabled(false);
+ startPlay.setEnabled(false);
+ stopRecord.setEnabled(true);
+ delete.setEnabled(false);
+ if (!isPause) {
+ // 新录音清空列表
+ mList.clear();
+ }
+ File file = new File(path);
+ if (!file.exists()) {
+ file.mkdirs();
+ }
+ fileName = path + "/" + getTime() + ".amr";
+ isPause = false;
+ mRecorder = new MediaRecorder();
+ mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
+ // 选择amr格式
+ mRecorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);
+ mRecorder.setOutputFile(fileName);
+ mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
+ try {
+ mRecorder.prepare();
+ } catch (Exception e) {
+ // 若录音器启动失败就需要重启应用,屏蔽掉按钮的点击事件。 否则会出现各种异常。
+ Toast.makeText(this, "录音器启动失败,请返回重试!", Toast.LENGTH_LONG).show();
+ startPlay.setEnabled(false);
+ stopPlay.setEnabled(false);
+ delete.setEnabled(false);
+ startRecord.setEnabled(false);
+ stopRecord.setEnabled(false);
+ mRecorder.release();
+ mRecorder = null;
+ this.finish();
+ }
+ if (mRecorder != null) {
+ mRecorder.start();
+ limitTime = System.currentTimeMillis();
+ }
+
+ }
+
+ // 计时器异步更新界面
+ Handler handler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ time.setText("您本次的录音时长为: "
+ + String.format("%1$02d:%2$02d:%3$02d", hour, minute,
+ second));
+ super.handleMessage(msg);
+ }
+ };
+
+ // 录音计时
+ private void recordTime() {
+ TimerTask timerTask = new TimerTask() {
+
+ @Override
+ public void run() {
+ second++;
+ if (second >= 60) {
+ second = 0;
+ minute++;
+ if (minute >= 60) {
+ minute = 0;
+ hour++;
+ }
+ }
+ handler.sendEmptyMessage(1);
+ }
+
+ };
+ timer = new Timer();
+ timer.schedule(timerTask, 1000, 1000);
+ }
+
+ // 获得当前时间
+ private String getTime() {
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日HH:mm:ss");
+ Date curDate = new Date(System.currentTimeMillis());// 获取当前时间
+ String time = formatter.format(curDate);
+ return time;
+ }
+
+ // 录音列表被点击事件
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position,
+ long id) {
+ // 屏蔽点击事件的一种方式
+ if (mRecorder == null) {
+ startPlay.setEnabled(true);
+ if (mPlayer == null || !mPlayer.isPlaying()) {
+ delete.setEnabled(true);
+ } else {
+ delete.setEnabled(false);
+ }
+ }
+ startPlay.setText("播放录音");
+ // 列表文件的选中效果
+ if (whichSelecte != null) {
+ whichSelecte
+ .setBackgroundColor(getResources().getColor(R.color.no));
+ }
+ view.setBackgroundColor(getResources().getColor(R.color.yes));
+ // 要播放文件的路径
+ playFileName = path + "/" + list.get(position);
+ // 要删除文件的名称
+ deleteStr = list.get(position);
+ whichSelecte = view;
+ time.setText(list.get(position));
+ }
+
+ // Activity被销毁的时候 释放资源
+ @Override
+ protected void onDestroy() {
+ // 删除片段
+ if (mList != null && mList.size() > 0) {
+ for (int i = 0; i < mList.size(); i++) {
+ File file = new File(mList.get(i));
+ if (file.exists()) {
+ file.delete();
+ }
+ }
+ }
+ if (null != mRecorder) {
+ mRecorder.stop();
+ mRecorder.release();
+ mRecorder = null;
+ }
+ if (null != mPlayer) {
+ mPlayer.stop();
+ mPlayer.release();
+ mPlayer = null;
+ }
+ if (timer != null) {
+ timer.cancel();
+ }
+ super.onDestroy();
+ }
+
+ // 来电暂停
+ @Override
+ protected void onPause() {
+ if (mRecorder != null) {
+ // 暂停录音
+ try {
+ pauseRecord();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (mPlayer != null) {
+ // 暂停播放
+ mPlayer.pause();
+ isPausePlay = true;
+ pausePlay.setText("继续播放");
+ pausePlay.setEnabled(true);
+ }
+ super.onPause();
+ }
+
+}
diff --git a/database/v/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/recoder/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
similarity index 100%
rename from database/v/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
rename to recoder/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
diff --git a/database/v/app/src/main/res/drawable/ic_launcher_background.xml b/recoder/app/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from database/v/app/src/main/res/drawable/ic_launcher_background.xml
rename to recoder/app/src/main/res/drawable/ic_launcher_background.xml
diff --git a/recoder/app/src/main/res/layout/activity_main.xml b/recoder/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..50b3d70
--- /dev/null
+++ b/recoder/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recoder/app/src/main/res/layout/item.xml b/recoder/app/src/main/res/layout/item.xml
new file mode 100644
index 0000000..725eb88
--- /dev/null
+++ b/recoder/app/src/main/res/layout/item.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/recoder/app/src/main/res/menu/main.xml b/recoder/app/src/main/res/menu/main.xml
new file mode 100644
index 0000000..e96be66
--- /dev/null
+++ b/recoder/app/src/main/res/menu/main.xml
@@ -0,0 +1,12 @@
+
diff --git a/database/v/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/recoder/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
similarity index 100%
rename from database/v/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to recoder/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
diff --git a/database/v/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/recoder/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
similarity index 100%
rename from database/v/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
rename to recoder/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
diff --git a/recoder/app/src/main/res/mipmap-hdpi/ic_launcher.png b/recoder/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..898f3ed
Binary files /dev/null and b/recoder/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/recoder/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/recoder/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dffca36
Binary files /dev/null and b/recoder/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/database/v/app/src/main/res/mipmap-mdpi/ic_launcher.png b/recoder/app/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-mdpi/ic_launcher.png
rename to recoder/app/src/main/res/mipmap-mdpi/ic_launcher.png
diff --git a/database/v/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/recoder/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
rename to recoder/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
diff --git a/database/v/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/recoder/app/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to recoder/app/src/main/res/mipmap-xhdpi/ic_launcher.png
diff --git a/database/v/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/recoder/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
rename to recoder/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
diff --git a/database/v/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/recoder/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to recoder/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
diff --git a/database/v/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/recoder/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
rename to recoder/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
diff --git a/database/v/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/recoder/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to recoder/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
diff --git a/database/v/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/recoder/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
similarity index 100%
rename from database/v/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
rename to recoder/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
diff --git a/recoder/app/src/main/res/values-v11/styles.xml b/recoder/app/src/main/res/values-v11/styles.xml
new file mode 100644
index 0000000..a4a95bc
--- /dev/null
+++ b/recoder/app/src/main/res/values-v11/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/recoder/app/src/main/res/values-v14/styles.xml b/recoder/app/src/main/res/values-v14/styles.xml
new file mode 100644
index 0000000..664f4f1
--- /dev/null
+++ b/recoder/app/src/main/res/values-v14/styles.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/recoder/app/src/main/res/values-w820dp/dimens.xml b/recoder/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..f3e7020
--- /dev/null
+++ b/recoder/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,10 @@
+
+
+
+ 64dp
+
+
diff --git a/recoder/app/src/main/res/values/color.xml b/recoder/app/src/main/res/values/color.xml
new file mode 100644
index 0000000..c3b89ac
--- /dev/null
+++ b/recoder/app/src/main/res/values/color.xml
@@ -0,0 +1,5 @@
+
+
+ #7DCBE7
+ #ebebeb
+
diff --git a/recoder/app/src/main/res/values/dimens.xml b/recoder/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..55c1e59
--- /dev/null
+++ b/recoder/app/src/main/res/values/dimens.xml
@@ -0,0 +1,7 @@
+
+
+
+ 16dp
+ 16dp
+
+
diff --git a/recoder/app/src/main/res/values/strings.xml b/recoder/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..259b527
--- /dev/null
+++ b/recoder/app/src/main/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+
+
+ MediaRecorde
+ Hello world!
+ Settings
+
+
diff --git a/recoder/app/src/main/res/values/styles.xml b/recoder/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..845fb57
--- /dev/null
+++ b/recoder/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
diff --git a/database/v/app/src/test/java/com/example/cici/voice/ExampleUnitTest.java b/recoder/app/src/test/java/com/example/mediarecorde/ExampleUnitTest.java
similarity index 90%
rename from database/v/app/src/test/java/com/example/cici/voice/ExampleUnitTest.java
rename to recoder/app/src/test/java/com/example/mediarecorde/ExampleUnitTest.java
index 102f00c..89d49d2 100644
--- a/database/v/app/src/test/java/com/example/cici/voice/ExampleUnitTest.java
+++ b/recoder/app/src/test/java/com/example/mediarecorde/ExampleUnitTest.java
@@ -1,4 +1,4 @@
-package com.example.cici.voice;
+package com.example.mediarecorde;
import org.junit.Test;
diff --git a/database/v/build.gradle b/recoder/build.gradle
similarity index 82%
rename from database/v/build.gradle
rename to recoder/build.gradle
index 1cdc6f2..8d3ef8e 100644
--- a/database/v/build.gradle
+++ b/recoder/build.gradle
@@ -19,8 +19,6 @@ allprojects {
repositories {
google()
jcenter()
- maven { url 'https://jitpack.io' }
- maven { url "https://raw.github.com/bmob/bmob-android-sdk/master" }
}
}
diff --git a/database/v/gradle.properties b/recoder/gradle.properties
similarity index 100%
rename from database/v/gradle.properties
rename to recoder/gradle.properties
diff --git a/database/v/gradle/wrapper/gradle-wrapper.jar b/recoder/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from database/v/gradle/wrapper/gradle-wrapper.jar
rename to recoder/gradle/wrapper/gradle-wrapper.jar
diff --git a/database/v/gradle/wrapper/gradle-wrapper.properties b/recoder/gradle/wrapper/gradle-wrapper.properties
similarity index 100%
rename from database/v/gradle/wrapper/gradle-wrapper.properties
rename to recoder/gradle/wrapper/gradle-wrapper.properties
diff --git a/database/v/gradlew b/recoder/gradlew
similarity index 100%
rename from database/v/gradlew
rename to recoder/gradlew
diff --git a/database/v/gradlew.bat b/recoder/gradlew.bat
similarity index 100%
rename from database/v/gradlew.bat
rename to recoder/gradlew.bat
diff --git a/database/v/settings.gradle b/recoder/settings.gradle
similarity index 100%
rename from database/v/settings.gradle
rename to recoder/settings.gradle
diff --git a/前端/voice文档/音之轨迹需求规格说明书.docx b/前端/voice文档/音之轨迹需求规格说明书.docx
deleted file mode 100644
index f358728..0000000
Binary files a/前端/voice文档/音之轨迹需求规格说明书.docx and /dev/null differ