├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── app-release.apk ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── xiaochao │ │ └── lclableview │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── xiaochao │ │ │ └── lclableview │ │ │ ├── Blank1Fragment.java │ │ │ ├── Blank2Fragment.java │ │ │ ├── Blank3Fragment.java │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable │ │ └── bag.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── fragment_blank1.xml │ │ ├── fragment_blank2.xml │ │ ├── fragment_blank3.xml │ │ └── fragment_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 │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── xiaochao │ └── lclableview │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── image ├── image1.png ├── image2.png └── image3.png ├── lclablelibrary ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── xiaochao │ │ └── lclablelibrary │ │ └── LabelView.java │ └── res │ └── values │ ├── attrs.xml │ └── strings.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | LcLableView -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 26 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #LablieView 2 | - 第一次写的开源控件,大家如果有什么更好的意见可以一起参与完善 3 | - 如果使用后有什么新的意见可以联系我 4 | - 邮箱:80945540@qq.com 5 | - [下载APK](http://fir.im/LcLableView) 6 | 7 | ## 效果图 8 | 9 | 10 | 11 | 12 | 13 | ### 使用说明 14 | 15 | 导入 lclablelibrary 到项目中 16 | 17 | 在 build.gradle 的 dependencies 添加: 18 | ``` 19 | dependencies { 20 | compile fileTree(include: ['*.jar'], dir: 'libs') 21 | .... 22 | compile project(':lclablelibrary') 23 | } 24 | ``` 25 | 26 | #### 属性 27 | 28 | | Attribute 属性 | Description 描述 | 29 | |:--- |:---| 30 | | lv_text | 设置文字内容 | 31 | | lv_text_color | 设置文字颜色,默认#ffffff | 32 | | lv_text_size | 设置文字大小,默认11sp | 33 | | lv_text_bold | 设置文字是否支持加粗,默认true | 34 | | lv_text_all_caps | 设置文字是否支持全部大写,默认true | 35 | | lv_background_color | 设置背景颜色,默认"#FF4081" | 36 | | lv_min_size | 设置LabelView所在矩形最小宽高,默认35dp或50dp | 37 | | lv_padding | 设置文字上下padding,默认3.5dp | 38 | | lv_gravity | 设置LabelView方向 | 39 | | lv_fill_triangle | 设置是否填充三角区域,默认false | 40 | | lv_fill_size | 设置是否浮嵌显示大小 | 41 | 42 | 43 | ### 实际使用代码 44 | 45 | ######使用空边标签时 46 | 47 | ``` 48 | 51 | 57 | 58 | 67 | 68 | ``` 69 | 70 | #####使用浮嵌标签时 71 | 72 | 要注意容器的android:layout_margin="3dp"必须和lv:lv_fill_size="3"值一样 73 | ``` 74 | 77 | 84 | 85 | 94 | 95 | ``` 96 | 97 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/80945540/LcLableView/16c1f1039b01b85a95ef814bbab39e64cf2a3400/app/app-release.apk -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.xiaochao.lclableview" 9 | minSdkVersion 23 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(include: ['*.jar'], dir: 'libs') 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.4.0' 26 | compile 'com.android.support:design:23.4.0' 27 | compile project(':lclablelibrary') 28 | } 29 | -------------------------------------------------------------------------------- /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 C:\Users\Administrator\AppData\Local\Android\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/com/xiaochao/lclableview/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.xiaochao.lclableview; 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/com/xiaochao/lclableview/Blank1Fragment.java: -------------------------------------------------------------------------------- 1 | package com.xiaochao.lclableview; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | 7 | import android.support.v4.app.Fragment; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | 12 | 13 | 14 | public class Blank1Fragment extends Fragment { 15 | 16 | @Override 17 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 18 | Bundle savedInstanceState) { 19 | // Inflate the layout for this fragment 20 | return inflater.inflate(R.layout.fragment_blank1, container, false); 21 | } 22 | 23 | @Override 24 | public void onViewCreated(View view, Bundle savedInstanceState) { 25 | super.onViewCreated(view, savedInstanceState); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaochao/lclableview/Blank2Fragment.java: -------------------------------------------------------------------------------- 1 | package com.xiaochao.lclableview; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | 12 | public class Blank2Fragment extends Fragment { 13 | 14 | @Override 15 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 16 | Bundle savedInstanceState) { 17 | // Inflate the layout for this fragment 18 | return inflater.inflate(R.layout.fragment_blank2, container, false); 19 | } 20 | 21 | @Override 22 | public void onViewCreated(View view, Bundle savedInstanceState) { 23 | super.onViewCreated(view, savedInstanceState); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaochao/lclableview/Blank3Fragment.java: -------------------------------------------------------------------------------- 1 | package com.xiaochao.lclableview; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | 12 | 13 | public class Blank3Fragment extends Fragment { 14 | 15 | @Override 16 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 17 | Bundle savedInstanceState) { 18 | // Inflate the layout for this fragment 19 | return inflater.inflate(R.layout.fragment_blank3, container, false); 20 | } 21 | 22 | @Override 23 | public void onViewCreated(View view, Bundle savedInstanceState) { 24 | super.onViewCreated(view, savedInstanceState); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/xiaochao/lclableview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.xiaochao.lclableview; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.design.widget.TabLayout; 7 | import android.support.v4.app.Fragment; 8 | import android.support.v4.app.FragmentManager; 9 | import android.support.v4.app.FragmentPagerAdapter; 10 | import android.support.v4.view.ViewPager; 11 | import android.support.v7.app.AppCompatActivity; 12 | import android.support.v7.widget.Toolbar; 13 | import android.view.Menu; 14 | import android.view.MenuItem; 15 | import android.widget.Toast; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | public class MainActivity extends AppCompatActivity { 21 | 22 | 23 | private SectionsPagerAdapter mSectionsPagerAdapter; 24 | 25 | private ViewPager mViewPager; 26 | private List mFragmentList=new ArrayList(); 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_main); 31 | mFragmentList.add(new Blank1Fragment()); 32 | mFragmentList.add(new Blank2Fragment()); 33 | mFragmentList.add(new Blank3Fragment()); 34 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 35 | setSupportActionBar(toolbar); 36 | mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); 37 | mViewPager = (ViewPager) findViewById(R.id.container); 38 | mViewPager.setAdapter(mSectionsPagerAdapter); 39 | 40 | TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); 41 | tabLayout.setupWithViewPager(mViewPager); 42 | 43 | 44 | } 45 | 46 | 47 | @Override 48 | public boolean onCreateOptionsMenu(Menu menu) { 49 | getMenuInflater().inflate(R.menu.menu_main, menu); 50 | return true; 51 | } 52 | 53 | @Override 54 | public boolean onOptionsItemSelected(MenuItem item) { 55 | int id = item.getItemId(); 56 | 57 | if (id == R.id.action_settings) { 58 | Uri uri = Uri.parse("https://github.com/80945540/LcLableView"); 59 | Intent it = new Intent(Intent.ACTION_VIEW, uri); 60 | startActivity(it); 61 | return true; 62 | } 63 | 64 | return super.onOptionsItemSelected(item); 65 | } 66 | 67 | public class SectionsPagerAdapter extends FragmentPagerAdapter { 68 | 69 | public SectionsPagerAdapter(FragmentManager fm) { 70 | super(fm); 71 | } 72 | 73 | @Override 74 | public Fragment getItem(int position) { 75 | 76 | return mFragmentList.get(position); 77 | } 78 | 79 | @Override 80 | public int getCount() { 81 | return 3; 82 | } 83 | 84 | @Override 85 | public CharSequence getPageTitle(int position) { 86 | switch (position) { 87 | case 0: 88 | return "浮嵌"; 89 | case 1: 90 | return "实边"; 91 | case 2: 92 | return "空边"; 93 | } 94 | return null; 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bag.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_blank1.xml: -------------------------------------------------------------------------------- 1 | 9 | 13 | 17 | 24 | 27 | 34 | 35 | 44 | 45 | 46 | 53 | 56 | 63 | 64 | 74 | 75 | 76 | 83 | 86 | 93 | 94 | 104 | 105 | 106 | 113 | 116 | 123 | 124 | 129 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_blank2.xml: -------------------------------------------------------------------------------- 1 | 9 | 13 | 17 | 24 | 27 | 33 | 34 | 43 | 44 | 45 | 52 | 55 | 61 | 62 | 72 | 73 | 74 | 81 | 84 | 90 | 91 | 101 | 102 | 103 | 110 | 113 | 119 | 120 | 125 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_blank3.xml: -------------------------------------------------------------------------------- 1 | 9 | 13 | 17 | 24 | 27 | 33 | 34 | 42 | 43 | 44 | 51 | 54 | 60 | 61 | 70 | 71 | 72 | 79 | 82 | 88 | 89 | 98 | 99 | 100 | 107 | 110 | 116 | 117 | 122 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /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/80945540/LcLableView/16c1f1039b01b85a95ef814bbab39e64cf2a3400/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/80945540/LcLableView/16c1f1039b01b85a95ef814bbab39e64cf2a3400/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/80945540/LcLableView/16c1f1039b01b85a95ef814bbab39e64cf2a3400/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/80945540/LcLableView/16c1f1039b01b85a95ef814bbab39e64cf2a3400/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/80945540/LcLableView/16c1f1039b01b85a95ef814bbab39e64cf2a3400/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/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 | 8dp 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LcLableView 3 | 下载 4 | Hello World from section: %1$d 5 | 6 | 7 | Hello blank fragment 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |