Commit 2b1589f6 by Kunj Gupta

Fixed - Issue #30 - v0.0.33_Listening not stopping on tap

.
parent ff5bd4bd
......@@ -20,6 +20,7 @@ import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
......@@ -185,6 +186,46 @@ public class DroidSpeech {
}
});
recognitionProgressView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
dsProperties.closedByUser = true;
// Closing droid speech operations
closeDroidSpeechOperations();
if (droidSpeechListener != null) {
// Sending an update that the droid speech was closed by user
droidSpeechListener.onDroidSpeechClosedByUser();
} else {
Log.i(TAG, "Droid speech closed");
}
}
return false;
}
});
recognitionProgressMsg.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
dsProperties.closedByUser = true;
// Closing droid speech operations
closeDroidSpeechOperations();
if (droidSpeechListener != null) {
// Sending an update that the droid speech was closed by user
droidSpeechListener.onDroidSpeechClosedByUser();
} else {
Log.i(TAG, "Droid speech closed");
}
}
return false;
}
});
speechProgressAlertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
......
......@@ -15,7 +15,7 @@
android:id="@+id/recognitionProgressMsg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/progressMsgMargin"
android:padding="@dimen/progressMsgMargin"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/app_name"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment