diff --git a/.gitignore b/.gitignore index ccf2efe..d231812 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,42 @@ -# Built application files -*.apk -*.ap_ +# Android generated +bin +gen +lint.xml -# Files for the Dalvik VM -*.dex +# IntelliJ IDEA +.idea +*.iml +*.ipr +*.iws +classes +gen-external-apklibs -# Java class files -*.class +# Eclipse +.project +.classpath +.settings +.checkstyle -# Generated files -bin/ -gen/ +# Gradle +.gradle +build +out -# Gradle files -.gradle/ -build/ -/*/build/ +# Maven +target +release.properties +pom.xml.* -# Local configuration file (sdk path, etc) +# Ant +ant.properties local.properties +proguard.cfg +proguard-project.txt + +# Other +.DS_Store +dist +tmp # Proguard folder generated by Eclipse proguard/ diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 3b70d9a..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -SimplifyReaderGit \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 96cc43e..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/obsessive.xml b/.idea/copyright/obsessive.xml deleted file mode 100644 index de40639..0000000 --- a/.idea/copyright/obsessive.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 9cc2906..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/dictionaries/chentao.xml b/.idea/dictionaries/chentao.xml deleted file mode 100644 index f92347d..0000000 --- a/.idea/dictionaries/chentao.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index afade3d..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3eaf84b..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Obsessive - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e633446..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 8915565..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1439967590817 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 5d489a8..f4b88d1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +## 说明 +***由于项目是几年前开发的,很多第三方库都已经更新了,导致安装或者编译失败,如果不能正常运行的,请查看Log自行解决,代码也是几年前的代码,只做参考。*** + + + ###简阅 @@ -5,19 +10,19 @@ ###效果图 -![image](https://raw.githubusercontent.com/SkillCollege/server/master/SimplifyReader/images/all_in_one.jpg) +![image](https://raw.githubusercontent.com/chentao0707/server/master/SimplifyReader/images/all_in_one.jpg) -![image](https://raw.githubusercontent.com/SkillCollege/server/master/SimplifyReader/images/project.gif) +![image](https://raw.githubusercontent.com/chentao0707/server/master/SimplifyReader/images/project.gif) -![image](https://raw.githubusercontent.com/SkillCollege/server/master/SimplifyReader/images/qrcode.gif) +![image](https://raw.githubusercontent.com/chentao0707/server/master/SimplifyReader/images/qrcode.gif) -![image](https://raw.githubusercontent.com/SkillCollege/server/master/SimplifyReader/images/project_struct.png) +![image](https://raw.githubusercontent.com/chentao0707/server/master/SimplifyReader/images/project_struct.png) ###Demo下载 -[火速跳转](https://fir.im/simplifyreader) | [Download-APK](https://raw.githubusercontent.com/SkillCollege/server/master/SimplifyReader/apks/app-debug.apk) +[火速跳转](https://fir.im/simplifyreader) | [Download-APK](https://raw.githubusercontent.com/chentao0707/server/master/SimplifyReader/apks/app-debug.apk) -![image](https://raw.githubusercontent.com/SkillCollege/server/master/SimplifyReader/images/download.png) +![image](https://raw.githubusercontent.com/chentao0707/server/master/SimplifyReader/images/download.png) ###模块分析 @@ -161,15 +166,15 @@ ###关于我 * **QQ:** 1076559197 -* **QQ Tribe:** 271918140 [https://github.com/liaohuqiu/qq-tribe-rule](https://github.com/liaohuqiu/qq-tribe-rule) +* **QQ Tribe:** 345470463 * **Weibo:** [http://weibo.com/obsessive1990](http://weibo.com/obsessive1990) * **Email:** [1076559197@qq.com](mailto:1076559197@qq.com) | [tchen0707@gmail.com](mailto:tchen0707@gmail.com) -* **Github:** [https://github.com/skillcollege](https://github.com/skillcollege) -* **Blog:** [https://skillcollege.github.io](https://skillcollege.github.io) | [http://blog.csdn.net/skillcollege](http://blog.csdn.net/skillcollege) +* **Github:** [https://github.com/chentao0707](https://github.com/chentao0707) +* **Blog:** [http://www.qingcore.com](http://www.qingcore.com) ###项目主页 -[http://skillcollege.github.io/SimplifyReader/](http://skillcollege.github.io/SimplifyReader/) +[http://www.qingcore.com/SimplifyReader/](http://www.qingcore.com/SimplifyReader/) ###License @@ -187,4 +192,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -``` \ No newline at end of file +``` diff --git a/SimplifyReader.iml b/SimplifyReader.iml deleted file mode 100644 index 53dad9e..0000000 --- a/SimplifyReader.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SimplifyReaderGit.iml b/SimplifyReaderGit.iml deleted file mode 100644 index f915c84..0000000 --- a/SimplifyReaderGit.iml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore index 796b96d..94114d9 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,39 @@ -/build +# Android generated +bin +gen +lint.xml + +# IntelliJ IDEA +.idea +*.iml +*.ipr +*.iws +classes +gen-external-apklibs + +# Eclipse +.project +.classpath +.settings +.checkstyle + +# Gradle +.gradle +build +out + +# Maven +target +release.properties +pom.xml.* + +# Ant +ant.properties +local.properties +proguard.cfg +proguard-project.txt + +# Other +.DS_Store +dist +tmp \ No newline at end of file diff --git a/app/app.iml b/app/app.iml index e6cbf7d..d4780cb 100644 --- a/app/app.iml +++ b/app/app.iml @@ -1,5 +1,5 @@ - + @@ -91,23 +91,24 @@ - - + + - - - + + + - - - + + + - + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 8b0e741..791dd28 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,8 +18,8 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 22 - buildToolsVersion '22.0.1' + compileSdkVersion 23 + buildToolsVersion '23.0.2' defaultConfig { applicationId "com.github.obsessive.simplifyreader" minSdkVersion 10 @@ -48,6 +48,8 @@ android { packagingOptions { exclude 'META-INF/services/javax.annotation.processing.Processor' + exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml' + exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties' } productFlavors { diff --git a/app/src/main/java/com/github/obsessive/simplifyreader/interactor/impl/ImagesContainerInteractorImpl.java b/app/src/main/java/com/github/obsessive/simplifyreader/interactor/impl/ImagesContainerInteractorImpl.java index d6ffb44..11c4c61 100644 --- a/app/src/main/java/com/github/obsessive/simplifyreader/interactor/impl/ImagesContainerInteractorImpl.java +++ b/app/src/main/java/com/github/obsessive/simplifyreader/interactor/impl/ImagesContainerInteractorImpl.java @@ -35,13 +35,14 @@ public class ImagesContainerInteractorImpl implements CommonContainerInteractor @Override public List getCommonCategoryList(Context context) { List resultData = new ArrayList<>(); - String[] imagesCategoryArray = context.getResources().getStringArray(R.array.images_category_list); - resultData.add(new BaseEntity(imagesCategoryArray[0], imagesCategoryArray[0])); - resultData.add(new BaseEntity(imagesCategoryArray[1], imagesCategoryArray[1])); - resultData.add(new BaseEntity(imagesCategoryArray[2], imagesCategoryArray[2])); - resultData.add(new BaseEntity(imagesCategoryArray[3], imagesCategoryArray[3])); - resultData.add(new BaseEntity(imagesCategoryArray[4], imagesCategoryArray[4])); - resultData.add(new BaseEntity(imagesCategoryArray[5], imagesCategoryArray[5])); + String[] imagesCategoryArrayId = context.getResources().getStringArray(R.array.images_category_list_id); + String[] imagesCategoryArrayName = context.getResources().getStringArray(R.array.images_category_list_name); + resultData.add(new BaseEntity(imagesCategoryArrayId[0], imagesCategoryArrayName[0])); + resultData.add(new BaseEntity(imagesCategoryArrayId[1], imagesCategoryArrayName[1])); + resultData.add(new BaseEntity(imagesCategoryArrayId[2], imagesCategoryArrayName[2])); + resultData.add(new BaseEntity(imagesCategoryArrayId[3], imagesCategoryArrayName[3])); + resultData.add(new BaseEntity(imagesCategoryArrayId[4], imagesCategoryArrayName[4])); + resultData.add(new BaseEntity(imagesCategoryArrayId[5], imagesCategoryArrayName[5])); return resultData; } } diff --git a/app/src/main/java/com/github/obsessive/simplifyreader/player/MusicPlayer.java b/app/src/main/java/com/github/obsessive/simplifyreader/player/MusicPlayer.java index eeac696..4d27cd2 100755 --- a/app/src/main/java/com/github/obsessive/simplifyreader/player/MusicPlayer.java +++ b/app/src/main/java/com/github/obsessive/simplifyreader/player/MusicPlayer.java @@ -125,6 +125,7 @@ public void replay() { mMediaPlayer.start(); mPlayState = MusicPlayState.MPS_PLAYING; + sendPlayCurrentPosition(); } public void pause() { diff --git a/app/src/main/java/com/github/obsessive/simplifyreader/ui/activity/SplashActivity.java b/app/src/main/java/com/github/obsessive/simplifyreader/ui/activity/SplashActivity.java index 056be00..e434425 100644 --- a/app/src/main/java/com/github/obsessive/simplifyreader/ui/activity/SplashActivity.java +++ b/app/src/main/java/com/github/obsessive/simplifyreader/ui/activity/SplashActivity.java @@ -128,7 +128,7 @@ public void initializeViews(String versionName, String copyright, int background @Override public void initializeUmengConfig() { - AnalyticsConfig.setAppkey("55018d77fd98c5901e000a09"); + AnalyticsConfig.setAppkey(this, "55018d77fd98c5901e000a09"); AnalyticsConfig.setChannel("SimplifyReader"); } diff --git a/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/ImagesListFragment.java b/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/ImagesListFragment.java index e71aff4..51082b7 100644 --- a/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/ImagesListFragment.java +++ b/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/ImagesListFragment.java @@ -16,6 +16,7 @@ package com.github.obsessive.simplifyreader.ui.fragment; +import android.graphics.Rect; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import android.view.LayoutInflater; @@ -79,7 +80,7 @@ public class ImagesListFragment extends BaseFragment implements ImagesListView, @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mCurrentImagesCategory = getResources().getStringArray(R.array.images_category_list)[0]; + mCurrentImagesCategory = getResources().getStringArray(R.array.images_category_list_id)[0]; } @Override @@ -276,8 +277,14 @@ public void onClick(View v) { @Override public void onItemClick(PLAAdapterView parent, View view, int position, long id) { + Rect frame = new Rect(); + getActivity().getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); + int statusBarHeight = frame.top; + int[] location = new int[2]; view.getLocationOnScreen(location); + location[1] += statusBarHeight; + int width = view.getWidth(); int height = view.getHeight(); diff --git a/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/MusicsFragment.java b/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/MusicsFragment.java index dc6066f..b9a225e 100644 --- a/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/MusicsFragment.java +++ b/app/src/main/java/com/github/obsessive/simplifyreader/ui/fragment/MusicsFragment.java @@ -151,7 +151,9 @@ public void onActivityCreated(Bundle savedInstanceState) { @Override public void onDetach() { super.onDetach(); - mMusicsPresenter.onStopPlay(); + if(mMusicsPresenter != null) { + mMusicsPresenter.onStopPlay(); + } mContext.unregisterReceiver(mBundleBroadCast); mContext.unregisterReceiver(mPositionBroadCast); mContext.unregisterReceiver(mSecondProgressBroadCast); diff --git a/app/src/main/java/com/github/obsessive/simplifyreader/utils/UriHelper.java b/app/src/main/java/com/github/obsessive/simplifyreader/utils/UriHelper.java index 422bb73..b9ffb51 100644 --- a/app/src/main/java/com/github/obsessive/simplifyreader/utils/UriHelper.java +++ b/app/src/main/java/com/github/obsessive/simplifyreader/utils/UriHelper.java @@ -114,7 +114,7 @@ public String getDoubanPlayListUrl(String channelId) { sb.append(ApiConstants.Urls.DOUBAN_PLAY_LIST_URLS); sb.append("?channel="); sb.append(channelId); - sb.append("&app_name=radio_desktop_win&version=100&type=&sid=0"); + sb.append("&app_name=radio_android&version=100&type=&sid=0"); return sb.toString().trim(); } } diff --git a/app/src/main/res/layout/activity_capture.xml b/app/src/main/res/layout/activity_capture.xml index 1d5c2ea..e5a0bd3 100644 --- a/app/src/main/res/layout/activity_capture.xml +++ b/app/src/main/res/layout/activity_capture.xml @@ -18,6 +18,7 @@ diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml index fc0e1b7..511a906 100644 --- a/app/src/main/res/layout/activity_splash.xml +++ b/app/src/main/res/layout/activity_splash.xml @@ -33,7 +33,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/app_name" - android:textSize="60sp" + android:textSize="50sp" android:textStyle="bold" android:textColor="@android:color/white" android:layout_centerHorizontal="true" diff --git a/app/src/main/res/values-zh/arrays.xml b/app/src/main/res/values-zh/arrays.xml new file mode 100644 index 0000000..30d2070 --- /dev/null +++ b/app/src/main/res/values-zh/arrays.xml @@ -0,0 +1,68 @@ + + + + + + 图片浏览 + 视频爽看 + 音乐轻听 + + + + 头条 + 汽车 + 房产 + 科技 + 星座 + 旅游 + 时尚 + 娱乐 + + + + 美女 + 动漫 + 明星 + 汽车 + 摄影 + 美食 + + + + 美女 + 动漫 + 明星 + 汽车 + 摄影 + 美食 + + + + 热门 + 搞笑 + 动漫 + 综艺 + + + + 当前版本 + 关于作者 + 项目主页 + 项目介绍 + 开源项目说明 + + \ No newline at end of file diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml new file mode 100644 index 0000000..592fa2e --- /dev/null +++ b/app/src/main/res/values-zh/strings.xml @@ -0,0 +1,39 @@ + + + 简阅 + DrawerOpen + DrawerClose + 扫一扫 + 关于我们 + 意见反馈 + Copyright © 2015 SimplifyReader All Rights Reserved\nPowered by Obsessive and Chris + 看尽生活中的点滴 + V %1$s + 再按一次退出 + 没有更多了 + 感谢您提出反馈意见,我会尽快回复 + + + 视频播放 + 观看次数\t + 收藏次数\t + 评论次数\t + 发布于\t + 标签 + + 历史 + 图片 + 灯光 + 确定 + 二维码 + 条形码 + 打开相机失败,请确保允许应用使用相机权限后重试! + 未解析到任何数据 + + 本地相册 + 2.6.0.1.20150312 + 图片下载失败 + 获取新闻URL失败 + 正在下载: + 图标 + \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 4eb76db..e7014fe 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1,5 +1,4 @@ - - - 获取新闻URL失败 - 图片下载失败 + Failed to fetch news url + Failed to download the picture \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c7f3bb9..0922472 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,36 +17,37 @@ - 简阅 + SimplifyReader DrawerOpen DrawerClose - 扫一扫 - 关于我们 - 意见反馈 - Copyright © 2015 SimplifyReader All Rights Reserved\nPower by Obsessive and Chris - 看尽生活中的点滴 + Scan QR Code + About us + Feedback + Copyright © 2015 SimplifyReader All Rights Reserved\nPowered by Obsessive and Chris + Go through the every bit of life V %1$s - 再按一次退出 - 没有更多了 - 感谢您提出反馈意见,我会尽快回复 + Press again to exit + No more content + Thanks for your feedback, I will reply as soon as possible - 视频播放 - 观看次数\t - 收藏次数\t - 评论次数\t - 发布于\t - 标签 + Media Player + Times watched\t + Favorites\t + Comments\t + Posted on\t + Tags - 历史 - 图片 - 灯光 - 确定 - 二维码 - 条形码 - 打开相机失败,请确保允许应用使用相机权限后重试! - 未解析到任何数据 + History + Picture + Light + Ok + QR Code + Barcode + Failed to open camera, please ensure the permission is allowed and try again + No data resolved - 本地相册 + Local photo album + Downloading: diff --git a/app/src/main/res/values/tb_munion_strings.xml b/app/src/main/res/values/tb_munion_strings.xml index b12a733..25db0b3 100644 --- a/app/src/main/res/values/tb_munion_strings.xml +++ b/app/src/main/res/values/tb_munion_strings.xml @@ -18,6 +18,5 @@ #e3e3e3 - 正在下载: \ No newline at end of file diff --git a/build.gradle b/build.gradle index 795b6b3..64a1575 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies{ - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:1.5.0' } } @@ -28,5 +28,6 @@ allprojects { jcenter() mavenCentral() maven { url "https://raw.githubusercontent.com/umeng/mvn-repo-umeng/master/repository" } + maven { url "https://jitpack.io" } } } diff --git a/library/.gitignore b/library/.gitignore index 796b96d..94114d9 100644 --- a/library/.gitignore +++ b/library/.gitignore @@ -1 +1,39 @@ -/build +# Android generated +bin +gen +lint.xml + +# IntelliJ IDEA +.idea +*.iml +*.ipr +*.iws +classes +gen-external-apklibs + +# Eclipse +.project +.classpath +.settings +.checkstyle + +# Gradle +.gradle +build +out + +# Maven +target +release.properties +pom.xml.* + +# Ant +ant.properties +local.properties +proguard.cfg +proguard-project.txt + +# Other +.DS_Store +dist +tmp \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index 93ae84e..402e4e0 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -17,8 +17,10 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 22 - buildToolsVersion '22.0.1' + compileSdkVersion 23 + buildToolsVersion '23.0.2' + useLibrary 'org.apache.http.legacy' + defaultConfig { minSdkVersion 10 targetSdkVersion 22 @@ -40,18 +42,20 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:22.2.0' - compile 'com.android.support:cardview-v7:22.2.0' - compile 'com.android.support:design:22.2.0' + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.android.support:cardview-v7:23.1.1' + compile 'com.android.support:design:23.1.1' compile 'com.jakewharton:butterknife:5.1.1' compile 'com.google.code.gson:gson:2.2.4' compile 'me.gujun.android.taggroup:library:1.4@aar' compile 'com.nineoldandroids:library:2.4.0' compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' - compile 'com.github.chrisbanes.photoview:library:1.2.3' - compile 'com.afollestad:material-dialogs:0.7.6.0' + compile 'com.github.chrisbanes.photoview:library:1.2.2' + compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') { + transitive = true + } compile 'de.greenrobot:eventbus:2.4.0' compile 'com.squareup.okhttp:okhttp:2.4.0' } diff --git a/library/library.iml b/library/library.iml deleted file mode 100644 index 53a93d9..0000000 --- a/library/library.iml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/library/src/main/java/com/github/obsessive/library/base/BaseAppCompatActivity.java b/library/src/main/java/com/github/obsessive/library/base/BaseAppCompatActivity.java index 53b7d9b..4e1ce99 100644 --- a/library/src/main/java/com/github/obsessive/library/base/BaseAppCompatActivity.java +++ b/library/src/main/java/com/github/obsessive/library/base/BaseAppCompatActivity.java @@ -362,8 +362,9 @@ protected void readyGoForResult(Class clazz, int requestCode, Bundle bundle) * @param msg */ protected void showToast(String msg) { + //防止遮盖虚拟按键 if (null != msg && !CommonUtils.isEmpty(msg)) { - Snackbar.make(getWindow().getDecorView(), msg, Snackbar.LENGTH_SHORT).show(); + Snackbar.make(getLoadingTargetView(), msg, Snackbar.LENGTH_SHORT).show(); } } @@ -478,4 +479,4 @@ protected void setTranslucentStatus(boolean on) { win.setAttributes(winParams); } } -} \ No newline at end of file +} diff --git a/library/src/main/java/com/github/obsessive/library/base/BaseAppManager.java b/library/src/main/java/com/github/obsessive/library/base/BaseAppManager.java index 44ad6a9..f4794d8 100644 --- a/library/src/main/java/com/github/obsessive/library/base/BaseAppManager.java +++ b/library/src/main/java/com/github/obsessive/library/base/BaseAppManager.java @@ -63,9 +63,13 @@ private BaseAppManager() { } - public synchronized static BaseAppManager getInstance() { - if (instance == null) { - instance = new BaseAppManager(); + public static BaseAppManager getInstance() { + if (null == instance) { + synchronized (BaseAppManager.class) { + if (null == instance) { + instance = new BaseAppManager(); + } + } } return instance; } diff --git a/library/src/main/java/com/github/obsessive/library/netstatus/NetStateReceiver.java b/library/src/main/java/com/github/obsessive/library/netstatus/NetStateReceiver.java index 4eda1e5..14e14c6 100644 --- a/library/src/main/java/com/github/obsessive/library/netstatus/NetStateReceiver.java +++ b/library/src/main/java/com/github/obsessive/library/netstatus/NetStateReceiver.java @@ -43,8 +43,12 @@ public class NetStateReceiver extends BroadcastReceiver { private static BroadcastReceiver mBroadcastReceiver; private static BroadcastReceiver getReceiver() { - if (mBroadcastReceiver == null) { - mBroadcastReceiver = new NetStateReceiver(); + if (null == mBroadcastReceiver) { + synchronized (NetStateReceiver.class) { + if (null == mBroadcastReceiver) { + mBroadcastReceiver = new NetStateReceiver(); + } + } } return mBroadcastReceiver; } diff --git a/library/src/main/java/com/github/obsessive/library/widgets/SmoothImageView.java b/library/src/main/java/com/github/obsessive/library/widgets/SmoothImageView.java index 1f0ca53..61a8d88 100644 --- a/library/src/main/java/com/github/obsessive/library/widgets/SmoothImageView.java +++ b/library/src/main/java/com/github/obsessive/library/widgets/SmoothImageView.java @@ -24,6 +24,7 @@ import android.graphics.Paint; import android.graphics.Paint.Style; import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.ColorDrawable; import android.util.AttributeSet; import android.util.Log; import android.view.animation.AccelerateDecelerateInterpolator; @@ -168,6 +169,10 @@ private void initTransform() { if (getDrawable() == null) { return; } + + //防止转换失败 + if (getDrawable() instanceof ColorDrawable) return; + if (mBitmap == null || mBitmap.isRecycled()) { mBitmap = ((BitmapDrawable) getDrawable()).getBitmap(); } diff --git a/library/src/main/res/values-zh/strings.xml b/library/src/main/res/values-zh/strings.xml new file mode 100644 index 0000000..8194325 --- /dev/null +++ b/library/src/main/res/values-zh/strings.xml @@ -0,0 +1,28 @@ + + + + + + library + 正在加载中... + 抱歉,暂未获取到数据!\n请点击屏幕重试~ + 抱歉,系统出错了!\n请点击屏幕重试~ + 暂未连接上网络!\n请连接后点击屏幕重试~ + 1 + 1 + + diff --git a/library/src/main/res/values/strings.xml b/library/src/main/res/values/strings.xml index a40208f..b45b43e 100644 --- a/library/src/main/res/values/strings.xml +++ b/library/src/main/res/values/strings.xml @@ -18,9 +18,9 @@ library - 正在加载中... - 抱歉,暂未获取到数据!\n请点击屏幕重试~ - 抱歉,系统出错了!\n请点击屏幕重试~ - 暂未连接上网络!\n请连接后点击屏幕重试~ + Loading... + Oops, failed to resolve data\nPlease hit the screen and try again~ + Oops, something wrong!\nPlease hit the screen and try again~ + No network connected!\nPlease hit the screen and try again after connecting~ diff --git a/library_youku/.gitignore b/library_youku/.gitignore index 796b96d..94114d9 100644 --- a/library_youku/.gitignore +++ b/library_youku/.gitignore @@ -1 +1,39 @@ -/build +# Android generated +bin +gen +lint.xml + +# IntelliJ IDEA +.idea +*.iml +*.ipr +*.iws +classes +gen-external-apklibs + +# Eclipse +.project +.classpath +.settings +.checkstyle + +# Gradle +.gradle +build +out + +# Maven +target +release.properties +pom.xml.* + +# Ant +ant.properties +local.properties +proguard.cfg +proguard-project.txt + +# Other +.DS_Store +dist +tmp \ No newline at end of file diff --git a/library_youku/build.gradle b/library_youku/build.gradle index e5ed684..e6cf4d7 100644 --- a/library_youku/build.gradle +++ b/library_youku/build.gradle @@ -17,8 +17,8 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion 23 + buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 10 diff --git a/library_youku/library_youku.iml b/library_youku/library_youku.iml deleted file mode 100644 index 59e95ee..0000000 --- a/library_youku/library_youku.iml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file