鸿蒙开源组件——按钮菜单

jacksky
发布于 2021-8-10 15:18
浏览
0收藏

BottomSheet

BottomSheet dialogs library for ohos with material design concept.

鸿蒙开源组件——按钮菜单-鸿蒙开发者社区鸿蒙开源组件——按钮菜单-鸿蒙开发者社区

 

鸿蒙开源组件——按钮菜单-鸿蒙开发者社区

 

鸿蒙开源组件——按钮菜单-鸿蒙开发者社区

Usage

通过DevEco studio 2.0+,并下载SDK Native 版本2.0+

方式一: 在entry的gradle中集成如下操作:

如果使用har,请将har放到entry中的libs 修改implementation fileTree(dir: 'libs', include: ['.jar','.har'])增加*.har

方式二:

allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:michaelbel-bottomsheet:1.0.2' 
BottomSheet.Builder builder = new BottomSheet.Builder(context);
builder
   .setTitle(CharSequence title)
   .setItems(CharSequence[] items, Drawable[] icons, BottomSheetClickListener listener)
   .setMenu(int menuResId, BottomSheetClickListener listener)
   .setView(int layoutResId)
   .setContentType( int type)
   .setDarkTheme(boolean darkTheme)
   .setFullWidth(boolean fullWidth)
   .setCellHeight(int cellHeightDp)
   .setDividers(boolean dividers)
   .setWindowDimming(int windowDimming)
   .setTitleMultiline(boolean multiline)
   .setBackgroundColor(int color)
   .setBackgroundColorRes(int color)
   .setTitleTextColor(int color)
   .setTitleTextColorRes(int color)
   .setItemTextColor( int color)
   .setItemTextColorRes( int color)
   .setCallback(new BottomSheetCallback() {
       @Override
       public void onShown() {
       }

       @Override
       public void onDismissed() {
       }
   })
   .show();

Wiki

For all information check [BottomSheet Wiki][wiki-url].

Deprecated

BottomSheet is deprecated. No more development will be taking place. Existing version will continue to function. Please, use [BottomSheetDialogFragment][bsdf-url] from Google instead. Thanks!

License

Copyright 2016 Michael Bely

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.

michaelbel_BottomSheet-master.zip 8.68M 12次下载
已于2021-8-10 15:18:05修改
收藏
回复
举报
回复
    相关推荐