2017년 6월 4일 일요일

[STUDY] Android "android-flowlayout" 라이브러리 소개

[목차]===========================================================
1. android-flowlayout 소개
2. android-flowlayout 라이브러리 정보
  1) 라이브러리 다운로드 주소
  2) Installation and usage
  3) Detailed parameters
  4) License
================================================================

1. android-flowlayout 소개
자바 GUI에는 FlowLayout이라는 유용한 레이아웃이 있는데, 안드로이드에는 없어서 만들어진 오픈소스입니다.
UI를 배치하다가 공간이 부족한 경우, 줄바꿈하여 다음행에서 계속 UI를 배치하는 레이아웃임


2. android-flowlayout 라이브러리 정보
  1) 라이브러리 다운로드 주소
     https://github.com/ApmeM/android-flowlayout 

  2) Installation and usage
  • Add it as dependency in Gradle as : compile 'org.apmem.tools:layouts:1.10@aar'
  • Or maven
    <dependency>
        <groupId>org.apmem.tools</groupId>
        <artifactId>layouts</artifactId>
        <version>1.10</version>
        <scope>provided</scope>
    </dependency>

  • Add the following xml code into your layout/something.xml:
<org.apmem.tools.layouts.FlowLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
</org.apmem.tools.layouts.FlowLayout>
  • Android gravity now supported (in combination with elements weight):
    f:weightDefault="1.0"
    android:gravity="fill"
  • To override default spacing between elements use default android margins in the child View element:
android:layout_marginTop="32dip"
android:layout_marginRight="32dip"
  • Also if you need to break line before some object even if there is enough space for it in the previous line - use the following LayoutParameter in the child view element:
f:layout_newLine="true"

  3) Detailed parameters
  • android:orientation - line direction. Use one of the following values:

* horizontal - line will be in horizontal direction, linebreak will create new line

* vertical - line will be in vertical direction, linebreak will create new column

  •     android:gravity - standart android gravity supported
  • debugDraw - draw debug information
  • weightDefault - default weight value for child elements. Used to fill line in case of Gravity.FILL_HORIZONTAL | Gravity.FILL_VERTICAL
  • layoutDirection - direction of inner child elements:
            *  ltr - left to right direction

            *  rtl - right to left direction
  • android:layout_margin* - override default spacings
  • android:layout_gravity - standart aandroid gravity supported
    * layout_weight - weight of the element. If not specified "layout.defaultWight" is used.

  • layout_newLine - brake line before current element even if there is enough place in the current line.
  4) License
Copyrights
Copyright 2011, Artem Votincev (apmem.org)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
   http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


출처 : 인터넷에서 검색하여 필요한 정보를 다양한 사이트에서 종합하여 작성된 것입니다. 많은 사이트 내용을 종합하여 공부하여 작성하다보니 일일이 나열하지 못하였습니다. ㅈㅅ(_ _) 이글은 자유롭게 퍼 가셔서 도움이 되었으면 좋겠습니다. 감사합니다.
 

댓글 없음:

댓글 쓰기