Skip to content

Commit

Permalink
V1.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfusheng committed Feb 23, 2018
1 parent 91e15bb commit bc1e714
Show file tree
Hide file tree
Showing 23 changed files with 32 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ deploy:
all_branches: true

after_deploy:
- fir p app/outputs/Gank.IO.apk -T $FIR_TOKEN -c "`git cat-file tag $TRAVIS_TAG`"
- fir publish app/outputs/Gank.IO.apk -T $FIR_TOKEN -c "干货集中营Android客户端"

notifications:
email:
Expand Down
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### 预览图

<img src="/resources/res1.gif" style="width: 30%;">
<img src="/resources/Gank.IO.gif" style="width: 30%;">

<br/>

Expand All @@ -18,14 +18,22 @@

<br/>

### 个人公众号
### 关注我吧,让我们做朋友^_^

<img src="/resources/wechat.jpg" style="width: 30%;">
<img src="http://ourvm0t8d.bkt.clouddn.com/follow_me.png">

### 打个赏吧,给作者加点油^_^

<img src="http://ourvm0t8d.bkt.clouddn.com/reward_me.png" >

### 关于我

[GitHub: sfsheng0322](https://github.com/sfsheng0322)
[个人邮箱: sfsheng0322@126.com]()
[个人博客: sunfusheng.com](http://sunfusheng.com/)
[简书主页](http://www.jianshu.com/users/88509e7e2ed1/latest_articles)

[个人邮箱: sfsheng0322@126.com](https://mail.126.com/)

[个人博客: sunfusheng.com](http://sunfusheng.com/)

[简书主页](http://www.jianshu.com/users/88509e7e2ed1/latest_articles)

[新浪微博](http://weibo.com/u/3852192525)
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
implementation 'me.drakeet.multitype:multitype:3.4.2'
implementation 'com.afollestad.material-dialogs:core:0.9.4.4'
implementation 'com.sunfusheng:glideimageview:1.2.0'
compile 'com.sunfusheng:FirUpdater:1.0.7'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'jp.wasabeef:recyclerview-animators:2.2.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
Binary file modified app/outputs/Gank.IO.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/outputs/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":9},"path":"Gank.IO.apk","properties":{"packageId":"com.sunfusheng.gank","split":"","minSdkVersion":"14"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":11},"path":"Gank.IO.apk","properties":{"packageId":"com.sunfusheng.gank","split":"","minSdkVersion":"14"}}]
6 changes: 1 addition & 5 deletions app/src/main/java/com/sunfusheng/gank/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ public class Constants {
// 干货集中营Base Url
public static final String BASE_URL = "http://gank.io/api/";

// fir.im 信息
public static final String FIR_IM_APP_ID = "58954512ca87a85dc4000135";
public static final String FIR_IM_API_TOKEN = "3c57fb226edf7facf821501e4eba08d2";

// fir.im 最新软件版本信息
public static final String URL_APP_VERSION = "http://api.fir.im/apps/latest/" + FIR_IM_APP_ID + "?api_token=" + FIR_IM_API_TOKEN + "&type=android";
public static final String FIR_IM_APP_ID = "58954512ca87a85dc4000135";

}
4 changes: 0 additions & 4 deletions app/src/main/java/com/sunfusheng/gank/http/ApiService.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.sunfusheng.gank.http;

import com.sunfusheng.gank.Constants;
import com.sunfusheng.gank.model.GankDay;
import com.sunfusheng.gank.util.update.VersionEntity;

import io.reactivex.Observable;
import retrofit2.http.GET;
Expand All @@ -18,6 +16,4 @@ public interface ApiService {
@GET("day/{year}/{month}/{day}")
Observable<GankDay> getGankDay(@Path("year") int year, @Path("month") int month, @Path("day") int day);

@GET(Constants.URL_APP_VERSION)
Observable<VersionEntity> checkVersion();
}
19 changes: 4 additions & 15 deletions app/src/main/java/com/sunfusheng/gank/ui/KotlinMainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
package com.sunfusheng.gank.ui

import android.os.Bundle
import android.text.TextUtils
import com.sunfusheng.FirUpdater
import com.sunfusheng.gank.Constants
import com.sunfusheng.gank.R
import com.sunfusheng.gank.base.BaseActivity
import com.sunfusheng.gank.http.Api
import com.sunfusheng.gank.ui.gank.GankFragment
import com.sunfusheng.gank.util.AppUtil
import com.sunfusheng.gank.util.ToastUtil
import com.sunfusheng.gank.util.update.UpdateHelper
import com.sunfusheng.gank.util.update.VersionEntity
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import java.util.concurrent.TimeUnit


class KotlinMainActivity : BaseActivity() {

private val END_TIME_SECONDS: Long = 2
private var updateHelper: UpdateHelper = UpdateHelper(this)

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -32,13 +28,7 @@ class KotlinMainActivity : BaseActivity() {
}

private fun checkVersion() {
Api.getInstance().apiService.checkVersion()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.compose<VersionEntity>(bindToLifecycle<VersionEntity>())
.filter { !TextUtils.isEmpty(it.version) }
.filter { Integer.parseInt(it.version) > AppUtil.getVersionCode() }
.subscribe({ updateHelper.dealWithVersion(it) }, { it.printStackTrace() })
FirUpdater(this, Constants.FIR_IM_API_TOKEN, Constants.FIR_IM_APP_ID).checkVersion()
}

private fun prepareForExiting() {
Expand All @@ -53,7 +43,6 @@ class KotlinMainActivity : BaseActivity() {
}

override fun onDestroy() {
updateHelper.unInit()
super.onDestroy()
}

Expand Down
19 changes: 3 additions & 16 deletions app/src/main/java/com/sunfusheng/gank/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.sunfusheng.FirUpdater;
import com.sunfusheng.gank.Constants;
import com.sunfusheng.gank.R;
import com.sunfusheng.gank.base.BaseActivity;
import com.sunfusheng.gank.http.Api;
import com.sunfusheng.gank.ui.gank.GankFragment;
import com.sunfusheng.gank.util.AppUtil;
import com.sunfusheng.gank.util.ToastUtil;
import com.sunfusheng.gank.util.update.UpdateHelper;

import java.util.concurrent.TimeUnit;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class MainActivity extends BaseActivity {

private static final long END_TIME_SECONDS = 2;
private UpdateHelper updateHelper = new UpdateHelper(this);

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -36,13 +32,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}

private void checkVersion() {
Api.getInstance().getApiService().checkVersion()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.compose(bindToLifecycle())
.filter(it -> it != null && !TextUtils.isEmpty(it.version))
.filter(it -> Integer.parseInt(it.version) > AppUtil.getVersionCode())
.subscribe(it -> updateHelper.dealWithVersion(it), Throwable::printStackTrace);
new FirUpdater(this, Constants.FIR_IM_API_TOKEN, Constants.FIR_IM_APP_ID).checkVersion();
}

private void prepareForExiting() {
Expand All @@ -58,9 +48,6 @@ private void prepareForExiting() {

@Override
protected void onDestroy() {
if (updateHelper != null) {
updateHelper.unInit();
}
super.onDestroy();
}

Expand Down
20 changes: 0 additions & 20 deletions app/src/main/java/com/sunfusheng/gank/util/update/Binary.java

This file was deleted.

115 changes: 0 additions & 115 deletions app/src/main/java/com/sunfusheng/gank/util/update/UpdateHelper.java

This file was deleted.

This file was deleted.

Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="colorPrimary">#C34A42</color>
<color name="colorPrimaryDark">#C34A42</color>
<color name="colorAccent">#C34A42</color>
<color name="colorPrimary">#c34a42</color>
<color name="colorPrimaryDark">#c34a42</color>
<color name="colorAccent">#c34a42</color>

<color name="color1">#212121</color>
<color name="color2">#333333</color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,6 @@
<color name="md_grey_700">#616161</color>
<color name="md_grey_800">#424242</color>
<color name="md_grey_900">#212121</color>

<color name="md_black">#000000</color>
<color name="md_white">#ffffff</color>

<!-- blue_grey -->
<color name="md_blue_grey_50">#eceff1</color>
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
mavenCentral()
google()
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/sfsheng0322/maven' }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
}

Expand All @@ -22,6 +23,7 @@ allprojects {
mavenCentral()
google()
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/sfsheng0322/maven' }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
}
}
Expand Down
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ gradle.ext.supportLibraryVersion = '27.0.2'

gradle.ext.minSdkVersion = 14
gradle.ext.targetSdkVersion = 27
gradle.ext.versionCode = 10
gradle.ext.versionName = "1.6.4"
gradle.ext.versionCode = 11
gradle.ext.versionName = "1.6.5"

0 comments on commit bc1e714

Please sign in to comment.