Customization

Introduction
Our library provides the ability to customize the graphical interface; for this you need:
  1. Create a style in your application, inheriting it from the style that needs to be changed;
  2. Change the values of the required attributes;
  3. Use the replaceResourceId method of the UsedeskResourceManager class, thereby specifying the SDK with which style to replace the standard one.


Example:

UsedeskResourceManager.replaceResourceId(ru.usedesk.chat_gui.R.style.
Usedesk_Chat_Screen, R.style.Usedesk_Chat_Screen_Custom)

Concept
Many styles in the library can be replaced using the UsedeskResourceManager, as shown above.
Each of these styles refers to a specific object in an interface created with LayoutInflater, such as pages or list items. This style contains attributes whose values can store different values or other styles.
Nested styles do not need to be overridden using the UsedeskResourceManager, but can be replaced in the parent style.

Typical Styles
Since many styles are related to interface elements with the same type, several typical styles have similar attributes, both standard for android and our library.
In such styles, you can override all the attributes that an element has, for example:
  • layout_width
  • layout_height
  • margin
  • padding
  • and etc.
However, some of these styles have some quirks associated with standard attributes as well as non-standard attributes.
Text Styles

Styles ending in Text refer to elements of type TextView, for example:

Usedesk.Chat.Attachment.Dialog.Storage.Text
With this style, the text is overridden by the following arguments:
  • text
  • usedesk_text_1
  • usedesk_text_2
  • usedesk_text_3
And only if they are set in the style initially.
Image Styles

Styles ending in Image refer to elements of type ImageView, for example:

Usedesk.Chat.Attachment.Dialog.Storage.Image

In this style, the image is predefined by the following arguments:

  • srcCompat
  • usedesk_drawable_1
  • usedesk_drawable_2

And only if they are set in the style initially.

InputLayout Styles

Styles ending in InputLayout are of type InputLayout and have no non-standard arguments, for example:

Usedesk.Chat.Screen.Offline.Form.Email.InputLayout
EditText Styles

Styles ending in EditText refer to elements of type EditText and do not have any non-standard arguments, for example.

Usedesk.Chat.Screen.Offline.Form.Email.EditText