Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eluleci/FlatUI
Android FlatUI Kit
https://github.com/eluleci/FlatUI
Last synced: about 1 month ago
JSON representation
Android FlatUI Kit
- Host: GitHub
- URL: https://github.com/eluleci/FlatUI
- Owner: eluleci
- Archived: true
- Created: 2013-11-19T11:13:10.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-25T16:46:13.000Z (about 10 years ago)
- Last Synced: 2024-08-03T17:21:52.728Z (5 months ago)
- Language: Java
- Homepage:
- Size: 1.64 MB
- Stars: 1,668
- Watchers: 121
- Forks: 426
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-android-ui - https://github.com/eluleci/FlatUI
- awesome-android-ui - https://github.com/eluleci/FlatUI
- awesome - FlatUI - Android FlatUI Kit (etc)
- awesome - FlatUI - Android FlatUI Kit (etc)
README
Android FlatUI
===================FlatUI is a library that lets you use native android widgets with a better and customized look.
You can define the widgets in XML or create on run time in JAVA. Even though the widgets are customized, you can create your styles with attributes.
There are many predefined themes inside this library but you can also use your own colors easily.
!!! There may be some unexpected results with different screen resolutions and different Android versions. If you have some problems or solutions to those problems please let me know.
Features included
-----------------
* Creating widgets inside XML.
* Creating widgets inside JAVA.
* Using existing and custom themes.
* Using existing and custom fonts.
* Changing theme and attributes at runtime.
* Changing ActionBar theme.Latest Changes
-----------------
* Add ease and ripple effects to buttons : 3.0.0
* Fix issue #30 - Merge pull requests #34 (@sherwinrobles), #32 (@aliok), #28 (@weiwelcome0) :2.2.0
* Fix issue #22 - NPE-while-creating-views-dynamically :2.1.1
* Fix issue #14, 15, 19, 26 - Attribute name clash (contribution from @aimanbaharum) :2.1.0
* Fix issue #17 - FlatButton padding applied (solution from @jstefanowski) :2.0.4
* Fix issue #18 - Consecutive activity opening (pull request from @michalbrz) :2.0.3Widgets
-----------
![Themes][1]Themes
-----------
![Themes][2]Including into your project
-------------------------Add the following dependency to your `build.gradle`.
dependencies {
compile 'com.github.eluleci:flatui:3.0.0'
}## Main Java functions
```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));```
## Using custom colors
You can use your own colors in two ways.
1 - Creating color array in xml and referencing it.
```xml
#ad843d
#d4a14a
#fbbf58
#fae8c8@color/custom_theme_darker
@color/custom_theme_dark
@color/custom_theme_primary
@color/custom_theme_light```
2 - Creating color array in java and setting it
```java
int[] myColors = {Color.RED, Color.BLUE, Color.GREEN, Color.BLACK};
((FlatSeekBar) findViewById(R.id.seekbar)).getAttributes().setColors(myColors);
```
## Using custom fonts
Roboto and Open Sans are already included to the library but you can use any font with Android FlatUI.
Place your font file in assets/fonts/ folder of your project and use fontFamily and fontWeight attributes to your view.
Your font file's name should be formatted like 'fontname_fontweight.ttf'.
It is important to name the font file in correct way otherwise the font cannot be created.
If your font file is .otf you can use the 'fontExtension' attribute for it.```xml
```
## Attribute list
These are only common attributes for most of the views. You can see the full list of available attributes in [attrs.xml][3]
- fl_theme : theme of the element (reference: @array/themeName)
- fl_textAppearance : text color on the element. dark or light colors of the theme.(none, dark, light)
- fl_fontFamily : name of the font family (string)
- fl_fontWeight : font weight of the text (string) (extralight, light, regular, bold, extrabold)
- fl_fontExtension : extension of the font. use if not ttf (string)- fl_borderWidth : border width of the element. (dimension)
- fl_cornerRadius : corner radius of the element. (dimension)
- fl_size : size of the element. (dimension)## Samples
Only showing specific attributes for views.
```xml
xmlns:flatui="http://schemas.android.com/apk/res-auto"
```License
--------Copyright 2014 CengaLabs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.[1]: https://raw.github.com/eluleci/FlatUI/master/sample-images/showcase.png
[2]: https://raw.github.com/eluleci/FlatUI/master/sample-images/themes.png
[3]: https://github.com/eluleci/FlatUI/blob/master/library/src/main/res/values/attrs.xml