Skip to content

Commit

Permalink
List of included changes:
Browse files Browse the repository at this point in the history
  - Move SIZE_ORIGINAL to the last option rather the default.

PiperOrigin-RevId: 374304481
Change-Id: I926a71bcd1756ba77346f1f2369b33439226b750
  • Loading branch information
Google ML Kit authored and zhouyiself committed May 18, 2021
1 parent e2d5093 commit 40ab67c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public final class StillImageActivity extends AppCompatActivity {
private static final String POSE_DETECTION = "Pose Detection";
private static final String SELFIE_SEGMENTATION = "Selfie Segmentation";

private static final String SIZE_ORIGINAL = "w:original"; // Original image size
private static final String SIZE_SCREEN = "w:screen"; // Match screen width
private static final String SIZE_1024_768 = "w:1024"; // ~1024*768 in a normal ratio
private static final String SIZE_640_480 = "w:640"; // ~640*480 in a normal ratio
private static final String SIZE_ORIGINAL = "w:original"; // Original image size

private static final String KEY_IMAGE_URI = "com.google.mlkit.vision.demo.KEY_IMAGE_URI";
private static final String KEY_SELECTED_SIZE = "com.google.mlkit.vision.demo.KEY_SELECTED_SIZE";
Expand All @@ -95,7 +95,7 @@ public final class StillImageActivity extends AppCompatActivity {
private ImageView preview;
private GraphicOverlay graphicOverlay;
private String selectedMode = OBJECT_DETECTION;
private String selectedSize = SIZE_ORIGINAL;
private String selectedSize = SIZE_SCREEN;

boolean isLandScape;

Expand Down Expand Up @@ -235,10 +235,10 @@ public void onNothingSelected(AdapterView<?> arg0) {}
private void populateSizeSelector() {
Spinner sizeSpinner = findViewById(R.id.size_selector);
List<String> options = new ArrayList<>();
options.add(SIZE_ORIGINAL);
options.add(SIZE_SCREEN);
options.add(SIZE_1024_768);
options.add(SIZE_640_480);
options.add(SIZE_ORIGINAL);

// Creating adapter for featureSpinner
ArrayAdapter<String> dataAdapter = new ArrayAdapter<>(this, R.layout.spinner_style, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class StillImageActivity : AppCompatActivity() {
private var selectedMode =
OBJECT_DETECTION
private var selectedSize: String? =
SIZE_ORIGINAL
SIZE_SCREEN
private var isLandScape = false
private var imageUri: Uri? = null
// Max width (portrait mode)
Expand Down Expand Up @@ -210,10 +210,10 @@ class StillImageActivity : AppCompatActivity() {
private fun populateSizeSelector() {
val sizeSpinner = findViewById<Spinner>(R.id.size_selector)
val options: MutableList<String> = ArrayList()
options.add(SIZE_ORIGINAL)
options.add(SIZE_SCREEN)
options.add(SIZE_1024_768)
options.add(SIZE_640_480)
options.add(SIZE_ORIGINAL)
// Creating adapter for featureSpinner
val dataAdapter =
ArrayAdapter(this, R.layout.spinner_style, options)
Expand Down Expand Up @@ -533,10 +533,10 @@ class StillImageActivity : AppCompatActivity() {
private const val POSE_DETECTION = "Pose Detection"
private const val SELFIE_SEGMENTATION = "Selfie Segmentation"

private const val SIZE_ORIGINAL = "w:original" // Original image size
private const val SIZE_SCREEN = "w:screen" // Match screen width
private const val SIZE_1024_768 = "w:1024" // ~1024*768 in a normal ratio
private const val SIZE_640_480 = "w:640" // ~640*480 in a normal ratio
private const val SIZE_ORIGINAL = "w:original" // Original image size
private const val KEY_IMAGE_URI = "com.google.mlkit.vision.demo.KEY_IMAGE_URI"
private const val KEY_IMAGE_MAX_WIDTH = "com.google.mlkit.vision.demo.KEY_IMAGE_MAX_WIDTH"
private const val KEY_IMAGE_MAX_HEIGHT = "com.google.mlkit.vision.demo.KEY_IMAGE_MAX_HEIGHT"
Expand Down

0 comments on commit 40ab67c

Please sign in to comment.