Skip to content

Commit f4b1175

Browse files
author
Emre Güdür
committed
değişiklikler düzenlenecek
1 parent d9cc331 commit f4b1175

10 files changed

Lines changed: 99 additions & 5 deletions

File tree

android/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>example</name>
4+
<comment>Project android_ created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=C\:/Program Files (x86)/Java/jdk1.8.0_251
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true

android/app/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

android/app/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>app</name>
4+
<comment>Project app created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=..
2+
eclipse.preferences.version=1

example/App.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class App extends Component {
4343
}
4444

4545
UNSAFE_componentWillMount() {
46-
this.addMessage(6)
46+
this.addMessage(7)
4747
}
4848

4949
getRandomColor() {
@@ -56,7 +56,7 @@ export class App extends Component {
5656
}
5757

5858
token() {
59-
return (parseInt(Math.random() * 10 % 7));
59+
return (parseInt(Math.random() * 10 % 8));
6060
}
6161

6262
photo(size) {
@@ -97,6 +97,9 @@ export class App extends Component {
9797
mtype = 'video';
9898
status = 'sent';
9999
break;
100+
case 7:
101+
mtype = 'audio';
102+
break;
100103
default:
101104
mtype = 'text';
102105
status = 'read';
@@ -119,7 +122,7 @@ export class App extends Component {
119122
date: +new Date(),
120123
collapseTitle: loremIpsum({ count: 2, units: 'words' }),
121124
participants: Array(this.token() + 6).fill(1).map(x => ({
122-
id: parseInt(Math.random() * 10 % 6),
125+
id: parseInt(Math.random() * 10 % 7),
123126
title: loremIpsum({ count: 1, units: 'words' }),
124127
})),
125128
dataSource: Array(this.token() + 5).fill(1).map(x => ({
@@ -153,6 +156,7 @@ export class App extends Component {
153156
text: mtype === 'spotify' ? 'spotify:track:0QjjaCaXE45mvhCnV3C0TA' : loremIpsum({ count: 1, units: 'sentences' }),
154157
data: {
155158
videoURL: this.token() >= 1 ? 'https://www.w3schools.com/html/mov_bbb.mp4' : 'http://www.exit109.com/~dnn/clips/RW20seconds_1.mp4',
159+
audioURL: 'https://www.w3schools.com/html/horse.mp3',
156160
uri: `data:image/png;base64,${this.photo(150)}`,
157161
status: {
158162
click: true,

src/AudioMessage/AudioMessage.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.rce-mbox-audio {
2+
padding-bottom: 10px;
3+
}

src/AudioMessage/AudioMessage.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
3+
import './AudioMessage.css';
4+
5+
export default class AudioMessage extends React.PureComponent {
6+
render() {
7+
return (
8+
<div className={'rce-mbox-audio'}>
9+
<audio controls>
10+
<source src={this.props.audioURL} type="audio/mp3"/>
11+
Your browser does not support the audio element.
12+
</audio>
13+
</div>
14+
);
15+
}
16+
}
17+
18+
AudioMessage.defaultProps = {
19+
audioURL: null,
20+
};

src/MessageBox/MessageBox.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import SpotifyMessage from '../SpotifyMessage/SpotifyMessage';
99
import ReplyMessage from '../ReplyMessage/ReplyMessage';
1010
import MeetingMessage from '../MeetingMessage/MeetingMessage';
1111
import VideoMessage from '../VideoMessage/VideoMessage';
12+
import AudioMessage from '../AudioMessage/AudioMessage';
1213

1314
import Avatar from '../Avatar/Avatar';
1415

@@ -41,7 +42,7 @@ export class MessageBox extends React.PureComponent {
4142

4243
render() {
4344
var positionCls = classNames('rce-mbox', { 'rce-mbox-right': this.props.position === 'right' });
44-
var thatAbsoluteTime = !/(text|video|file|meeting)/g.test(this.props.type) && !(this.props.type === 'location' && this.props.text);
45+
var thatAbsoluteTime = !/(text|video|file|meeting|audio)/g.test(this.props.type) && !(this.props.type === 'location' && this.props.text);
4546

4647
const dateText = this.props.date && !isNaN(this.props.date) && (
4748
this.props.dateString ||
@@ -217,6 +218,10 @@ export class MessageBox extends React.PureComponent {
217218
onMeetingVideoLinkClick={this.props.onMeetingVideoLinkClick}
218219
onMeetingTitleClick={this.props.onMeetingTitleClick} />
219220
}
221+
{
222+
this.props.type === 'audio' &&
223+
<AudioMessage audioURL={this.props.data.audioURL}/>
224+
}
220225

221226
<div
222227
className={classNames(

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import ReplyMessage from './ReplyMessage/ReplyMessage';
1414
import MeetingItem from './MeetingItem/MeetingItem';
1515
import MeetingList from './MeetingList/MeetingList';
1616
import MeetingMessage from './MeetingMessage/MeetingMessage';
17-
17+
import AudioMessage from './AudioMessage/AudioMessage';
1818

1919
export {
2020
MessageBox,
@@ -33,4 +33,5 @@ export {
3333
MeetingItem,
3434
MeetingList,
3535
MeetingMessage,
36+
AudioMessage,
3637
};

0 commit comments

Comments
 (0)