-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
michal_szwarc
committed
Mar 19, 2015
1 parent
0def9af
commit 7d1e2f5
Showing
3 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,54 @@ | ||
# MaterialSettings | ||
MaterialSettings - small library to create settings activity | ||
|
||
Work in progress... | ||
###Simple code: | ||
```java | ||
public class Settings1Activity extends MaterialSettings { | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
addItem(new HeaderItem(this).setTitle("Sample title 1")); | ||
addItem(new CheckboxItem(this, "key1").setTitle("Checkbox item 1").setSubtitle("Subtitle text 1").setOnCheckedChangeListener(new CheckboxItem.OnCheckedChangeListener() { | ||
@Override | ||
public void onCheckedChange(CheckboxItem cbi, boolean isChecked) { | ||
Toast.makeText(Settings1Activity.this, "CHECKED: " + isChecked, Toast.LENGTH_SHORT).show(); | ||
} | ||
})); | ||
} | ||
@Override | ||
public StorageInterface initStorageInterface() { | ||
return new PreferencesStorageInterface(this); | ||
} | ||
} | ||
``` | ||
|
||
### Style attrs | ||
* msToolbarTheme | ||
* msToolbarThemePopup | ||
* msColorPrimary - primary color | ||
* msColorPrimaryDark - color of status bar (api 21+) | ||
* msColorAccent - accent color | ||
* msWindowBg - default window bg color | ||
* msColorHeader - headers text color (usually same as msColorAccent) | ||
* msColorTextTitle - item title color | ||
* msColorTextSubTitle - subtitle text color | ||
* msDivider - divider drawable | ||
* msItem - whole item color | ||
* msTextStyle - reference to text title style (TextView) | ||
* msSubTextStyle - reference to text sub title style (TextView) | ||
* msHeaderStyle - reference to text title style (TextView) | ||
|
||
### Same style | ||
```xml | ||
<style name="MaterialSettings.Red" parent="MaterialSettingsTheme"> | ||
<item name="msColorPrimary">@color/redPrimary</item> | ||
<item name="msColorPrimaryDark">@color/redPrimaryDark</item> | ||
<item name="msColorAccent">@color/redAccent</item> | ||
<item name="msColorHeader">@color/redAccent</item> | ||
</style> | ||
``` | ||
|
||
# Screens | ||
![Default](/screens/theme_default.png) | ||
![Rec](/screens/theme_red.png) | ||
![Dark](/screens/theme_dark.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.