Skip to content

Commit

Permalink
Add vector sample
Browse files Browse the repository at this point in the history
  • Loading branch information
konifar committed Mar 12, 2016
1 parent 6d44aad commit 67ccf90
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ android {
targetSdkVersion 23
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
Expand All @@ -25,10 +26,10 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
//compile project(':likebutton')
compile 'com.github.jd-alexander:LikeButton:0.1.6'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile project(':likebutton')
//compile 'com.github.jd-alexander:LikeButton:0.1.6'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.mikepenz:iconics-core:2.5.2@aar'
compile 'com.mikepenz:community-material-typeface:1.3.41.1@aar'
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_android_green_500_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<path android:fillColor="#4CAF50" android:pathData="M6,18c0,0.55 0.45,1 1,1h1v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L11,19h2v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L16,19h1c0.55,0 1,-0.45 1,-1L18,8L6,8v10zM3.5,8C2.67,8 2,8.67 2,9.5v7c0,0.83 0.67,1.5 1.5,1.5S5,17.33 5,16.5v-7C5,8.67 4.33,8 3.5,8zM20.5,8c-0.83,0 -1.5,0.67 -1.5,1.5v7c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5v-7c0,-0.83 -0.67,-1.5 -1.5,-1.5zM15.53,2.16l1.3,-1.3c0.2,-0.2 0.2,-0.51 0,-0.71 -0.2,-0.2 -0.51,-0.2 -0.71,0l-1.48,1.48C13.85,1.23 12.95,1 12,1c-0.96,0 -1.86,0.23 -2.66,0.63L7.85,0.15c-0.2,-0.2 -0.51,-0.2 -0.71,0 -0.2,0.2 -0.2,0.51 0,0.71l1.31,1.31C6.97,3.26 6,5.01 6,7h12c0,-1.99 -0.97,-3.75 -2.47,-4.84zM10,5L9,5L9,4h1v1zM15,5h-1L14,4h1v1z"/>
</vector>
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_android_grey_500_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<path android:fillColor="#9E9E9E" android:pathData="M6,18c0,0.55 0.45,1 1,1h1v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L11,19h2v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L16,19h1c0.55,0 1,-0.45 1,-1L18,8L6,8v10zM3.5,8C2.67,8 2,8.67 2,9.5v7c0,0.83 0.67,1.5 1.5,1.5S5,17.33 5,16.5v-7C5,8.67 4.33,8 3.5,8zM20.5,8c-0.83,0 -1.5,0.67 -1.5,1.5v7c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5v-7c0,-0.83 -0.67,-1.5 -1.5,-1.5zM15.53,2.16l1.3,-1.3c0.2,-0.2 0.2,-0.51 0,-0.71 -0.2,-0.2 -0.51,-0.2 -0.71,0l-1.48,1.48C13.85,1.23 12.95,1 12,1c-0.96,0 -1.86,0.23 -2.66,0.63L7.85,0.15c-0.2,-0.2 -0.51,-0.2 -0.71,0 -0.2,0.2 -0.2,0.51 0,0.71l1.31,1.31C6.97,3.26 6,5.01 6,7h12c0,-1.99 -0.97,-3.75 -2.47,-4.84zM10,5L9,5L9,4h1v1zM15,5h-1L14,4h1v1z"/>
</vector>
22 changes: 16 additions & 6 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.like.example.MainActivity"
Expand All @@ -23,14 +21,14 @@
android:id="@+id/star_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon_size="25dp"
app:icon_size="22dp"
app:icon_type="star" />

<com.like.LikeButton
android:id="@+id/heart_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon_size="25dp"
app:icon_size="22dp"
app:anim_scale_factor="3"
app:icon_type="heart" />

Expand All @@ -42,7 +40,7 @@
app:circle_start_color="@android:color/holo_blue_bright"
app:dots_primary_color="@android:color/holo_blue_light"
app:dots_secondary_color="@android:color/holo_blue_dark"
app:icon_size="25dp"
app:icon_size="22dp"
app:like_drawable="@drawable/thumb_on"
app:unlike_drawable="@drawable/thumb_off" />

Expand All @@ -54,6 +52,18 @@
app:circle_start_color="@android:color/holo_purple"
app:dots_primary_color="@android:color/holo_blue_dark"
app:dots_secondary_color="@android:color/holo_blue_light"
app:icon_size="25dp" />
app:icon_size="22dp" />

<com.like.LikeButton
android:id="@+id/vector_android_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:circle_end_color="@android:color/holo_green_dark"
app:circle_start_color="@android:color/holo_green_dark"
app:dots_primary_color="@android:color/holo_green_dark"
app:dots_secondary_color="@android:color/holo_green_light"
app:icon_size="22dp"
app:like_drawable="@drawable/ic_android_green_500_24dp"
app:unlike_drawable="@drawable/ic_android_grey_500_24dp" />
</LinearLayout>
</RelativeLayout>

0 comments on commit 67ccf90

Please sign in to comment.