Skip to content

Commit 2bce203

Browse files
author
hongyangAndroid
committed
add android-percent-support-extends
1 parent 44efc71 commit 2bce203

File tree

78 files changed

+3836
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3836
-1
lines changed

README-orgin.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
Android Percent Support Lib Sample :triangular_ruler::triangular_ruler::triangular_ruler:
2+
===================================
3+
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-android--percent--support--lib--sample-green.svg?style=flat)](https://android-arsenal.com/details/3/2054)
4+
5+
I made a sample of the new percent support library.<br>
6+
It will be documented soon on android dev website so it's just a proof of concept :)<br>
7+
You can check official docs reference [here](https://juliengenoud.github.io/android-percent-support-lib-sample/)
8+
9+
This library provide percentage based layouts,
10+
horizontal and vertical at the same time.
11+
12+
## simple result
13+
![PercentRelativeLayout](https://cloud.githubusercontent.com/assets/1808854/8392086/dd20ee1e-1cdd-11e5-852e-795a0d00cc89.png)
14+
## complex result
15+
![PercentRelativeLayout Complex](https://cloud.githubusercontent.com/assets/1808854/8398283/22bd374c-1de8-11e5-9e74-f19ea46b8086.png)
16+
<br>from https://gist.github.com/shekarshine/5458f697c02e5619b0e2
17+
18+
19+
20+
21+
22+
### How to use :
23+
just add percent support library to your project
24+
```xml
25+
dependencies {
26+
compile 'com.android.support:percent:22.2.0'
27+
}
28+
```
29+
30+
###Supported Layouts :
31+
32+
####PercentRelativeLayout
33+
```xml
34+
<android.support.percent.PercentRelativeLayout
35+
xmlns:android="http://schemas.android.com/apk/res/android"
36+
xmlns:app="http://schemas.android.com/apk/res-auto"
37+
android:layout_width="match_parent"
38+
android:layout_height="match_parent">
39+
40+
<View
41+
android:id="@+id/top_left"
42+
android:layout_width="0dp"
43+
android:layout_height="0dp"
44+
android:layout_alignParentTop="true"
45+
android:background="#ff44aacc"
46+
app:layout_heightPercent="20%"
47+
app:layout_widthPercent="70%" />
48+
49+
<View
50+
android:id="@+id/top_right"
51+
android:layout_width="0dp"
52+
android:layout_height="0dp"
53+
android:layout_alignParentTop="true"
54+
android:layout_toRightOf="@+id/top_left"
55+
android:background="#ffe40000"
56+
app:layout_heightPercent="20%"
57+
app:layout_widthPercent="30%" />
58+
59+
60+
<View
61+
android:id="@+id/bottom"
62+
android:layout_width="match_parent"
63+
android:layout_height="0dp"
64+
android:layout_below="@+id/top_left"
65+
android:background="#ff00ff22"
66+
app:layout_heightPercent="80%" />
67+
</android.support.percent.PercentRelativeLayout>
68+
```
69+
70+
####PercentFrameLayout
71+
```xml
72+
<android.support.percent.PercentFrameLayout
73+
xmlns:android="http://schemas.android.com/apk/res/android"
74+
xmlns:app="http://schemas.android.com/apk/res-auto"
75+
android:layout_width="match_parent"
76+
android:layout_height="match_parent">
77+
<!-- ... XML CODE -->
78+
</android.support.percent.PercentFrameLayout>
79+
```
80+
81+
###Stylable :
82+
83+
- heightPercent
84+
- widthPercent
85+
- marginBottomPercent
86+
- marginEndPercent
87+
- marginLeftPercent
88+
- marginPercent
89+
- marginRightPercent
90+
- marginStartPercent
91+
- marginTopPercent
92+
93+
Pre-requisites
94+
--------------
95+
96+
- Android SDK v22
97+
- Android Build Tools v22.0.1
98+
- Android Percent Support Repository v22.2.0
99+
- Android Support v4 Repository v22.2.0
100+
101+
according to the the manifest minsdk is v7 (android 2.1)
102+
103+
####License Mit

0 commit comments

Comments
 (0)