Skip to content

Commit

Permalink
Merge pull request #554 from jpush/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JoshLipan authored Jan 10, 2019
2 parents 4bf488e + ddf7093 commit 3e6ec12
Show file tree
Hide file tree
Showing 28 changed files with 218 additions and 138 deletions.
6 changes: 3 additions & 3 deletions Android/chatinput/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

- Gradle
```groovy
compile 'cn.jiguang.imui:chatinput:0.9.1'
compile 'cn.jiguang.imui:chatinput:0.10.0'
```

- Maven
```
<dependency>
<groupId>cn.jiguang.imui</groupId>
<artifactId>chatinput</artifactId>
<version>0.9.1</version>
<version>0.10.0</version>
<type>pom</type>
</dependency>
```
Expand All @@ -42,7 +42,7 @@ compile 'cn.jiguang.imui:chatinput:0.9.1'
```groovy
dependencies {
compile 'com.github.jpush:imui:0.9.1'
compile 'com.github.jpush:imui:0.7.7'
}
```

Expand Down
6 changes: 3 additions & 3 deletions Android/chatinput/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Provides several ways to add dependency, you can choose one of them:
- Via Gradle
```groovy
compile 'cn.jiguang.imui:chatinput:0.9.1'
compile 'cn.jiguang.imui:chatinput:0.10.0'
```

Expand All @@ -22,7 +22,7 @@ compile 'cn.jiguang.imui:chatinput:0.9.1'
<dependency>
<groupId>cn.jiguang.imui</groupId>
<artifactId>chatinput</artifactId>
<version>0.9.1</version>
<version>0.10.0</version>
<type>pom</type>
</dependency>
```
Expand All @@ -43,7 +43,7 @@ allprojects {
```groovy
dependencies {
compile 'com.github.jpush:imui:0.9.1'
compile 'com.github.jpush:imui:0.7.7'
}
```

Expand Down
10 changes: 5 additions & 5 deletions Android/chatinput/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'cn.jiguang.imui'
PUBLISH_ARTIFACT_ID = 'chatinput'
PUBLISH_VERSION = '0.9.1'
PUBLISH_VERSION = '0.10.0'
}

android {
Expand All @@ -30,16 +30,16 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
compile 'com.google.android:flexbox:0.2.5'
implementation 'com.google.android:flexbox:0.2.5'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.android.support:support-v4:27.1.0'
testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'
}

apply from: 'android-release-aar.gradle'
2 changes: 1 addition & 1 deletion Android/chatinput/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera2" />
<uses-feature android:name="android.hardware.camera2" android:required="false" />

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class ChatInputStyle extends Style {
private int sendBtnPressedIcon;
private Drawable sendCountBg;
private boolean showSelectAlbumBtn;
private float cameraQuality;

public static ChatInputStyle parse(Context context, AttributeSet attrs) {
ChatInputStyle style = new ChatInputStyle(context, attrs);
Expand Down Expand Up @@ -94,6 +95,7 @@ public static ChatInputStyle parse(Context context, AttributeSet attrs) {
style.getDimension(R.dimen.aurora_padding_input_right));
style.inputPaddingBottom = typedArray.getDimensionPixelSize(R.styleable.ChatInputView_inputPaddingBottom,
style.getDimension(R.dimen.aurora_padding_input_bottom));
style.cameraQuality = typedArray.getFloat(R.styleable.ChatInputView_cameraQuality,0.5f);
typedArray.recycle();
return style;
}
Expand Down Expand Up @@ -216,4 +218,12 @@ public int getInputPaddingBottom() {
public boolean getShowSelectAlbum() {
return this.showSelectAlbumBtn;
}

public float getCameraQuality() {
return this.cameraQuality <= 0.01f ? 0.01f : this.cameraQuality;
}

public void setCameraQuality(float cameraQuality) {
this.cameraQuality = cameraQuality;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public void run() {
mCaptureBtn.setBackgroundResource(R.drawable.aurora_preview_record_video_start);
mMediaPlayer.stop();
mMediaPlayer.release();
mCameraSupport.open(mCameraId, mWidth, mHeight, mIsBackCamera);
mCameraSupport.open(mCameraId, mWidth, mHeight, mIsBackCamera, mStyle.getCameraQuality());
} else {
for (int i = 0; i < Camera.getNumberOfCameras(); i++) {
Camera.CameraInfo info = new Camera.CameraInfo();
Expand All @@ -706,7 +706,7 @@ public void run() {
mIsBackCamera = false;
mCameraSupport.release();
mCameraSupport.open(mCameraId, mTextureView.getWidth(), mTextureView.getHeight(),
mIsBackCamera);
mIsBackCamera, mStyle.getCameraQuality());
break;
}
} else {
Expand All @@ -715,7 +715,7 @@ public void run() {
mIsBackCamera = true;
mCameraSupport.release();
mCameraSupport.open(mCameraId, mTextureView.getWidth(), mTextureView.getHeight(),
mIsBackCamera);
mIsBackCamera, mStyle.getCameraQuality());
break;
}
}
Expand Down Expand Up @@ -839,7 +839,7 @@ public void initCamera() {
}
}
if (mTextureView.isAvailable()) {
mCameraSupport.open(mCameraId, mWidth, sMenuHeight, mIsBackCamera);
mCameraSupport.open(mCameraId, mWidth, sMenuHeight, mIsBackCamera, mStyle.getCameraQuality());
} else {
mTextureView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {
@Override
Expand All @@ -848,7 +848,7 @@ public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width,
if (mCameraSupport == null) {
initCamera();
} else {
mCameraSupport.open(mCameraId, width, height, mIsBackCamera);
mCameraSupport.open(mCameraId, width, height, mIsBackCamera, mStyle.getCameraQuality());
}

}
Expand All @@ -857,7 +857,7 @@ public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width,
public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height) {
Log.d("ChatInputView", "Texture size changed, Opening camera");
if (mTextureView.getVisibility() == VISIBLE && mCameraSupport != null) {
mCameraSupport.open(mCameraId, width, height, mIsBackCamera);
mCameraSupport.open(mCameraId, width, height, mIsBackCamera, mStyle.getCameraQuality());
}
}

Expand Down Expand Up @@ -1191,7 +1191,7 @@ public void onAnimationEnd(Animator animator) {
if (hasContent) {
mSendBtn.setImageDrawable(ContextCompat.getDrawable(getContext(), mStyle.getSendBtnPressedIcon()));
} else {
mSendBtn.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.aurora_menuitem_send));
mSendBtn.setImageDrawable(ContextCompat.getDrawable(getContext(), mStyle.getSendBtnIcon()));
}
restoreAnimatorSet.start();
}
Expand Down Expand Up @@ -1530,4 +1530,9 @@ public FrameLayout getMenuContainer(){
return this.mMenuContainer;
}

public void setCameraQuality(float cameraQuality){
mStyle.setCameraQuality(cameraQuality);
}


}
Loading

0 comments on commit 3e6ec12

Please sign in to comment.