当前位置: 首页>>代码示例>>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;未经允许,请勿转载。