Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -155,6 +155,8 @@ dependencies {
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.1.3.10' // 即时通讯基础能力库
|
||||
api 'cn.rongcloud.sdk:im_kit:5.1.3.10' // 即时通讯 UI 基础组件
|
||||
//融云小视频模块
|
||||
api 'cn.rongcloud.sdk:sight:5.1.2'
|
||||
api 'com.facebook.android:facebook-login:8.2.0'
|
||||
api 'com.facebook.android:facebook-android-sdk:[5,6)'
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
|
||||
/**
|
||||
* 消息長按彈窗
|
||||
*/
|
||||
public class MessageLongClickPopuwindow {
|
||||
private Activity mContext;
|
||||
private View popupView;
|
||||
private PopupWindow popupWindow;
|
||||
private LinearLayout copyLinear;
|
||||
|
||||
public MessageLongClickPopuwindow(Activity context) {
|
||||
this.mContext = context;
|
||||
popupView = LayoutInflater.from(mContext).inflate(R.layout.view_message_long_click, null);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,6 @@ public class MessageIMManager {
|
||||
*/
|
||||
@Override
|
||||
public boolean onMessageLongClick(Context context, View view, Message message) {
|
||||
|
||||
ToastUtil.show(message.getContent().toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.media.MediaMetadataRetriever;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -29,4 +31,45 @@ public class FileUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 视频 或 音频 时长
|
||||
* @param path 视频 或 音频 文件路径
|
||||
* @return 时长 毫秒值
|
||||
*/
|
||||
public static long getDuration(String path){
|
||||
android.media.MediaMetadataRetriever mmr = new android.media.MediaMetadataRetriever();
|
||||
long duration=0;
|
||||
try {
|
||||
if (path!= null) {
|
||||
mmr.setDataSource(path);
|
||||
}
|
||||
String time = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||
duration= Long.parseLong(time);
|
||||
} catch (Exception ex) {
|
||||
} finally {
|
||||
mmr.release();
|
||||
}
|
||||
return duration;
|
||||
}
|
||||
/**
|
||||
* Android 音乐播放器应用里,读出的音乐时长为 long 类型以毫秒数为单位,例如:将 234736 转化为分钟和秒应为 03:55 (包含四舍五入)
|
||||
* @param duration 音乐时长
|
||||
* @return
|
||||
*/
|
||||
public static String timeParse(long duration) {
|
||||
String time = "" ;
|
||||
long minute = duration / 60000 ;
|
||||
long seconds = duration % 60000 ;
|
||||
long second = Math.round((float)seconds/1000) ;
|
||||
if( minute < 10 ){
|
||||
time += "0" ;
|
||||
}
|
||||
time += minute+":" ;
|
||||
if( second < 10 ){
|
||||
time += "0" ;
|
||||
}
|
||||
time += second ;
|
||||
return time ;
|
||||
}
|
||||
}
|
||||
|
||||
77
common/src/main/res/layout/view_message_long_click.xml
Normal file
77
common/src/main/res/layout/view_message_long_click.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:cardBackgroundColor="#474747"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/copy_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_copy"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/copy"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/withdraw_linear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_copy"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/withdraw"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@mipmap/icon_message_quote"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="@string/quote"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/icon_message_copy.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_message_copy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 470 B |
BIN
common/src/main/res/mipmap-xxhdpi/icon_message_quote.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_message_quote.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user