├── sample ├── assets │ ├── ToggleButton.txt │ ├── CollageView.txt │ ├── Titanic.txt │ ├── CircleProgress.txt │ ├── CircularProgressButton.txt │ ├── SweetAlertDialog.txt │ ├── SwipeMenuListView.txt │ ├── TickPlusDrawable.txt │ ├── TextJustify.txt │ ├── about.txt │ ├── FlabbyListView.txt │ ├── TouchImageView.txt │ ├── GossipView.txt │ ├── XListView.txt │ ├── ResideMenu.txt │ ├── DragSortListView.txt │ ├── ButterKnife.txt │ ├── NumberProgressBar.txt │ ├── SatelliteMenu.txt │ └── DiscrollView.txt ├── res │ ├── drawable-hdpi │ │ ├── hd.jpg │ │ ├── ic_1.png │ │ ├── ic_2.png │ │ ├── ic_3.png │ │ ├── ic_4.png │ │ ├── ic_5.png │ │ ├── ic_6.png │ │ ├── main.png │ │ ├── wave.png │ │ ├── cheese1.png │ │ ├── cheese2.png │ │ ├── cheese3.png │ │ ├── menu_bg.jpg │ │ ├── about_img.png │ │ ├── home_img.png │ │ ├── ic_delete.png │ │ ├── image_img.png │ │ ├── list_img.png │ │ ├── logo_big.png │ │ ├── main_icon.png │ │ ├── menu_img.png │ │ ├── other_img.png │ │ ├── sat_item.png │ │ ├── sat_main.png │ │ ├── shadow.9.png │ │ ├── button_img.png │ │ ├── dialog_img.png │ │ ├── ic_launcher.png │ │ ├── icon_profile.png │ │ ├── progress_img.png │ │ ├── badge_ifaux.9.png │ │ ├── framework_img.png │ │ ├── ic_action_good.png │ │ ├── icon_settings.png │ │ ├── ilovecheese_i.png │ │ ├── title_bar_menu.png │ │ ├── ic_action_about.png │ │ ├── ic_action_accept.png │ │ ├── ic_action_cancel.png │ │ ├── ic_action_discard.png │ │ ├── ic_action_share.png │ │ ├── ilovecheese_heart.png │ │ ├── title_bar_menu_on.png │ │ ├── xlistview_arrow.png │ │ ├── ic_action_favorite.png │ │ ├── ic_action_important.png │ │ └── ilovecheese_cheese.png │ ├── drawable │ │ ├── home_view_bg.png │ │ ├── home_view_inner_bg.png │ │ ├── home_score_normal_bg.png │ │ ├── home_score_pressed_bg.png │ │ ├── home_view_inner_press_bg.png │ │ ├── dialog_background.xml │ │ ├── home_score_bg_selector.xml │ │ ├── error_circle.xml │ │ ├── success_bow.xml │ │ ├── warning_circle.xml │ │ ├── success_circle.xml │ │ ├── cpb_background.xml │ │ ├── titlebar_menu_selector.xml │ │ ├── error_state_selector.xml │ │ ├── complete_state_selector.xml │ │ ├── idle_state_selector.xml │ │ ├── blue_button_background.xml │ │ ├── gray_button_background.xml │ │ ├── red_button_background.xml │ │ ├── warning_sigh.xml │ │ └── error_center_x.xml │ ├── values │ │ ├── sat_strings.xml │ │ ├── ids.xml │ │ ├── sat_attrs.xml │ │ ├── toggle_button_attrs.xml │ │ ├── dimens.xml │ │ ├── library_circularprogressbutton_strings.xml │ │ ├── dslv_attrs.xml │ │ ├── colors.xml │ │ └── strings.xml │ ├── anim │ │ ├── sat_item_click_interpolator.xml │ │ ├── sat_item_anticipate_interpolator.xml │ │ ├── sat_item_in_rotate_interpolator.xml │ │ ├── sat_item_out_rotate_interpolator.xml │ │ ├── sat_item_overshoot_interpolator.xml │ │ ├── sat_main_rotate_left.xml │ │ ├── sat_main_rotate_right.xml │ │ ├── success_bow_roate.xml │ │ ├── modal_out.xml │ │ ├── success_mask_layout.xml │ │ ├── error_frame_in.xml │ │ ├── sat_item_anim_click.xml │ │ ├── error_x_in.xml │ │ └── modal_in.xml │ ├── layout │ │ ├── flabby_lv_main.xml │ │ ├── sat_item_cr.xml │ │ ├── sat_main.xml │ │ ├── touch_imageview_main.xml │ │ ├── tickplusdrawable_main.xml │ │ ├── swipemenulistview_main.xml │ │ ├── collageviews_main.xml │ │ ├── about.xml │ │ ├── home.xml │ │ ├── flabby_lv_item.xml │ │ ├── gossipview_main.xml │ │ ├── titanic_main.xml │ │ ├── residemenu_item.xml │ │ ├── satellite_menu_main.xml │ │ ├── swipemenulistview_item.xml │ │ ├── dragsort_listview_item.xml │ │ ├── xlistview_footer.xml │ │ ├── textjustify_test.xml │ │ ├── main_item.xml │ │ ├── dragsort_listview.xml │ │ ├── togglebutton_main.xml │ │ ├── intro.xml │ │ ├── residemenu.xml │ │ ├── textjustify_layout.xml │ │ ├── main.xml │ │ ├── xlistview_header.xml │ │ └── numberprogressbar_main.xml │ └── color │ │ ├── cpb_error_state_selector.xml │ │ ├── cpb_idle_state_selector.xml │ │ └── cpb_complete_state_selector.xml ├── libs │ ├── butterknife-6.0.0.jar │ ├── android-support-v4.jar │ ├── android-support-v7-appcompat.jar │ ├── nineoldandroids-library-2.4.0.jar │ └── universal-image-loader-1.9.3.jar ├── ui.src │ └── com │ │ └── qy │ │ └── customview │ │ ├── circular_progress_button │ │ ├── OnAnimationEndListener.java │ │ ├── StateManager.java │ │ ├── StrokeGradientDrawable.java │ │ └── CircularProgressDrawable.java │ │ ├── residemenu │ │ ├── ResideMenu_helper.txt │ │ ├── TouchDisableView.java │ │ └── ResideMenuItem.java │ │ ├── swipemenu_listview │ │ ├── SwipeMenuCreator.java │ │ ├── SwipeMenu.java │ │ ├── SwipeMenuItem.java │ │ └── SwipeMenuView.java │ │ ├── satellite_menu │ │ ├── IDegreeProvider.java │ │ ├── ArrayDegreeProvider.java │ │ ├── LinearDegreeProvider.java │ │ ├── DefaultDegreeProvider.java │ │ └── SatelliteMenuItem.java │ │ ├── gossipview │ │ ├── GossipItem.java │ │ └── MyUtils.java │ │ ├── circleprogress │ │ ├── Utils.java │ │ └── DummyContent.java │ │ ├── discrollview │ │ ├── Discrollvable.java │ │ └── simple │ │ │ ├── DiscrollvableRedLayout.java │ │ │ ├── DiscrollvableGreenLayout.java │ │ │ ├── DiscrollvablePurpleLayout.java │ │ │ ├── DiscrollvableLastLayout.java │ │ │ └── DiscrollvablePathLayout.java │ │ ├── xlistview │ │ ├── XListView.txt │ │ └── XListViewFooter.java │ │ ├── collage_views │ │ ├── Vector2D.java │ │ └── CollageView.java │ │ ├── toggle_button │ │ └── facebook │ │ │ └── rebound │ │ │ ├── SpringSystem.java │ │ │ ├── SimpleSpringListener.java │ │ │ ├── OrigamiValueConverter.java │ │ │ ├── SteppingLooper.java │ │ │ ├── SynchronousLooper.java │ │ │ ├── SpringListener.java │ │ │ ├── SpringSystemListener.java │ │ │ ├── SpringLooper.java │ │ │ ├── SpringConfig.java │ │ │ ├── ui │ │ │ └── Util.java │ │ │ ├── SpringUtil.java │ │ │ └── SpringConfigRegistry.java │ │ ├── touch_imageview │ │ └── ExtendedViewPager.java │ │ ├── text_justify │ │ ├── simple │ │ │ ├── MyLeadingMarginSpan2.java │ │ │ ├── FontsOverride.java │ │ │ ├── Utils.java │ │ │ ├── ArticleBuilder.java │ │ │ └── MyQuoteSpan.java │ │ ├── style │ │ │ ├── Direction.java │ │ │ ├── TextAlignment.java │ │ │ ├── LeftSpan.java │ │ │ ├── CenterSpan.java │ │ │ ├── RightSpan.java │ │ │ ├── JustifiedSpan.java │ │ │ ├── TextAlignmentSpan.java │ │ │ └── DirectionSpan.java │ │ └── Console.java │ │ ├── dragsort_listview │ │ ├── DragSortItemViewCheckable.java │ │ ├── SimpleFloatViewManager.java │ │ ├── DragSortItemView.java │ │ └── help.txt │ │ ├── flabby_listview │ │ └── FlabbyAdapter.java │ │ └── sweet_alert_dialog │ │ └── OptAnimationLoader.java ├── 使用前必读.txt └── src │ └── com │ └── qy │ └── main │ ├── activity │ ├── DiscrollViewActivity.java │ ├── TouchImageViewActivity.java │ ├── CollageViewActivity.java │ ├── TitanicActivity.java │ ├── TickPlusDrawableActivity.java │ ├── GossipViewActivity.java │ ├── FlabbyListViewActivity.java │ ├── NumberProgressBarActivity.java │ ├── IntroActivity.java │ ├── CircleProgressActivity.java │ ├── SatelliteMenuActivity.java │ └── ToggleButtonActivity.java │ ├── fragment │ └── AboutFragment.java │ ├── utils │ └── AssetsUtil.java │ └── bean │ └── Obj.java ├── apk └── QY-OpenSource.apk └── README.md /sample/assets/ToggleButton.txt: -------------------------------------------------------------------------------- 1 | 一个效果非常好的滑动开关控件。 -------------------------------------------------------------------------------- /sample/assets/CollageView.txt: -------------------------------------------------------------------------------- 1 | 可以在界面上随意拖动缩放旋转的ImageView. -------------------------------------------------------------------------------- /sample/assets/Titanic.txt: -------------------------------------------------------------------------------- 1 | Titanic实现动态波浪形动画逐渐填充自定义TextView. -------------------------------------------------------------------------------- /sample/assets/CircleProgress.txt: -------------------------------------------------------------------------------- 1 | 各种形式的圆形进度条,有圆圈+数字风格的,有类似水位上升的。 -------------------------------------------------------------------------------- /sample/assets/CircularProgressButton.txt: -------------------------------------------------------------------------------- 1 | 显示进度的按钮,可用于数据的提交,系统登录等,动画效果很棒,提高用户体验。 -------------------------------------------------------------------------------- /sample/assets/SweetAlertDialog.txt: -------------------------------------------------------------------------------- 1 | Android版的SweetAlert,清新文艺,快意灵动的甜心弹框. 2 | 灵感来源于JS版SweetAlert. -------------------------------------------------------------------------------- /apk/QY-OpenSource.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/apk/QY-OpenSource.apk -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/hd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/hd.jpg -------------------------------------------------------------------------------- /sample/libs/butterknife-6.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/libs/butterknife-6.0.0.jar -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_1.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_2.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_3.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_4.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_5.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_6.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/main.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/wave.png -------------------------------------------------------------------------------- /sample/assets/SwipeMenuListView.txt: -------------------------------------------------------------------------------- 1 | SwipeMenuListView 实现了类似于iPhone 的列表滑动功能,开发者可以在此基础上制作一些类似滑动删除的效果, 纯代码添加菜单,不需要在item布局文件中添加菜单的布局。 -------------------------------------------------------------------------------- /sample/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/libs/android-support-v4.jar -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/cheese1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/cheese1.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/cheese2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/cheese2.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/cheese3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/cheese3.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/menu_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/menu_bg.jpg -------------------------------------------------------------------------------- /sample/res/drawable/home_view_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable/home_view_bg.png -------------------------------------------------------------------------------- /sample/assets/TickPlusDrawable.txt: -------------------------------------------------------------------------------- 1 | 作者很有个性的标语:I'm not a Gif maker, I'm a developer ,解释了这个项目的目的。tickplusdrawable用纯代码而不是gif图片实现了一个动画按钮。 -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/about_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/about_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/home_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/home_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_delete.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/image_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/image_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/list_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/list_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/logo_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/logo_big.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/main_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/main_icon.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/menu_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/menu_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/other_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/other_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/sat_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/sat_item.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/sat_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/sat_main.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/shadow.9.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/button_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/button_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/dialog_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/dialog_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/icon_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/icon_profile.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/progress_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/progress_img.png -------------------------------------------------------------------------------- /sample/assets/TextJustify.txt: -------------------------------------------------------------------------------- 1 | TextJustify是对安卓TextView控件的格式优化,TextView在显示文字的时候往往在一行的中间部分就跳到了下一行,看起来很杂乱,尤其是在显示英文的时候,TextJustify解决了这个问题。 2 | 3 | -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/badge_ifaux.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/badge_ifaux.9.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/framework_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/framework_img.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_good.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/icon_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/icon_settings.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ilovecheese_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ilovecheese_i.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/title_bar_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/title_bar_menu.png -------------------------------------------------------------------------------- /sample/res/drawable/home_view_inner_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable/home_view_inner_bg.png -------------------------------------------------------------------------------- /sample/res/values/sat_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /sample/libs/android-support-v7-appcompat.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/libs/android-support-v7-appcompat.jar -------------------------------------------------------------------------------- /sample/libs/nineoldandroids-library-2.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/libs/nineoldandroids-library-2.4.0.jar -------------------------------------------------------------------------------- /sample/libs/universal-image-loader-1.9.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/libs/universal-image-loader-1.9.3.jar -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_about.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_accept.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_cancel.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_discard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_discard.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_share.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ilovecheese_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ilovecheese_heart.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/title_bar_menu_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/title_bar_menu_on.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/xlistview_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/xlistview_arrow.png -------------------------------------------------------------------------------- /sample/res/drawable/home_score_normal_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable/home_score_normal_bg.png -------------------------------------------------------------------------------- /sample/res/drawable/home_score_pressed_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable/home_score_pressed_bg.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_favorite.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ic_action_important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ic_action_important.png -------------------------------------------------------------------------------- /sample/res/drawable-hdpi/ilovecheese_cheese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable-hdpi/ilovecheese_cheese.png -------------------------------------------------------------------------------- /sample/res/drawable/home_view_inner_press_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qyxxjd/QY-OpenSource/HEAD/sample/res/drawable/home_view_inner_press_bg.png -------------------------------------------------------------------------------- /sample/assets/about.txt: -------------------------------------------------------------------------------- 1 | Q Q : 630404403 2 | 3 | 微信 : 630404403 4 | 5 | 邮箱 : 630404403@qq.com 6 | 7 | 博客 : http://blog.csdn.net/qy1387 8 | 9 | 项目地址:https://github.com/qyxxjd/QY-OpenSource -------------------------------------------------------------------------------- /sample/res/anim/sat_item_click_interpolator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sample/res/anim/sat_item_anticipate_interpolator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/res/anim/sat_item_in_rotate_interpolator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/res/anim/sat_item_out_rotate_interpolator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/res/anim/sat_item_overshoot_interpolator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/assets/FlabbyListView.txt: -------------------------------------------------------------------------------- 1 | 这个ListView看上去比标准的“柔和”多了,而且滚动的时候还跟橡皮筋一样的粘着,比较有趣。 2 | 3 | Android library to display a ListView which cells are not rigid but flabby and react to ListView scroll and touch events. -------------------------------------------------------------------------------- /sample/assets/TouchImageView.txt: -------------------------------------------------------------------------------- 1 | 最好用的可缩放ImagView,继承自ImageView具有ImageView的所有功能;除此之外,还有缩放、拖拽、双击放大等功能,并伴有动画效果。 2 | 3 | 我在github上找到了三个,分别是 PhotoView、ImageViewZoom、TouchImageView。经过比较TouchImageView在性能上最好、集成简单。 4 | 5 | -------------------------------------------------------------------------------- /sample/assets/GossipView.txt: -------------------------------------------------------------------------------- 1 | 当我们想展示一个数组形式的数据的时候,要么是使用列表的形式,要么是使用网格的形式,今天我们介绍一种奇葩的形式,圆圈形式. 2 | 3 | 注意,周边的扇形是可以点击的。如果使用现有控件,要实现起来是有难度的,所以我们就采用了自定义View的方式。 4 | 5 | 原理以及使用方法,请移步: http://jcodecraeer.com/a/opensource/2014/1115/1988.html -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/circular_progress_button/OnAnimationEndListener.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.circular_progress_button; 2 | 3 | interface OnAnimationEndListener { 4 | 5 | public void onAnimationEnd(); 6 | } 7 | -------------------------------------------------------------------------------- /sample/res/drawable/dialog_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/residemenu/ResideMenu_helper.txt: -------------------------------------------------------------------------------- 1 | 2 | 复制src/com/special/ResideMenu下的所有代码到您的项目相应位置 3 | 复制libs/nineoldandroids-library-2.4.0.jar到您项目libs/下 4 | 复制res/drawable-hdpi/shadow.9.png到您的项目相应位置 5 | 复制res/layout/residemenu.xml 和 residemenu_item.xml到您的项目相应位置 -------------------------------------------------------------------------------- /sample/assets/XListView.txt: -------------------------------------------------------------------------------- 1 | XlistView,可以实现流行的下拉刷新功能以及上拉加载更多的分页功能. 2 | listview是在项目中用到最多的控件之一吧,下拉刷新和自动翻页也似乎成了标配。 3 | 优点是集成很方便,而且下拉刷新后释放,反弹的过度效果也做得很顺滑. 4 | 5 | 已知bug:(我在写这个项目的时候发现了这个问题,网友也有反馈) 6 | 当最开始数据不能撑满屏幕的时候,也就是比如有1条,那么将ListView向上拉不会完美刷新,必须将底部的view拉出屏幕才可以刷新。 7 | 解决方法:详见XListView的onTouchEvent方法。 -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/swipemenu_listview/SwipeMenuCreator.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.swipemenu_listview; 2 | 3 | 4 | /** 5 | * 6 | * @author baoyz 7 | * @date 2014-8-24 8 | * 9 | */ 10 | public interface SwipeMenuCreator { 11 | 12 | void create(SwipeMenu menu); 13 | } 14 | -------------------------------------------------------------------------------- /sample/assets/ResideMenu.txt: -------------------------------------------------------------------------------- 1 | ReisdeMenu 创意灵感来自于Dribbble(Dribbble是一个面向创作家、艺术工作者、设计师等创意类作品的人群,提供作品在线服务,供网友在线查看已经完成的作品,或者正在创作的作品.). 2 | 而这个是Android版的ResideMenu,在视觉效果上部分参考了iOS版的RESideMenu,并在此感谢以上作者的贡献。 3 | 支持手势操作菜单,同时支持自定义手势操作失效区域。更详细的说明文档请看https://github.com/SpecialCyCi/AndroidResideMenu/blob/master/README_CN.md -------------------------------------------------------------------------------- /sample/res/drawable/home_score_bg_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | -------------------------------------------------------------------------------- /sample/res/drawable/error_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/res/drawable/success_bow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/res/drawable/warning_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/satellite_menu/IDegreeProvider.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.satellite_menu; 2 | 3 | /** 4 | * Interface for providing degrees between satellites. 5 | * 6 | * @author Siyamed SINIR 7 | * 8 | */ 9 | public interface IDegreeProvider { 10 | public float[] getDegrees(int count, float totalDegrees); 11 | } 12 | -------------------------------------------------------------------------------- /sample/assets/DragSortListView.txt: -------------------------------------------------------------------------------- 1 | DragSortListView(DSLV)是Android ListView的一个扩展,支持拖拽排序和左右滑动删除功能。重写了TouchInterceptor(TI)类来提供更加优美的拖拽动画效果。 2 | 3 | DSLV主要特性: 4 | 完美的拖拽支持; 5 | 在拖动时提供更平滑的滚动列表滚动; 6 | 支持每个ListItem高度的多样性 7 | 公开startDrag()和stopDrag()方法; 8 | 有公开的接口可以自定义拖动的View。 9 | 10 | DragSortListView适用于带有任何优先级的列表:收藏夹、播放列表及清单等,算得上是目前Android开源实现拖动排序操作最完美的方案。 -------------------------------------------------------------------------------- /sample/使用前必读.txt: -------------------------------------------------------------------------------- 1 | 导入项目后会报错的,需要在eclipse里面配置一下butterknife环境, 2 | 1.右键你的工程,选择“Properties”, 3 | 2.选择"Java Compiler" , 4 | 3.选择 "Java Compiler"—"Annotation Processing" 并选择"Enable annotation processing", 5 | 4.选择 "Java Compiler“—”Annotation Processing“—”Factory Path",选择butterknife-6.0.0.jar的路径。 6 | 官网配置教程: 7 | http://jakewharton.github.io/butterknife/ide-eclipse.html -------------------------------------------------------------------------------- /sample/res/drawable/success_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/res/drawable/cpb_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /sample/res/layout/flabby_lv_main.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sample/res/drawable/titlebar_menu_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/res/anim/sat_main_rotate_left.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/res/anim/sat_main_rotate_right.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/res/values/sat_attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/res/anim/success_bow_roate.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /sample/res/layout/sat_item_cr.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /sample/res/layout/sat_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /sample/res/layout/touch_imageview_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/DiscrollViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import com.qy.main.R; 4 | 5 | import android.app.Activity; 6 | import android.os.Bundle; 7 | 8 | public class DiscrollViewActivity 9 | extends 10 | Activity 11 | { 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.discrollview_main); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sample/res/layout/tickplusdrawable_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/TouchImageViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.qy.main.R; 7 | 8 | public class TouchImageViewActivity 9 | extends 10 | Activity 11 | { 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.touch_imageview_main); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sample/res/layout/swipemenulistview_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /sample/res/drawable/error_state_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /sample/res/drawable/complete_state_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /sample/res/drawable/idle_state_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /sample/assets/ButterKnife.txt: -------------------------------------------------------------------------------- 1 | 自于jakewharton大神的力作,安卓里面的视图注入库 2 | 可以对任意的View对象使用注入,当然了,需要提供view root的对象 3 | 简化list adapter中的View Holder模式 4 | View "injection" library for Android which uses annotation processing to generate boilerplate code for you. 5 | Eliminate findViewById calls by using @InjectView on fields. 6 | Group multiple viewsin a list using @InjectViews. Operate on all of them at once with actions, setters, or properties. 7 | Eliminate anonymous inner-classes for listeners by annotating methods with @OnClick and others. -------------------------------------------------------------------------------- /sample/res/color/cpb_error_state_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /sample/res/color/cpb_idle_state_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /sample/res/color/cpb_complete_state_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | -------------------------------------------------------------------------------- /sample/res/layout/collageviews_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /sample/res/values/toggle_button_attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/res/layout/about.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/gossipview/GossipItem.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.gossipview; 2 | 3 | public class GossipItem { 4 | private String title; 5 | private int index; 6 | public GossipItem (String title,int index){ 7 | this.title =title; 8 | this.index = index; 9 | } 10 | 11 | public String getTitle() { 12 | return title; 13 | } 14 | 15 | public void setTitle(String title) { 16 | this.title = title; 17 | } 18 | 19 | public int getIndex() { 20 | return index; 21 | } 22 | 23 | public void setIndex(int index) { 24 | this.index = index; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/circleprogress/Utils.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.circleprogress; 2 | 3 | import android.content.res.Resources; 4 | 5 | /** 6 | * Created by bruce on 14-11-6. 7 | */ 8 | public class Utils { 9 | public static float dp2px(Resources resources, float dp) { 10 | final float scale = resources.getDisplayMetrics().density; 11 | return dp * scale + 0.5f; 12 | } 13 | 14 | public static float sp2px(Resources resources, float sp){ 15 | final float scale = resources.getDisplayMetrics().scaledDensity; 16 | return sp * scale; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sample/res/drawable/blue_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/res/drawable/gray_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/res/drawable/red_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/res/layout/home.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/CollageViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.qy.customview.collage_views.MultiTouchListener; 7 | import com.qy.main.R; 8 | 9 | public class CollageViewActivity 10 | extends 11 | Activity 12 | { 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.collageviews_main); 17 | findViewById(R.id.collageviews_img).setOnTouchListener(new MultiTouchListener()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sample/assets/NumberProgressBar.txt: -------------------------------------------------------------------------------- 1 | NumberProgressBar实现了带数字进度的Android进度控件。 2 | 3 | The NumberProgressBar is a bar, slim and sexy (every man wants! ). 4 | 5 | I decided to do this because I was really tired of android original progress bar. So, I made some change, added more color style for this. 6 | 7 | And also you can contribute more color style, or new idea to me. 8 | 9 | BTW. My friends also made some other platform's NumberProgressBar: 10 | Web-Front by kalasoo - https://github.com/kalasoo/NumberProgressBar 11 | iOS by Ming-Zhe - https://github.com/Ming-Zhe/NumberProgressBar 12 | Windows Phone by s2003zy - https://github.com/s2003zy -------------------------------------------------------------------------------- /sample/res/anim/modal_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 14 | 18 | -------------------------------------------------------------------------------- /sample/res/anim/success_mask_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 19 | 20 | -------------------------------------------------------------------------------- /sample/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | 290dp 9 | 3dp 10 | 34dp 11 | 12 | 13 | 8dp 14 | 15 | 16 | 4dp 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/assets/SatelliteMenu.txt: -------------------------------------------------------------------------------- 1 | 点击主按钮,会弹出多个围绕着主按钮排列的子按钮,从而形成一个弹出式菜单。子按钮弹出和消失的动画效果都很棒。这种弹出式菜单按钮应用在Path app中。 2 | 3 | 'Path' has a very attractive menu sitting on the left bottom corner of the screen. Satellite Menu is the open version of this menu. 4 | 5 | For the ones who didnt see path, the menu consists of a main button on the left bottom of the screen. When the user clicks on this button, a number of buttons are popped out of this button. I have resembled this structure to a planet and satellites and thats why I gave the name of this project. 6 | 7 | The menu uses built-in animations of Android platform. 8 | 9 | Works in API Level 7 (2.1) and above. 10 | 11 | Licenced with LGPL. -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/discrollview/Discrollvable.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.discrollview; 2 | 3 | /** 4 | * Represents a View able to be discrollved. 5 | */ 6 | public interface Discrollvable { 7 | 8 | /** 9 | * Called to discrollve the View. 10 | * @param ratio discrollve ratio between 0.0 and 1.0. 11 | * 1.0 means the View is totally discrollved 12 | */ 13 | public void onDiscrollve(float ratio); 14 | 15 | /** 16 | * Called to reset the discrollvation of the View. 17 | * In this method, you have to reset the View in order 18 | * to be discrollved again. 19 | */ 20 | public void onResetDiscrollve(); 21 | } 22 | -------------------------------------------------------------------------------- /sample/res/anim/error_frame_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/TitanicActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.qy.customview.titanic.Titanic; 7 | import com.qy.customview.titanic.TitanicTextView; 8 | import com.qy.main.R; 9 | 10 | public class TitanicActivity 11 | extends 12 | Activity 13 | { 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.titanic_main); 18 | TitanicTextView tv = (TitanicTextView) findViewById(R.id.titanic_tv); 19 | 20 | // start animation 21 | new Titanic().start(tv); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample/assets/DiscrollView.txt: -------------------------------------------------------------------------------- 1 | 支持滚动时Item淡入淡出,平移,缩放效果的ScrollView. 2 | 在滚动页面时,网页上的部件会逐渐褪色、平移或者缩放。 3 | Regularly, I am pleasantly surprised by websites using a pattern I called the discrollver pattern. I'm sure you already know what I'm talking about but if not, http://vimeo.com/player is a good example. When you scroll, widgets appear from nowhere by fade, translation or scale. 4 | 5 | With DiscrollView, I wanted to import this pattern on Android. This is an 0.0.1 alpha version because you have to do all the transformation work (fade, translation, scale etc) yourself base on a ratio value. I'm going to add some transformation presets (translation from left to right + fade in for example) to make the library more ready to use for lazy developers. -------------------------------------------------------------------------------- /sample/res/drawable/warning_sigh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /sample/res/anim/sat_item_anim_click.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 16 | 17 | 22 | 23 | -------------------------------------------------------------------------------- /sample/res/layout/flabby_lv_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 19 | 20 | -------------------------------------------------------------------------------- /sample/res/layout/gossipview_main.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/satellite_menu/ArrayDegreeProvider.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.satellite_menu; 2 | 3 | /** 4 | * Provide the degree between each satellite as an array of degrees. Can be provided to 5 | * {@link SatelliteMenu} as a parameter. 6 | * 7 | * @author Siyamed SINIR 8 | * 9 | */ 10 | public class ArrayDegreeProvider implements IDegreeProvider { 11 | private float[] degrees; 12 | 13 | public ArrayDegreeProvider(float[] degrees) { 14 | this.degrees = degrees; 15 | } 16 | 17 | public float[] getDegrees(int count, float totalDegrees){ 18 | if(degrees == null || degrees.length != count){ 19 | throw new IllegalArgumentException("Provided delta degrees and the action count are not the same."); 20 | } 21 | return degrees; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/xlistview/XListView.txt: -------------------------------------------------------------------------------- 1 | XlistView 2 | 可以实现流行的下拉刷新功能以及上拉加载更多的分页功能 3 | 优点是集成很方便,而且下拉刷新后释放,反弹的过度效果也做得很顺滑. 4 | 5 | 6 | 7 | 文件清单 8 | 9 | java: 10 | XListView.java 11 | XListViewFooter.java 12 | XListViewHeader.java 13 | 14 | layout: 15 | xlistview_footer.xml 16 | xlistview_header.xml 17 | 18 | 图片: 19 | xlistview_arrow.png 20 | 21 | strings.xml 加入: 22 | 下拉刷新 23 | 松开刷新数据 24 | 正在加载... 25 | 上次更新时间: 26 | 查看更多 27 | 松开载入更多 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/collage_views/Vector2D.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.collage_views; 2 | 3 | import android.graphics.PointF; 4 | 5 | public class Vector2D extends PointF { 6 | 7 | public Vector2D() { 8 | super(); 9 | } 10 | 11 | public Vector2D(float x, float y) { 12 | super(x, y); 13 | } 14 | 15 | public static float getAngle(Vector2D vector1, Vector2D vector2) { 16 | vector1.normalize(); 17 | vector2.normalize(); 18 | double degrees = (180.0 / Math.PI) * (Math.atan2(vector2.y, vector2.x) - Math.atan2(vector1.y, vector1.x)); 19 | return (float) degrees; 20 | } 21 | 22 | public void normalize() { 23 | float length = (float) Math.sqrt(x * x + y * y); 24 | x /= length; 25 | y /= length; 26 | } 27 | } -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SpringSystem.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.toggle_button.facebook.rebound; 2 | 3 | /** 4 | * This is a wrapper for BaseSpringSystem that provides the convenience of automatically providing 5 | * the AndroidSpringLooper dependency in {@link SpringSystem#create}. 6 | */ 7 | public class SpringSystem extends BaseSpringSystem { 8 | 9 | /** 10 | * Create a new SpringSystem providing the appropriate constructor parameters to work properly 11 | * in an Android environment. 12 | * @return the SpringSystem 13 | */ 14 | public static SpringSystem create() { 15 | return new SpringSystem(AndroidSpringLooperFactory.createSpringLooper()); 16 | } 17 | 18 | private SpringSystem(SpringLooper springLooper) { 19 | super(springLooper); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /sample/res/layout/titanic_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | -------------------------------------------------------------------------------- /sample/res/layout/residemenu_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 22 | 23 | -------------------------------------------------------------------------------- /sample/res/layout/satellite_menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 20 | 21 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SimpleSpringListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | package com.qy.customview.toggle_button.facebook.rebound; 12 | 13 | public class SimpleSpringListener implements SpringListener { 14 | @Override 15 | public void onSpringUpdate(Spring spring) { 16 | } 17 | 18 | @Override 19 | public void onSpringAtRest(Spring spring) { 20 | } 21 | 22 | @Override 23 | public void onSpringActivate(Spring spring) { 24 | } 25 | 26 | @Override 27 | public void onSpringEndStateChange(Spring spring) { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sample/res/layout/swipemenulistview_item.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 23 | 24 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/OrigamiValueConverter.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.toggle_button.facebook.rebound; 2 | 3 | /** 4 | * Helper math util to convert tension & friction values from the Origami design tool to values that 5 | * the spring system needs. 6 | */ 7 | public class OrigamiValueConverter { 8 | 9 | public static double tensionFromOrigamiValue(double oValue) { 10 | return oValue == 0 ? 0 : (oValue - 30.0) * 3.62 + 194.0; 11 | } 12 | 13 | public static double origamiValueFromTension(double tension) { 14 | return tension == 0 ? 0 : (tension - 194.0) / 3.62 + 30.0; 15 | } 16 | 17 | public static double frictionFromOrigamiValue(double oValue) { 18 | return oValue == 0 ? 0 : (oValue - 8.0) * 3.0 + 25.0; 19 | } 20 | 21 | public static double origamiValueFromFriction(double friction) { 22 | return friction == 0 ? 0 : (friction - 25.0) / 3.0 + 8.0; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/satellite_menu/LinearDegreeProvider.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.satellite_menu; 2 | 3 | /** 4 | * Linearly distributes satellites in the given total degree. 5 | * 6 | * @author Siyamed SINIR 7 | * 8 | */ 9 | public class LinearDegreeProvider implements IDegreeProvider { 10 | public float[] getDegrees(int count, float totalDegrees){ 11 | if(count < 1){ 12 | return new float[]{}; 13 | } 14 | 15 | if(count == 1){ 16 | return new float[]{45}; 17 | } 18 | 19 | float[] result = null; 20 | int tmpCount = count-1; 21 | 22 | result = new float[count]; 23 | float delta = totalDegrees / tmpCount; 24 | 25 | for(int index=0; index 2 | 6 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /sample/res/anim/error_x_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 12 | 13 | 22 | 23 | 32 | -------------------------------------------------------------------------------- /sample/res/drawable/error_center_x.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/fragment/AboutFragment.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.fragment; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.TextView; 10 | import butterknife.ButterKnife; 11 | import butterknife.InjectView; 12 | 13 | import com.qy.main.R; 14 | import com.qy.main.utils.AssetsUtil; 15 | 16 | 17 | public class AboutFragment 18 | extends 19 | Fragment 20 | { 21 | 22 | private Activity context; 23 | private View parentView; 24 | @InjectView (R.id.about_txt) 25 | TextView tv; 26 | 27 | @Override 28 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 29 | parentView = inflater.inflate(R.layout.about, container, false); 30 | 31 | context = getActivity(); 32 | ButterKnife.inject(this, parentView); 33 | 34 | tv.setText(AssetsUtil.getAssetString("about.txt", context)); 35 | return parentView; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/circular_progress_button/StateManager.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.circular_progress_button; 2 | 3 | class StateManager { 4 | 5 | private boolean mIsEnabled; 6 | private int mProgress; 7 | 8 | public StateManager(CircularProgressButton progressButton) { 9 | mIsEnabled = progressButton.isEnabled(); 10 | mProgress = progressButton.getProgress(); 11 | } 12 | 13 | public void saveProgress(CircularProgressButton progressButton) { 14 | mProgress = progressButton.getProgress(); 15 | } 16 | 17 | public boolean isEnabled() { 18 | return mIsEnabled; 19 | } 20 | 21 | public int getProgress() { 22 | return mProgress; 23 | } 24 | 25 | public void checkState(CircularProgressButton progressButton) { 26 | if (progressButton.getProgress() != getProgress()) { 27 | progressButton.setProgress(progressButton.getProgress()); 28 | } else if(progressButton.isEnabled() != isEnabled()) { 29 | progressButton.setEnabled(progressButton.isEnabled()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SteppingLooper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | package com.qy.customview.toggle_button.facebook.rebound; 11 | 12 | public class SteppingLooper extends SpringLooper { 13 | 14 | private boolean mStarted; 15 | private long mLastTime; 16 | 17 | @Override 18 | public void start() { 19 | mStarted = true; 20 | mLastTime = 0; 21 | } 22 | 23 | public boolean step(long interval) { 24 | if (mSpringSystem == null || !mStarted) { 25 | return false; 26 | } 27 | long currentTime = mLastTime + interval; 28 | mSpringSystem.loop(currentTime); 29 | mLastTime = currentTime; 30 | return mSpringSystem.getIsIdle(); 31 | } 32 | 33 | @Override 34 | public void stop() { 35 | mStarted = false; 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /sample/res/layout/xlistview_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 18 | 19 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/touch_imageview/ExtendedViewPager.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.touch_imageview; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.View; 7 | 8 | 9 | public class ExtendedViewPager extends ViewPager { 10 | 11 | public ExtendedViewPager(Context context) { 12 | super(context); 13 | } 14 | 15 | public ExtendedViewPager(Context context, AttributeSet attrs) { 16 | super(context, attrs); 17 | } 18 | 19 | @Override 20 | protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) { 21 | if (v instanceof TouchImageView) { 22 | // 23 | // canScrollHorizontally is not supported for Api < 14. To get around this issue, 24 | // ViewPager is extended and canScrollHorizontallyFroyo, a wrapper around 25 | // canScrollHorizontally supporting Api >= 8, is called. 26 | // 27 | return ((TouchImageView) v).canScrollHorizontallyFroyo(-dx); 28 | 29 | } else { 30 | return super.canScroll(v, checkV, dx, x, y); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sample/res/values/library_circularprogressbutton_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | circularprogressbutton 4 | Dmytro Danylyk 5 | http://dmytrodanylyk.com/ 6 | Circular Progress Button 7 | Android Button which can morph to Circular Progress. 8 | 1.1.0 9 | http://dmytrodanylyk.com/pages/portfolio/circular-progress-button.html 10 | mit 11 | true 12 | https://github.com/dmytrodanylyk/circular-progress-button 13 | 14 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/circular_progress_button/StrokeGradientDrawable.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.circular_progress_button; 2 | 3 | import android.graphics.drawable.GradientDrawable; 4 | 5 | public class StrokeGradientDrawable { 6 | 7 | private int mStrokeWidth; 8 | private int mStrokeColor; 9 | 10 | private GradientDrawable mGradientDrawable; 11 | 12 | public StrokeGradientDrawable(GradientDrawable drawable) { 13 | mGradientDrawable = drawable; 14 | } 15 | 16 | public int getStrokeWidth() { 17 | return mStrokeWidth; 18 | } 19 | 20 | public void setStrokeWidth(int strokeWidth) { 21 | mStrokeWidth = strokeWidth; 22 | mGradientDrawable.setStroke(strokeWidth, getStrokeColor()); 23 | } 24 | 25 | public int getStrokeColor() { 26 | return mStrokeColor; 27 | } 28 | 29 | public void setStrokeColor(int strokeColor) { 30 | mStrokeColor = strokeColor; 31 | mGradientDrawable.setStroke(getStrokeWidth(), strokeColor); 32 | } 33 | 34 | public GradientDrawable getGradientDrawable() { 35 | return mGradientDrawable; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/swipemenu_listview/SwipeMenu.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.swipemenu_listview; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import android.content.Context; 7 | 8 | /** 9 | * 10 | * @author baoyz 11 | * @date 2014-8-23 12 | * 13 | */ 14 | public class SwipeMenu { 15 | 16 | private Context mContext; 17 | private List mItems; 18 | private int mViewType; 19 | 20 | public SwipeMenu(Context context) { 21 | mContext = context; 22 | mItems = new ArrayList(); 23 | } 24 | 25 | public Context getContext() { 26 | return mContext; 27 | } 28 | 29 | public void addMenuItem(SwipeMenuItem item) { 30 | mItems.add(item); 31 | } 32 | 33 | public void removeMenuItem(SwipeMenuItem item) { 34 | mItems.remove(item); 35 | } 36 | 37 | public List getMenuItems() { 38 | return mItems; 39 | } 40 | 41 | public SwipeMenuItem getMenuItem(int index) { 42 | return mItems.get(index); 43 | } 44 | 45 | public int getViewType() { 46 | return mViewType; 47 | } 48 | 49 | public void setViewType(int viewType) { 50 | this.mViewType = viewType; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/gossipview/MyUtils.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.gossipview; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.util.DisplayMetrics; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.view.WindowManager; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | import android.widget.TextView; 12 | 13 | /** 14 | * Created by Dacer on 10/8/13. 15 | */ 16 | public class MyUtils { 17 | 18 | public static int dip2px(Context context, float dipValue){ 19 | final float scale = context.getResources().getDisplayMetrics().density; 20 | return (int)(dipValue * scale + 0.5f); 21 | } 22 | 23 | public static int px2dip(Context context, float pxValue){ 24 | final float scale = context.getResources().getDisplayMetrics().density; 25 | return (int)(pxValue / scale + 0.5f); 26 | } 27 | 28 | public static int sp2px(Context context, float spValue) { 29 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; 30 | return (int) (spValue * fontScale + 0.5f); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/simple/MyLeadingMarginSpan2.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.simple; 2 | 3 | /* 4 | * Provided by @levifan 5 | * https://github.com/bluejamesbond/Sandbox/issues/2#issuecomment-60928630 6 | */ 7 | 8 | import android.graphics.Canvas; 9 | import android.graphics.Paint; 10 | import android.text.Layout; 11 | 12 | public class MyLeadingMarginSpan2 implements 13 | android.text.style.LeadingMarginSpan.LeadingMarginSpan2 { 14 | 15 | private int margin; 16 | private int lines; 17 | 18 | public MyLeadingMarginSpan2(int lines, int margin) { 19 | this.lines = lines; 20 | this.margin = margin; 21 | } 22 | 23 | @Override 24 | public int getLeadingMargin(boolean first) { 25 | return margin; 26 | } 27 | 28 | @Override 29 | public void drawLeadingMargin(Canvas c, Paint p, int x, int dir, int top, int baseline, 30 | int bottom, CharSequence text, int start, int end, boolean first, 31 | Layout layout) { 32 | } 33 | 34 | @Override 35 | public int getLeadingMarginLineCount() { 36 | return lines; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/Direction.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | /* 4 | * Copyright 2014 Mathew Kurian 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ------------------------------------------------------------------------- 19 | * 20 | * Direction.java 21 | * @author Mathew Kurian 22 | * 23 | * From TextJustify-Android Library v2.0 24 | * https://github.com/bluejamesbond/TextJustify-Android 25 | * 26 | * Please report any issues 27 | * https://github.com/bluejamesbond/TextJustify-Android/issues 28 | * 29 | * Date: 11/25/14 7:13 PM 30 | */ 31 | 32 | public enum Direction { 33 | NORMAL, REVERSE 34 | } -------------------------------------------------------------------------------- /sample/res/layout/textjustify_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 22 | 23 | 24 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /sample/res/anim/modal_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 11 | 19 | 20 | 29 | 30 | 39 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/TextAlignment.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | /* 4 | * Copyright 2014 Mathew Kurian 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ------------------------------------------------------------------------- 19 | * 20 | * TextAlignment.java 21 | * @author Mathew Kurian 22 | * 23 | * From TextJustify-Android Library v2.0 24 | * https://github.com/bluejamesbond/TextJustify-Android 25 | * 26 | * Please report any issues 27 | * https://github.com/bluejamesbond/TextJustify-Android/issues 28 | * 29 | * Date: 10/27/14 1:36 PM 30 | */ 31 | 32 | public enum TextAlignment { 33 | LEFT, RIGHT, JUSTIFIED, CENTER 34 | } -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SynchronousLooper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | package com.qy.customview.toggle_button.facebook.rebound; 11 | 12 | public class SynchronousLooper extends SpringLooper { 13 | 14 | public static double SIXTY_FPS = 16.6667; 15 | private double mTimeStep; 16 | private boolean mRunning; 17 | 18 | public SynchronousLooper() { 19 | mTimeStep = SIXTY_FPS; 20 | } 21 | 22 | public double getTimeStep() { 23 | return mTimeStep; 24 | } 25 | 26 | public void setTimeStep(double timeStep) { 27 | mTimeStep = timeStep; 28 | } 29 | 30 | @Override 31 | public void start() { 32 | mRunning = true; 33 | while (!mSpringSystem.getIsIdle()) { 34 | if (mRunning == false) { 35 | break; 36 | } 37 | mSpringSystem.loop(mTimeStep); 38 | } 39 | } 40 | 41 | @Override 42 | public void stop() { 43 | mRunning = false; 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/satellite_menu/DefaultDegreeProvider.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.satellite_menu; 2 | 3 | /** 4 | * Default provider for degrees between satellites. For number of satellites up to 3 5 | * tries to keep satellites centered in the given total degrees. For number equal and 6 | * bigger than four, distirbutes evenly using min and max degrees. 7 | * 8 | * @author Siyamed SINIR 9 | * 10 | */ 11 | public class DefaultDegreeProvider implements IDegreeProvider { 12 | public float[] getDegrees(int count, float totalDegrees){ 13 | if(count < 1) 14 | { 15 | return new float[]{}; 16 | } 17 | 18 | float[] result = null; 19 | int tmpCount = 0; 20 | if(count < 4){ 21 | tmpCount = count+1; 22 | }else{ 23 | tmpCount = count-1; 24 | } 25 | 26 | result = new float[count]; 27 | float delta = totalDegrees / tmpCount; 28 | 29 | for(int index=0; index 6 | 7 | 13 | 14 | 22 | 23 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /sample/res/layout/dragsort_listview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 31 | 32 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/simple/FontsOverride.java: -------------------------------------------------------------------------------- 1 | /* 2 | * http://stackoverflow.com/questions/2973270/using-a-custom-typeface-in-android/16275257#16275257 3 | */ 4 | 5 | package com.qy.customview.text_justify.simple; 6 | 7 | import android.content.Context; 8 | import android.graphics.Typeface; 9 | 10 | import java.lang.reflect.Field; 11 | 12 | public final class FontsOverride { 13 | 14 | public static void setDefaultFont(Context context, 15 | String staticTypefaceFieldName, String fontAssetName) { 16 | final Typeface regular = Typeface.createFromAsset(context.getAssets(), 17 | fontAssetName); 18 | replaceFont(staticTypefaceFieldName, regular); 19 | } 20 | 21 | protected static void replaceFont(String staticTypefaceFieldName, 22 | final Typeface newTypeface) { 23 | try { 24 | final Field staticField = Typeface.class 25 | .getDeclaredField(staticTypefaceFieldName); 26 | staticField.setAccessible(true); 27 | staticField.set(null, newTypeface); 28 | } catch (NoSuchFieldException e) { 29 | e.printStackTrace(); 30 | } catch (IllegalAccessException e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/LeftSpan.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | /* 4 | * Copyright 2014 Mathew Kurian 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ------------------------------------------------------------------------- 19 | * 20 | * LeftSpan.java 21 | * @author Mathew Kurian 22 | * 23 | * From TextJustify-Android Library v2.0 24 | * https://github.com/bluejamesbond/TextJustify-Android 25 | * 26 | * Please report any issues 27 | * https://github.com/bluejamesbond/TextJustify-Android/issues 28 | * 29 | * Date: 10/27/14 1:36 PM 30 | */ 31 | 32 | public class LeftSpan extends TextAlignmentSpan { 33 | @Override 34 | public TextAlignment getTextAlignment() { 35 | return TextAlignment.LEFT; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SpringSystemListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | package com.qy.customview.toggle_button.facebook.rebound; 12 | 13 | /** 14 | * SpringSystemListener provides an interface for listening to events before and after each Physics 15 | * solving loop the BaseSpringSystem runs. 16 | */ 17 | public interface SpringSystemListener { 18 | 19 | /** 20 | * Runs before each pass through the physics integration loop providing an opportunity to do any 21 | * setup or alterations to the Physics state before integrating. 22 | * @param springSystem the BaseSpringSystem listened to 23 | */ 24 | void onBeforeIntegrate(BaseSpringSystem springSystem); 25 | 26 | /** 27 | * Runs after each pass through the physics integration loop providing an opportunity to do any 28 | * setup or alterations to the Physics state after integrating. 29 | * @param springSystem the BaseSpringSystem listened to 30 | */ 31 | void onAfterIntegrate(BaseSpringSystem springSystem); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/CenterSpan.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | /* 4 | * Copyright 2014 Mathew Kurian 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ------------------------------------------------------------------------- 19 | * 20 | * CenterSpan.java 21 | * @author Mathew Kurian 22 | * 23 | * From TextJustify-Android Library v2.0 24 | * https://github.com/bluejamesbond/TextJustify-Android 25 | * 26 | * Please report any issues 27 | * https://github.com/bluejamesbond/TextJustify-Android/issues 28 | * 29 | * Date: 10/27/14 1:36 PM 30 | */ 31 | 32 | public class CenterSpan extends TextAlignmentSpan { 33 | @Override 34 | public TextAlignment getTextAlignment() { 35 | return TextAlignment.CENTER; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/RightSpan.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | /* 4 | * Copyright 2014 Mathew Kurian 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ------------------------------------------------------------------------- 19 | * 20 | * RightSpan.java 21 | * @author Mathew Kurian 22 | * 23 | * From TextJustify-Android Library v2.0 24 | * https://github.com/bluejamesbond/TextJustify-Android 25 | * 26 | * Please report any issues 27 | * https://github.com/bluejamesbond/TextJustify-Android/issues 28 | * 29 | * Date: 10/27/14 1:36 PM 30 | */ 31 | 32 | public class RightSpan extends TextAlignmentSpan { 33 | 34 | @Override 35 | public TextAlignment getTextAlignment() { 36 | return TextAlignment.RIGHT; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/JustifiedSpan.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | /* 4 | * Copyright 2014 Mathew Kurian 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ------------------------------------------------------------------------- 19 | * 20 | * JustifiedSpan.java 21 | * @author Mathew Kurian 22 | * 23 | * From TextJustify-Android Library v2.0 24 | * https://github.com/bluejamesbond/TextJustify-Android 25 | * 26 | * Please report any issues 27 | * https://github.com/bluejamesbond/TextJustify-Android/issues 28 | * 29 | * Date: 10/27/14 1:36 PM 30 | */ 31 | 32 | public class JustifiedSpan extends TextAlignmentSpan { 33 | @Override 34 | public TextAlignment getTextAlignment() { 35 | return TextAlignment.JUSTIFIED; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/utils/AssetsUtil.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | 7 | import android.content.Context; 8 | 9 | public class AssetsUtil 10 | { 11 | /** 12 | * 读取assets下的文本文件 13 | * @param asset 文件名称 14 | * @param context 15 | * @return 16 | */ 17 | public static String getAssetString(String asset, Context context) { 18 | BufferedReader bufferedReader = null; 19 | try { 20 | bufferedReader = new BufferedReader(new InputStreamReader(context.getAssets().open(asset))); 21 | String line = null; 22 | StringBuilder builder = new StringBuilder(); 23 | while (null != (line = bufferedReader.readLine())) { 24 | builder.append(line).append("\n"); 25 | } 26 | return builder.toString(); 27 | } catch (IOException e) { 28 | e.printStackTrace(); 29 | }finally{ 30 | if (null != bufferedReader) { 31 | try { 32 | bufferedReader.close(); 33 | } catch (IOException e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | bufferedReader = null; 38 | } 39 | return ""; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/TickPlusDrawableActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Activity; 5 | import android.graphics.Color; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import com.qy.customview.tickplus_drawable.TickPlusDrawable; 9 | import com.qy.main.R; 10 | 11 | public class TickPlusDrawableActivity 12 | extends 13 | Activity 14 | { 15 | @SuppressLint ("NewApi") 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.tickplusdrawable_main); 20 | 21 | View view = findViewById(R.id.view); 22 | 23 | final TickPlusDrawable tickPlusDrawable = new TickPlusDrawable(getResources().getDimensionPixelSize(R.dimen.stroke_width), getResources().getColor(android.R.color.holo_blue_dark), Color.WHITE); 24 | 25 | if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) { 26 | view.setBackgroundDrawable(tickPlusDrawable); 27 | } else { 28 | view.setBackground(tickPlusDrawable); 29 | } 30 | 31 | view.setOnClickListener(new View.OnClickListener() { 32 | @Override 33 | public void onClick(View v) { 34 | tickPlusDrawable.toggle(); 35 | } 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sample/res/values/dslv_attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SpringLooper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | package com.qy.customview.toggle_button.facebook.rebound; 12 | 13 | /** 14 | * The spring looper is an interface for implementing platform-dependent run loops. 15 | */ 16 | public abstract class SpringLooper { 17 | 18 | protected BaseSpringSystem mSpringSystem; 19 | 20 | /** 21 | * Set the BaseSpringSystem that the SpringLooper will call back to. 22 | * @param springSystem the spring system to call loop on. 23 | */ 24 | public void setSpringSystem(BaseSpringSystem springSystem) { 25 | mSpringSystem = springSystem; 26 | } 27 | 28 | /** 29 | * The BaseSpringSystem has requested that the looper begins running this {@link Runnable} 30 | * on every frame. The {@link Runnable} will continue running on every frame until 31 | * {@link #stop()} is called. 32 | * If an existing {@link Runnable} had been started on this looper, it will be cancelled. 33 | */ 34 | public abstract void start(); 35 | 36 | /** 37 | * The looper will no longer run the {@link Runnable}. 38 | */ 39 | public abstract void stop(); 40 | } -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/GossipViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import android.app.Activity; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.view.View.OnClickListener; 10 | import android.widget.Toast; 11 | 12 | import com.qy.customview.gossipview.GossipItem; 13 | import com.qy.customview.gossipview.GossipView; 14 | import com.qy.main.R; 15 | 16 | public class GossipViewActivity 17 | extends 18 | Activity 19 | { 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.gossipview_main); 24 | GossipView gossipView = (GossipView)findViewById(R.id.gossipview); 25 | String [] strs = {"安卓","微软","苹果","谷歌","百度","腾讯"} ; 26 | 27 | final List items =new ArrayList(); 28 | for(int i = 0; i < strs.length; i++) { 29 | GossipItem item = new GossipItem(strs[i],3); 30 | items.add(item); 31 | } 32 | gossipView.setItems(items); 33 | gossipView.setNumber(6); 34 | gossipView.setOnPieceClickListener( new GossipView.OnPieceClickListener(){ 35 | @Override 36 | public void onPieceClick(int index) { 37 | if(index != -1 && index != -2) { 38 | Toast.makeText(GossipViewActivity.this, "你选择了" + items.get(index).getTitle(), Toast.LENGTH_SHORT).show(); 39 | } 40 | } 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/collage_views/CollageView.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.collage_views; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.util.AttributeSet; 8 | import android.widget.ImageView; 9 | 10 | public class CollageView extends ImageView { 11 | 12 | private static final int PADDING = 8; 13 | private static final float STROKE_WIDTH = 8.0f; 14 | 15 | private Paint mBorderPaint; 16 | 17 | public CollageView(Context context) { 18 | this(context, null); 19 | } 20 | 21 | public CollageView(Context context, AttributeSet attrs) { 22 | this(context, attrs, 0); 23 | setPadding(PADDING, PADDING, PADDING, PADDING); 24 | } 25 | 26 | public CollageView(Context context, AttributeSet attrs, int defStyle) { 27 | super(context, attrs, defStyle); 28 | initBorderPaint(); 29 | } 30 | 31 | private void initBorderPaint() { 32 | mBorderPaint = new Paint(); 33 | mBorderPaint.setAntiAlias(true); 34 | mBorderPaint.setStyle(Paint.Style.STROKE); 35 | mBorderPaint.setColor(Color.TRANSPARENT); 36 | mBorderPaint.setStrokeWidth(STROKE_WIDTH); 37 | } 38 | 39 | @Override 40 | protected void onDraw(Canvas canvas) { 41 | super.onDraw(canvas); 42 | canvas.drawRect(PADDING, PADDING, getWidth() - PADDING, getHeight() - PADDING, mBorderPaint); 43 | } 44 | } -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/FlabbyListViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import android.app.ListActivity; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.ListView; 10 | import android.widget.Toast; 11 | 12 | import com.qy.customview.flabby_listview.FlabbyAdapter; 13 | import com.qy.main.R; 14 | 15 | public class FlabbyListViewActivity 16 | extends 17 | ListActivity 18 | { 19 | private static final int NUM_LIST_ITEM = 100; 20 | private FlabbyAdapter mAdapter; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.flabby_lv_main); 26 | List items = getListItems(); 27 | mAdapter = new FlabbyAdapter(this,items); 28 | setListAdapter(mAdapter); 29 | getListView().setSelection(items.size()/2); 30 | } 31 | 32 | private ArrayList getListItems() { 33 | ArrayList list = new ArrayList(); 34 | for(int i=0;i 55 | 微信:630404403
56 | 博客:[http://blog.csdn.net/qy1387](http://blog.csdn.net/qy1387) 57 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/circleprogress/DummyContent.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.circleprogress; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * Helper class for providing sample content for user interfaces created by 10 | * Android template wizards. 11 | *

12 | * TODO: Replace all uses of this class before publishing your app. 13 | */ 14 | public class DummyContent { 15 | 16 | /** 17 | * An array of sample (dummy) items. 18 | */ 19 | public static List ITEMS = new ArrayList(); 20 | 21 | /** 22 | * A map of sample (dummy) items, by ID. 23 | */ 24 | public static Map ITEM_MAP = new HashMap(); 25 | 26 | static { 27 | // Add 3 sample items. 28 | addItem(new DummyItem("1", "Item 1")); 29 | addItem(new DummyItem("2", "Item 2")); 30 | addItem(new DummyItem("3", "Item 3")); 31 | } 32 | 33 | private static void addItem(DummyItem item) { 34 | ITEMS.add(item); 35 | ITEM_MAP.put(item.id, item); 36 | } 37 | 38 | /** 39 | * A dummy item representing a piece of content. 40 | */ 41 | public static class DummyItem { 42 | public String id; 43 | public String content; 44 | 45 | public DummyItem(String id, String content) { 46 | this.id = id; 47 | this.content = content; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return content; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /sample/res/layout/togglebutton_main.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | 17 | 24 | 25 | 35 | 36 | 41 | 42 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/style/DirectionSpan.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.text_justify.style; 2 | 3 | import android.text.TextPaint; 4 | import android.text.style.CharacterStyle; 5 | 6 | /* 7 | * Copyright 2014 Mathew Kurian 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * ------------------------------------------------------------------------- 22 | * 23 | * ReverseSpan.java 24 | * @author Mathew Kurian 25 | * 26 | * From TextJustify-Android Library v2.0 27 | * https://github.com/bluejamesbond/TextJustify-Android 28 | * 29 | * Please report any issues 30 | * https://github.com/bluejamesbond/TextJustify-Android/issues 31 | * 32 | * Date: 11/25/14 7:06 PM 33 | */ 34 | 35 | public class DirectionSpan extends CharacterStyle { 36 | private final Direction direction; 37 | 38 | public DirectionSpan(Direction direction) { 39 | this.direction = direction; 40 | } 41 | 42 | public Direction getDirection() { 43 | return direction; 44 | } 45 | 46 | @Override 47 | public void updateDrawState(TextPaint tp) { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/simple/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Mathew Kurian 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * ------------------------------------------------------------------------- 17 | * 18 | * Utils.java 19 | * @author Mathew Kurian 20 | * 21 | * From TextJustify-Android Library v2.0 22 | * https://github.com/bluejamesbond/TextJustify-Android 23 | * 24 | * Please report any issues 25 | * https://github.com/bluejamesbond/TextJustify-Android/issues 26 | * 27 | * Date: 11/1/14 3:03 PM 28 | */ 29 | 30 | package com.qy.customview.text_justify.simple; 31 | 32 | public class Utils { 33 | 34 | /* 35 | * Refer to http://stackoverflow.com/a/2560017/1100536 36 | */ 37 | public static String splitCamelCase(String s) { 38 | return s.replaceAll( 39 | String.format("%s|%s|%s", 40 | "(?<=[A-Z])(?=[A-Z][a-z])", 41 | "(?<=[^A-Z])(?=[A-Z])", 42 | "(?<=[A-Za-z])(?=[^A-Za-z])" 43 | ), 44 | " " 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/SpringConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | package com.qy.customview.toggle_button.facebook.rebound; 12 | 13 | /** 14 | * Data structure for storing spring configuration. 15 | */ 16 | public class SpringConfig { 17 | public double friction; 18 | public double tension; 19 | 20 | public static SpringConfig defaultConfig = SpringConfig.fromOrigamiTensionAndFriction(40, 7); 21 | 22 | /** 23 | * constructor for the SpringConfig 24 | * @param tension tension value for the SpringConfig 25 | * @param friction friction value for the SpringConfig 26 | */ 27 | public SpringConfig(double tension, double friction) { 28 | this.tension = tension; 29 | this.friction = friction; 30 | } 31 | 32 | /** 33 | * A helper to make creating a SpringConfig easier with values mapping to the Origami values. 34 | * @param qcTension tension as defined in the Quartz Composition 35 | * @param qcFriction friction as defined in the Quartz Composition 36 | * @return a SpringConfig that maps to these values 37 | */ 38 | public static SpringConfig fromOrigamiTensionAndFriction(double qcTension, double qcFriction) { 39 | return new SpringConfig( 40 | OrigamiValueConverter.tensionFromOrigamiValue(qcTension), 41 | OrigamiValueConverter.frictionFromOrigamiValue(qcFriction) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/toggle_button/facebook/rebound/ui/Util.java: -------------------------------------------------------------------------------- 1 | package com.qy.customview.toggle_button.facebook.rebound.ui; 2 | 3 | import android.content.res.Resources; 4 | import android.util.TypedValue; 5 | import android.view.ViewGroup; 6 | import android.widget.FrameLayout; 7 | import android.widget.RelativeLayout; 8 | 9 | /** 10 | * Utilities for generating view hierarchies without using resources. 11 | */ 12 | public abstract class Util { 13 | 14 | public static final int dpToPx(float dp, Resources res) { 15 | return (int) TypedValue.applyDimension( 16 | TypedValue.COMPLEX_UNIT_DIP, 17 | dp, 18 | res.getDisplayMetrics()); 19 | } 20 | 21 | public static final FrameLayout.LayoutParams createLayoutParams(int width, int height) { 22 | return new FrameLayout.LayoutParams(width, height); 23 | } 24 | 25 | public static final FrameLayout.LayoutParams createMatchParams() { 26 | return createLayoutParams( 27 | ViewGroup.LayoutParams.MATCH_PARENT, 28 | ViewGroup.LayoutParams.MATCH_PARENT); 29 | } 30 | 31 | public static final FrameLayout.LayoutParams createWrapParams() { 32 | return createLayoutParams( 33 | ViewGroup.LayoutParams.WRAP_CONTENT, 34 | ViewGroup.LayoutParams.WRAP_CONTENT); 35 | } 36 | 37 | public static final FrameLayout.LayoutParams createWrapMatchParams() { 38 | return createLayoutParams( 39 | ViewGroup.LayoutParams.WRAP_CONTENT, 40 | ViewGroup.LayoutParams.MATCH_PARENT); 41 | } 42 | 43 | public static final FrameLayout.LayoutParams createMatchWrapParams() { 44 | return createLayoutParams( 45 | ViewGroup.LayoutParams.MATCH_PARENT, 46 | ViewGroup.LayoutParams.WRAP_CONTENT); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /sample/src/com/qy/main/activity/IntroActivity.java: -------------------------------------------------------------------------------- 1 | package com.qy.main.activity; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.text.TextUtils; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.TextView; 10 | import butterknife.ButterKnife; 11 | import butterknife.InjectView; 12 | import butterknife.OnClick; 13 | 14 | import com.qy.main.R; 15 | import com.qy.main.bean.Obj; 16 | import com.qy.main.utils.AssetsUtil; 17 | 18 | public class IntroActivity extends Activity{ 19 | 20 | @InjectView(R.id.intro_title) 21 | TextView title; 22 | @InjectView(R.id.intro_content) 23 | TextView intro; 24 | @InjectView(R.id.intro_url) 25 | TextView url; 26 | @InjectView(R.id.intro_btn) 27 | Button btn; 28 | 29 | Obj obj; 30 | 31 | @Override 32 | public void onCreate(Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | setContentView(R.layout.intro); 35 | ButterKnife.inject(this); 36 | 37 | if(getIntent().hasExtra("obj")){ 38 | obj = (Obj) getIntent().getSerializableExtra("obj"); 39 | } 40 | if(null==obj){ 41 | finish(); 42 | return; 43 | } 44 | 45 | title.setText(obj.title); 46 | intro.setText(AssetsUtil.getAssetString(obj.title+".txt", this)); 47 | if(!TextUtils.isEmpty(obj.url)){ 48 | url.setVisibility(View.VISIBLE); 49 | url.setText("项目主页:"+obj.url); 50 | } 51 | btn.setVisibility(obj.isEnable ? View.VISIBLE : View.GONE); 52 | } 53 | 54 | @OnClick(R.id.intro_btn) 55 | public void click(){ 56 | startActivity(new Intent(this,obj._class)); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /sample/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #00000000 5 | #FFFFFF 6 | #FFFFFF 7 | #D0D0D0 8 | #B6B6B6 9 | #AEDEF4 10 | #96BFD2 11 | #DD6B55 12 | #CD5B55 13 | #F27474 14 | #A5DC86 15 | #33A5DC86 16 | #F8BB86 17 | #575757 18 | #ff37474f 19 | #ff263238 20 | #ff21272b 21 | #ff80cbc4 22 | #ff009688 23 | 24 | 25 | 26 | #ffdedede 27 | #ff0099cc 28 | #ff00719b 29 | #ffff4444 30 | #ffcd3a3a 31 | #ff99cc00 32 | #ff6d9b00 33 | @android:color/white 34 | @android:color/white 35 | -------------------------------------------------------------------------------- /sample/ui.src/com/qy/customview/text_justify/simple/ArticleBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Mathew Kurian 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * ------------------------------------------------------------------------- 17 | * 18 | * ArticleBuilder.java 19 | * @author Mathew Kurian 20 | * 21 | * From TextJustify-Android Library v2.0 22 | * https://github.com/bluejamesbond/TextJustify-Android 23 | * 24 | * Please report any issues 25 | * https://github.com/bluejamesbond/TextJustify-Android/issues 26 | * 27 | * Date: 11/1/14 3:03 PM 28 | */ 29 | 30 | package com.qy.customview.text_justify.simple; 31 | 32 | import android.text.Html; 33 | import android.text.SpannableStringBuilder; 34 | import android.text.Spanned; 35 | 36 | /** 37 | * Created by Mathew Kurian on 10/31/2014. 38 | */ 39 | public class ArticleBuilder extends SpannableStringBuilder { 40 | public ArticleBuilder append(CharSequence text, boolean newline, Object... spans) { 41 | int start = this.length(); 42 | this.append(Html.fromHtml(text + "
" + (newline ? "
" : ""))); 43 | for (Object span : spans) { 44 | this.setSpan(span, start, this.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); 45 | } 46 | return this; 47 | } 48 | } -------------------------------------------------------------------------------- /sample/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 开源学院 5 | 6 | 7 | 下拉刷新 8 | 松开刷新数据 9 | 正在加载... 10 | 上次更新时间: 11 | 查看更多 12 | 松开载入更多 13 | 14 | 15 | Here\'s a message! 16 | OK 17 | Cancel 18 | Loading... 19 | Default Progressbar: 20 | 21 | 22 | Upload 23 | Error 24 | Complete 25 | Indeterminate Progress Sample 26 | Integer Progress Sample 27 | State Change Sample 28 | Progress Padding Sample 29 | Custom Selector Sample 30 | 31 | @string/IndeterminateProgressSample 32 | @string/IntegerProgressSample 33 | @string/StateChangeSample 34 | @string/ProgressPaddingSample 35 | @string/CustomSelectorSample 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /sample/res/layout/intro.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 19 | 20 | 27 | 28 | 36 | 37 |