An open API service indexing awesome lists of open source software.

https://github.com/3sidedcube/guidestyle-android-client


https://github.com/3sidedcube/guidestyle-android-client

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# Style Guide library

https://user-images.githubusercontent.com/4551077/231733266-e705ead8-c94c-4be5-9f77-f315de78177d.mp4

## What is the Style Guide lib?
The StyleGuide lib is a designer tool that 3SidedCube has created in order to make sure that all the UI components match the designs before we implement all the screens. Designers and developers can verify that by reviewing all the colors, dimens, styles and the basic views (Buttons, RadioButtons, Switches, CheckBoxes)

## Rules
In order the StyleGuide to pick up the Heading, Body, Subtitle, Captions styles, they should be written in the following format:

```

<item name="android:textSize">24sp</item>
<item name="android:lineHeight">32dp</item>


<item name="android:textSize">14sp</item>
<item name="android:lineHeight">32dp</item>

```

For better grouping of the color we recommend using the following way(etc namecolor_variation):
```
#2A533E
#4F9C75
#69CD9A
#ADE4C8
#E2FAEE
```

## Usage
You can just call the StyleGuide from your activity either as an Activity or as BottomSheetFragment:

```
startActivity(Intent(this, StyleGuideActivity::class.java))
```

or
```
StyleGuideFragment().show(supportFragmentManager, StyleGuideFragment::class.java.name)
```

# Hacks
Many times we will implement custom views in our projects. In order to show this custom views, we can extend the StyleGuideFragment and add the views that we want:
```
class CustomStyleGuide : StyleGuideFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
/**
* call the super if you want to have the default StyleGuide for the main views (etc Colors, Buttons, TextStyles, RadioButton,CheckBoxes, Switches )
* or remove it if you only want your custom views
*/
super.onViewCreated(view, savedInstanceState)
val text = TextView(context)
text.text = "test"
addCustomView(text)
val text2 = TextView(context)
text2.text = "test2"
addCustomView(text2)
}
```

## Installation
To use in a project add the following to the repositories list in your root gradle file:
```
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
Add the following dependency to the app gradle file:
```
implementation 'com.github.3sidedcube:guidestyle-android-client:v0.2.0'
```

## License

See LICENSE.md