一个极简且仿Material Design Snackbar的库
- 在某些情况下Activity的界面可能不透明
- 极简而且体积小
- 仿Material Design SnackBar
- 可更改按钮颜色
compile 'com.widget.snackbar'
使用方法: 普通例子:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",SnackBar.LENGTH_LONG).show;
带有按钮事件方法:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",SnackBar.LENGTH_LONG).setAction(LISTENER).show;
自定义Show时间事件:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",5*1000).show;
2秒show:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",SnackBar.LENGTH_SHORT).show;
设置Action按钮颜色:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",SnackBar.LENGTH_LONG).setAction(LISTENER).setActionColor(R.id.COLOR).show;
您也可以使文本内容大写或者小写: 1.大写:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",SnackBar.LENGTH_LONG).toUpperCase.show;
2.小写:
new SnackBar.makeText(YOURACTIVITY.this),"MESSAGE",SnackBar.LENGTH_LONG).toLowerCase.show;
Copyright 2016 Peter&DevelopTeam 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.