Skip to content

Commit

Permalink
Release 19 (beta 5) for XE16
Browse files Browse the repository at this point in the history
  • Loading branch information
w9jds committed Apr 16, 2014
1 parent ae7efdb commit a6b7b21
Show file tree
Hide file tree
Showing 30 changed files with 280 additions and 89 deletions.
249 changes: 175 additions & 74 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file added Gallery4Glass.apk
Binary file not shown.
Binary file modified out/production/Gallery4Glass/Gallery4Glass.apk
Binary file not shown.
Binary file modified out/production/Gallery4Glass/Gallery4Glass.unaligned.apk
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified out/production/Gallery4Glass/com/w9jds/gallery4glass/R$id.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified out/production/Gallery4Glass/com/w9jds/gallery4glass/R$menu.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified out/production/Gallery4Glass/com/w9jds/gallery4glass/R$xml.class
Binary file not shown.
Binary file modified out/production/Gallery4Glass/com/w9jds/gallery4glass/R.class
Binary file not shown.
Binary file not shown.
Binary file modified out/production/Gallery4Glass/org/opencv/BuildConfig.class
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions res/xml/gallery_voice_trigger.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>

<trigger keyword="@string/gallery_voice_trigger">
<constraints network="true" />
</trigger>
<trigger keyword="@string/gallery_voice_trigger"/>
116 changes: 104 additions & 12 deletions src/com/w9jds/gallery4glass/CameraActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AdapterView;

import com.google.analytics.tracking.android.EasyTracker;
import com.google.analytics.tracking.android.MapBuilder;
import com.google.android.glass.media.Sounds;
import com.google.android.glass.touchpad.Gesture;
import com.google.android.glass.touchpad.GestureDetector;
import com.google.android.glass.widget.CardScrollView;
import com.w9jds.gallery4glass.Adapters.csaAdapter;
import com.w9jds.gallery4glass.Classes.Gallery4Glass;
import com.w9jds.gallery4glass.Classes.SingleMediaScanner;
import com.w9jds.gallery4glass.Widget.OpenCVSurface;
import com.w9jds.gallery4glass.Widget.SliderView;


import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.OpenCVLoader;
Expand All @@ -35,13 +38,16 @@
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class CameraActivity extends Activity implements CameraBridgeViewBase.CvCameraViewListener2
{
public static final String ACTION_WINK = "com.google.glass.action.EYE_GESTURE";

//create an adapter for the cardscrollviewer
private csaAdapter mcvAdapter;
// Declare a new Gesture Detector
private GestureDetector mGestureDetector;
// Declare a new Camera Preview Surface
Expand Down Expand Up @@ -85,16 +91,109 @@ public boolean onCreateOptionsMenu(Menu menu)
@Override
public boolean onOptionsItemSelected(android.view.MenuItem iItem)
{
SliderView svProgress;
CardScrollView csvCardsView;
final Camera cCamera;
Camera.Parameters params;

switch (iItem.getItemId())
{
case R.id.scene_menu_item:

cCamera = mPreviewSurface.getCamera();

params = cCamera.getParameters();
mPreviewSurface.disableView();

//add a card to the card scroll view for each supported Scenes that is available
final List<String> lsScenes = params.getSupportedSceneModes();

//create a new card scroll viewer for this context
csvCardsView = new CardScrollView(this);
//create a new adapter for the scroll viewer
mcvAdapter = new csaAdapter(this, (ArrayList<String>)lsScenes);
//set this adapter as the adapter for the scroll viewer
csvCardsView.setAdapter(mcvAdapter);
//activate this scroll viewer
csvCardsView.activate();
//add a listener to the scroll viewer that is fired when an item is clicked
csvCardsView.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, final int position, long id)
{

//play the tap sound
maManager.playSoundEffect(Sounds.TAP);

setPreviewSurface();

new Handler().postDelayed(new Runnable()
{
public void run()
{
Camera cCamera = mPreviewSurface.getCamera();

Camera.Parameters cParams = cCamera.getParameters();

cParams.setSceneMode(lsScenes.get(position));
}
}, 2000);

}
});

//set the view of this activity
setContentView(csvCardsView);

return true;

case R.id.white_balance_menu_item:

cCamera = mPreviewSurface.getCamera();

params = cCamera.getParameters();
mPreviewSurface.disableView();
//add a card to the card scroll view for each supported White Balances that is available
final List<String> lsWhites = params.getSupportedWhiteBalance();


//create a new card scroll viewer for this context
csvCardsView = new CardScrollView(this);
//create a new adapter for the scroll viewer
mcvAdapter = new csaAdapter(this, (ArrayList<String>)lsWhites);
//set this adapter as the adapter for the scroll viewer
csvCardsView.setAdapter(mcvAdapter);
//activate this scroll viewer
csvCardsView.activate();
//add a listener to the scroll viewer that is fired when an item is clicked
csvCardsView.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, final int position, long id)
{
//play the tap sound
maManager.playSoundEffect(Sounds.TAP);

setPreviewSurface();

new Handler().postDelayed(new Runnable()
{
public void run()
{
Camera cCamera = mPreviewSurface.getCamera();

Camera.Parameters cParams = cCamera.getParameters();

cParams.setWhiteBalance(lsWhites.get(position));
}
}, 2000);

}
});

//set the view of this activity
setContentView(csvCardsView);

return true;

default:
Expand Down Expand Up @@ -160,7 +259,7 @@ private GestureDetector createGestureDetector(final Context cContext)
GestureDetector gestureDetector = new GestureDetector(cContext);

//Create a base listener for generic gestures
gestureDetector.setBaseListener( new GestureDetector.BaseListener()
gestureDetector.setBaseListener(new GestureDetector.BaseListener()
{
@Override
public boolean onGesture(Gesture gGesture)
Expand All @@ -185,14 +284,7 @@ public boolean onGesture(Gesture gGesture)
}

else if (gGesture == Gesture.TWO_LONG_PRESS)
{
Camera cCamera = mPreviewSurface.getCamera();

Camera.Parameters params = cCamera.getParameters();

List<String> test = params.getSupportedSceneModes();
List<String> test3 = params.getSupportedWhiteBalance();
}
openOptionsMenu();

else if (gGesture == Gesture.SWIPE_DOWN)
{
Expand Down

0 comments on commit a6b7b21

Please sign in to comment.