YangsBryant / Dselectorbryant
单选滚动选择器、diy丰富、有阻尼效果、简单美观、触摸or点击模式 (Rolling Selector, Diy Rich, Damping Effect, Simple and Beautiful, Touch or Click Mode)
Stars: ✭ 109
Programming Languages
java
68154 projects - #9 most used programming language
Projects that are alternatives of or similar to Dselectorbryant
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+596.33%)
Mutual labels: selector
Reapex
A lightweight framework to build pluggable and extendable redux/react application
Stars: ✭ 58 (-46.79%)
Mutual labels: selector
Lambda Converters
Strongly-typed lambda expressions as value converters, data template selectors, and validation rules
Stars: ✭ 99 (-9.17%)
Mutual labels: selector
Postcss Prefix Selector
Prefix all CSS rules with a selector
Stars: ✭ 75 (-31.19%)
Mutual labels: selector
Cash
An absurdly small jQuery alternative for modern browsers.
Stars: ✭ 5,714 (+5142.2%)
Mutual labels: selector
Xselectorutil
一个可以用代码处理控件的阴影效果,及用代码在TextView、EditText、Button等控件设置selector背景(触摸反馈,样式变化、文字颜色变化、hint文字颜色变化等效果)的组件
Stars: ✭ 98 (-10.09%)
Mutual labels: selector
Statebutton
一个可以用代码设置selector背景(按下去背景颜色更改,样式变化等等)的button, 再也不用写selector了
Stars: ✭ 1,276 (+1070.64%)
Mutual labels: selector
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: ✭ 763 (+600%)
Mutual labels: selector
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (-8.26%)
Mutual labels: selector
React Native Modal Dropdown
A react-native dropdown/picker/selector component for both Android & iOS.
Stars: ✭ 1,103 (+911.93%)
Mutual labels: selector
Mithril Query
Query mithril virtual dom for testing purposes
Stars: ✭ 105 (-3.67%)
Mutual labels: selector
Pd Select
vue components ,like ios 3D picker style,vue 3d 选择器组件,3D滚轮
Stars: ✭ 101 (-7.34%)
Mutual labels: selector
Resq
React Element Selector Query (RESQ) - Query React components and children by component name or HTML selector
Stars: ✭ 89 (-18.35%)
Mutual labels: selector
DSelectorBryant
单选滚动选择器
引入module
allprojects {
repositories {
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
implementation 'com.github.YangsBryant:DSelectorBryant:1.0.3'
主要代码
public class MainActivity extends AppCompatActivity {
DSelectorPopup dSelectorPopup;
ConstraintLayout constraintLayout;
ArrayList<String> list = new ArrayList<>();
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
for (int i = 0; i <= 10; i++) {
list.add("YMF"+i);
}
dSelectorPopup = new DSelectorPopup(this,list);
dSelectorPopup.build();
constraintLayout = findViewById(R.id.main);
button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//弹出窗体
dSelectorPopup.popOutShadow(constraintLayout);
}
});
/*点击监听器
Tips:实现此监听器,点击button也会返回当前选中项的下标和文本,因此button既可以当做取消用,也可以当做确定用*/
dSelectorPopup.setSelectorListener(new DSelectorPopup.SelectorClickListener() {
@Override
public void onSelectorClick(int position, String text) {
Toast.makeText(MainActivity.this,text,Toast.LENGTH_SHORT).show();
//缩回窗体
dSelectorPopup.dismissPopup();
}
});
//滑动监听器
/*dSelectorPopup.setSelectoMoverListener(new DSelectorPopup.SelectorMoveListener() {
@Override
public void onSelectorMove(int position, String text) {
Toast.makeText(MainActivity.this,text,Toast.LENGTH_SHORT).show();
}
});*/
}
}
参数实例
dSelectorPopup.setOffset(5)
.setTextSize(30)
.setTextcolor_selection(getResources().getColor(R.color.colorAccent))
.setTextcolor_unchecked(getResources().getColor(R.color.colorPrimary))
.setGradual_color(0xffD81B60)
.setTitleText("我是标题")
.setTitleColor(getResources().getColor(R.color.colorPrimary))
.setTitleSize(25)
.setButton_background(getResources().getDrawable(R.drawable.popup_bg)).build();
Tips:分割线的颜色值为:0xff 加上16进制颜色值,例如:0xffD81B60
DSelectorBryant属性大全
方法名 | 属性 |
---|---|
build() | 参数设置完毕,在最后build一下 |
setHeights(int height) | PopupWindow的高度,单位dp |
isOutside(boolean bl) | 点击弹窗外是否消失,默认true |
setSeletion(int seletion) | 默认选中项 |
setOffset(int offset) | 对话框中当前项上面和下面的项数 |
setTextSize(int size) | 文本字体大小 |
setTextcolor_selection(int textcolor_selection) | 选中文本颜色 |
setTextcolor_unchecked(int textcolor_unchecked) | 未选中文本颜色 |
setGradual_color(int gradual_color) | 分割线颜色 |
setFining(boolean fining) | 是否开启分割线两端变细,默认true |
setTitleText(String titleText) | 标题的文字 |
setTitleSize(int titleSize) | 标题文字大小 |
setTitleColor(int titleColor) | 标题文字颜色 |
setButtonText(String buttonText) | 按钮文本 |
setButtonSize(int buttonSize) | 按钮文字大小 |
setButtonColor(int buttonColor) | 按钮文字颜色 |
setButton_background(Drawable drawable) | 按钮背景 |
setButtonWidt(int buttonWidt) | 按钮宽度,单位dp |
setButtonHeight(int buttonHeight) | 按钮高度,单位dp |
popOutShadow(View view) | 显示弹窗 |
dismissPopup() | 关闭弹窗 |
setSelectorListener(SelectorClickListener selectorListener) | 点击监听器 |
setSelectoMoverListener(SelectorMoveListener selectoMoverListener) | 滑动监听器 |
联系QQ:961606042
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].