### XML Usage Examples for FlatUI Android Views
Source: https://github.com/eluleci/flatui/blob/master/README.md
Demonstrates how to apply various FlatUI custom attributes to different Android views like `SomeFlatView`, `FlatTextView`, `FlatEditText`, `FlatButton`, `FlatCheckBox`, `FlatRadioButton`, and `FlatToggleButton` within an XML layout file. It includes examples for theme, text appearance, font, border, corner radius, size, background color, field style, touch effect, and dot margin attributes.
```XML
xmlns:flatui="http://schemas.android.com/apk/res-auto"
```
--------------------------------
### Initialize FlatUI and Set Default Theme in Android Java
Source: https://github.com/eluleci/flatui/blob/master/README.md
This Java code demonstrates essential FlatUI initialization steps. It shows how to initialize default values for screen compatibility, set a global default theme (either predefined or custom), and apply a FlatUI-styled background to the ActionBar or SupportActionBar.
```Java
// Converts the default values (radius, size, border) to dp to be compatible with different
// screen sizes. If you skip this there may be problem with different screen densities
FlatUI.initDefaultValues(this);
// Setting default theme to avoid to add the attribute "theme" to XML
// and to be able to change the whole theme at once
FlatUI.setDefaultTheme(FlatUI.DEEP);
FlatUI.setDefaultTheme(R.array.my_custom_theme); // for using custom theme as default
// Getting action bar drawable and setting it.
// Sometimes weird problems may occur while changing action bar drawable at runtime.
// You can try to set title of the action bar to invalidate it after setting background.
getActionBar().setBackgroundDrawable(FlatUI.getActionBarDrawable(FlatUI.DEEP, false));
getSupportActionBar().setBackgroundDrawable(FlatUI.getActionBarDrawable(FlatUI.DEEP, false));
```
--------------------------------
### Define and Apply Custom FlatUI Themes in XML
Source: https://github.com/eluleci/flatui/blob/master/README.md
This XML snippet illustrates how to define a custom color theme for FlatUI widgets. It involves creating an integer array of colors in 'colors.xml' and then referencing this array as the 'fl_theme' attribute in a FlatUI view within your layout file.
```XML
#ad843d
#d4a14a
#fbbf58
#fae8c8
- @color/custom_theme_darker
- @color/custom_theme_dark
- @color/custom_theme_primary
- @color/custom_theme_light
```
--------------------------------
### Add FlatUI Library Dependency to Gradle
Source: https://github.com/eluleci/flatui/blob/master/README.md
This snippet demonstrates how to include the FlatUI library in an Android project. Add the specified 'compile' dependency to your module's 'build.gradle' file to integrate the library and access its features.
```Gradle
dependencies {
compile 'com.github.eluleci:flatui:3.0.0'
}
```
--------------------------------
### Apply Custom FlatUI Colors Programmatically in Java
Source: https://github.com/eluleci/flatui/blob/master/README.md
This Java code demonstrates how to apply custom colors to a FlatUI widget at runtime. It involves creating an integer array of color values and then setting these colors directly to the 'Attributes' object of a FlatUI view, such as a 'FlatSeekBar'.
```Java
int[] myColors = {Color.RED, Color.BLUE, Color.GREEN, Color.BLACK};
((FlatSeekBar) findViewById(R.id.seekbar)).getAttributes().setColors(myColors);
```
--------------------------------
### Apply Custom Fonts to FlatUI Views in XML
Source: https://github.com/eluleci/flatui/blob/master/README.md
This XML snippet shows how to integrate custom fonts with FlatUI views. Place your font file in 'assets/fonts/' and then use 'fl_fontFamily', 'fl_fontWeight', and optionally 'fl_fontExtension' attributes in your view definition. Font file names must follow the 'fontname_fontweight.ttf' format.
```XML
```
--------------------------------
### ProGuard Rule for Android WebView JavaScript Interface
Source: https://github.com/eluleci/flatui/blob/master/sample/proguard-rules.txt
This ProGuard rule demonstrates how to prevent obfuscation of public methods within a JavaScript interface class used by an Android WebView. Uncommenting and replacing 'fqcn.of.javascript.interface.for.webview' with the actual class name ensures JavaScript can properly invoke these methods.
```ProGuard
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.