Merge pull request #96 from amadeu01/preview-available-sizes

Preview available sizes
pull/104/head
Florent CHAMPIGNY 7 years ago committed by GitHub
commit ed9c10bb3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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)
```groovy
compile 'com.github.florent37:camerafragment:1.0.9'
compile 'com.github.florent37:camerafragment:1.0.10'
```
# Community

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

@ -2,6 +2,7 @@ package com.github.florent37.camerafragment;
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.CameraFragmentResultListener;
import com.github.florent37.camerafragment.listeners.CameraFragmentStateListener;
@ -17,6 +18,8 @@ public interface CameraFragmentApi {
void openSettingDialog();
PhotoQualityOption[] getPhotoQualities();
void switchCameraTypeFrontBack();
void switchActionPhotoVideo();

@ -50,6 +50,7 @@ import com.github.florent37.camerafragment.listeners.CameraFragmentStateListener
import com.github.florent37.camerafragment.listeners.CameraFragmentVideoRecordTextListener;
import java.io.File;
import java.util.ArrayList;
/*
* 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
public void openSettingDialog() {
final Context context = getContext();

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

Loading…
Cancel
Save