parent
ac6814d061
commit
8154e129f4
@ -1,37 +0,0 @@ |
||||
package com.flurgle.camerakit.demo; |
||||
|
||||
import android.graphics.Bitmap; |
||||
import android.support.annotation.Nullable; |
||||
|
||||
import java.io.File; |
||||
import java.lang.ref.WeakReference; |
||||
|
||||
public class MediaHolder { |
||||
|
||||
private static WeakReference<File> video; |
||||
private static WeakReference<Bitmap> image; |
||||
|
||||
public static void setVideo(@Nullable File video) { |
||||
MediaHolder.video = video != null ? new WeakReference<>(video) : null; |
||||
} |
||||
|
||||
@Nullable |
||||
public static File getVideo() { |
||||
return video != null ? video.get() : null; |
||||
} |
||||
|
||||
public static void setImage(@Nullable Bitmap image) { |
||||
MediaHolder.image = image != null ? new WeakReference<>(image) : null; |
||||
} |
||||
|
||||
@Nullable |
||||
public static Bitmap getImage() { |
||||
return image != null ? image.get() : null; |
||||
} |
||||
|
||||
public static void dispose() { |
||||
setVideo(null); |
||||
setImage(null); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,49 @@ |
||||
package com.flurgle.camerakit.demo; |
||||
|
||||
import android.graphics.Bitmap; |
||||
import android.support.annotation.Nullable; |
||||
|
||||
import com.flurgle.camerakit.utils.Size; |
||||
|
||||
import java.lang.ref.WeakReference; |
||||
|
||||
public class ResultHolder { |
||||
|
||||
private static WeakReference<Bitmap> image; |
||||
private static Size nativeCaptureSize; |
||||
private static long timeToCallback; |
||||
|
||||
|
||||
public static void setImage(@Nullable Bitmap image) { |
||||
ResultHolder.image = image != null ? new WeakReference<>(image) : null; |
||||
} |
||||
|
||||
@Nullable |
||||
public static Bitmap getImage() { |
||||
return image != null ? image.get() : null; |
||||
} |
||||
|
||||
public static void setNativeCaptureSize(@Nullable Size nativeCaptureSize) { |
||||
ResultHolder.nativeCaptureSize = nativeCaptureSize; |
||||
} |
||||
|
||||
@Nullable |
||||
public static Size getNativeCaptureSize() { |
||||
return nativeCaptureSize; |
||||
} |
||||
|
||||
public static void setTimeToCallback(long timeToCallback) { |
||||
ResultHolder.timeToCallback = timeToCallback; |
||||
} |
||||
|
||||
public static long getTimeToCallback() { |
||||
return timeToCallback; |
||||
} |
||||
|
||||
public static void dispose() { |
||||
setImage(null); |
||||
setNativeCaptureSize(null); |
||||
setTimeToCallback(0); |
||||
} |
||||
|
||||
} |
@ -1,17 +1,183 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
android:layout_height="match_parent" |
||||
android:background="@android:color/white"> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical"> |
||||
|
||||
<VideoView |
||||
android:id="@+id/video" |
||||
<FrameLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" /> |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<ImageView |
||||
android:id="@+id/image" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_gravity="center_horizontal" |
||||
android:adjustViewBounds="true" /> |
||||
|
||||
</FrameLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
android:padding="16dp"> |
||||
|
||||
<FrameLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp"> |
||||
|
||||
<View |
||||
android:layout_width="2.5dp" |
||||
android:layout_height="match_parent" |
||||
android:background="@color/colorPrimary" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="10dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:text="NATIVE CAPTURE RESOLUTION" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="18dp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/nativeCaptureResolution" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="14.5dp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</FrameLayout> |
||||
|
||||
<FrameLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="24dp"> |
||||
|
||||
<View |
||||
android:layout_width="2.5dp" |
||||
android:layout_height="match_parent" |
||||
android:scaleType="centerInside" /> |
||||
android:background="@color/colorPrimary" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="10dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:text="ACTUAL RESOLUTION" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="18dp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/actualResolution" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="14.5dp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</FrameLayout> |
||||
|
||||
<FrameLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="24dp"> |
||||
|
||||
<View |
||||
android:layout_width="2.5dp" |
||||
android:layout_height="match_parent" |
||||
android:background="@color/colorPrimary" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="10dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:text="APPROX. UNCOMPRESSED SIZE" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="18dp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/approxUncompressedSize" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="14.5dp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</FrameLayout> |
||||
|
||||
<FrameLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="24dp"> |
||||
|
||||
<View |
||||
android:layout_width="2.5dp" |
||||
android:layout_height="match_parent" |
||||
android:background="@color/colorPrimary" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="10dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:text="CAPTURE LATENCY" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="18dp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/captureLatency" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="3dp" |
||||
android:textColor="@android:color/black" |
||||
android:textSize="14.5dp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</FrameLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</ScrollView> |
Loading…
Reference in new issue