當前位置: 首頁>>代碼示例>>Java>>正文


Java Bundle.getFloatArray方法代碼示例

本文整理匯總了Java中android.os.Bundle.getFloatArray方法的典型用法代碼示例。如果您正苦於以下問題:Java Bundle.getFloatArray方法的具體用法?Java Bundle.getFloatArray怎麽用?Java Bundle.getFloatArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.getFloatArray方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        normalizedScale = bundle.getFloat("saveScale");
        m = bundle.getFloatArray("matrix");
        prevMatrix.setValues(m);
        prevMatchViewHeight = bundle.getFloat("matchViewHeight");
        prevMatchViewWidth = bundle.getFloat("matchViewWidth");
        prevViewHeight = bundle.getInt("viewHeight");
        prevViewWidth = bundle.getInt("viewWidth");
        imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
        super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
        return;
    }

    super.onRestoreInstanceState(state);
}
 
開發者ID:sherlockchou86,項目名稱:yphoto,代碼行數:19,代碼來源:TouchImageView.java

示例2: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onRestoreInstanceState(Parcelable state) {
  	if (state instanceof Bundle) {
     Bundle bundle = (Bundle) state;
     normalizedScale = bundle.getFloat("saveScale");
     m = bundle.getFloatArray("matrix");
     prevMatrix.setValues(m);
     prevMatchViewHeight = bundle.getFloat("matchViewHeight");
     prevMatchViewWidth = bundle.getFloat("matchViewWidth");
     prevViewHeight = bundle.getInt("viewHeight");
     prevViewWidth = bundle.getInt("viewWidth");
     imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
     super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
     return;
  	}

  	super.onRestoreInstanceState(state);
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:19,代碼來源:TouchImageView.java

示例3: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
public void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        this.normalizedScale = bundle.getFloat("saveScale");
        this.values = bundle.getFloatArray("matrix");
        this.prevMatrix.setValues(this.values);
        this.prevMatchViewHeight = bundle.getFloat("matchViewHeight");
        this.prevMatchViewWidth = bundle.getFloat("matchViewWidth");
        this.prevViewHeight = bundle.getInt("viewHeight");
        this.prevViewWidth = bundle.getInt("viewWidth");
        this.imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
        super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
        return;
    }
    super.onRestoreInstanceState(state);
}
 
開發者ID:asif-patel,項目名稱:ImageMagnifier,代碼行數:17,代碼來源:TouchImageView.java

示例4: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override public void onRestoreInstanceState(Parcelable state) {
  if (state instanceof Bundle) {
    Bundle bundle = (Bundle) state;
    normalizedScale = bundle.getFloat("saveScale");
    m = bundle.getFloatArray("matrix");
    prevMatrix.setValues(m);
    prevMatchViewHeight = bundle.getFloat("matchViewHeight");
    prevMatchViewWidth = bundle.getFloat("matchViewWidth");
    prevViewHeight = bundle.getInt("viewHeight");
    prevViewWidth = bundle.getInt("viewWidth");
    imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
    super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
    return;
  }

  super.onRestoreInstanceState(state);
}
 
開發者ID:malijie,項目名稱:PhotoPicker-master,代碼行數:18,代碼來源:TouchImageView.java

示例5: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
public void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        this.normalizedScale = bundle.getFloat("saveScale");
        this.m = bundle.getFloatArray("matrix");
        this.prevMatrix.setValues(this.m);
        this.prevMatchViewHeight = bundle.getFloat("matchViewHeight");
        this.prevMatchViewWidth = bundle.getFloat("matchViewWidth");
        this.prevViewHeight = bundle.getInt("viewHeight");
        this.prevViewWidth = bundle.getInt("viewWidth");
        this.imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
        super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
        return;
    }
    super.onRestoreInstanceState(state);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:TouchImageView.java

示例6: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        colorHSV = bundle.getFloatArray("color");
        super.onRestoreInstanceState(bundle.getParcelable("super"));
    } else {
        super.onRestoreInstanceState(state);
    }
}
 
開發者ID:89luca89,項目名稱:ThunderMusic,代碼行數:11,代碼來源:ColorPicker.java

示例7: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        colorHSV = bundle.getFloatArray("color");
        updateAdjacentHue();
        super.onRestoreInstanceState(bundle.getParcelable("super"));
    } else {
        super.onRestoreInstanceState(state);
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:12,代碼來源:MultiColorPicker.java

示例8: unbundle

import android.os.Bundle; //導入方法依賴的package包/類
public static TestClassBundled unbundle(Bundle bundle, Gson gson) {
    return new AutoValue_TestClassBundled(
            bundle,
            bundle.getByte("some_byte"),
            bundle.getBoolean("some_boolean"),
            bundle.getShort("some_short"),
            bundle.getInt("some_int"),
            bundle.getLong("some_long"),
            bundle.getChar("some_char"),
            bundle.getFloat("some_float"),
            bundle.getDouble("some_double"),
            bundle.getString("some_string"),
            bundle.getCharSequence("some_char_sequence"),
            bundle.getParcelable("some_parcelable"),
            bundle.getParcelableArrayList("some_parcelable_array_list"),
            bundle.getSparseParcelableArray("some_parcelable_sparse_array"),
            bundle.getSerializable("some_serializable"),
            bundle.getIntegerArrayList("some_integer_array_list"),
            bundle.getStringArrayList("some_string_array_list"),
            bundle.getCharSequenceArrayList("some_char_sequence_array_list"),
            bundle.getByteArray("some_byte_array"),
            bundle.getShortArray("some_short_array"),
            bundle.getCharArray("some_char_array"),
            bundle.getFloatArray("some_float_array"),
            gson.fromJson(bundle.getString("some_unknown_object"), new com.google.common.reflect.TypeToken<UnknownObject>(){}.getType()),
            gson.fromJson(bundle.getString("some_unknown_object_list"), new com.google.common.reflect.TypeToken<ArrayList<UnknownObject>>(){}.getType()),
            gson.fromJson(bundle.getString("test_enum"), new com.google.common.reflect.TypeToken<TestEnum>(){}.getType()));
}
 
開發者ID:uber,項目名稱:auto-value-bundle,代碼行數:29,代碼來源:AutoValue_TestClassBundled.java

示例9: onRestoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        mColorHSV = bundle.getFloatArray("color");
        mColorInitial = bundle.getInt("previous");
        super.onRestoreInstanceState(bundle.getParcelable("super"));
    } else {
        super.onRestoreInstanceState(state);
    }
}
 
開發者ID:dftec-es,項目名稱:planetcon,代碼行數:12,代碼來源:ColorPicker.java

示例10: putResults

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Add the recognition results to the existing {@link Bundle}
 *
 * @param results recognition results {@link Bundle}
 */
public void putResults(@NonNull final Bundle results) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "putResults");
    }

    final ArrayList<String> heardVoice = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
    final float[] confidence = results.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);

    if (heardVoice != null) {
        getBundle().putStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION, heardVoice);
    } else {
        if (DEBUG) {
            MyLog.i(CLS_NAME, "putResults: speech empty");
        }
        getBundle().putStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION, new ArrayList<String>());
    }

    if (confidence != null) {
        getBundle().putFloatArray(SpeechRecognizer.CONFIDENCE_SCORES, confidence);
    } else {
        if (DEBUG) {
            MyLog.i(CLS_NAME, "putResults: confidence empty");
        }
        getBundle().putFloatArray(SpeechRecognizer.CONFIDENCE_SCORES, new float[0]);
    }
}
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:32,代碼來源:SelfAwareConditions.java

示例11: getFloatArray

import android.os.Bundle; //導入方法依賴的package包/類
public float[] getFloatArray(Bundle state, String key) {
    return state.getFloatArray(key + baseKey);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:Injector.java

示例12: logSpeechResults

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Iterate through the recognition results and their associated confidence scores.
 *
 * @param bundle of recognition data
 */
public static void logSpeechResults(final Bundle bundle) {
    MyLog.i(CLS_NAME, "logSpeechResults");

    examineBundle(bundle);

    final ArrayList<String> heardVoice = bundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
    final ArrayList<String> unstable = bundle.getStringArrayList(RecognitionNative.UNSTABLE_RESULTS);
    final float[] confidence = bundle.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);

    if (heardVoice != null) {
        MyLog.d(CLS_NAME, "heardVoice: " + heardVoice.size());
    }
    if (unstable != null) {
        MyLog.d(CLS_NAME, "unstable: " + unstable.size());
    }
    if (confidence != null) {
        MyLog.d(CLS_NAME, "confidence: " + confidence.length);
    }

    /* handles empty string bug */
    if (UtilsList.notNaked(heardVoice)) {
        heardVoice.removeAll(Collections.singleton(""));
    }

    /* handles empty string bug */
    if (UtilsList.notNaked(unstable)) {
        unstable.removeAll(Collections.singleton(""));
    }

    if (UtilsList.notNaked(confidence) && UtilsList.notNaked(heardVoice) && confidence.length == heardVoice.size()) {
        for (int i = 0; i < heardVoice.size(); i++) {
            MyLog.i(CLS_NAME, "Results: " + heardVoice.get(i) + " ~ " + confidence[i]);
        }
    } else if (UtilsList.notNaked(heardVoice)) {
        for (int i = 0; i < heardVoice.size(); i++) {
            MyLog.i(CLS_NAME, "Results: " + heardVoice.get(i));
        }
    } else if (UtilsList.notNaked(unstable)) {
        for (int i = 0; i < unstable.size(); i++) {
            MyLog.i(CLS_NAME, "Unstable: " + unstable.get(i));
        }
    } else {
        MyLog.w(CLS_NAME, "Results: values error");
    }
}
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:51,代碼來源:SelfAwareVerbose.java

示例13: onExampleCallback

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * This example method is exposed to simulate a callback from your Intent Service, once a keyphrase
 * has been detected.
 *
 * @param bundle containing associated keyphrase extras
 */
public void onExampleCallback(final Bundle bundle) {

    if (getActivity() != null && tvResults != null && bundle != null && !bundle.isEmpty()) {

        appendText(null);

        final ArrayList<String> voiceData = bundle.getStringArrayList(Request.RESULTS_RECOGNITION);
        final float[] confidenceScore = bundle.getFloatArray(Request.CONFIDENCE_SCORES);

        if (confidenceScore != null && voiceData != null && confidenceScore.length == voiceData.size()) {
            for (int i = 0; i < voiceData.size(); i++) {
                Log.i(CLS_NAME, "onSpeechResults: " + voiceData.get(i) + " ~ " + confidenceScore[i]);
                appendText(voiceData.get(i) + " ~ " + confidenceScore[i]);
            }
        } else if (voiceData != null) {
            for (int i = 0; i < voiceData.size(); i++) {
                Log.i(CLS_NAME, "onSpeechResults: " + voiceData.get(i));
                appendText(voiceData.get(i));
            }
        } else {
            Log.w(CLS_NAME, "onSpeechResults: values error");
            appendText("onSpeechResults: values error");
        }

        appendText("\n");

        bundle.remove(Request.RESULTS_RECOGNITION);
        bundle.remove(Request.CONFIDENCE_SCORES);

        final Set<String> keys = bundle.keySet();
        for (final String key : keys) {
            appendText(key + ": " + bundle.get(key));
        }

        if (voiceData != null && !voiceData.isEmpty()) {

            switch (bundle.getInt(SaiyKeyphrase.SAIY_ACTION, 0)) {

                case DO_SOMETHING_1:
                    Log.i(CLS_NAME, "onHandleIntent: DO_SOMETHING_1");
                    appendText("Heard: " + SAUSAGES + "!");
                    break;
                case DO_SOMETHING_2:
                    Log.i(CLS_NAME, "onHandleIntent: DO_SOMETHING_2");
                    appendText("\nStart the playlist: " + voiceData.get(0).toLowerCase(Locale.US)
                            .replaceFirst(SPOTIFY_PLAYLIST, "") + "!");
                    break;
                case DO_SOMETHING_3:
                    Log.i(CLS_NAME, "onHandleIntent: DO_SOMETHING_3");
                    appendText("\nStart the album: " + voiceData.get(0).toLowerCase(Locale.US)
                            .replaceFirst(SPOTIFY_ALBUM, "") + "!");
                    break;
                case DO_NOT_USE_ZERO:
                    Log.e(CLS_NAME, "onHandleIntent: DO_NOT_USE_ZERO");
                    break;
            }
        } else {
            Log.e(CLS_NAME, "onHandleIntent: voice data empty - should not happen");
        }
    }
}
 
開發者ID:brandall76,項目名稱:API-Example-App,代碼行數:68,代碼來源:FragmentDemoCommand.java


注:本文中的android.os.Bundle.getFloatArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。