Material Components for Android 1.0.0 → 1.1.0

37618b4d60cf3d1f43f7196253264edc?s=47 Nabe
May 15, 2019

Material Components for Android 1.0.0 → 1.1.0

37618b4d60cf3d1f43f7196253264edc?s=128

Nabe

May 15, 2019
Tweet

Transcript

  1. .BUFSJBM$PNQPOFOUT GPS"OESPJE ὎  ؔϞό ,B[VLJ8BUBOBCF

  2. 1SPpMF w ͳ΂ w 5XJUUFS!/BCF$PUU w (JU)VC/6NFSP"OE%FW w 'FOSJS*OD w

    "OESPJE"QQ%FWFMPQFS
  3. ⚠JTBMQIB⚠

  4. ὎ BMQIB w .BUFSJBM5IFNJOH w $PMPS 4IBQF 5ZQPHSBQIZ5IFNJOH w %BSL5IFNF

    w /FX$PNQPOFOUT w 6QEBUF$PNQPOFOUT w #VHpYFUD
  5. ὎ BMQIB w .BUFSJBM5IFNJOH w $PMPS 4IBQF 5ZQPHSBQIZ5IFNJOH w %BSL5IFNF

    w /FX$PNQPOFOUT w 6QEBUF$PNQPOFOUT w #VHpYFUD
  6. /FX$PNQPOFOUT w &YUFOEFE'MPBUJOH"DUJPO#VUUPO w .BUFSJBM#VUUPO5PHHMF(SPVQ

  7. &YUFOEFE'"#

  8. &YUFOEFE'"# <com.google.android.material.floatingactionbutton.ExtendedF loatingActionButton android:id="@+id/extendedFab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:text="Create" app:icon="@drawable/ic_add" />

  9. &YUFOEFE'"# extendedFab.extend() extendedFab.shrink()

  10. .BUFSJBM#VUUPO5PHHMF(SPVQ

  11. .BUFSJBM#VUUPO5PHHMF(SPVQ <com.google.android.material.button.MaterialButtonToggleGroup android:id="@+id/singleSelectToggleGroup" android:layout_width="wrap_content" android:layout_height="wrap_content" app:singleSelection="true"> <com.google.android.material.button.MaterialButton style=“?attr/materialButtonOutlinedStyle" android:layout_width="wrap_content" android:layout_height="wrap_content"

    android:text="Select1" /> <com.google.android.material.button.MaterialButton style="?attr/materialButtonOutlinedStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Select2" /> </com.google.android.material.button.MaterialButtonToggleGroup>
  12. .BUFSJBM#VUUPO5PHHMF(SPVQ w DIFDLFE#VUUPO*EDIFDLFE#VUUPO*ET w DIFDL JE*OU  w BEE0O#VUUPO$IFDLFE-JTUFOFS w

    DMFBS$IFDLFE w "OENPSFʜ
  13. 6QEBUFE$PNQPOFOUT w 5FYU*OQVU-BZPVU w #PUUPN/BWJHBUJPO w 4OBDLCBS w $BSE7JFX w

    0UIFST
  14. 5FYU*OQVU-BZPVU

  15. 5FYU*OQVU-BZPVU <com.google.android.material.textfield.TextInputLayout android:id="@+id/dropdownFilledTextInputLayout" style="@style/ Widget.MaterialComponents.TextInputLayout.FilledBox.Exposed DropdownMenu" android:layout_width="match_parent" android:layout_height="wrap_content"> <androidx.appcompat.widget.AppCompatAutoCompleteTextView android:id="@+id/filledAutoCompleteTextView"

    android:layout_width="match_parent" android:layout_height="wrap_content" android:editable="false" /> </com.google.android.material.textfield.TextInputLayout>
  16. 5FYU*OQVU-BZPVU val adapter = ArrayAdapter( context, android.R.layout.simple_spinner_dropdown_item, arrayOf("Item 1", "Item

    2", "Item 3", "Item 4") ) filledAutoCompleteTextView.setAdapter(adapter)
  17. 5FYU*OQVU-BZPVU w BQQTUBSU*DPO%SBXBCMFBQQFOE*DPO%SBXBCMF w TFU4UBSU*DPO0O$MJDL-JTUFOFS TFU&OE*DPO0O$MJDL-JTUFOFS

  18. #PUUPN/BWJHBUJPO

  19. #PUUPN/BWJHBUJPO // show only badge bottomNavigation.showBadge(R.id.navigation_item_1) // show badge with

    number val badgeDrawable = bottomNavigation.showBadge(R.id.navigation_item_2) badgeDrawable.apply { number = 5000 maxCharacterCount = 5 // default is 4 } // dismiss badge bottomNavigation.removeBadge(R.id.navigation_item_1)
  20. 4OBDLCBS

  21. 4OBDLCBS Snackbar.make(view, "Message", Snackbar.LENGTH_LONG) .setAction("Action") { // Some action }

    .setAnchorView(fab) .show() w TFU"ODIPS7JFX WJFX  w FH'MPBUJOH"DUJPO#VUUPO
  22. 4OBDLCBS <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar"> <item name="snackbarStyle"> @style/Widget.MaterialComponents.Snackbar.FullWidth </item> </style>

  23. $BSE7JFX

  24. $BSE7JFX <com.google.android.material.card.MaterialCardView android:id=“@+id/cardView" android:layout_width="match_parent" android:layout_height="match_parent" android:checkable="true"> </com.google.android.material.card.MaterialCardView> cardView.isSelected = true

    // or false
  25. 0UIFS w 4VQQPSUT.BUFSJBM5IFNJOH $PMPS 4IBQF  5ZQPHSBQIZ %BSL5IFNF  w

    .BUFSJBM%JBMPH#VJMEFS w 4FMFDUJPO$POUSPM 4XJUDI 3BEJP#VUUPO  5PHHMF#VUUPO  w #PUUPN4IFFU w "OENPSFʜ
  26. *OEFWFMPQNFOU

  27. w IUUQTHJUIVCDPNNBUFSJBMDPNQPOFOUTNBUFSJBM DPNQPOFOUTBOESPJE