UndoBar support customize style with background/icon/duration/animation attribution.
UndoBar will determine if tranlucent mode(4.4) is using and adjust its position.
Style
UndoBar provides 3 default styles. You can use them for different purposes like undo,refresh, or just use it as replacement of toasts.
For example, you can use retry style in this way.
UndoBar will switch to KitKat L&F in API-19 target and Material design in API20+.
You can set theme in your appliation to change the look and feel. For example, you can use following lines in your style.xml to always use material style UndoBar.
Using UndoBarController.AdvancedUndoListener if you need to get notification when UndoBar was cleared or hidden.
UndoBar is designed to dynamically add to activity viewgroup, so you need to handle screen-rotation by your self. Check this example to see more.
Contribute
Feel free to fork it
License
Copyright 2011, 2015 Kai Liao
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.
请发表评论