Added PhotoQualityOption return

pull/96/head
Amadeu Cavalcante 7 years ago
parent c1de41c864
commit a0183cf45a
  1. 2
      README.md
  2. 2
      build.gradle
  3. 3
      camerafragment/src/main/java/com/github/florent37/camerafragment/CameraFragmentApi.java
  4. 10
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/BaseAnncaFragment.java
  5. 6
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/ui/model/PhotoQualityOption.java

@ -145,7 +145,7 @@ CameraFragment comes with some default views
In your module [![Download](https://api.bintray.com/packages/florent37/maven/CameraFragment/images/download.svg)](https://bintray.com/florent37/maven/CameraFragment/_latestVersion) In your module [![Download](https://api.bintray.com/packages/florent37/maven/CameraFragment/images/download.svg)](https://bintray.com/florent37/maven/CameraFragment/_latestVersion)
```groovy ```groovy
compile 'com.github.florent37:camerafragment:1.0.9' compile 'com.github.florent37:camerafragment:1.0.10'
``` ```
# Community # Community

@ -22,6 +22,6 @@ ext {
sdk = 25 sdk = 25
buildTools = "25.0.0" //keep 25.0.0 for Continuous Integration buildTools = "25.0.0" //keep 25.0.0 for Continuous Integration
minSdk = 10 minSdk = 10
libraryVersion = "1.0.9" libraryVersion = "1.0.10"
supportVersion = "25.0.0" supportVersion = "25.0.0"
} }

@ -2,6 +2,7 @@ package com.github.florent37.camerafragment;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import com.github.florent37.camerafragment.internal.ui.model.PhotoQualityOption;
import com.github.florent37.camerafragment.listeners.CameraFragmentControlsListener; import com.github.florent37.camerafragment.listeners.CameraFragmentControlsListener;
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener; import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener;
import com.github.florent37.camerafragment.listeners.CameraFragmentStateListener; import com.github.florent37.camerafragment.listeners.CameraFragmentStateListener;
@ -17,6 +18,8 @@ public interface CameraFragmentApi {
void openSettingDialog(); void openSettingDialog();
PhotoQualityOption[] getPhotoQualities();
void switchCameraTypeFrontBack(); void switchCameraTypeFrontBack();
void switchActionPhotoVideo(); void switchActionPhotoVideo();

@ -50,6 +50,7 @@ import com.github.florent37.camerafragment.listeners.CameraFragmentStateListener
import com.github.florent37.camerafragment.listeners.CameraFragmentVideoRecordTextListener; import com.github.florent37.camerafragment.listeners.CameraFragmentVideoRecordTextListener;
import java.io.File; import java.io.File;
import java.util.ArrayList;
/* /*
* Created by memfis on 12/1/16. * Created by memfis on 12/1/16.
@ -343,6 +344,15 @@ public abstract class BaseAnncaFragment<CameraId> extends Fragment implements Ca
} }
} }
public PhotoQualityOption[] getPhotoQualities() {
ArrayList<PhotoQualityOption> photoQualityOptions = new ArrayList<>();
for (CharSequence photoQualitie: photoQualities) {
photoQualityOptions.add((PhotoQualityOption) photoQualitie);
}
return photoQualityOptions.toArray(new PhotoQualityOption[photoQualityOptions.size()]);
}
@Override @Override
public void openSettingDialog() { public void openSettingDialog() {
final Context context = getContext(); final Context context = getContext();

@ -12,13 +12,19 @@ public class PhotoQualityOption implements CharSequence {
@Configuration.MediaQuality @Configuration.MediaQuality
private int mediaQuality; private int mediaQuality;
private String title; private String title;
private Size size;
public PhotoQualityOption(@Configuration.MediaQuality int mediaQuality, Size size) { public PhotoQualityOption(@Configuration.MediaQuality int mediaQuality, Size size) {
this.mediaQuality = mediaQuality; this.mediaQuality = mediaQuality;
this.size = size;
title = String.valueOf(size.getWidth()) + " x " + String.valueOf(size.getHeight()); title = String.valueOf(size.getWidth()) + " x " + String.valueOf(size.getHeight());
} }
public Size getSize() {
return size;
}
@Configuration.MediaQuality @Configuration.MediaQuality
public int getMediaQuality() { public int getMediaQuality() {
return mediaQuality; return mediaQuality;

Loading…
Cancel
Save