├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── jp │ │ └── shts │ │ └── android │ │ └── trianglelabelview │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── jp │ │ │ └── shts │ │ │ └── android │ │ │ └── trianglelabelview │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable │ │ ├── s_image_1.jpg │ │ ├── s_image_2.jpg │ │ ├── s_image_3.jpg │ │ └── s_image_4.jpg │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── card_left_bottom.xml │ │ ├── card_left_top.xml │ │ ├── card_right_bottom.xml │ │ ├── card_right_top.xml │ │ └── content_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── color_material.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── jp │ └── shts │ └── android │ └── trianglelabelview │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── img └── capture.png ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── jp │ │ └── shts │ │ └── android │ │ └── library │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── jp │ │ │ └── shts │ │ │ └── android │ │ │ └── library │ │ │ └── TriangleLabelView.java │ └── res │ │ └── values │ │ ├── attrs.xml │ │ └── strings.xml │ └── test │ └── java │ └── jp │ └── shts │ └── android │ └── library │ └── ExampleUnitTest.java └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .idea/ 7 | .DS_Store 8 | /build 9 | /captures 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TriangleLabelView 2 | ==================== 3 | Show triangle view. 4 | 5 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-TriangleLabelView-green.svg?style=true)](https://android-arsenal.com/details/1/3336) 6 | 7 | [![](https://jitpack.io/v/shts/TriangleLabelView.svg)](https://jitpack.io/#shts/TriangleLabelView) 8 | 9 | 10 | 11 | 12 | 13 | How to Use 14 | ===== 15 | 16 | To see how the TriangleLabelView are added to your xml layouts, check the sample project. 17 | 18 | ``` 19 | 35 | 36 | ``` 37 | 38 | Install 39 | ===== 40 | 41 | Add it in your root `build.gradle` at the end of repositories: 42 | 43 | ```groovy 44 | allprojects { 45 | repositories { 46 | ... 47 | maven { url "https://jitpack.io" } 48 | } 49 | } 50 | ``` 51 | Add the dependency 52 | 53 | ```groovy 54 | dependencies { 55 | compile 'com.github.shts:TriangleLabelView:1.1.2' 56 | } 57 | ``` 58 | 59 | Credits 60 | ======= 61 | I used [LabelView](https://github.com/corerzhang/LabelView) library by [Corer](https://github.com/corerzhang) as a base for development. 62 | 63 | License 64 | ======= 65 | 66 | Copyright (C) 2016 Shota Saito 67 | 68 | Licensed under the Apache License, Version 2.0 (the "License"); 69 | you may not use this file except in compliance with the License. 70 | You may obtain a copy of the License at 71 | 72 | http://www.apache.org/licenses/LICENSE-2.0 73 | 74 | Unless required by applicable law or agreed to in writing, software 75 | distributed under the License is distributed on an "AS IS" BASIS, 76 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 77 | See the License for the specific language governing permissions and 78 | limitations under the License. 79 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.1" 6 | 7 | defaultConfig { 8 | applicationId "jp.shts.android.trianglelabelview" 9 | minSdkVersion 10 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:24.2.0' 26 | compile 'com.android.support:design:24.2.0' 27 | compile 'com.android.support:cardview-v7:24.2.0' 28 | compile project(':library') 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/adt-bundle-mac-x86_64-20131030/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/jp/shts/android/trianglelabelview/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package jp.shts.android.trianglelabelview; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/jp/shts/android/trianglelabelview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package jp.shts.android.trianglelabelview; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.support.v7.widget.Toolbar; 6 | 7 | public class MainActivity extends AppCompatActivity { 8 | 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | setContentView(R.layout.activity_main); 13 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 14 | toolbar.setTitle(R.string.app_name); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/s_image_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/drawable/s_image_1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/s_image_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/drawable/s_image_2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/s_image_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/drawable/s_image_3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/s_image_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/drawable/s_image_4.jpg -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_left_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 16 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_left_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 16 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_right_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 16 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/card_right_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 16 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 20 | 25 | 30 | 31 | 36 | 41 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shts/TriangleLabelView/fb0a1df514ea37d39fabbfff93d08ca482cd2a48/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | > 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/color_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 16 | #FFEBEE 17 | #FFCDD2 18 | #EF9A9A 19 | #E57373 20 | #EF5350 21 | #F44336 22 | #E53935 23 | #D32F2F 24 | #C62828 25 | #B71C1C 26 | #FF8A80 27 | #FF5252 28 | #FF1744 29 | #D50000 30 | 31 | #EDE7F6 32 | #D1C4E9 33 | #B39DDB 34 | #9575CD 35 | #7E57C2 36 | #673AB7 37 | #5E35B1 38 | #512DA8 39 | #4527A0 40 | #311B92 41 | #B388FF 42 | #7C4DFF 43 | #651FFF 44 | #6200EA 45 | 46 | #E1F5FE 47 | #B3E5FC 48 | #81D4FA 49 | #4FC3F7 50 | #29B6F6 51 | #03A9F4 52 | #039BE5 53 | #0288D1 54 | #0277BD 55 | #01579B 56 | #80D8FF 57 | #40C4FF 58 | #00B0FF 59 | #0091EA 60 | 61 | #E8F5E9 62 | #C8E6C9 63 | #A5D6A7 64 | #81C784 65 | #66BB6A 66 | #4CAF50 67 | #43A047 68 | #388E3C 69 | #2E7D32 70 | #1B5E20 71 | #B9F6CA 72 | #69F0AE 73 | #00E676 74 | #00C853 75 | 76 | #FFFDE7 77 | #FFF9C4 78 | #FFF59D 79 | #FFF176 80 | #FFEE58 81 | #FFEB3B 82 | #FDD835 83 | #FBC02D 84 | #F9A825 85 | #F57F17 86 | #FFFF8D 87 | #FFFF00 88 | #FFEA00 89 | #FFD600 90 | 91 | #FBE9E7 92 | #FFCCBC 93 | #FFAB91 94 | #FF8A65 95 | #FF7043 96 | #FF5722 97 | #F4511E 98 | #E64A19 99 | #D84315 100 | #BF360C 101 | #FF9E80 102 | #FF6E40 103 | #FF3D00 104 | #DD2C00 105 | 106 | #ECEFF1 107 | #CFD8DC 108 | #B0BEC5 109 | #90A4AE 110 | #78909C 111 | #607D8B 112 | #546E7A 113 | #455A64 114 | #37474F 115 | #263238 116 | 117 | #FCE4EC 118 | #F8BBD0 119 | #F48FB1 120 | #F06292 121 | #EC407A 122 | #E91E63 123 | #D81B60 124 | #C2185B 125 | #AD1457 126 | #880E4F 127 | #FF80AB 128 | #FF4081 129 | #F50057 130 | #C51162 131 | 132 | #E8EAF6 133 | #C5CAE9 134 | #9FA8DA 135 | #7986CB 136 | #5C6BC0 137 | #3F51B5 138 | #3949AB 139 | #303F9F 140 | #283593 141 | #1A237E 142 | #8C9EFF 143 | #536DFE 144 | #3D5AFE 145 | #304FFE 146 | 147 | #E0F7FA 148 | #B2EBF2 149 | #80DEEA 150 | #4DD0E1 151 | #26C6DA 152 | #00BCD4 153 | #00ACC1 154 | #0097A7 155 | #00838F 156 | #006064 157 | #84FFFF 158 | #18FFFF 159 | #00E5FF 160 | #00B8D4 161 | 162 | #F1F8E9 163 | #DCEDC8 164 | #C5E1A5 165 | #AED581 166 | #9CCC65 167 | #8BC34A 168 | #7CB342 169 | #689F38 170 | #558B2F 171 | #33691E 172 | #CCFF90 173 | #B2FF59 174 | #76FF03 175 | #64DD17 176 | 177 | #FFF8E1 178 | #FFECB3 179 | #FFE082 180 | #FFD54F 181 | #FFCA28 182 | #FFC107 183 | #FFB300 184 | #FFA000 185 | #FF8F00 186 | #FF6F00 187 | #FFE57F 188 | #FFD740 189 | #FFC400 190 | #FFAB00 191 | 192 | #EFEBE9 193 | #D7CCC8 194 | #BCAAA4 195 | #A1887F 196 | #8D6E63 197 | #795548 198 | #6D4C41 199 | #5D4037 200 | #4E342E 201 | #3E2723 202 | 203 | #F3E5F5 204 | #E1BEE7 205 | #CE93D8 206 | #BA68C8 207 | #AB47BC 208 | #9C27B0 209 | #8E24AA 210 | #7B1FA2 211 | #6A1B9A 212 | #4A148C 213 | #EA80FC 214 | #E040FB 215 | #D500F9 216 | #AA00FF 217 | 218 | #E3F2FD 219 | #BBDEFB 220 | #90CAF9 221 | #64B5F6 222 | #42A5F5 223 | #2196F3 224 | #1E88E5 225 | #1976D2 226 | #1565C0 227 | #0D47A1 228 | #82B1FF 229 | #448AFF 230 | #2979FF 231 | #2962FF 232 | 233 | #E0F2F1 234 | #B2DFDB 235 | #80CBC4 236 | #4DB6AC 237 | #26A69A 238 | #009688 239 | #00897B 240 | #00796B 241 | #00695C 242 | #004D40 243 | #A7FFEB 244 | #64FFDA 245 | #1DE9B6 246 | #00BFA5 247 | 248 | #F9FBE7 249 | #F0F4C3 250 | #E6EE9C 251 | #DCE775 252 | #D4E157 253 | #CDDC39 254 | #C0CA33 255 | #AFB42B 256 | #9E9D24 257 | #827717 258 | #F4FF81 259 | #EEFF41 260 | #C6FF00 261 | #AEEA00 262 | 263 | #FFF3E0 264 | #FFE0B2 265 | #FFCC80 266 | #FFB74D 267 | #FFA726 268 | #FF9800 269 | #FB8C00 270 | #F57C00 271 | #EF6C00 272 | #E65100 273 | #FFD180 274 | #FFAB40 275 | #FF9100 276 | #FF6D00 277 | 278 | #FAFAFA 279 | #F5F5F5 280 | #EEEEEE 281 | #E0E0E0 282 | #BDBDBD 283 | #9E9E9E 284 | #757575 285 | #616161 286 | #424242 287 | #212121 288 | 289 | #000000 290 | #FFFFFF 291 | 292 | 293 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | TriangleLabelView 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |