src\MyApplication\.idea\sonarlint\issuestore\0\c\0c2f607fe7104db4aff5a972f67db47c8fc3a01a
src\MyApplication\.idea\sonarlint\issuestore\1\4\14d85ff7ad98d57e0b3d3d1342692c5fb59955a4 src\MyApplication\.idea\sonarlint\issuestore\1\e\1e127e509da20f358c272f78cfdaea4346e9199b src\MyApplication\.idea\sonarlint\issuestore\7\7\77 src\MyApplication\.idea\sonarlint\issuestore\0\c\0c2f607fe7104db4aff5a972f67db47c8fc3a01a src\MyApplication\.idea\sonarlint\issuestore\1\4\14d85ff7ad98d57e0b3d3d1342692c5fb59955a4 src\MyApplication\.idea\sonarlint\issuestore\1\e\1e127e509da20f358c272f78cfdaea4346e9199b src\MyApplication\.idea\sonarlint\issuestore\7\7\77b0e160fe3b756580b20d005c789ac79935523a src\MyApplication\.idea\sonarlint\issuestore\8\2\824db7b1941b2ab3f719e805a0d5d84f175b9127 src\MyApplication\.idea\sonarlint\issuestore\8\2\82d2fb9785192ddc21561f59fc59fc0e07e8a84c src\MyApplication\.idea\sonarlint\issuestore\9\a\9a3b018c7a5556301c9f2b82bea49b0b3ceb2613 src\MyApplication\.idea\sonarlint\issuestore\f\6\f694bbb1d0ede28a56fa9364fe5df7136cda2823 src\MyApplication\.idea\sonarlint\issuestore\f\d\fd468597b3276a6c77a10eb393b17d78086669ae src\MyApplication\.idea\sonarlint\issuestore\index.pb src\MyApplication\app\src\main\AndroidManifest.xml src\MyApplication\app\src\main\java\com\example\administrator\myapplication\AppCompatPreferenceActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\EditImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\EditNotes.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ImagesDisplay.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ListActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\LoginActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ScanImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\SearchActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\SignActivity.java src\MyApplication\app\src\main\res\layout\activity_login.xml src\MyApplication\app\src\main\res\layout\activity_sign.xml src\MyApplication\app\src\main\res\values\colors.xml src\MyApplication\app\src\main\res\values\dimens.xml src\MyApplication\app\src\main\res\values\strings.xml src\MyApplication\app\src\main\res\values\styles.xml src\MyApplication\.idea\sonarlint\issuestore\5\4\5407486fb05ebaf77ee187807ac7fbb8cb42de8a src\MyApplication\.idea\sonarlint\issuestore\5\5\55a10cdfd1735580de467639a7fadbfa2db674ba src\MyApplication\.idea\sonarlint\issuestore\7\f\7fc1f946c8e0fc0221c21f1cb84787e5b2965d9a src\MyApplication\.idea\sonarlint\issuestore\8\3\83d37b2761f0342c28dad5cd3a4bdc7a7b7d55d6 src\MyApplication\.idea\sonarlint\issuestore\8\e\8e104bc4be91ecea7d96ed093e7eefd2be1a136c src\MyApplication\.idea\sonarlint\issuestore\a\2\a2cac54ed6169d41dc3d4fe37b5f3594fabd1e9d src\MyApplication\.idea\sonarlint\issuestore\b\d\bd98ce0af59853dea38d4090583c47ba06bce28d src\MyApplication\.idea\sonarlint\issuestore\d\2\d2c92a556e47fd0e9a3fa038dbf835129e2f5090 src\MyApplication\.idea\sonarlint\issuestore\d\5\d55eada2cdd2dd102362d485231d9b377995b0b0 src\MyApplication\.idea\sonarlint\issuestore\d\9\d9f0b00bd9259256a0cc6a48eb4c59665266c4ea src\MyApplication\.idea\sonarlint\issuestore\e\7\e71af57077389976b85ce04fe9c4f9e8bc78f9d2 src\MyApplication\.idea\sonarlint\issuestore\f\4\f4db46de912ee15bd8dff2e67791e614cfdc8ae8 src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\AppCompatPreferenceActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\EditImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\EditNotes.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\ImagesDisplay.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\ListActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\LoginActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\ScanImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\SearchActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\SignActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\WelcomeActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\CircleImageView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\HTQDragGridView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\NoteItemCircleView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\ToggleButton.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\patternlock\LockPatternView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\patternlock\Point.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\patternlock\RotateDegrees.java src\MyApplication\app\src\main\res\anim\grow_from_bottom.xml src\MyApplication\app\src\main\res\anim\shrink_from_top.xml src\MyApplication\app\src\main\res\drawable-v21\about.png src\MyApplication\app\src\main\res\drawable-v21\actionbar_icon_add.png src\MyApplication\app\src\main\res\drawable-v21\actionbar_send_icon.png src\MyApplication\app\src\main\res\drawable-v21\base_horization_line.png src\MyApplication\app\src\main\res\drawable-v21\bitmap_error.png src\MyApplication\app\src\main\res\drawable-v21\bitmap_normal.png src\MyApplication\app\src\main\res\drawable-v21\bitmap_pressed.png src\MyApplication\app\src\main\res\drawable-v21\blue.png src\MyApplication\app\src\main\res\drawable-v21\btn_dark_blue_background.xml src\MyApplication\app\src\main\res\drawable-v21\btn_orange_background.xml src\MyApplication\app\src\main\res\drawable-v21\green.png src\MyApplication\app\src\main\res\drawable-v21\ic_menu_camera.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_gallery.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_manage.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_send.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_share.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_slideshow.xml src\MyApplication\app\src\main\res\drawable-v21\ic_note_delete.png src\MyApplication\app\src\main\res\drawable-v21\icon_up.png src\MyApplication\app\src\main\res\drawable-v21\input_bg.9.png src\MyApplication\app\src\main\res\drawable-v21\line_error.png src\MyApplication\app\src\main\res\drawable-v21\line_pressed.png src\MyApplication\app\src\main\res\drawable-v21\login_divider_line.xml src\MyApplication\app\src\main\res\drawable-v21\login_et_background.xml src\MyApplication\app\src\main\res\drawable-v21\login_ll_background.xml src\MyApplication\app\src\main\res\drawable-v21\purple.png src\MyApplication\app\src\main\res\drawable-v21\red.png src\MyApplication\app\src\main\res\drawable-v21\yellow.png src\MyApplication\app\src\main\res\drawable\actionbar_icon_add.png src\MyApplication\app\src\main\res\drawable\add_menu.png src\MyApplication\app\src\main\res\drawable\arrow.png src\MyApplication\app\src\main\res\drawable\back.png src\MyApplication\app\src\main\res\drawable\base_edit_input.9.png src\MyApplication\app\src\main\res\drawable\base_horizontal_line.9.png src\MyApplication\app\src\main\res\drawable\btn_login_n.9.png src\MyApplication\app\src\main\res\drawable\btn_login_p.9.png src\MyApplication\app\src\main\res\drawable\btn_login_selector.xml src\MyApplication\app\src\main\res\drawable\default_head.png src\MyApplication\app\src\main\res\drawable\diary_pwd.png src\MyApplication\app\src\main\res\drawable\email.png src\MyApplication\app\src\main\res\drawable\exit.9.png src\MyApplication\app\src\main\res\drawable\font_large.png src\MyApplication\app\src\main\res\drawable\font_normal.png src\MyApplication\app\src\main\res\drawable\font_size_selector_bg.9.png src\MyApplication\app\src\main\res\drawable\font_small.png src\MyApplication\app\src\main\res\drawable\font_super.png src\MyApplication\app\src\main\res\drawable\icon_color.png src\MyApplication\app\src\main\res\drawable\login_bg.png src\MyApplication\app\src\main\res\drawable\login_icon_account.png src\MyApplication\app\src\main\res\drawable\login_icon_password.png src\MyApplication\app\src\main\res\drawable\menu_alert.png src\MyApplication\app\src\main\res\drawable\menu_font_size.png src\MyApplication\app\src\main\res\drawable\menu_share.png src\MyApplication\app\src\main\res\drawable\menu_to_desktop.png src\MyApplication\app\src\main\res\drawable\nickname.png src\MyApplication\app\src\main\res\drawable\password.png src\MyApplication\app\src\main\res\drawable\pop_bg.9.png src\MyApplication\app\src\main\res\drawable\pop_bg_press.9.png src\MyApplication\app\src\main\res\drawable\selected.png src\MyApplication\app\src\main\res\drawable\side_nav_bar.xml src\MyApplication\app\src\main\res\drawable\skin_ico_checked.png src\MyApplication\app\src\main\res\drawable\skin_img_item_background.xml src\MyApplication\app\src\main\res\drawable\skin_img_item_background_normal.9.png src\MyApplication\app\src\main\res\drawable\skin_img_item_background_selected.9.png src\MyApplication\app\src\main\res\drawable\user_name.png src\MyApplication\app\src\main\res\layout\about_me_fragment.xml src\MyApplication\app\src\main\res\layout\activity_main.xml src\MyApplication\app\src\main\res\layout\activity_note_edit.xml src\MyApplication\app\src\main\res\layout\activity_register.xml src\MyApplication\app\src\main\res\layout\activity_set_lock.xml src\MyApplication\app\src\main\res\layout\activity_unlock.xml src\MyApplication\app\src\main\res\layout\activity_user_info.xml src\MyApplication\app\src\main\res\layout\activity_welcome.xml src\MyApplication\app\src\main\res\layout\app_bar_main.xml src\MyApplication\app\src\main\res\layout\bg_pic_grid_item.xml src\MyApplication\app\src\main\res\layout\change_info_dialog_layout.xml src\MyApplication\app\src\main\res\layout\content_main.xml src\MyApplication\app\src\main\res\layout\datetime_picker.xml src\MyApplication\app\src\main\res\layout\fragment_change_background.xml src\MyApplication\app\src\main\res\layout\fragment_note.xml src\MyApplication\app\src\main\res\layout\fragment_setting.xml src\MyApplication\app\src\main\res\layout\item_notebook.xml src\MyApplication\app\src\main\res\layout\layout_note_detail_menu.xml src\MyApplication\app\src\main\res\layout\main_fragment.xml src\MyApplication\app\src\main\res\layout\nav_header_main.xml src\MyApplication\app\src\main\res\layout\note_edit_activity_fraglayout.xml src\MyApplication\app\src\main\res\layout\pop_showavator.xml src\MyApplication\app\src\main\res\layout\popupwindow_choose_layout.xml src\MyApplication\app\src\main\res\layout\widget_lock_view.xml src\MyApplication\app\src\main\res\menu\activity_main_drawer.xml src\MyApplication\app\src\main\res\menu\main.xml src\MyApplication\app\src\main\res\menu\notebook_edit_menu.xml src\MyApplication\app\src\main\res\mipmap-hdpi\app_icon.jpg src\MyApplication\app\src\main\res\mipmap-hdpi\mine_avatar.jpg src\MyApplication\app\src\main\res\mipmap-hdpi\welc_bg.jpg src\MyApplication\app\src\main\res\values-v21\attrs.xml src\MyApplication\app\src\main\res\values-v21\styles.xml src\MyApplication\app\src\main\res\values-w820dp\dimens.xml src\MyApplication\app\src\main\res\values\attrs.xml src\MyApplication\app\src\main\res\values\drawables.xml b0e160fe3b756580b20d005c789ac79935523a src\MyApplication\.idea\sonarlint\issuestore\8\2\824db7b1941b2ab3f719e805a0d5d84f175b9127 src\MyApplication\.idea\sonarlint\issuestore\8\2\82d2fb9785192ddc21561f59fc59fc0e07e8a84c src\MyApplication\.idea\sonarlint\issuestore\9\a\9a3b018c7a5556301c9f2b82bea49b0b3ceb2613 src\MyApplication\.idea\sonarlint\issuestore\f\6\f694bbb1d0ede28a56fa9364fe5df7136cda2823 src\MyApplication\.idea\sonarlint\issuestore\f\d\fd468597b3276a6c77a10eb393b17d78086669ae src\MyApplication\.idea\sonarlint\issuestore\index.pb src\MyApplication\app\src\main\AndroidManifest.xml src\MyApplication\app\src\main\java\com\example\administrator\myapplication\AppCompatPreferenceActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\EditImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\EditNotes.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ImagesDisplay.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ListActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\LoginActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ScanImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\SearchActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\SignActivity.java src\MyApplication\app\src\main\res\layout\activity_login.xml src\MyApplication\app\src\main\res\layout\activity_sign.xml src\MyApplication\app\src\main\res\values\colors.xml src\MyApplication\app\src\main\res\values\dimens.xml src\MyApplication\app\src\main\res\values\strings.xml src\MyApplication\app\src\main\res\values\styles.xml src\MyApplication\.idea\sonarlint\issuestore\5\4\5407486fb05ebaf77ee187807ac7fbb8cb42de8a src\MyApplication\.idea\sonarlint\issuestore\5\5\55a10cdfd1735580de467639a7fadbfa2db674ba src\MyApplication\.idea\sonarlint\issuestore\7\f\7fc1f946c8e0fc0221c21f1cb84787e5b2965d9a src\MyApplication\.idea\sonarlint\issuestore\8\3\83d37b2761f0342c28dad5cd3a4bdc7a7b7d55d6 src\MyApplication\.idea\sonarlint\issuestore\8\e\8e104bc4be91ecea7d96ed093e7eefd2be1a136c src\MyApplication\.idea\sonarlint\issuestore\a\2\a2cac54ed6169d41dc3d4fe37b5f3594fabd1e9d src\MyApplication\.idea\sonarlint\issuestore\b\d\bd98ce0af59853dea38d4090583c47ba06bce28d src\MyApplication\.idea\sonarlint\issuestore\d\2\d2c92a556e47fd0e9a3fa038dbf835129e2f5090 src\MyApplication\.idea\sonarlint\issuestore\d\5\d55eada2cdd2dd102362d485231d9b377995b0b0 src\MyApplication\.idea\sonarlint\issuestore\d\9\d9f0b00bd9259256a0cc6a48eb4c59665266c4ea src\MyApplication\.idea\sonarlint\issuestore\e\7\e71af57077389976b85ce04fe9c4f9e8bc78f9d2 src\MyApplication\.idea\sonarlint\issuestore\f\4\f4db46de912ee15bd8dff2e67791e614cfdc8ae8 src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\AppCompatPreferenceActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\EditImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\EditNotes.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\ImagesDisplay.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\ListActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\LoginActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\ScanImages.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\SearchActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\SignActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\ui\WelcomeActivity.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\CircleImageView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\HTQDragGridView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\NoteItemCircleView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\ToggleButton.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\patternlock\LockPatternView.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\patternlock\Point.java src\MyApplication\app\src\main\java\com\example\administrator\myapplication\widget\patternlock\RotateDegrees.java src\MyApplication\app\src\main\res\anim\grow_from_bottom.xml src\MyApplication\app\src\main\res\anim\shrink_from_top.xml src\MyApplication\app\src\main\res\drawable-v21\about.png src\MyApplication\app\src\main\res\drawable-v21\actionbar_icon_add.png src\MyApplication\app\src\main\res\drawable-v21\actionbar_send_icon.png src\MyApplication\app\src\main\res\drawable-v21\base_horization_line.png src\MyApplication\app\src\main\res\drawable-v21\bitmap_error.png src\MyApplication\app\src\main\res\drawable-v21\bitmap_normal.png src\MyApplication\app\src\main\res\drawable-v21\bitmap_pressed.png src\MyApplication\app\src\main\res\drawable-v21\blue.png src\MyApplication\app\src\main\res\drawable-v21\btn_dark_blue_background.xml src\MyApplication\app\src\main\res\drawable-v21\btn_orange_background.xml src\MyApplication\app\src\main\res\drawable-v21\green.png src\MyApplication\app\src\main\res\drawable-v21\ic_menu_camera.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_gallery.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_manage.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_send.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_share.xml src\MyApplication\app\src\main\res\drawable-v21\ic_menu_slideshow.xml src\MyApplication\app\src\main\res\drawable-v21\ic_note_delete.png src\MyApplication\app\src\main\res\drawable-v21\icon_up.png src\MyApplication\app\src\main\res\drawable-v21\input_bg.9.png src\MyApplication\app\src\main\res\drawable-v21\line_error.png src\MyApplication\app\src\main\res\drawable-v21\line_pressed.png src\MyApplication\app\src\main\res\drawable-v21\login_divider_line.xml src\MyApplication\app\src\main\res\drawable-v21\login_et_background.xml src\MyApplication\app\src\main\res\drawable-v21\login_ll_background.xml src\MyApplication\app\src\main\res\drawable-v21\purple.png src\MyApplication\app\src\main\res\drawable-v21\red.png src\MyApplication\app\src\main\res\drawable-v21\yellow.png src\MyApplication\app\src\main\res\drawable\actionbar_icon_add.png src\MyApplication\app\src\main\res\drawable\add_menu.png src\MyApplication\app\src\main\res\drawable\arrow.png src\MyApplication\app\src\main\res\drawable\back.png src\MyApplication\app\src\main\res\drawable\base_edit_input.9.png src\MyApplication\app\src\main\res\drawable\base_horizontal_line.9.png src\MyApplication\app\src\main\res\drawable\btn_login_n.9.png src\MyApplication\app\src\main\res\drawable\btn_login_p.9.png src\MyApplication\app\src\main\res\drawable\btn_login_selector.xml src\MyApplication\app\src\main\res\drawable\default_head.png src\MyApplication\app\src\main\res\drawable\diary_pwd.png src\MyApplication\app\src\main\res\drawable\email.png src\MyApplication\app\src\main\res\drawable\exit.9.png src\MyApplication\app\src\main\res\drawable\font_large.png src\MyApplication\app\src\main\res\drawable\font_normal.png src\MyApplication\app\src\main\res\drawable\font_size_selector_bg.9.png src\MyApplication\app\src\main\res\drawable\font_small.png src\MyApplication\app\src\main\res\drawable\font_super.png src\MyApplication\app\src\main\res\drawable\icon_color.png src\MyApplication\app\src\main\res\drawable\login_bg.png src\MyApplication\app\src\main\res\drawable\login_icon_account.png src\MyApplication\app\src\main\res\drawable\login_icon_password.png src\MyApplication\app\src\main\res\drawable\menu_alert.png src\MyApplication\app\src\main\res\drawable\menu_font_size.png src\MyApplication\app\src\main\res\drawable\menu_share.png src\MyApplication\app\src\main\res\drawable\menu_to_desktop.png src\MyApplication\app\src\main\res\drawable\nickname.png src\MyApplication\app\src\main\res\drawable\password.png src\MyApplication\app\src\main\res\drawable\pop_bg.9.png src\MyApplication\app\src\main\res\drawable\pop_bg_press.9.png src\MyApplication\app\src\main\res\drawable\selected.png src\MyApplication\app\src\main\res\drawable\side_nav_bar.xml src\MyApplication\app\src\main\res\drawable\skin_ico_checked.png src\MyApplication\app\src\main\res\drawable\skin_img_item_background.xml src\MyApplication\app\src\main\res\drawable\skin_img_item_background_normal.9.png src\MyApplication\app\src\main\res\drawable\skin_img_item_background_selected.9.png src\MyApplication\app\src\main\res\drawable\user_name.png src\MyApplication\app\src\main\res\layout\about_me_fragment.xml src\MyApplication\app\src\main\res\layout\activity_main.xml src\MyApplication\app\src\main\res\layout\activity_note_edit.xml src\MyApplication\app\src\main\res\layout\activity_register.xml src\MyApplication\app\src\main\res\layout\activity_set_lock.xml src\MyApplication\app\src\main\res\layout\activity_unlock.xml src\MyApplication\app\src\main\res\layout\activity_user_info.xml src\MyApplication\app\src\main\res\layout\activity_welcome.xml src\MyApplication\app\src\main\res\layout\app_bar_main.xml src\MyApplication\app\src\main\res\layout\bg_pic_grid_item.xml src\MyApplication\app\src\main\res\layout\change_info_dialog_layout.xml src\MyApplication\app\src\main\res\layout\content_main.xml src\MyApplication\app\src\main\res\layout\datetime_picker.xml src\MyApplication\app\src\main\res\layout\fragment_change_background.xml src\MyApplication\app\src\main\res\layout\fragment_note.xml src\MyApplication\app\src\main\res\layout\fragment_setting.xml src\MyApplication\app\src\main\res\layout\item_notebook.xml src\MyApplication\app\src\main\res\layout\layout_note_detail_menu.xml src\MyApplication\app\src\main\res\layout\main_fragment.xml src\MyApplication\app\src\main\res\layout\nav_header_main.xml src\MyApplication\app\src\main\res\layout\note_edit_activity_fraglayout.xml src\MyApplication\app\src\main\res\layout\pop_showavator.xml src\MyApplication\app\src\main\res\layout\popupwindow_choose_layout.xml src\MyApplication\app\src\main\res\layout\widget_lock_view.xml src\MyApplication\app\src\main\res\menu\activity_main_drawer.xml src\MyApplication\app\src\main\res\menu\main.xml src\MyApplication\app\src\main\res\menu\notebook_edit_menu.xml src\MyApplication\app\src\main\res\mipmap-hdpi\app_icon.jpg src\MyApplication\app\src\main\res\mipmap-hdpi\mine_avatar.jpg src\MyApplication\app\src\main\res\mipmap-hdpi\welc_bg.jpg src\MyApplication\app\src\main\res\values-v21\attrs.xml src\MyApplication\app\src\main\res\values-v21\styles.xml src\MyApplication\app\src\main\res\values-w820dp\dimens.xml src\MyApplication\app\src\main\res\values\attrs.xml src\MyApplication\app\src\main\res\values\drawables.xml
|
@ -1,2 +0,0 @@
|
|||
|
||||
isquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(…ÿÙ®úÿÿÿÿ
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(€¥Û¬
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(<28>ªÉç
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
Tsquid:S1118":Add a private constructor to hide the implicit public one.(㉷눪<E389B7><EB88AA><EFBFBD><EFBFBD>
|
||||
gsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(군赴
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
qsquid:S3008"WRename this field "BITMAP_ERROR" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(•†<E280A2>ÿÿÿÿÿ
|
||||
lsquid:S3008"WRename this field "BITMAP_PRESS" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(üÉÌÍ
|
||||
[squid:S1126"AReplace this if-then-else statement by a single return statement.(¾ê¹¥üÿÿÿÿ
|
||||
Lsquid:S1444"2Make this "public static BITMAP_ERROR" field final(•†<E280A2>ÿÿÿÿÿ
|
||||
msquid:S3008"XRename this field "BITMAP_NORMAL" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(û¹ß¶
|
||||
„"squid:ClassVariableVisibilityCheck"XMake BITMAP_PRESS a static final constant or non-public and provide accessors if needed.(üÉÌÍ
|
||||
…"squid:ClassVariableVisibilityCheck"YMake BITMAP_NORMAL a static final constant or non-public and provide accessors if needed.(û¹ß¶
|
||||
‰"squid:ClassVariableVisibilityCheck"XMake BITMAP_ERROR a static final constant or non-public and provide accessors if needed.(•†<E280A2>ÿÿÿÿÿ
|
||||
Hsquid:S1444"3Make this "public static BITMAP_NORMAL" field final(û¹ß¶
|
||||
Gsquid:S1444"2Make this "public static BITMAP_PRESS" field final(üÉÌÍ
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(³Î¶î
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
Tsquid:S1161":Add the "@Override" annotation above this method signature(â¢çÊüÿÿÿÿ
|
||||
hsquid:MaximumInheritanceDepth"<This class has 7 parents which is greater than 5 authorized.(ž<> ¨ýÿÿÿÿ
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
isquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(‹†½íÿÿÿÿÿ
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(úºé“
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
Lsquid:S2589"7Remove this expression which always evaluates to "true"(¯É©“
|
||||
Ksquid:S2696"6Make the enclosing method "static" or remove this set.(µâ‚Ø
|
||||
hsquid:MaximumInheritanceDepth"<This class has 6 parents which is greater than 5 authorized.(¸–þ§þÿÿÿÿ
|
||||
Ssquid:S1226">Introduce a new variable instead of reusing the parameter "x".(úµÈ™
|
||||
lsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed.(Ö¼Ù<C2BC>ýÿÿÿÿ
|
||||
nsquid:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(«Ûô‘
|
||||
S"squid:SwitchLastCaseIsDefaultCheck""Add a default case to this switch.(¯·ø‹úÿÿÿÿ
|
||||
Tsquid:S3398"?Move this method into the anonymous class declared at line 157.(É™â¢
|
||||
[squid:S1126"AReplace this if-then-else statement by a single return statement.(ê±Ë<C2B1>úÿÿÿÿ
|
||||
S"squid:SwitchLastCaseIsDefaultCheck""Add a default case to this switch.(¯·ø‹úÿÿÿÿ
|
||||
asquid:S2184"GCast one of the operands of this multiplication operation to a "float".(÷æ‰Ðùÿÿÿÿ
|
||||
gsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(ºµÇ¨
|
||||
Zsquid:CallToDeprecatedMethod"/Remove this use of "vibrate"; it is deprecated.(½<>ì©úÿÿÿÿ
|
||||
psquid:S00115"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(‡ÚÂÖ
|
||||
=squid:S1148"#Use a logger to log this exception.(€ÉÔ…ýÿÿÿÿ
|
||||
\squid:S2184"GCast one of the operands of this multiplication operation to a "float".(žì‘Ç
|
||||
nsquid:S1450"TRemove the "moveX" field and declare it as a local variable in the relevant methods.(Í àØþÿÿÿÿ
|
||||
Isquid:EmptyStatementUsageCheck"Remove this empty statement.(ôŸŽìúÿÿÿÿ
|
||||
Lsquid:S2589"7Remove this expression which always evaluates to "true"(¯É©“
|
||||
Ssquid:S1226">Introduce a new variable instead of reusing the parameter "y".(žÅ™õ
|
||||
lsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed.(»òíÖÿÿÿÿÿ
|
|
@ -1,13 +1,11 @@
|
|||
|
||||
Isquid:S1066"/Merge this if statement with the enclosing one.(¿±Ïßüÿÿÿÿ
|
||||
[squid:S2142"FEither re-interrupt this method or rethrow the "InterruptedException".(ä ¹€
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(Àó‚´
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(Ö¾ã¯
|
||||
Lsquid:S1135"2Complete the task associated to this TODO comment.(ÉÓÈìýÿÿÿÿ
|
||||
›squid:S1186"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(ô¬ý¶ùÿÿÿÿ
|
||||
Osquid:S2386"5Move "PROJECTION" to a class and lower its visibility(‡ÎÌÑùÿÿÿÿ
|
||||
<squid:S1214""Move constants to a class or enum.(×™´ªùÿÿÿÿ
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(ž¼í
|
||||
gsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(Æ¿ú„
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(ôã©Ö
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(ž¼í
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(ž¼í
|
||||
Isquid:S1066"/Merge this if statement with the enclosing one.(¿±Ïßüÿÿÿÿ
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(Ö¾ã¯
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(Àó‚´
|
||||
Lsquid:S1135"2Complete the task associated to this TODO comment.(ÉÓÈìýÿÿÿÿ
|
||||
[squid:S2142"FEither re-interrupt this method or rethrow the "InterruptedException".(ä ¹€
|
||||
_squid:CommentedOutCodeLine"<This block of commented-out lines of code should be removed.( àˆ{
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(ž¼í
|
||||
›squid:S1186"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(ô¬ý¶ùÿÿÿÿ
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
msquid:ModifiersOrderCheck"EReorder the modifiers to comply with the Java Language Specification.(Á¡Â«øÿÿÿÿ
|
||||
@squid:S1659"&Declare "spotMaxX" on a separate line.(Ç¡´ôþÿÿÿÿ
|
||||
osquid:S1450"URemove the "startX" field and declare it as a local variable in the relevant methods.(Àœ<C380>£ýÿÿÿÿ
|
||||
<squid:S1659""Declare "endX" on a separate line.(Àœ<C380>£ýÿÿÿÿ
|
||||
Ysquid:UnusedPrivateMethod"6Remove this unused private "ToggleButton" constructor.(ª„Àï
|
||||
hsquid:ModifiersOrderCheck"EReorder the modifiers to comply with the Java Language Specification.(êÅ®Ü
|
||||
gsquid:ModifiersOrderCheck"EReorder the modifiers to comply with the Java Language Specification.(Ûû•
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(³Î¶î
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
Vsquid:S2184"ACast one of the operands of this division operation to a "float".(ñÌ–à
|
||||
Vsquid:S2184"ACast one of the operands of this addition operation to a "float".(†¬’²
|
||||
Vsquid:S2184"ACast one of the operands of this addition operation to a "float".(†¬’²
|
||||
Vsquid:S2184"ACast one of the operands of this division operation to a "float".(ĵöö
|
||||
Vsquid:S2184"ACast one of the operands of this division operation to a "float".(ĵöö
|
||||
Vsquid:S2184"ACast one of the operands of this division operation to a "float".(ñÌ–à
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
esquid:CommentedOutCodeLine"<This block of commented-out lines of code should be removed.(îí”Ôþÿÿÿÿ
|
||||
ssquid:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(±±´ðþÿÿÿÿ
|
||||
:squid:S2068" Remove this hard-coded password.(Š…÷<E280A6>úÿÿÿÿ
|
||||
Bsquid:S1125"(Remove the literal "true" boolean value.(êØòëÿÿÿÿÿ
|
||||
Xsquid:S1155">Use isEmpty() to check whether the collection is empty or not.(ÃЮùÿÿÿÿ
|
||||
0squid:S1643"Use a StringBuilder instead.(븈2
|
||||
Fsquid:S1068",Remove this unused "mContext" private field.(»úžøÿÿÿÿ
|
||||
esquid:CommentedOutCodeLine"<This block of commented-out lines of code should be removed.(¬ëʳûÿÿÿÿ
|
||||
S"squid:SwitchLastCaseIsDefaultCheck""Add a default case to this switch.(ãÁð™øÿÿÿÿ
|
||||
[squid:CallToDeprecatedMethod"0Remove this use of "getWidth"; it is deprecated.(ð“ñÀþÿÿÿÿ
|
||||
4squid:S2131"Use "Integer.toString" instead.(јòö
|
||||
Dsquid:S1066"/Merge this if statement with the enclosing one.(댯Ú
|
||||
[squid:S2184"ACast one of the operands of this division operation to a "float".(¢é…ˆþÿÿÿÿ
|
||||
=squid:S1148"#Use a logger to log this exception.(€ÉÔ…ýÿÿÿÿ
|
||||
Zsquid:S2184"@Cast one of the operands of this integer division to a "double".(¢é…ˆþÿÿÿÿ
|
||||
esquid:CommentedOutCodeLine"<This block of commented-out lines of code should be removed.(±¹ËÌüÿÿÿÿ
|
||||
>squid:S1659"$Declare "mMoveY" on a separate line.(ŸöÁæúÿÿÿÿ
|
||||
osquid:S1450"URemove the "mMoveY" field and declare it as a local variable in the relevant methods.(ŸöÁæúÿÿÿÿ
|
||||
gsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 35 to the 15 allowed.(ôó§è
|
||||
psquid:S1450"\Remove the "mScreenHeight" field and declare it as a local variable in the relevant methods.(ÎݘZ
|
||||
osquid:S1450"URemove the "mMoveX" field and declare it as a local variable in the relevant methods.(ŸöÁæúÿÿÿÿ
|
||||
[squid:S2142"FEither re-interrupt this method or rethrow the "InterruptedException".(ä ¹€
|
||||
`squid:CommentedOutCodeLine"<This block of commented-out lines of code should be removed.(îˆÝç
|
||||
usquid:S1450"[Remove the "mScreenWidth" field and declare it as a local variable in the relevant methods.(Ò™úªÿÿÿÿÿ
|
||||
[squid:CallToDeprecatedMethod"0Remove this use of "getWidth"; it is deprecated.(ð“ñÀþÿÿÿÿ
|
||||
:squid:S2068" Remove this hard-coded password.(ò¤‚›üÿÿÿÿ
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
Isquid:S1066"/Merge this if statement with the enclosing one.(¿±Ïßüÿÿÿÿ
|
||||
<squid:S1214""Move constants to a class or enum.(×™´ªùÿÿÿÿ
|
||||
Lsquid:S1135"2Complete the task associated to this TODO comment.(ÉÓÈìýÿÿÿÿ
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(ž¼í
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(ž¼í
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(Ö¾ã¯
|
||||
Gsquid:S1135"2Complete the task associated to this TODO comment.(Àó‚´
|
||||
gsquid:S3776"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(Æ¿ú„
|
||||
[squid:S2142"FEither re-interrupt this method or rethrow the "InterruptedException".(ä ¹€
|
||||
›squid:S1186"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(ô¬ý¶ùÿÿÿÿ
|
||||
Osquid:S2386"5Move "PROJECTION" to a class and lower its visibility(‡ÎÌÑùÿÿÿÿ
|
||||
dsquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(ôã©Ö
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
isquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(곤헌<EAB3A4><ED978C><EFBFBD><EFBFBD>
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
isquid:MaximumInheritanceDepth"=This class has 10 parents which is greater than 5 authorized.(´úÈ¢ùÿÿÿÿ
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
hsquid:MaximumInheritanceDepth"<This class has 7 parents which is greater than 5 authorized.(ž<> ¨ýÿÿÿÿ
|
||||
Tsquid:S1161":Add the "@Override" annotation above this method signature(â¢çÊüÿÿÿÿ
|
|
@ -1,21 +1,25 @@
|
|||
|
||||
<
|
||||
build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
|
||||
{
|
||||
Kapp\src\main\java\com\example\administrator\myapplication\SignActivity.java,7\7\77b0e160fe3b756580b20d005c789ac79935523a
|
||||
|
|
||||
Lapp\src\main\java\com\example\administrator\myapplication\ImagesDisplay.java,f\6\f694bbb1d0ede28a56fa9364fe5df7136cda2823
|
||||
{
|
||||
Kapp\src\main\java\com\example\administrator\myapplication\ListActivity.java,0\c\0c2f607fe7104db4aff5a972f67db47c8fc3a01a
|
||||
y
|
||||
Iapp\src\main\java\com\example\administrator\myapplication\EditImages.java,1\e\1e127e509da20f358c272f78cfdaea4346e9199b
|
||||
x
|
||||
Happ\src\main\java\com\example\administrator\myapplication\EditNotes.java,8\2\824db7b1941b2ab3f719e805a0d5d84f175b9127
|
||||
y
|
||||
Iapp\src\main\java\com\example\administrator\myapplication\ScanImages.java,1\4\14d85ff7ad98d57e0b3d3d1342692c5fb59955a4
|
||||
}
|
||||
Mapp\src\main\java\com\example\administrator\myapplication\SearchActivity.java,8\2\82d2fb9785192ddc21561f59fc59fc0e07e8a84c
|
||||
|
|
||||
Lapp\src\main\java\com\example\administrator\myapplication\LoginActivity.java,9\a\9a3b018c7a5556301c9f2b82bea49b0b3ceb2613
|
||||
Š
|
||||
Zapp\src\main\java\com\example\administrator\myapplication\AppCompatPreferenceActivity.java,f\d\fd468597b3276a6c77a10eb393b17d78086669ae
|
||||
~
|
||||
Napp\src\main\java\com\example\administrator\myapplication\ui\SignActivity.java,b\d\bd98ce0af59853dea38d4090583c47ba06bce28d
|
||||
<EFBFBD>
|
||||
]app\src\main\java\com\example\administrator\myapplication\ui\AppCompatPreferenceActivity.java,7\f\7fc1f946c8e0fc0221c21f1cb84787e5b2965d9a
|
||||
‘
|
||||
aapp\src\main\java\com\example\administrator\myapplication\widget\patternlock\LockPatternView.java,d\5\d55eada2cdd2dd102362d485231d9b377995b0b0
|
||||
‡
|
||||
Wapp\src\main\java\com\example\administrator\myapplication\widget\patternlock\Point.java,5\5\55a10cdfd1735580de467639a7fadbfa2db674ba
|
||||
…
|
||||
Uapp\src\main\java\com\example\administrator\myapplication\widget\HTQDragGridView.java,8\e\8e104bc4be91ecea7d96ed093e7eefd2be1a136c
|
||||
…
|
||||
Uapp\src\main\java\com\example\administrator\myapplication\widget\CircleImageView.java,d\2\d2c92a556e47fd0e9a3fa038dbf835129e2f5090
|
||||
<EFBFBD>
|
||||
_app\src\main\java\com\example\administrator\myapplication\widget\patternlock\RotateDegrees.java,5\4\5407486fb05ebaf77ee187807ac7fbb8cb42de8a
|
||||
ˆ
|
||||
Xapp\src\main\java\com\example\administrator\myapplication\widget\NoteItemCircleView.java,e\7\e71af57077389976b85ce04fe9c4f9e8bc78f9d2
|
||||
‚
|
||||
Rapp\src\main\java\com\example\administrator\myapplication\widget\ToggleButton.java,a\2\a2cac54ed6169d41dc3d4fe37b5f3594fabd1e9d
|
||||
<EFBFBD>
|
||||
Qapp\src\main\java\com\example\administrator\myapplication\ui\WelcomeActivity.java,f\4\f4db46de912ee15bd8dff2e67791e614cfdc8ae8
|
||||
|
||||
Oapp\src\main\java\com\example\administrator\myapplication\ui\LoginActivity.java,d\9\d9f0b00bd9259256a0cc6a48eb4c59665266c4ea
|
|
@ -15,25 +15,28 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:label="@string/title_activity_login">4
|
||||
android:name=".ui.LoginActivity"
|
||||
android:label="@string/title_activity_login">
|
||||
4
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".SignActivity"/>
|
||||
<activity android:name=".ListActivity"/>
|
||||
<activity android:name=".SearchActivity">
|
||||
<activity android:name=".ui.SignActivity"/>
|
||||
<activity android:name=".ui.ListActivity"/>
|
||||
<activity android:name=".ui.SearchActivity">
|
||||
</activity>
|
||||
<activity android:name=".EditImages">
|
||||
<activity android:name=".ui.EditImages">
|
||||
</activity>
|
||||
<activity android:name=".ScanImages">
|
||||
<activity android:name=".ui.ScanImages">
|
||||
</activity>
|
||||
<activity android:name=".ImagesDisplay">
|
||||
<activity android:name=".ui.ImagesDisplay">
|
||||
</activity>
|
||||
<activity android:name=".EditNotes">
|
||||
<activity android:name=".ui.EditNotes">
|
||||
</activity>
|
||||
<activity android:name=".ui.WelcomeActivity">
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
|
@ -1,8 +1,10 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class EditImages extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -1,10 +1,12 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class EditNotes extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -1,10 +1,12 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class ImagesDisplay extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -1,10 +1,12 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class ListActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -1,4 +1,4 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
|
@ -30,6 +30,8 @@ import android.widget.Button;
|
|||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -296,13 +298,13 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
|||
|
||||
|
||||
private interface ProfileQuery {
|
||||
/* String[] PROJECTION = {
|
||||
String[] PROJECTION = {
|
||||
ContactsContract.CommonDataKinds.Email.ADDRESS,
|
||||
ContactsContract.CommonDataKinds.Email.IS_PRIMARY,
|
||||
};
|
||||
|
||||
int ADDRESS = 0;
|
||||
int IS_PRIMARY = 1; */
|
||||
int IS_PRIMARY = 1;
|
||||
}
|
||||
|
||||
/**
|
|
@ -1,10 +1,12 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class ScanImages extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -1,8 +1,10 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class SearchActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -1,10 +1,12 @@
|
|||
package com.example.administrator.myapplication;
|
||||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class SignActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
|
@ -0,0 +1,15 @@
|
|||
package com.example.administrator.myapplication.ui;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
public class WelcomeActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_welcome);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,253 @@
|
|||
package com.example.administrator.myapplication.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
|
||||
/**
|
||||
* 圆形ImageView组件
|
||||
*
|
||||
*/
|
||||
public class CircleImageView extends ImageView {
|
||||
|
||||
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
|
||||
|
||||
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
|
||||
private static final int COLORDRAWABLE_DIMENSION = 1;
|
||||
|
||||
private static final int DEFAULT_BORDER_WIDTH = 0;
|
||||
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
|
||||
|
||||
private final RectF mDrawableRect = new RectF();
|
||||
private final RectF mBorderRect = new RectF();
|
||||
|
||||
private final Matrix mShaderMatrix = new Matrix();
|
||||
private final Paint mBitmapPaint = new Paint();
|
||||
private final Paint mBorderPaint = new Paint();
|
||||
|
||||
private int mBorderColor = DEFAULT_BORDER_COLOR;
|
||||
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
|
||||
|
||||
private Bitmap mBitmap;
|
||||
private BitmapShader mBitmapShader;
|
||||
private int mBitmapWidth;
|
||||
private int mBitmapHeight;
|
||||
|
||||
private float mDrawableRadius;
|
||||
private float mBorderRadius;
|
||||
|
||||
private boolean mReady;
|
||||
private boolean mSetupPending;
|
||||
|
||||
//默认显示圆形
|
||||
private boolean isDisplayCircle = true;
|
||||
|
||||
public CircleImageView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public CircleImageView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
super.setScaleType(SCALE_TYPE);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
|
||||
|
||||
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_border_width, DEFAULT_BORDER_WIDTH);
|
||||
mBorderColor = a.getColor(R.styleable.CircleImageView_border_color, DEFAULT_BORDER_COLOR);
|
||||
|
||||
a.recycle();
|
||||
|
||||
mReady = true;
|
||||
|
||||
if (mSetupPending) {
|
||||
setup();
|
||||
mSetupPending = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScaleType getScaleType() {
|
||||
return SCALE_TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScaleType(ScaleType scaleType) {
|
||||
if (scaleType != SCALE_TYPE) {
|
||||
throw new IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
if(!isDisplayCircle) {
|
||||
super.onDraw(canvas);
|
||||
return;
|
||||
}
|
||||
if (getDrawable() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mDrawableRadius, mBitmapPaint);
|
||||
if(mBorderWidth != 0){
|
||||
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mBorderRadius, mBorderPaint);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
setup();
|
||||
}
|
||||
|
||||
public void setDisplayCircle(boolean isDisplayCircle) {
|
||||
this.isDisplayCircle = isDisplayCircle;
|
||||
}
|
||||
|
||||
public int getBorderColor() {
|
||||
return mBorderColor;
|
||||
}
|
||||
|
||||
public void setBorderColor(int borderColor) {
|
||||
if (borderColor == mBorderColor) {
|
||||
return;
|
||||
}
|
||||
|
||||
mBorderColor = borderColor;
|
||||
mBorderPaint.setColor(mBorderColor);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public int getBorderWidth() {
|
||||
return mBorderWidth;
|
||||
}
|
||||
|
||||
public void setBorderWidth(int borderWidth) {
|
||||
if (borderWidth == mBorderWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
mBorderWidth = borderWidth;
|
||||
setup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImageBitmap(Bitmap bm) {
|
||||
super.setImageBitmap(bm);
|
||||
mBitmap = bm;
|
||||
setup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImageDrawable(Drawable drawable) {
|
||||
super.setImageDrawable(drawable);
|
||||
mBitmap = getBitmapFromDrawable(drawable);
|
||||
setup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImageResource(int resId) {
|
||||
super.setImageResource(resId);
|
||||
mBitmap = getBitmapFromDrawable(getDrawable());
|
||||
setup();
|
||||
}
|
||||
|
||||
private Bitmap getBitmapFromDrawable(Drawable drawable) {
|
||||
if (drawable == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
}
|
||||
|
||||
try {
|
||||
Bitmap bitmap;
|
||||
|
||||
if (drawable instanceof ColorDrawable) {
|
||||
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
|
||||
} else {
|
||||
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
} catch (OutOfMemoryError e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void setup() {
|
||||
if (!mReady) {
|
||||
mSetupPending = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mBitmap == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
|
||||
|
||||
mBitmapPaint.setAntiAlias(true);
|
||||
mBitmapPaint.setShader(mBitmapShader);
|
||||
|
||||
mBorderPaint.setStyle(Paint.Style.STROKE);
|
||||
mBorderPaint.setAntiAlias(true);
|
||||
mBorderPaint.setColor(mBorderColor);
|
||||
mBorderPaint.setStrokeWidth(mBorderWidth);
|
||||
|
||||
mBitmapHeight = mBitmap.getHeight();
|
||||
mBitmapWidth = mBitmap.getWidth();
|
||||
|
||||
mBorderRect.set(0, 0, getWidth(), getHeight());
|
||||
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2, (mBorderRect.width() - mBorderWidth) / 2);
|
||||
|
||||
mDrawableRect.set(mBorderWidth, mBorderWidth, mBorderRect.width() - mBorderWidth, mBorderRect.height() - mBorderWidth);
|
||||
mDrawableRadius = Math.min(mDrawableRect.height() / 2, mDrawableRect.width() / 2);
|
||||
|
||||
updateShaderMatrix();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private void updateShaderMatrix() {
|
||||
float scale;
|
||||
float dx = 0;
|
||||
float dy = 0;
|
||||
|
||||
mShaderMatrix.set(null);
|
||||
|
||||
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {
|
||||
scale = mDrawableRect.height() / (float) mBitmapHeight;
|
||||
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
|
||||
} else {
|
||||
scale = mDrawableRect.width() / (float) mBitmapWidth;
|
||||
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
|
||||
}
|
||||
|
||||
mShaderMatrix.setScale(scale, scale);
|
||||
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mBorderWidth, (int) (dy + 0.5f) + mBorderWidth);
|
||||
|
||||
mBitmapShader.setLocalMatrix(mShaderMatrix);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,682 @@
|
|||
package com.example.administrator.myapplication.widget;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Handler;
|
||||
import android.os.Vibrator;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.ViewTreeObserver.OnPreDrawListener;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListAdapter;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 感谢这篇博客的作者,http://blog.csdn.net/xiaanming/article/details/17718579<br>
|
||||
* 在这个基础上解决了原作者的问题:Adapter无法使用ViewHolder优化的问题,优化了手势识别率,并添加了trashView功能,
|
||||
* 优化自定义控件对外扩展性,解决在上下拉环境下手势冲突问题<br>
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class HTQDragGridView extends GridView {
|
||||
|
||||
private long dragResponseMS = 700; // item长按响应的时间
|
||||
private int mDragPosition;// 正在拖拽的position
|
||||
|
||||
private boolean isDrag = false; // 是否可以拖拽,用于控件内部逻辑实现
|
||||
private boolean canDrag = true; // 是否可用拖拽,主要用于外部开放设置
|
||||
private boolean mAnimationEnd = true;
|
||||
|
||||
private int mDownX;
|
||||
private int mDownY;
|
||||
private int moveX;
|
||||
private int moveY;
|
||||
|
||||
private View mStartDragItemView = null; // 刚开始拖拽的item对应的View
|
||||
private ImageView mDragImageView; // 用于拖拽时显示的幻影镜像
|
||||
private Bitmap mDragBitmap; // 幻影镜像对应的Bitmap
|
||||
private View mTrashView; // 删除item的垃圾桶图标
|
||||
|
||||
private final Vibrator mVibrator; // 震动器
|
||||
private final int mStatusHeight;// 状态栏的高度
|
||||
private final WindowManager mWindowManager;
|
||||
private WindowManager.LayoutParams mWindowLayoutParams; // item镜像的布局参数
|
||||
|
||||
private int mPoint2ItemTop; // 按下的点到所在item的上边缘的距离
|
||||
private int mPoint2ItemLeft;
|
||||
private int mOffset2Top; // DragGridView距离屏幕顶部的偏移量
|
||||
private int mOffset2Left;
|
||||
|
||||
private int mDownScrollBorder; // DragGridView自动向下滚动的边界值
|
||||
private int mUpScrollBorder; // DragGridView自动向上滚动的边界值
|
||||
|
||||
private DragGridBaseAdapter mDragAdapter;
|
||||
private int mNumColumns;
|
||||
private int mColumnWidth;
|
||||
private boolean mNumColumnsSet;
|
||||
private int mHorizontalSpacing;
|
||||
|
||||
private static final int speed = 20; // DragGridView自动滚动的速度
|
||||
private static final int MOVE_OFFSET = 25;
|
||||
private boolean moved = false;
|
||||
|
||||
public static final int HANDLE_START = 0x3587;
|
||||
public static final int HANDLE_CANCLE = 0x3588;
|
||||
public static final int HANDLE_FINISH = 0x3589;
|
||||
private static OnMoveListener moveListener; // 拖拽开始与结束监听器
|
||||
private OnDeleteListener deleteListener; // 移动到垃圾桶时的监听器
|
||||
|
||||
private final TouchRect moveRect = new TouchRect();
|
||||
private final TouchRect gridRect = new TouchRect();
|
||||
private final TouchRect trashRect = new TouchRect();
|
||||
|
||||
public HTQDragGridView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public HTQDragGridView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public HTQDragGridView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
mVibrator = (Vibrator) context
|
||||
.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
mWindowManager = (WindowManager) context
|
||||
.getSystemService(Context.WINDOW_SERVICE);
|
||||
mStatusHeight = getStatusHeight(context); // 获取状态栏的高度
|
||||
|
||||
if (!mNumColumnsSet) {
|
||||
mNumColumns = AUTO_FIT;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取状态栏的高度
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
private static int getStatusHeight(Context context) {
|
||||
int statusHeight = 0;
|
||||
Rect localRect = new Rect();
|
||||
|
||||
((Activity) context).getWindow().getDecorView()
|
||||
.getWindowVisibleDisplayFrame(localRect);
|
||||
statusHeight = localRect.top;
|
||||
if (0 == statusHeight) {
|
||||
Class<?> localClass;
|
||||
try {
|
||||
localClass = Class.forName("com.android.internal.R$dimen");
|
||||
Object localObject = localClass.newInstance();
|
||||
int i5 = Integer.parseInt(localClass
|
||||
.getField("status_bar_height").get(localObject)
|
||||
.toString());
|
||||
statusHeight = context.getResources().getDimensionPixelSize(i5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return statusHeight;
|
||||
}
|
||||
|
||||
private static final Handler mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(android.os.Message msg) {
|
||||
if (moveListener != null) {
|
||||
if (msg.what == HANDLE_START) {
|
||||
moveListener.startMove();
|
||||
} else if (msg.what == HANDLE_FINISH) {
|
||||
moveListener.finishMove();
|
||||
} else if (msg.what == HANDLE_CANCLE) {
|
||||
moveListener.cancleMove();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 用来处理是否为长按的Runnable
|
||||
|
||||
private final Runnable mLongClickRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!canDrag) {
|
||||
return;
|
||||
}
|
||||
isDrag = true; // 设置可以拖拽
|
||||
moved = true;
|
||||
mHandler.sendEmptyMessage(HANDLE_START);
|
||||
mVibrator.vibrate(50); // 震动一下
|
||||
|
||||
mStartDragItemView.setVisibility(View.INVISIBLE);// 隐藏该item
|
||||
|
||||
createDragImage(mDragBitmap, mDownX, mDownY);
|
||||
mDragBitmap = null;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 若设置为AUTO_FIT,计算有多少列
|
||||
*/
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
if (mNumColumns == AUTO_FIT) {
|
||||
int numFittedColumns = 1; // 可用列
|
||||
|
||||
if (mColumnWidth > 0) {
|
||||
int gridWidth = Math.max(MeasureSpec.getSize(widthMeasureSpec)
|
||||
- getPaddingLeft() - getPaddingRight(), 0);
|
||||
numFittedColumns = gridWidth / mColumnWidth;
|
||||
if (numFittedColumns > 0) {
|
||||
while (numFittedColumns != 1) {
|
||||
if (numFittedColumns * mColumnWidth
|
||||
+ (numFittedColumns - 1) * mHorizontalSpacing > gridWidth) {
|
||||
numFittedColumns--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
numFittedColumns = 2;
|
||||
}
|
||||
mNumColumns = numFittedColumns;
|
||||
}
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
initRecord();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化坐标数据
|
||||
*/
|
||||
private void initRecord() {
|
||||
gridRect.left = this.getLeft();
|
||||
gridRect.right = this.getRight();
|
||||
gridRect.top = this.getTop();
|
||||
gridRect.bottom = this.getBottom();
|
||||
if (mTrashView != null) {
|
||||
trashRect.left = mTrashView.getLeft();
|
||||
trashRect.right = mTrashView.getRight();
|
||||
trashRect.bottom = mTrashView.getBottom();
|
||||
trashRect.top = mTrashView.getTop();
|
||||
}
|
||||
}
|
||||
|
||||
/******************** preference method ********************/
|
||||
|
||||
@Override
|
||||
public void setAdapter(ListAdapter adapter) {
|
||||
super.setAdapter(adapter);
|
||||
|
||||
if (adapter instanceof DragGridBaseAdapter) {
|
||||
mDragAdapter = (DragGridBaseAdapter) adapter;
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
"the adapter must be implements DragGridAdapter");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNumColumns(int numColumns) {
|
||||
super.setNumColumns(numColumns);
|
||||
mNumColumnsSet = true;
|
||||
this.mNumColumns = numColumns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColumnWidth(int columnWidth) {
|
||||
super.setColumnWidth(columnWidth);
|
||||
mColumnWidth = columnWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHorizontalSpacing(int horizontalSpacing) {
|
||||
super.setHorizontalSpacing(horizontalSpacing);
|
||||
this.mHorizontalSpacing = horizontalSpacing;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置响应拖拽的毫秒数,默认是700毫秒
|
||||
*
|
||||
* @param dragResponseMS
|
||||
*/
|
||||
public void setDragResponseMS(long dragResponseMS) {
|
||||
this.dragResponseMS = dragResponseMS;
|
||||
}
|
||||
|
||||
public void setOnDeleteListener(OnDeleteListener l) {
|
||||
this.deleteListener = l;
|
||||
}
|
||||
|
||||
public void setTrashView(View trashView) {
|
||||
this.mTrashView = trashView;
|
||||
}
|
||||
|
||||
public void setDragEnable(boolean isDrag) {
|
||||
this.canDrag = isDrag;
|
||||
if (canDrag) {
|
||||
mHandler.removeCallbacks(mLongClickRunnable);
|
||||
}
|
||||
}
|
||||
|
||||
/******************** touch method ********************/
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (canDrag) {
|
||||
switch (ev.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mDownX = (int) ev.getX();
|
||||
mDownY = (int) ev.getY();
|
||||
moveRect.left = mDownX - MOVE_OFFSET;
|
||||
moveRect.right = mDownX + MOVE_OFFSET;
|
||||
moveRect.top = mDownY - MOVE_OFFSET;
|
||||
moveRect.bottom = mDownY + MOVE_OFFSET;
|
||||
|
||||
// 根据按下的X,Y坐标获取所点击item的position
|
||||
mDragPosition = pointToPosition(mDownX, mDownY);
|
||||
|
||||
if (mDragPosition == AdapterView.INVALID_POSITION) {
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
// 使用Handler延迟dragResponseMS执行mLongClickRunnable
|
||||
mHandler.postDelayed(mLongClickRunnable, dragResponseMS);
|
||||
|
||||
// 根据position获取该item所对应的View
|
||||
mStartDragItemView = getChildAt(mDragPosition
|
||||
- getFirstVisiblePosition());
|
||||
|
||||
mPoint2ItemTop = mDownY - mStartDragItemView.getTop();
|
||||
mPoint2ItemLeft = mDownX - mStartDragItemView.getLeft();
|
||||
|
||||
mOffset2Top = (int) (ev.getRawY() - mDownY);
|
||||
mOffset2Left = (int) (ev.getRawX() - mDownX);
|
||||
|
||||
// 获取DragGridView自动向上滚动的偏移量,小于这个值,DragGridView向下滚动
|
||||
mDownScrollBorder = getHeight() / 5;
|
||||
// 大于这个值,DragGridView向上滚动
|
||||
mUpScrollBorder = getHeight() * 4 / 5;
|
||||
|
||||
// 开启mDragItemView绘图缓存
|
||||
mStartDragItemView.setDrawingCacheEnabled(true);
|
||||
// 获取mDragItemView在缓存中的Bitmap对象
|
||||
mDragBitmap = Bitmap.createBitmap(mStartDragItemView
|
||||
.getDrawingCache());
|
||||
// 这一步很关键,释放绘图缓存,避免出现重复的镜像
|
||||
mStartDragItemView.destroyDrawingCache();
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
// 如果我们在按下的item上面移动,只要不超过item的边界我们就不移除mRunnable
|
||||
if (!isTouchInItem(moveRect, ev.getX(), ev.getY())) {
|
||||
mHandler.removeCallbacks(mLongClickRunnable);
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
mHandler.removeCallbacks(mScrollRunnable);
|
||||
mHandler.removeCallbacks(mLongClickRunnable);
|
||||
if (moved && getAdapter().getCount() > 0) {
|
||||
mHandler.sendEmptyMessage(HANDLE_FINISH);
|
||||
} else {
|
||||
mHandler.sendEmptyMessage(HANDLE_CANCLE);
|
||||
}
|
||||
moved = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
if (isDrag && canDrag && mDragImageView != null) {
|
||||
switch (ev.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
initRecord();
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
moveX = (int) ev.getX();
|
||||
moveY = (int) ev.getY();
|
||||
|
||||
onDragItem(moveX, moveY);// 拖动item
|
||||
|
||||
if (mTrashView != null) {
|
||||
if (inTrash(moveX, moveY)) {
|
||||
mTrashView.setScaleX(1.7f);
|
||||
mTrashView.setScaleY(1.7f);
|
||||
} else {
|
||||
mTrashView.setScaleX(1f);
|
||||
mTrashView.setScaleY(1f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
onStopDrag();
|
||||
isDrag = false;
|
||||
if (deleteListener != null && inTrash(ev.getX(), ev.getY())) {
|
||||
deleteListener.onDelete(mDragPosition);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否点击在GridView的item上面
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @return
|
||||
*/
|
||||
private boolean isTouchInItem(TouchRect moveRect, float x, float y) {
|
||||
// 防止手抖的处理,如果是横向在item上移动是没有影响的,
|
||||
// 但是纵向由于外层上下拉控件还是会有影响,具体解决请看NoteBookFragment类中的mSwipeRefreshLayout.setOnTouchListener方法
|
||||
if (x < moveRect.right && x > moveRect.left && y < moveRect.bottom
|
||||
&& y > moveRect.top) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建拖动的镜像
|
||||
*
|
||||
* @param bitmap
|
||||
* @param downX
|
||||
* 按下的点相对父控件的X坐标
|
||||
* @param downY
|
||||
* 按下的点相对父控件的X坐标
|
||||
*/
|
||||
private void createDragImage(Bitmap bitmap, int downX, int downY) {
|
||||
mWindowLayoutParams = new WindowManager.LayoutParams();
|
||||
mWindowLayoutParams.format = PixelFormat.TRANSLUCENT; // 图片之外的其他地方透明
|
||||
|
||||
mWindowLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;
|
||||
mWindowLayoutParams.x = downX - mPoint2ItemLeft + mOffset2Left;
|
||||
mWindowLayoutParams.y = downY - mPoint2ItemTop + mOffset2Top
|
||||
- mStatusHeight;
|
||||
mWindowLayoutParams.alpha = 0.55f; // 透明度
|
||||
|
||||
|
||||
mWindowLayoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
mWindowLayoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
mWindowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
||||
|
||||
mDragImageView = new ImageView(getContext());
|
||||
mDragImageView.setImageBitmap(bitmap);
|
||||
mWindowManager.addView(mDragImageView, mWindowLayoutParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从界面上面移动拖动镜像
|
||||
*/
|
||||
private void removeDragImage() {
|
||||
if (mDragImageView != null) {
|
||||
mWindowManager.removeView(mDragImageView);
|
||||
mDragImageView = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拖动item,在里面实现了item镜像的位置更新,item的相互交换以及GridView的自行滚动
|
||||
*
|
||||
* @param moveX
|
||||
* @param moveY
|
||||
*/
|
||||
private void onDragItem(int moveX, int moveY) {
|
||||
mWindowLayoutParams.x = moveX - mPoint2ItemLeft + mOffset2Left;
|
||||
mWindowLayoutParams.y = moveY - mPoint2ItemTop + mOffset2Top
|
||||
- mStatusHeight;
|
||||
mWindowManager.updateViewLayout(mDragImageView, mWindowLayoutParams); // 更新镜像的位置
|
||||
onSwapItem(moveX, moveY);
|
||||
// GridView自动滚动
|
||||
mHandler.post(mScrollRunnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手指当前处于垃圾桶图标上
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @return
|
||||
*/
|
||||
private boolean inTrash(float x, float y) {
|
||||
x += gridRect.left;
|
||||
y += gridRect.top;
|
||||
if (x > trashRect.left && x < trashRect.right && y > trashRect.top
|
||||
&& y < trashRect.bottom) {
|
||||
if (mHandler != null && mScrollRunnable != null) {
|
||||
mHandler.removeCallbacks(mScrollRunnable);
|
||||
}
|
||||
if (mDragImageView != null) {
|
||||
mDragImageView.setScaleX(0.6f);
|
||||
mDragImageView.setScaleY(0.6f);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (mDragImageView != null) {
|
||||
mDragImageView.setScaleX(1f);
|
||||
mDragImageView.setScaleY(1f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当moveY的值大于向上滚动的边界值,触发GridView自动向上滚动 当moveY的值小于向下滚动的边界值,触发GridView自动向下滚动
|
||||
* 否则不进行滚动
|
||||
*/
|
||||
private final Runnable mScrollRunnable = new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
int scrollY;
|
||||
if (getFirstVisiblePosition() == 0
|
||||
|| getLastVisiblePosition() == getCount() - 1) {
|
||||
mHandler.removeCallbacks(mScrollRunnable);
|
||||
}
|
||||
|
||||
if (moveY > mUpScrollBorder) {
|
||||
scrollY = speed;
|
||||
mHandler.postDelayed(mScrollRunnable, 25);
|
||||
} else if (moveY < mDownScrollBorder) {
|
||||
scrollY = -speed;
|
||||
mHandler.postDelayed(mScrollRunnable, 25);
|
||||
} else {
|
||||
scrollY = 0;
|
||||
mHandler.removeCallbacks(mScrollRunnable);
|
||||
}
|
||||
|
||||
smoothScrollBy(scrollY, 10);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 交换item,并且控制item之间的显示与隐藏效果
|
||||
*
|
||||
* @param moveX
|
||||
* @param moveY
|
||||
*/
|
||||
private void onSwapItem(int moveX, int moveY) {
|
||||
// 获取我们手指移动到的那个item的position
|
||||
|
||||
final int tempPosition = pointToPosition(moveX, moveY);
|
||||
|
||||
// 假如tempPosition 改变了并且tempPosition不等于-1,则进行交换
|
||||
|
||||
if (tempPosition != mDragPosition
|
||||
&& tempPosition != AdapterView.INVALID_POSITION
|
||||
&& mAnimationEnd) {
|
||||
mDragAdapter.reorderItems(mDragPosition, tempPosition);
|
||||
mDragAdapter.setHideItem(tempPosition);
|
||||
|
||||
final ViewTreeObserver observer = getViewTreeObserver();
|
||||
observer.addOnPreDrawListener(new OnPreDrawListener() {
|
||||
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
observer.removeOnPreDrawListener(this);
|
||||
animateReorder(mDragPosition, tempPosition);
|
||||
mDragPosition = tempPosition;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建移动动画
|
||||
*
|
||||
* @param view
|
||||
* @param startX
|
||||
* @param endX
|
||||
* @param startY
|
||||
* @param endY
|
||||
* @return
|
||||
*/
|
||||
private AnimatorSet createTranslationAnimations(View view, float startX,
|
||||
float endX, float startY, float endY) {
|
||||
ObjectAnimator animX = ObjectAnimator.ofFloat(view, "translationX",
|
||||
startX, endX);
|
||||
ObjectAnimator animY = ObjectAnimator.ofFloat(view, "translationY",
|
||||
startY, endY);
|
||||
AnimatorSet animSetXY = new AnimatorSet();
|
||||
animSetXY.playTogether(animX, animY);
|
||||
return animSetXY;
|
||||
}
|
||||
|
||||
/**
|
||||
* item的交换动画效果
|
||||
*
|
||||
* @param oldPosition
|
||||
* @param newPosition
|
||||
*/
|
||||
private void animateReorder(final int oldPosition, final int newPosition) {
|
||||
boolean isForward = newPosition > oldPosition;
|
||||
List<Animator> resultList = new LinkedList<Animator>();
|
||||
if (isForward) {
|
||||
for (int pos = oldPosition; pos < newPosition; pos++) {
|
||||
View view = getChildAt(pos - getFirstVisiblePosition());
|
||||
if (view == null) {
|
||||
continue;
|
||||
}
|
||||
if ((pos + 1) % mNumColumns == 0) {
|
||||
resultList.add(createTranslationAnimations(view,
|
||||
-view.getWidth() * (mNumColumns - 1), 0,
|
||||
view.getHeight(), 0));
|
||||
} else {
|
||||
resultList.add(createTranslationAnimations(view,
|
||||
view.getWidth(), 0, 0, 0));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int pos = oldPosition; pos > newPosition; pos--) {
|
||||
View view = getChildAt(pos - getFirstVisiblePosition());
|
||||
if ((pos + mNumColumns) % mNumColumns == 0) {
|
||||
resultList.add(createTranslationAnimations(view,
|
||||
view.getWidth() * (mNumColumns - 1), 0,
|
||||
-view.getHeight(), 0));
|
||||
} else {
|
||||
resultList.add(createTranslationAnimations(view,
|
||||
-view.getWidth(), 0, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AnimatorSet resultSet = new AnimatorSet();
|
||||
resultSet.playTogether(resultList);
|
||||
resultSet.setDuration(300);
|
||||
resultSet.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
resultSet.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
mAnimationEnd = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mAnimationEnd = true;
|
||||
}
|
||||
});
|
||||
resultSet.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止拖拽我们将之前隐藏的item显示出来,并将镜像移除
|
||||
*/
|
||||
private void onStopDrag() {
|
||||
View view = getChildAt(mDragPosition - getFirstVisiblePosition());
|
||||
if (view != null) {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mDragAdapter.setHideItem(-1);
|
||||
removeDragImage();
|
||||
|
||||
if (mTrashView != null) {
|
||||
mTrashView.setScaleX(1f);
|
||||
mTrashView.setScaleY(1f);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnMoveListener(OnMoveListener l) {
|
||||
moveListener = l;
|
||||
}
|
||||
|
||||
public interface OnMoveListener {
|
||||
void startMove();
|
||||
|
||||
void finishMove();
|
||||
|
||||
void cancleMove();
|
||||
}
|
||||
|
||||
public interface OnDeleteListener {
|
||||
void onDelete(int position);
|
||||
}
|
||||
|
||||
public interface DragGridBaseAdapter {
|
||||
/**
|
||||
* 移动时回调
|
||||
*/
|
||||
public void reorderItems(int oldPosition, int newPosition);
|
||||
|
||||
/**
|
||||
* 隐藏时回调
|
||||
*/
|
||||
public void setHideItem(int hidePosition);
|
||||
}
|
||||
|
||||
private class TouchRect {
|
||||
int top;
|
||||
int bottom;
|
||||
int left;
|
||||
int right;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.example.administrator.myapplication.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
/**
|
||||
* 圆形ImageView组件 点击事件不会穿透
|
||||
*
|
||||
* @author kymjs(kymjs123@gmail.com)
|
||||
*/
|
||||
public class NoteItemCircleView extends CircleImageView {
|
||||
|
||||
public NoteItemCircleView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public NoteItemCircleView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public NoteItemCircleView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
super.onTouchEvent(event);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,336 @@
|
|||
package com.example.administrator.myapplication.widget;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TypeEvaluator;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Paint.Cap;
|
||||
import android.graphics.Paint.Style;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Property;
|
||||
import android.view.View;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author Qiujuer
|
||||
*/
|
||||
public class ToggleButton extends View {
|
||||
/** */
|
||||
private float radius;
|
||||
/**
|
||||
* 开启颜色
|
||||
*/
|
||||
private int onColor = Color.parseColor("#4ebb7f");
|
||||
/**
|
||||
* 关闭颜色
|
||||
*/
|
||||
private int offBorderColor = Color.parseColor("#dadbda");
|
||||
/**
|
||||
* 灰色带颜色
|
||||
*/
|
||||
private int offColor = Color.parseColor("#ffffff");
|
||||
/**
|
||||
* 手柄颜色
|
||||
*/
|
||||
private int spotColor = Color.parseColor("#ffffff");
|
||||
/**
|
||||
* 边框颜色
|
||||
*/
|
||||
private int borderColor = offBorderColor;
|
||||
/**
|
||||
* 画笔
|
||||
*/
|
||||
private Paint paint;
|
||||
/**
|
||||
* 开关状态
|
||||
*/
|
||||
private boolean toggleOn = false;
|
||||
/**
|
||||
* 边框大小
|
||||
*/
|
||||
private int borderWidth = 2;
|
||||
/**
|
||||
* 垂直中心
|
||||
*/
|
||||
private float centerY;
|
||||
/**
|
||||
* 按钮的开始和结束位置
|
||||
*/
|
||||
private float startX, endX;
|
||||
/**
|
||||
* 手柄X位置的最小和最大值
|
||||
*/
|
||||
private float spotMinX, spotMaxX;
|
||||
/**
|
||||
* 手柄大小
|
||||
*/
|
||||
private int spotSize;
|
||||
/**
|
||||
* 手柄X位置
|
||||
*/
|
||||
private float spotX;
|
||||
/**
|
||||
* 关闭时内部灰色带高度
|
||||
*/
|
||||
private float offLineWidth;
|
||||
/** */
|
||||
private RectF rect = new RectF();
|
||||
|
||||
private OnToggleChanged listener;
|
||||
|
||||
private ToggleButton(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ToggleButton(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
setup(attrs);
|
||||
}
|
||||
|
||||
public ToggleButton(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
setup(attrs);
|
||||
}
|
||||
|
||||
public void setup(AttributeSet attrs) {
|
||||
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
paint.setStyle(Style.FILL);
|
||||
paint.setStrokeCap(Cap.ROUND);
|
||||
|
||||
this.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
toggle();
|
||||
}
|
||||
});
|
||||
|
||||
TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.ToggleButton);
|
||||
offBorderColor = typedArray.getColor(R.styleable.ToggleButton_offBorderColor, offBorderColor);
|
||||
onColor = typedArray.getColor(R.styleable.ToggleButton_onColor, onColor);
|
||||
spotColor = typedArray.getColor(R.styleable.ToggleButton_spotColor, spotColor);
|
||||
offColor = typedArray.getColor(R.styleable.ToggleButton_offColor, offColor);
|
||||
borderWidth = typedArray.getDimensionPixelSize(R.styleable.ToggleButton_toggle_border_width, borderWidth);
|
||||
typedArray.recycle();
|
||||
}
|
||||
|
||||
public void toggle() {
|
||||
toggleOn = !toggleOn;
|
||||
animateCheckedState(toggleOn);
|
||||
if (listener != null) {
|
||||
listener.onToggle(toggleOn);
|
||||
}
|
||||
}
|
||||
|
||||
public void toggleOn() {
|
||||
setToggleOn();
|
||||
if (listener != null) {
|
||||
listener.onToggle(toggleOn);
|
||||
}
|
||||
}
|
||||
|
||||
public void toggleOff() {
|
||||
setToggleOff();
|
||||
if (listener != null) {
|
||||
listener.onToggle(toggleOn);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置显示成打开样式,不会触发toggle事件
|
||||
*/
|
||||
public void setToggleOn() {
|
||||
toggleOn = true;
|
||||
setAnimatorProperty(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置显示成关闭样式,不会触发toggle事件
|
||||
*/
|
||||
public void setToggleOff() {
|
||||
toggleOn = false;
|
||||
setAnimatorProperty(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right,
|
||||
int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
|
||||
final int width = getWidth();
|
||||
final int height = getHeight();
|
||||
radius = Math.min(width, height) * 0.5f;
|
||||
centerY = radius;
|
||||
startX = radius;
|
||||
endX = width - radius;
|
||||
spotMinX = startX + borderWidth;
|
||||
spotMaxX = endX - borderWidth;
|
||||
spotSize = height - 4 * borderWidth;
|
||||
|
||||
// update values
|
||||
setAnimatorProperty(toggleOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
rect.set(0, 0, getWidth(), getHeight());
|
||||
paint.setColor(borderColor);
|
||||
canvas.drawRoundRect(rect, radius, radius, paint);
|
||||
|
||||
if (offLineWidth > 0) {
|
||||
final float cy = offLineWidth * 0.5f;
|
||||
rect.set(spotX - cy, centerY - cy, endX + cy, centerY + cy);
|
||||
paint.setColor(offColor);
|
||||
canvas.drawRoundRect(rect, cy, cy, paint);
|
||||
}
|
||||
|
||||
rect.set(spotX - 1 - radius, centerY - radius, spotX + 1.1f + radius, centerY + radius);
|
||||
paint.setColor(borderColor);
|
||||
canvas.drawRoundRect(rect, radius, radius, paint);
|
||||
|
||||
final float spotR = spotSize * 0.5f;
|
||||
rect.set(spotX - spotR, centerY - spotR, spotX + spotR, centerY + spotR);
|
||||
paint.setColor(spotColor);
|
||||
canvas.drawRoundRect(rect, spotR, spotR, paint);
|
||||
}
|
||||
|
||||
/**
|
||||
* =============================================================================================
|
||||
* The Animate
|
||||
* =============================================================================================
|
||||
*/
|
||||
private static final Interpolator ANIMATION_INTERPOLATOR = new DecelerateInterpolator();
|
||||
private static final int ANIMATION_DURATION = 280;
|
||||
private ObjectAnimator mAnimator;
|
||||
|
||||
private void animateCheckedState(boolean newCheckedState) {
|
||||
AnimatorProperty property = new AnimatorProperty();
|
||||
if (newCheckedState) {
|
||||
property.color = onColor;
|
||||
property.offLineWidth = 10;
|
||||
property.spotX = spotMaxX;
|
||||
} else {
|
||||
property.color = offBorderColor;
|
||||
property.offLineWidth = spotSize;
|
||||
property.spotX = spotMinX;
|
||||
}
|
||||
|
||||
if (mAnimator == null) {
|
||||
mAnimator = ObjectAnimator.ofObject(this, ANIM_VALUE, new AnimatorEvaluator(mCurProperty), property);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
mAnimator.setAutoCancel(true);
|
||||
mAnimator.setDuration(ANIMATION_DURATION);
|
||||
mAnimator.setInterpolator(ANIMATION_INTERPOLATOR);
|
||||
} else {
|
||||
mAnimator.cancel();
|
||||
mAnimator.setObjectValues(property);
|
||||
}
|
||||
mAnimator.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* =============================================================================================
|
||||
* The custom properties
|
||||
* =============================================================================================
|
||||
*/
|
||||
|
||||
private AnimatorProperty mCurProperty = new AnimatorProperty();
|
||||
|
||||
private void setAnimatorProperty(AnimatorProperty property) {
|
||||
this.spotX = property.spotX;
|
||||
this.borderColor = property.color;
|
||||
this.offLineWidth = property.offLineWidth;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private void setAnimatorProperty(boolean isOn) {
|
||||
AnimatorProperty property = mCurProperty;
|
||||
if (isOn) {
|
||||
property.color = onColor;
|
||||
property.offLineWidth = 10;
|
||||
property.spotX = spotMaxX;
|
||||
} else {
|
||||
property.color = offBorderColor;
|
||||
property.offLineWidth = spotSize;
|
||||
property.spotX = spotMinX;
|
||||
}
|
||||
setAnimatorProperty(property);
|
||||
}
|
||||
|
||||
private final static class AnimatorProperty {
|
||||
private int color;
|
||||
private float offLineWidth;
|
||||
private float spotX;
|
||||
}
|
||||
|
||||
private final static class AnimatorEvaluator implements TypeEvaluator<AnimatorProperty> {
|
||||
private final AnimatorProperty mProperty;
|
||||
|
||||
public AnimatorEvaluator(AnimatorProperty property) {
|
||||
mProperty = property;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimatorProperty evaluate(float fraction, AnimatorProperty startValue, AnimatorProperty endValue) {
|
||||
// Values
|
||||
mProperty.spotX = (int) (startValue.spotX + (endValue.spotX - startValue.spotX) * fraction);
|
||||
|
||||
mProperty.offLineWidth = (int) (startValue.offLineWidth + (endValue.offLineWidth - startValue.offLineWidth) * (1 - fraction));
|
||||
|
||||
// Color
|
||||
int startA = (startValue.color >> 24) & 0xff;
|
||||
int startR = (startValue.color >> 16) & 0xff;
|
||||
int startG = (startValue.color >> 8) & 0xff;
|
||||
int startB = startValue.color & 0xff;
|
||||
|
||||
int endA = (endValue.color >> 24) & 0xff;
|
||||
int endR = (endValue.color >> 16) & 0xff;
|
||||
int endG = (endValue.color >> 8) & 0xff;
|
||||
int endB = endValue.color & 0xff;
|
||||
|
||||
mProperty.color = (startA + (int) (fraction * (endA - startA))) << 24 |
|
||||
(startR + (int) (fraction * (endR - startR))) << 16 |
|
||||
(startG + (int) (fraction * (endG - startG))) << 8 |
|
||||
(startB + (int) (fraction * (endB - startB)));
|
||||
|
||||
return mProperty;
|
||||
}
|
||||
}
|
||||
|
||||
private final static Property<ToggleButton, AnimatorProperty> ANIM_VALUE = new Property<ToggleButton, AnimatorProperty>(AnimatorProperty.class, "animValue") {
|
||||
@Override
|
||||
public AnimatorProperty get(ToggleButton object) {
|
||||
return object.mCurProperty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(ToggleButton object, AnimatorProperty value) {
|
||||
object.setAnimatorProperty(value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @author ThinkPad
|
||||
*/
|
||||
public interface OnToggleChanged {
|
||||
/**
|
||||
* @param on
|
||||
*/
|
||||
public void onToggle(boolean on);
|
||||
}
|
||||
|
||||
|
||||
public void setOnToggleChanged(OnToggleChanged onToggleChanged) {
|
||||
listener = onToggleChanged;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,399 @@
|
|||
package com.example.administrator.myapplication.widget.patternlock;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.administrator.myapplication.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class LockPatternView extends View {
|
||||
//判断线的状态
|
||||
private boolean isLineState = true;
|
||||
//判断点是否被实例化了
|
||||
private boolean isInitPoint = false;//不能被定义为static,否则很可能导致mPoints内存泄漏
|
||||
//判断手指是否离开屏幕
|
||||
private boolean isFinish = false;
|
||||
//判断手指点击屏幕时是否选中了九宫格中的点
|
||||
private boolean isSelect = false;
|
||||
// 创建MyPoint的数组
|
||||
private Point[][] mPoints;
|
||||
// 声明屏幕的宽和高
|
||||
private int mScreenHeight;
|
||||
private int mScreenWidth;
|
||||
// 声明点线的图片的半径
|
||||
private float mPointRadius;
|
||||
// 声明线的图片的高(即是半径)
|
||||
private float mLineHeight;
|
||||
// 声明鼠标移动的x,y坐标
|
||||
private float mMoveX, mMoveY;
|
||||
// 声明屏幕上的宽和高的偏移量
|
||||
private int mScreenHeightOffSet = 0;
|
||||
private int mScreenWidthOffSet = 0;
|
||||
// 创建一个画笔
|
||||
private Paint mPaint;
|
||||
// 声明资源图片
|
||||
private Bitmap mBitmapNormal;
|
||||
private Bitmap mBitmapPressed;
|
||||
private Bitmap mBitmapError;
|
||||
private Bitmap mLinePressed;
|
||||
private Bitmap mLineError;
|
||||
// 创建一个矩阵
|
||||
private Matrix mMatrix = new Matrix();
|
||||
// 创建MyPoint的列表
|
||||
private List<Point> mPointList = new ArrayList<Point>();
|
||||
// 实例化鼠标点
|
||||
private Point mMousePoint = new Point();
|
||||
// 用获取从activity中传过来的密码字符串
|
||||
private String mPassword = "";
|
||||
|
||||
private Context mContext;
|
||||
private OnLockListener mListener;
|
||||
private Activity activity;
|
||||
|
||||
public LockPatternView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mContext = context;
|
||||
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mPoints = new Point[3][3];
|
||||
}
|
||||
|
||||
public LockPatternView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mPoints = new Point[3][3];
|
||||
}
|
||||
|
||||
public LockPatternView(Context context) {
|
||||
super(context);
|
||||
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mPoints = new Point[3][3];
|
||||
}
|
||||
|
||||
/**
|
||||
* 画点和画线
|
||||
*/
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
if (!isInitPoint) {
|
||||
initPoint(); // 先初始化
|
||||
}
|
||||
canvasPoint(canvas); // 开始画点
|
||||
|
||||
// 开始画线
|
||||
if (mPointList.size() > 0) {
|
||||
Point b = null;
|
||||
Point a = mPointList.get(0);
|
||||
for (int i = 1; i < mPointList.size(); i++) {
|
||||
b = mPointList.get(i);
|
||||
canvasLine(a, b, canvas);
|
||||
a = b;
|
||||
}
|
||||
if (!isFinish) {
|
||||
canvasLine(a, mMousePoint, canvas);
|
||||
}
|
||||
}
|
||||
if(isFinish)
|
||||
{
|
||||
|
||||
try {
|
||||
Thread.sleep(700);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
changePointToNormal();
|
||||
postInvalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author htq
|
||||
*/
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
//
|
||||
Display d=activity.getWindowManager().getDefaultDisplay();
|
||||
setMeasuredDimension(d.getWidth(),d.getWidth());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手指点击手机屏幕
|
||||
*/
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
mMoveX = event.getX();
|
||||
mMoveY = event.getY();
|
||||
// 设置移动点的坐标
|
||||
mMousePoint.setX(mMoveX);
|
||||
mMousePoint.setY(mMoveY);
|
||||
Point mPoint = null;
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
isLineState = true;
|
||||
isFinish = false;
|
||||
// // 每次点击时就会将pointList中元素设置转化成普通状态
|
||||
// for (int i = 0; i < mPointList.size(); i++) {
|
||||
// mPointList.get(i).setState(Point.BITMAP_NORMAL);
|
||||
// }
|
||||
// // 将pointList中的元素清除掉
|
||||
// mPointList.clear();
|
||||
changePointToNormal();
|
||||
// 判断是否点中了九宫格中的点
|
||||
mPoint = getIsSelectedPoint(mMoveX, mMoveY);
|
||||
if (mPoint != null) {
|
||||
isSelect = true;
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (isSelect == true) {
|
||||
mPoint = getIsSelectedPoint(mMoveX, mMoveY);
|
||||
}
|
||||
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
isFinish = true;
|
||||
isSelect = false;
|
||||
// 规定至少要有4个点被连线才有可能是正确
|
||||
// 其他种情况都是错误的
|
||||
if (mPointList.size() >= 4) {// 正确情况
|
||||
for (int j = 0; j < mPointList.size(); j++) {
|
||||
mPassword += mPointList.get(j).getIndex();
|
||||
}
|
||||
Log.i("password",mPassword);
|
||||
//将连线后得到的密码传给activity
|
||||
mListener.getStringPassword(mPassword);
|
||||
mPassword = "";
|
||||
//经过activity判断传过来是否正确
|
||||
if (mListener.isPassword()) {
|
||||
for (int i = 0; i < mPointList.size(); i++) {
|
||||
mPointList.get(i).setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_PRESS);
|
||||
|
||||
}
|
||||
isLineState = true;
|
||||
} else {
|
||||
for (int i = 0; i < mPointList.size(); i++) {
|
||||
mPointList.get(i).setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_ERROR);
|
||||
|
||||
}
|
||||
Log.i("correct","is not correct");
|
||||
isLineState = false;
|
||||
}
|
||||
// 错误情况
|
||||
} else if (mPointList.size() < 4 && mPointList.size() > 1) {
|
||||
for (int i = 0; i < mPointList.size(); i++) {
|
||||
mPointList.get(i).setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_ERROR);
|
||||
Snackbar.make(this,"为了您的App安全,手势至少得包含4个点",Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
isLineState = false;
|
||||
// 如果只有一个点被点中时为普通情况
|
||||
} else if (mPointList.size() == 1) {
|
||||
for (int i = 0; i < mPointList.size(); i++) {
|
||||
mPointList.get(i).setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_NORMAL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
// 将mPoint添加到pointList中
|
||||
if (isSelect && mPoint != null) {
|
||||
if (mPoint.getState() == com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_NORMAL) {
|
||||
mPoint.setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_PRESS);
|
||||
mPointList.add(mPoint);
|
||||
}
|
||||
}
|
||||
// Log.i("draw","draw -----");
|
||||
// 每次发生OnTouchEvent()后都刷新View
|
||||
postInvalidate();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author htq
|
||||
*/
|
||||
private void changePointToNormal()
|
||||
{
|
||||
// 每次点击时就会将pointList中元素设置转化成普通状态
|
||||
for (int i = 0; i < mPointList.size(); i++) {
|
||||
mPointList.get(i).setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_NORMAL);
|
||||
}
|
||||
// 将pointList中的元素清除掉
|
||||
mPointList.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断九宫格中的某个点是否被点中了,或者某个点能否被连线
|
||||
*
|
||||
* @param moveX
|
||||
* @param moveY
|
||||
* @return
|
||||
*/
|
||||
private Point getIsSelectedPoint(float moveX, float moveY) {
|
||||
Point myPoint = null;
|
||||
for (int i = 0; i < mPoints.length; i++) {
|
||||
for (int j = 0; j < mPoints[i].length; j++) {
|
||||
if (mPoints[i][j].isWith(mPoints[i][j], moveX, moveY,
|
||||
mPointRadius)) {
|
||||
myPoint = mPoints[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return myPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* 画线
|
||||
*
|
||||
* @param a 起始点
|
||||
* @param b 目的点
|
||||
* @param canvas 画布
|
||||
*/
|
||||
private void canvasLine(Point a, Point b, Canvas canvas) {
|
||||
// Math.sqrt(平方+平方)
|
||||
float abInstance = (float) Math.sqrt(
|
||||
(a.getX() - b.getX()) * (a.getX() - b.getX())
|
||||
+ (a.getY() - b.getY()) * (a.getY() - b.getY())
|
||||
);
|
||||
canvas.rotate(com.example.administrator.myapplication.widget.patternlock.RotateDegrees.getDegrees(a, b), a.getX(), a.getY());
|
||||
|
||||
mMatrix.setScale(abInstance / mLineHeight, 1);
|
||||
mMatrix.postTranslate(a.getX(), a.getY());
|
||||
if (isLineState) {
|
||||
canvas.drawBitmap(mLinePressed, mMatrix, mPaint);
|
||||
} else {
|
||||
canvas.drawBitmap(mLineError, mMatrix, mPaint);
|
||||
}
|
||||
|
||||
canvas.rotate(-com.example.administrator.myapplication.widget.patternlock.RotateDegrees.getDegrees(a, b), a.getX(), a.getY());
|
||||
}
|
||||
|
||||
/**
|
||||
* 画点
|
||||
*
|
||||
* @param canvas
|
||||
*/
|
||||
private void canvasPoint(Canvas canvas) {
|
||||
|
||||
for (int i = 0; i < mPoints.length; i++) {
|
||||
for (int j = 0; j < mPoints[i].length; j++) {
|
||||
if (mPoints[i][j].getState() == com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_NORMAL) {
|
||||
canvas.drawBitmap(mBitmapNormal,
|
||||
mPoints[i][j].getX() - mPointRadius,
|
||||
mPoints[i][j].getY() - mPointRadius, mPaint);
|
||||
} else if (mPoints[i][j].getState() == com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_PRESS) {
|
||||
canvas.drawBitmap(mBitmapPressed,
|
||||
mPoints[i][j].getX() - mPointRadius,
|
||||
mPoints[i][j].getY() - mPointRadius, mPaint);
|
||||
} else {
|
||||
canvas.drawBitmap(mBitmapError,
|
||||
mPoints[i][j].getX() - mPointRadius,
|
||||
mPoints[i][j].getY() - mPointRadius, mPaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例化九宫格中所有点和所有的资源图片
|
||||
*/
|
||||
private void initPoint() {
|
||||
// 获取View的宽高
|
||||
mScreenWidth = getWidth();
|
||||
mScreenHeight = getHeight();
|
||||
if (mScreenHeight > mScreenWidth) {
|
||||
// 获取y轴上的偏移量
|
||||
mScreenHeightOffSet = (mScreenHeight - mScreenWidth) / 2;
|
||||
// 将屏幕高的变量设置成与宽相等,目的是为了new Point(x,y)时方便操作
|
||||
mScreenHeight = mScreenWidth;
|
||||
} else {
|
||||
// 获取x轴上的偏移量
|
||||
mScreenWidthOffSet = (mScreenWidth - mScreenHeight) / 2;
|
||||
// 将屏幕宽的变量设置成与高相等,目的是为了new Point(x,y)时方便操作
|
||||
mScreenWidth = mScreenHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例化所有的资源图片
|
||||
*/
|
||||
mBitmapError = BitmapFactory.decodeResource(getResources(), R.drawable.bitmap_error);
|
||||
mBitmapNormal = BitmapFactory.decodeResource(getResources(), R.drawable.bitmap_normal);
|
||||
mBitmapPressed = BitmapFactory.decodeResource(getResources(), R.drawable.bitmap_pressed);
|
||||
mLineError = BitmapFactory.decodeResource(getResources(), R.drawable.line_error);
|
||||
mLinePressed = BitmapFactory.decodeResource(getResources(), R.drawable.line_pressed);
|
||||
|
||||
mPointRadius = mBitmapNormal.getWidth() / 2;
|
||||
mLineHeight = mLinePressed.getHeight();
|
||||
|
||||
/**
|
||||
* 开始实例化九宫格中点
|
||||
*/
|
||||
mPoints[0][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4,
|
||||
mScreenHeightOffSet + mScreenHeight / 4);
|
||||
mPoints[0][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2,
|
||||
mScreenHeightOffSet + mScreenHeight / 4);
|
||||
mPoints[0][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4,
|
||||
mScreenHeightOffSet + mScreenHeight / 4);
|
||||
|
||||
mPoints[1][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4,
|
||||
mScreenHeightOffSet + mScreenHeight / 2);
|
||||
mPoints[1][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2,
|
||||
mScreenHeightOffSet + mScreenHeight / 2);
|
||||
mPoints[1][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4,
|
||||
mScreenHeightOffSet + mScreenHeight / 2);
|
||||
|
||||
mPoints[2][0] = new Point(mScreenWidthOffSet + mScreenWidth / 4,
|
||||
mScreenHeightOffSet + mScreenHeight * 3 / 4);
|
||||
mPoints[2][1] = new Point(mScreenWidthOffSet + mScreenWidth / 2,
|
||||
mScreenHeightOffSet + mScreenHeight * 3 / 4);
|
||||
mPoints[2][2] = new Point(mScreenWidthOffSet + mScreenWidth * 3 / 4,
|
||||
mScreenHeightOffSet + mScreenHeight * 3 / 4);
|
||||
|
||||
|
||||
// 设置九宫格中的各个index
|
||||
int index = 1;
|
||||
for (int i = 0; i < mPoints.length; i++) {
|
||||
for (int j = 0; j < mPoints[i].length; j++) {
|
||||
mPoints[i][j].setIndex(index + "");
|
||||
// 在没有任何操作的情况下默認点的状态
|
||||
mPoints[i][j].setState(com.example.administrator.myapplication.widget.patternlock.Point.BITMAP_NORMAL);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// 将isInitPoint设置为true
|
||||
isInitPoint = true;
|
||||
}
|
||||
|
||||
public interface OnLockListener {
|
||||
public void getStringPassword(String password);
|
||||
|
||||
|
||||
// public void setErrorMsg(String msg);
|
||||
// public void setSuccessMsg(String msg);
|
||||
public boolean isPassword();
|
||||
}
|
||||
|
||||
|
||||
public void setLockListener(OnLockListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
public void setActivityContext(Activity aty){this.activity=aty;}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.example.administrator.myapplication.widget.patternlock;
|
||||
|
||||
public class Point {
|
||||
public static int BITMAP_NORMAL = 0; // 正常
|
||||
public static int BITMAP_ERROR = 1; // 错误
|
||||
public static int BITMAP_PRESS = 2; // 按下
|
||||
|
||||
//九宫格中的点的下标(即每个点代表一个值)
|
||||
private String index;
|
||||
//点的状态
|
||||
private int state;
|
||||
//点的坐标
|
||||
private float x;
|
||||
private float y;
|
||||
|
||||
public Point() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Point(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public String getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public float getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public float getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setIndex(String index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void setX(float x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public void setY(float y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断屏幕上的九宫格中的点能否可以进行连线
|
||||
*
|
||||
* @param a
|
||||
* @param moveX
|
||||
* @param moveY
|
||||
* @param radius 点bitmap的半径
|
||||
* @return 布尔型
|
||||
*/
|
||||
public boolean isWith(Point a, float moveX, float moveY, float radius) {
|
||||
float result = (float) Math.sqrt((a.getX() - moveX)
|
||||
* (a.getX() - moveX) + (a.getY() - moveY)
|
||||
* (a.getY() - moveY));
|
||||
if (result < 5 * radius / 4) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.example.administrator.myapplication.widget.patternlock;
|
||||
|
||||
public class RotateDegrees {
|
||||
|
||||
public static float getDegrees(Point a, Point b) {
|
||||
float degrees = 0;
|
||||
float ax = a.getX();
|
||||
float ay = a.getY();
|
||||
float bx = b.getX();
|
||||
float by = b.getY();
|
||||
|
||||
if (ax == bx) {
|
||||
if (by > ay) {
|
||||
degrees = 90;
|
||||
} else {
|
||||
degrees = 270;
|
||||
}
|
||||
} else if (by == ay) {
|
||||
if (ax > bx) {
|
||||
degrees = 180;
|
||||
} else {
|
||||
degrees = 0;
|
||||
}
|
||||
} else {
|
||||
if (ax > bx) {
|
||||
if (ay > by) { // 第三象限
|
||||
degrees = 180 + (float) (Math.atan2(ay - by, ax - bx) * 180 / Math.PI);
|
||||
} else { // 第二象限
|
||||
degrees = 180 - (float) (Math.atan2(by - ay, ax - bx) * 180 / Math.PI);
|
||||
}
|
||||
} else {
|
||||
if (ay > by) { // 第四象限
|
||||
degrees = 360 - (float) (Math.atan2(ay - by, bx - ax) * 180 / Math.PI);
|
||||
} else { // 第一象限
|
||||
degrees = (float) (Math.atan2(by - ay, bx - ax) * 180 / Math.PI);
|
||||
}
|
||||
}
|
||||
}
|
||||
return degrees;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<scale
|
||||
android:fromXScale="0.3" android:toXScale="1.0"
|
||||
android:fromYScale="0.3" android:toYScale="1.0"
|
||||
android:pivotX="50%" android:pivotY="100%"
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
/>
|
||||
<alpha
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:fromAlpha="0.0" android:toAlpha="1.0"
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
/>
|
||||
</set>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<scale
|
||||
android:fromXScale="1.0" android:toXScale="0.3"
|
||||
android:fromYScale="1.0" android:toYScale="0.3"
|
||||
android:pivotX="50%" android:pivotY="100%"
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
/>
|
||||
<alpha
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:fromAlpha="1.0" android:toAlpha="0.0"
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
/>
|
||||
</set>
|
After Width: | Height: | Size: 321 B |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 2.6 KiB |
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#3F51B5" />
|
||||
</shape>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#FF5722" />
|
||||
</shape>
|
After Width: | Height: | Size: 2.6 KiB |
|
@ -0,0 +1,12 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z" />
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
|
||||
</vector>
|
After Width: | Height: | Size: 528 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 288 B |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#B6B6B6" />
|
||||
<size android:height="1px" />
|
||||
</shape>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
</shape>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:radius="5dp"
|
||||
/>
|
||||
<solid
|
||||
android:color="@android:color/white"/>
|
||||
</shape>
|
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 240 B |
After Width: | Height: | Size: 89 B |
After Width: | Height: | Size: 288 B |
After Width: | Height: | Size: 285 B |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/btn_login_n" android:state_pressed="false"/>
|
||||
<item android:drawable="@drawable/btn_login_p" android:state_pressed="true"/>
|
||||
|
||||
</selector>
|
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 488 B |
After Width: | Height: | Size: 628 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 763 B |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 90 B |