12 Şubat 2017 Pazar

InputMethodManager sınıfı

Giriş
Activity içinde şöyle yaparız.
<activity android:windowSoftInputMode="stateAlwaysVisible" ... />
constructor
Şöyle yaparız.
InputMethodManager lm = (InputMethodManager) context
  .getSystemService(Context.INPUT_METHOD_SERVICE);
hideSoftInputFromWindow metodu
Saklamak için şöyle yaparız.
View view = ...;
InputMethodManager imm = (InputMethodManager)context.getSystemService(
            Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
Şöyle yaparız.
imm.hideSoftInputFromWindow(_pay_box_helper.getWindowToken(), 0)
showInputMethodPicker metodu
İki giriş yöntemi varsa, Samsung Klavye ve Google Handwriting Input gibi seçim yapmak için şöyle yaparız.
InputMethodManager imm = (InputMethodManager) context().
 getSystemService(INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
toggleSoftInput metodu
Açmak için şöyle yaparız.
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,
  InputMethodManager.HIDE_IMPLICIT_ONLY);



8 Şubat 2017 Çarşamba

Camera.Parameters Sınıfı

Giriş
Şu satırı dahil ederiz.
import android.hardware.Camera;
import android.hardware.Camera.Parameters;
constructor
Şöyle yaparız.
Parameters params = camera.getParameters();
getExposureCompensation metodu
Şöyle yaparız.
int exposureComp = params.getExposureCompensation();
getPreviewSize metodu
Açıklaması şöyle
Picture size This is the size of the image produced when you tell the camera to take a photo. If it is the same aspect ratio as the native resolution then it will be directly scaled from that. If the aspect ratio is different then it will be cropped from the native size. In my experience, the largest size returned by getSupportedPictureSizes is the native resolution of the camera.

Preview size This is the size of the image preview that is shown on-screen. It may be a different aspect ratio than either the native size or the picture size, causing further cropping
Şöyle yaparız.
Camera.Size size = params.getPreviewSize();
set metodu
Şöyle yaparız.
params.set("rotation", 90); 
setFlashMode metodu
Şöyle yaparız.
params.setFlashMode(Parameters.FLASH_MODE_TORCH);
Şöyle yaparız.
params.setFlashMode(Parameters.FLASH_MODE_OFF);
setPictureFormat metodu
Şöyle yaparız
params.setPictureFormat(ImageFormat.JPEG);
setPictureSize metodu
Örnek ver

setPreviewSize metodu
Örnek ver


1 Şubat 2017 Çarşamba

Loader Sınıfı

Giriş
Açıklaması şöyle
If you just want to load data in background, you can think about Loaders. They cache the data application wide and fit nicely with activity/fragment life cycle.