├── .gitignore ├── DaoGenerator ├── .classpath ├── .freemarker-ide.xml ├── .gitignore ├── .project ├── .settings │ ├── gradle │ │ ├── org.springsource.ide.eclipse.gradle.core.prefs │ │ └── org.springsource.ide.eclipse.gradle.refresh.prefs │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.groovy.core.prefs ├── bin │ ├── content-provider.ftl │ ├── dao-deep.ftl │ ├── dao-master.ftl │ ├── dao-session.ftl │ ├── dao-unit-test.ftl │ ├── dao.ftl │ ├── de │ │ └── greenrobot │ │ │ └── daogenerator │ │ │ ├── ContentProvider.class │ │ │ ├── DaoGenerator.class │ │ │ ├── DaoUtil.class │ │ │ ├── Entity.class │ │ │ ├── Index.class │ │ │ ├── Property$PropertyBuilder.class │ │ │ ├── Property.class │ │ │ ├── PropertyOrderList.class │ │ │ ├── PropertyType.class │ │ │ ├── Query.class │ │ │ ├── QueryParam.class │ │ │ ├── Schema.class │ │ │ ├── ToMany.class │ │ │ ├── ToOne.class │ │ │ ├── gentest │ │ │ └── TestDaoGenerator.class │ │ │ └── test │ │ │ └── SimpleDaoGeneratorTest.class │ ├── entity.ftl │ └── gentest │ │ └── ExampleDaoGenerator.class ├── build.gradle ├── freemarker.jar ├── java-formater.xml ├── mybuild.xml ├── performance │ ├── galaxy-nexus.xlsx │ └── performance-data.xlsx ├── settings.gradle ├── src-generator-testentities │ └── de │ │ └── greenrobot │ │ └── daogenerator │ │ └── gentest │ │ └── TestDaoGenerator.java ├── src-template │ ├── content-provider.ftl │ ├── dao-deep.ftl │ ├── dao-master.ftl │ ├── dao-session.ftl │ ├── dao-unit-test.ftl │ ├── dao.ftl │ └── entity.ftl ├── src-test │ └── de │ │ └── greenrobot │ │ └── daogenerator │ │ └── test │ │ └── SimpleDaoGeneratorTest.java └── src │ ├── de │ └── greenrobot │ │ └── daogenerator │ │ ├── ContentProvider.java │ │ ├── DaoGenerator.java │ │ ├── DaoUtil.java │ │ ├── Entity.java │ │ ├── Index.java │ │ ├── Property.java │ │ ├── PropertyOrderList.java │ │ ├── PropertyType.java │ │ ├── Query.java │ │ ├── QueryParam.java │ │ ├── Schema.java │ │ ├── ToMany.java │ │ └── ToOne.java │ └── gentest │ ├── ExampleDaoGenerator.java │ ├── LianrenDaoGenerator.java │ ├── O2MallDaoGenerator.java │ └── quLoveDaoGenerator.java ├── One开发框架.ppt ├── README.md └── studioOne ├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml └── runConfigurations.xml ├── androidOne ├── build.gradle ├── libs │ ├── alipaysdk.jar │ ├── alipaysecsdk.jar │ ├── alipayutdid.jar │ ├── butterknife-6.1.0.jar │ ├── date4j.jar │ ├── google-zxing.jar │ └── libammsdk.jar ├── local.properties └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── chinese.db │ ├── config.properties │ ├── mutil_pinyin.db │ ├── pinyin.db │ └── sentitive.txt │ ├── java │ └── com │ │ └── sd │ │ └── one │ │ ├── activity │ │ ├── BaseActivity.java │ │ ├── BaseApplication.java │ │ ├── BaseFragment.java │ │ ├── GuideActivity.java │ │ ├── MainActivity.java │ │ ├── SplashActivity.java │ │ ├── adapter │ │ │ ├── BaseAdapter.java │ │ │ ├── PagerFragmentAdapter.java │ │ │ └── ViewPagerAdapter.java │ │ ├── cart │ │ │ └── CartActivity.java │ │ ├── category │ │ │ └── CategoryActivity.java │ │ ├── collection │ │ │ └── CollectionActivity.java │ │ ├── home │ │ │ └── HomeActivity.java │ │ └── more │ │ │ └── MoerActivity.java │ │ ├── common │ │ ├── Constants.java │ │ ├── async │ │ │ ├── AsyncRequest.java │ │ │ ├── AsyncResult.java │ │ │ ├── AsyncTaskManager.java │ │ │ ├── HttpException.java │ │ │ └── OnDataListener.java │ │ ├── manager │ │ │ ├── ActivityPageManager.java │ │ │ ├── CacheManager.java │ │ │ ├── LruCacheManager.java │ │ │ └── PreferencesManager.java │ │ ├── okhttp │ │ │ ├── CookieJarImpl.java │ │ │ ├── CookieStore.java │ │ │ ├── HttpsUtils.java │ │ │ ├── OkHttpUtils.java │ │ │ ├── PersistentCookieStore.java │ │ │ ├── RequestInterceptor.java │ │ │ ├── RequestParams.java │ │ │ └── SerializableHttpCookie.java │ │ └── parse │ │ │ ├── JsonMananger.java │ │ │ ├── SoapManager.java │ │ │ └── XmlMananger.java │ │ ├── model │ │ ├── base │ │ │ ├── BaseModel.java │ │ │ └── BaseResponse.java │ │ └── response │ │ │ └── ConfigData.java │ │ ├── service │ │ ├── ApiService.java │ │ ├── RetrofitAction.java │ │ └── RetrofitManager.java │ │ ├── utils │ │ ├── BitmapUtils.java │ │ ├── CommonUtils.java │ │ ├── DateStyle.java │ │ ├── DateUtils.java │ │ ├── FileUtils.java │ │ ├── NLog.java │ │ ├── NToast.java │ │ ├── StringUtils.java │ │ ├── VersionUpdateService.java │ │ ├── db │ │ │ ├── DBManager.java │ │ │ ├── entity │ │ │ │ ├── Address.java │ │ │ │ ├── Customer.java │ │ │ │ ├── Order.java │ │ │ │ ├── Product.java │ │ │ │ └── Purchase.java │ │ │ └── gen │ │ │ │ ├── AddressDao.java │ │ │ │ ├── CustomerDao.java │ │ │ │ ├── DaoMaster.java │ │ │ │ ├── DaoSession.java │ │ │ │ ├── OrderDao.java │ │ │ │ ├── ProductDao.java │ │ │ │ └── PurchaseDao.java │ │ ├── encrypt │ │ │ ├── AESType.java │ │ │ ├── AESUtils.java │ │ │ ├── BackAES.java │ │ │ ├── Base64.java │ │ │ ├── Base64InputStream.java │ │ │ ├── Base64OutputStream.java │ │ │ ├── MD5.java │ │ │ └── Shared.java │ │ ├── jpinyin │ │ │ ├── ChineseHelper.java │ │ │ ├── PinyinException.java │ │ │ ├── PinyinFormat.java │ │ │ ├── PinyinHelper.java │ │ │ └── PinyinResource.java │ │ ├── pay │ │ │ ├── Base64.java │ │ │ ├── PayListener.java │ │ │ ├── PayUtils.java │ │ │ └── PayUtils1.java │ │ ├── photo │ │ │ ├── PhotoParams.java │ │ │ └── PhotoUtils.java │ │ └── sensitive │ │ │ ├── SensitiveWordInit.java │ │ │ └── SensitivewordFilter.java │ │ ├── widget │ │ ├── ClearEditText.java │ │ ├── CompaScrollerListView.java │ │ ├── NoScrollGridView.java │ │ ├── NoScrollerListView.java │ │ ├── PagerSlidingTabStrip.java │ │ ├── dialog │ │ │ ├── BaseDialog.java │ │ │ ├── BottomMenuDialog.java │ │ │ ├── CommonDialog.java │ │ │ ├── DragListViewDialog.java │ │ │ ├── LoadDialog.java │ │ │ ├── MenuDialog.java │ │ │ └── MessageDialog.java │ │ ├── downtime │ │ │ ├── DownTimer.java │ │ │ └── DownTimerListener.java │ │ ├── draglistview │ │ │ ├── DragSortController.java │ │ │ ├── DragSortCursorAdapter.java │ │ │ ├── DragSortItemView.java │ │ │ ├── DragSortItemViewCheckable.java │ │ │ ├── DragSortListView.java │ │ │ ├── ResourceDragSortCursorAdapter.java │ │ │ ├── SimpleDragSortCursorAdapter.java │ │ │ └── SimpleFloatViewManager.java │ │ ├── sortlistview │ │ │ ├── CharacterParser.java │ │ │ ├── PinyinComparator.java │ │ │ ├── SideBar.java │ │ │ └── SortModel.java │ │ ├── swipeListview │ │ │ ├── BaseSwipeListViewListener.java │ │ │ ├── SwipeListView.java │ │ │ ├── SwipeListViewListener.java │ │ │ └── SwipeListViewTouchListener.java │ │ └── wheel │ │ │ ├── ItemsRange.java │ │ │ ├── OnWheelChangedListener.java │ │ │ ├── OnWheelClickedListener.java │ │ │ ├── OnWheelScrollListener.java │ │ │ ├── WheelRecycle.java │ │ │ ├── WheelScroller.java │ │ │ ├── WheelView.java │ │ │ └── adapter │ │ │ ├── AbstractWheelAdapter.java │ │ │ ├── AbstractWheelTextAdapter.java │ │ │ ├── AdapterWheel.java │ │ │ ├── ArrayWheelAdapter.java │ │ │ ├── NumericWheelAdapter.java │ │ │ ├── WheelAdapter.java │ │ │ └── WheelViewAdapter.java │ │ └── wxapi │ │ ├── AppRegister.java │ │ └── WXPayEntryActivity.java │ └── res │ ├── anim │ ├── slide_in_from_bottom.xml │ ├── slide_in_from_top.xml │ ├── slide_out_to_bottom.xml │ └── slide_out_to_top.xml │ ├── drawable-hdpi │ ├── ad.png │ ├── background_item.9.png │ ├── drag.9.png │ ├── drag_delete_x.png │ ├── drag_icon.9.png │ ├── drawer_menu.png │ ├── drawer_shadow.9.png │ ├── guidepage_1.jpg │ ├── guidepage_2.jpg │ ├── guidepage_3.jpg │ ├── guidepage_4.jpg │ ├── ic_launcher.png │ ├── page_indicator.png │ ├── page_indicator_focused.png │ ├── pulltorefresh_default_flip.png │ ├── pulltorefresh_default_rotate.png │ ├── pulltorefresh_indicator_arrow.png │ ├── search_clear_pressed.png │ ├── waterfall_arrow.png │ └── waterfall_item_bg.9.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ ├── bottom_bg.png │ ├── btn_cart.png │ ├── btn_cart_press.png │ ├── btn_category.png │ ├── btn_category_press.png │ ├── btn_collection.png │ ├── btn_collection_press.png │ ├── btn_home.png │ ├── btn_home_press.png │ ├── btn_member.png │ ├── btn_member_press.png │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable │ ├── pulltorefresh_bg_bottom.xml │ ├── pulltorefresh_bg_top.xml │ ├── selector_menu_cart.xml │ ├── selector_menu_category.xml │ ├── selector_menu_collection.xml │ ├── selector_menu_home.xml │ ├── selector_menu_member.xml │ ├── selector_menu_txt.xml │ ├── sidebar_background.xml │ ├── slidingtab_background_tab.xml │ ├── wheel_bg.xml │ └── wheel_val.xml │ ├── layout │ ├── cart_layout.xml │ ├── category_layout.xml │ ├── collection_layout.xml │ ├── home_layout.xml │ ├── layout_base.xml │ ├── layout_demo_photo.xml │ ├── layout_dialog.xml │ ├── layout_dialog_bottom.xml │ ├── layout_dialog_drag.xml │ ├── layout_dialog_drag_item.xml │ ├── layout_dialog_loading.xml │ ├── layout_dialog_menu.xml │ ├── layout_dialog_menu_item.xml │ ├── layout_dialog_message.xml │ ├── layout_guide.xml │ ├── layout_guide_item1.xml │ ├── layout_guide_item2.xml │ ├── layout_guide_item3.xml │ ├── layout_guide_item4.xml │ ├── layout_listview_item.xml │ ├── layout_main.xml │ ├── layout_splash.xml │ ├── more_layout.xml │ ├── pay_result.xml │ ├── pulltorefresh_header.xml │ ├── slidingmenu_frame.xml │ └── slidingmenu_main.xml │ ├── menu │ ├── drag_mode_menu.xml │ └── menu.xml │ ├── values-zh │ └── strings.xml │ ├── values │ ├── array.xml │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── drag_strings.xml │ ├── pulltorefresh_strings.xml │ ├── slidingmenu_strings.xml │ ├── slidingtab_strings.xml │ ├── strings.xml │ ├── styles.xml │ └── swipelistview_string.xml │ └── xml │ └── config.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── import-summary.txt └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | studioOne/oneCore/build/ 2 | studioOne/bugtags/build/ 3 | studioOne/androidOne/build/ 4 | -------------------------------------------------------------------------------- /DaoGenerator/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /DaoGenerator/.freemarker-ide.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DaoGenerator/.gitignore: -------------------------------------------------------------------------------- 1 | /test-out 2 | /release 3 | /bin 4 | /gradle.properties 5 | /build 6 | -------------------------------------------------------------------------------- /DaoGenerator/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | DaoGenerator 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.springsource.ide.eclipse.gradle.core.nature 16 | org.eclipse.jdt.core.javanature 17 | org.eclipse.jdt.groovy.core.groovyNature 18 | 19 | 20 | -------------------------------------------------------------------------------- /DaoGenerator/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Sun Feb 24 10:56:04 CET 2013 3 | org.springsource.ide.eclipse.gradle.linkedresources= 4 | org.springsource.ide.eclipse.gradle.rootprojectloc= 5 | -------------------------------------------------------------------------------- /DaoGenerator/.settings/gradle/org.springsource.ide.eclipse.gradle.refresh.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences 2 | #Sun Feb 24 10:56:15 CET 2013 3 | enableDSLD=true 4 | -------------------------------------------------------------------------------- /DaoGenerator/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/gentest/ExampleDaoGenerator.java=UTF-8 3 | encoding/=Cp1252 4 | -------------------------------------------------------------------------------- /DaoGenerator/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Fri Jul 22 21:20:49 CEST 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.6 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.6 13 | -------------------------------------------------------------------------------- /DaoGenerator/.settings/org.eclipse.jdt.groovy.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | groovy.compiler.level=-1 3 | -------------------------------------------------------------------------------- /DaoGenerator/bin/dao-unit-test.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 4 | 5 | This file is part of greenDAO Generator. 6 | 7 | greenDAO Generator is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | greenDAO Generator is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with greenDAO Generator. If not, see . 18 | 19 | --> 20 | package ${entity.javaPackageTest}; 21 | 22 | <#assign isStringPK = entity.pkProperty?? && entity.pkProperty.propertyType == "String" /> 23 | <#if isStringPK> 24 | import de.greenrobot.dao.test.AbstractDaoTestStringPk; 25 | <#else> 26 | import de.greenrobot.dao.test.AbstractDaoTestLongPk; 27 | 28 | 29 | import ${entity.javaPackage}.${entity.className}; 30 | import ${entity.javaPackageDao}.${entity.classNameDao}; 31 | 32 | public class ${entity.classNameTest} extends <#if 33 | isStringPK>AbstractDaoTestStringPk<${entity.classNameDao}, ${entity.className}><#else>AbstractDaoTestLongPk<${entity.classNameDao}, ${entity.className}> { 34 | 35 | public ${entity.classNameTest}() { 36 | super(${entity.classNameDao}.class); 37 | } 38 | 39 | @Override 40 | protected ${entity.className} createEntity(<#if isStringPK>String<#else>Long key) { 41 | ${entity.className} entity = new ${entity.className}(); 42 | <#if entity.pkProperty??> 43 | entity.set${entity.pkProperty.propertyName?cap_first}(key); 44 | 45 | <#list entity.properties as property> 46 | <#if property.notNull> 47 | entity.set${property.propertyName?cap_first}(); 48 | 49 | 50 | return entity; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/ContentProvider.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/ContentProvider.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/DaoGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/DaoGenerator.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/DaoUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/DaoUtil.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/Entity.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/Index.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/Index.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/Property$PropertyBuilder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/Property$PropertyBuilder.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/Property.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/Property.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/PropertyOrderList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/PropertyOrderList.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/PropertyType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/PropertyType.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/Query.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/Query.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/QueryParam.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/QueryParam.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/Schema.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/Schema.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/ToMany.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/ToMany.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/ToOne.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/ToOne.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/gentest/TestDaoGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/gentest/TestDaoGenerator.class -------------------------------------------------------------------------------- /DaoGenerator/bin/de/greenrobot/daogenerator/test/SimpleDaoGeneratorTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/de/greenrobot/daogenerator/test/SimpleDaoGeneratorTest.class -------------------------------------------------------------------------------- /DaoGenerator/bin/gentest/ExampleDaoGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/bin/gentest/ExampleDaoGenerator.class -------------------------------------------------------------------------------- /DaoGenerator/freemarker.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/freemarker.jar -------------------------------------------------------------------------------- /DaoGenerator/performance/galaxy-nexus.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/performance/galaxy-nexus.xlsx -------------------------------------------------------------------------------- /DaoGenerator/performance/performance-data.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/DaoGenerator/performance/performance-data.xlsx -------------------------------------------------------------------------------- /DaoGenerator/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'greendao-generator' -------------------------------------------------------------------------------- /DaoGenerator/src-template/dao-unit-test.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 3 | Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 4 | 5 | This file is part of greenDAO Generator. 6 | 7 | greenDAO Generator is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | greenDAO Generator is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with greenDAO Generator. If not, see . 18 | 19 | --> 20 | package ${entity.javaPackageTest}; 21 | 22 | <#assign isStringPK = entity.pkProperty?? && entity.pkProperty.propertyType == "String" /> 23 | <#if isStringPK> 24 | import de.greenrobot.dao.test.AbstractDaoTestStringPk; 25 | <#else> 26 | import de.greenrobot.dao.test.AbstractDaoTestLongPk; 27 | 28 | 29 | import ${entity.javaPackage}.${entity.className}; 30 | import ${entity.javaPackageDao}.${entity.classNameDao}; 31 | 32 | public class ${entity.classNameTest} extends <#if 33 | isStringPK>AbstractDaoTestStringPk<${entity.classNameDao}, ${entity.className}><#else>AbstractDaoTestLongPk<${entity.classNameDao}, ${entity.className}> { 34 | 35 | public ${entity.classNameTest}() { 36 | super(${entity.classNameDao}.class); 37 | } 38 | 39 | @Override 40 | protected ${entity.className} createEntity(<#if isStringPK>String<#else>Long key) { 41 | ${entity.className} entity = new ${entity.className}(); 42 | <#if entity.pkProperty??> 43 | entity.set${entity.pkProperty.propertyName?cap_first}(key); 44 | 45 | <#list entity.properties as property> 46 | <#if property.notNull> 47 | entity.set${property.propertyName?cap_first}(); 48 | 49 | 50 | return entity; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /DaoGenerator/src-test/de/greenrobot/daogenerator/test/SimpleDaoGeneratorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * This file is part of greenDAO Generator. 5 | * 6 | * greenDAO Generator is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * greenDAO Generator is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with greenDAO Generator. If not, see . 17 | */ 18 | package de.greenrobot.daogenerator.test; 19 | 20 | import static org.junit.Assert.assertEquals; 21 | import static org.junit.Assert.assertFalse; 22 | import static org.junit.Assert.assertTrue; 23 | 24 | import java.io.File; 25 | 26 | import org.junit.Test; 27 | 28 | import de.greenrobot.daogenerator.DaoGenerator; 29 | import de.greenrobot.daogenerator.DaoUtil; 30 | import de.greenrobot.daogenerator.Entity; 31 | import de.greenrobot.daogenerator.Property; 32 | import de.greenrobot.daogenerator.Schema; 33 | 34 | public class SimpleDaoGeneratorTest { 35 | 36 | @Test 37 | public void testMinimalSchema() throws Exception { 38 | Schema schema = new Schema(1, "de.greenrobot.testdao"); 39 | Entity adressTable = schema.addEntity("Adresse"); 40 | Property idProperty = adressTable.addIdProperty().getProperty(); 41 | adressTable.addIntProperty("count").index(); 42 | adressTable.addIntProperty("dummy").notNull(); 43 | assertEquals(1, schema.getEntities().size()); 44 | assertEquals(3, adressTable.getProperties().size()); 45 | 46 | File daoFile = new File("test-out/de/greenrobot/testdao/" + adressTable.getClassName() + "Dao.java"); 47 | daoFile.delete(); 48 | assertFalse(daoFile.exists()); 49 | 50 | new DaoGenerator().generateAll(schema, "test-out"); 51 | 52 | assertEquals("PRIMARY KEY", idProperty.getConstraints()); 53 | assertTrue(daoFile.toString(), daoFile.exists()); 54 | } 55 | 56 | @Test 57 | public void testDbName() { 58 | assertEquals("NORMAL", DaoUtil.dbName("normal")); 59 | assertEquals("NORMAL", DaoUtil.dbName("Normal")); 60 | assertEquals("CAMEL_CASE", DaoUtil.dbName("CamelCase")); 61 | assertEquals("CAMEL_CASE_THREE", DaoUtil.dbName("CamelCaseThree")); 62 | assertEquals("CAMEL_CASE_XXXX", DaoUtil.dbName("CamelCaseXXXX")); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /DaoGenerator/src/de/greenrobot/daogenerator/ContentProvider.java: -------------------------------------------------------------------------------- 1 | package de.greenrobot.daogenerator; 2 | 3 | import java.util.List; 4 | 5 | public class ContentProvider { 6 | private final List entities; 7 | private String authority; 8 | private String basePath; 9 | private String className; 10 | private String javaPackage; 11 | private boolean readOnly; 12 | private Schema schema; 13 | 14 | public ContentProvider(Schema schema, List entities) { 15 | this.schema = schema; 16 | this.entities = entities; 17 | } 18 | 19 | public String getAuthority() { 20 | return authority; 21 | } 22 | 23 | public void setAuthority(String authority) { 24 | this.authority = authority; 25 | } 26 | 27 | public String getBasePath() { 28 | return basePath; 29 | } 30 | 31 | public void setBasePath(String basePath) { 32 | this.basePath = basePath; 33 | } 34 | 35 | public String getClassName() { 36 | return className; 37 | } 38 | 39 | public void setClassName(String className) { 40 | this.className = className; 41 | } 42 | 43 | public String getJavaPackage() { 44 | return javaPackage; 45 | } 46 | 47 | public void setJavaPackage(String javaPackage) { 48 | this.javaPackage = javaPackage; 49 | } 50 | 51 | public boolean isReadOnly() { 52 | return readOnly; 53 | } 54 | 55 | public void readOnly() { 56 | this.readOnly = true; 57 | } 58 | 59 | public List getEntities() { 60 | return entities; 61 | } 62 | 63 | public void init2ndPass() { 64 | if (authority == null) { 65 | authority = schema.getDefaultJavaPackage() + ".provider"; 66 | } 67 | if (basePath == null) { 68 | basePath = ""; 69 | } 70 | if (className == null) { 71 | className = "EntityContentProvider"; 72 | } 73 | if (javaPackage == null) { 74 | javaPackage = schema.getDefaultJavaPackage(); 75 | } 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /DaoGenerator/src/de/greenrobot/daogenerator/Index.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * This file is part of greenDAO Generator. 5 | * 6 | * greenDAO Generator is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * greenDAO Generator is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with greenDAO Generator. If not, see . 17 | */ 18 | package de.greenrobot.daogenerator; 19 | 20 | 21 | public class Index extends PropertyOrderList { 22 | private String name; 23 | private boolean unique; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public Index setName(String name) { 30 | this.name = name; 31 | return this; 32 | } 33 | 34 | public Index makeUnique() { 35 | unique = true; 36 | return this; 37 | } 38 | 39 | public boolean isUnique() { 40 | return unique; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /DaoGenerator/src/de/greenrobot/daogenerator/PropertyOrderList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * This file is part of greenDAO Generator. 5 | * 6 | * greenDAO Generator is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * greenDAO Generator is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with greenDAO Generator. If not, see . 17 | */ 18 | package de.greenrobot.daogenerator; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | public class PropertyOrderList { 24 | private List properties; 25 | private List propertiesOrder; 26 | 27 | public PropertyOrderList() { 28 | properties = new ArrayList(); 29 | propertiesOrder = new ArrayList(); 30 | } 31 | 32 | public void addProperty(Property property) { 33 | properties.add(property); 34 | propertiesOrder.add(null); 35 | } 36 | 37 | public void addPropertyAsc(Property property) { 38 | properties.add(property); 39 | propertiesOrder.add("ASC"); 40 | } 41 | 42 | public void addPropertyDesc(Property property) { 43 | properties.add(property); 44 | propertiesOrder.add("DESC"); 45 | } 46 | 47 | public void addOrderRaw(String order) { 48 | properties.add(null); 49 | propertiesOrder.add(order); 50 | } 51 | 52 | public List getProperties() { 53 | return properties; 54 | } 55 | 56 | List getPropertiesOrder() { 57 | return propertiesOrder; 58 | } 59 | 60 | public String getCommaSeparatedString() { 61 | StringBuilder builder = new StringBuilder(); 62 | int size = properties.size(); 63 | for (int i = 0; i < size; i++) { 64 | Property property = properties.get(i); 65 | String order = propertiesOrder.get(i); 66 | if (property != null) { 67 | builder.append(property.getColumnName()).append(' '); 68 | } 69 | if (order != null) { 70 | builder.append(order); 71 | } 72 | if (i < size - 1) { 73 | builder.append(','); 74 | } 75 | } 76 | return builder.toString(); 77 | } 78 | 79 | public boolean isEmpty() { 80 | return properties.isEmpty(); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /DaoGenerator/src/de/greenrobot/daogenerator/PropertyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * This file is part of greenDAO Generator. 5 | * 6 | * greenDAO Generator is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * greenDAO Generator is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with greenDAO Generator. If not, see . 17 | */ 18 | package de.greenrobot.daogenerator; 19 | 20 | /** 21 | * Currently available types for properties. 22 | * 23 | * @author Markus 24 | */ 25 | public enum PropertyType { 26 | Byte, Short, Int, Long, Boolean, Float, Double, String, ByteArray, Date 27 | } 28 | -------------------------------------------------------------------------------- /DaoGenerator/src/de/greenrobot/daogenerator/Query.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * This file is part of greenDAO Generator. 5 | * 6 | * greenDAO Generator is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * greenDAO Generator is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with greenDAO Generator. If not, see . 17 | */ 18 | package de.greenrobot.daogenerator; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** NOT IMPLEMENTED YET. Check back later. */ 24 | public class Query { 25 | @SuppressWarnings("unused") 26 | private String name; 27 | private List parameters; 28 | @SuppressWarnings("unused") 29 | private boolean distinct; 30 | 31 | public Query(String name) { 32 | this.name = name; 33 | parameters= new ArrayList(); 34 | } 35 | 36 | public QueryParam addEqualsParam(Property column) { 37 | return addParam(column, "="); 38 | } 39 | 40 | public QueryParam addParam(Property column, String operator) { 41 | QueryParam queryParam = new QueryParam(column, operator); 42 | parameters.add(queryParam); 43 | return queryParam; 44 | } 45 | 46 | public void distinct() { 47 | distinct = true; 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /DaoGenerator/src/de/greenrobot/daogenerator/QueryParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * This file is part of greenDAO Generator. 5 | * 6 | * greenDAO Generator is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * greenDAO Generator is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with greenDAO Generator. If not, see . 17 | */ 18 | package de.greenrobot.daogenerator; 19 | 20 | /** NOT IMPLEMENTED YET. Check back later. */ 21 | public class QueryParam { 22 | private Property column; 23 | private String operator; 24 | 25 | public QueryParam(Property column, String operator) { 26 | this.column = column; 27 | this.operator = operator; 28 | } 29 | 30 | public Property getColumn() { 31 | return column; 32 | } 33 | 34 | public String getOperator() { 35 | return operator; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /DaoGenerator/src/gentest/LianrenDaoGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gentest; 17 | 18 | import de.greenrobot.daogenerator.DaoGenerator; 19 | import de.greenrobot.daogenerator.Entity; 20 | import de.greenrobot.daogenerator.Schema; 21 | 22 | /** 23 | * Generates entities and DAOs for the example project DaoExample. 24 | * 25 | * Run it as a Java application (not Android). 26 | * 27 | * @author Markus 28 | */ 29 | public class LianrenDaoGenerator { 30 | 31 | public static void main(String[] args) throws Exception { 32 | // com.shengdao.demo.utils.db是生成的类package的值 33 | Schema schema = new Schema(3, "com.shengdao.lianren.utils.db"); 34 | 35 | // 添加Note对象的Schema,会生成针对Note的数据库相关代码 36 | addFriend(schema); 37 | 38 | addNotice(schema); 39 | 40 | // C://Users/huxinwu/Desktop/demo 41 | // 该地址是生成的代码存放地址,相对地址不好写就写绝对地址,生成后直接拷贝到对应的地址(com.shengdao.demo.utils.db)下面 42 | new DaoGenerator().generateAll(schema, "C://Users/huxinwu/Desktop/demo"); 43 | } 44 | 45 | /** 46 | * @param schema 47 | */ 48 | private static void addFriend(Schema schema) { 49 | Entity note = schema.addEntity("Friend"); 50 | note.addStringProperty("userId").notNull().primaryKey(); 51 | note.addStringProperty("name"); 52 | note.addStringProperty("portraitUri"); 53 | } 54 | 55 | /** 56 | * @param schema 57 | */ 58 | private static void addNotice(Schema schema) { 59 | Entity note = schema.addEntity("Notice"); 60 | note.addIdProperty().autoincrement().primaryKey(); 61 | note.addStringProperty("pushContent"); 62 | note.addStringProperty("targetid"); 63 | note.addStringProperty("time"); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /DaoGenerator/src/gentest/O2MallDaoGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Markus Junginger, greenrobot (http://greenrobot.de) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gentest; 17 | 18 | import de.greenrobot.daogenerator.DaoGenerator; 19 | import de.greenrobot.daogenerator.Entity; 20 | import de.greenrobot.daogenerator.Schema; 21 | 22 | /** 23 | * Generates entities and DAOs for the example project DaoExample. 24 | * 25 | * Run it as a Java application (not Android). 26 | * 27 | * @author Markus 28 | */ 29 | public class O2MallDaoGenerator { 30 | 31 | public static void main(String[] args) throws Exception { 32 | //com.shengdao.demo.utils.db是生成的类package的值 33 | Schema schema = new Schema(3, "com.suneee.o2mall.utils.db"); 34 | 35 | //添加Note对象的Schema,会生成针对Note的数据库相关代码 36 | addNote(schema); 37 | 38 | //C://Users/huxinwu/Desktop/demo 该地址是生成的代码存放地址,相对地址不好写就写绝对地址,生成后直接拷贝到对应的地址(com.shengdao.demo.utils.db)下面 39 | new DaoGenerator().generateAll(schema, "C://Users/huxinwu/Desktop/demo"); 40 | } 41 | 42 | /** 43 | * @param schema 44 | */ 45 | private static void addNote(Schema schema) { 46 | Entity note = schema.addEntity("ImageInfo"); 47 | note.addStringProperty("id").primaryKey().notNull(); 48 | note.addStringProperty("url"); 49 | 50 | note = schema.addEntity("GoodsInfo"); 51 | note.addIdProperty().autoincrement().primaryKey(); 52 | note.addStringProperty("goods_image"); 53 | note.addStringProperty("goods_id"); 54 | note.addStringProperty("goods_serial"); 55 | note.addStringProperty("goods_name"); 56 | note.addStringProperty("brand_name"); 57 | note.addStringProperty("spec_id"); 58 | note.addStringProperty("spec_goods_storage"); 59 | note.addStringProperty("goods_store_price"); 60 | note.addStringProperty("goods_store_saleprice"); 61 | note.addStringProperty("goods_state"); 62 | note.addStringProperty("item_score"); 63 | note.addStringProperty("buynum"); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /One开发框架.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/One开发框架.ppt -------------------------------------------------------------------------------- /studioOne/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /studioOne/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /studioOne/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /studioOne/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /studioOne/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /studioOne/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.8 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /studioOne/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /studioOne/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /studioOne/androidOne/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'org.greenrobot.greendao' 3 | 4 | android { 5 | compileSdkVersion 25 6 | buildToolsVersion "25.0.2" 7 | 8 | defaultConfig { 9 | applicationId "com.sd.one" 10 | minSdkVersion 14 11 | targetSdkVersion 22 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 18 | } 19 | } 20 | } 21 | 22 | 23 | greendao { 24 | schemaVersion 1 25 | daoPackage 'com.sd.one.utils.db.gen' 26 | targetGenDir 'src/main/java' 27 | } 28 | 29 | dependencies { 30 | compile fileTree(dir: 'libs', include: ['*.jar']) 31 | 32 | compile 'com.alibaba:fastjson:1.1.62.android' 33 | compile 'org.greenrobot:eventbus:3.0.0' 34 | compile 'com.jakewharton:butterknife:7.0.1' 35 | compile 'com.squareup.okhttp3:okhttp:3.6.0' 36 | compile 'com.squareup.okhttp3:logging-interceptor:3.6.0' 37 | 38 | compile 'com.squareup.retrofit2:retrofit:2.1.0' 39 | compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' 40 | compile 'org.ligboy.retrofit2:converter-fastjson:2.0.2' 41 | compile 'io.reactivex:rxandroid:1.2.1' 42 | 43 | compile 'com.pnikosis:materialish-progress:1.7' 44 | compile 'com.github.bumptech.glide:glide:3.7.0' 45 | compile 'com.nineoldandroids:library:2.4.0' 46 | compile 'com.android.support:appcompat-v7:25.3.1' 47 | 48 | compile'org.greenrobot:greendao:3.0.1' 49 | compile'org.greenrobot:greendao-generator:3.0.0' 50 | } 51 | -------------------------------------------------------------------------------- /studioOne/androidOne/libs/alipaysdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/alipaysdk.jar -------------------------------------------------------------------------------- /studioOne/androidOne/libs/alipaysecsdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/alipaysecsdk.jar -------------------------------------------------------------------------------- /studioOne/androidOne/libs/alipayutdid.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/alipayutdid.jar -------------------------------------------------------------------------------- /studioOne/androidOne/libs/butterknife-6.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/butterknife-6.1.0.jar -------------------------------------------------------------------------------- /studioOne/androidOne/libs/date4j.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/date4j.jar -------------------------------------------------------------------------------- /studioOne/androidOne/libs/google-zxing.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/google-zxing.jar -------------------------------------------------------------------------------- /studioOne/androidOne/libs/libammsdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/libs/libammsdk.jar -------------------------------------------------------------------------------- /studioOne/androidOne/local.properties: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | #Mon Mar 20 17:59:06 CST 2017 11 | sdk.dir=/Users/devin/Library/Android/sdk 12 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/assets/config.properties: -------------------------------------------------------------------------------- 1 | #is debug mode, if debug is true that log is open, if debug is false that log is close. 2 | debug=true -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/assets/pinyin.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/assets/pinyin.db -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/BaseApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, BaseApplication 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity; 7 | 8 | import android.app.Application; 9 | import android.text.TextUtils; 10 | import com.sd.one.utils.CommonUtils; 11 | import com.sd.one.utils.NLog; 12 | 13 | /** 14 | * [系统Application类,设置全局变量以及初始化组件] 15 | * 16 | * @author devin.hu 17 | * @version 1.0 18 | * @date 2013-9-17 19 | **/ 20 | public class BaseApplication extends Application { 21 | 22 | private final String tag = BaseApplication.class.getSimpleName(); 23 | 24 | 25 | @Override 26 | public void onCreate() { 27 | init(); 28 | } 29 | 30 | /** 31 | * 初始化 32 | */ 33 | private void init() { 34 | //初始化debug模式 35 | String flag = CommonUtils.getProperty(getApplicationContext(), "debug"); 36 | if (!TextUtils.isEmpty(flag)) { 37 | Boolean isDebug = Boolean.parseBoolean(flag); 38 | NLog.setDebug(isDebug); 39 | NLog.e(tag, "isDebug: " + isDebug); 40 | } 41 | 42 | // IMSSdk 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/adapter/BaseAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, BaseAdapter 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.adapter; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collection; 10 | import java.util.List; 11 | import android.content.Context; 12 | import android.view.LayoutInflater; 13 | 14 | /** 15 | * [适配器基类] 16 | * 17 | * @author huxinwu 18 | * @version 1.0 19 | * @date 2014-10-30 20 | * 21 | **/ 22 | public abstract class BaseAdapter extends android.widget.BaseAdapter { 23 | 24 | protected List dataSet; 25 | protected Context mContext; 26 | protected LayoutInflater mInflater; 27 | 28 | @SuppressWarnings({ "unchecked", "rawtypes" }) 29 | public BaseAdapter(Context context) { 30 | this(context, new ArrayList()); 31 | } 32 | 33 | public BaseAdapter(Context context, List data) { 34 | this.mContext = context; 35 | this.dataSet = data; 36 | mInflater = LayoutInflater.from(mContext); 37 | } 38 | 39 | public Context getContext() { 40 | return this.mContext; 41 | } 42 | 43 | public void addData(T data) { 44 | this.dataSet.add(data); 45 | } 46 | 47 | public void addData(Collection data) { 48 | this.dataSet.addAll(data); 49 | } 50 | 51 | public void addData(int index, Collection data) { 52 | this.dataSet.addAll(index, data); 53 | } 54 | 55 | public void removeData(Collection data) { 56 | this.dataSet.removeAll(data); 57 | } 58 | 59 | public void removeAll() { 60 | this.dataSet.clear(); 61 | } 62 | 63 | public void remove(T data) { 64 | this.dataSet.remove(data); 65 | } 66 | 67 | public void remove(int position) { 68 | this.dataSet.remove(position); 69 | } 70 | 71 | public List subData(int index, int count) { 72 | return this.dataSet.subList(index, index + count); 73 | } 74 | 75 | @Override 76 | public int getCount() { 77 | return this.dataSet.size(); 78 | } 79 | 80 | @Override 81 | public T getItem(int position) { 82 | return this.dataSet.get(position); 83 | } 84 | 85 | @Override 86 | public long getItemId(int position) { 87 | return 0L; 88 | } 89 | 90 | public void setItem(int position, T obj) { 91 | this.dataSet.set(position, obj); 92 | } 93 | 94 | public void addItem(int position, T obj) { 95 | this.dataSet.add(position, obj); 96 | } 97 | 98 | public void addItems(int position, Collection data) { 99 | this.dataSet.addAll(position, data); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/adapter/PagerFragmentAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, PagerFragmentAdapter 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.adapter; 7 | 8 | import java.util.List; 9 | 10 | import android.support.v4.app.Fragment; 11 | import android.support.v4.app.FragmentManager; 12 | import android.support.v4.app.FragmentPagerAdapter; 13 | 14 | /** 15 | * [FragmentPager适配器] 16 | * 17 | * @author huxinwu 18 | * @version 1.0 19 | * @date 2014-10-27 20 | * 21 | **/ 22 | public class PagerFragmentAdapter extends FragmentPagerAdapter { 23 | 24 | private List titles; 25 | private List fragments; 26 | 27 | public PagerFragmentAdapter(FragmentManager fm) { 28 | super(fm); 29 | } 30 | 31 | public CharSequence getPageTitle(int position) { 32 | return titles.get(position); 33 | } 34 | 35 | @Override 36 | public int getCount() { 37 | return fragments.size(); 38 | } 39 | 40 | public List getTitles() { 41 | return titles; 42 | } 43 | 44 | public void setTitles(List titles) { 45 | this.titles = titles; 46 | } 47 | 48 | public List getFragments() { 49 | return fragments; 50 | } 51 | 52 | public void setFragments(List fragments) { 53 | this.fragments = fragments; 54 | } 55 | 56 | @Override 57 | public Fragment getItem(int position) { 58 | return fragments.get(position); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/adapter/ViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, ViewPagerAdapter 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.adapter; 7 | 8 | import java.util.ArrayList; 9 | 10 | import android.os.Parcelable; 11 | import android.support.v4.view.PagerAdapter; 12 | import android.support.v4.view.ViewPager; 13 | import android.view.View; 14 | 15 | /** 16 | * [A brief description] 17 | * 18 | * @author huxinwu 19 | * @version 1.0 20 | * @date 2014-11-6 21 | * 22 | **/ 23 | public class ViewPagerAdapter extends PagerAdapter { 24 | 25 | private ArrayList pageViews; 26 | 27 | /** 28 | * @param pageViews 29 | */ 30 | public ViewPagerAdapter(ArrayList pageViews) { 31 | this.pageViews = pageViews; 32 | } 33 | 34 | @Override 35 | public int getCount() { 36 | return pageViews.size(); 37 | } 38 | 39 | @Override 40 | public boolean isViewFromObject(View arg0, Object arg1) { 41 | return arg0 == arg1; 42 | } 43 | 44 | @Override 45 | public int getItemPosition(Object object) { 46 | return super.getItemPosition(object); 47 | } 48 | 49 | @Override 50 | public void destroyItem(View arg0, int arg1, Object arg2) { 51 | ((ViewPager) arg0).removeView(pageViews.get(arg1)); 52 | } 53 | 54 | @Override 55 | public Object instantiateItem(View arg0, int arg1) { 56 | ((ViewPager) arg0).addView(pageViews.get(arg1)); 57 | return pageViews.get(arg1); 58 | } 59 | 60 | @Override 61 | public void restoreState(Parcelable arg0, ClassLoader arg1) { 62 | 63 | } 64 | 65 | @Override 66 | public Parcelable saveState() { 67 | return null; 68 | } 69 | 70 | @Override 71 | public void startUpdate(View arg0) { 72 | 73 | } 74 | 75 | @Override 76 | public void finishUpdate(View arg0) { 77 | 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/cart/CartActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, CartActivity 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.cart; 7 | 8 | import android.os.Bundle; 9 | import android.view.KeyEvent; 10 | 11 | import com.sd.one.R; 12 | import com.sd.one.activity.BaseActivity; 13 | 14 | /** 15 | * [A brief description] 16 | * 17 | * @author huxinwu 18 | * @version 1.0 19 | * @date 2014-11-6 20 | * 21 | * 22 | * 23 | * 24 | * 25 | * 26 | **/ 27 | public class CartActivity extends BaseActivity { 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | setContentView(R.layout.category_layout); 33 | } 34 | 35 | @Override 36 | public boolean onKeyDown(int keyCode, KeyEvent event) { 37 | return getParent().onKeyDown(keyCode, event); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/category/CategoryActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, CategoryActivity 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.category; 7 | 8 | import android.os.Bundle; 9 | import android.view.KeyEvent; 10 | 11 | import com.sd.one.R; 12 | import com.sd.one.activity.BaseActivity; 13 | 14 | /** 15 | * [A brief description] 16 | * 17 | * @author huxinwu 18 | * @version 1.0 19 | * @date 2014-11-6 20 | * 21 | **/ 22 | public class CategoryActivity extends BaseActivity { 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.more_layout); 28 | } 29 | 30 | @Override 31 | public boolean onKeyDown(int keyCode, KeyEvent event) { 32 | return getParent().onKeyDown(keyCode, event); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/collection/CollectionActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, CollectionActivity 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.collection; 7 | 8 | import android.os.Bundle; 9 | import android.view.KeyEvent; 10 | 11 | import com.sd.one.R; 12 | import com.sd.one.activity.BaseActivity; 13 | 14 | /** 15 | * [A brief description] 16 | * 17 | * @author huxinwu 18 | * @version 1.0 19 | * @date 2014-11-6 20 | * 21 | **/ 22 | public class CollectionActivity extends BaseActivity { 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.collection_layout); 28 | } 29 | 30 | @Override 31 | public boolean onKeyDown(int keyCode, KeyEvent event) { 32 | return getParent().onKeyDown(keyCode, event); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/home/HomeActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, HomeActivity 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.home; 7 | 8 | import android.os.Bundle; 9 | import android.view.KeyEvent; 10 | import android.view.View; 11 | import android.view.View.OnClickListener; 12 | 13 | import com.sd.one.R; 14 | import com.sd.one.activity.BaseActivity; 15 | import com.sd.one.widget.dialog.LoadDialog; 16 | 17 | /** 18 | * [A brief description] 19 | * 20 | * @author huxinwu 21 | * @version 1.0 22 | * @date 2014-11-6 23 | * 24 | **/ 25 | public class HomeActivity extends BaseActivity implements OnClickListener{ 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.home_layout); 31 | LoadDialog.show(mContext); 32 | } 33 | 34 | @Override 35 | public boolean onKeyDown(int keyCode, KeyEvent event) { 36 | return getParent().onKeyDown(keyCode, event); 37 | } 38 | 39 | @Override 40 | public void onClick(View v) { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/activity/more/MoerActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, MoerActivity 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.activity.more; 7 | 8 | import android.os.Bundle; 9 | import android.view.KeyEvent; 10 | 11 | import com.sd.one.R; 12 | import com.sd.one.activity.BaseActivity; 13 | 14 | /** 15 | * [更多页面] 16 | * 17 | * @author huxinwu 18 | * @version 1.0 19 | * @date 2014-11-6 20 | * 21 | **/ 22 | public class MoerActivity extends BaseActivity { 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.more_layout); 28 | } 29 | 30 | @Override 31 | public boolean onKeyDown(int keyCode, KeyEvent event) { 32 | return getParent().onKeyDown(keyCode, event); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, Constants 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.common; 7 | 8 | /** 9 | * [A brief description] 10 | * 11 | * @author huxinwu 12 | * @version 1.0 13 | * @date 2014-11-6 14 | * 15 | **/ 16 | public class Constants { 17 | 18 | /** 是否第一次运行 **/ 19 | public static final String IS_FIRST_RUN = "isFirstRun"; 20 | 21 | /** 数据库名称 **/ 22 | public static final String DB_NAME = "demo_db"; 23 | 24 | //系统参数 25 | public static final String APP_ID = "iPhone_Android"; 26 | public static final String CERTI_ID = "2356221002"; 27 | public static final String VERSION = "1.0"; 28 | public static final String TOKEN = "4d01a4c48ffaa2114c5c3745e6edfd3b2fbbade6d43c219298af6386169e0a47"; 29 | 30 | public static final String WEIXIN_APP_ID = "wxb4754ef83e822c2b"; 31 | public static final String DOMAIN = "https://www.qulover.com/"; 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/async/AsyncRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, DownLoad 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.common.async; 7 | 8 | /** 9 | * [A brief description] 10 | * 11 | * @author devin.hu 12 | * @version 1.0 13 | * @date 2013-9-29 14 | * 15 | **/ 16 | public class AsyncRequest { 17 | 18 | /** 19 | * 请求id 20 | */ 21 | private int requestCode; 22 | /** 23 | * 是否检查网络,true表示检查,false表示不检查 24 | */ 25 | private boolean isCheckNetwork; 26 | /** 27 | * 处理监听 28 | */ 29 | private OnDataListener listener; 30 | 31 | public AsyncRequest() { 32 | super(); 33 | } 34 | 35 | public AsyncRequest(int requestCode, boolean isCheckNetwork, OnDataListener listener) { 36 | this.requestCode = requestCode; 37 | this.isCheckNetwork = isCheckNetwork; 38 | this.listener = listener; 39 | } 40 | 41 | public int getRequestCode() { 42 | return requestCode; 43 | } 44 | 45 | public void setRequestCode(int requestCode) { 46 | this.requestCode = requestCode; 47 | } 48 | 49 | public boolean isCheckNetwork() { 50 | return isCheckNetwork; 51 | } 52 | 53 | public void setCheckNetwork(boolean isCheckNetwork) { 54 | this.isCheckNetwork = isCheckNetwork; 55 | } 56 | 57 | public OnDataListener getListener() { 58 | return listener; 59 | } 60 | 61 | public void setListener(OnDataListener listener) { 62 | this.listener = listener; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/async/AsyncResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, DownLoad 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.common.async; 7 | 8 | /** 9 | * [A brief description] 10 | * 11 | * @author devin.hu 12 | * @version 1.0 13 | * @date 2013-9-29 14 | * 15 | **/ 16 | public class AsyncResult { 17 | 18 | /** 19 | * 请求id 20 | */ 21 | private int requestCode; 22 | /** 23 | * 是否检查网络,true表示检查,false表示不检查 24 | */ 25 | private boolean isCheckNetwork; 26 | /** 27 | * 下载状态 28 | */ 29 | private int state; 30 | /** 31 | * 返回结果 32 | */ 33 | private Object result; 34 | /** 35 | * 处理监听 36 | */ 37 | private OnDataListener listener; 38 | 39 | public AsyncResult() { 40 | super(); 41 | } 42 | 43 | 44 | public AsyncResult(int requestCode, boolean isCheckNetwork, OnDataListener listener) { 45 | this.requestCode = requestCode; 46 | this.isCheckNetwork = isCheckNetwork; 47 | this.listener = listener; 48 | } 49 | 50 | public int getRequestCode() { 51 | return requestCode; 52 | } 53 | 54 | public void setRequestCode(int requestCode) { 55 | this.requestCode = requestCode; 56 | } 57 | 58 | public boolean isCheckNetwork() { 59 | return isCheckNetwork; 60 | } 61 | 62 | public void setCheckNetwork(boolean isCheckNetwork) { 63 | this.isCheckNetwork = isCheckNetwork; 64 | } 65 | 66 | public int getState() { 67 | return state; 68 | } 69 | 70 | public void setState(int state) { 71 | this.state = state; 72 | } 73 | 74 | public Object getResult() { 75 | return result; 76 | } 77 | 78 | public void setResult(Object result) { 79 | this.result = result; 80 | } 81 | 82 | public OnDataListener getListener() { 83 | return listener; 84 | } 85 | 86 | public void setListener(OnDataListener listener) { 87 | this.listener = listener; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/async/HttpException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Launch Android Client, HttpException 3 | Copyright (c) 2014 LAUNCH Tech Company Limited 4 | http:www.cnlaunch.com 5 | */ 6 | package com.sd.one.common.async; 7 | 8 | /** 9 | * [HttpException请求异常类] 10 | * 11 | * @author devin.hu 12 | * @version 1.0 13 | * @date 2013-9-29 14 | * 15 | **/ 16 | public class HttpException extends Exception { 17 | 18 | /** 19 | * serialVersionUID 20 | */ 21 | private static final long serialVersionUID = 4010634120321127684L; 22 | 23 | public HttpException() { 24 | super(); 25 | } 26 | 27 | public HttpException(String detailMessage, Throwable throwable) { 28 | super(detailMessage, throwable); 29 | } 30 | 31 | public HttpException(String detailMessage) { 32 | super(detailMessage); 33 | } 34 | 35 | public HttpException(Throwable throwable) { 36 | super(throwable); 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/async/OnDataListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, OnDataListener 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.common.async; 7 | 8 | /** 9 | * [异步数据处理回调接口类] 10 | * 11 | * @author devin.hu 12 | * @version 1.0 13 | * @date 2013-9-24 14 | * 15 | **/ 16 | public interface OnDataListener { 17 | 18 | /** 19 | * 异步耗时方法 20 | * @param requestCode 请求码 21 | * @return 22 | * @throws HttpException 23 | */ 24 | public Object doInBackground(int requestCode) throws HttpException; 25 | 26 | /** 27 | * 打断方法 28 | * @param requestCode 请求码 29 | * @param result 返回结果 true表示打断,false表示继续执行onSuccess方法 30 | */ 31 | public boolean onIntercept(int requestCode, Object result); 32 | 33 | /** 34 | * 成功方法(可直接更新UI) 35 | * @param requestCode 请求码 36 | * @param result 返回结果 37 | */ 38 | public void onSuccess(int requestCode, Object result); 39 | 40 | /** 41 | * 失败方法(可直接更新UI) 42 | * @param requestCode 请求码 43 | * @param state 返回状态 44 | * @param result 返回结果 45 | */ 46 | public void onFailure(int requestCode, int state, Object result); 47 | } 48 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/manager/LruCacheManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, LruCacheManager 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.common.manager; 7 | 8 | import android.util.LruCache; 9 | 10 | /** 11 | * [A brief description] 12 | * 13 | * @author huxinwu 14 | * @version 1.0 15 | * @date 2014-11-6 16 | * 17 | **/ 18 | public class LruCacheManager { 19 | 20 | /** 21 | * lruCache 22 | */ 23 | private LruCache lruCache; 24 | /** 25 | * instance 26 | */ 27 | private static LruCacheManager instance; 28 | /** 29 | * cache size 30 | */ 31 | private final int CACHE_SIZE = 50; 32 | 33 | 34 | /** 35 | * LruCacheManager constructor 36 | */ 37 | private LruCacheManager() { 38 | this.lruCache = new LruCache(CACHE_SIZE); 39 | } 40 | 41 | /** 42 | * get the LruCacheManager instance, it is the singleton 43 | * 44 | * @return LruCacheManager 45 | */ 46 | public static LruCacheManager getInstance() { 47 | if (instance == null) { 48 | synchronized (LruCacheManager.class) { 49 | if (instance == null) { 50 | instance = new LruCacheManager(); 51 | } 52 | } 53 | } 54 | return instance; 55 | } 56 | 57 | /** 58 | * put 59 | * @param key String 60 | * @param value Object 61 | */ 62 | public void put(String key, Object value) { 63 | lruCache.put(key, value); 64 | } 65 | 66 | /** 67 | * get 68 | * @param key String 69 | * @return Object 70 | */ 71 | public Object get(String key) { 72 | return lruCache.get(key); 73 | } 74 | 75 | /** 76 | * remove 77 | * @param key String 78 | * @return Object 79 | */ 80 | public Object remove(String key) { 81 | return lruCache.remove(key); 82 | } 83 | 84 | /** 85 | * evictAll 86 | */ 87 | public void evictAll() { 88 | lruCache.evictAll(); 89 | } 90 | 91 | /** 92 | * maxSize 93 | * @return int 94 | */ 95 | public int maxSize() { 96 | return lruCache.maxSize(); 97 | } 98 | 99 | /** 100 | * size 101 | * @return int 102 | */ 103 | public int size() { 104 | return lruCache.size(); 105 | } 106 | 107 | /** 108 | * trimToSize 109 | * @param maxSize 110 | */ 111 | public void trimToSize(int maxSize) { 112 | lruCache.trimToSize(maxSize); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/okhttp/CookieJarImpl.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.common.okhttp; 2 | 3 | 4 | import java.util.List; 5 | 6 | import okhttp3.Cookie; 7 | import okhttp3.CookieJar; 8 | import okhttp3.HttpUrl; 9 | 10 | public class CookieJarImpl implements CookieJar { 11 | 12 | private CookieStore cookieStore; 13 | 14 | public CookieJarImpl(CookieStore cookieStore) { 15 | if (cookieStore == null) { 16 | throw new IllegalArgumentException("cookieStore can not be null!"); 17 | } 18 | this.cookieStore = cookieStore; 19 | } 20 | 21 | @Override 22 | public void saveFromResponse(HttpUrl url, List cookies) { 23 | cookieStore.saveCookies(url, cookies); 24 | } 25 | 26 | @Override 27 | public List loadForRequest(HttpUrl url) { 28 | return cookieStore.loadCookies(url); 29 | } 30 | 31 | public CookieStore getCookieStore() { 32 | return cookieStore; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/okhttp/CookieStore.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.common.okhttp; 2 | 3 | import java.util.List; 4 | 5 | import okhttp3.Cookie; 6 | import okhttp3.HttpUrl; 7 | 8 | /** 9 | * ================================================ 10 | * 作 者:廖子尧 11 | * 版 本:1.0 12 | * 创建日期:2016/1/14 13 | * 描 述:CookieStore 的公共接口 14 | * 修订历史: 15 | * ================================================ 16 | */ 17 | public interface CookieStore { 18 | 19 | /** 保存url对应所有cookie */ 20 | void saveCookies(HttpUrl url, List cookie); 21 | 22 | /** 加载url所有的cookie */ 23 | List loadCookies(HttpUrl url); 24 | 25 | /** 获取当前所有保存的cookie */ 26 | List getAllCookie(); 27 | 28 | /** 根据url和cookie移除对应的cookie */ 29 | boolean removeCookie(HttpUrl url, Cookie cookie); 30 | 31 | /** 根据url移除所有的cookie */ 32 | boolean removeCookies(HttpUrl url); 33 | 34 | /** 移除所有的cookie */ 35 | boolean removeAllCookie(); 36 | } 37 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/okhttp/RequestInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.common.okhttp; 2 | 3 | import java.io.IOException; 4 | 5 | import okhttp3.HttpUrl; 6 | import okhttp3.Interceptor; 7 | import okhttp3.Request; 8 | import okhttp3.Response; 9 | 10 | 11 | /** 12 | * Created by devin on 17/3/7. 13 | */ 14 | 15 | public class RequestInterceptor implements Interceptor { 16 | 17 | @Override public Response intercept(Chain chain) throws IOException { 18 | 19 | Request original = chain.request(); 20 | 21 | //添加Agent 22 | Request request = original.newBuilder() 23 | .header("User-Agent", "Your-App-Name") 24 | .method(original.method(), original.body()) 25 | .build(); 26 | 27 | //添加token 28 | HttpUrl httpUrl = request.url().newBuilder() 29 | .addQueryParameter("token", "tokenValue") 30 | .build(); 31 | 32 | request = request.newBuilder().url(httpUrl).build(); 33 | 34 | return chain.proceed(request); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/okhttp/SerializableHttpCookie.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.common.okhttp; 2 | 3 | import java.io.IOException; 4 | import java.io.ObjectInputStream; 5 | import java.io.ObjectOutputStream; 6 | import java.io.Serializable; 7 | 8 | import okhttp3.Cookie; 9 | 10 | public class SerializableHttpCookie implements Serializable { 11 | private static final long serialVersionUID = 6374381323722046732L; 12 | 13 | private transient final Cookie cookie; 14 | private transient Cookie clientCookie; 15 | 16 | public SerializableHttpCookie(Cookie cookie) { 17 | this.cookie = cookie; 18 | } 19 | 20 | public Cookie getCookie() { 21 | Cookie bestCookie = cookie; 22 | if (clientCookie != null) { 23 | bestCookie = clientCookie; 24 | } 25 | return bestCookie; 26 | } 27 | 28 | private void writeObject(ObjectOutputStream out) throws IOException { 29 | out.writeObject(cookie.name()); 30 | out.writeObject(cookie.value()); 31 | out.writeLong(cookie.expiresAt()); 32 | out.writeObject(cookie.domain()); 33 | out.writeObject(cookie.path()); 34 | out.writeBoolean(cookie.secure()); 35 | out.writeBoolean(cookie.httpOnly()); 36 | out.writeBoolean(cookie.hostOnly()); 37 | out.writeBoolean(cookie.persistent()); 38 | } 39 | 40 | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { 41 | String name = (String) in.readObject(); 42 | String value = (String) in.readObject(); 43 | long expiresAt = in.readLong(); 44 | String domain = (String) in.readObject(); 45 | String path = (String) in.readObject(); 46 | boolean secure = in.readBoolean(); 47 | boolean httpOnly = in.readBoolean(); 48 | boolean hostOnly = in.readBoolean(); 49 | boolean persistent = in.readBoolean(); 50 | Cookie.Builder builder = new Cookie.Builder(); 51 | builder = builder.name(name); 52 | builder = builder.value(value); 53 | builder = builder.expiresAt(expiresAt); 54 | builder = hostOnly ? builder.hostOnlyDomain(domain) : builder.domain(domain); 55 | builder = builder.path(path); 56 | builder = secure ? builder.secure() : builder; 57 | builder = httpOnly ? builder.httpOnly() : builder; 58 | clientCookie = builder.build(); 59 | } 60 | } -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/common/parse/JsonMananger.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, JsonMananger 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.common.parse; 7 | 8 | import java.util.List; 9 | 10 | import com.alibaba.fastjson.JSON; 11 | import com.alibaba.fastjson.util.TypeUtils; 12 | import com.sd.one.common.async.HttpException; 13 | import com.sd.one.utils.NLog; 14 | 15 | /** 16 | * [JSON解析管理类] 17 | * 18 | * @author huxinwu 19 | * @version 1.0 20 | * @date 2014-3-5 21 | * 22 | **/ 23 | public class JsonMananger { 24 | 25 | static{ 26 | TypeUtils.compatibleWithJavaBean = true; 27 | } 28 | private static final String tag = JsonMananger.class.getSimpleName(); 29 | 30 | /** 31 | * 将json字符串转换成java对象 32 | * @param json 33 | * @param cls 34 | * @return 35 | * @throws HttpException 36 | */ 37 | public static T jsonToBean(String json, Class cls) throws HttpException { 38 | return JSON.parseObject(json, cls); 39 | } 40 | 41 | /** 42 | * 将json字符串转换成java List对象 43 | * @param json 44 | * @param cls 45 | * @return 46 | * @throws HttpException 47 | */ 48 | public static List jsonToList(String json, Class cls) throws HttpException { 49 | return JSON.parseArray(json, cls); 50 | } 51 | 52 | /** 53 | * 将bean对象转化成json字符串 54 | * @param obj 55 | * @return 56 | * @throws HttpException 57 | */ 58 | public static String beanToJson(Object obj) throws HttpException{ 59 | String result = JSON.toJSONString(obj); 60 | NLog.e(tag, "beanToJson: " + result); 61 | return result; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/model/base/BaseModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, BaseModel 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | package com.sd.one.model.base; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * [model基类,主要是针对需要序列化的返回结果对象,如果返回结果需要序列化到磁盘,则返回结果中的所有对象需要继承该类实现序列化接口] 11 | * 12 | * @author huxinwu 13 | * @version 1.0 14 | * @date 2014-11-6 15 | * 16 | **/ 17 | public abstract class BaseModel implements Serializable { 18 | 19 | /** 20 | * serialVersionUID 21 | */ 22 | private static final long serialVersionUID = 2085645529977627985L; 23 | } 24 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/model/base/BaseResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, BaseResponse 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.model.base; 7 | 8 | import android.text.TextUtils; 9 | 10 | /** 11 | * [返回结果基类,返回结果公共字段本类实现] 12 | * 13 | * @author huxinwu 14 | * @version 1.0 15 | * @date 2014-11-6 16 | * 17 | **/ 18 | public class BaseResponse extends BaseModel { 19 | 20 | /** 21 | * serialVersionUID 22 | */ 23 | private static final long serialVersionUID = -5616901114632786764L; 24 | 25 | private String resultCode; 26 | 27 | private String errorMsg; 28 | 29 | private T data; 30 | 31 | public T getData() { 32 | return data; 33 | } 34 | 35 | public void setData(T data) { 36 | this.data = data; 37 | } 38 | 39 | public String getResultCode() { 40 | return resultCode; 41 | } 42 | 43 | public void setResultCode(String resultCode) { 44 | this.resultCode = resultCode; 45 | } 46 | 47 | public String getErrorMsg() { 48 | return errorMsg; 49 | } 50 | 51 | public void setErrorMsg(String errorMsg) { 52 | this.errorMsg = errorMsg; 53 | } 54 | 55 | public boolean isSucces() { 56 | if (!TextUtils.isEmpty(resultCode) && "1".equals(resultCode)) { 57 | return true; 58 | } 59 | return false; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/model/response/ConfigData.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.model.response; 2 | 3 | 4 | import com.sd.one.model.base.BaseModel; 5 | 6 | /** 7 | * [一句话简单描述] 8 | * 9 | * @author huxinwu 10 | * @version 1.0 11 | * @date 2016/5/5 12 | */ 13 | public class ConfigData extends BaseModel { 14 | 15 | private String id; 16 | private String configName; 17 | private int type;//类型 2个性标签 3满意部位 4感情状态 5性取向 6举报类型 7投诉类型 8星座 18 | private String orderNum; 19 | private String description; 20 | private String valid;//是否可用 0可用 1不可用 21 | private String configCode; 22 | private String configValue; 23 | private boolean checkFlag; 24 | 25 | public String getConfigName() { 26 | return configName; 27 | } 28 | 29 | public void setConfigName(String configName) { 30 | this.configName = configName; 31 | } 32 | 33 | public int getType() { 34 | return type; 35 | } 36 | 37 | public void setType(int type) { 38 | this.type = type; 39 | } 40 | 41 | public String getOrderNum() { 42 | return orderNum; 43 | } 44 | 45 | public void setOrderNum(String orderNum) { 46 | this.orderNum = orderNum; 47 | } 48 | 49 | public String getDescription() { 50 | return description; 51 | } 52 | 53 | public void setDescription(String description) { 54 | this.description = description; 55 | } 56 | 57 | public String getValid() { 58 | return valid; 59 | } 60 | 61 | public void setValid(String valid) { 62 | this.valid = valid; 63 | } 64 | 65 | public String getId() { 66 | return id; 67 | } 68 | 69 | public void setId(String id) { 70 | this.id = id; 71 | } 72 | 73 | public String getConfigCode() { 74 | return configCode; 75 | } 76 | 77 | public void setConfigCode(String configCode) { 78 | this.configCode = configCode; 79 | } 80 | 81 | public String getConfigValue() { 82 | return configValue; 83 | } 84 | 85 | public void setConfigValue(String configValue) { 86 | this.configValue = configValue; 87 | } 88 | 89 | public boolean isCheckFlag() { 90 | return checkFlag; 91 | } 92 | 93 | public void setCheckFlag(boolean checkFlag) { 94 | this.checkFlag = checkFlag; 95 | } 96 | 97 | @Override 98 | public String toString() { 99 | return "ConfigData{" + 100 | "id='" + id + '\'' + 101 | ", configName='" + configName + '\'' + 102 | ", type=" + type + 103 | ", orderNum='" + orderNum + '\'' + 104 | ", description='" + description + '\'' + 105 | ", valid='" + valid + '\'' + 106 | ", configCode='" + configCode + '\'' + 107 | ", configValue='" + configValue + '\'' + 108 | ", checkFlag=" + checkFlag + 109 | '}'; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/service/ApiService.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.service; 2 | 3 | import com.sd.one.model.base.BaseResponse; 4 | import com.sd.one.model.response.ConfigData; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import retrofit2.Call; 9 | import retrofit2.http.GET; 10 | import retrofit2.http.Query; 11 | import retrofit2.http.QueryMap; 12 | 13 | /** 14 | * [retrofit实现接口部分; 15 | * 本框架接口都返回call,因为call同时支持同步和异步方法,在异步框架里面用同步方法(比如activity页面发请求),不在异步框架里面用异步方法(比如dialog里面发请求) 16 | * retrofit具体使用可参见官网http://square.github.io/retrofit/] 17 | * 18 | * @author huxinwu 19 | * @version 1.0 20 | * @date 2016/10/11 21 | */ 22 | public interface ApiService { 23 | 24 | @GET("/app/sys/getConfig") 25 | Call>> getConfig(@QueryMap Map options); 26 | 27 | 28 | @GET("/app/circle/getCircleTypeList") 29 | Call>> getCircleTypeList(@Query("patientId") String patientId); 30 | } 31 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/service/RetrofitAction.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.service; 2 | 3 | import android.content.Context; 4 | import com.sd.one.model.base.BaseResponse; 5 | import com.sd.one.model.response.ConfigData; 6 | 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import retrofit2.Call; 10 | 11 | /** 12 | * [一句话简单描述] 13 | * 14 | * @author huxinwu 15 | * @version 1.0 16 | * @date 2016/12/14 17 | */ 18 | public class RetrofitAction extends RetrofitManager { 19 | 20 | /** 21 | * 构造方法 22 | * @param mContext 23 | */ 24 | public RetrofitAction(Context mContext) { 25 | super(mContext); 26 | } 27 | 28 | /** 29 | * 获取配置信息接口 30 | * @return 31 | */ 32 | public Call>> getConfig() { 33 | HashMap params = getRequestParams(); 34 | return apiService.getConfig(params); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/service/RetrofitManager.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.service; 2 | 3 | import android.content.Context; 4 | import android.text.TextUtils; 5 | 6 | import com.sd.one.common.Constants; 7 | import com.sd.one.common.okhttp.OkHttpUtils; 8 | 9 | import java.util.HashMap; 10 | 11 | import retrofit2.Retrofit; 12 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 13 | import retrofit2.converter.fastjson.FastJsonConverterFactory; 14 | import rx.Observable; 15 | import rx.Subscriber; 16 | import rx.android.schedulers.AndroidSchedulers; 17 | import rx.schedulers.Schedulers; 18 | 19 | /** 20 | * [一句话简单描述] 21 | * 22 | * @author huxinwu 23 | * @version 1.0 24 | * @date 2016/12/14 25 | */ 26 | public abstract class RetrofitManager { 27 | 28 | protected Retrofit retrofit; 29 | protected ApiService apiService; 30 | 31 | /** 32 | * 构造方法 33 | */ 34 | public RetrofitManager(Context context) { 35 | retrofit = new Retrofit.Builder() 36 | .client(OkHttpUtils.getInstance(context).getOkHttpClient()) 37 | .addConverterFactory(FastJsonConverterFactory.create()) 38 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 39 | .baseUrl(Constants.DOMAIN) 40 | .build(); 41 | 42 | //初始化接口类 43 | apiService = retrofit.create(ApiService.class); 44 | } 45 | 46 | 47 | /** 48 | * 获取处理后的RequestParams对象 49 | * @return 50 | */ 51 | public HashMap getRequestParams(){ 52 | HashMap params = new HashMap(); 53 | params.put("app_id", "2016789168"); 54 | params.put("model", "android"); 55 | params.put("version", "1.0"); 56 | return params; 57 | } 58 | 59 | 60 | public void toSubscribe(Observable observable, Subscriber subscriber){ 61 | observable.subscribeOn(Schedulers.io()) 62 | .unsubscribeOn(Schedulers.io()) 63 | .observeOn(AndroidSchedulers.mainThread()) 64 | .subscribe(subscriber); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/DateStyle.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, DateStyle 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.utils; 7 | 8 | /** 9 | * [时间格式样式类] 10 | * 11 | * @author devin.hu 12 | * @version 1.0 13 | * @date 2014-2-25 14 | * 15 | **/ 16 | public class DateStyle { 17 | 18 | /** 19 | * 默认时间格式 20 | */ 21 | public static String MM_DD = "MM-DD"; 22 | public static String YYYY_MM = "YYYY-MM"; 23 | public static String YYYY_MM_DD = "YYYY-MM-DD"; 24 | public static String MM_DD_HH_MM = "MM-DD hh:MM"; 25 | public static String MM_DD_HH_MM_SS = "MM-DD hh:MM:ss"; 26 | public static String YYYY_MM_DD_HH_MM = "YYYY-MM-DD hh:MM"; 27 | public static String YYYY_MM_DD_HH_MM_SS = "YYYY-MM-DD hh:MM:ss"; 28 | 29 | /** 30 | * 英文时间格式 31 | */ 32 | public static String MM_DD_EN = "MM/DD"; 33 | public static String YYYY_MM_EN = "YYYY/MM"; 34 | public static String YYYY_MM_DD_EN = "YYYY/MM/DD"; 35 | public static String MM_DD_HH_MM_EN = "MM/DD hh:MM"; 36 | public static String MM_DD_HH_MM_SS_EN = "MM/DD hh:MM:ss"; 37 | public static String YYYY_MM_DD_HH_MM_EN = "YYYY/MM/DD hh:MM"; 38 | public static String YYYY_MM_DD_HH_MM_SS_EN = "YYYY/MM/DD hh:MM:ss"; 39 | 40 | /** 41 | * 中文时间格式 42 | */ 43 | public static String MM_DD_CN = "MM月DD日"; 44 | public static String YYYY_MM_CN = "YYYY年MM月"; 45 | public static String YYYY_MM_DD_CN = "YYYY年MM月DD日"; 46 | public static String MM_DD_HH_MM_CN = "MM月DD日 hh:MM"; 47 | public static String MM_DD_HH_MM_SS_CN = "MM月DD日 hh:MM:ss"; 48 | public static String YYYY_MM_DD_HH_MM_CN = "YYYY年MM月DD日 hh:MM"; 49 | public static String YYYY_MM_DD_HH_MM_SS_CN = "YYYY年MM月DD日 hh:MM:ss"; 50 | 51 | public static String HH_MM = "hh:MM"; 52 | public static String HH_MM_SS = "hh:MM:ss"; 53 | } 54 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/NLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, NLog 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.utils; 7 | 8 | import android.util.Log; 9 | 10 | /** 11 | * [A brief description] 12 | * 13 | * @author devin.hu 14 | * @version 1.0 15 | * @date 2013-9-17 16 | * 17 | **/ 18 | public class NLog { 19 | 20 | private static final String LOG_FORMAT = "%1$s\n%2$s"; 21 | private static boolean isDebug = false; 22 | 23 | public static void d(String tag, Object... args) { 24 | log(Log.DEBUG, null, tag, args); 25 | } 26 | 27 | public static void i(String tag, Object... args) { 28 | log(Log.INFO, null, tag, args); 29 | } 30 | 31 | public static void w(String tag, Object... args) { 32 | log(Log.WARN, null, tag, args); 33 | } 34 | 35 | public static void e(Throwable ex) { 36 | log(Log.ERROR, ex, null); 37 | } 38 | 39 | public static void e(String tag, Object... args) { 40 | log(Log.ERROR, null, tag, args); 41 | } 42 | 43 | public static void e(Throwable ex, String tag, Object... args) { 44 | log(Log.ERROR, ex, tag, args); 45 | } 46 | 47 | private static void log(int priority, Throwable ex, String tag, Object... args) { 48 | 49 | if (isDebug == false) return; 50 | 51 | String log = ""; 52 | if (ex == null) { 53 | if(args != null && args.length > 0){ 54 | for(Object obj : args){ 55 | log += String.valueOf(obj); 56 | } 57 | } 58 | } else { 59 | String logMessage = ex.getMessage(); 60 | String logBody = Log.getStackTraceString(ex); 61 | log = String.format(LOG_FORMAT, logMessage, logBody); 62 | } 63 | Log.println(priority, tag, log); 64 | } 65 | 66 | public static boolean isDebug() { 67 | return isDebug; 68 | } 69 | 70 | public static void setDebug(boolean isDebug) { 71 | NLog.isDebug = isDebug; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/NToast.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, NToast 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.utils; 7 | 8 | import android.app.Activity; 9 | import android.content.Context; 10 | import android.text.TextUtils; 11 | import android.widget.Toast; 12 | 13 | /** 14 | * [Toast工具类] 15 | * 16 | * @author mashidong 17 | * @version 1.0 18 | * @date 2014-3-13 19 | * 20 | **/ 21 | public class NToast { 22 | 23 | public static void shortToast(Context context, int resId) { 24 | showToast(context, resId, Toast.LENGTH_SHORT); 25 | } 26 | 27 | public static void shortToast(Context context, String text) { 28 | if(!TextUtils.isEmpty(text) && !"".equals(text.trim())){ 29 | showToast(context, text, Toast.LENGTH_SHORT); 30 | } 31 | } 32 | 33 | public static void longToast(Context context, int resId) { 34 | showToast(context, resId, Toast.LENGTH_LONG); 35 | } 36 | 37 | public static void longToast(Context context, String text) { 38 | if(!TextUtils.isEmpty(text) && !"".equals(text.trim())){ 39 | showToast(context, text, Toast.LENGTH_LONG); 40 | } 41 | } 42 | 43 | public static void showToast(Context context, int resId, int duration) { 44 | if (context == null){ 45 | return; 46 | } 47 | if (context != null && context instanceof Activity) { 48 | if(((Activity) context).isFinishing()) { 49 | return; 50 | } 51 | } 52 | String text = context.getString(resId); 53 | showToast(context, text, duration); 54 | } 55 | 56 | public static void showToast(Context context, String text, int duration) { 57 | if (context == null){ 58 | return; 59 | } 60 | if (context != null && context instanceof Activity) { 61 | if(((Activity) context).isFinishing()) { 62 | return; 63 | } 64 | } 65 | if(!TextUtils.isEmpty(text) && !"".equals(text.trim())){ 66 | Toast.makeText(context, text, duration).show(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/db/DBManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, DBManager 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.utils.db; 7 | 8 | import com.sd.one.common.Constants; 9 | import com.sd.one.utils.db.gen.DaoMaster; 10 | import com.sd.one.utils.db.gen.DaoSession; 11 | import android.content.Context; 12 | 13 | /** 14 | * [数据库管理类,数据采用GreenDao来实现,所有实现通过模板自动生成;通过获取daoSession来获取所有的dao,从而实现操作对象] 15 | * 16 | * @author huxinwu 17 | * @version 1.0 18 | * @date 2014-11-6 19 | * 20 | **/ 21 | public class DBManager { 22 | 23 | private static DBManager instance; 24 | private DaoMaster daoMaster; 25 | private DaoSession daoSession; 26 | 27 | /** 28 | * [获取DBManager实例,单例模式实现] 29 | * 30 | * @param context 31 | * @return 32 | */ 33 | public static DBManager getInstance(Context context) { 34 | if (instance == null) { 35 | synchronized (DBManager.class) { 36 | if (instance == null) { 37 | instance = new DBManager(context); 38 | } 39 | } 40 | } 41 | return instance; 42 | } 43 | 44 | /** 45 | * 构造方法 46 | * @param context 47 | */ 48 | private DBManager(Context context) { 49 | if(daoSession == null){ 50 | if(daoMaster == null){ 51 | DaoMaster.OpenHelper helper = new DaoMaster.DevOpenHelper(context, Constants.DB_NAME, null); 52 | daoMaster = new DaoMaster(helper.getWritableDatabase()); 53 | } 54 | daoSession = daoMaster.newSession(); 55 | } 56 | } 57 | 58 | public DaoMaster getDaoMaster() { 59 | return daoMaster; 60 | } 61 | 62 | public void setDaoMaster(DaoMaster daoMaster) { 63 | this.daoMaster = daoMaster; 64 | } 65 | 66 | public DaoSession getDaoSession() { 67 | return daoSession; 68 | } 69 | 70 | public void setDaoSession(DaoSession daoSession) { 71 | this.daoSession = daoSession; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/db/entity/Customer.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.db.entity; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Id; 5 | import org.greenrobot.greendao.annotation.Generated; 6 | 7 | /** 8 | * Created by devin on 17/8/29. 9 | */ 10 | @Entity 11 | public class Customer { 12 | 13 | @Id(autoincrement = true) 14 | private Long customerId; 15 | 16 | private String name; 17 | private String phone; 18 | private String creteTime; 19 | public String getCreteTime() { 20 | return this.creteTime; 21 | } 22 | public void setCreteTime(String creteTime) { 23 | this.creteTime = creteTime; 24 | } 25 | public String getPhone() { 26 | return this.phone; 27 | } 28 | public void setPhone(String phone) { 29 | this.phone = phone; 30 | } 31 | public String getName() { 32 | return this.name; 33 | } 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | public Long getCustomerId() { 38 | return this.customerId; 39 | } 40 | public void setCustomerId(Long customerId) { 41 | this.customerId = customerId; 42 | } 43 | @Generated(hash = 1137716255) 44 | public Customer(Long customerId, String name, String phone, String creteTime) { 45 | this.customerId = customerId; 46 | this.name = name; 47 | this.phone = phone; 48 | this.creteTime = creteTime; 49 | } 50 | @Generated(hash = 60841032) 51 | public Customer() { 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/db/entity/Order.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.db.entity; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Id; 5 | import org.greenrobot.greendao.annotation.NotNull; 6 | import org.greenrobot.greendao.annotation.Generated; 7 | 8 | /** 9 | * Created by devin on 17/8/29. 10 | */ 11 | @Entity 12 | public class Order { 13 | 14 | @Id(autoincrement = true) 15 | private Long orderId; 16 | 17 | @NotNull 18 | private Long customerId; 19 | 20 | private String name; 21 | private String finalPrice; 22 | private String price; 23 | private String status; 24 | private String desc; 25 | private String creteTime; 26 | public String getCreteTime() { 27 | return this.creteTime; 28 | } 29 | public void setCreteTime(String creteTime) { 30 | this.creteTime = creteTime; 31 | } 32 | public String getDesc() { 33 | return this.desc; 34 | } 35 | public void setDesc(String desc) { 36 | this.desc = desc; 37 | } 38 | public String getStatus() { 39 | return this.status; 40 | } 41 | public void setStatus(String status) { 42 | this.status = status; 43 | } 44 | public String getPrice() { 45 | return this.price; 46 | } 47 | public void setPrice(String price) { 48 | this.price = price; 49 | } 50 | public String getFinalPrice() { 51 | return this.finalPrice; 52 | } 53 | public void setFinalPrice(String finalPrice) { 54 | this.finalPrice = finalPrice; 55 | } 56 | public String getName() { 57 | return this.name; 58 | } 59 | public void setName(String name) { 60 | this.name = name; 61 | } 62 | public Long getCustomerId() { 63 | return this.customerId; 64 | } 65 | public void setCustomerId(Long customerId) { 66 | this.customerId = customerId; 67 | } 68 | public Long getOrderId() { 69 | return this.orderId; 70 | } 71 | public void setOrderId(Long orderId) { 72 | this.orderId = orderId; 73 | } 74 | @Generated(hash = 505498130) 75 | public Order(Long orderId, @NotNull Long customerId, String name, 76 | String finalPrice, String price, String status, String desc, 77 | String creteTime) { 78 | this.orderId = orderId; 79 | this.customerId = customerId; 80 | this.name = name; 81 | this.finalPrice = finalPrice; 82 | this.price = price; 83 | this.status = status; 84 | this.desc = desc; 85 | this.creteTime = creteTime; 86 | } 87 | @Generated(hash = 1105174599) 88 | public Order() { 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/db/entity/Product.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.db.entity; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Id; 5 | import org.greenrobot.greendao.annotation.Index; 6 | import org.greenrobot.greendao.annotation.Generated; 7 | 8 | /** 9 | * Created by devin on 17/8/29. 10 | */ 11 | @Entity 12 | public class Product { 13 | 14 | @Id(autoincrement = true) 15 | private Long productId; 16 | 17 | @Index 18 | private String porductName; 19 | 20 | private String basePrice; 21 | private String image; 22 | private String desc; 23 | private String creteTime; 24 | public String getCreteTime() { 25 | return this.creteTime; 26 | } 27 | public void setCreteTime(String creteTime) { 28 | this.creteTime = creteTime; 29 | } 30 | public String getDesc() { 31 | return this.desc; 32 | } 33 | public void setDesc(String desc) { 34 | this.desc = desc; 35 | } 36 | public String getImage() { 37 | return this.image; 38 | } 39 | public void setImage(String image) { 40 | this.image = image; 41 | } 42 | public String getBasePrice() { 43 | return this.basePrice; 44 | } 45 | public void setBasePrice(String basePrice) { 46 | this.basePrice = basePrice; 47 | } 48 | public String getPorductName() { 49 | return this.porductName; 50 | } 51 | public void setPorductName(String porductName) { 52 | this.porductName = porductName; 53 | } 54 | public Long getProductId() { 55 | return this.productId; 56 | } 57 | public void setProductId(Long productId) { 58 | this.productId = productId; 59 | } 60 | @Generated(hash = 1007500402) 61 | public Product(Long productId, String porductName, String basePrice, 62 | String image, String desc, String creteTime) { 63 | this.productId = productId; 64 | this.porductName = porductName; 65 | this.basePrice = basePrice; 66 | this.image = image; 67 | this.desc = desc; 68 | this.creteTime = creteTime; 69 | } 70 | @Generated(hash = 1890278724) 71 | public Product() { 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/encrypt/AESType.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.encrypt; 2 | 3 | public enum AESType { 4 | 5 | ECB("ECB", "0"), CBC("CBC", "1"), CFB("CFB", "2"), OFB("OFB", "3"); 6 | private String k; 7 | private String v; 8 | 9 | private AESType(String k, String v) { 10 | this.k = k; 11 | this.v = v; 12 | } 13 | 14 | public String key() { 15 | return this.k; 16 | } 17 | 18 | public String value() { 19 | return this.v; 20 | } 21 | 22 | public static AESType get(int id) { 23 | AESType[] vs = AESType.values(); 24 | for (int i = 0; i < vs.length; i++) { 25 | AESType d = vs[i]; 26 | if (d.key().equals(id)) 27 | return d; 28 | } 29 | return AESType.CBC; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/encrypt/MD5.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.encrypt; 2 | 3 | import java.security.MessageDigest; 4 | import java.security.NoSuchAlgorithmException; 5 | 6 | /** 7 | * MD5加密 8 | * @author jiang.li 9 | * @date 2013-12-17 14:09 10 | */ 11 | public class MD5 { 12 | 13 | /**全局数组**/ 14 | private final static String[] strDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" }; 15 | 16 | /** 17 | * 返回形式为数字跟字符串 18 | * @param bByte 19 | * @return 20 | */ 21 | private static String byteToArrayString(byte bByte) { 22 | int iRet = bByte; 23 | if (iRet < 0) { 24 | iRet += 256; 25 | } 26 | int iD1 = iRet / 16; 27 | int iD2 = iRet % 16; 28 | return strDigits[iD1] + strDigits[iD2]; 29 | } 30 | 31 | /** 32 | * 转换字节数组为16进制字串 33 | * @param bByte 34 | * @return 35 | */ 36 | private static String byteToString(byte[] bByte) { 37 | StringBuffer sBuffer = new StringBuffer(); 38 | for (int i = 0; i < bByte.length; i++) { 39 | sBuffer.append(byteToArrayString(bByte[i])); 40 | } 41 | return sBuffer.toString(); 42 | } 43 | 44 | /** 45 | * MD5加密 46 | * @param str 待加密的字符串 47 | * @return 48 | */ 49 | public static String encrypt(String str) { 50 | String result = null; 51 | try { 52 | result = new String(str); 53 | MessageDigest md = MessageDigest.getInstance("MD5"); 54 | result = byteToString(md.digest(str.getBytes())); 55 | } catch (NoSuchAlgorithmException ex) { 56 | ex.printStackTrace(); 57 | } 58 | return result; 59 | } 60 | 61 | /** 62 | * MD5加密 63 | * @param str 待加密的字符串 64 | * @param lowerCase 大小写 65 | * @return 66 | */ 67 | public static String encrypt(String str,boolean lowerCase) { 68 | String result = null; 69 | try { 70 | result = new String(str); 71 | MessageDigest md = MessageDigest.getInstance("MD5"); 72 | result = byteToString(md.digest(str.getBytes())); 73 | if(lowerCase){ 74 | result = result.toLowerCase(); 75 | } 76 | } catch (NoSuchAlgorithmException ex) { 77 | ex.printStackTrace(); 78 | } 79 | return result; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/encrypt/Shared.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Java Base64 - A pure Java library for reading and writing Base64 3 | * encoded streams. 4 | * 5 | * Copyright (C) 2007-2009 Carlo Pelliccia (www.sauronsoftware.it) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License version 9 | * 2.1, as published by the Free Software Foundation. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License version 2.1 along with this program. 18 | * If not, see . 19 | */ 20 | package com.sd.one.utils.encrypt; 21 | 22 | /** 23 | * Package related utilities. 24 | * 25 | * @author Carlo Pelliccia 26 | */ 27 | class Shared { 28 | 29 | static String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 30 | 31 | static char pad = '='; 32 | 33 | } -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/jpinyin/PinyinException.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.jpinyin; 2 | 3 | /** 4 | * 异常类 5 | * 6 | */ 7 | public class PinyinException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | private String message; 12 | 13 | public PinyinException() { 14 | super(); 15 | } 16 | 17 | public PinyinException(final String message) { 18 | super(message); 19 | } 20 | 21 | public PinyinException(final Exception e) { 22 | super(e); 23 | } 24 | 25 | public PinyinException(Throwable cause) { 26 | super(cause); 27 | } 28 | 29 | public PinyinException(final String message, final Throwable cause) { 30 | super(message, cause); 31 | } 32 | 33 | @Override 34 | public String getMessage() { 35 | return this.message == null ? super.getMessage() : this.message; 36 | } 37 | 38 | public void setMessage(String message) { 39 | this.message = message; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return this.message; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/jpinyin/PinyinFormat.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.jpinyin; 2 | 3 | 4 | /** 5 | * [汉字转拼音类] 6 | * 7 | * @author huxinwu 8 | * @version 1.0 9 | * @date 2014-3-18 10 | * 11 | **/ 12 | public enum PinyinFormat { 13 | WITH_TONE_MARK, WITHOUT_TONE, WITH_TONE_NUMBER; 14 | } 15 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/jpinyin/PinyinResource.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.jpinyin; 2 | 3 | import android.content.Context; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.InputStreamReader; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | /** 13 | * [资源加载类] 14 | * 15 | * @author huxinwu 16 | * @version 1.0 17 | * @date 2014-3-18 18 | * 19 | **/ 20 | public final class PinyinResource { 21 | 22 | private PinyinResource() {} 23 | 24 | private static Map getResource(String resourceName, Context context) { 25 | Map map = new HashMap(); 26 | try { 27 | 28 | InputStream is = context.getAssets().open(resourceName); 29 | BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8")); 30 | String line = null; 31 | while ((line = br.readLine()) != null) { 32 | String[] tokens = line.trim().split("="); 33 | map.put(tokens[0], tokens[1]); 34 | } 35 | br.close(); 36 | } catch (IOException e) { 37 | throw new PinyinException(e); 38 | } 39 | 40 | return map; 41 | } 42 | 43 | public static Map getPinyinResource(Context context) { 44 | return getResource("pinyin.db", context); 45 | } 46 | 47 | public static Map getMutilPinyinResource(Context context) { 48 | return getResource("mutil_pinyin.db", context); 49 | } 50 | 51 | public static Map getChineseResource(Context context) { 52 | return getResource("chinese.db", context); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/pay/PayListener.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.pay; 2 | 3 | public interface PayListener { 4 | 5 | /** 6 | * 支付模块监听 7 | * 8 | * @param state 支付模块状态 9 | * PayUtils.PAY_INIT_CODE = 10400 支付初始化错误 10 | * PayUtils.PAY_GOODS_CODE = 18400 支付商品不完整错误 11 | * PayUtils.PAY_SUC_CODE = 9000 支付成功 12 | * PayUtils.PAY_DOING_CODE = 8000 支付结果确认中 13 | * PayUtils.PAY_FAIL_CODE = 7000 支付失败 14 | * 15 | * @param message 16 | */ 17 | public void onPayResult(int state, String message); 18 | } 19 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/utils/photo/PhotoParams.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.utils.photo; 2 | 3 | import android.graphics.Bitmap; 4 | import android.net.Uri; 5 | import android.os.Environment; 6 | 7 | /** 8 | * [裁剪参数配置类] 9 | * 10 | * @author huxinwu 11 | * @version 1.0 12 | * @date 2015-1-7 13 | * 14 | **/ 15 | public class PhotoParams { 16 | 17 | public static final String CROP_TYPE = "image/*"; 18 | public static final String CROP_FILE_NAME = "crop_file.jpg"; 19 | public static final String OUTPUT_FORMAT = Bitmap.CompressFormat.JPEG.toString(); 20 | 21 | public static final int DEFAULT_ASPECT = 1; 22 | public static final int DEFAULT_OUTPUT = 300; 23 | 24 | /** 临时地址 **/ 25 | public Uri uri; 26 | /** 输出地址 **/ 27 | public Uri outputUri; 28 | 29 | /** 类型 **/ 30 | public String type; 31 | 32 | /** 输入类型,图片如jpg **/ 33 | public String outputFormat; 34 | 35 | /** crop为true可以剪裁 **/ 36 | public String crop; 37 | public boolean scale; 38 | public boolean returnData; 39 | public boolean noFaceDetection; 40 | public boolean scaleUpIfNeeded; 41 | 42 | /** aspectX aspectY 是宽高的比例 **/ 43 | public int aspectX; 44 | public int aspectY; 45 | 46 | /** outputX,outputY 是剪裁图片的宽高 **/ 47 | public int outputX; 48 | public int outputY; 49 | 50 | public PhotoParams() { 51 | crop = "true"; 52 | type = CROP_TYPE; 53 | uri = buildUri(); 54 | outputUri = buildUri(); 55 | scale = true; 56 | returnData = true; 57 | noFaceDetection = true; 58 | scaleUpIfNeeded = true; 59 | outputFormat = OUTPUT_FORMAT; 60 | aspectX = DEFAULT_ASPECT; 61 | aspectY = DEFAULT_ASPECT; 62 | outputX = DEFAULT_OUTPUT; 63 | outputY = DEFAULT_OUTPUT; 64 | } 65 | 66 | private Uri buildUri() { 67 | return Uri.fromFile(Environment.getExternalStorageDirectory()).buildUpon().appendPath(CROP_FILE_NAME).build(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/CompaScrollerListView.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.MotionEvent; 6 | import android.widget.ListView; 7 | import android.widget.ScrollView; 8 | 9 | /** 10 | * [兼容ScrollView的ListView, 解决滑动冲突事件] 11 | * 12 | * @author devin.hu 13 | * @version 1.0 14 | * @date 2014-1-20 15 | * 16 | **/ 17 | public class CompaScrollerListView extends ListView { 18 | 19 | private ScrollView scrollView; 20 | 21 | /** 22 | * @param context 23 | * @param attrs 24 | * @param defStyle 25 | */ 26 | public CompaScrollerListView(Context context, AttributeSet attrs, int defStyle) { 27 | super(context, attrs, defStyle); 28 | } 29 | 30 | /** 31 | * @param context 32 | * @param attrs 33 | */ 34 | public CompaScrollerListView(Context context, AttributeSet attrs) { 35 | super(context, attrs); 36 | } 37 | 38 | /** 39 | * @param context 40 | */ 41 | public CompaScrollerListView(Context context) { 42 | super(context); 43 | } 44 | 45 | @Override 46 | public boolean onTouchEvent(MotionEvent event) { 47 | int action = event.getAction(); 48 | switch (action) { 49 | case MotionEvent.ACTION_DOWN: 50 | if(scrollView != null){ 51 | scrollView.requestDisallowInterceptTouchEvent(true); 52 | } 53 | break; 54 | 55 | case MotionEvent.ACTION_UP: 56 | if(scrollView != null){ 57 | scrollView.requestDisallowInterceptTouchEvent(false); 58 | } 59 | break; 60 | } 61 | return super.onTouchEvent(event); 62 | } 63 | 64 | public ScrollView getScrollView() { 65 | return scrollView; 66 | } 67 | 68 | public void setScrollView(ScrollView scrollView) { 69 | this.scrollView = scrollView; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/NoScrollGridView.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.GridView; 6 | 7 | /** 8 | * [自定义不滚动的GridView] 9 | * 10 | * @author devin.hu 11 | * @version 1.0 12 | * @date 2014-1-20 13 | * 14 | **/ 15 | public class NoScrollGridView extends GridView { 16 | 17 | public NoScrollGridView(Context context) { 18 | super(context); 19 | 20 | } 21 | 22 | public NoScrollGridView(Context context, AttributeSet attrs) { 23 | super(context, attrs); 24 | } 25 | 26 | @Override 27 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 28 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 29 | super.onMeasure(widthMeasureSpec, expandSpec); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/NoScrollerListView.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.ListView; 6 | 7 | /** 8 | * [自定义不滚动的ListView] 9 | * 10 | * @author devin.hu 11 | * @version 1.0 12 | * @date 2014-1-20 13 | * 14 | **/ 15 | public class NoScrollerListView extends ListView { 16 | 17 | public NoScrollerListView(Context context) { 18 | super(context); 19 | 20 | } 21 | 22 | public NoScrollerListView(Context context, AttributeSet attrs) { 23 | super(context, attrs); 24 | } 25 | 26 | @Override 27 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 28 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 29 | super.onMeasure(widthMeasureSpec, expandSpec); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/dialog/CommonDialog.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.dialog; 2 | 3 | import android.content.Context; 4 | import android.text.TextUtils; 5 | import android.view.KeyEvent; 6 | import android.view.View; 7 | 8 | import com.sd.one.R; 9 | 10 | /** 11 | * [MessageDialog] 12 | * @author: devin.hu 13 | * @version: 1.0 14 | * @date: Oct 17, 2013 15 | */ 16 | public class CommonDialog extends BaseDialog { 17 | 18 | /** View对象 **/ 19 | private View contentView; 20 | /** 能否取消 true表示不能取消,false表示可以取消 **/ 21 | private boolean canNotCancel = false; 22 | 23 | 24 | /** 25 | * 可以取消的、带确定和取消的、默认标题的CommonDialog 26 | * @param context 27 | * @param contentView 28 | */ 29 | public CommonDialog(Context context, View contentView) { 30 | this(context, null, context.getString(R.string.common_confirm), null, false, contentView); 31 | } 32 | 33 | /** 34 | * 可以取消的、带确定和取消的CommonDialog 35 | * @param context 36 | * @param title 37 | * @param contentView 38 | */ 39 | public CommonDialog(Context context, String title, View contentView) { 40 | this(context, title, context.getString(R.string.common_confirm), null, false, contentView); 41 | } 42 | 43 | /** 44 | * 可以取消的CommonDialog 45 | * @param context 46 | * @param title 47 | * @param btnText1 48 | * @param btnText2 49 | * @param contentView 50 | */ 51 | public CommonDialog(Context context, String title, String btnText1, String btnText2, View contentView) { 52 | this(context, title, btnText1, btnText2, false, contentView); 53 | } 54 | 55 | /** 56 | * CommonDialog基础构造方法 57 | * @param context 58 | * @param title 59 | * @param btnText1 60 | * @param btnText2 61 | * @param canNotCancel 62 | * @param contentView 63 | */ 64 | public CommonDialog(Context context, String title, String btnText1, String btnText2, boolean canNotCancel, View contentView) { 65 | super(context); 66 | 67 | this.canNotCancel = canNotCancel; 68 | this.contentView = contentView; 69 | 70 | //设置标题 71 | if(!TextUtils.isEmpty(title)){ 72 | setTitle(title); 73 | } 74 | 75 | //设置按钮1 76 | if(!TextUtils.isEmpty(btnText1)){ 77 | this.setBtn1Text(btnText1); 78 | } 79 | 80 | //设置按钮2 81 | if(TextUtils.isEmpty(btnText2)){ 82 | this.setBtn2Visible(false); 83 | } else { 84 | this.setBtn2Visible(true); 85 | this.setBtn2Text(btnText2); 86 | } 87 | 88 | this.setBtn3Visible(true); 89 | } 90 | 91 | @Override 92 | public boolean onKeyDown(int keyCode, KeyEvent event){ 93 | if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_SEARCH) { 94 | if (canNotCancel) { 95 | return true; 96 | } 97 | } 98 | return super.onKeyDown(keyCode, event); 99 | } 100 | 101 | @Override 102 | public View createContentView() { 103 | return contentView; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/dialog/DragListViewDialog.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.dialog; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | 6 | import android.content.Context; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.widget.ArrayAdapter; 10 | import android.widget.LinearLayout; 11 | 12 | import com.sd.one.R; 13 | import com.sd.one.widget.draglistview.DragSortListView; 14 | import com.sd.one.widget.draglistview.DragSortListView.DropListener; 15 | import com.sd.one.widget.draglistview.DragSortListView.RemoveListener; 16 | 17 | /** 18 | * [A brief description] 19 | * 20 | * @author: devin.hu 21 | * @version: 1.0 22 | * @date: Oct 28, 2013 23 | */ 24 | public class DragListViewDialog extends BaseDialog implements DropListener, RemoveListener{ 25 | 26 | /** 27 | * contentView 28 | */ 29 | private LinearLayout contentView; 30 | private DragSortListView listview; 31 | private ArrayAdapter adapter; 32 | 33 | public DragListViewDialog(Context context) { 34 | super(context); 35 | contentView = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.layout_dialog_drag, null); 36 | listview = (DragSortListView) contentView.findViewById(R.id.listview); 37 | 38 | String[] array = context.getResources().getStringArray(R.array.jazz_artist_names); 39 | ArrayList arrayList = new ArrayList(Arrays.asList(array)); 40 | 41 | adapter = new ArrayAdapter(context, R.layout.layout_dialog_drag_item, R.id.text, arrayList); 42 | listview.setAdapter(adapter); 43 | 44 | listview.setDropListener(this); 45 | listview.setRemoveListener(this); 46 | } 47 | 48 | @Override 49 | public View createContentView() { 50 | return contentView; 51 | } 52 | 53 | @Override 54 | public void remove(int which) { 55 | String item = adapter.getItem(which); 56 | adapter.remove(item); 57 | listview.removeCheckState(which); 58 | } 59 | 60 | @Override 61 | public void drop(int from, int to) { 62 | if (from != to) { 63 | String item = adapter.getItem(from); 64 | adapter.remove(item); 65 | adapter.insert(item, to); 66 | listview.moveCheckState(from, to); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/downtime/DownTimer.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, DownTimer 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | package com.sd.one.widget.downtime; 6 | 7 | import android.os.CountDownTimer; 8 | 9 | import com.sd.one.utils.NLog; 10 | 11 | /** 12 | * [倒计时类] 13 | * 14 | * @author devin.hu 15 | * @version 1.0 16 | * @date 2014-12-1 17 | * 18 | **/ 19 | public class DownTimer { 20 | 21 | private final String TAG = DownTimer.class.getSimpleName(); 22 | private CountDownTimer mCountDownTimer; 23 | private DownTimerListener listener; 24 | 25 | 26 | /** 27 | * [开始倒计时功能]
28 | * [倒计为time长的时间,时间间隔为每秒] 29 | * @param time 30 | */ 31 | public void startDown(long time){ 32 | startDown(time, 1000); 33 | } 34 | 35 | /** 36 | * [倒计为time长的时间,时间间隔为mills] 37 | * @param time 38 | * @param mills 39 | */ 40 | public void startDown(long time, long mills){ 41 | stopDown(); 42 | mCountDownTimer = new CountDownTimer(time, mills){ 43 | @Override 44 | public void onTick(long millisUntilFinished) { 45 | if(listener != null){ 46 | listener.onTick(millisUntilFinished); 47 | }else{ 48 | NLog.e(TAG, "DownTimerListener 监听不能为空"); 49 | } 50 | } 51 | 52 | @Override 53 | public void onFinish() { 54 | if(listener != null){ 55 | listener.onFinish(); 56 | }else{ 57 | NLog.e(TAG, "DownTimerListener 监听不能为空"); 58 | } 59 | stopDown(); 60 | } 61 | 62 | }.start(); 63 | } 64 | 65 | /** 66 | * [停止倒计时功能]
67 | */ 68 | public void stopDown(){ 69 | if(mCountDownTimer != null){ 70 | mCountDownTimer.cancel(); 71 | listener = null; 72 | mCountDownTimer = null; 73 | } 74 | } 75 | 76 | /** 77 | * [设置倒计时监听]
78 | * @param listener 79 | */ 80 | public void setListener(DownTimerListener listener) { 81 | this.listener = listener; 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/downtime/DownTimerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | ShengDao Android Client, DownTimerListener 3 | Copyright (c) 2014 ShengDao Tech Company Limited 4 | */ 5 | package com.sd.one.widget.downtime; 6 | 7 | /** 8 | * [倒计时监听类] 9 | * 10 | * @author devin.hu 11 | * @version 1.0 12 | * @date 2014-12-1 13 | * 14 | **/ 15 | public interface DownTimerListener { 16 | 17 | /** 18 | * [倒计时每秒方法]
19 | * @param millisUntilFinished 20 | */ 21 | public void onTick(long millisUntilFinished); 22 | 23 | /** 24 | * [倒计时完成方法]
25 | */ 26 | public void onFinish(); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/draglistview/DragSortItemViewCheckable.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.draglistview; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.widget.Checkable; 6 | 7 | /** 8 | * Lightweight ViewGroup that wraps list items obtained from user's 9 | * ListAdapter. ItemView expects a single child that has a definite 10 | * height (i.e. the child's layout height is not MATCH_PARENT). 11 | * The width of 12 | * ItemView will always match the width of its child (that is, 13 | * the width MeasureSpec given to ItemView is passed directly 14 | * to the child, and the ItemView measured width is set to the 15 | * child's measured width). The height of ItemView can be anything; 16 | * the 17 | * 18 | * 19 | * The purpose of this class is to optimize slide 20 | * shuffle animations. 21 | */ 22 | public class DragSortItemViewCheckable extends DragSortItemView implements Checkable { 23 | 24 | public DragSortItemViewCheckable(Context context) { 25 | super(context); 26 | } 27 | 28 | @Override 29 | public boolean isChecked() { 30 | View child = getChildAt(0); 31 | if (child instanceof Checkable) 32 | return ((Checkable) child).isChecked(); 33 | else 34 | return false; 35 | } 36 | 37 | @Override 38 | public void setChecked(boolean checked) { 39 | View child = getChildAt(0); 40 | if (child instanceof Checkable) 41 | ((Checkable) child).setChecked(checked); 42 | } 43 | 44 | @Override 45 | public void toggle() { 46 | View child = getChildAt(0); 47 | if (child instanceof Checkable) 48 | ((Checkable) child).toggle(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/draglistview/SimpleFloatViewManager.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.draglistview; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.Color; 5 | import android.graphics.Point; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | import android.widget.ListView; 10 | 11 | /** 12 | * Simple implementation of the FloatViewManager class. Uses list 13 | * items as they appear in the ListView to create the floating View. 14 | */ 15 | public class SimpleFloatViewManager implements DragSortListView.FloatViewManager { 16 | 17 | private Bitmap mFloatBitmap; 18 | 19 | private ImageView mImageView; 20 | 21 | private int mFloatBGColor = Color.BLACK; 22 | 23 | private ListView mListView; 24 | 25 | public SimpleFloatViewManager(ListView lv) { 26 | mListView = lv; 27 | } 28 | 29 | public void setBackgroundColor(int color) { 30 | mFloatBGColor = color; 31 | } 32 | 33 | /** 34 | * This simple implementation creates a Bitmap copy of the 35 | * list item currently shown at ListView position. 36 | */ 37 | @Override 38 | public View onCreateFloatView(int position) { 39 | // Guaranteed that this will not be null? I think so. Nope, got 40 | // a NullPointerException once... 41 | View v = mListView.getChildAt(position + mListView.getHeaderViewsCount() - mListView.getFirstVisiblePosition()); 42 | 43 | if (v == null) { 44 | return null; 45 | } 46 | 47 | v.setPressed(false); 48 | 49 | // Create a copy of the drawing cache so that it does not get 50 | // recycled by the framework when the list tries to clean up memory 51 | //v.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); 52 | v.setDrawingCacheEnabled(true); 53 | mFloatBitmap = Bitmap.createBitmap(v.getDrawingCache()); 54 | v.setDrawingCacheEnabled(false); 55 | 56 | if (mImageView == null) { 57 | mImageView = new ImageView(mListView.getContext()); 58 | } 59 | mImageView.setBackgroundColor(mFloatBGColor); 60 | mImageView.setPadding(0, 0, 0, 0); 61 | mImageView.setImageBitmap(mFloatBitmap); 62 | mImageView.setLayoutParams(new ViewGroup.LayoutParams(v.getWidth(), v.getHeight())); 63 | 64 | return mImageView; 65 | } 66 | 67 | /** 68 | * This does nothing 69 | */ 70 | @Override 71 | public void onDragFloatView(View floatView, Point position, Point touch) { 72 | // do nothing 73 | } 74 | 75 | /** 76 | * Removes the Bitmap from the ImageView created in 77 | * onCreateFloatView() and tells the system to recycle it. 78 | */ 79 | @Override 80 | public void onDestroyFloatView(View floatView) { 81 | ((ImageView) floatView).setImageDrawable(null); 82 | 83 | mFloatBitmap.recycle(); 84 | mFloatBitmap = null; 85 | } 86 | 87 | } 88 | 89 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/sortlistview/PinyinComparator.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.sortlistview; 2 | 3 | import java.util.Comparator; 4 | 5 | /** 6 | * [A brief description] 7 | * 8 | * @author devin.hu 9 | * @version 1.0 10 | * @date 2014-2-7 11 | * 12 | **/ 13 | public class PinyinComparator implements Comparator { 14 | 15 | public int compare(SortModel o1, SortModel o2) { 16 | if (o1.getSortLetters().equals("@") || o2.getSortLetters().equals("#")) { 17 | return -1; 18 | } else if (o1.getSortLetters().equals("#") 19 | || o2.getSortLetters().equals("@")) { 20 | return 1; 21 | } else { 22 | return o1.getSortLetters().compareTo(o2.getSortLetters()); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/sortlistview/SortModel.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.sortlistview; 2 | 3 | /** 4 | * [A brief description] 5 | * 6 | * @author devin.hu 7 | * @version 1.0 8 | * @date 2014-2-7 9 | * 10 | **/ 11 | public class SortModel { 12 | 13 | // 显示的数据 14 | private String name; 15 | 16 | // 显示数据拼音的首字母 17 | private String sortLetters; 18 | 19 | private String deviceId; 20 | 21 | private String userId; 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public String getSortLetters() { 32 | return sortLetters; 33 | } 34 | 35 | public void setSortLetters(String sortLetters) { 36 | this.sortLetters = sortLetters; 37 | } 38 | 39 | public String getDeviceId() { 40 | return deviceId; 41 | } 42 | 43 | public void setDeviceId(String deviceId) { 44 | this.deviceId = deviceId; 45 | } 46 | 47 | public String getUserId() { 48 | return userId; 49 | } 50 | 51 | public void setUserId(String userId) { 52 | this.userId = userId; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/swipeListview/BaseSwipeListViewListener.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.swipeListview; 2 | 3 | /** 4 | * [A brief description] 5 | * 6 | * @author devin.hu 7 | * @version 1.0 8 | * @date 2014-2-7 9 | * 10 | **/ 11 | public class BaseSwipeListViewListener implements SwipeListViewListener { 12 | 13 | @Override 14 | public void onOpened(int position, boolean toRight) { 15 | } 16 | 17 | @Override 18 | public void onClosed(int position, boolean fromRight) { 19 | } 20 | 21 | @Override 22 | public void onListChanged() { 23 | } 24 | 25 | @Override 26 | public void onMove(int position, float x) { 27 | } 28 | 29 | @Override 30 | public void onStartOpen(int position, int action, boolean right) { 31 | } 32 | 33 | @Override 34 | public void onStartClose(int position, boolean right) { 35 | } 36 | 37 | @Override 38 | public void onClickFrontView(int position) { 39 | } 40 | 41 | @Override 42 | public void onClickBackView(int position) { 43 | } 44 | 45 | @Override 46 | public void onDismiss(int[] reverseSortedPositions) { 47 | } 48 | 49 | @Override 50 | public int onChangeSwipeMode(int position) { 51 | return SwipeListView.SWIPE_MODE_DEFAULT; 52 | } 53 | 54 | @Override 55 | public void onChoiceChanged(int position, boolean selected) { 56 | } 57 | 58 | @Override 59 | public void onChoiceStarted() { 60 | } 61 | 62 | @Override 63 | public void onChoiceEnded() { 64 | } 65 | 66 | @Override 67 | public void onFirstListItem() { 68 | } 69 | 70 | @Override 71 | public void onLastListItem() { 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/swipeListview/SwipeListViewListener.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.swipeListview; 2 | 3 | /** 4 | * Listener to get callback notifications for the SwipeListView 5 | */ 6 | public interface SwipeListViewListener { 7 | 8 | /** 9 | * Called when open animation finishes 10 | * @param position list item 11 | * @param toRight Open to right 12 | */ 13 | void onOpened(int position, boolean toRight); 14 | 15 | /** 16 | * Called when close animation finishes 17 | * @param position list item 18 | * @param fromRight Close from right 19 | */ 20 | void onClosed(int position, boolean fromRight); 21 | 22 | /** 23 | * Called when the list changed 24 | */ 25 | void onListChanged(); 26 | 27 | /** 28 | * Called when user is moving an item 29 | * @param position list item 30 | * @param x Current position X 31 | */ 32 | void onMove(int position, float x); 33 | 34 | /** 35 | * Start open item 36 | * @param position list item 37 | * @param action current action 38 | * @param right to right 39 | */ 40 | void onStartOpen(int position, int action, boolean right); 41 | 42 | /** 43 | * Start close item 44 | * @param position list item 45 | * @param right 46 | */ 47 | void onStartClose(int position, boolean right); 48 | 49 | /** 50 | * Called when user clicks on the front view 51 | * @param position list item 52 | */ 53 | void onClickFrontView(int position); 54 | 55 | /** 56 | * Called when user clicks on the back view 57 | * @param position list item 58 | */ 59 | void onClickBackView(int position); 60 | 61 | /** 62 | * Called when user dismisses items 63 | * @param reverseSortedPositions Items dismissed 64 | */ 65 | void onDismiss(int[] reverseSortedPositions); 66 | 67 | /** 68 | * Used when user want to change swipe list mode on some rows. Return SWIPE_MODE_DEFAULT 69 | * if you don't want to change swipe list mode 70 | * @param position position that you want to change 71 | * @return type 72 | */ 73 | int onChangeSwipeMode(int position); 74 | 75 | /** 76 | * Called when user choice item 77 | * @param position position that choice 78 | * @param selected if item is selected or not 79 | */ 80 | void onChoiceChanged(int position, boolean selected); 81 | 82 | /** 83 | * User start choice items 84 | */ 85 | void onChoiceStarted(); 86 | 87 | /** 88 | * User end choice items 89 | */ 90 | void onChoiceEnded(); 91 | 92 | /** 93 | * User is in first item of list 94 | */ 95 | void onFirstListItem(); 96 | 97 | /** 98 | * User is in last item of list 99 | */ 100 | void onLastListItem(); 101 | 102 | } 103 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/ItemsRange.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel; 2 | 3 | /** 4 | * [Range for visible items] 5 | * 6 | * @author: devin.hu 7 | * @version: 1.0 8 | * @date: Oct 17, 2013 9 | */ 10 | public class ItemsRange { 11 | 12 | /** 13 | * First item number 14 | */ 15 | private int first; 16 | 17 | /** 18 | * Items count 19 | */ 20 | private int count; 21 | 22 | /** 23 | * Default constructor. Creates an empty range 24 | */ 25 | public ItemsRange() { 26 | this(0, 0); 27 | } 28 | 29 | /** 30 | * Constructor 31 | * 32 | * @param first 33 | * the number of first item 34 | * @param count 35 | * the count of items 36 | */ 37 | public ItemsRange(int first, int count) { 38 | this.first = first; 39 | this.count = count; 40 | } 41 | 42 | /** 43 | * Gets number of first item 44 | * 45 | * @return the number of the first item 46 | */ 47 | public int getFirst() { 48 | return first; 49 | } 50 | 51 | /** 52 | * Gets number of last item 53 | * 54 | * @return the number of last item 55 | */ 56 | public int getLast() { 57 | return getFirst() + getCount() - 1; 58 | } 59 | 60 | /** 61 | * Get items count 62 | * 63 | * @return the count of items 64 | */ 65 | public int getCount() { 66 | return count; 67 | } 68 | 69 | /** 70 | * Tests whether item is contained by range 71 | * 72 | * @param index 73 | * the item number 74 | * @return true if item is contained 75 | */ 76 | public boolean contains(int index) { 77 | return index >= getFirst() && index <= getLast(); 78 | } 79 | } -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/OnWheelChangedListener.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel; 2 | 3 | /** 4 | * [ Wheel changed listener interface.] 5 | * The onChanged() method is called whenever current wheel positions is changed: 6 | * New Wheel position is set; Wheel view is scrolled 7 | * 8 | * @author: devin.hu 9 | * @version: 1.0 10 | * @date: Oct 17, 2013 11 | */ 12 | public interface OnWheelChangedListener { 13 | 14 | /** 15 | * Callback method to be invoked when current item changed 16 | * 17 | * @param wheel 18 | * the wheel view whose state has changed 19 | * @param oldValue 20 | * the old value of current item 21 | * @param newValue 22 | * the new value of current item 23 | */ 24 | void onChanged(WheelView wheel, int oldValue, int newValue); 25 | } 26 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/OnWheelClickedListener.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel; 2 | 3 | /** 4 | * Wheel clicked listener interface. 5 | *

The onItemClicked() method is called whenever a wheel item is clicked 6 | *

  • New Wheel position is set 7 | *
  • Wheel view is scrolled 8 | * 9 | * @author: devin.hu 10 | * @version: 1.0 11 | * @date: Oct 17, 2013 12 | */ 13 | public interface OnWheelClickedListener { 14 | /** 15 | * Callback method to be invoked when current item clicked 16 | * @param wheel the wheel view 17 | * @param itemIndex the index of clicked item 18 | */ 19 | void onItemClicked(WheelView wheel, int itemIndex); 20 | } 21 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/OnWheelScrollListener.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel; 2 | 3 | /** 4 | * [Wheel scrolled listener interface] 5 | * @author: devin.hu 6 | * @version: 1.0 7 | * @date: Oct 17, 2013 8 | */ 9 | public interface OnWheelScrollListener { 10 | /** 11 | * Callback method to be invoked when scrolling started. 12 | * @param wheel the wheel view whose state has changed. 13 | */ 14 | void onScrollingStarted(WheelView wheel); 15 | 16 | /** 17 | * Callback method to be invoked when scrolling ended. 18 | * @param wheel the wheel view whose state has changed. 19 | */ 20 | void onScrollingFinished(WheelView wheel); 21 | } 22 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/adapter/AbstractWheelAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel.adapter; 2 | 3 | import java.util.LinkedList; 4 | import java.util.List; 5 | 6 | import android.database.DataSetObserver; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | 10 | 11 | /** 12 | * [Abstract Wheel adapter] 13 | * @author: devin.hu 14 | * @version: 1.0 15 | * @date: Oct 17, 2013 16 | */ 17 | public abstract class AbstractWheelAdapter implements WheelViewAdapter { 18 | 19 | /** 20 | * datasetObservers 21 | */ 22 | private List datasetObservers; 23 | 24 | @Override 25 | public View getEmptyItem(View convertView, ViewGroup parent) { 26 | return null; 27 | } 28 | 29 | @Override 30 | public void registerDataSetObserver(DataSetObserver observer) { 31 | if (datasetObservers == null) { 32 | datasetObservers = new LinkedList(); 33 | } 34 | datasetObservers.add(observer); 35 | } 36 | 37 | @Override 38 | public void unregisterDataSetObserver(DataSetObserver observer) { 39 | if (datasetObservers != null) { 40 | datasetObservers.remove(observer); 41 | } 42 | } 43 | 44 | /** 45 | * Notifies observers about data changing 46 | */ 47 | protected void notifyDataChangedEvent() { 48 | if (datasetObservers != null) { 49 | for (DataSetObserver observer : datasetObservers) { 50 | observer.onChanged(); 51 | } 52 | } 53 | } 54 | 55 | /** 56 | * Notifies observers about invalidating data 57 | */ 58 | protected void notifyDataInvalidatedEvent() { 59 | if (datasetObservers != null) { 60 | for (DataSetObserver observer : datasetObservers) { 61 | observer.onInvalidated(); 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/adapter/AdapterWheel.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel.adapter; 2 | 3 | import android.content.Context; 4 | 5 | 6 | /** 7 | * [Adapter class for old wheel adapter (deprecated WheelAdapter class)] 8 | * @author: devin.hu 9 | * @version: 1.0 10 | * @date: Oct 17, 2013 11 | * @deprecated Will be removed soon 12 | */ 13 | public class AdapterWheel extends AbstractWheelTextAdapter { 14 | 15 | // Source adapter 16 | private WheelAdapter adapter; 17 | 18 | /** 19 | * Constructor 20 | * @param context the current context 21 | * @param adapter the source adapter 22 | */ 23 | public AdapterWheel(Context context, WheelAdapter adapter) { 24 | super(context); 25 | 26 | this.adapter = adapter; 27 | } 28 | 29 | /** 30 | * Gets original adapter 31 | * @return the original adapter 32 | */ 33 | public WheelAdapter getAdapter() { 34 | return adapter; 35 | } 36 | 37 | @Override 38 | public int getItemsCount() { 39 | return adapter.getItemsCount(); 40 | } 41 | 42 | @Override 43 | protected CharSequence getItemText(int index) { 44 | return adapter.getItem(index); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/adapter/ArrayWheelAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel.adapter; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * @param the element type 7 | * [The simple Array wheel adapter] 8 | * 9 | * @author: devin.hu 10 | * @version: 1.0 11 | * @date: Oct 17, 2013 12 | */ 13 | public class ArrayWheelAdapter extends AbstractWheelTextAdapter { 14 | 15 | /** 16 | * items 17 | */ 18 | private T items[]; 19 | 20 | /** 21 | * Constructor 22 | * @param context the current context 23 | * @param items the items 24 | */ 25 | public ArrayWheelAdapter(Context context, T items[]) { 26 | super(context); 27 | //setEmptyItemResource(TEXT_VIEW_ITEM_RESOURCE); 28 | this.items = items; 29 | } 30 | 31 | @Override 32 | public CharSequence getItemText(int index) { 33 | if (index >= 0 && index < items.length) { 34 | T item = items[index]; 35 | if (item instanceof CharSequence) { 36 | return (CharSequence) item; 37 | } 38 | return item.toString(); 39 | } 40 | return null; 41 | } 42 | 43 | @Override 44 | public int getItemsCount() { 45 | return items.length; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/adapter/NumericWheelAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel.adapter; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * [Numeric Wheel adapter] 7 | * @author: devin.hu 8 | * @version: 1.0 9 | * @date: Oct 17, 2013 10 | */ 11 | public class NumericWheelAdapter extends AbstractWheelTextAdapter { 12 | 13 | /** The default min value */ 14 | public static final int DEFAULT_MAX_VALUE = 9; 15 | 16 | /** The default max value */ 17 | private static final int DEFAULT_MIN_VALUE = 0; 18 | 19 | // Values 20 | private int minValue; 21 | private int maxValue; 22 | 23 | // format 24 | private String format; 25 | 26 | /** 27 | * Constructor 28 | * @param context the current context 29 | */ 30 | public NumericWheelAdapter(Context context) { 31 | this(context, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE); 32 | } 33 | 34 | /** 35 | * Constructor 36 | * @param context the current context 37 | * @param minValue the wheel min value 38 | * @param maxValue the wheel max value 39 | */ 40 | public NumericWheelAdapter(Context context, int minValue, int maxValue) { 41 | this(context, minValue, maxValue, null); 42 | } 43 | 44 | /** 45 | * Constructor 46 | * @param context the current context 47 | * @param minValue the wheel min value 48 | * @param maxValue the wheel max value 49 | * @param format the format string 50 | */ 51 | public NumericWheelAdapter(Context context, int minValue, int maxValue, String format) { 52 | super(context); 53 | 54 | this.minValue = minValue; 55 | this.maxValue = maxValue; 56 | this.format = format; 57 | } 58 | 59 | @Override 60 | public CharSequence getItemText(int index) { 61 | if (index >= 0 && index < getItemsCount()) { 62 | int value = minValue + index; 63 | return format != null ? String.format(format, value) : Integer.toString(value); 64 | } 65 | return null; 66 | } 67 | 68 | @Override 69 | public int getItemsCount() { 70 | return maxValue - minValue + 1; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/adapter/WheelAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel.adapter; 2 | 3 | /** 4 | * [Wheel adapter interface] 5 | * @author: devin.hu 6 | * @version: 1.0 7 | * @date: Oct 17, 2013 8 | * @deprecated Use WheelViewAdapter 9 | */ 10 | public interface WheelAdapter { 11 | /** 12 | * Gets items count 13 | * @return the count of wheel items 14 | */ 15 | public int getItemsCount(); 16 | 17 | /** 18 | * Gets a wheel item by index. 19 | * 20 | * @param index the item index 21 | * @return the wheel item text or null 22 | */ 23 | public String getItem(int index); 24 | 25 | /** 26 | * Gets maximum item length. It is used to determine the wheel width. 27 | * If -1 is returned there will be used the default wheel width. 28 | * 29 | * @return the maximum item length or -1 30 | */ 31 | public int getMaximumLength(); 32 | } 33 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/widget/wheel/adapter/WheelViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.widget.wheel.adapter; 2 | 3 | import android.database.DataSetObserver; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | 7 | /** 8 | * [Wheel items adapter interface] 9 | * @author: devin.hu 10 | * @version: 1.0 11 | * @date: Oct 17, 2013 12 | */ 13 | public interface WheelViewAdapter { 14 | /** 15 | * Gets items count 16 | * @return the count of wheel items 17 | */ 18 | public int getItemsCount(); 19 | 20 | /** 21 | * Get a View that displays the data at the specified position in the data set 22 | * 23 | * @param index the item index 24 | * @param convertView the old view to reuse if possible 25 | * @param parent the parent that this view will eventually be attached to 26 | * @return the wheel item View 27 | */ 28 | public View getItem(int index, View convertView, ViewGroup parent); 29 | 30 | /** 31 | * Get a View that displays an empty wheel item placed before the first or after 32 | * the last wheel item. 33 | * 34 | * @param convertView the old view to reuse if possible 35 | * @param parent the parent that this view will eventually be attached to 36 | * @return the empty item View 37 | */ 38 | public View getEmptyItem(View convertView, ViewGroup parent); 39 | 40 | /** 41 | * Register an observer that is called when changes happen to the data used by this adapter. 42 | * @param observer the observer to be registered 43 | */ 44 | public void registerDataSetObserver(DataSetObserver observer); 45 | 46 | /** 47 | * Unregister an observer that has previously been registered 48 | * @param observer the observer to be unregistered 49 | */ 50 | void unregisterDataSetObserver (DataSetObserver observer); 51 | } 52 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/wxapi/AppRegister.java: -------------------------------------------------------------------------------- 1 | /* 2 | Fmms Android Client, AppRegister 3 | Copyright (c) 2015 Fmms Tech Company Limited 4 | */ 5 | 6 | package com.sd.one.wxapi; 7 | 8 | import android.content.BroadcastReceiver; 9 | import android.content.Context; 10 | import android.content.Intent; 11 | 12 | import com.sd.one.common.Constants; 13 | import com.tencent.mm.sdk.openapi.IWXAPI; 14 | import com.tencent.mm.sdk.openapi.WXAPIFactory; 15 | 16 | /** 17 | * [A brief description] 18 | * 19 | * @author huxinwu 20 | * @version 1.0 21 | * @date 2015-8-4 22 | * 23 | **/ 24 | public class AppRegister extends BroadcastReceiver { 25 | 26 | @Override 27 | public void onReceive(Context context, Intent arg1) { 28 | final IWXAPI api = WXAPIFactory.createWXAPI(context, null); 29 | api.registerApp(Constants.WEIXIN_APP_ID); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/java/com/sd/one/wxapi/WXPayEntryActivity.java: -------------------------------------------------------------------------------- 1 | package com.sd.one.wxapi; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.widget.Toast; 7 | 8 | import com.sd.one.R; 9 | import com.sd.one.common.Constants; 10 | import com.tencent.mm.sdk.constants.ConstantsAPI; 11 | import com.tencent.mm.sdk.modelbase.BaseReq; 12 | import com.tencent.mm.sdk.modelbase.BaseResp; 13 | import com.tencent.mm.sdk.openapi.IWXAPI; 14 | import com.tencent.mm.sdk.openapi.IWXAPIEventHandler; 15 | import com.tencent.mm.sdk.openapi.WXAPIFactory; 16 | 17 | /** 18 | * [微信支付回调页面] 19 | * 20 | * @author huxinwu 21 | * @version 1.0 22 | * @date 2015-8-4 23 | * 24 | **/ 25 | public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler{ 26 | 27 | private IWXAPI api; 28 | 29 | @Override 30 | public void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | setContentView(R.layout.pay_result); 33 | api = WXAPIFactory.createWXAPI(this, Constants.WEIXIN_APP_ID); 34 | api.handleIntent(getIntent(), this); 35 | } 36 | 37 | @Override 38 | protected void onNewIntent(Intent intent) { 39 | super.onNewIntent(intent); 40 | setIntent(intent); 41 | api.handleIntent(intent, this); 42 | } 43 | 44 | @Override 45 | public void onReq(BaseReq req) { 46 | 47 | } 48 | 49 | @Override 50 | public void onResp(BaseResp resp) { 51 | if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) { 52 | if(0 == resp.errCode){ 53 | Toast.makeText(this, "支付成功", 1000).show(); 54 | WXPayEntryActivity.this.finish(); 55 | }else{ 56 | Toast.makeText(this, "支付失败", 1000).show(); 57 | WXPayEntryActivity.this.finish(); 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/anim/slide_in_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/anim/slide_in_from_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/anim/slide_out_to_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/anim/slide_out_to_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/ad.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/background_item.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/background_item.9.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/drag.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/drag.9.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/drag_delete_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/drag_delete_x.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/drag_icon.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/drag_icon.9.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/drawer_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/drawer_menu.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_1.jpg -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_2.jpg -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_3.jpg -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/guidepage_4.jpg -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/page_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/page_indicator.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/page_indicator_focused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/page_indicator_focused.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/pulltorefresh_default_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/pulltorefresh_default_flip.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/pulltorefresh_default_rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/pulltorefresh_default_rotate.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/pulltorefresh_indicator_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/pulltorefresh_indicator_arrow.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/search_clear_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/search_clear_pressed.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/waterfall_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/waterfall_arrow.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-hdpi/waterfall_item_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-hdpi/waterfall_item_bg.9.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/bottom_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/bottom_bg.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_cart.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_cart_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_cart_press.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_category.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_category_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_category_press.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_collection.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_collection_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_collection_press.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_home.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_home_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_home_press.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_member.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/btn_member_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/btn_member_press.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devinhu/androidone/a09166b8150f9d9dedfe271112a4f8707af07b7a/studioOne/androidOne/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/pulltorefresh_bg_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/pulltorefresh_bg_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/selector_menu_cart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/selector_menu_category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/selector_menu_collection.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/selector_menu_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/selector_menu_member.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/selector_menu_txt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/sidebar_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/slidingtab_background_tab.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/wheel_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/drawable/wheel_val.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/layout/cart_layout.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/layout/category_layout.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/layout/collection_layout.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/layout/home_layout.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /studioOne/androidOne/src/main/res/layout/layout_base.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 |