Skip to content

Camera Config Storage Widget

Siddharth Utgikar edited this page Feb 26, 2021 · 3 revisions

(Updated widget in develop branch)

Shows the camera's current capacity and other information for internal and SD card storage locations.

The following image displays the information the widget displays in Photo Mode.

The following image displays the information the widget displays in Video Mode.

The following image displays the various states of the widget.

Usage

<dji.ux.beta.visualcamera.widget.cameraconfig.storage.CameraConfigStorageWidget
        android:id="@+id/widget_camera_config_storage"
        android:layout_width="wrap_content"
        android:layout_height="50dp" />

Customizations

The widget can be customized by the user to serve their purpose and theme.

Example

<dji.ux.beta.visualcamera.widget.cameraconfig.storage.CameraConfigStorageWidget
        android:id="@+id/widget_camera_config_storage"
        android:layout_width="wrap_content"
        android:layout_height="50dp"
        android:background="@color/uxsdk_white_85_percent"
        app:uxsdk_capacityTextColor="@color/black"
        app:uxsdk_imageFormatTextColor="@color/uxsdk_red"
        app:uxsdk_capacityValueTextColor="@color/gray"
        app:uxsdk_cameraColorTextColor="@color/black" />

Java Example

CameraConfigStorageWidget cameraConfigStorageWidget = findViewById(R.id.widget_camera_config_storage);
cameraConfigStorageWidget.setBackgroundColor(getResources().getColor(R.color.uxsdk_white_85_percent));
cameraConfigStorageWidget.setCapacityTextColor(getResources().getColor(R.color.black));
cameraConfigStorageWidget.setImageFormatTextColor(getResources().getColor(R.color.uxsdk_red));
cameraConfigStorageWidget.setCapacityValueTextColor(getResources().getColor(R.color.gray));
cameraConfigStorageWidget.setCameraColorTextColor(getResources().getColor(R.color.black));

Attributes

List of the customizable XML attributes
  • uxsdk_cameraIndex - The camera index to which the widget should react.
  • uxsdk_sdCardWarningIcon - The icon for SD Card in warning state.
  • uxsdk_sdCardNormalIcon - The icon for SD Card in normal state.
  • uxsdk_sdCardNotInsertedIcon - The icon for SD Card not inserted state.
  • uxsdk_internalStorageWarningIcon - The icon for Internal Storage in warning state.
  • uxsdk_internalStorageNormalIcon - The icon for Internal Storage in normal state.
  • uxsdk_internalStorageNotInsertedIcon - The icon for Internal Storage in not inserted icon.
  • uxsdk_storageIconBackground - The background of the storage icon.
  • uxsdk_imageFormatTextAppearance - The appearance of the text for image format.
  • uxsdk_imageFormatTextColor - The color of the text for image format.
  • uxsdk_imageFormatTextBackground - The background of the text for image format.
  • uxsdk_imageFormatTextSize - The size of the text for image format.
  • uxsdk_capacityTextAppearance - The appearance of the text for storage capacity.
  • uxsdk_capacityTextColor - The color of the text for storage capacity.
  • uxsdk_capacityTextBackground - The background of the text for storage capacity.
  • uxsdk_capacityTextSize - The size of the text for storage capacity.
  • uxsdk_capacityValueTextAppearance - The appearance of the text for storage capacity value.
  • uxsdk_capacityValueTextColor - The color of the text for storage capacity value.
  • uxsdk_capacityValueTextBackground - The background of the text for storage capacity value.
  • uxsdk_capacityValueTextSize - The size of the text for storage capacity value.
  • uxsdk_cameraColorTextAppearance - The appearance of the text for camera color text.
  • uxsdk_cameraColorTextColor - The color of the text for camera color text.
  • uxsdk_cameraColorTextBackground - The background of the text for camera color text.
  • uxsdk_cameraColorTextSize - The size of the text for camera color text.

APIs

List of the customization APIs
  • public void setCameraIndex(@NonNull SettingDefinitions.CameraIndex cameraIndex) - Set the camera index to which the widget should react.
  • @NonNull public SettingDefinitions.CameraIndex getCameraIndex() - Get the camera index to which the widget is reacting.
  • public void setInternalStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - Set the icon for Internal Storage based on storage state.
  • public void setInternalStorageIcon(@NonNull StorageIconState storageIconState, @Nullable Drawable drawable) - Set the icon for Internal Storage based on storage state.
  • @Nullable public Drawable getInternalStorageIcon(@NonNull StorageIconState storageIconState) - Get the icon for Internal Storage based on storage state.
  • public void setSDCardStorageIcon(@NonNull StorageIconState storageIconState, @DrawableRes int resourceId) - Set the icon for SD Card based on storage state.
  • public void setSDCardStorageIcon(@NonNull StorageIconState storageIconState, @Nullable Drawable drawable) - Set the icon for SD Card based on storage state.
  • @Nullable public Drawable getSDCardStorageIcon(@NonNull StorageIconState storageIconState) - Get the icon for SD Card based on storage state.
  • public void setStorageIconBackground(@DrawableRes int resourceId) - Set the sotrage icon background.
  • public void setStorageIconBackground(@Nullable Drawable icon) - Set the storage icon background.
  • @Nullable public Drawable getStorageIconBackground() - Get the background of the storage icon.
  • public void setCameraColorTextAppearance(@StyleRes int textAppearance) - Set the appearance of the camera color text.
  • public void setCameraColorTextColor(@NonNull ColorStateList colorStateList) - Set the color state list of the camera color text.
  • public void setCameraColorTextColor(@ColorInt int color) - Set the color of the camera color text.
  • @Nullable public ColorStateList getCameraColorTextColors() - Get the color state list of the camera color text.
  • @ColorInt public int getCameraColorTextColor() - Get the color of the camera color text.
  • public void setCameraColorTextSize(@Dimension float textSize) - Set the size of the camera color text.
  • @Dimension public float getCameraColorTextSize() - Get the size of the camera color text.
  • public void setCameraColorTextBackground(@Nullable Drawable drawable) - Set the background of the camera color text.
  • public void setCameraColorTextBackground(@DrawableRes int resourceId) - Set the background of the camera color text.
  • @Nullable public Drawable getCameraColorTextBackground() - Get the background of the camera color text.
  • public void setImageFormatTextAppearance(@StyleRes int textAppearance) - Set the appearance of the image format text.
  • public void setImageFormatTextColor(@NonNull ColorStateList colorStateList) - Set the color state list of the image format text.
  • public void setImageFormatTextColor(@ColorInt int color) - Set the color of the image format text.
  • @Nullable public ColorStateList getImageFormatTextColors() - Get the color state list of the image format text.
  • @ColorInt public int getImageFormatTextColor() - Get the color of the image format text.
  • public void setImageFormatTextSize(float textSize) - Set the size of the image format text.
  • @Dimension public float getImageFormatTextSize() - Get the size of the image format text.
  • public void setImageFormatTextBackground(@Nullable Drawable drawable) - Set the background of the image format text.
  • public void setImageFormatTextBackground(@DrawableRes int resourceId) - Set the background of the image format text.
  • @Nullable public Drawable getImageFormatTextBackground() - Get the background of the image format text.
  • public void setStatusCapacityTitleTextAppearance(@StyleRes int textAppearance) - Set the appearance of the status capacity title text.
  • public void setStatusCapacityTitleTextColor(@NonNull ColorStateList colorStateList) - Set the color state list of the status capacity title text.
  • public void setStatusCapacityTitleTextColor(@ColorInt int color) - Set the color of the status capcacity title text.
  • @Nullable public ColorStateList getStatusCapacityTitleTextColors() - Get the color state list of the status capacity title text.
  • @ColorInt public int getStatusCapacityTitleTextColor() - Get the color of the status capacity title text.
  • public void setStatusCapacityTitleTextSize(float textSize) - Set the size of the status capacity title text.
  • @Dimension public float getStatusCapacityTitleTextSize() - Get the size of the status capacity title text.
  • public void setStatusCapacityTitleTextBackground(@Nullable Drawable drawable) - Set the background of the status capacity title text.
  • public void setStatusCapacityTitleTextBackground(@DrawableRes int resourceId) - Set the background of the status capacity title text.
  • @Nullable public Drawable getStatusCapacityTitleTextBackground() - Get the background of the status capacity title text.
  • public void setStatusCapacityValueTextAppearance(@StyleRes int textAppearance)- Set the appearance of the status capacity value text.
  • public void setStatusCapacityValueTextColor(@NonNull ColorStateList colorStateList) - Set the color state list of the status capacity value text.
  • public void setStatusCapacityValueTextColor(@ColorInt int color) - Set the color of the status capacity value text.
  • @Nullable public ColorStateList getStatusCapacityValueTextColors() - Get the color state list of the status capacity value text.
  • @ColorInt public int getStatusCapacityValueTextColor() - Get the color of the status capacity value text.
  • public void setStatusCapacityValueTextSize(float textSize) - Set the size of the status capacity value text.
  • @Dimension public float getStatusCapacityValueTextSize() - Get the size of the status capacity value text
  • public void setStatusCapacityValueTextBackground(@Nullable Drawable drawable) - Set the background of the status capacity value text.
  • public void setStatusCapacityValueTextBackground(@DrawableRes int resourceId) - Set the background of the status capacity value text.
  • @Nullable public Drawable getStatusCapacityValueTextBackground() - Get the background of the status capacity value text.
Clone this wiki locally