Compare commits

...

9 Commits
dev ... v2.6

51 changed files with 536 additions and 306 deletions

View File

@ -3,7 +3,7 @@
### 多渠道打包配置 ### 多渠道打包配置
* 使用[ApkChannelPackage](https://github.com/ltlovezh/ApkChannelPackage)的方案 * 使用[ApkChannelPackage](https://github.com/ltlovezh/ApkChannelPackage)的方案
* 正式打包命令:请使用./gradlew channelRelease打包渠道包 * 正式打包命令:请使用./gradlew channelPubRelease打包渠道包
### 混淆配置 ### 混淆配置
* 配置文件Android默认配置+proguard-rules.txt等 * 配置文件Android默认配置+proguard-rules.txt等

View File

@ -56,19 +56,11 @@ android {
* All third-party appid/appkey * All third-party appid/appkey
*/ */
buildConfigField "String", "WECHAT_APPID", "\"${WECHAT_APPID}\"" buildConfigField "String", "WECHAT_APPID", "\"${WECHAT_APPID}\""
buildConfigField "String", "WECHAT_SECRET", "\"${WECHAT_SECRET}\""
buildConfigField "String", "TENCENT_APPID", "\"${TENCENT_APPID}\"" buildConfigField "String", "TENCENT_APPID", "\"${TENCENT_APPID}\""
buildConfigField "String", "WEIBO_APPKEY", "\"${WEIBO_APPKEY}\"" buildConfigField "String", "WEIBO_APPKEY", "\"${WEIBO_APPKEY}\""
buildConfigField "String", "MIPUSH_APPID", "\"${MIPUSH_APPID}\""
buildConfigField "String", "MIPUSH_APPKEY", "\"${MIPUSH_APPKEY}\""
buildConfigField "String", "MTA_APPKEY", "\"${MTA_APPKEY}\"" buildConfigField "String", "MTA_APPKEY", "\"${MTA_APPKEY}\""
buildConfigField "String", "TD_APPID", "\"${TD_APPID}\"" buildConfigField "String", "TD_APPID", "\"${TD_APPID}\""
buildConfigField "String", "UMENG_APPKEY", "\"${UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "DEBUG_UMENG_APPKEY", "\"${DEBUG_UMENG_APPKEY}\""
buildConfigField "String", "DEBUG_UMENG_MESSAGE_SECRET", "\"${DEBUG_UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "DEBUG_MIPUSH_APPID", "\"${DEBUG_MIPUSH_APPID}\""
buildConfigField "String", "DEBUG_MIPUSH_APPKEY", "\"${DEBUG_MIPUSH_APPKEY}\""
} }
@ -100,42 +92,56 @@ android {
} }
} }
buildTypes {
debug {
debuggable true
minifyEnabled false
zipAlignEnabled false
versionNameSuffix "-debug"
buildConfigField "String", "UMENG_APPKEY", "\"${DEBUG_UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${DEBUG_UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "MIPUSH_APPID", "\"${DEBUG_MIPUSH_APPID}\""
buildConfigField "String", "MIPUSH_APPKEY", "\"${DEBUG_MIPUSH_APPKEY}\""
}
release {
debuggable false
minifyEnabled true
zipAlignEnabled true
shrinkResources true
signingConfig signingConfigs.release
buildConfigField "String", "UMENG_APPKEY", "\"${UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "MIPUSH_APPID", "\"${MIPUSH_APPID}\""
buildConfigField "String", "MIPUSH_APPKEY", "\"${MIPUSH_APPKEY}\""
}
}
/** /**
* 多渠道打包所有渠道值均通过java code设置 * 多渠道打包,渠道请参考"channel.txt"文件,所有渠道值均通过java code设置
*/ */
// productFlavors { productFlavors {
// GH_100 {} // public release host
// GH_101 {} pub {
// GH_102 {} buildConfigField "String", "API_HOST", "\"${API_HOST}\""
// GH_103 {} buildConfigField "String", "USER_HOST", "\"${USER_HOST}\""
// GH_104 {} buildConfigField "String", "COMMENT_HOST", "\"${COMMENT_HOST}\""
// GH_106 {} buildConfigField "String", "LIBAO_HOST", "\"${LIBAO_HOST}\""
// GH_107 {} buildConfigField "String", "MESSAGE_HOST", "\"${MESSAGE_HOST}\""
// GH_108 {} buildConfigField "String", "DATA_HOST", "\"${DATA_HOST}\""
// GH_109 {} }
// GH_110 {} // internal dev host
// GH_111 {} dev {
// GH_113 {} buildConfigField "String", "API_HOST", "\"${DEV_API_HOST}\""
// GH_114 {} buildConfigField "String", "USER_HOST", "\"${DEV_USER_HOST}\""
// GH_115 {} buildConfigField "String", "COMMENT_HOST", "\"${DEV_COMMENT_HOST}\""
// GH_116 {} buildConfigField "String", "LIBAO_HOST", "\"${DEV_LIBAO_HOST}\""
// GH_117 {} buildConfigField "String", "MESSAGE_HOST", "\"${DEV_MESSAGE_HOST}\""
// GH_118 {} buildConfigField "String", "DATA_HOST", "\"${DEV_DATA_HOST}\""
// GH_119 {} }
// GH_120 {} }
// GH_121 {}
// GH_123 {}
// GH_127 {}
// GH_200 {}
// GH_201 {}
// GH_202 {}
// GH_203 {}
// GH_204 {}
// GH_205 {}
// GH_222 {}
// GH_307 {}
// GH_TEST {}
// }
// productFlavors.all { flavor -> // productFlavors.all { flavor ->
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]//命令 gradlew assembleRelease // flavor.manifestPlaceholders = [CHANNEL_VALUE: name]//命令 gradlew assembleRelease
// } // }
@ -237,12 +243,12 @@ if (propFile.exists()) {
if (props.containsKey('keyAlias') && props.containsKey('keyPassword') && if (props.containsKey('keyAlias') && props.containsKey('keyPassword') &&
props.containsKey('storeFile') && props.containsKey('storePassword')) { props.containsKey('storeFile') && props.containsKey('storePassword')) {
android.signingConfigs { android.signingConfigs {
// debug { debug {
// keyAlias props.get('keyAlias') keyAlias props.get('keyAlias')
// keyPassword props.get('keyPassword') keyPassword props.get('keyPassword')
// storeFile file(props.get('storeFile')) storeFile file(props.get('storeFile'))
// storePassword props.get('storePassword') storePassword props.get('storePassword')
// } }
release { release {
keyAlias props.get('keyAlias') keyAlias props.get('keyAlias')
keyPassword props.get('keyPassword') keyPassword props.get('keyPassword')

View File

@ -140,9 +140,6 @@ public class AppController extends Application {
*/ */
if (shouldInit()) { if (shouldInit()) {
MiPushClient.registerPush(this, Config.MIPUSH_APPID, Config.MIPUSH_APPKEY); MiPushClient.registerPush(this, Config.MIPUSH_APPID, Config.MIPUSH_APPKEY);
if (BuildConfig.DEBUG) {
MiPushClient.registerPush(this, Config.DEBUG_MIPUSH_APPID, Config.DEBUG_MIPUSH_APPKEY);
}
} }
@ -170,10 +167,6 @@ public class AppController extends Application {
//友盟推送 //友盟推送
final PushAgent pushAgent = PushAgent.getInstance(this); final PushAgent pushAgent = PushAgent.getInstance(this);
pushAgent.setAppkeyAndSecret(Config.UMENG_APPKEY, Config.UMENG_MESSAGE_SECRET); pushAgent.setAppkeyAndSecret(Config.UMENG_APPKEY, Config.UMENG_MESSAGE_SECRET);
if (BuildConfig.DEBUG) {
// 设置debug的key覆盖掉原值非debug build这个if分支会被去掉
pushAgent.setAppkeyAndSecret(Config.DEBUG_UMENG_APPKEY, Config.DEBUG_UMENG_MESSAGE_SECRET);
}
//注册推送服务每次调用register方法都会回调该接口 //注册推送服务每次调用register方法都会回调该接口
pushAgent.register(new IUmengRegisterCallback() { pushAgent.register(new IUmengRegisterCallback() {

View File

@ -125,7 +125,7 @@ public abstract class BaseActivity extends BaseAppCompatToolBarActivity implemen
public void onEventMainThread(final EBShowDialog showDialog) { public void onEventMainThread(final EBShowDialog showDialog) {
if (!mIsPause && this.getClass().getName().equals(RunningUtils.getTopActivity(this))) { if (!mIsPause && this.getClass().getName().equals(RunningUtils.getTopActivity(this))) {
if ("hijack".equals(showDialog.getType())) { if ("hijack".equals(showDialog.getType())) {
DialogUtils.showQqSessionDialog(this, null);// 建议用户联系客服 DialogUtils.showQqSessionDialog(this, "2586716223");// 建议用户联系客服
} else if ("plugin".equals(showDialog.getType())) { } else if ("plugin".equals(showDialog.getType())) {
DialogUtils.showPluginDialog(this, new DialogUtils.ConfirmListener() { DialogUtils.showPluginDialog(this, new DialogUtils.ConfirmListener() {
@Override @Override

View File

@ -8,12 +8,13 @@ import com.gh.gamecenter.BuildConfig;
public class Config { public class Config {
public static final String HOST = "http://api2.ghzhushou.com/v2d6/"; public static final String API_HOST = BuildConfig.API_HOST;
public static final String USER_HOST = "http://user2.ghzhushou.com/v1d2/"; public static final String USER_HOST = BuildConfig.USER_HOST;
public static final String COMMENT_HOST = "http://comment2.ghzhushou.com/v1d2/"; public static final String COMMENT_HOST = BuildConfig.COMMENT_HOST;
public static final String DATA_HOST = "http://data.ghzhushou.com/"; public static final String DATA_HOST = BuildConfig.DATA_HOST;
public static final String LIBAO_HOST = "http://libao2.ghzhushou.com/v1d2/"; public static final String LIBAO_HOST = BuildConfig.LIBAO_HOST;
public static final String MESSAGE_HOST = "http://message.ghzhushou.com/v1d0/"; // TODO TEST v1d1 public static final String MESSAGE_HOST = BuildConfig.MESSAGE_HOST;
public static final String PREFERENCE = "ghzhushou"; public static final String PREFERENCE = "ghzhushou";
// Third-Party confs // Third-Party confs
@ -27,12 +28,6 @@ public class Config {
public static final String UMENG_APPKEY = BuildConfig.UMENG_APPKEY; public static final String UMENG_APPKEY = BuildConfig.UMENG_APPKEY;
public static final String UMENG_MESSAGE_SECRET = BuildConfig.UMENG_MESSAGE_SECRET; public static final String UMENG_MESSAGE_SECRET = BuildConfig.UMENG_MESSAGE_SECRET;
public static final String DEBUG_MIPUSH_APPID = BuildConfig.DEBUG_MIPUSH_APPID;
public static final String DEBUG_MIPUSH_APPKEY = BuildConfig.DEBUG_MIPUSH_APPKEY;
public static final String DEBUG_UMENG_APPKEY = BuildConfig.DEBUG_UMENG_APPKEY;
public static final String DEBUG_UMENG_MESSAGE_SECRET = BuildConfig.DEBUG_UMENG_MESSAGE_SECRET;
public static boolean isShow(Context context) { public static boolean isShow(Context context) {
SharedPreferences sp = context.getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE); SharedPreferences sp = context.getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
return sp.getBoolean("isShow", true); return sp.getBoolean("isShow", true);

View File

@ -19,7 +19,7 @@ import java.util.Map;
/** /**
* Created by LGT on 2016/12/9. * Created by LGT on 2016/12/9.
* 数据收集 工具类data.ghzhushou.com * 数据收集 工具类data.ghzs666.com
*/ */
public class DataCollectionUtils { public class DataCollectionUtils {

View File

@ -73,7 +73,7 @@ public class ImageUtils {
} }
public static void display(SimpleDraweeView simpleDraweeView, String url) { public static void display(SimpleDraweeView simpleDraweeView, String url) {
// if (url.startsWith("http://image.ghzhushou.com") && url.endsWith(".jpg")) { // if (url.startsWith("http://image.ghzs666.com") && url.endsWith(".jpg")) {
// url = url + "?x-oss-process=image/format,webp"; // url = url + "?x-oss-process=image/format,webp";
// } // }
simpleDraweeView.setImageURI(url); simpleDraweeView.setImageURI(url);

View File

@ -50,7 +50,7 @@ public class IntentUtils {
"\n" + "\n" +
"光环助手官网地址:\n" + "光环助手官网地址:\n" +
"\n" + "\n" +
"http://www.ghzhushou.com/link?source=appshare333"); "http://www.ghzs666.com/link?source=appshare333");
return data; return data;
} }
} }

View File

@ -642,6 +642,9 @@ public class LibaoUtils {
libaoEntity.setTotal(libaoStatusEntity.getTotal()); libaoEntity.setTotal(libaoStatusEntity.getTotal());
String beforeStatus = libaoStatusEntity.getBeforeStatus(); String beforeStatus = libaoStatusEntity.getBeforeStatus();
if (TextUtils.isEmpty(beforeStatus)) {
beforeStatus = libaoStatusEntity.getStatus();
}
int repeat = libaoEntity.getRepeat(); int repeat = libaoEntity.getRepeat();
if (repeat > 0 if (repeat > 0
&& libaoDao.isCanLing(libaoEntity.getId(), mContext) && libaoDao.isCanLing(libaoEntity.getId(), mContext)

View File

@ -23,78 +23,78 @@ public class TimestampUtils {
private static void initIntervalMap() { private static void initIntervalMap() {
intervalMap = new ArrayMap<>(); intervalMap = new ArrayMap<>();
intervalMap.put("^" + Config.HOST + "index/slides" + "$", 5); intervalMap.put("^" + Config.API_HOST + "index/slides" + "$", 5);
intervalMap.put("^" + Config.HOST + "game/chajian" + "$", 10); intervalMap.put("^" + Config.API_HOST + "game/chajian" + "$", 10);
intervalMap.put("^" + Config.HOST + "game/tuijian" + "$", 15); intervalMap.put("^" + Config.API_HOST + "game/tuijian" + "$", 15);
intervalMap.put("^" + Config.HOST + "game/.+/detail" + "$", 20); intervalMap.put("^" + Config.API_HOST + "game/.+/detail" + "$", 20);
intervalMap.put("^" + Config.HOST + "game/.+/digest" + "$", 25); intervalMap.put("^" + Config.API_HOST + "game/.+/digest" + "$", 25);
intervalMap.put("^" + Config.HOST + "game/remenkapai" + "$", 30); intervalMap.put("^" + Config.API_HOST + "game/remenkapai" + "$", 30);
intervalMap.put("^" + Config.HOST + "game/.+/news_digest" + "$", 35); intervalMap.put("^" + Config.API_HOST + "game/.+/news_digest" + "$", 35);
intervalMap.put("^" + Config.HOST + "game/column/.+\\?page=.+" + "$", 40); intervalMap.put("^" + Config.API_HOST + "game/column/.+\\?page=.+" + "$", 40);
intervalMap.put("^" + Config.HOST + "support/package/.+/game/digest" + "$", 45); intervalMap.put("^" + Config.API_HOST + "support/package/.+/game/digest" + "$", 45);
intervalMap.put("^" + Config.HOST + "game/danjiyouxi\\?limit=20\\&offset=.+" + "$", 50); intervalMap.put("^" + Config.API_HOST + "game/danjiyouxi\\?limit=20\\&offset=.+" + "$", 50);
intervalMap.put("^" + Config.HOST + "news/.+/digest" + "$", 55); intervalMap.put("^" + Config.API_HOST + "news/.+/digest" + "$", 55);
intervalMap.put("^" + Config.HOST + "news/.+/detail" + "$", 60); intervalMap.put("^" + Config.API_HOST + "news/.+/detail" + "$", 60);
intervalMap.put("^" + Config.HOST + "news/.+/suggestion" + "$", 65); intervalMap.put("^" + Config.API_HOST + "news/.+/suggestion" + "$", 65);
intervalMap.put("^" + Config.HOST + "game/.+/news\\?limit=3" + "$", 70); intervalMap.put("^" + Config.API_HOST + "game/.+/news\\?limit=3" + "$", 70);
intervalMap.put("^" + Config.HOST + "zixun/zixun\\?limit=20\\&offset=.+" + "$", 75); intervalMap.put("^" + Config.API_HOST + "zixun/zixun\\?limit=20\\&offset=.+" + "$", 75);
intervalMap.put("^" + Config.HOST + "game/.+/news\\?limit=20\\&offset=.+" + "$", 80); intervalMap.put("^" + Config.API_HOST + "game/.+/news\\?limit=20\\&offset=.+" + "$", 80);
intervalMap.put("^" + Config.HOST + "zixun/yuanchuang\\?limit=20\\&offset=.+" + "$", 85); intervalMap.put("^" + Config.API_HOST + "zixun/yuanchuang\\?limit=20\\&offset=.+" + "$", 85);
intervalMap.put("^" + Config.HOST + "news\\?type_group=.+\\&offset=.+\\&limit=20" + "$", 90); intervalMap.put("^" + Config.API_HOST + "news\\?type_group=.+\\&offset=.+\\&limit=20" + "$", 90);
intervalMap.put("^" + Config.HOST + "zixun/guanzhu\\?key=.+\\&limit=20\\&offset=.+" + "$", 95); intervalMap.put("^" + Config.API_HOST + "zixun/guanzhu\\?key=.+\\&limit=20\\&offset=.+" + "$", 95);
intervalMap.put("^" + Config.HOST + "game/.+/news\\?limit=20\\&offset=.+\\&type=.+" + "$", 100); intervalMap.put("^" + Config.API_HOST + "game/.+/news\\?limit=20\\&offset=.+\\&type=.+" + "$", 100);
intervalMap.put("^" + Config.HOST + "zixun/guanzhu\\?game_id=.+\\&limit=20\\&offset=.+" + "$", 105); intervalMap.put("^" + Config.API_HOST + "zixun/guanzhu\\?game_id=.+\\&limit=20\\&offset=.+" + "$", 105);
intervalMap.put("^" + Config.HOST + "search/news\\?game_id=.+\\&keyword=.+\\&page=.+\\&limit=20" + "$", 110); intervalMap.put("^" + Config.API_HOST + "search/news\\?game_id=.+\\&keyword=.+\\&page=.+\\&limit=20" + "$", 110);
intervalMap.put("^" + Config.HOST + "search/game\\?keyword=.+" + "$", 115); intervalMap.put("^" + Config.API_HOST + "search/game\\?keyword=.+" + "$", 115);
intervalMap.put("^" + Config.HOST + "support/setting/platform" + "$", 120); intervalMap.put("^" + Config.API_HOST + "support/setting/platform" + "$", 120);
intervalMap.put("^" + Config.HOST + "update/package/.+" + "$", 125); intervalMap.put("^" + Config.API_HOST + "update/package/.+" + "$", 125);
intervalMap.put("^" + Config.HOST + "update/game/.+/package/.+" + "$", 130); intervalMap.put("^" + Config.API_HOST + "update/game/.+/package/.+" + "$", 130);
intervalMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?limit=10\\&offset=.+" + "$", 135); intervalMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?limit=10\\&offset=.+" + "$", 135);
intervalMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?order=hot\\&limit=10\\&offset=.+" + "$", 140); intervalMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?order=hot\\&limit=10\\&offset=.+" + "$", 140);
} }
private static void initCDMap() { private static void initCDMap() {
cdMap = new ArrayMap<>(); cdMap = new ArrayMap<>();
cdMap.put("^" + Config.HOST + "index/slides" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "index/slides" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/chajian" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/chajian" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/tuijian" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/tuijian" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/.+/detail" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/.+/detail" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/.+/digest" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/.+/digest" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/remenkapai" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/remenkapai" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/.+/news_digest" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/.+/news_digest" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/column/.+\\?page=.+" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/column/.+\\?page=.+" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "support/package/.+/game/digest" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "support/package/.+/game/digest" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "game/danjiyouxi\\?limit=20\\&offset=.+" + "$", Constants.GAME_CD); cdMap.put("^" + Config.API_HOST + "game/danjiyouxi\\?limit=20\\&offset=.+" + "$", Constants.GAME_CD);
cdMap.put("^" + Config.HOST + "news/.+/digest" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "news/.+/digest" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "news/.+/detail" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "news/.+/detail" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "news/.+/suggestion" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "news/.+/suggestion" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "game/.+/news\\?limit=3" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "game/.+/news\\?limit=3" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "zixun/zixun\\?limit=20\\&offset=.+" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "zixun/zixun\\?limit=20\\&offset=.+" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "game/.+/news\\?limit=20\\&offset=.+" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "game/.+/news\\?limit=20\\&offset=.+" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "zixun/yuanchuang\\?limit=10\\&offset=.+" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "zixun/yuanchuang\\?limit=10\\&offset=.+" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "news\\?type_group=.+\\&offset=.+\\&limit=20" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "news\\?type_group=.+\\&offset=.+\\&limit=20" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "zixun/guanzhu\\?key=.+\\&limit=20\\&offset=.+" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "zixun/guanzhu\\?key=.+\\&limit=20\\&offset=.+" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "game/.+/news\\?limit=20\\&offset=.+\\&type=.+" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "game/.+/news\\?limit=20\\&offset=.+\\&type=.+" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "zixun/guanzhu\\?game_id=.+\\&limit=20\\&offset=.+" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "zixun/guanzhu\\?game_id=.+\\&limit=20\\&offset=.+" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "search/news\\?game_id=.+\\&keyword=.+\\&page=.+\\&limit=20" + "$", Constants.NEWS_CD); cdMap.put("^" + Config.API_HOST + "search/news\\?game_id=.+\\&keyword=.+\\&page=.+\\&limit=20" + "$", Constants.NEWS_CD);
cdMap.put("^" + Config.HOST + "search/game\\?keyword=.+" + "$", Constants.SEARCH_CD); cdMap.put("^" + Config.API_HOST + "search/game\\?keyword=.+" + "$", Constants.SEARCH_CD);
cdMap.put("^" + Config.HOST + "support/setting/platform" + "$", Constants.PLATFORM_CD); cdMap.put("^" + Config.API_HOST + "support/setting/platform" + "$", Constants.PLATFORM_CD);
cdMap.put("^" + Config.HOST + "update/package/.+" + "$", Constants.UPDATE_CD); cdMap.put("^" + Config.API_HOST + "update/package/.+" + "$", Constants.UPDATE_CD);
cdMap.put("^" + Config.HOST + "update/game/.+/package/.+" + "$", Constants.UPDATE_CD); cdMap.put("^" + Config.API_HOST + "update/game/.+/package/.+" + "$", Constants.UPDATE_CD);
cdMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?limit=10\\&offset=.+" + "$", Constants.COMMENT_CD); cdMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?limit=10\\&offset=.+" + "$", Constants.COMMENT_CD);
cdMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?order=hot\\&limit=10\\&offset=.+" + "$", Constants.COMMENT_CD); cdMap.put("^" + Config.COMMENT_HOST + "article/.+/comment\\?order=hot\\&limit=10\\&offset=.+" + "$", Constants.COMMENT_CD);
cdMap.put("^" + Config.HOST + "device/.+/concern" + "$", 0); cdMap.put("^" + Config.API_HOST + "device/.+/concern" + "$", 0);
cdMap.put("^" + Config.HOST + "device/.+/concern/.+" + "$", 0); cdMap.put("^" + Config.API_HOST + "device/.+/concern/.+" + "$", 0);
cdMap.put("^" + Config.HOST + "stat/download" + "$", 0); cdMap.put("^" + Config.API_HOST + "stat/download" + "$", 0);
cdMap.put("^" + Config.HOST + "disclaimer" + "$", 0); cdMap.put("^" + Config.API_HOST + "disclaimer" + "$", 0);
cdMap.put("^" + Config.HOST + "search/game/default" + "$", 0); cdMap.put("^" + Config.API_HOST + "search/game/default" + "$", 0);
cdMap.put("^" + Config.HOST + "support/upgrade\\?version=.+\\&channel=.+" + "$", 0); cdMap.put("^" + Config.API_HOST + "support/upgrade\\?version=.+\\&channel=.+" + "$", 0);
cdMap.put("^" + Config.HOST + "support/time/current" + "$", 0); cdMap.put("^" + Config.API_HOST + "support/time/current" + "$", 0);
cdMap.put("^" + Config.HOST + "support/setting/ui" + "$", 0); cdMap.put("^" + Config.API_HOST + "support/setting/ui" + "$", 0);
cdMap.put("^" + Config.HOST + "support/download_status\\?version=.+\\&channel=.+" + "$", 0); cdMap.put("^" + Config.API_HOST + "support/download_status\\?version=.+\\&channel=.+" + "$", 0);
cdMap.put("^" + Config.HOST + "support/suggestion" + "$", 0); cdMap.put("^" + Config.API_HOST + "support/suggestion" + "$", 0);
cdMap.put("^" + Config.HOST + "game/.+/serverInfo" + "$", 0); cdMap.put("^" + Config.API_HOST + "game/.+/serverInfo" + "$", 0);
cdMap.put("^" + Config.HOST + "support/package/unused\\?skip=.+" + "$", 0); cdMap.put("^" + Config.API_HOST + "support/package/unused\\?skip=.+" + "$", 0);
} }
/* /*

View File

@ -38,23 +38,23 @@ public class UserIconUtils {
public static String getUserIconUrl(int i) { public static String getUserIconUrl(int i) {
switch (i) { switch (i) {
case 1: case 1:
return "http://image.ghzhushou.com/pic/default_icon_1.png"; return "http://image.ghzs666.com/pic/default_icon_1.png";
case 2: case 2:
return "http://image.ghzhushou.com/pic/default_icon_2.png"; return "http://image.ghzs666.com/pic/default_icon_2.png";
case 3: case 3:
return "http://image.ghzhushou.com/pic/default_icon_3.png"; return "http://image.ghzs666.com/pic/default_icon_3.png";
case 4: case 4:
return "http://image.ghzhushou.com/pic/default_icon_4.png"; return "http://image.ghzs666.com/pic/default_icon_4.png";
case 5: case 5:
return "http://image.ghzhushou.com/pic/default_icon_5.png"; return "http://image.ghzs666.com/pic/default_icon_5.png";
case 6: case 6:
return "http://image.ghzhushou.com/pic/default_icon_6.png"; return "http://image.ghzs666.com/pic/default_icon_6.png";
case 7: case 7:
return "http://image.ghzhushou.com/pic/default_icon_7.png"; return "http://image.ghzs666.com/pic/default_icon_7.png";
case 8: case 8:
return "http://image.ghzhushou.com/pic/default_icon_8.png"; return "http://image.ghzs666.com/pic/default_icon_8.png";
default: default:
return "http://image.ghzhushou.com/pic/default_icon_1.png"; return "http://image.ghzs666.com/pic/default_icon_1.png";
} }
} }
} }

View File

@ -102,6 +102,24 @@ public class DownloadThread extends Thread {
return; return;
} }
} }
// 妈的太长了不测了。。直接copy一份简单点
// 1. https://resource.ghzs666.com 对应原来的 https://apk.ghzhushou.com已配置完毕
// 2. https://apk.ghzs666.com 对应原来的 https://apk2.ghzhushou.com已配置完毕
// 3. https://resource.ghzs666.com域名的下载链接将不会增加新产生的apk地址都会在https://apk.ghzs666.com中 @研发-林潘森
if (!entry.isChange()
&& "download.ghzs666.com".equals(new URL(entry.getUrl()).getHost())
&& ("resource.ghzs666.com".equals(connection.getURL().getHost())
|| "apk.ghzs666.com".equals(connection.getURL().getHost()))) {
String newETag = getETag(entry.getUrl());
if (!TextUtils.isEmpty(newETag)) {
entry.setETag(newETag);
entry.setChange(true);
download();
return;
}
}
Utils.log("eTag = " + eTag); Utils.log("eTag = " + eTag);
Utils.log("eTag2 = " + eTag2); Utils.log("eTag2 = " + eTag2);
listener.onStatusChanged(DownloadStatus.hijack, connection.getURL().toString()); listener.onStatusChanged(DownloadStatus.hijack, connection.getURL().toString());
@ -206,7 +224,7 @@ public class DownloadThread extends Thread {
private String getETag(String url) { private String getETag(String url) {
try { try {
String newUrl = "http://download.ghzhushou.com/etag" String newUrl = "http://download.ghzs666.com/etag"
+ "?url=" + URLEncoder.encode(url, "utf-8") + "?url=" + URLEncoder.encode(url, "utf-8")
+ "&" + System.currentTimeMillis(); + "&" + System.currentTimeMillis();
HttpURLConnection connection = (HttpURLConnection) new URL(newUrl).openConnection(); HttpURLConnection connection = (HttpURLConnection) new URL(newUrl).openConnection();

View File

@ -5,6 +5,9 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.gh.base.BaseActivity; import com.gh.base.BaseActivity;
import com.gh.gamecenter.adapter.CommentDetailAdapter; import com.gh.gamecenter.adapter.CommentDetailAdapter;
@ -18,6 +21,10 @@ public class CommentDetailActivity extends BaseActivity {
@BindView(R.id.comment_detail_rv) @BindView(R.id.comment_detail_rv)
RecyclerView mRecyclerView; RecyclerView mRecyclerView;
@BindView(R.id.reuse_none_data)
LinearLayout mNoData;
@BindView(R.id.reuse_tv_none_data)
TextView mNoDataTv;
private CommentDetailAdapter mAdapter; private CommentDetailAdapter mAdapter;
private LinearLayoutManager mLayoutManager; private LinearLayoutManager mLayoutManager;
@ -41,7 +48,7 @@ public class CommentDetailActivity extends BaseActivity {
String commentId = getIntent().getExtras().getString("commentId"); String commentId = getIntent().getExtras().getString("commentId");
mAdapter = new CommentDetailAdapter(this, commentId); mAdapter = new CommentDetailAdapter(this, this, commentId);
mLayoutManager = new LinearLayoutManager(this); mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager); mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter); mRecyclerView.setAdapter(mAdapter);
@ -56,4 +63,12 @@ public class CommentDetailActivity extends BaseActivity {
} }
}); });
} }
@Override
public void loadEmpty() {
super.loadEmpty();
mNoData.setVisibility(View.VISIBLE);
mNoDataTv.setText("天了噜~页面不见了");
mRecyclerView.setVisibility(View.GONE);
}
} }

View File

@ -56,6 +56,7 @@ import com.gh.gamecenter.retrofit.RetrofitManager;
import com.jakewharton.rxbinding.view.RxView; import com.jakewharton.rxbinding.view.RxView;
import com.tencent.tauth.Tencent; import com.tencent.tauth.Tencent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
@ -116,6 +117,8 @@ public class GameDetailActivity extends BaseActivity {
ProgressBar mDownloadPb; ProgressBar mDownloadPb;
@BindView(R.id.gamedetail_appbar) @BindView(R.id.gamedetail_appbar)
AppBarLayout mAppBarLayout; AppBarLayout mAppBarLayout;
@BindView(R.id.gamedetail_kaifu_hint)
View mKaifuHint;
private ConcernManager mConcernManager; private ConcernManager mConcernManager;
private String mGameId; private String mGameId;
@ -127,6 +130,9 @@ public class GameDetailActivity extends BaseActivity {
private String title; // 页面标题 private String title; // 页面标题
private String shareCode; private String shareCode;
private boolean mIsTouchScreen = false; private boolean mIsTouchScreen = false;
private boolean mIsShowKaifuHint;
private int mCurVpPosition;
private DataWatcher dataWatcher = new DataWatcher() { private DataWatcher dataWatcher = new DataWatcher() {
@Override @Override
public void onDataChanged(DownloadEntity downloadEntity) { public void onDataChanged(DownloadEntity downloadEntity) {
@ -190,6 +196,7 @@ public class GameDetailActivity extends BaseActivity {
mViewPager.setScrollable(true); mViewPager.setScrollable(true);
mKaifuHint.setVisibility(View.GONE);
mConcernManager = new ConcernManager(GameDetailActivity.this); mConcernManager = new ConcernManager(GameDetailActivity.this);
name = "游戏详情"; name = "游戏详情";
@ -225,13 +232,18 @@ public class GameDetailActivity extends BaseActivity {
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
mCurVpPosition = position;
if (position == 0) { if (position == 0) {
if (mIsShowKaifuHint) {
mKaifuHint.setVisibility(View.VISIBLE);
}
mTanBarFuLiTv.setTextColor(Color.WHITE); mTanBarFuLiTv.setTextColor(Color.WHITE);
mTanBarFuLiTv.setBackgroundResource(R.drawable.gamedetail_tag_select_bg); mTanBarFuLiTv.setBackgroundResource(R.drawable.gamedetail_tag_select_bg);
mTanBarXinXiTv.setTextColor(Color.BLACK); mTanBarXinXiTv.setTextColor(Color.BLACK);
mTanBarXinXiTv.setBackgroundDrawable(new ColorDrawable(0)); mTanBarXinXiTv.setBackgroundDrawable(new ColorDrawable(0));
} else { } else {
mTanBarXinXiTv.setTextColor(Color.WHITE); mTanBarXinXiTv.setTextColor(Color.WHITE);
mKaifuHint.setVisibility(View.GONE);
mTanBarXinXiTv.setBackgroundResource(R.drawable.gamedetail_tag_unselect_bg); mTanBarXinXiTv.setBackgroundResource(R.drawable.gamedetail_tag_unselect_bg);
mTanBarFuLiTv.setTextColor(Color.BLACK); mTanBarFuLiTv.setTextColor(Color.BLACK);
mTanBarFuLiTv.setBackgroundDrawable(new ColorDrawable(0)); mTanBarFuLiTv.setBackgroundDrawable(new ColorDrawable(0));
@ -256,6 +268,24 @@ public class GameDetailActivity extends BaseActivity {
} }
}); });
// 防抖处理
RxView.clicks(mShareIv)
.throttleFirst(1, TimeUnit.SECONDS)
.subscribe(new Action1<Void>() {
@Override
public void call(Void aVoid) {
if (TextUtils.isEmpty(shareCode)) return;
Map<String, Object> kv = new HashMap<>();
kv.put("点击", "分享");
DataUtils.onEvent(GameDetailActivity.this, "插件数据", mGameEntity.getName(), kv);
DataCollectionUtils.uploadClick(GameDetailActivity.this, "分享", "游戏详情", mGameEntity.getName());
String url = "http://www.ghzs666.com/game/" + shareCode;
showShare(url, mGameEntity.getName(), mGameEntity.getIcon(), null, mGameEntity.getTag(), false);
}
});
} }
@Override @Override
@ -456,6 +486,19 @@ public class GameDetailActivity extends BaseActivity {
mAppBarLayout.setExpanded(true, true); mAppBarLayout.setExpanded(true, true);
} else if (SKIP_FULI.equals(reuse.getType())) { } else if (SKIP_FULI.equals(reuse.getType())) {
mViewPager.setCurrentItem(0); mViewPager.setCurrentItem(0);
} else if ("hideKaifuHint".equals(reuse.getType())) {
mIsShowKaifuHint = false;
mKaifuHint.setVisibility(View.GONE);
} else if ("showKaifuHint".equals(reuse.getType())) {
mIsShowKaifuHint = true;
if (mCurVpPosition == 0) {
mKaifuHint.post(new Runnable() {
@Override
public void run() {
mKaifuHint.setVisibility(View.VISIBLE);
}
});
}
} }
} }
@ -498,8 +541,8 @@ public class GameDetailActivity extends BaseActivity {
} }
@OnClick({R.id.detail_tv_download, R.id.detail_pb_progressbar, R.id.reuse_no_connection @OnClick({R.id.detail_tv_download, R.id.detail_pb_progressbar, R.id.reuse_no_connection
, R.id.detail_tv_per, R.id.gamedetail_tabbar_xinxi_tv , R.id.detail_tv_per, R.id.gamedetail_tabbar_xinxi_tv, R.id.gamedetail_tabbar_fuli_tv
, R.id.gamedetail_tabbar_fuli_tv, R.id.gamedetail_share}) , R.id.gamedetail_share, R.id.gamedetail_kaifu_hint})
public void onClick(View v) { public void onClick(View v) {
if (v == mDownloadTv) { if (v == mDownloadTv) {
if (mGameEntity != null && !mGameEntity.getApk().isEmpty()) { if (mGameEntity != null && !mGameEntity.getApk().isEmpty()) {
@ -532,24 +575,6 @@ public class GameDetailActivity extends BaseActivity {
mViewPager.setCurrentItem(0); mViewPager.setCurrentItem(0);
} else if (v == mTanBarXinXiTv) { } else if (v == mTanBarXinXiTv) {
mViewPager.setCurrentItem(1); mViewPager.setCurrentItem(1);
} else if (v == mShareIv) {
if (TextUtils.isEmpty(shareCode)) return;
// 防抖处理
RxView.clicks(mShareIv)
.throttleFirst(1, TimeUnit.SECONDS)
.subscribe(new Action1<Void>() {
@Override
public void call(Void aVoid) {
Map<String, Object> kv = new HashMap<>();
kv.put("点击", "分享");
DataUtils.onEvent(GameDetailActivity.this, "插件数据", mGameEntity.getName(), kv);
DataCollectionUtils.uploadClick(GameDetailActivity.this, "分享", "游戏详情", mGameEntity.getName());
String url = "http://www.ghzhushou.com/game/" + shareCode;
showShare(url, mGameEntity.getName(), mGameEntity.getIcon(), null, mGameEntity.getTag(), false);
}
});
} else if (v == mNoConnection) { } else if (v == mNoConnection) {
mLoading.setVisibility(View.VISIBLE); mLoading.setVisibility(View.VISIBLE);
mNoConnection.setVisibility(View.GONE); mNoConnection.setVisibility(View.GONE);
@ -559,6 +584,9 @@ public class GameDetailActivity extends BaseActivity {
} else if (mGameId != null) { } else if (mGameId != null) {
getGameDigest(); getGameDigest();
} }
} else if (v == mKaifuHint) {
mAppBarLayout.setExpanded(false, true);
EventBus.getDefault().post(new EBReuse("scrollToKaiFu"));
} }
} }

View File

@ -1010,7 +1010,9 @@ public class MainActivity extends BaseActivity implements OnClickListener {
@Override @Override
public void onCompleted() { public void onCompleted() {
concernManager.addByList(concernDigest); concernManager.addByList(concernDigest);
} @Override }
@Override
public void onNext(GameEntity response) { public void onNext(GameEntity response) {
concernDigest.add(response); concernDigest.add(response);
} }

View File

@ -300,11 +300,11 @@ public class NewsDetailActivity extends BaseActivity implements OnClickListener
DataCollectionUtils.uploadClick(NewsDetailActivity.this, "分享", "新闻详情" DataCollectionUtils.uploadClick(NewsDetailActivity.this, "分享", "新闻详情"
, adapter.getNewsDetailEntity().getTitle()); , adapter.getNewsDetailEntity().getTitle());
String url = "http://www.ghzhushou.com/article/" + String url = "http://www.ghzs666.com/article/" +
adapter.getNewsDetailEntity().getId() + ".html"; adapter.getNewsDetailEntity().getId() + ".html";
if (gameEntity == null) { if (gameEntity == null) {
showShare(url, adapter.getNewsDetailEntity().getTitle(), showShare(url, adapter.getNewsDetailEntity().getTitle(),
"http://image.ghzhushou.com/pic/57d604808ab49e467d8b4568.png", "http://image.ghzs666.com/pic/57d604808ab49e467d8b4568.png",
adapter.getNewsDetailEntity().getTitle(), null, false); adapter.getNewsDetailEntity().getTitle(), null, false);
} else { } else {
showShare(url, gameEntity.getName(), gameEntity.getIcon(), showShare(url, gameEntity.getName(), gameEntity.getIcon(),

View File

@ -106,7 +106,7 @@ public class ShareCardActivity extends BaseActivity {
}, 200); }, 200);
if (!TextUtils.isEmpty(newsId)) { if (!TextUtils.isEmpty(newsId)) {
String qrBody = "http://www.ghzhushou.com/article/" + newsId + ".html?source=appshare200"; String qrBody = "http://www.ghzs666.com/article/" + newsId + ".html?source=appshare200";
QRCodeUtils.setQRCode(this, qrBody, mShareQrCodeDv); QRCodeUtils.setQRCode(this, qrBody, mShareQrCodeDv);
} }
} }

View File

@ -153,7 +153,7 @@ public class ShareCardPicActivity extends BaseActivity {
} }
if (!TextUtils.isEmpty(newsId)) { if (!TextUtils.isEmpty(newsId)) {
String qrBody = "http://www.ghzhushou.com/article/" + newsId + ".html?source=appshare200"; String qrBody = "http://www.ghzs666.com/article/" + newsId + ".html?source=appshare200";
QRCodeUtils.setQRCode(this, qrBody, mShareQrCodeDv); QRCodeUtils.setQRCode(this, qrBody, mShareQrCodeDv);
} }
} }
@ -195,7 +195,7 @@ public class ShareCardPicActivity extends BaseActivity {
// @Override // @Override
// public void call(Subscriber<? super String> subscriber) { // public void call(Subscriber<? super String> subscriber) {
// String filePath = getExternalCacheDir().getPath() + "/ShareImg/ShareQRCode.jpg"; // String filePath = getExternalCacheDir().getPath() + "/ShareImg/ShareQRCode.jpg";
// boolean success = QRCodeUtils.createQRImage("http://www.ghzhushou.com/article/" + newsId + ".html?source=appshare200" // boolean success = QRCodeUtils.createQRImage("http://www.ghzs666.com/article/" + newsId + ".html?source=appshare200"
// , 200, 200, filePath, ShareCardPicActivity.this); // , 200, 200, filePath, ShareCardPicActivity.this);
// if (success) { // if (success) {
// subscriber.onNext(filePath); // subscriber.onNext(filePath);
@ -219,7 +219,7 @@ public class ShareCardPicActivity extends BaseActivity {
@Override @Override
public void run() { public void run() {
try { try {
String newUrl = "http://image.ghzhushou.com/pic/hq" + url.substring(url.lastIndexOf("/")); String newUrl = "http://image.ghzs666.com/pic/hq" + url.substring(url.lastIndexOf("/"));
HttpURLConnection connection = (HttpURLConnection) new URL(newUrl).openConnection(); HttpURLConnection connection = (HttpURLConnection) new URL(newUrl).openConnection();
connection.setRequestMethod("GET"); connection.setRequestMethod("GET");
connection.setConnectTimeout(5 * 1000); connection.setConnectTimeout(5 * 1000);

View File

@ -59,10 +59,10 @@ public class ShareGhActivity extends BaseActivity {
init(getString(R.string.title_share_gh)); init(getString(R.string.title_share_gh));
ButterKnife.bind(this); ButterKnife.bind(this);
mGhAddress.setText(Html.fromHtml("<u>" + "www.ghzhushou.com" + "</u>")); mGhAddress.setText(Html.fromHtml("<u>" + "www.ghzs666.com" + "</u>"));
QRCodeUtils.setQRCode(this, "http://www.ghzhushou.com/link?source=appshare100", mGhQrcode); QRCodeUtils.setQRCode(this, "http://www.ghzs666.com/link?source=appshare100", mGhQrcode);
ShareUtils.getInstance(this).showShareWindows(mShareRl, "http://www.ghzhushou.com/link?source=appshare300", "光环助手" ShareUtils.getInstance(this).showShareWindows(mShareRl, "http://www.ghzs666.com/link?source=appshare300", "光环助手"
, "http://image.ghzhushou.com/pic/57d604808ab49e467d8b4568.png", null, false, false, false); , "http://image.ghzs666.com/pic/57d604808ab49e467d8b4568.png", null, false, false, false);
} }
@OnClick(R.id.wifi_share_btn) @OnClick(R.id.wifi_share_btn)
@ -74,7 +74,7 @@ public class ShareGhActivity extends BaseActivity {
@OnClick(R.id.gh_address_tv) @OnClick(R.id.gh_address_tv)
public void copyAddress() { public void copyAddress() {
ClipboardManager cmb = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipboardManager cmb = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText("http://www.ghzhushou.com/link?source=appshare100"); cmb.setText("http://www.ghzs666.com/link?source=appshare100");
Utils.toast(this, "网址复制成功,请到微信/QQ粘贴分享"); Utils.toast(this, "网址复制成功,请到微信/QQ粘贴分享");
} }

View File

@ -82,6 +82,7 @@ public class SkipActivity extends BaseActivity {
uri.getQueryParameter(KEY_VERSION)); uri.getQueryParameter(KEY_VERSION));
intent.putExtra(KEY_CONTENT, content); intent.putExtra(KEY_CONTENT, content);
intent.putExtra(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN); intent.putExtra(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN);
intent.putExtra("suggestType", 4);
intent.setClass(this, SuggestionActivity.class); intent.setClass(this, SuggestionActivity.class);
break; break;
case HOST_DOWNLOAD: case HOST_DOWNLOAD:
@ -120,6 +121,8 @@ public class SkipActivity extends BaseActivity {
PlatformUtils.getInstance(this).getPlatformName(uri.getQueryParameter(KEY_PLATFORM)), PlatformUtils.getInstance(this).getPlatformName(uri.getQueryParameter(KEY_PLATFORM)),
uri.getQueryParameter(KEY_VERSION)); uri.getQueryParameter(KEY_VERSION));
intent.putExtra(KEY_CONTENT, content); intent.putExtra(KEY_CONTENT, content);
intent.putExtra(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN);
intent.putExtra("suggestType", 4);
intent.putExtra(KEY_TO, "SuggestionActivity"); intent.putExtra(KEY_TO, "SuggestionActivity");
break; break;
case HOST_DOWNLOAD: case HOST_DOWNLOAD:

View File

@ -174,7 +174,10 @@ public class SuggestionActivity extends BaseActivity implements SuggestTypeAdapt
String suggestHintType = getIntent().getExtras().getString("suggestHintType"); String suggestHintType = getIntent().getExtras().getString("suggestHintType");
if (getIntent().getBundleExtra("data") != null) { if (getIntent().getBundleExtra("data") != null) {
suggestContent = getIntent().getBundleExtra("data").getString("content"); Bundle data = getIntent().getBundleExtra("data");
suggestContent = data.getString("content");
suggestHintType = data.getString("suggestHintType");
curType = data.getInt("suggestType");
} }
sp = getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE); sp = getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
@ -437,10 +440,10 @@ public class SuggestionActivity extends BaseActivity implements SuggestTypeAdapt
for (String s : mAdapter.getFileList()) { for (String s : mAdapter.getFileList()) {
path = getCacheDir() + File.separator + System.currentTimeMillis() + index + ".jpg"; path = getCacheDir() + File.separator + System.currentTimeMillis() + index + ".jpg";
if (BitmapUtils.savePicture(path, s)) { if (BitmapUtils.savePicture(path, s)) {
subscriber.onNext(FileUtils.uploadFile(Config.HOST + "support/user/suggestion/img", path, null)); subscriber.onNext(FileUtils.uploadFile(Config.API_HOST + "support/user/suggestion/img", path, null));
index++; index++;
} else { } else {
subscriber.onNext(FileUtils.uploadFile(Config.HOST + "support/user/suggestion/img", s, null)); subscriber.onNext(FileUtils.uploadFile(Config.API_HOST + "support/user/suggestion/img", s, null));
} }
} }
subscriber.onCompleted(); subscriber.onCompleted();

View File

@ -230,7 +230,7 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
@Override @Override
public void run() { public void run() {
try { try {
String newUrl = "http://image.ghzhushou.com/pic/hq" + url.substring(url.lastIndexOf("/")); String newUrl = "http://image.ghzs666.com/pic/hq" + url.substring(url.lastIndexOf("/"));
HttpURLConnection connection = (HttpURLConnection) new URL(newUrl).openConnection(); HttpURLConnection connection = (HttpURLConnection) new URL(newUrl).openConnection();
connection.setRequestMethod("GET"); connection.setRequestMethod("GET");
connection.setConnectTimeout(5 * 1000); connection.setConnectTimeout(5 * 1000);
@ -314,8 +314,8 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
if (scaleType != null || isOrientation) { if (scaleType != null || isOrientation) {
imageView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER); imageView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
} }
if (!url.startsWith("http://image.ghzhushou.com/pic/hq/") && url.startsWith("http://image.ghzhushou.com/pic/")) { if (!url.startsWith("http://image.ghzs666.com/pic/hq/") && url.startsWith("http://image.ghzs666.com/pic/")) {
String hqUrl = "http://image.ghzhushou.com/pic/hq" + url.substring(url.lastIndexOf("/")); String hqUrl = "http://image.ghzs666.com/pic/hq" + url.substring(url.lastIndexOf("/"));
if (imagePipeline.isInBitmapMemoryCache(Uri.parse(hqUrl))) { // 检查高清图是否被缓存 if (imagePipeline.isInBitmapMemoryCache(Uri.parse(hqUrl))) { // 检查高清图是否被缓存
loadImage(hqUrl, imageView); loadImage(hqUrl, imageView);
} else { } else {
@ -376,7 +376,7 @@ public class ViewImageActivity extends Activity implements OnPageChangeListener
private void findImageBM() { private void findImageBM() {
String key = urls.get(viewimage_vp_show.getCurrentItem()); String key = urls.get(viewimage_vp_show.getCurrentItem());
String hdKey = "http://image.ghzhushou.com/pic/hq" + key.substring(key.lastIndexOf("/")); String hdKey = "http://image.ghzs666.com/pic/hq" + key.substring(key.lastIndexOf("/"));
ImagePipeline imagePipeline = Fresco.getImagePipeline(); ImagePipeline imagePipeline = Fresco.getImagePipeline();
String curUrl; String curUrl;

View File

@ -173,7 +173,7 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
Toast.makeText(VoteActivity.this, "请输入名字", Toast.LENGTH_SHORT).show(); Toast.makeText(VoteActivity.this, "请输入名字", Toast.LENGTH_SHORT).show();
return true; return true;
} }
postVersionVote(nickname, true, true);
dialog.dismiss(); dialog.dismiss();
return true; return true;
} }

View File

@ -33,6 +33,7 @@ import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick;
import rx.android.schedulers.AndroidSchedulers; import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1; import rx.functions.Action1;
import rx.schedulers.Schedulers; import rx.schedulers.Schedulers;
@ -40,7 +41,7 @@ import rx.schedulers.Schedulers;
/** /**
* Created by khy on 2016/10/18. * Created by khy on 2016/10/18.
*/ */
public class WebActivity extends BaseActivity implements View.OnClickListener{ public class WebActivity extends BaseActivity {
@BindView(R.id.news_webview) @BindView(R.id.news_webview)
WebView webView; WebView webView;
@ -65,7 +66,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener{
public static Intent getWebIntent(Context context) { public static Intent getWebIntent(Context context) {
Intent intent = new Intent(context, WebActivity.class); Intent intent = new Intent(context, WebActivity.class);
intent.putExtra("gameName", "使用条款与免责声明"); intent.putExtra("gameName", "使用条款与免责声明");
intent.putExtra("url", "http://api.ghzhushou.com/disclaimer"); intent.putExtra("url", "http://api.ghzs666.com/disclaimer");
return intent; return intent;
} }
@ -78,7 +79,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener{
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
// 刷新评论数 // 刷新评论数
if (resultCode == 1001 && progressBar.getVisibility() == View.VISIBLE && newsId != null) { if (resultCode == 1001 && newsId != null && data != null && data.getExtras() != null) {
webComment.setText("查看评论(" + data.getExtras().getInt("commentNum") + ""); webComment.setText("查看评论(" + data.getExtras().getInt("commentNum") + "");
} else if (requestCode == com.tencent.connect.common.Constants.REQUEST_QQ_SHARE } else if (requestCode == com.tencent.connect.common.Constants.REQUEST_QQ_SHARE
|| requestCode == com.tencent.connect.common.Constants.REQUEST_QZONE_SHARE) { || requestCode == com.tencent.connect.common.Constants.REQUEST_QZONE_SHARE) {
@ -107,7 +108,6 @@ public class WebActivity extends BaseActivity implements View.OnClickListener{
mToolBoxEntity = (ToolBoxEntity) AppController.get("ToolBoxEntity", true); mToolBoxEntity = (ToolBoxEntity) AppController.get("ToolBoxEntity", true);
mShareIv = new ImageView(this); mShareIv = new ImageView(this);
mShareIv.setImageResource(R.drawable.ic_share); mShareIv.setImageResource(R.drawable.ic_share);
mShareIv.setOnClickListener(this);
mShareIv.setVisibility(View.VISIBLE); mShareIv.setVisibility(View.VISIBLE);
mShareIv.setPadding(DisplayUtils.dip2px(this, 13), DisplayUtils.dip2px(this, 11) mShareIv.setPadding(DisplayUtils.dip2px(this, 13), DisplayUtils.dip2px(this, 11)
, DisplayUtils.dip2px(this, 11), DisplayUtils.dip2px(this, 13)); , DisplayUtils.dip2px(this, 11), DisplayUtils.dip2px(this, 13));
@ -191,6 +191,17 @@ public class WebActivity extends BaseActivity implements View.OnClickListener{
if (newsId != null) { if (newsId != null) {
getNewsCommentNum(); getNewsCommentNum();
} }
if (mShareIv != null) {
RxView.clicks(mShareIv)
.throttleFirst(1, TimeUnit.SECONDS)
.subscribe(new Action1<Void>() {
@Override
public void call(Void aVoid) {
showShare(mToolBoxEntity.getUrl(), mToolBoxEntity.getDes(), mToolBoxEntity.getIcon(), mToolBoxEntity.getName(), null, true);
}
});
}
} }
public void getNewsCommentNum() { public void getNewsCommentNum() {
@ -211,7 +222,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener{
}); });
} }
@Override @OnClick({R.id.web_comment})
public void onClick(View v) { public void onClick(View v) {
if (v == webComment) { if (v == webComment) {
Intent intent = new Intent(this, MessageDetailActivity.class); Intent intent = new Intent(this, MessageDetailActivity.class);
@ -219,15 +230,6 @@ public class WebActivity extends BaseActivity implements View.OnClickListener{
intent.putExtra("commentNum", commentNum); intent.putExtra("commentNum", commentNum);
intent.putExtra(EntranceUtils.KEY_ENTRANCE, mEntrance + "+(光环浏览器)"); intent.putExtra(EntranceUtils.KEY_ENTRANCE, mEntrance + "+(光环浏览器)");
startActivityForResult(intent, 1001); startActivityForResult(intent, 1001);
} else if (v == mShareIv) {
RxView.clicks(mShareIv)
.throttleFirst(1, TimeUnit.SECONDS)
.subscribe(new Action1<Void>() {
@Override
public void call(Void aVoid) {
showShare(mToolBoxEntity.getUrl(), mToolBoxEntity.getDes(), mToolBoxEntity.getIcon(), mToolBoxEntity.getName(), null, true);
}
});
} }
} }

View File

@ -22,6 +22,7 @@ import com.gh.gamecenter.db.CommentDao;
import com.gh.gamecenter.db.VoteDao; import com.gh.gamecenter.db.VoteDao;
import com.gh.gamecenter.db.info.VoteInfo; import com.gh.gamecenter.db.info.VoteInfo;
import com.gh.gamecenter.entity.CommentEntity; import com.gh.gamecenter.entity.CommentEntity;
import com.gh.gamecenter.listener.OnCallBackListener;
import com.gh.gamecenter.retrofit.Response; import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.retrofit.RetrofitManager;
@ -39,6 +40,8 @@ import rx.schedulers.Schedulers;
*/ */
public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> { public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
private OnCallBackListener mListener;
private SharedPreferences mSharedPreferences; private SharedPreferences mSharedPreferences;
private List<CommentEntity> mCommentList; private List<CommentEntity> mCommentList;
@ -55,8 +58,9 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
private boolean mIsLoading; private boolean mIsLoading;
private boolean mIsNetworkError; private boolean mIsNetworkError;
public CommentDetailAdapter(Context context, String commentId) { public CommentDetailAdapter(Context context, OnCallBackListener listener, String commentId) {
super(context); super(context);
mListener = listener;
mCommentId = commentId; mCommentId = commentId;
mVoteDao = new VoteDao(context); mVoteDao = new VoteDao(context);
@ -84,7 +88,9 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
super.onResponse(response); super.onResponse(response);
mCommentList.addAll(response); mCommentList.addAll(response);
if (response.size() < 20) { if (mCommentList.size() == 0) {
mListener.loadEmpty();
} else if (response.size() < 20) {
mIsOver = true; mIsOver = true;
} }
@ -95,10 +101,10 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
@Override @Override
public void onFailure(HttpException e) { public void onFailure(HttpException e) {
super.onFailure(e); super.onFailure(e);
Utils.toast(mContext, "评论加载失败, 请检查网络设置"); Utils.toast(mContext, "评论加载失败, 请检查网络设置");
mIsNetworkError = true; mIsNetworkError = true;
mIsLoading = false; mIsLoading = false;
notifyItemChanged(getItemCount() - 1); notifyItemChanged(getItemCount() - 1);
} }
}); });
} }

View File

@ -167,8 +167,10 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
mLoadKeyOver = true; mLoadKeyOver = true;
loadData(mIsSearch, 0); loadData(mIsSearch, 0);
} else { } else {
if (response.size() > 0) { if (response.size() >= 0) {
mEntityList.addAll(response); if (response.size() > 0) {
mEntityList.addAll(response);
}
mCallBackListener.loadDone(); mCallBackListener.loadDone();
if (response.size() < 20) { if (response.size() < 20) {
@ -190,6 +192,7 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
super.onFailure(e); super.onFailure(e);
if (e != null && e.code() == 409) { if (e != null && e.code() == 409) {
mIsRequestError = true; mIsRequestError = true;
mLoadKeyOver = true;
loadData(mIsSearch, finalOffset); loadData(mIsSearch, finalOffset);
return; return;
} }
@ -209,7 +212,7 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
public int getItemViewType(int position) { public int getItemViewType(int position) {
if (position == 0) { if (position == 0) {
return 0; return 0;
} else if (position == getItemCount() - 1) { } else if (position == 1 || position == getItemCount() - 1) {
return 1; return 1;
} else { } else {
return 2; return 2;
@ -235,11 +238,11 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof ToolBoxViewHolder) { if (holder instanceof ToolBoxViewHolder) {
ToolBoxViewHolder viewHolder = (ToolBoxViewHolder) holder; ToolBoxViewHolder viewHolder = (ToolBoxViewHolder) holder;
ToolBoxEntity toolBoxEntity = mEntityList.get(position - 1); ToolBoxEntity toolBoxEntity = mEntityList.get(position - 2);
initToolBoxViewHolder(viewHolder, toolBoxEntity); initToolBoxViewHolder(viewHolder, toolBoxEntity);
} else if (holder instanceof FooterViewHolder) { } else if (holder instanceof FooterViewHolder) {
FooterViewHolder viewHolder = (FooterViewHolder) holder; FooterViewHolder viewHolder = (FooterViewHolder) holder;
initFooterViewHolder(viewHolder); initFooterViewHolder(viewHolder, position);
} else if (holder instanceof LibaoSearchViewHolder) { } else if (holder instanceof LibaoSearchViewHolder) {
LibaoSearchViewHolder viewHolder = (LibaoSearchViewHolder) holder; LibaoSearchViewHolder viewHolder = (LibaoSearchViewHolder) holder;
initSearchViewHolder(viewHolder); initSearchViewHolder(viewHolder);
@ -249,7 +252,7 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
@Override @Override
public int getItemCount() { public int getItemCount() {
if (mEntityList.size() > 0) { if (mEntityList.size() > 0) {
return mEntityList.size() + 2; return mEntityList.size() + 3;
} else { } else {
return 1; return 1;
} }
@ -301,21 +304,10 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
} }
private void initFooterViewHolder(FooterViewHolder viewHolder) { private void initFooterViewHolder(FooterViewHolder viewHolder, int position) {
viewHolder.initItemPadding(); viewHolder.initItemPadding();
if (mIsNetworkError) {
viewHolder.lineLeft.setVisibility(View.GONE); if (position == 1) {
viewHolder.lineRight.setVisibility(View.GONE);
viewHolder.loading.setVisibility(View.GONE);
viewHolder.hint.setText("加载失败,点击重试");
viewHolder.itemView.setClickable(true);
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadData(mIsSearch, mEntityList.size());
}
});
} else if (mIsOver) {
viewHolder.lineLeft.setVisibility(View.VISIBLE); viewHolder.lineLeft.setVisibility(View.VISIBLE);
viewHolder.lineRight.setVisibility(View.VISIBLE); viewHolder.lineRight.setVisibility(View.VISIBLE);
viewHolder.loading.setVisibility(View.GONE); viewHolder.loading.setVisibility(View.GONE);
@ -328,11 +320,31 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
} }
}); });
} else { } else {
viewHolder.lineLeft.setVisibility(View.GONE); if (mIsNetworkError) {
viewHolder.lineRight.setVisibility(View.GONE); viewHolder.lineLeft.setVisibility(View.GONE);
viewHolder.loading.setVisibility(View.VISIBLE); viewHolder.lineRight.setVisibility(View.GONE);
viewHolder.hint.setText(loading); viewHolder.loading.setVisibility(View.GONE);
viewHolder.itemView.setClickable(false); viewHolder.hint.setText("加载失败,点击重试");
viewHolder.itemView.setClickable(true);
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadData(mIsSearch, mEntityList.size());
}
});
} else if (mIsOver) {
viewHolder.lineLeft.setVisibility(View.VISIBLE);
viewHolder.lineRight.setVisibility(View.VISIBLE);
viewHolder.loading.setVisibility(View.GONE);
viewHolder.hint.setText("加载完毕");
viewHolder.itemView.setClickable(false);
} else {
viewHolder.lineLeft.setVisibility(View.GONE);
viewHolder.lineRight.setVisibility(View.GONE);
viewHolder.loading.setVisibility(View.VISIBLE);
viewHolder.hint.setText(loading);
viewHolder.itemView.setClickable(false);
}
} }
} }
@ -345,8 +357,8 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
String url = toolBoxEntity.getUrl(); String url = toolBoxEntity.getUrl();
// http://www.ghzhushou.com/article/59291e7ce9a64a496cfd6897.html // http://www.ghzs666.com/article/59291e7ce9a64a496cfd6897.html
if (url.contains("http://www.ghzhushou.com/article/")) { if (url.contains("http://www.ghzs666.com/article/")) {
String newsId = url.substring(url.lastIndexOf("/") + 1, url.length() - 5); String newsId = url.substring(url.lastIndexOf("/") + 1, url.length() - 5);
Intent intent = new Intent(mContext, NewsDetailActivity.class); Intent intent = new Intent(mContext, NewsDetailActivity.class);
intent.putExtra("newsId", newsId); intent.putExtra("newsId", newsId);

View File

@ -22,10 +22,10 @@ public class SkinConfig {
* perPage : 请求数量 * perPage : 请求数量
*/ */
public static int perPage = 300; public static int perPage = 300;
// http://api.ghzhushou.com/v2d2/game/57ce84f88ab49e83728b4572/skin/data?per_page=1000&page=1 // http://api.ghzs666.com/v2d2/game/57ce84f88ab49e83728b4572/skin/data?per_page=1000&page=1
public static final String JSON_PATCHURL = "http://api.ghzhushou.com/v2d2/skin/game/" public static final String JSON_PATCHURL = "http://api.ghzs666.com/v2d2/skin/game/"
+ GAME_ID + "/data?per_page=" + perPage + "&page="; + GAME_ID + "/data?per_page=" + perPage + "&page=";
// public static final String JSON_PATCHURL = "http://api.ghzhushou.com/v2d2/skin/game/" // public static final String JSON_PATCHURL = "http://api.ghzs666.com/v2d2/skin/game/"
// + GAME_ID + "/data?per_page=" + perPage + "&page="; // 原链接 // + GAME_ID + "/data?per_page=" + perPage + "&page="; // 原链接
// ewan.anfeng 安峰 // ewan.anfeng 安峰

View File

@ -120,8 +120,23 @@ public class FuLiAdapter extends BaseRecyclerAdapter<ViewHolder> {
} }
} }
if (mToolBoxList != null && mToolBoxList.size() > 0) { if (!TextUtils.isEmpty(mGameDetailEntity.getFulishuoming())
|| contact != null && (contact.getService() != null && !TextUtils.isEmpty(contact.getService().getDes())
|| contact.getPlayer() != null && !TextUtils.isEmpty(contact.getService().getDes()))) {
if (position_news != -1) { if (position_news != -1) {
position_fuli = position_news + 1;
} else if (position_notice != -1) {
position_fuli = position_notice + 1;
} else {
position_fuli = 0;
}
}
if (mToolBoxList != null && mToolBoxList.size() > 0) {
if (position_fuli != -1) {
position_tools = position_fuli + 1;
} else if (position_news != -1) {
position_tools = position_news + 1; position_tools = position_news + 1;
} else if (position_notice != -1) { } else if (position_notice != -1) {
position_tools = position_notice + 1; position_tools = position_notice + 1;
@ -130,19 +145,6 @@ public class FuLiAdapter extends BaseRecyclerAdapter<ViewHolder> {
} }
} }
if (!TextUtils.isEmpty(mGameDetailEntity.getFulishuoming())
|| contact != null && (contact.getService() != null && !TextUtils.isEmpty(contact.getService().getDes())
|| contact.getPlayer() != null && !TextUtils.isEmpty(contact.getService().getDes()))) {
if (position_tools != -1) {
position_fuli = position_tools + 1;
} else if (position_news != -1) {
position_fuli = position_news + 1;
} else if (position_notice != -1) {
position_fuli = position_notice + 1;
} else {
position_fuli = 0;
}
}
if (mLibaoList != null && mLibaoList.size() > 0) { if (mLibaoList != null && mLibaoList.size() > 0) {
if (position_fuli != -1) { if (position_fuli != -1) {
position_libao = position_fuli + 1; position_libao = position_fuli + 1;
@ -172,6 +174,26 @@ public class FuLiAdapter extends BaseRecyclerAdapter<ViewHolder> {
position_kaifu = 0; position_kaifu = 0;
} }
} }
if (position_kaifu != -1) {
int index = 0;
if (position_news != -1) {
index ++;
}
if (position_tools != -1) {
index ++;
}
if (position_libao != -1) {
index ++;
}
if (position_fuli != -1) {
index ++;
}
if (index >= 2) {
EventBus.getDefault().post(new EBReuse("canShowKaifuHint"));
}
}
} }
private void getToolTox() { private void getToolTox() {
@ -524,12 +546,12 @@ public class FuLiAdapter extends BaseRecyclerAdapter<ViewHolder> {
private void initLibaoViewHolder(GameDetaiLibaoViewHolder viewHolder) { private void initLibaoViewHolder(GameDetaiLibaoViewHolder viewHolder) {
viewHolder.libaoRv.setNestedScrollingEnabled(false); viewHolder.libaoRv.setNestedScrollingEnabled(false);
ViewGroup.LayoutParams params2 = viewHolder.libaoRv.getLayoutParams(); ViewGroup.LayoutParams params2 = viewHolder.libaoRv.getLayoutParams();
if (mLibaoList != null && (mLibaoList.size() <= 3 || isOpenLibaoList)) { if (mLibaoList != null && (mLibaoList.size() <= 2 || isOpenLibaoList)) {
viewHolder.openList.setVisibility(View.GONE); viewHolder.openList.setVisibility(View.GONE);
params2.height = DisplayUtils.dip2px(mContext, 68) * mLibaoList.size(); params2.height = DisplayUtils.dip2px(mContext, 68) * mLibaoList.size();
} else { } else {
viewHolder.openList.setVisibility(View.VISIBLE); viewHolder.openList.setVisibility(View.VISIBLE);
params2.height = DisplayUtils.dip2px(mContext, 68) * 3; params2.height = DisplayUtils.dip2px(mContext, 68) * 2;
} }
viewHolder.libaoRv.setLayoutParams(params2); viewHolder.libaoRv.setLayoutParams(params2);

View File

@ -5,6 +5,7 @@ import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import com.gh.base.BaseFragment; import com.gh.base.BaseFragment;
import com.gh.common.util.DisplayUtils;
import com.gh.common.view.MeasureLinearLayoutManager; import com.gh.common.view.MeasureLinearLayoutManager;
import com.gh.common.view.VerticalItemDecoration; import com.gh.common.view.VerticalItemDecoration;
import com.gh.gamecenter.GameDetailActivity; import com.gh.gamecenter.GameDetailActivity;
@ -27,6 +28,9 @@ public class FuliFragment extends BaseFragment {
private MeasureLinearLayoutManager layoutManager; private MeasureLinearLayoutManager layoutManager;
private boolean isCanScroll; private boolean isCanScroll;
private boolean isCanShowKaiFuHint;
private int indexHeight = 0;
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
@ -57,6 +61,23 @@ public class FuliFragment extends BaseFragment {
if (position == 0 && Math.abs(dy) > 10) { if (position == 0 && Math.abs(dy) > 10) {
EventBus.getDefault().post(new EBReuse(GameDetailActivity.OPEN_APPBAR)); EventBus.getDefault().post(new EBReuse(GameDetailActivity.OPEN_APPBAR));
} }
if (isCanShowKaiFuHint) {
int lastVisibleItemPosition = layoutManager.findLastVisibleItemPosition();
int itemCount = layoutManager.getItemCount();
if (lastVisibleItemPosition >= itemCount - 2) {
indexHeight += dy;
if (DisplayUtils.px2dip(getContext(), indexHeight) >= 45) {
EventBus.getDefault().post(new EBReuse("hideKaifuHint"));
} else {
EventBus.getDefault().post(new EBReuse("showKaifuHint"));
}
} else {
indexHeight = 0;
EventBus.getDefault().post(new EBReuse("showKaifuHint"));
}
}
} }
}); });
} }
@ -71,6 +92,13 @@ public class FuliFragment extends BaseFragment {
isCanScroll = false; isCanScroll = false;
} else if ("CalenderCancel".equals(reuse.getType())) { } else if ("CalenderCancel".equals(reuse.getType())) {
isCanScroll = true; isCanScroll = true;
} else if ("canShowKaifuHint".equals(reuse.getType())){
isCanShowKaiFuHint = true;
} else if ("scrollToKaiFu".equals(reuse.getType()) && layoutManager != null) {
int position = layoutManager.getItemCount() - 2;
if (position > 0)
layoutManager.smoothScrollToPosition(mRecyclerView, null, position);
} }
} }

View File

@ -77,7 +77,7 @@ public class GameDetailToolsAdapter extends BaseRecyclerAdapter {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
String url = toolBoxEntity.getUrl(); String url = toolBoxEntity.getUrl();
if (url.contains("http://www.ghzhushou.com/article/")) { if (url.contains("http://www.ghzs666.com/article/")) {
String newsId = url.substring(url.lastIndexOf("/") + 1, url.length() - 5); String newsId = url.substring(url.lastIndexOf("/") + 1, url.length() - 5);
Intent intent = new Intent(mContext, NewsDetailActivity.class); Intent intent = new Intent(mContext, NewsDetailActivity.class);
intent.putExtra("newsId", newsId); intent.putExtra("newsId", newsId);

View File

@ -140,7 +140,7 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
} }
try { try {
ArrayList<String> imgs = new ArrayList<>(); ArrayList<String> imgs = new ArrayList<>();
Pattern pattern = Pattern.compile("http://image\\.ghzhushou\\.com/pic/.{24}\\.jpg"); Pattern pattern = Pattern.compile("http://image\\.ghzs666\\.com/pic/.{24}\\.jpg");
Matcher matcher = pattern.matcher(content); Matcher matcher = pattern.matcher(content);
while (matcher.find()) { while (matcher.find()) {
imgs.add(matcher.group()); imgs.add(matcher.group());

View File

@ -20,6 +20,7 @@ public class NewsDetailContentViewHolder extends RecyclerView.ViewHolder {
public NewsDetailContentViewHolder(View itemView) { public NewsDetailContentViewHolder(View itemView) {
super(itemView); super(itemView);
itemView.requestFocus();
newsdetail_item_tv_title = (TextView) itemView.findViewById(R.id.newsdetail_item_tv_title); newsdetail_item_tv_title = (TextView) itemView.findViewById(R.id.newsdetail_item_tv_title);
newsdetail_item_tv_time = (TextView) itemView.findViewById(R.id.newsdetail_item_tv_time); newsdetail_item_tv_time = (TextView) itemView.findViewById(R.id.newsdetail_item_tv_time);
newsdetail_item_tv_author = (TextView) itemView.findViewById(R.id.newsdetail_item_tv_author); newsdetail_item_tv_author = (TextView) itemView.findViewById(R.id.newsdetail_item_tv_author);

View File

@ -34,7 +34,7 @@ import rx.Observable;
/** /**
* Created by khy on 2016/11/1. * Created by khy on 2016/11/1.
* api.ghzhushou.com * api.ghzs666.com
*/ */
public interface ApiService { public interface ApiService {

View File

@ -18,7 +18,7 @@ import rx.Observable;
/** /**
* Created by LGT on 2016/11/9. * Created by LGT on 2016/11/9.
* comment.ghzhushou.com * comment.ghzs666.com
*/ */
public interface CommentService { public interface CommentService {

View File

@ -16,7 +16,7 @@ import rx.Observable;
/** /**
* Created by LGT on 2016/11/9. * Created by LGT on 2016/11/9.
* data.ghzhushou.com * data.ghzs666.com
*/ */
public interface DataService { public interface DataService {

View File

@ -16,7 +16,7 @@ import retrofit2.http.Query;
import rx.Observable; import rx.Observable;
/** /**
* libao.ghzhushou.com * libao.ghzs666.com
*/ */
public interface LibaoService { public interface LibaoService {

View File

@ -57,7 +57,7 @@ public class OkHttpInterceptor implements Interceptor {
} }
} }
// log 打印 // // log 打印
// Utils.log(String.format("Interceptor Received response for %s in %n%s", // Utils.log(String.format("Interceptor Received response for %s in %n%s",
// response.request().url(), response.headers())); // response.request().url(), response.headers()));

View File

@ -1,7 +1,6 @@
package com.gh.gamecenter.retrofit; package com.gh.gamecenter.retrofit;
import com.gh.base.AppController; import com.gh.base.AppController;
import com.gh.common.util.GzipUtils;
import com.gh.common.util.NetworkUtils; import com.gh.common.util.NetworkUtils;
import com.gh.common.util.TimestampUtils; import com.gh.common.util.TimestampUtils;
@ -38,7 +37,8 @@ public class OkHttpNetworkInterceptor implements Interceptor {
@Override @Override
public BufferedSource source() { public BufferedSource source() {
Buffer buffer = new Buffer(); Buffer buffer = new Buffer();
buffer.write(GzipUtils.compressBytes("[]".getBytes())); // buffer.write(GzipUtils.compressBytes("[]".getBytes()));
buffer.write("[]".getBytes());
return buffer; return buffer;
} }
}; };

View File

@ -30,7 +30,7 @@ public class Response<T> extends Subscriber<T> {
if (e instanceof HttpException) { if (e instanceof HttpException) {
onFailure((HttpException) e); onFailure((HttpException) e);
} else { } else {
onFailure(e); onFailure(null);
} }
} }

View File

@ -4,6 +4,7 @@ import com.gh.common.constant.Config;
import com.gh.gamecenter.BuildConfig; import com.gh.gamecenter.BuildConfig;
import java.io.File; import java.io.File;
import java.util.concurrent.TimeUnit;
import okhttp3.Cache; import okhttp3.Cache;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
@ -42,14 +43,14 @@ public class RetrofitManager {
final OkHttpClient okHttpClient = builder final OkHttpClient okHttpClient = builder
.addNetworkInterceptor(new OkHttpNetworkInterceptor()) .addNetworkInterceptor(new OkHttpNetworkInterceptor())
.addInterceptor(new OkHttpInterceptor()) .addInterceptor(new OkHttpInterceptor())
// .connectTimeout(30, TimeUnit.SECONDS) .connectTimeout(8, TimeUnit.SECONDS)
.cache(cache) .cache(cache)
.build(); .build();
mApiService = new Retrofit.Builder() mApiService = new Retrofit.Builder()
.client(okHttpClient) .client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.baseUrl(Config.HOST) .baseUrl(Config.API_HOST)
.build() .build()
.create(ApiService.class); .create(ApiService.class);

View File

@ -16,7 +16,7 @@ import rx.Observable;
/** /**
* Created by LGT on 2016/12/5. * Created by LGT on 2016/12/5.
* user.ghzhushou.com * user.ghzs666.com
*/ */
public interface UserService { public interface UserService {

View File

@ -121,6 +121,16 @@ public class SearchGameDetailFragment extends BaseFragment implements OnCallBack
} }
} }
}); });
reuse_no_connection.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
search_loading.setVisibility(View.VISIBLE);
reuse_no_connection.setVisibility(View.GONE);
adapter = new SearchGameDetailFragmentAdapter(SearchGameDetailFragment.this, key, type, mEntrance);
search_detail.setAdapter(adapter);
}
});
} }
@Override @Override

View File

@ -117,6 +117,16 @@ public class SearchGameListFragment extends BaseFragment implements OnCallBackLi
} }
} }
}); });
reuse_no_connection.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
search_loading.setVisibility(View.VISIBLE);
reuse_no_connection.setVisibility(View.GONE);
adapter = new SearchGameListFragmentAdapter(SearchGameListFragment.this, key, type, mEntrance);
search_detail.setAdapter(adapter);
}
});
} }
@Override @Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android = "http://schemas.android.com/apk/res/android"
android:shape = "rectangle" >
<solid android:color = "#E0000000" />
<corners android:radius = "999dp" />
</shape >

View File

@ -6,9 +6,16 @@
<include layout = "@layout/reuse_actionbar" /> <include layout = "@layout/reuse_actionbar" />
<android.support.v7.widget.RecyclerView <RelativeLayout
android:id = "@+id/comment_detail_rv"
android:layout_width = "match_parent" android:layout_width = "match_parent"
android:layout_height = "match_parent" /> android:layout_height = "match_parent" >
<android.support.v7.widget.RecyclerView
android:id = "@+id/comment_detail_rv"
android:layout_width = "match_parent"
android:layout_height = "match_parent" />
<include layout = "@layout/reuse_none_data" />
</RelativeLayout >
</LinearLayout > </LinearLayout >

View File

@ -7,20 +7,21 @@
<RelativeLayout <RelativeLayout
android:id = "@+id/reuse_actionbar" android:id = "@+id/reuse_actionbar"
android:layout_width = "match_parent" android:layout_width = "match_parent"
android:layout_height = "match_parent" android:layout_height = "?actionBarSize"
android:background = "@android:color/white" android:background = "@android:color/white" >
android:visibility = "visible" >
<RelativeLayout <RelativeLayout
android:id = "@+id/actionbar_rl_back" android:id = "@+id/actionbar_rl_back"
android:layout_width = "48dp" android:layout_width = "?actionBarSize"
android:layout_height = "match_parent" > android:layout_height = "match_parent" >
<ImageView <ImageView
android:id = "@+id/actionbar_iv_back" android:id = "@+id/actionbar_iv_back"
android:layout_width = "19dp" android:layout_width = "wrap_content"
android:layout_height = "19dp" android:layout_height = "wrap_content"
android:layout_centerInParent = "true" android:layout_centerInParent = "true"
android:padding = "18dp"
android:scaleType = "centerInside"
android:src = "@drawable/ic_bar_back" /> android:src = "@drawable/ic_bar_back" />
</RelativeLayout > </RelativeLayout >
@ -37,7 +38,7 @@
<ImageView <ImageView
android:id = "@+id/gamedetail_share" android:id = "@+id/gamedetail_share"
android:layout_width = "48dp" android:layout_width = "48dp"
android:layout_height = "48dp" android:layout_height = "?actionBarSize"
android:layout_alignParentRight = "true" android:layout_alignParentRight = "true"
android:layout_centerInParent = "true" android:layout_centerInParent = "true"
android:layout_marginRight = "6dp" android:layout_marginRight = "6dp"
@ -69,20 +70,22 @@
<include layout = "@layout/reuse_none_data" /> <include layout = "@layout/reuse_none_data" />
<View
android:layout_width = "match_parent"
android:layout_height = "7dp"
android:background = "@drawable/shadow"
android:layout_above = "@+id/detail_ll_bottom" />
<LinearLayout <LinearLayout
android:id = "@+id/detail_ll_bottom" android:id = "@+id/detail_ll_bottom"
android:layout_width = "match_parent" android:layout_width = "match_parent"
android:layout_height = "wrap_content" android:layout_height = "wrap_content"
android:layout_alignParentBottom = "true" android:layout_alignParentBottom = "true"
android:layout_marginTop = "-7dp"
android:orientation = "vertical" android:orientation = "vertical"
android:visibility = "gone" > android:visibility = "gone" >
<View
android:layout_width = "match_parent"
android:layout_height = "7dp"
android:layout_above = "@+id/detail_ll_bottom"
android:background = "@drawable/shadow" />
<RelativeLayout <RelativeLayout
android:layout_width = "match_parent" android:layout_width = "match_parent"
android:layout_height = "60dp" android:layout_height = "60dp"
@ -116,5 +119,42 @@
</RelativeLayout > </RelativeLayout >
</LinearLayout > </LinearLayout >
<LinearLayout
android:id = "@+id/gamedetail_kaifu_hint"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_alignParentBottom = "true"
android:layout_centerHorizontal = "true"
android:layout_marginBottom = "78dp"
android:background = "@drawable/gamedetail_kaifu_hint"
android:orientation = "horizontal"
android:visibility = "gone"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="7dp"
android:paddingBottom="7dp" >
<ImageView
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:src="@drawable/gamedetail_kaifu_hint_icon1"/>
<TextView
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:text="开服表"
android:textColor="@android:color/white"
android:textSize="15sp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"/>
<ImageView
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:src="@drawable/gamedetail_kaifu_hint_icon2"/>
</LinearLayout >
</RelativeLayout > </RelativeLayout >
</LinearLayout > </LinearLayout >

View File

@ -38,7 +38,8 @@
android:textColor = "@color/title" android:textColor = "@color/title"
android:textColorHint = "@color/text_9a9a9a" android:textColorHint = "@color/text_9a9a9a"
android:textCursorDrawable = "@drawable/cursor_color" android:textCursorDrawable = "@drawable/cursor_color"
android:textSize = "18sp" /> android:textSize = "18sp"
android:inputType="textPersonName"/>
<View <View
android:layout_width = "match_parent" android:layout_width = "match_parent"

View File

@ -55,7 +55,7 @@
<string name = "kaifu_calender" >开服日历</string > <string name = "kaifu_calender" >开服日历</string >
<string name = "kaifu_hint" >(时间仅供参考,点击日期查看详情)</string > <string name = "kaifu_hint" >(时间仅供参考,点击日期查看详情)</string >
<string name = "kaifu_close_detail" >关闭</string > <string name = "kaifu_close_detail" >关闭</string >
<string name = "kaifu_report_error" >反馈错误</string > <string name = "kaifu_report_error" >有奖反馈</string >
<string name = "libao_name" >礼包名称</string > <string name = "libao_name" >礼包名称</string >
<string name = "libao_game" >游戏礼包</string > <string name = "libao_game" >游戏礼包</string >
<string name = "news_info" >资讯攻略</string > <string name = "news_info" >资讯攻略</string >

View File

@ -1,38 +1,53 @@
# Project-wide Gradle settings. ## Project-wide Gradle settings.
#
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit # For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html # http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m # Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Mon Jul 24 15:51:42 CST 2017
org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
org.gradle.parallel=true org.gradle.parallel=true
android.useDeprecatedNdk=true android.useDeprecatedNdk=true
org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
MIPUSH_APPID=2882303761517352993 # channel packages
MIPUSH_APPKEY=5451735292993 channel_file=channel.txt
WECHAT_APPID=wx3ffd0785fad18396
TENCENT_APPID=1104659243
WEIBO_APPKEY=1723629218
MTA_APPKEY=APV567FTBS7J
TD_APPID=81DB144D555386A38A70B833537EC256
UMENG_APPKEY=585a29fa8f4a9d327600023e
UMENG_MESSAGE_SECRET=8bcce6bed547ee624f5c2cc64d39a9e9
# Third-party keys
DEBUG_UMENG_APPKEY=58e5b0b9c62dca35a00005e6 DEBUG_UMENG_APPKEY=58e5b0b9c62dca35a00005e6
DEBUG_UMENG_MESSAGE_SECRET=ca08596492f8a7fde2ab48dceab8c1f3 DEBUG_UMENG_MESSAGE_SECRET=ca08596492f8a7fde2ab48dceab8c1f3
DEBUG_MIPUSH_APPID=2882303761517564447 DEBUG_MIPUSH_APPID=2882303761517564447
DEBUG_MIPUSH_APPKEY=5761756481447 DEBUG_MIPUSH_APPKEY=5761756481447
# for apkChannelPackage MIPUSH_APPID=2882303761517352993
channel_file=channel.txt MIPUSH_APPKEY=5451735292993
WECHAT_APPID=wx3ffd0785fad18396
WECHAT_SECRET=368b49e8471857575a033b206218f9fb
TD_APPID=81DB144D555386A38A70B833537EC256
TENCENT_APPID=1104659243
MTA_APPKEY=APV567FTBS7J
WEIBO_APPKEY=1723629218
UMENG_APPKEY=585a29fa8f4a9d327600023e
UMENG_MESSAGE_SECRET=8bcce6bed547ee624f5c2cc64d39a9e9
# hosts
DEV_API_HOST=http\://dev.api.ghzs666.com/v2d6/
DEV_DATA_HOST=http\://data.ghzs666.com/
DEV_LIBAO_HOST=http\://dev.libao.ghzs666.com/v1d2/
DEV_MESSAGE_HOST=http\://dev.message.ghzs666.com/v1d1/
DEV_USER_HOST=http\://dev.user.ghzs666.com/v1d2/
DEV_COMMENT_HOST=http\://dev.comment.ghzs666.com/v1d2/
API_HOST=http\://api.ghzs666.com/v2d6/
DATA_HOST=http\://data.ghzs666.com/
LIBAO_HOST=http\://libao.ghzs666.com/v1d2/
MESSAGE_HOST=http\://message.ghzs666.com/v1d0/
USER_HOST=http\://user.ghzs666.com/v1d2/
COMMENT_HOST=http\://comment.ghzs666.com/v1d2/