Java Code Examples for android.os.Bundle.getFloat()

The following are Jave code examples for showing how to use getFloat() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AndroidBackendlessChat   File: TouchImageView.java   View Source Code Vote up 7 votes
@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);
}
 
Example 2
Project: Sega   File: TouchImageView.java   View Source Code Vote up 7 votes
@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);
}
 
Example 3
Project: Android_ImagePicker   File: TouchImageView.java   View Source Code Vote up 7 votes
@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);
}
 
Example 4
Project: yphoto   File: TouchImageView.java   View Source Code Vote up 7 votes
@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);
}
 
Example 5
Project: Sega   File: CommentActivity.java   View Source Code Vote up 6 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_comment);
    ButterKnife.bind(this);
    if (savedInstanceState == null) {
        CommentFragment fragment = new CommentFragment();
        Bundle args = new Bundle();
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            extras.getFloat("totalamount"); // use the type of data in place of String
        }
        args.putInt(ViMarket.COMMENT_TYPE, extras.getInt(ViMarket.COMMENT_TYPE, 0));
        args.putInt(ViMarket.user_ID, getIntent().getIntExtra(ViMarket.user_ID, 0));
        args.putString(ViMarket.user_name, getIntent().getStringExtra(ViMarket.user_name));
        args.putParcelableArrayList(ViMarket.COMMENT_LIST, getIntent().getParcelableArrayListExtra(ViMarket.COMMENT_LIST));
        fragment.setArguments(args);
        getSupportFragmentManager().beginTransaction().replace(R.id.comment_container, fragment).commit();
        if (isTablet) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        }
    }
    Intent returnIntent = new Intent();
    setResult(Activity.RESULT_CANCELED, returnIntent);

}
 
Example 6
Project: JsoupSample   File: TouchImageView.java   View Source Code Vote up 6 votes
@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);
}
 
Example 7
Project: OSchina_resources_android   File: TouchImageView.java   View Source Code Vote up 6 votes
@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);
}
 
Example 8
Project: ceji_android   File: NumberProgressBar.java   View Source Code Vote up 6 votes
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        final Bundle bundle = (Bundle) state;
        mTextColor = bundle.getInt(INSTANCE_TEXT_COLOR);
        mTextSize = bundle.getFloat(INSTANCE_TEXT_SIZE);
        mReachedBarHeight = bundle.getFloat(INSTANCE_REACHED_BAR_HEIGHT);
        mUnreachedBarHeight = bundle.getFloat(INSTANCE_UNREACHED_BAR_HEIGHT);
        mReachedBarColor = bundle.getInt(INSTANCE_REACHED_BAR_COLOR);
        mUnreachedBarColor = bundle.getInt(INSTANCE_UNREACHED_BAR_COLOR);
        initializePainters();
        setMax(bundle.getInt(INSTANCE_MAX));
        setProgress(bundle.getInt(INSTANCE_PROGRESS));
        setPrefix(bundle.getString(INSTANCE_PREFIX));
        setSuffix(bundle.getString(INSTANCE_SUFFIX));
        setProgressTextVisibility(bundle.getBoolean(INSTANCE_TEXT_VISIBILITY) ? ProgressTextVisibility.Visible : ProgressTextVisibility.Invisible);
        super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
        return;
    }
    super.onRestoreInstanceState(state);
}
 
Example 9
Project: LongImageCamera   File: TouchImageView.java   View Source Code Vote up 6 votes
@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);
}
 
Example 10
Project: LueansRead   File: TouchImageView.java   View Source Code Vote up 6 votes
@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);
}
 
Example 11
Project: Zxing-Custom   File: CaptureActivityHandler.java   View Source Code Vote up 5 votes
@Override
public void handleMessage(Message message) {
  if (message.what == R.id.restart_preview) {
    restartPreviewAndDecode();

  } else if (message.what == R.id.decode_succeeded) {
    state = State.SUCCESS;
    Bundle bundle = message.getData();
    Bitmap barcode = null;
    float scaleFactor = 1.0f;
    if (bundle != null) {
      byte[] compressedBitmap = bundle.getByteArray(DecodeThread.BARCODE_BITMAP);
      if (compressedBitmap != null) {
        barcode = BitmapFactory.decodeByteArray(compressedBitmap, 0, compressedBitmap.length, null);
        // Mutable copy:
        barcode = barcode.copy(Bitmap.Config.ARGB_8888, true);
      }
      scaleFactor = bundle.getFloat(DecodeThread.BARCODE_SCALED_FACTOR);
    }
    activity.handleDecode((Result) message.obj, barcode, scaleFactor);

  } else if (message.what == R.id.decode_failed) {// We're decoding as fast as possible, so when one decode fails, start another.
    state = State.PREVIEW;
    cameraManager.requestPreviewFrame(decodeThread.getHandler(), R.id.decode);

  } else if (message.what == R.id.return_scan_result) {
    activity.getActivity().setResult(Activity.RESULT_OK, (Intent) message.obj);
    activity.getActivity().finish();

  }
}
 
Example 12
Project: PaoMovie   File: DonutProgress.java   View Source Code Vote up 5 votes
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        final Bundle bundle = (Bundle) state;
        textColor = bundle.getInt(INSTANCE_TEXT_COLOR);
        textSize = bundle.getFloat(INSTANCE_TEXT_SIZE);
        innerBottomTextSize = bundle.getFloat(INSTANCE_INNER_BOTTOM_TEXT_SIZE);
        innerBottomText = bundle.getString(INSTANCE_INNER_BOTTOM_TEXT);
        innerBottomTextColor = bundle.getInt(INSTANCE_INNER_BOTTOM_TEXT_COLOR);
        finishedStrokeColor = bundle.getInt(INSTANCE_FINISHED_STROKE_COLOR);
        unfinishedStrokeColor = bundle.getInt(INSTANCE_UNFINISHED_STROKE_COLOR);
        finishedStrokeWidth = bundle.getFloat(INSTANCE_FINISHED_STROKE_WIDTH);
        unfinishedStrokeWidth = bundle.getFloat(INSTANCE_UNFINISHED_STROKE_WIDTH);
        innerBackgroundColor = bundle.getInt(INSTANCE_BACKGROUND_COLOR);
        attributeResourceId = bundle.getInt(INSTANCE_INNER_DRAWABLE);
        initPainters();
        setMax(bundle.getInt(INSTANCE_MAX));
        setStartingDegree(bundle.getInt(INSTANCE_STARTING_DEGREE));
        setProgress(bundle.getFloat(INSTANCE_PROGRESS));
        prefixText = bundle.getString(INSTANCE_PREFIX);
        suffixText = bundle.getString(INSTANCE_SUFFIX);
        text = bundle.getString(INSTANCE_TEXT);
        super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
        return;
    }
    super.onRestoreInstanceState(state);
}
 
Example 13
Project: ZXingAndroidExt   File: CaptureActivityHandler.java   View Source Code Vote up 5 votes
@Override
public void handleMessage(Message message) {
    int what = message.what;
    if (what == R.id.restart_preview) {
        restartPreviewAndDecode();
    } else if (what == R.id.decode_succeeded) {
        state = State.SUCCESS;
        Bundle bundle = message.getData();
        Bitmap barcode = null;
        float scaleFactor = 1.0f;
        if (bundle != null) {
            byte[] compressedBitmap = bundle.getByteArray(DecodeThread.BARCODE_BITMAP);
            if (compressedBitmap != null) {
                barcode = BitmapFactory.decodeByteArray(compressedBitmap, 0, compressedBitmap.length, null);
                // Mutable copy:
                barcode = barcode.copy(Bitmap.Config.ARGB_8888, true);
            }
            scaleFactor = bundle.getFloat(DecodeThread.BARCODE_SCALED_FACTOR);
        }
        activity.handleDecode((Result) message.obj, barcode, scaleFactor);
    } else if (what == R.id.decode_failed) {
        // We're decoding as fast as possible, so when one decode fails, start another.
        state = State.PREVIEW;
        cameraManager.requestPreviewFrame(decodeThread.getHandler(), R.id.decode);
    } else if (what == R.id.return_scan_result) {
        activity.setResult(Activity.RESULT_OK, (Intent) message.obj);
        activity.finish();
    } else if (what == R.id.launch_product_query) {
        String url = (String) message.obj;

        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
        intent.setData(Uri.parse(url));

        ResolveInfo resolveInfo =
                activity.getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
        String browserPackageName = null;
        if (resolveInfo != null && resolveInfo.activityInfo != null) {
            browserPackageName = resolveInfo.activityInfo.packageName;
            Log.d(TAG, "Using browser in package " + browserPackageName);
        }

        // Needed for default Android browser / Chrome only apparently
        if ("com.android.browser".equals(browserPackageName) || "com.android.chrome".equals(browserPackageName)) {
            intent.setPackage(browserPackageName);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.putExtra(Browser.EXTRA_APPLICATION_ID, browserPackageName);
        }

        try {
            activity.startActivity(intent);
        } catch (ActivityNotFoundException ignored) {
            Log.w(TAG, "Can't find anything to handle VIEW of URI " + url);
        }
    }
}
 
Example 14
Project: FloatingMusicMenu   File: FloatingMusicButton.java   View Source Code Vote up 5 votes
@Override
protected void onRestoreInstanceState(Parcelable state) {
    super.onRestoreInstanceState(state);
    Bundle bundle = (Bundle) state;
    isRotation = bundle.getBoolean("rotation");
    progress = bundle.getFloat("progress");
    requestLayout();
}
 
Example 15
Project: jackknife   File: ShadeView.java   View Source Code Vote up 5 votes
@Override
public void onRestoreInstanceState(Parcelable parcelable) {
    if (parcelable instanceof Bundle) {
        Bundle bundle = (Bundle) parcelable;
        mAlpha = bundle.getFloat(STATE_ALPHA);
        super.onRestoreInstanceState(bundle.getParcelable(STATE_INSTANCE));
    } else {
        super.onRestoreInstanceState(parcelable);
    }
}
 
Example 16
Project: tvConnect_android   File: CaptureActivityHandler.java   View Source Code Vote up 5 votes
@Override
public void handleMessage(Message message) {
	if (message.what == R.id.restart_preview) {
		restartPreviewAndDecode();

	} else if (message.what == R.id.decode_succeeded) {
		state = State.SUCCESS;
		Bundle bundle = message.getData();
		Bitmap barcode = null;
		float scaleFactor = 1.0f;
		if (bundle != null) {
			byte[] compressedBitmap = bundle
					.getByteArray(DecodeThread.BARCODE_BITMAP);
			if (compressedBitmap != null) {
				barcode = BitmapFactory.decodeByteArray(compressedBitmap,
						0, compressedBitmap.length, null);
				// Mutable copy:
				barcode = barcode.copy(Bitmap.Config.ARGB_8888, true);
			}
			scaleFactor = bundle
					.getFloat(DecodeThread.BARCODE_SCALED_FACTOR);
		}
		activity.handleDecode((Result) message.obj, barcode, scaleFactor);

	} else if (message.what == R.id.decode_failed) {// We're decoding as fast as possible, so when one decode fails,
		// start another.
		state = State.PREVIEW;
		cameraManager.requestPreviewFrame(decodeThread.getHandler(),
				R.id.decode);

	} else if (message.what == R.id.return_scan_result) {
		activity.setResult(Activity.RESULT_OK, (Intent) message.obj);
		activity.finish();

	} else if (message.what == R.id.launch_product_query) {
		String url = (String) message.obj;

		Intent intent = new Intent(Intent.ACTION_VIEW);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
		intent.setData(Uri.parse(url));

		ResolveInfo resolveInfo = activity.getPackageManager()
				.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
		String browserPackageName = null;
		if (resolveInfo != null && resolveInfo.activityInfo != null) {
			browserPackageName = resolveInfo.activityInfo.packageName;
			Log.d(TAG, "Using browser in package " + browserPackageName);
		}

		// Needed for default Android browser / Chrome only apparently
		if ("com.android.browser".equals(browserPackageName)
				|| "com.android.chrome".equals(browserPackageName)) {
			intent.setPackage(browserPackageName);
			intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			intent.putExtra(Browser.EXTRA_APPLICATION_ID,
					browserPackageName);
		}

		try {
			activity.startActivity(intent);
		} catch (ActivityNotFoundException ignored) {
			Log.w(TAG, "Can't find anything to handle VIEW of URI " + url);
		}

	}
}
 
Example 17
Project: airgram   File: ColorPickerView.java   View Source Code Vote up 5 votes
@Override
protected void onRestoreInstanceState(Parcelable state) {
    Bundle savedState = (Bundle) state;

    Parcelable superState = savedState.getParcelable(STATE_PARENT);
    super.onRestoreInstanceState(superState);

    mAngle = savedState.getFloat(STATE_ANGLE);
    setOldCenterColor(savedState.getInt(STATE_OLD_COLOR));
    mShowCenterOldColor = savedState.getBoolean(STATE_SHOW_OLD_COLOR);
    int currentColor = calculateColor(mAngle);
    mPointerColor.setColor(currentColor);
    setNewCenterColor(currentColor);
}
 
Example 18
Project: OmegaRoundingImageView   File: ImageViewActivity.java   View Source Code Vote up 5 votes
@Override
protected void updateTransitionsArguments(Bundle bundle) {
    float startRounding = bundle.getFloat(RoundingImageTransitionValues.KEY_IMAGE_START_ROUNDING);
    float endRounding = bundle.getFloat(RoundingImageTransitionValues.KEY_IMAGE_END_ROUNDING);
    float startOffsetY = bundle.getFloat(RoundingImageTransitionValues.KEY_IMAGE_START_OFFSET);
    float endOffsetY = bundle.getFloat(RoundingImageTransitionValues.KEY_IMAGE_END_OFFSET);

    RoundingImageTransitionValues values = new RoundingImageTransitionValues(startOffsetY, endOffsetY, startRounding, endRounding);
    setEnterSharedElementCallback(RoundingImageTransitionUtil.getCallback(values));
}
 
Example 19
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public Float getBoxedFloat(Bundle state, String key) {
    if (state.containsKey(key + mBaseKey)) {
        return state.getFloat(key + mBaseKey);
    }
    return null;
}
 
Example 20
Project: keepass2android   File: CaptureActivityHandler.java   View Source Code Vote up 4 votes
@Override
public void handleMessage(Message message) {
  switch (message.what) {
    case R.id.restart_preview:
      Log.d(TAG, "Got restart preview message");
      restartPreviewAndDecode();
      break;
    case R.id.decode_succeeded:
      Log.d(TAG, "Got decode succeeded message");
      state = State.SUCCESS;
      Bundle bundle = message.getData();
      Bitmap barcode = null;
      float scaleFactor = 1.0f;
      if (bundle != null) {
        byte[] compressedBitmap = bundle.getByteArray(DecodeThread.BARCODE_BITMAP);
        if (compressedBitmap != null) {
          barcode = BitmapFactory.decodeByteArray(compressedBitmap, 0, compressedBitmap.length, null);
          // Mutable copy:
          barcode = barcode.copy(Bitmap.Config.ARGB_8888, true);
        }
        scaleFactor = bundle.getFloat(DecodeThread.BARCODE_SCALED_FACTOR);          
      }
      activity.handleDecode((Result) message.obj, barcode, scaleFactor);
      break;
    case R.id.decode_failed:
      // We're decoding as fast as possible, so when one decode fails, start another.
      state = State.PREVIEW;
      cameraManager.requestPreviewFrame(decodeThread.getHandler(), R.id.decode);
      break;
    case R.id.return_scan_result:
      Log.d(TAG, "Got return scan result message");
      activity.setResult(Activity.RESULT_OK, (Intent) message.obj);
      activity.finish();
      break;
    case R.id.launch_product_query:
      Log.d(TAG, "Got product query message");
      String url = (String) message.obj;

      Intent intent = new Intent(Intent.ACTION_VIEW);
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
      intent.setData(Uri.parse(url));

      ResolveInfo resolveInfo =
          activity.getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
      String browserPackageName = null;
      if (resolveInfo != null && resolveInfo.activityInfo != null) {
        browserPackageName = resolveInfo.activityInfo.packageName;
        Log.d(TAG, "Using browser in package " + browserPackageName);
      }

      // Needed for default Android browser / Chrome only apparently
      if ("com.android.browser".equals(browserPackageName) || "com.android.chrome".equals(browserPackageName)) {
        intent.setPackage(browserPackageName);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(Browser.EXTRA_APPLICATION_ID, browserPackageName);
      }

      try {
        activity.startActivity(intent);
      } catch (ActivityNotFoundException ignored) {
        Log.w(TAG, "Can't find anything to handle VIEW of URI " + url);
      }
      break;
  }
}