Skinning the Social SDKs

Skinning the Android SDKs

Every view in the Android KWS Social UI SDK is skinnable and comes with a default Skin. The Skin itself is a standard XML layout file. To connect the XML layout file with the actual components in code, we use the base ISkin protocol, out of which different types of skins are defined.

For example the UserView has this default standard XML layout, that we provide out of the box:

To link the above with the actual View component, you need to create an instance implementing IUserSkin.Detail, like so:

class MyUserSkin(override val layout: Int = R.layout.my_custom_user_skin,
                  override val userIcon: Int =,
                  override val userName: Int =,
                  override val followButton: Int =,
                  override val getFollowersButton: Int =,
                  override val bio: Int =,
                  override val bgImage: Int =,
                  override val followers: Int =,
                  override val following: Int =,
                  override val creations: Int = : IUserSkin.Detail

This specifies two things:

  1. The XML layout file that acts as source
  2. The IDs of each component that is mandatory

All sub-types of ISkin will have a number of essential components that are inseparable from that view. In the above example, a “UserView” will always need to have an icon, a user name, buttons for following or unfollowing, etc.

Since the XML layout is entirely decoupled from the View type defined in code, any layout with any colour scheme or copy can be created.