├── .circleci └── config.yml ├── .github ├── issue_template.md └── workflows │ └── gradle-wrapper-validation.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── assets ├── align-content.gif ├── align-items.gif ├── divider-beginning-middle.png ├── flex-direction.gif ├── flex-wrap.gif ├── flexbox-layoutmanager.gif ├── flexbox-visual.png ├── fluid-grid │ ├── nexus9-full-width.png │ ├── nexus9-half.png │ ├── nexus9-one-fourth.png │ └── nexus9-three-fourth.png ├── justify-content.gif ├── layout_alignSelf.gif ├── layout_flexBasisPercent.gif ├── layout_flexGrow.gif ├── layout_flexShrink.gif ├── layout_maxWidth.gif ├── layout_minWidth.gif ├── layout_order.gif ├── layout_wrapBefore.gif └── pngs │ └── check_green_small.png ├── build.gradle ├── demo-cat-gallery ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── google │ │ └── android │ │ └── flexbox │ │ └── apps │ │ └── catgallery │ │ ├── CatAdapter.kt │ │ ├── CatViewHolder.kt │ │ └── MainActivity.kt │ └── res │ ├── drawable │ ├── cat_1.jpg │ ├── cat_10.jpg │ ├── cat_11.jpg │ ├── cat_12.jpg │ ├── cat_13.jpg │ ├── cat_14.jpg │ ├── cat_15.jpg │ ├── cat_16.jpg │ ├── cat_17.jpg │ ├── cat_18.jpg │ ├── cat_19.jpg │ ├── cat_2.jpg │ ├── cat_3.jpg │ ├── cat_4.jpg │ ├── cat_5.jpg │ ├── cat_6.jpg │ ├── cat_7.jpg │ ├── cat_8.jpg │ └── cat_9.jpg │ ├── layout │ ├── activity_main.xml │ ├── content_main.xml │ └── viewholder_cat.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 │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── demo-playground ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── google │ │ └── android │ │ └── apps │ │ └── flexbox │ │ └── test │ │ └── MainActivityTest.kt │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── google │ │ └── android │ │ └── flexbox │ │ ├── Extensions.kt │ │ ├── FlexItemAdapter.kt │ │ ├── FlexItemChangedListener.kt │ │ ├── FlexItemChangedListenerImpl.kt │ │ ├── FlexItemChangedListenerImplRecyclerView.kt │ │ ├── FlexItemClickListener.kt │ │ ├── FlexItemEditFragment.kt │ │ ├── FlexItemViewHolder.kt │ │ ├── FlexboxLayoutFragment.kt │ │ ├── FragmentHelper.kt │ │ ├── MainActivity.kt │ │ ├── RecyclerViewFragment.kt │ │ ├── SettingsActivity.kt │ │ └── validators │ │ ├── DimensionInputValidator.kt │ │ ├── FixedDimensionInputValidator.kt │ │ ├── FlexBasisPercentInputValidator.kt │ │ ├── InputValidator.kt │ │ ├── IntegerInputValidator.kt │ │ └── NonNegativeDecimalInputValidator.kt │ └── res │ ├── drawable-hdpi │ ├── ic_add_white_24dp.png │ └── ic_remove_white_24dp.png │ ├── drawable-mdpi │ ├── ic_add_white_24dp.png │ └── ic_remove_white_24dp.png │ ├── drawable-xhdpi │ ├── ic_add_white_24dp.png │ └── ic_remove_white_24dp.png │ ├── drawable-xxhdpi │ ├── ic_add_white_24dp.png │ └── ic_remove_white_24dp.png │ ├── drawable-xxxhdpi │ ├── ic_add_white_24dp.png │ └── ic_remove_white_24dp.png │ ├── drawable │ ├── flex_item_background.xml │ └── side_nav_bar.xml │ ├── layout │ ├── activity_main.xml │ ├── app_bar_main.xml │ ├── content_main.xml │ ├── fragment_flex_item_edit.xml │ ├── fragment_flexboxlayout.xml │ ├── fragment_recyclerview.xml │ ├── nav_header_main.xml │ ├── spinner_align_content.xml │ ├── spinner_align_items.xml │ ├── spinner_flex_direction.xml │ ├── spinner_flex_wrap.xml │ ├── spinner_item.xml │ ├── spinner_justify_content.xml │ └── viewholder_flex_item.xml │ ├── menu │ ├── activity_main_drawer.xml │ └── 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-v14 │ └── styles.xml │ ├── values-v21 │ └── styles.xml │ ├── values-w720dp │ └── dimens.xml │ ├── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── new_flex_item_preferences.xml ├── flexbox ├── .gitignore ├── build.gradle ├── constants.gradle ├── maven-puglisher-plugin.gradle ├── proguard-rules.txt └── src │ ├── androidTest │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ └── flexbox │ │ │ ├── FakeFlexContainer.kt │ │ │ ├── FlexboxHelperTest.kt │ │ │ └── test │ │ │ ├── ConfigChangeActivity.kt │ │ │ ├── FlexboxAndroidTest.kt │ │ │ ├── FlexboxLayoutManagerConfigChangeTest.kt │ │ │ ├── FlexboxLayoutManagerTest.kt │ │ │ ├── FlexboxTestActivity.kt │ │ │ ├── IsEqualAllowingError.kt │ │ │ ├── NestedInnerAdapter.kt │ │ │ ├── NestedOuterAdapter.kt │ │ │ ├── TestAdapter.kt │ │ │ ├── TestAdapterMultiViewTypes.kt │ │ │ ├── TestUtil.kt │ │ │ └── TestViewHolder.kt │ └── res │ │ ├── drawable │ │ ├── divider.xml │ │ ├── divider_thick.xml │ │ └── flex_item_background.xml │ │ ├── layout │ │ ├── activity_align_content_test.xml │ │ ├── activity_align_content_test_overflowed.xml │ │ ├── activity_align_items_baseline_test.xml │ │ ├── activity_align_items_baseline_wrap_content.xml │ │ ├── activity_align_items_parent_padding_test.xml │ │ ├── activity_align_items_test.xml │ │ ├── activity_align_self_stretch_test.xml │ │ ├── activity_child_needs_remeasure_column.xml │ │ ├── activity_child_needs_remeasure_row.xml │ │ ├── activity_direction_column_align_items_center_margin_oneside.xml │ │ ├── activity_direction_row_align_items_center_margin_oneside.xml │ │ ├── activity_divider_test_direction_column.xml │ │ ├── activity_divider_test_direction_row.xml │ │ ├── activity_empty_children.xml │ │ ├── activity_first_item_large_horizontal_test.xml │ │ ├── activity_first_item_large_vertical_test.xml │ │ ├── activity_first_view_gone_first_line_single_item.xml │ │ ├── activity_first_view_gone_layout_grow_set_for_rest.xml │ │ ├── activity_first_view_gone_layout_shrink_set_for_rest.xml │ │ ├── activity_flex_basis_percent_test.xml │ │ ├── activity_flex_grow_test.xml │ │ ├── activity_flex_item_match_parent.xml │ │ ├── activity_flex_item_match_parent_direction_column.xml │ │ ├── activity_flex_wrap_test.xml │ │ ├── activity_flexbox_wrap_content.xml │ │ ├── activity_flexbox_wrapped_with_horizontalscrollview.xml │ │ ├── activity_flexbox_wrapped_with_scrollview.xml │ │ ├── activity_justify_content_test.xml │ │ ├── activity_justify_content_with_gone.xml │ │ ├── activity_justify_content_with_parent_padding.xml │ │ ├── activity_maxheight_test.xml │ │ ├── activity_maxheight_upper_bound_test.xml │ │ ├── activity_maxwidth_test.xml │ │ ├── activity_maxwidth_upper_bound_test.xml │ │ ├── activity_minheight_lower_bound_test.xml │ │ ├── activity_minheight_test.xml │ │ ├── activity_minwidth_lower_bound_test.xml │ │ ├── activity_minwidth_test.xml │ │ ├── activity_order_test.xml │ │ ├── activity_simple.xml │ │ ├── activity_stretch_test.xml │ │ ├── activity_views_visibility_gone.xml │ │ ├── activity_views_visibility_invisible.xml │ │ ├── activity_visibility_gone_first_item_in_flex_line_column.xml │ │ ├── activity_visibility_gone_first_item_in_flex_line_row.xml │ │ ├── activity_wrap_before_test.xml │ │ ├── activity_wrap_child_margin_horizontal_test.xml │ │ ├── activity_wrap_child_margin_vertical_test.xml │ │ ├── activity_wrap_content_child_bottom_margin_column_grow.xml │ │ ├── activity_wrap_content_child_bottom_margin_column_shrink.xml │ │ ├── activity_wrap_content_child_bottom_margin_row_grow.xml │ │ ├── activity_wrap_content_child_bottom_margin_row_shrink.xml │ │ ├── activity_wrap_parent_padding_horizontal_test.xml │ │ ├── activity_wrap_parent_padding_vertical_test.xml │ │ ├── activity_zero_height_positive_flexgrow.xml │ │ ├── activity_zero_width_positive_flexgrow.xml │ │ ├── recyclerview.xml │ │ ├── recyclerview_reverse.xml │ │ ├── recyclerview_viewholder.xml │ │ ├── viewholder_inner_recyclerview.xml │ │ ├── viewholder_inner_recyclerview_wrap_horizontally.xml │ │ ├── viewholder_textview.xml │ │ ├── wrapped_recyclerview.xml │ │ └── wrapped_recyclerview_scroll_vertical.xml │ │ └── values │ │ └── strings.xml │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── google │ │ └── android │ │ └── flexbox │ │ ├── AlignContent.java │ │ ├── AlignItems.java │ │ ├── AlignSelf.java │ │ ├── FlexContainer.java │ │ ├── FlexDirection.java │ │ ├── FlexItem.java │ │ ├── FlexLine.java │ │ ├── FlexWrap.java │ │ ├── FlexboxHelper.java │ │ ├── FlexboxItemDecoration.java │ │ ├── FlexboxLayout.java │ │ ├── FlexboxLayoutManager.java │ │ └── JustifyContent.java │ └── res │ └── values │ └── attrs.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── tool └── codeStyleSettings.xml /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: ~/code 5 | docker: 6 | - image: circleci/android:api-29 7 | environment: 8 | JVM_OPTS: -Xmx3200m 9 | MAX_RETRY: 4 10 | steps: 11 | - checkout 12 | - restore_cache: 13 | key: jars-{{ checksum "build.gradle" }}-{{ checksum "flexbox/build.gradle" }} 14 | - run: 15 | name: Download Dependencies 16 | command: ./gradlew androidDependencies 17 | - run: 18 | name: Set up gcloud service key 19 | command: | 20 | if [ -n "$GCLOUD_SERVICE_KEY" ]; then echo ${GCLOUD_SERVICE_KEY} | base64 --decode > ${HOME}/client-secret.json ; 21 | gcloud config set project ${GCLOUD_PROJECT} ; 22 | gcloud auth activate-service-account ${GCLOUD_SERVICE_ACCOUNT} --key-file ${HOME}/client-secret.json ; 23 | fi 24 | - save_cache: 25 | paths: 26 | - ~/.gradle 27 | key: jars-{{ checksum "build.gradle" }}-{{ checksum "flexbox/build.gradle" }} 28 | - run: 29 | name: Build apks 30 | command: ./gradlew build assembleAndroidTest 31 | - run: 32 | name: Run Firebase Test Lab 33 | command: | 34 | if [ -n "$GCLOUD_SERVICE_KEY" ]; then set +e ; 35 | counter=0 ; 36 | result=1 ; 37 | while [ $result != 0 -a $counter -lt $MAX_RETRY ]; do 38 | gcloud firebase test android run \ 39 | --type instrumentation \ 40 | --app demo-playground/build/outputs/apk/debug/demo-playground-debug.apk \ 41 | --test flexbox/build/outputs/apk/androidTest/debug/flexbox-debug-androidTest.apk \ 42 | --device-ids hammerhead,sailfish \ 43 | --os-version-ids 19,21,23,24,25,26 \ 44 | --locales en --orientations portrait,landscape \ 45 | --results-bucket android-devrel-ci-flexbox \ 46 | --timeout 180s ; 47 | result=$? ; 48 | let counter=counter+1 ; 49 | done 50 | exit $result ; 51 | fi 52 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | - [ ] I have searched [existing issues](https://github.com/google/flexbox-layout/issues) and confirmed this is not a duplicate 2 | 3 | ## Issues and steps to reproduce 4 | *Please replace this with steps to reproduce your issue.* 5 | 6 | ## Expected behavior 7 | *Please describe what you expected would happen.* 8 | 9 | ## Version of the flexbox library 10 | *e.g. 0.2.6, 0.3.0-alpha3* 11 | 12 | ## Link to code 13 | *Please link to the code we can use to reproduce this issue.* 14 | *A complete project we can build/run is preferred, if you can't provide one, please show* 15 | *us relevant code* 16 | -------------------------------------------------------------------------------- /.github/workflows/gradle-wrapper-validation.yml: -------------------------------------------------------------------------------- 1 | name: "Validate Gradle Wrapper" 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | validation: 6 | name: "Validation" 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: gradle/wrapper-validation-action@v1 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea/ 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | !.idea/codeStyleSettings.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .vscode/ 12 | 13 | # Taken from Android.gitignore https://github.com/github/gitignore/blob/master/Android.gitignore 14 | # 15 | # Built application files 16 | *.apk 17 | *.ap_ 18 | 19 | # Files for the Dalvik VM 20 | *.dex 21 | 22 | # Java class files 23 | *.class 24 | 25 | # Generated files 26 | bin/ 27 | gen/ 28 | out/ 29 | 30 | # Gradle files 31 | .gradle/ 32 | build/ 33 | 34 | # Local configuration file (sdk path, etc) 35 | local.properties 36 | 37 | # Proguard folder generated by Eclipse 38 | proguard/ 39 | 40 | # Log Files 41 | *.log 42 | 43 | # Android Studio Navigation editor temp files 44 | .navigation/ 45 | 46 | # Android Studio captures folder 47 | captures/ 48 | 49 | # Intellij 50 | *.iml 51 | -------------------------------------------------------------------------------- /assets/align-content.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/align-content.gif -------------------------------------------------------------------------------- /assets/align-items.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/align-items.gif -------------------------------------------------------------------------------- /assets/divider-beginning-middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/divider-beginning-middle.png -------------------------------------------------------------------------------- /assets/flex-direction.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/flex-direction.gif -------------------------------------------------------------------------------- /assets/flex-wrap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/flex-wrap.gif -------------------------------------------------------------------------------- /assets/flexbox-layoutmanager.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/flexbox-layoutmanager.gif -------------------------------------------------------------------------------- /assets/flexbox-visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/flexbox-visual.png -------------------------------------------------------------------------------- /assets/fluid-grid/nexus9-full-width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/fluid-grid/nexus9-full-width.png -------------------------------------------------------------------------------- /assets/fluid-grid/nexus9-half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/fluid-grid/nexus9-half.png -------------------------------------------------------------------------------- /assets/fluid-grid/nexus9-one-fourth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/fluid-grid/nexus9-one-fourth.png -------------------------------------------------------------------------------- /assets/fluid-grid/nexus9-three-fourth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/fluid-grid/nexus9-three-fourth.png -------------------------------------------------------------------------------- /assets/justify-content.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/justify-content.gif -------------------------------------------------------------------------------- /assets/layout_alignSelf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_alignSelf.gif -------------------------------------------------------------------------------- /assets/layout_flexBasisPercent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_flexBasisPercent.gif -------------------------------------------------------------------------------- /assets/layout_flexGrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_flexGrow.gif -------------------------------------------------------------------------------- /assets/layout_flexShrink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_flexShrink.gif -------------------------------------------------------------------------------- /assets/layout_maxWidth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_maxWidth.gif -------------------------------------------------------------------------------- /assets/layout_minWidth.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_minWidth.gif -------------------------------------------------------------------------------- /assets/layout_order.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_order.gif -------------------------------------------------------------------------------- /assets/layout_wrapBefore.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/layout_wrapBefore.gif -------------------------------------------------------------------------------- /assets/pngs/check_green_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/assets/pngs/check_green_small.png -------------------------------------------------------------------------------- /demo-cat-gallery/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: 'com.android.application' 18 | apply plugin: 'kotlin-android' 19 | 20 | android { 21 | compileSdkVersion rootProject.ext.compileSdkVersion 22 | 23 | defaultConfig { 24 | applicationId "com.google.android.flexbox.apps.catgallery" 25 | minSdkVersion rootProject.ext.minSdkVersion 26 | targetSdkVersion rootProject.ext.targetSdkVersion 27 | versionCode 1 28 | versionName "1.0" 29 | 30 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 31 | } 32 | buildTypes { 33 | release { 34 | shrinkResources true 35 | minifyEnabled true 36 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 37 | } 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation project(path: ":flexbox") 43 | implementation "androidx.appcompat:appcompat:${rootProject.androidxAppCompatVersion}" 44 | implementation "androidx.recyclerview:recyclerview:${rootProject.androidxRecyclerViewVersion}" 45 | implementation "com.google.android.material:material:${rootProject.materialVersion}" 46 | implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.kotlinVersion}" 47 | } 48 | -------------------------------------------------------------------------------- /demo-cat-gallery/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 /usr/local/google/home/thagikura/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 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/java/com/google/android/flexbox/apps/catgallery/CatViewHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Google Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.flexbox.apps.catgallery 18 | 19 | import android.view.View 20 | import android.widget.ImageView 21 | import androidx.annotation.DrawableRes 22 | import androidx.recyclerview.widget.RecyclerView 23 | import com.google.android.flexbox.FlexboxLayoutManager 24 | 25 | /** 26 | * ViewHolder that represents a cat image. 27 | */ 28 | internal class CatViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { 29 | 30 | private val imageView: ImageView = itemView.findViewById(R.id.imageview) 31 | 32 | internal fun bindTo(@DrawableRes drawableRes: Int) { 33 | imageView.setImageResource(drawableRes) 34 | val lp = imageView.layoutParams 35 | if (lp is FlexboxLayoutManager.LayoutParams) { 36 | lp.flexGrow = 1f 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_1.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_10.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_11.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_12.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_13.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_14.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_15.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_16.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_17.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_18.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_19.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_2.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_3.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_4.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_5.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_6.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_7.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_8.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/drawable/cat_9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/drawable/cat_9.jpg -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 23 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/layout/viewholder_cat.xml: -------------------------------------------------------------------------------- 1 | 16 | 24 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/flexbox-layout/366b461fd0425bfaa9872b1d9af9da3055d3bc74/demo-cat-gallery/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | #3F51B5 18 | #303F9F 19 | #FF4081 20 | 21 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 180dp 18 | 19 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | Cat Gallery 18 | Cat image 19 | 20 | -------------------------------------------------------------------------------- /demo-cat-gallery/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 25 | 29 | 26 | 27 | -------------------------------------------------------------------------------- /demo-playground/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 24 | 25 | 24 | 25 | 28 | 29 | 33 | 34 | 42 | 43 |