aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/voice/RecognitionView.java
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-01-28 10:09:44 -0800
committerDoug Zongker <dougz@android.com>2010-01-28 10:09:44 -0800
commita16ff1b19e8e012cf37a234bae67b994e805bfb1 (patch)
tree2e8888e77ff0fd976fc45e0b1542b0789977486b /src/com/android/inputmethod/voice/RecognitionView.java
parentb1cd7016028f5770da2688f1ec51e0601fc5b9eb (diff)
downloadlatinime-a16ff1b19e8e012cf37a234bae67b994e805bfb1.tar.gz
latinime-a16ff1b19e8e012cf37a234bae67b994e805bfb1.tar.xz
latinime-a16ff1b19e8e012cf37a234bae67b994e805bfb1.zip
remove references to Gservices from LatinIME
Open-sourced platform code shouldn't refer to Gservices. Use the platform-standard Secure settings table instead (which we can still push values into from the servers on google-experience devices, like gservices), but can be populated by other mechanisms for non-ged phones. Change-Id: Id0b5830bfc78c1d10dc732dce46546cd09cd1422
Diffstat (limited to 'src/com/android/inputmethod/voice/RecognitionView.java')
-rw-r--r--src/com/android/inputmethod/voice/RecognitionView.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/com/android/inputmethod/voice/RecognitionView.java b/src/com/android/inputmethod/voice/RecognitionView.java
index 97acb1152..fd3d6d0de 100644
--- a/src/com/android/inputmethod/voice/RecognitionView.java
+++ b/src/com/android/inputmethod/voice/RecognitionView.java
@@ -1,12 +1,12 @@
/*
* Copyright (C) 2009 Google Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -36,7 +36,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.android.inputmethod.latin.R;
-import com.android.inputmethod.voice.GoogleSettingsUtil;
+import com.android.inputmethod.voice.SettingsUtil;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
@@ -112,10 +112,10 @@ public class RecognitionView {
mView = inflater.inflate(R.layout.recognition_status, null);
ContentResolver cr = context.getContentResolver();
- mMinMicrophoneLevel = GoogleSettingsUtil.getGservicesFloat(
- cr, GoogleSettingsUtil.LATIN_IME_MIN_MICROPHONE_LEVEL, 15.f);
- mMaxMicrophoneLevel = GoogleSettingsUtil.getGservicesFloat(
- cr, GoogleSettingsUtil.LATIN_IME_MAX_MICROPHONE_LEVEL, 30.f);
+ mMinMicrophoneLevel = SettingsUtil.getSettingsFloat(
+ cr, SettingsUtil.LATIN_IME_MIN_MICROPHONE_LEVEL, 15.f);
+ mMaxMicrophoneLevel = SettingsUtil.getSettingsFloat(
+ cr, SettingsUtil.LATIN_IME_MAX_MICROPHONE_LEVEL, 30.f);
// Pre-load volume level images
Resources r = context.getResources();
@@ -131,7 +131,7 @@ public class RecognitionView {
mInitializing = r.getDrawable(R.drawable.mic_slash);
mError = r.getDrawable(R.drawable.caution);
-
+
mImage = (ImageView) mView.findViewById(R.id.image);
mButton = mView.findViewById(R.id.button);
mButton.setOnClickListener(clickListener);
@@ -207,12 +207,12 @@ public class RecognitionView {
final ShortBuffer buf = ByteBuffer.wrap(waveBuffer.toByteArray())
.order(ByteOrder.nativeOrder()).asShortBuffer();
buf.position(0);
- waveBuffer.reset();
+ waveBuffer.reset();
showWave(buf, speechStartPosition / 2, speechEndPosition / 2);
}
});
}
-
+
/**
* @return an average abs of the specified buffer.
*/
@@ -295,15 +295,15 @@ public class RecognitionView {
MarginLayoutParams mProgressParams = (MarginLayoutParams)mProgress.getLayoutParams();
mProgressParams.topMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
-h / 2 - 18, mContext.getResources().getDisplayMetrics());
-
+
// Tweak the padding manually to fill out the whole view horizontally.
// TODO: Do this in the xml layout instead.
- ((View) mImage.getParent()).setPadding(4, ((View) mImage.getParent()).getPaddingTop(), 3,
+ ((View) mImage.getParent()).setPadding(4, ((View) mImage.getParent()).getPaddingTop(), 3,
((View) mImage.getParent()).getPaddingBottom());
- mProgress.setLayoutParams(mProgressParams);
+ mProgress.setLayoutParams(mProgressParams);
}
-
+
public void finish() {
mState = State.READY;
mUiHandler.post(new Runnable() {