文件整理
@ -5,7 +5,6 @@ import android.app.ActivityManager;
|
||||
import android.app.ActivityManager.RunningAppProcessInfo;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Process;
|
||||
import android.support.v4.util.ArrayMap;
|
||||
import android.text.TextUtils;
|
||||
@ -15,36 +14,92 @@ import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.gh.base.GHPushMessageReceiver.PushHandler;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DexUtils;
|
||||
import com.gh.common.util.HotFix;
|
||||
import com.gh.common.util.Utils;
|
||||
import com.xiaomi.channel.commonutils.logger.LoggerInterface;
|
||||
import com.xiaomi.mipush.sdk.Logger;
|
||||
import com.xiaomi.mipush.sdk.MiPushClient;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
//import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
|
||||
public class AppController extends Application {
|
||||
|
||||
public static final String TAG = AppController.class.getSimpleName();
|
||||
|
||||
private RequestQueue mRequestQueue;
|
||||
|
||||
private static AppController mInstance;
|
||||
|
||||
// xiaomi push appid
|
||||
public static final String APP_ID = "2882303761517352993";
|
||||
// xiaomi push appkey
|
||||
public static final String APP_KEY = "5451735292993";
|
||||
|
||||
private static AppController mInstance;
|
||||
private static PushHandler handler = null;
|
||||
private static ArrayMap<String, Object> objectMap = new ArrayMap<>();
|
||||
|
||||
private static ArrayMap<String, Object> objectMap = new ArrayMap<String, Object>();
|
||||
private RequestQueue mRequestQueue;
|
||||
|
||||
private ArrayList<Activity> list = new ArrayList<>();
|
||||
|
||||
private boolean isFinish = false;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
// File dexPath = new File(getDir("dex", Context.MODE_PRIVATE), "hackdex_dex.jar");
|
||||
// DexUtils.prepareAssetsDex(this, dexPath, "hackdex_dex.jar");
|
||||
// HotFix.patch(this, dexPath.getAbsolutePath(), "dodola.hackdex.AntilazyLoad");
|
||||
|
||||
// SharedPreferences sp = this.getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
|
||||
// File directory = new File(this.getFilesDir().getAbsolutePath() + File.separator + "hotfix");
|
||||
// if (directory.exists()) {
|
||||
// File[] files = directory.listFiles();
|
||||
// for (File file : files) {
|
||||
// Utils.log("dex file = " + file.getName());
|
||||
// String clazz = sp.getString(file.getName(), null);
|
||||
// if (clazz != null) {
|
||||
// dexPath = new File(getDir("dex", Context.MODE_PRIVATE), file.getName());
|
||||
// DexUtils.prepareDex(this, dexPath, file);
|
||||
// HotFix.patch(this, dexPath.getAbsolutePath(), clazz);
|
||||
// Utils.log(file.getName() + " patch success");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
DataUtils.init(this);
|
||||
|
||||
AppUncaHandler uncaHandler = new AppUncaHandler(this);
|
||||
Thread.setDefaultUncaughtExceptionHandler(uncaHandler);
|
||||
mInstance = this;
|
||||
|
||||
// 注册push服务,注册成功后会向GHPushMessageReceiver发送广播
|
||||
// 可以从GHPushMessageReceiver的onCommandResult方法中MiPushCommandMessage对象参数中获取注册信息
|
||||
if (shouldInit()) {
|
||||
MiPushClient.registerPush(this, APP_ID, APP_KEY);
|
||||
}
|
||||
|
||||
LoggerInterface newLogger = new LoggerInterface() {
|
||||
|
||||
@Override
|
||||
public void setTag(String tag) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(String content, Throwable t) {
|
||||
Log.d(TAG, content, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(String content) {
|
||||
Log.d(TAG, content);
|
||||
}
|
||||
};
|
||||
Logger.setLogger(this, newLogger);
|
||||
if (handler == null) {
|
||||
handler = new PushHandler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void put(String key, Object object) {
|
||||
objectMap.put(key, object);
|
||||
@ -62,10 +117,6 @@ public class AppController extends Application {
|
||||
objectMap.remove(key);
|
||||
}
|
||||
|
||||
private ArrayList<Activity> list = new ArrayList<Activity>();
|
||||
|
||||
private boolean isFinish = false;
|
||||
|
||||
/**
|
||||
* Activity关闭时,删除Activity列表中的Activity对象
|
||||
*/
|
||||
@ -100,67 +151,6 @@ public class AppController extends Application {
|
||||
Process.killProcess(Process.myPid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
// Fresco.initialize(getApplicationContext());
|
||||
File dexPath = new File(getDir("dex", Context.MODE_PRIVATE), "hackdex_dex.jar");
|
||||
DexUtils.prepareAssetsDex(this, dexPath, "hackdex_dex.jar");
|
||||
HotFix.patch(this, dexPath.getAbsolutePath(), "dodola.hackdex.AntilazyLoad");
|
||||
|
||||
SharedPreferences sp = this.getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
|
||||
File directory = new File(this.getFilesDir().getAbsolutePath() + File.separator + "hotfix");
|
||||
if (directory.exists()) {
|
||||
File[] files = directory.listFiles();
|
||||
for (File file : files) {
|
||||
Utils.log("dex file = " + file.getName());
|
||||
String clazz = sp.getString(file.getName(), null);
|
||||
if (clazz != null) {
|
||||
dexPath = new File(getDir("dex", Context.MODE_PRIVATE), file.getName());
|
||||
DexUtils.prepareDex(this, dexPath, file);
|
||||
HotFix.patch(this, dexPath.getAbsolutePath(), clazz);
|
||||
Utils.log(file.getName() + " patch success");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DataUtils.init(this);
|
||||
|
||||
AppUncaHandler uncaHandler = new AppUncaHandler(this);
|
||||
Thread.setDefaultUncaughtExceptionHandler(uncaHandler);
|
||||
mInstance = this;
|
||||
|
||||
// 注册push服务,注册成功后会向GHPushMessageReceiver发送广播
|
||||
// 可以从GHPushMessageReceiver的onCommandResult方法中MiPushCommandMessage对象参数中获取注册信息
|
||||
if (shouldInit()) {
|
||||
MiPushClient.registerPush(this, APP_ID, APP_KEY);
|
||||
}
|
||||
|
||||
LoggerInterface newLogger = new LoggerInterface() {
|
||||
|
||||
@Override
|
||||
public void setTag(String tag) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(String content, Throwable t) {
|
||||
Log.d(TAG, content, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(String content) {
|
||||
Log.d(TAG, content);
|
||||
}
|
||||
};
|
||||
Logger.setLogger(this, newLogger);
|
||||
if (handler == null) {
|
||||
handler = new PushHandler(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String getProcessName(Context cxt, int pid) {
|
||||
ActivityManager am = (ActivityManager) cxt
|
||||
.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
@ -180,19 +170,6 @@ public class AppController extends Application {
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
public <T> void addRequest(Request<T> request) {
|
||||
if (mRequestQueue == null) {
|
||||
mRequestQueue = Volley.newRequestQueue(getApplicationContext());
|
||||
}
|
||||
mRequestQueue.add(request);
|
||||
}
|
||||
|
||||
public void cancleRequest(Object tag){
|
||||
if (mRequestQueue != null) {
|
||||
mRequestQueue.cancelAll(tag);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> void addToRequestQueue(Request<T> request) {
|
||||
request.setTag(TAG);
|
||||
getInstance().addRequest(request);
|
||||
@ -210,7 +187,7 @@ public class AppController extends Application {
|
||||
}
|
||||
addToRequestQueue(request, tag);
|
||||
}
|
||||
|
||||
|
||||
public static <T> void addToRequestQueue(Request<T> request, Class<?> clazz) {
|
||||
String tag = null;
|
||||
if (clazz != null) {
|
||||
@ -224,7 +201,7 @@ public class AppController extends Application {
|
||||
getInstance().cancleRequest(tag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void canclePendingRequests(Object obj) {
|
||||
if (obj != null) {
|
||||
getInstance().cancleRequest(obj.getClass().getSimpleName());
|
||||
@ -236,6 +213,19 @@ public class AppController extends Application {
|
||||
getInstance().cancleRequest(clazz.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void addRequest(Request<T> request) {
|
||||
if (mRequestQueue == null) {
|
||||
mRequestQueue = Volley.newRequestQueue(getApplicationContext());
|
||||
}
|
||||
mRequestQueue.add(request);
|
||||
}
|
||||
|
||||
public void cancleRequest(Object tag){
|
||||
if (mRequestQueue != null) {
|
||||
mRequestQueue.cancelAll(tag);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldInit() {
|
||||
ActivityManager am = ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE));
|
||||
|
||||
@ -5,7 +5,6 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
@ -37,17 +36,14 @@ import onekeyshare.OnekeyShare;
|
||||
import onekeyshare.themes.classic.PlatformPage;
|
||||
|
||||
public class BaseActivity extends Activity {
|
||||
private String LOG = this.getClass().getName();
|
||||
private boolean LOG_ON = true;
|
||||
|
||||
private SystemBarTintManager tintManager;
|
||||
|
||||
private boolean isPause;
|
||||
|
||||
private SystemBarTintManager tintManager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AppLog("onCreate");
|
||||
Utils.log(this.getClass().getSimpleName());
|
||||
AppController.getInstance().addActivity(this);
|
||||
EventBus.getDefault().register(this);
|
||||
@ -65,7 +61,7 @@ public class BaseActivity extends Activity {
|
||||
setTranslucentStatus(true);
|
||||
tintManager = new SystemBarTintManager(this);
|
||||
tintManager.setStatusBarTintEnabled(true);
|
||||
tintManager.setStatusBarTintResource(R.color.theme_colors);
|
||||
tintManager.setStatusBarTintResource(R.color.theme);
|
||||
SystemBarConfig config = tintManager.getConfig();
|
||||
contentView.setPadding(0, config.getPixelInsetTop(false), 0,
|
||||
config.getPixelInsetBottom());
|
||||
@ -120,12 +116,6 @@ public class BaseActivity extends Activity {
|
||||
AppController.getInstance().removeActivity(this);
|
||||
}
|
||||
|
||||
public void AppLog(String str) {
|
||||
if (LOG_ON) {
|
||||
Log.i(LOG, str);
|
||||
}
|
||||
}
|
||||
|
||||
public void toast(String msg) {
|
||||
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -231,35 +221,15 @@ public class BaseActivity extends Activity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
AppLog("onPause");
|
||||
DataUtils.onPause(this);
|
||||
isPause = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestart() {
|
||||
super.onRestart();
|
||||
AppLog("onRestart");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
AppLog("onResume");
|
||||
DataUtils.onResume(this);
|
||||
isPause = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
AppLog("onStart");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
AppLog("onStop");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
@ -37,15 +36,12 @@ import onekeyshare.OnekeyShare;
|
||||
import onekeyshare.themes.classic.PlatformPage;
|
||||
|
||||
public class BaseFragmentActivity extends FragmentActivity {
|
||||
private String LOG = this.getClass().getName();
|
||||
private boolean LOG_ON = false;
|
||||
|
||||
private boolean isPause;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AppLog("onCreate");
|
||||
Utils.log(this.getClass().getSimpleName());
|
||||
AppController.getInstance().addActivity(this);
|
||||
EventBus.getDefault().register(this);
|
||||
@ -63,7 +59,7 @@ public class BaseFragmentActivity extends FragmentActivity {
|
||||
setTranslucentStatus(true);
|
||||
SystemBarTintManager tintManager = new SystemBarTintManager(this);
|
||||
tintManager.setStatusBarTintEnabled(true);
|
||||
tintManager.setStatusBarTintResource(R.color.theme_colors);
|
||||
tintManager.setStatusBarTintResource(R.color.theme);
|
||||
SystemBarConfig config = tintManager.getConfig();
|
||||
contentView.setPadding(0, config.getPixelInsetTop(false), 0,
|
||||
config.getPixelInsetBottom());
|
||||
@ -113,12 +109,6 @@ public class BaseFragmentActivity extends FragmentActivity {
|
||||
AppController.getInstance().removeActivity(this);
|
||||
}
|
||||
|
||||
public void AppLog(String str) {
|
||||
if (LOG_ON) {
|
||||
Log.i(LOG, str);
|
||||
}
|
||||
}
|
||||
|
||||
public void toast(String msg) {
|
||||
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -224,34 +214,15 @@ public class BaseFragmentActivity extends FragmentActivity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
AppLog("onPause");
|
||||
DataUtils.onPause(this);
|
||||
isPause = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestart() {
|
||||
super.onRestart();
|
||||
AppLog("onRestart");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
AppLog("onResume");
|
||||
DataUtils.onResume(this);
|
||||
isPause = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
AppLog("onStart");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
AppLog("onStop");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.gh.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
@ -64,7 +63,6 @@ import java.util.Locale;
|
||||
public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
|
||||
private String mRegId;
|
||||
private long mResultCode = -1;
|
||||
private String mReason;
|
||||
private String mCommand;
|
||||
private String mMessage;
|
||||
@ -74,6 +72,8 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
private String mStartTime;
|
||||
private String mEndTime;
|
||||
|
||||
private long mResultCode = -1;
|
||||
|
||||
@Override
|
||||
public void onReceivePassThroughMessage(Context context,
|
||||
MiPushMessage message) {
|
||||
@ -86,15 +86,12 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
Utils.log("channel = " + channel);
|
||||
// 1判断渠道号是否一致或是否为ALL
|
||||
String TD_CHANNEL_ID = (String) PackageUtils.getMetaData(context, context.getPackageName(), "TD_CHANNEL_ID");
|
||||
if ("ALL".equals(channel)
|
||||
|| TD_CHANNEL_ID
|
||||
.equalsIgnoreCase(channel)) {
|
||||
if ("ALL".equals(channel) || channel.equalsIgnoreCase(TD_CHANNEL_ID)) {
|
||||
String type = jsonObject.getString("type");
|
||||
Utils.log("type = " + type);
|
||||
if ("NEWS".equals(type)) {
|
||||
// 新闻推送
|
||||
JSONArray jsonArray = jsonObject
|
||||
.getJSONArray("package");
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("package");
|
||||
ArrayMap<String, Boolean> map = getInstalledMapFromLocal(context);
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
Boolean b = map.get(jsonArray.getString(i));
|
||||
@ -119,14 +116,11 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
if (gh_version != null) {
|
||||
gh_version = gh_version.substring(2);
|
||||
// 判断gh_version是否相同
|
||||
if (gh_version.equals(apk
|
||||
.getString("gh_version"))) {
|
||||
if (gh_version.equals(apk.getString("gh_version"))) {
|
||||
// 判断version是否相同
|
||||
String version = PackageUtils
|
||||
.getVersionByPackage(context,
|
||||
packageName);
|
||||
if (version.equals(apk
|
||||
.getString("version"))) {
|
||||
String version = PackageUtils.getVersionByPackage(
|
||||
context, packageName);
|
||||
if (apk.getString("version").equals(version)) {
|
||||
// 版本相同,无需显示插件更新,继续查看是否有可更新的游戏包
|
||||
continue;
|
||||
}
|
||||
@ -147,10 +141,8 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Log.v(AppController.TAG, "onReceivePassThroughMessage is called. "
|
||||
+ message.toString());
|
||||
String log = context.getString(R.string.recv_passthrough_message,
|
||||
message.getContent());
|
||||
Log.v(AppController.TAG, "onReceivePassThroughMessage is called. " + message.toString());
|
||||
String log = context.getString(R.string.recv_passthrough_message, message.getContent());
|
||||
|
||||
if (!TextUtils.isEmpty(message.getTopic())) {
|
||||
mTopic = message.getTopic();
|
||||
@ -163,8 +155,7 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
AppController.getHandler().sendMessage(msg);
|
||||
}
|
||||
|
||||
private void showNotification(Context context, JSONObject jsonObject, int id)
|
||||
throws JSONException {
|
||||
private void showNotification(Context context, JSONObject jsonObject, int id) throws JSONException {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.gh.gamecenter.NOTIFICATION");
|
||||
intent.putExtra("notifyId", id);
|
||||
@ -185,7 +176,8 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
RemoteViews remoteViews = null;
|
||||
|
||||
if (Build.MANUFACTURER.equals("Meizu")
|
||||
&& (Build.MODEL.startsWith("m") || Build.MODEL.startsWith("MX"))) {
|
||||
&& (Build.MODEL.startsWith("m")
|
||||
|| Build.MODEL.startsWith("MX"))) {
|
||||
remoteViews = new RemoteViews(context.getPackageName(),
|
||||
R.layout.notification_meizu);
|
||||
SimpleDateFormat format = new SimpleDateFormat("HH:mm",
|
||||
@ -193,8 +185,8 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
remoteViews.setTextViewText(R.id.time, format.format(new Date()));
|
||||
} else if (Build.MANUFACTURER.equals("Xiaomi")
|
||||
&& (Build.MODEL.startsWith("MI")
|
||||
|| Build.MODEL.startsWith("HM") || Build.MODEL
|
||||
.startsWith("Redmi"))) {
|
||||
|| Build.MODEL.startsWith("HM")
|
||||
|| Build.MODEL.startsWith("Redmi"))) {
|
||||
// 小米系统
|
||||
remoteViews = new RemoteViews(context.getPackageName(),
|
||||
R.layout.notification_xiaomi);
|
||||
@ -304,8 +296,7 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
|
||||
@Override
|
||||
public void onCommandResult(Context context, MiPushCommandMessage message) {
|
||||
Log.v(AppController.TAG,
|
||||
"onCommandResult is called. " + message.toString());
|
||||
Log.v(AppController.TAG, "onCommandResult is called. " + message.toString());
|
||||
String command = message.getCommand();
|
||||
List<String> arguments = message.getCommandArguments();
|
||||
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments
|
||||
@ -325,60 +316,49 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
mAlias = cmdArg1;
|
||||
log = context.getString(R.string.set_alias_success, mAlias);
|
||||
} else {
|
||||
log = context.getString(R.string.set_alias_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.set_alias_fail, message.getReason());
|
||||
}
|
||||
} else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
|
||||
if (message.getResultCode() == ErrorCode.SUCCESS) {
|
||||
mAlias = cmdArg1;
|
||||
log = context.getString(R.string.unset_alias_success, mAlias);
|
||||
} else {
|
||||
log = context.getString(R.string.unset_alias_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.unset_alias_fail, message.getReason());
|
||||
}
|
||||
} else if (MiPushClient.COMMAND_SET_ACCOUNT.equals(command)) {
|
||||
if (message.getResultCode() == ErrorCode.SUCCESS) {
|
||||
mAccount = cmdArg1;
|
||||
log = context.getString(R.string.set_account_success, mAccount);
|
||||
} else {
|
||||
log = context.getString(R.string.set_account_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.set_account_fail, message.getReason());
|
||||
}
|
||||
} else if (MiPushClient.COMMAND_UNSET_ACCOUNT.equals(command)) {
|
||||
if (message.getResultCode() == ErrorCode.SUCCESS) {
|
||||
mAccount = cmdArg1;
|
||||
log = context.getString(R.string.unset_account_success,
|
||||
mAccount);
|
||||
log = context.getString(R.string.unset_account_success, mAccount);
|
||||
} else {
|
||||
log = context.getString(R.string.unset_account_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.unset_account_fail, message.getReason());
|
||||
}
|
||||
} else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
|
||||
if (message.getResultCode() == ErrorCode.SUCCESS) {
|
||||
mTopic = cmdArg1;
|
||||
log = context.getString(R.string.subscribe_topic_success,
|
||||
mTopic);
|
||||
log = context.getString(R.string.subscribe_topic_success, mTopic);
|
||||
} else {
|
||||
log = context.getString(R.string.subscribe_topic_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.subscribe_topic_fail, message.getReason());
|
||||
}
|
||||
} else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
|
||||
if (message.getResultCode() == ErrorCode.SUCCESS) {
|
||||
log = context.getString(R.string.unsubscribe_topic_success,
|
||||
mTopic);
|
||||
log = context.getString(R.string.unsubscribe_topic_success, mTopic);
|
||||
} else {
|
||||
log = context.getString(R.string.unsubscribe_topic_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.unsubscribe_topic_fail, message.getReason());
|
||||
}
|
||||
} else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
|
||||
if (message.getResultCode() == ErrorCode.SUCCESS) {
|
||||
mStartTime = cmdArg1;
|
||||
mEndTime = cmdArg2;
|
||||
log = context.getString(R.string.set_accept_time_success,
|
||||
mStartTime, mEndTime);
|
||||
log = context.getString(R.string.set_accept_time_success, mStartTime, mEndTime);
|
||||
} else {
|
||||
log = context.getString(R.string.set_accept_time_fail,
|
||||
message.getReason());
|
||||
log = context.getString(R.string.set_accept_time_fail, message.getReason());
|
||||
}
|
||||
} else {
|
||||
log = message.getReason();
|
||||
@ -415,26 +395,19 @@ public class GHPushMessageReceiver extends PushMessageReceiver {
|
||||
AppController.getHandler().sendMessage(msg);
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
public static String getSimpleDate() {
|
||||
return new SimpleDateFormat("MM-dd hh:mm:ss").format(new Date());
|
||||
return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault()).format(new Date());
|
||||
}
|
||||
|
||||
public static class PushHandler extends Handler {
|
||||
|
||||
private Context context;
|
||||
|
||||
public PushHandler(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
String s = (String) msg.obj;
|
||||
|
||||
if (!TextUtils.isEmpty(s)) {
|
||||
// Toast.makeText(context, s, Toast.LENGTH_LONG).show();
|
||||
Utils.log(getSimpleDate() + " PushHandler:" + s);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,9 @@ import com.gh.gamecenter.SplashScreenActivity;
|
||||
|
||||
public final class Config {
|
||||
|
||||
// test host dev.ghzhushou.com/api
|
||||
public static final String HOST = "http://api.ghzhushou.com/";
|
||||
// public static final String HOST = "http://115.28.145.16:9001/";
|
||||
|
||||
public static final String PREFERENCE = "ghzhushou";
|
||||
|
||||
// public static final boolean isShow = true;
|
||||
public static final boolean isShow = SplashScreenActivity.isShow;
|
||||
|
||||
}
|
||||
|
||||
@ -38,4 +38,5 @@ public class Constants {
|
||||
public static final int SEARCH_CD = 5 * 60 * 1000;
|
||||
//评论 cd间隔
|
||||
public static final int COMMENT_CD = 60 * 1000;
|
||||
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import com.gh.gamecenter.volley.extended.ConcernJsonArrayExtendedRequest;
|
||||
import com.gh.gamecenter.volley.extended.JsonArrayExtendedRequest;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -19,102 +18,117 @@ import java.util.UUID;
|
||||
* Created by khy on 2016/8/24.
|
||||
*/
|
||||
public class ConcernUtils {
|
||||
public static void LoadConcernData(final String url, final DownJsonListener listener){
|
||||
|
||||
public static void loadConcernData(final String url, final DownJsonListener listener){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JsonArrayExtendedRequest request = new JsonArrayExtendedRequest(url, new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
if (listener != null){
|
||||
listener.downSucced(response.toString());
|
||||
}
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
if (listener != null){
|
||||
listener.downFailed();
|
||||
}
|
||||
}
|
||||
});
|
||||
JsonArrayExtendedRequest request = new JsonArrayExtendedRequest(url,
|
||||
new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
if (listener != null){
|
||||
listener.downSucced(response.toString());
|
||||
}
|
||||
}
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
if (listener != null){
|
||||
listener.downFailed();
|
||||
}
|
||||
}
|
||||
});
|
||||
request.setShouldCache(false);
|
||||
AppController.addToRequestQueue(request);
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
public static void PostConcernGameId(final String postData, final String postUrl,final DownJsonListener listener){
|
||||
new Thread(new Runnable() {
|
||||
|
||||
public static void postConcernGameId(final String gameId, final String postUrl, final DownJsonListener listener){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JSONArray jsonArray = null;
|
||||
try {
|
||||
jsonArray = new JSONArray(postData);
|
||||
} catch (JSONException e) {
|
||||
|
||||
}
|
||||
ConcernJsonArrayExtendedRequest request = new ConcernJsonArrayExtendedRequest(Request.Method.POST, postUrl, jsonArray, new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
listener.downSucced("关注成功");
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
listener.downFailed();
|
||||
}
|
||||
});
|
||||
JSONArray data = new JSONArray();
|
||||
data.put(gameId);
|
||||
|
||||
ConcernJsonArrayExtendedRequest request = new ConcernJsonArrayExtendedRequest(
|
||||
Request.Method.POST, postUrl, data,
|
||||
new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
if (listener != null) {
|
||||
listener.downSucced("关注成功");
|
||||
}
|
||||
}
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
if (listener != null) {
|
||||
listener.downFailed();
|
||||
}
|
||||
}
|
||||
});
|
||||
request.setShouldCache(false);
|
||||
AppController.addToRequestQueue(request);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
public static void DeleteConcernData(final String url, final DownJsonListener listener){
|
||||
final JSONArray jsonArray = new JSONArray();
|
||||
|
||||
public static void deleteConcernData(final String url, final DownJsonListener listener){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ConcernJsonArrayExtendedRequest request = new ConcernJsonArrayExtendedRequest(Request.Method.DELETE, url, jsonArray, new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
listener.downSucced("删除成功");
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
listener.downFailed();
|
||||
}
|
||||
});
|
||||
ConcernJsonArrayExtendedRequest request = new ConcernJsonArrayExtendedRequest(
|
||||
Request.Method.DELETE, url, new JSONArray(),
|
||||
new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
if (listener != null) {
|
||||
listener.downSucced("删除成功");
|
||||
}
|
||||
}
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
if (listener != null) {
|
||||
listener.downFailed();
|
||||
}
|
||||
}
|
||||
});
|
||||
request.setShouldCache(false);
|
||||
AppController.addToRequestQueue(request);
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
public static void UpdateConcernData(final String url,String updateData,final DownJsonListener listener){
|
||||
JSONArray jsonArray = null;
|
||||
try {
|
||||
jsonArray = new JSONArray(updateData);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
final JSONArray finalJsonArray = jsonArray;
|
||||
|
||||
public static void updateConcernData(final String url, final JSONArray data, final DownJsonListener listener){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ConcernJsonArrayExtendedRequest request = new ConcernJsonArrayExtendedRequest(Request.Method.PUT, url, finalJsonArray, new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
listener.downSucced("跟新设备关注成功");
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
listener.downFailed();
|
||||
}
|
||||
});
|
||||
ConcernJsonArrayExtendedRequest request = new ConcernJsonArrayExtendedRequest(
|
||||
Request.Method.PUT, url, data,
|
||||
new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
if (listener != null) {
|
||||
listener.downSucced("跟新设备关注成功");
|
||||
}
|
||||
}
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
if (listener != null) {
|
||||
listener.downFailed();
|
||||
}
|
||||
}
|
||||
});
|
||||
request.setShouldCache(false);
|
||||
AppController.addToRequestQueue(request);
|
||||
}
|
||||
@ -123,16 +137,15 @@ public class ConcernUtils {
|
||||
}
|
||||
|
||||
public interface DownJsonListener {
|
||||
|
||||
void downSucced(String str);
|
||||
void downFailed();
|
||||
|
||||
}
|
||||
//获取设备号ID
|
||||
public static String UUID(Context context){
|
||||
|
||||
// 获取设备号ID
|
||||
public static String uuid(Context context){
|
||||
final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
|
||||
final String tmDevice, tmSerial, tmPhone, androidId;
|
||||
final String tmDevice, tmSerial, androidId;
|
||||
tmDevice = "" + tm.getDeviceId();
|
||||
tmSerial = "" + tm.getSimSerialNumber();
|
||||
androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
|
||||
@ -140,5 +153,6 @@ public class ConcernUtils {
|
||||
UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
|
||||
return deviceUuid.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -15,14 +15,16 @@ public class DeviceUtils {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
String imei = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
|
||||
if (!TextUtils.isEmpty(imei)) {
|
||||
buffer.append("imei=" + imei);
|
||||
buffer.append("imei=");
|
||||
buffer.append(imei);
|
||||
}
|
||||
String android_id = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
|
||||
if (!TextUtils.isEmpty(android_id)) {
|
||||
if (buffer.length() != 0) {
|
||||
buffer.append(",");
|
||||
}
|
||||
buffer.append("android_id=" + android_id);
|
||||
buffer.append("android_id=");
|
||||
buffer.append(android_id);
|
||||
}
|
||||
WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
String mac = wm.getConnectionInfo().getMacAddress();
|
||||
@ -30,7 +32,8 @@ public class DeviceUtils {
|
||||
if (buffer.length() != 0) {
|
||||
buffer.append(",");
|
||||
}
|
||||
buffer.append("mac=" + mac);
|
||||
buffer.append("mac=");
|
||||
buffer.append(mac);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import java.io.OutputStream;
|
||||
* Created by sunpengfei on 15/11/4.
|
||||
*/
|
||||
public class DexUtils {
|
||||
|
||||
private static final int BUF_SIZE = 2048;
|
||||
|
||||
public static boolean prepareAssetsDex(Context context, File dexInternalStoragePath, String dex_file) {
|
||||
@ -53,7 +54,7 @@ public class DexUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean prepareDex(Context context, File dexInternalStoragePath, File dex_file) {
|
||||
public static boolean prepareDex(File dexInternalStoragePath, File dex_file) {
|
||||
BufferedInputStream bis = null;
|
||||
OutputStream dexWriter = null;
|
||||
|
||||
@ -86,4 +87,5 @@ public class DexUtils {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -36,29 +36,30 @@ public class DialogUtils {
|
||||
isShowHijackDialog = true;
|
||||
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context,
|
||||
R.layout.common_alertdialog, null);
|
||||
TextView title = (TextView) view
|
||||
.findViewById(R.id.alertdialog_title);
|
||||
title.setText("警告");
|
||||
TextView content = (TextView) view
|
||||
.findViewById(R.id.alertdialog_content);
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
|
||||
// 标题
|
||||
TextView title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
title.setText("警告");
|
||||
|
||||
// 内容
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
content.setText("您当前网络环境异常,下载地址已被替换(网络劫持),请更换网络环境进行下载。");
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
// 取消按钮
|
||||
TextView cancel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirem = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
|
||||
// 确定按钮
|
||||
TextView confirem = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
confirem.setText("确定");
|
||||
confirem.setOnClickListener(new OnClickListener() {
|
||||
confirem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 跳转wifi管理界面
|
||||
@ -67,6 +68,7 @@ public class DialogUtils {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setOnDismissListener(new Dialog.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@ -87,28 +89,30 @@ public class DialogUtils {
|
||||
isShowDeleteDialog = true;
|
||||
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context,
|
||||
R.layout.search_history_delete_dialog, null);
|
||||
View view = View.inflate(context, R.layout.search_history_delete_dialog, null);
|
||||
|
||||
// 标题
|
||||
TextView title = (TextView) view.findViewById(R.id.delete_dialog_title);
|
||||
title.setText("卸载");
|
||||
TextView content = (TextView) view
|
||||
.findViewById(R.id.delete_dialog_message);
|
||||
|
||||
// 内容
|
||||
TextView content = (TextView) view.findViewById(R.id.delete_dialog_message);
|
||||
content.setText("您已安装了官方原版,该版本与插件版本冲突,是否卸载官方原版?");
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.delete_dialog_cancel);
|
||||
// 取消按钮
|
||||
TextView cancel = (TextView) view.findViewById(R.id.delete_dialog_cancel);
|
||||
cancel.setText("忽略");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirem = (TextView) view
|
||||
.findViewById(R.id.delete_dialog_confirm);
|
||||
|
||||
// 确定按钮
|
||||
TextView confirem = (TextView) view.findViewById(R.id.delete_dialog_confirm);
|
||||
confirem.setText("卸载");
|
||||
confirem.setOnClickListener(new OnClickListener() {
|
||||
confirem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
@ -117,6 +121,7 @@ public class DialogUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setOnDismissListener(new Dialog.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@ -131,24 +136,27 @@ public class DialogUtils {
|
||||
public static void showWarningDialog(Context context, String msg, final ConfiremListener listener) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
TextView title = (TextView) view
|
||||
.findViewById(R.id.alertdialog_title);
|
||||
title.setText("下载提示");
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
|
||||
// 标题
|
||||
TextView title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
title.setText("下载提示");
|
||||
|
||||
// 内容
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
content.setText(msg);
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
// 取消按钮
|
||||
TextView cancel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirem = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
|
||||
// 确定按钮
|
||||
TextView confirem = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
confirem.setText("继续");
|
||||
confirem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -159,6 +167,7 @@ public class DialogUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
@ -171,19 +180,24 @@ public class DialogUtils {
|
||||
public static void showSuccessDialog(Context context) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.gamedetails_attention_dialog, null);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.dialog_title);
|
||||
title.setText("关注成功");
|
||||
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
message.setText("游戏的最新动态消息会优先提醒您,包括攻略、资讯、开服信息、开测信息以及最新的插件。");
|
||||
|
||||
view.findViewById(R.id.dialog_rl_cancel).setVisibility(View.GONE);
|
||||
|
||||
TextView confirm = (TextView) view.findViewById(R.id.dialog_confirm);
|
||||
confirm.setText("我知道了");
|
||||
confirm.setOnClickListener(new OnClickListener() {
|
||||
confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
message.setText("游戏的最新动态消息会优先提醒您,包括攻略、资讯、开服信息、开测信息以及最新的插件。");
|
||||
view.findViewById(R.id.dialog_rl_cancel).setVisibility(View.GONE);
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
@ -192,21 +206,24 @@ public class DialogUtils {
|
||||
public static void showCancelDialog(Context context, final ConfiremListener listener) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.gamedetails_attention_dialog, null);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.dialog_title);
|
||||
title.setText("取消关注");
|
||||
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
Spanned content = Html.fromHtml("取消关注游戏后,您将无法及时收到游戏的" +
|
||||
"<font color='#ff0000'>攻略</font>、" +
|
||||
"<font color='#ff0000'>资讯</font>等最新动态提醒,您确定取消吗?");
|
||||
message.setText(content);
|
||||
|
||||
TextView cancel = (TextView) view.findViewById(R.id.dialog_cancel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView message = (TextView) view.findViewById(R.id.dialog_message);
|
||||
|
||||
Spanned content = Html
|
||||
.fromHtml("取消关注游戏后,您将无法及时收到游戏的<font color='#ff0000'>攻略</font>、<font color='#ff0000'>资讯</font>等最新动态提醒,您确定取消吗?");
|
||||
message.setText(content);
|
||||
|
||||
view.findViewById(R.id.dialog_rl_confirm).setVisibility(View.VISIBLE);
|
||||
view.findViewById(R.id.dialog_confirm).setOnClickListener(
|
||||
@ -219,6 +236,7 @@ public class DialogUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
@ -228,26 +246,26 @@ public class DialogUtils {
|
||||
final DismissListener dListener) {
|
||||
final Dialog dialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.common_alertdialog, null);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.alertdialog_title);
|
||||
title.setText("插件化安装");
|
||||
TextView content = (TextView) view
|
||||
.findViewById(R.id.alertdialog_content);
|
||||
|
||||
TextView content = (TextView) view.findViewById(R.id.alertdialog_content);
|
||||
Spanned spanned = Html.fromHtml("您将进行插件化安装以实现插件功能,此过程将"
|
||||
+ "<font color=\"#ff0000\">卸载</font>" + "当前使用的版本并"
|
||||
+ "<font color=\"#ff0000\">安装插件版本</font>" + "。");
|
||||
content.setText(spanned);
|
||||
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
TextView cancel = (TextView) view.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("取消");
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
TextView confirm = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
|
||||
TextView confirm = (TextView) view.findViewById(R.id.alertdialog_confirm);
|
||||
confirm.setText("确定");
|
||||
confirm.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@ -276,20 +294,22 @@ public class DialogUtils {
|
||||
public static void showDisclaimerDialog(Context context, String content) {
|
||||
final Dialog disclaimerDialog = new Dialog(context);
|
||||
View view = View.inflate(context, R.layout.setting_disclaimer_dialog, null);
|
||||
TextView title = (TextView) view
|
||||
.findViewById(R.id.disclaimer_dialog_title);
|
||||
|
||||
TextView title = (TextView) view.findViewById(R.id.disclaimer_dialog_title);
|
||||
title.setText("免责声明");
|
||||
TextView message = (TextView) view
|
||||
.findViewById(R.id.disclaimer_dialog_message);
|
||||
|
||||
TextView message = (TextView) view.findViewById(R.id.disclaimer_dialog_message);
|
||||
Spanned spanned = Html.fromHtml(content);
|
||||
message.setText(spanned);
|
||||
|
||||
view.findViewById(R.id.disclaimer_dialog_confirm).setOnClickListener(
|
||||
new OnClickListener() {
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
disclaimerDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
disclaimerDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
disclaimerDialog.setContentView(view);
|
||||
disclaimerDialog.show();
|
||||
|
||||
@ -25,7 +25,7 @@ public class DisplayUtils {
|
||||
* 将px值转换为sp值,保证文字大小不变
|
||||
*
|
||||
* @param pxValue
|
||||
* @param fontScale
|
||||
* @param pxValue
|
||||
* (DisplayMetrics类中属性scaledDensity)
|
||||
* @return
|
||||
*/
|
||||
@ -38,7 +38,7 @@ public class DisplayUtils {
|
||||
* 将sp值转换为px值,保证文字大小不变
|
||||
*
|
||||
* @param spValue
|
||||
* @param fontScale
|
||||
* @param spValue
|
||||
* (DisplayMetrics类中属性scaledDensity)
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -134,9 +134,7 @@ public class FileUtils {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static float getFreeSpaceByPath(String path) {
|
||||
StatFs statfs = new StatFs(path);
|
||||
|
||||
long blockSize = statfs.getBlockSize();
|
||||
|
||||
long availableBlocks = statfs.getAvailableBlocks();
|
||||
|
||||
return availableBlocks * blockSize / 1024f / 1024f;
|
||||
@ -168,8 +166,7 @@ public class FileUtils {
|
||||
DataInputStream dis = null;
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url)
|
||||
.openConnection();
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
connection.setConnectTimeout(5 * 1000);
|
||||
connection.setReadTimeout(5 * 1000);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.gh.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
@ -27,50 +26,53 @@ import java.util.TimeZone;
|
||||
*/
|
||||
public class GameViewUtils {
|
||||
|
||||
public static void setLabelList(Context context, LinearLayout labelLayout,
|
||||
List<String> tag) {
|
||||
public static void setLabelList(Context context, LinearLayout labelLayout, List<String> tag) {
|
||||
labelLayout.removeAllViews();
|
||||
if (tag == null || tag.isEmpty()) {
|
||||
labelLayout.addView(getGameTagView(context, "官方版"));
|
||||
labelLayout.addView(getGameTagView(context, "官方版", 0));
|
||||
} else {
|
||||
for (int i = 0, size = tag.size() > 3 ? 3 : tag.size(); i < size; i++) {
|
||||
labelLayout.addView(getGameTagView(context, tag.get(i)));
|
||||
if (i == size - 1) {
|
||||
labelLayout.addView(getGameTagView(context, tag.get(i), 0));
|
||||
} else {
|
||||
labelLayout.addView(getGameTagView(context, tag.get(i), DisplayUtils.dip2px(context, 5)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取游戏标签列表视图
|
||||
public static void setLabelList(Context context, LinearLayout labelLayout,
|
||||
String tag) {
|
||||
public static void setLabelList(Context context, LinearLayout labelLayout, String tag) {
|
||||
labelLayout.removeAllViews();
|
||||
// 添加tag标签
|
||||
if (tag != null && !tag.isEmpty()) {
|
||||
String[] tags = tag.split(",");
|
||||
for (int i = 0; i < tags.length; i++) {
|
||||
labelLayout.addView(getGameTagView(context, tags[i]));
|
||||
if (i == tags.length - 1) {
|
||||
labelLayout.addView(getGameTagView(context, tags[i], 0));
|
||||
} else {
|
||||
labelLayout.addView(getGameTagView(context, tags[i], DisplayUtils.dip2px(context, 5)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static TextView getGameTagView(Context context, String tagStr) {
|
||||
LayoutParams lp = new LayoutParams(
|
||||
public static TextView getGameTagView(Context context, String tagStr, int rightMargin) {
|
||||
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
||||
lp.setMargins(0, 0, DisplayUtils.dip2px(context, 5), 0);
|
||||
lparams.rightMargin = rightMargin;
|
||||
TextView tag = new TextView(context);
|
||||
tag.setTextSize(TypedValue.COMPLEX_UNIT_SP, 11);
|
||||
tag.setSingleLine(true);
|
||||
tag.setText(tagStr);
|
||||
if ("官方版".equals(tagStr) || "已关注".equals(tagStr)) {
|
||||
tag.setBackgroundResource(R.drawable.border_green_bg);
|
||||
tag.setTextColor(Color.parseColor("#05c400"));
|
||||
} else if ("已安装".equals(tagStr)) {
|
||||
tag.setBackgroundResource(R.drawable.border_red_bg);
|
||||
tag.setTextColor(Color.parseColor("#bc2132"));
|
||||
tag.setTextColor(context.getResources().getColor(R.color.tag_green));
|
||||
} else {
|
||||
tag.setBackgroundResource(R.drawable.border_blue_bg);
|
||||
tag.setTextColor(0xff1BA4FC);
|
||||
tag.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
}
|
||||
tag.setLayoutParams(lp);
|
||||
tag.setLayoutParams(lparams);
|
||||
tag.setPadding(DisplayUtils.dip2px(context, 3),
|
||||
0,
|
||||
DisplayUtils.dip2px(context, 3),
|
||||
@ -80,13 +82,10 @@ public class GameViewUtils {
|
||||
|
||||
public static String getGameTestDate(long testTime) {
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd",
|
||||
Locale.CHINA);
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
|
||||
format.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
||||
|
||||
String testDate;
|
||||
|
||||
try {
|
||||
long today = format.parse(format.format(new Date())).getTime();
|
||||
long day = Long.parseLong(testTime + "000");
|
||||
|
||||
@ -15,8 +15,7 @@ public class GzipUtils {
|
||||
/*
|
||||
* 数据压缩
|
||||
*/
|
||||
public static void compress(InputStream is, OutputStream os)
|
||||
throws IOException {
|
||||
public static void compress(InputStream is, OutputStream os) throws IOException {
|
||||
GZIPOutputStream gos = null;
|
||||
try {
|
||||
gos = new GZIPOutputStream(os);
|
||||
@ -38,8 +37,7 @@ public class GzipUtils {
|
||||
/*
|
||||
* 数据解压缩
|
||||
*/
|
||||
public static void decompress(InputStream is, OutputStream os)
|
||||
throws IOException {
|
||||
public static void decompress(InputStream is, OutputStream os) throws IOException {
|
||||
GZIPInputStream gis = null;
|
||||
try {
|
||||
gis = new GZIPInputStream(is);
|
||||
@ -112,4 +110,5 @@ public class GzipUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ import dalvik.system.PathClassLoader;
|
||||
|
||||
/* compiled from: ProGuard */
|
||||
public final class HotFix {
|
||||
|
||||
public static void patch(Context context, String patchDexFile, String patchClassName) {
|
||||
if (patchDexFile != null && new File(patchDexFile).exists()) {
|
||||
try {
|
||||
@ -153,4 +154,5 @@ public final class HotFix {
|
||||
}
|
||||
return newInstance;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package com.gh.common.util;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.sdk.android.httpdns.HttpDns;
|
||||
import com.alibaba.sdk.android.httpdns.HttpDnsService;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Created by khy on 2016/7/11.
|
||||
*/
|
||||
public class HttpdnsUtils {
|
||||
private static HttpDnsService httpdns;
|
||||
private static String accountID = "180813";
|
||||
|
||||
public static String getUrls(Context context,String url){
|
||||
httpdns = HttpDns.getService(context,accountID);
|
||||
try {
|
||||
URL oldUrl = new URL(url);
|
||||
HttpURLConnection connection = (HttpURLConnection) oldUrl.openConnection();
|
||||
String ip = httpdns.getIpByHost(oldUrl.getHost());
|
||||
if (ip!= null){
|
||||
String newUrl = url.replaceFirst(oldUrl.getHost(), ip);
|
||||
return newUrl;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -27,9 +27,11 @@ import java.util.concurrent.Executors;
|
||||
import de.greenrobot.event.EventBus;
|
||||
|
||||
public class ImageUtils {
|
||||
|
||||
private static ImageUtils singleton;
|
||||
private static ImageLoader imageLoader;
|
||||
private static DisplayImageOptions options;
|
||||
|
||||
private ArrayMap<String, WeakReference<Bitmap>> imageCache = new ArrayMap<String, WeakReference<Bitmap>>();
|
||||
|
||||
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(5);
|
||||
@ -78,16 +80,14 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingComplete(String arg0, View view,
|
||||
Bitmap arg2) {
|
||||
public void onLoadingComplete(String arg0, View view, Bitmap arg2) {
|
||||
AlphaAnimation animation = new AlphaAnimation(0f, 1f);
|
||||
animation.setDuration(500);
|
||||
view.startAnimation(animation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String arg0, View arg1,
|
||||
FailReason arg2) {
|
||||
public void onLoadingFailed(String arg0, View arg1, FailReason arg2) {
|
||||
|
||||
}
|
||||
|
||||
@ -99,21 +99,20 @@ public class ImageUtils {
|
||||
});
|
||||
}
|
||||
//增加一个上下文环境,图片宽度设最大,高度自适应
|
||||
public void display(String url, ImageView imageView, int drawable,Context context) {
|
||||
display(url, imageView, drawable, ScaleType.FIT_XY, null,context);
|
||||
public void display(String url, ImageView imageView, int drawable, Context context) {
|
||||
display(url, imageView, drawable, ScaleType.FIT_XY, null, context);
|
||||
}
|
||||
|
||||
public void display(String url, ImageView imageView, int drawable) {
|
||||
display(url, imageView, drawable, ScaleType.FIT_XY, null);
|
||||
}
|
||||
|
||||
public void display(final String url, final ImageView imageView,
|
||||
final int drawable, final ScaleType scaleType,
|
||||
final OnLoadingCompleteListener listener) {
|
||||
public void display(final String url, final ImageView imageView, final int drawable,
|
||||
final ScaleType scaleType, final OnLoadingCompleteListener listener) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view,
|
||||
Bitmap loadedImage) {
|
||||
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
||||
if (imageView instanceof CircleImageView) {
|
||||
imageView.setScaleType(ScaleType.CENTER_CROP);
|
||||
} else {
|
||||
@ -138,27 +137,24 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String imageUri, View view,
|
||||
FailReason reason) {
|
||||
public void onLoadingFailed(String imageUri, View view, FailReason reason) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void display(final String url, final ImageView imageView,
|
||||
final int drawable, final ScaleType scaleType,
|
||||
final OnLoadingCompleteListener listener,final Context context) {
|
||||
public void display(final String url, final ImageView imageView, final int drawable,
|
||||
final ScaleType scaleType, final OnLoadingCompleteListener listener, final Context context) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view,
|
||||
Bitmap loadedImage) {
|
||||
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
||||
int width = loadedImage.getWidth();
|
||||
int height = loadedImage.getHeight();
|
||||
int widthPixels = context.getResources().getDisplayMetrics().widthPixels;
|
||||
widthPixels = widthPixels - (int)(context.getResources().getDisplayMetrics().density * 10);
|
||||
float index = (float) height / (float) width;
|
||||
int newHeight = (int)(index * widthPixels);
|
||||
widthPixels = widthPixels - DisplayUtils.dip2px(context, 10);
|
||||
float scale = (float) height / (float) width;
|
||||
int newHeight = (int)(scale * widthPixels);
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
|
||||
if (layoutParams!=null){
|
||||
@ -193,16 +189,14 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String imageUri, View view,
|
||||
FailReason reason) {
|
||||
public void onLoadingFailed(String imageUri, View view, FailReason reason) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void display(final String url, final ImageView imageView,
|
||||
final int drawable, final ScaleType scaleType,
|
||||
final OnLoadingCompleteListener listener, final int i) {
|
||||
public void display(final String url, final ImageView imageView, final int drawable,
|
||||
final ScaleType scaleType, final OnLoadingCompleteListener listener, final int i) {
|
||||
imageLoader.displayImage(url, imageView, options,
|
||||
new ImageLoadingListener() {
|
||||
@Override
|
||||
|
||||
@ -9,9 +9,11 @@ import java.io.RandomAccessFile;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Installation {
|
||||
private static String sID = null;
|
||||
|
||||
private static final String INSTALLATION = "INSTALLATION";
|
||||
|
||||
private static String sID = null;
|
||||
|
||||
public synchronized static String getUUID(Context context) {
|
||||
if (sID == null) {
|
||||
File installation = new File(context.getFilesDir(), INSTALLATION);
|
||||
@ -42,4 +44,5 @@ public class Installation {
|
||||
out.write(id.getBytes());
|
||||
out.close();
|
||||
}
|
||||
|
||||
}
|
||||
@ -74,4 +74,5 @@ public class MD5Utils {
|
||||
BigInteger bigInt = new BigInteger(1, digest.digest());
|
||||
return bigInt.toString(16);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ public class MeasureHeightLayoutManager extends LinearLayoutManager {
|
||||
}
|
||||
|
||||
private int[] mMeasuredDimension = new int[1];
|
||||
|
||||
@Override
|
||||
public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state,
|
||||
int widthSpec, int heightSpec) {
|
||||
@ -32,7 +33,7 @@ public class MeasureHeightLayoutManager extends LinearLayoutManager {
|
||||
height = height + mMeasuredDimension[0];
|
||||
|
||||
}
|
||||
if (height>heightSize){
|
||||
if (height > heightSize){
|
||||
super.onMeasure(recycler, state, widthSpec, heightSpec);
|
||||
}else {
|
||||
setMeasuredDimension(View.MeasureSpec.getSize(widthSpec), height);
|
||||
@ -40,7 +41,6 @@ public class MeasureHeightLayoutManager extends LinearLayoutManager {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec,
|
||||
int heightSpec, int[] measuredDimension) {
|
||||
View view = recycler.getViewForPosition(position);
|
||||
@ -59,4 +59,5 @@ public class MeasureHeightLayoutManager extends LinearLayoutManager {
|
||||
measuredDimension[0] = getDecoratedMeasuredHeight(view) + p.bottomMargin + p.topMargin;
|
||||
recycler.recycleView(view);
|
||||
}
|
||||
|
||||
}
|
||||
@ -9,8 +9,7 @@ public class NetworkUtils {
|
||||
/**
|
||||
* 判断是否有网络连接
|
||||
*
|
||||
* @param context
|
||||
* 上下文
|
||||
* @param context 上下文
|
||||
* @return true 有网络连接 false 无网络连接
|
||||
*/
|
||||
public static boolean isNetworkConnected(Context context) {
|
||||
@ -29,8 +28,7 @@ public class NetworkUtils {
|
||||
/**
|
||||
* 判断WIFI网络是否可用
|
||||
*
|
||||
* @param context
|
||||
* 上下文
|
||||
* @param context 上下文
|
||||
* @return true wifi可用 false wifi不可用
|
||||
*/
|
||||
public static boolean isWifiConnected(Context context) {
|
||||
@ -49,8 +47,7 @@ public class NetworkUtils {
|
||||
/**
|
||||
* 判断MOBILE网络是否可用
|
||||
*
|
||||
* @param context
|
||||
* 上下文
|
||||
* @param context 上下文
|
||||
* @return true mobile可用 false mobile不可用
|
||||
*/
|
||||
public static boolean isMobileConnected(Context context) {
|
||||
@ -106,4 +103,5 @@ public class NetworkUtils {
|
||||
}
|
||||
return "NONE";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -43,8 +43,7 @@ public class NewsUtils {
|
||||
* @param entrance
|
||||
* @return
|
||||
*/
|
||||
public static void startNewsActivity(Context context,
|
||||
NewsEntity newsEntity, String entrance) {
|
||||
public static void startNewsActivity(Context context, NewsEntity newsEntity, String entrance) {
|
||||
Intent intent = new Intent(context, NewsActivity.class);
|
||||
NewsDetailsEntity entity = new NewsDetailsEntity();
|
||||
entity.setId(newsEntity.getId());
|
||||
@ -70,12 +69,13 @@ public class NewsUtils {
|
||||
public void onResponse(JSONObject response) {
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
request.setShouldCache(false);
|
||||
AppController.addToRequestQueue(request, NewsUtils.class);
|
||||
}
|
||||
|
||||
@ -33,15 +33,15 @@ import de.greenrobot.event.EventBus;
|
||||
|
||||
public class PlatformUtils {
|
||||
|
||||
private static PlatformUtils mInstance;
|
||||
|
||||
private Context context;
|
||||
|
||||
private ArrayMap<String, String> platformMap;
|
||||
private ArrayMap<String, Integer> platformPicMap;
|
||||
private ArrayMap<String, String> platformPicUrlMap;
|
||||
private ArrayMap<String, String> platformColorMap;
|
||||
|
||||
private static PlatformUtils mInstance;
|
||||
|
||||
private Context context;
|
||||
|
||||
private PlatformUtils(Context con) {
|
||||
this.context = con.getApplicationContext();
|
||||
initMap();
|
||||
@ -214,7 +214,7 @@ public class PlatformUtils {
|
||||
if (color != null) {
|
||||
return color;
|
||||
}
|
||||
return "#1BA4FC";
|
||||
return "#00B7FA";
|
||||
}
|
||||
|
||||
public int getPlatformPic(String platform) {
|
||||
@ -309,4 +309,5 @@ public class PlatformUtils {
|
||||
});
|
||||
AppController.addToRequestQueue(request, SplashScreenActivity.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -43,7 +43,6 @@ public class RSEUtils {
|
||||
* 使用公钥加密
|
||||
*
|
||||
* @param content
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public static String encryptByPublic(String content) {
|
||||
@ -68,10 +67,7 @@ public class RSEUtils {
|
||||
/**
|
||||
* 使用公钥解密
|
||||
*
|
||||
* @param content
|
||||
* 密文
|
||||
* @param key
|
||||
* 商户私钥
|
||||
* @param content 密文
|
||||
* @return 解密后的字符串
|
||||
*/
|
||||
public static String decryptByPublic(String content) {
|
||||
|
||||
@ -5,7 +5,7 @@ public class SpeedUtils {
|
||||
public static String getSpeed(long kSpeed) {
|
||||
if (kSpeed >= 1000) {
|
||||
float mSpeed = kSpeed / 1024f;
|
||||
String str = mSpeed + "";
|
||||
String str = String.valueOf(mSpeed);
|
||||
if (str.length() > 4) {
|
||||
str = str.substring(0, 4);
|
||||
}
|
||||
@ -14,10 +14,9 @@ public class SpeedUtils {
|
||||
return kSpeed + "K/s";
|
||||
}
|
||||
|
||||
public static String getRemainTime(long totalSize, long currentSize,
|
||||
long speed) {
|
||||
public static String getRemainTime(long totalSize, long currentSize, long speed) {
|
||||
long remainSize = totalSize - currentSize;
|
||||
long remainTime = 0;
|
||||
long remainTime;
|
||||
if (speed != 0) {
|
||||
remainTime = remainSize / speed;
|
||||
} else {
|
||||
@ -35,4 +34,5 @@ public class SpeedUtils {
|
||||
return second + "秒";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ public class DownloadDialog {
|
||||
int color = Color.parseColor(PlatformUtils.getInstance(context)
|
||||
.getPlatformColor(apkEntity.getPlatform()));
|
||||
GradientDrawable gradientDrawable = new GradientDrawable();
|
||||
gradientDrawable.setColor(0xFFFFFFFF);
|
||||
gradientDrawable.setColor(Color.WHITE);
|
||||
gradientDrawable.setStroke(DisplayUtils.dip2px(context, 1), color);
|
||||
viewHolder.itemView.setBackgroundDrawable(gradientDrawable);
|
||||
|
||||
@ -690,7 +690,7 @@ public class DownloadDialog {
|
||||
int color = Color.parseColor(PlatformUtils.getInstance(
|
||||
context).getPlatformColor(apkEntity.getPlatform()));
|
||||
GradientDrawable gradientDrawable = new GradientDrawable();
|
||||
gradientDrawable.setColor(0xFFFFFFFF);
|
||||
gradientDrawable.setColor(Color.WHITE);
|
||||
gradientDrawable.setStroke(DisplayUtils.dip2px(context, 1), color);
|
||||
viewHolder.itemView.setBackgroundDrawable(gradientDrawable);
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.gh.common.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
@ -16,7 +17,7 @@ public class HorizontalItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
public HorizontalItemDecoration(Context context, int interval, int size) {
|
||||
paint = new Paint();
|
||||
paint.setColor(0xffffffff);
|
||||
paint.setColor(Color.WHITE);
|
||||
mInterval = DisplayUtils.dip2px(context, interval);
|
||||
mSize = size;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ public class VerticalItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
public VerticalItemDecoration(Context context, int interval) {
|
||||
paint = new Paint();
|
||||
paint.setColor(context.getResources().getColor(R.color.bg_color));
|
||||
paint.setColor(context.getResources().getColor(R.color.background));
|
||||
mInterval = DisplayUtils.dip2px(context, interval);
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -49,7 +50,7 @@ public class ConcernActivity extends BaseActivity implements OnClickListener {
|
||||
private RecyclerView concern_rv_show, concern_rv_recommend;
|
||||
private ConcernManager manager;
|
||||
private RelativeLayout concern_rl_title;
|
||||
private TextView concern_tv_none;
|
||||
private LinearLayout reuse_none_data;
|
||||
|
||||
private List<ConcernInfo> list;
|
||||
private List<GameEntity> recommendList;
|
||||
@ -80,7 +81,7 @@ public class ConcernActivity extends BaseActivity implements OnClickListener {
|
||||
if (!list.isEmpty()) {
|
||||
initConcernGame();
|
||||
} else {
|
||||
concern_tv_none.setVisibility(View.VISIBLE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
concern_rv_show.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@ -234,7 +235,7 @@ public class ConcernActivity extends BaseActivity implements OnClickListener {
|
||||
concernList.remove(position);
|
||||
concern_rv_show.getAdapter().notifyItemRemoved(position);
|
||||
if (list.isEmpty()) {
|
||||
concern_tv_none.setVisibility(View.VISIBLE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
concern_rv_show.setVisibility(View.GONE);
|
||||
}
|
||||
concern_item_btn.setClickable(false);
|
||||
@ -340,7 +341,7 @@ public class ConcernActivity extends BaseActivity implements OnClickListener {
|
||||
concernEntity.setId(gameEntity.getId());
|
||||
list.add(concernEntity);
|
||||
if (list.size() == 1) {
|
||||
concern_tv_none.setVisibility(View.GONE);
|
||||
reuse_none_data.setVisibility(View.GONE);
|
||||
concern_rv_show.setVisibility(View.VISIBLE);
|
||||
}
|
||||
concern_rv_show.getAdapter().notifyItemInserted(list.size() - 1);
|
||||
@ -441,11 +442,11 @@ public class ConcernActivity extends BaseActivity implements OnClickListener {
|
||||
}
|
||||
concernList = new ArrayList<ConcernInfo>();
|
||||
if (!list.isEmpty()) {
|
||||
concern_tv_none.setVisibility(View.GONE);
|
||||
reuse_none_data.setVisibility(View.GONE);
|
||||
concern_rv_show.setVisibility(View.VISIBLE);
|
||||
initConcernGame();
|
||||
} else {
|
||||
concern_tv_none.setVisibility(View.VISIBLE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
concern_rv_show.setVisibility(View.GONE);
|
||||
}
|
||||
recommendList = new ArrayList<GameEntity>();
|
||||
@ -461,28 +462,29 @@ public class ConcernActivity extends BaseActivity implements OnClickListener {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
String uuid = ConcernUtils.UUID(this);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
String uuid = ConcernUtils.uuid(this);
|
||||
JSONArray data = new JSONArray();
|
||||
for (ConcernInfo concernInfo : manager.getConcernGame()) {
|
||||
jsonArray.put(concernInfo.getId());
|
||||
data.put(concernInfo.getId());
|
||||
}
|
||||
ConcernUtils.UpdateConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern", jsonArray.toString(), new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("更新设备关注游戏成功");
|
||||
}
|
||||
ConcernUtils.updateConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern", data,
|
||||
new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("更新设备关注游戏成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downFailed() {
|
||||
Utils.log("更新设备关注游戏失败");
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void downFailed() {
|
||||
Utils.log("更新设备关注游戏失败");
|
||||
}
|
||||
});
|
||||
view = null;
|
||||
concern_rv_show = null;
|
||||
concern_rv_recommend = null;
|
||||
manager = null;
|
||||
concern_rl_title = null;
|
||||
concern_tv_none = null;
|
||||
reuse_none_data = null;
|
||||
list = null;
|
||||
recommendList = null;
|
||||
concernList = null;
|
||||
|
||||
@ -35,10 +35,12 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
OnClickListener, OnPageChangeListener {
|
||||
|
||||
private ViewPager downloadmanager_viewPager;
|
||||
private TextView downloadmanager_tv_download, downloadmanager_tv_update,
|
||||
downloadmanager_download_number, downloadmanager_update_number;
|
||||
private LinearLayout downloadmanager_ll_download,
|
||||
downloadmanager_ll_update;
|
||||
private TextView downloadmanager_tv_download;
|
||||
private TextView downloadmanager_tv_update;
|
||||
private TextView downloadmanager_download_number;
|
||||
private TextView downloadmanager_update_number;
|
||||
private LinearLayout downloadmanager_ll_download;
|
||||
private LinearLayout downloadmanager_ll_update;
|
||||
private View downloadmanager_slide_line;
|
||||
private LinearLayout.LayoutParams lparams;
|
||||
|
||||
@ -52,37 +54,32 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
View contentView = View.inflate(this, R.layout.activity_downloadmanager, null);
|
||||
|
||||
init(contentView, "下载更新管理");
|
||||
|
||||
downloadmanager_ll_download.setOnClickListener(this);
|
||||
downloadmanager_ll_update.setOnClickListener(this);
|
||||
|
||||
int currentItem = getIntent().getIntExtra("currentItem", -1);
|
||||
|
||||
int updateSize = PackageManager.getUpdateList().size();
|
||||
|
||||
int downloadSize = DownloadManager.getInstance(getApplicationContext())
|
||||
.getAll().size();
|
||||
|
||||
if (updateSize != 0) {
|
||||
downloadmanager_update_number.setVisibility(View.VISIBLE);
|
||||
downloadmanager_update_number.setText("" + updateSize);
|
||||
downloadmanager_update_number.setText(String.valueOf(updateSize));
|
||||
} else {
|
||||
downloadmanager_update_number.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
int downloadSize = DownloadManager.getInstance(
|
||||
getApplicationContext()).getAll().size();
|
||||
if (downloadSize != 0) {
|
||||
downloadmanager_download_number.setVisibility(View.VISIBLE);
|
||||
downloadmanager_download_number.setText("" + downloadSize);
|
||||
downloadmanager_download_number.setText(String.valueOf(downloadSize));
|
||||
} else {
|
||||
downloadmanager_download_number.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
int currentItem = getIntent().getIntExtra("currentItem", -1);
|
||||
if (currentItem == -1) {
|
||||
if (updateSize != 0 && downloadSize == 0) {
|
||||
currentItem = 1;
|
||||
@ -157,17 +154,15 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
new EBUISwitch("DownloadManagerActivity", 0));
|
||||
downloadmanager_ll_download.setClickable(false);
|
||||
downloadmanager_ll_update.setClickable(true);
|
||||
downloadmanager_tv_download.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
downloadmanager_tv_update.setTextColor(0xFF333333);
|
||||
downloadmanager_tv_download.setTextColor(getResources().getColor(R.color.theme));
|
||||
downloadmanager_tv_update.setTextColor(getResources().getColor(R.color.title));
|
||||
} else {
|
||||
EventBus.getDefault().post(
|
||||
new EBUISwitch("DownloadManagerActivity", 1));
|
||||
downloadmanager_ll_download.setClickable(true);
|
||||
downloadmanager_ll_update.setClickable(false);
|
||||
downloadmanager_tv_download.setTextColor(0xFF333333);
|
||||
downloadmanager_tv_update.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
downloadmanager_tv_download.setTextColor(getResources().getColor(R.color.title));
|
||||
downloadmanager_tv_update.setTextColor(getResources().getColor(R.color.theme));
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,7 +206,7 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
}
|
||||
|
||||
public void onEventMainThread(EBDownloadChanged changed) {
|
||||
if (changed.getType() == "download") {
|
||||
if ("download".equals(changed.getType())) {
|
||||
if (changed.getVisibility() == View.VISIBLE){
|
||||
downloadmanager_download_number.setVisibility(View.VISIBLE);
|
||||
} else if (changed.getVisibility() == View.GONE) {
|
||||
@ -219,15 +214,15 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
} else if (changed.getVisibility() == View.INVISIBLE) {
|
||||
downloadmanager_download_number.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
downloadmanager_download_number.setText(changed.getSize() + "");
|
||||
} else if (changed.getType() == "update") {
|
||||
downloadmanager_download_number.setText(String.valueOf(changed.getSize()));
|
||||
} else if ("update".equals(changed.getType())) {
|
||||
if (changed.getSize() == -1) {
|
||||
int number = Integer.valueOf(downloadmanager_update_number
|
||||
.getText().toString());
|
||||
if (number == 1) {
|
||||
downloadmanager_update_number.setVisibility(View.GONE);
|
||||
} else {
|
||||
downloadmanager_update_number.setText((number - 1) + "");
|
||||
downloadmanager_update_number.setText(String.valueOf(number - 1));
|
||||
}
|
||||
} else {
|
||||
if (changed.getSize() != 0) {
|
||||
@ -238,7 +233,7 @@ public class DownloadManagerActivity extends BaseFragmentActivity implements
|
||||
} else if (changed.getVisibility() == View.INVISIBLE) {
|
||||
downloadmanager_update_number.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
downloadmanager_update_number.setText(changed.getSize() + "");
|
||||
downloadmanager_update_number.setText(String.valueOf(changed.getSize()));
|
||||
} else {
|
||||
downloadmanager_update_number.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@ -81,15 +81,13 @@ public class GameActivity extends BaseFragmentActivity implements
|
||||
if (position == 0) {
|
||||
new_game_text.setClickable(false);
|
||||
test_game_text.setClickable(true);
|
||||
new_game_text.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
test_game_text.setTextColor(0xFF333333);
|
||||
new_game_text.setTextColor(getResources().getColor(R.color.theme));
|
||||
test_game_text.setTextColor(getResources().getColor(R.color.title));
|
||||
} else {
|
||||
new_game_text.setClickable(true);
|
||||
test_game_text.setClickable(false);
|
||||
new_game_text.setTextColor(0xFF333333);
|
||||
test_game_text.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
new_game_text.setTextColor(getResources().getColor(R.color.title));
|
||||
test_game_text.setTextColor(getResources().getColor(R.color.theme));
|
||||
}
|
||||
if (position != 0) {
|
||||
rparams.leftMargin = (int) (width * position) + width / 4;
|
||||
@ -143,16 +141,14 @@ public class GameActivity extends BaseFragmentActivity implements
|
||||
EventBus.getDefault().post(new EBUISwitch("GameActivity", 0));
|
||||
new_game_text.setClickable(false);
|
||||
test_game_text.setClickable(true);
|
||||
new_game_text.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
test_game_text.setTextColor(0xFF333333);
|
||||
new_game_text.setTextColor(getResources().getColor(R.color.theme));
|
||||
test_game_text.setTextColor(getResources().getColor(R.color.title));
|
||||
} else {
|
||||
EventBus.getDefault().post(new EBUISwitch("GameActivity", 1));
|
||||
new_game_text.setClickable(true);
|
||||
test_game_text.setClickable(false);
|
||||
new_game_text.setTextColor(0xFF333333);
|
||||
test_game_text.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
new_game_text.setTextColor(getResources().getColor(R.color.title));
|
||||
test_game_text.setTextColor(getResources().getColor(R.color.theme));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -153,8 +153,8 @@ public class GameDeatilsNewsActivity extends BaseActivity{
|
||||
}
|
||||
public StateListDrawable selectorBg(){
|
||||
|
||||
GradientDrawable roundCornerShape1 = createRoundCornerShape(2, 50, Color.parseColor("#b3b3b3"), Color.parseColor("#ffffff"));
|
||||
GradientDrawable roundCornerShape2 = createRoundCornerShape(0, 50, Color.TRANSPARENT, Color.parseColor("#00b7fa"));
|
||||
GradientDrawable roundCornerShape1 = createRoundCornerShape(2, 50, getResources().getColor(R.color.hint), Color.WHITE);
|
||||
GradientDrawable roundCornerShape2 = createRoundCornerShape(0, 50, Color.TRANSPARENT, getResources().getColor(R.color.theme));
|
||||
GradientDrawable roundCornerShape3 = createRoundCornerShape(0, 50, Color.TRANSPARENT, Color.parseColor("#59d3ff"));
|
||||
StateListDrawable bg_install = new StateListDrawable();
|
||||
|
||||
@ -191,14 +191,14 @@ public class GameDeatilsNewsActivity extends BaseActivity{
|
||||
radioButton.setLayoutParams(layoutParams);
|
||||
radioButton.setButtonDrawable(android.R.color.transparent);
|
||||
radioButton.setGravity(Gravity.CENTER);
|
||||
radioButton.setBackground(selectorBg());
|
||||
radioButton.setBackgroundDrawable(selectorBg());
|
||||
radioButton.setText(listType.get(index));
|
||||
radioButton.setTextColor(Color.parseColor("#b3b3b3"));
|
||||
radioButton.setTextColor(getResources().getColor(R.color.hint));
|
||||
ll_type.addView(radioButton);
|
||||
if (i == selectI&&j==selectJ){
|
||||
radioButton.setSelected(true);
|
||||
newsType = radioButton.getText().toString();
|
||||
radioButton.setTextColor(Color.parseColor("#ffffff"));
|
||||
radioButton.setTextColor(Color.WHITE);
|
||||
}
|
||||
index++;
|
||||
final int finalI = i;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.gh.gamecenter;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
@ -294,7 +295,7 @@ public class GameDetailsActivity extends BaseFragmentActivity implements
|
||||
gamedetails_tv_download.setText("暂无下载");
|
||||
gamedetails_tv_download
|
||||
.setBackgroundResource(R.drawable.textview_gray_style);
|
||||
gamedetails_tv_download.setTextColor(0xFF999999);
|
||||
gamedetails_tv_download.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
gamedetails_tv_download.setClickable(false);
|
||||
} else {
|
||||
boolean isInstalled = false;
|
||||
@ -334,7 +335,7 @@ public class GameDetailsActivity extends BaseFragmentActivity implements
|
||||
top_tv_attention.setText("关注");
|
||||
top_tv_attention
|
||||
.setBackgroundResource(R.drawable.textview_red_style);
|
||||
top_tv_attention.setTextColor(0xffffffff);
|
||||
top_tv_attention.setTextColor(Color.WHITE);
|
||||
}
|
||||
|
||||
ImageUtils.getInstance(this).display(entity.getIcon(), top_iv_icon);
|
||||
@ -426,7 +427,7 @@ public class GameDetailsActivity extends BaseFragmentActivity implements
|
||||
|
||||
top_tv_attention.setText("关注");
|
||||
top_tv_attention.setBackgroundResource(R.drawable.textview_red_style);
|
||||
top_tv_attention.setTextColor(0xffffffff);
|
||||
top_tv_attention.setTextColor(Color.WHITE);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -624,15 +625,13 @@ public class GameDetailsActivity extends BaseFragmentActivity implements
|
||||
gamedetails_tv_information.setClickable(true);
|
||||
gamedetails_tv_strategy.setClickable(true);
|
||||
|
||||
titlebar_tv_details.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
titlebar_tv_information.setTextColor(0xFF333333);
|
||||
titlebar_tv_strategy.setTextColor(0xFF333333);
|
||||
titlebar_tv_details.setTextColor(getResources().getColor(R.color.theme));
|
||||
titlebar_tv_information.setTextColor(getResources().getColor(R.color.title));
|
||||
titlebar_tv_strategy.setTextColor(getResources().getColor(R.color.title));
|
||||
|
||||
gamedetails_tv_details.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
gamedetails_tv_information.setTextColor(0xFF333333);
|
||||
gamedetails_tv_strategy.setTextColor(0xFF333333);
|
||||
gamedetails_tv_details.setTextColor(getResources().getColor(R.color.theme));
|
||||
gamedetails_tv_information.setTextColor(getResources().getColor(R.color.title));
|
||||
gamedetails_tv_strategy.setTextColor(getResources().getColor(R.color.title));
|
||||
break;
|
||||
case 1:
|
||||
if (gamedetails_ll_topbar.getVisibility() == View.VISIBLE) {
|
||||
@ -648,15 +647,13 @@ public class GameDetailsActivity extends BaseFragmentActivity implements
|
||||
gamedetails_tv_information.setClickable(false);
|
||||
gamedetails_tv_strategy.setClickable(true);
|
||||
|
||||
titlebar_tv_details.setTextColor(0xFF333333);
|
||||
titlebar_tv_information.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
titlebar_tv_strategy.setTextColor(0xFF333333);
|
||||
titlebar_tv_details.setTextColor(getResources().getColor(R.color.title));
|
||||
titlebar_tv_information.setTextColor(getResources().getColor(R.color.theme));
|
||||
titlebar_tv_strategy.setTextColor(getResources().getColor(R.color.title));
|
||||
|
||||
gamedetails_tv_details.setTextColor(0xFF333333);
|
||||
gamedetails_tv_information.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
gamedetails_tv_strategy.setTextColor(0xFF333333);
|
||||
gamedetails_tv_details.setTextColor(getResources().getColor(R.color.title));
|
||||
gamedetails_tv_information.setTextColor(getResources().getColor(R.color.theme));
|
||||
gamedetails_tv_strategy.setTextColor(getResources().getColor(R.color.title));
|
||||
break;
|
||||
case 2:
|
||||
if (gamedetails_ll_topbar.getVisibility() == View.VISIBLE) {
|
||||
@ -672,15 +669,13 @@ public class GameDetailsActivity extends BaseFragmentActivity implements
|
||||
gamedetails_tv_information.setClickable(true);
|
||||
gamedetails_tv_strategy.setClickable(false);
|
||||
|
||||
titlebar_tv_details.setTextColor(0xFF333333);
|
||||
titlebar_tv_information.setTextColor(0xFF333333);
|
||||
titlebar_tv_strategy.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
titlebar_tv_details.setTextColor(getResources().getColor(R.color.title));
|
||||
titlebar_tv_information.setTextColor(getResources().getColor(R.color.title));
|
||||
titlebar_tv_strategy.setTextColor(getResources().getColor(R.color.theme));
|
||||
|
||||
gamedetails_tv_details.setTextColor(0xFF333333);
|
||||
gamedetails_tv_information.setTextColor(0xFF333333);
|
||||
gamedetails_tv_strategy.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
gamedetails_tv_details.setTextColor(getResources().getColor(R.color.title));
|
||||
gamedetails_tv_information.setTextColor(getResources().getColor(R.color.title));
|
||||
gamedetails_tv_strategy.setTextColor(getResources().getColor(R.color.theme));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -968,8 +968,7 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
case 0:
|
||||
home1Layout.setClickable(false);
|
||||
home1Image.setImageResource(R.drawable.home1_selected);
|
||||
home1Title.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
home1Title.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (pluginFragmentActivity == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
if (list != null) {
|
||||
@ -993,8 +992,7 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
case 1:
|
||||
home2Layout.setClickable(false);
|
||||
home2Image.setImageResource(R.drawable.home2_selected);
|
||||
home2Title.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
home2Title.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (newsFragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
if (list != null) {
|
||||
@ -1018,8 +1016,7 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
case 2:
|
||||
home3Layout.setClickable(false);
|
||||
home3Image.setImageResource(R.drawable.home3_selected);
|
||||
home3Title.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
home3Title.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (home3Fragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
if (list != null) {
|
||||
@ -1056,9 +1053,9 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
home1Image.setImageResource(R.drawable.home1_unselected);
|
||||
home2Image.setImageResource(R.drawable.home2_unselected);
|
||||
home3Image.setImageResource(R.drawable.home3_unselected);
|
||||
home1Title.setTextColor(0xFF333333);
|
||||
home2Title.setTextColor(0xFF333333);
|
||||
home3Title.setTextColor(0xFF333333);
|
||||
home1Title.setTextColor(getResources().getColor(R.color.title));
|
||||
home2Title.setTextColor(getResources().getColor(R.color.title));
|
||||
home3Title.setTextColor(getResources().getColor(R.color.title));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,6 +3,7 @@ package com.gh.gamecenter;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.util.ArrayMap;
|
||||
@ -32,6 +33,7 @@ import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.ConcernUtils;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.DialogUtils;
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.FileUtils;
|
||||
import com.gh.common.util.ImageUtils;
|
||||
import com.gh.common.util.MD5Utils;
|
||||
@ -123,16 +125,19 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
View contentView = View.inflate(this, R.layout.activity_new_gamedetails, null);
|
||||
|
||||
RelativeLayout reuse_actionbar = (RelativeLayout) contentView.findViewById(R.id.reuse_actionbar);
|
||||
iv_share = new ImageView(this);
|
||||
iv_share.setImageResource(R.drawable.share_icon);
|
||||
float dp = getResources().getDisplayMetrics().density;
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int)(dp*20),(int)(dp*20));
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
|
||||
DisplayUtils.dip2px(this, 20), DisplayUtils.dip2px(this, 20));
|
||||
params.addRule( RelativeLayout.CENTER_VERTICAL);
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT );
|
||||
params.setMargins(0,0,(int)(dp*10),0);
|
||||
params.rightMargin = DisplayUtils.dip2px(this, 10);
|
||||
reuse_actionbar.addView(iv_share,params);
|
||||
|
||||
gameId = getIntent().getStringExtra("gameId");
|
||||
entrance = getIntent().getStringExtra("entrance");
|
||||
if (gameId != null) {
|
||||
@ -287,7 +292,7 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
tvDowload.setText("暂无下载");
|
||||
tvDowload
|
||||
.setBackgroundResource(R.drawable.textview_gray_style);
|
||||
tvDowload.setTextColor(0xFF999999);
|
||||
tvDowload.setTextColor(context.getResources().getColor(R.color.btn_gray));
|
||||
tvDowload.setClickable(false);
|
||||
} else {
|
||||
boolean isInstalled = false;
|
||||
@ -569,10 +574,10 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
String uuid = ConcernUtils.UUID(this);
|
||||
if (isConcern == true&&concernCode ==2){
|
||||
String uuid = ConcernUtils.uuid(this);
|
||||
if (isConcern && concernCode == 2){
|
||||
//取消关注
|
||||
ConcernUtils.DeleteConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern/" + gameId, new ConcernUtils.DownJsonListener() {
|
||||
ConcernUtils.deleteConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern/" + gameId, new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("删除提交成功==游戏详情");
|
||||
@ -584,9 +589,9 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
}
|
||||
});
|
||||
|
||||
}else if (isConcern == false&& concernCode == 1){
|
||||
} else if (!isConcern && concernCode == 1){
|
||||
//添加关注
|
||||
ConcernUtils.PostConcernGameId("[" + gameId + "]", Config.HOST + "v2d0/device/" + uuid + "/concern", new ConcernUtils.DownJsonListener() {
|
||||
ConcernUtils.postConcernGameId(gameId, Config.HOST + "v2d0/device/" + uuid + "/concern", new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("关注提交成功==游戏详情");
|
||||
@ -597,7 +602,7 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
Utils.log("关注提交失败==游戏详情");
|
||||
}
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
Utils.log("无关注操作==游戏详情");
|
||||
}
|
||||
gameId = null;
|
||||
@ -619,8 +624,8 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
handler = null;
|
||||
}
|
||||
|
||||
|
||||
public class GameDetailsAdapter extends RecyclerView.Adapter<GameDetailsAdapter.ViewHolder>{
|
||||
|
||||
private Context context;
|
||||
|
||||
public GameDetailsAdapter(Context context) {
|
||||
@ -628,6 +633,7 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
getGameDetail();
|
||||
getGameNews();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position){
|
||||
if (position == 0){
|
||||
@ -649,7 +655,7 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view ;
|
||||
View view;
|
||||
switch (viewType){
|
||||
case 0:
|
||||
view = LayoutInflater.from(context).inflate(R.layout.gamedetails_rv_item_top,parent,false);
|
||||
@ -850,7 +856,7 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
attention.setText("关注");
|
||||
attention
|
||||
.setBackgroundResource(R.drawable.textview_red_style);
|
||||
attention.setTextColor(0xffffffff);
|
||||
attention.setTextColor(Color.WHITE);
|
||||
}
|
||||
});
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
@ -890,7 +896,7 @@ public class NewGameDetailsActivity extends BaseActivity implements View.OnClick
|
||||
} else {
|
||||
tv_concern.setText("关注");
|
||||
tv_concern.setBackgroundResource(R.drawable.textview_red_style);
|
||||
tv_concern.setTextColor(0xffffffff);
|
||||
tv_concern.setTextColor(Color.WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@ public class NewsActivity extends BaseActivity implements OnClickListener {
|
||||
essaydetails_ll_bottom.setVisibility(View.VISIBLE);
|
||||
essaydetails_tv_download.setText("暂无下载");
|
||||
essaydetails_tv_download.setBackgroundResource(R.drawable.textview_gray_style);
|
||||
essaydetails_tv_download.setTextColor(0xFF999999);
|
||||
essaydetails_tv_download.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
essaydetails_tv_download.setClickable(false);
|
||||
} else if (Config.isShow) {
|
||||
essaydetails_ll_bottom.setVisibility(View.VISIBLE);
|
||||
@ -857,7 +857,7 @@ public class NewsActivity extends BaseActivity implements OnClickListener {
|
||||
attention.setText("关注");
|
||||
attention
|
||||
.setBackgroundResource(R.drawable.textview_red_style);
|
||||
attention.setTextColor(0xffffffff);
|
||||
attention.setTextColor(Color.WHITE);
|
||||
}
|
||||
});
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
@ -1034,7 +1034,7 @@ public class NewsActivity extends BaseActivity implements OnClickListener {
|
||||
} else {
|
||||
holder.essaydetails_attention.setText("关注");
|
||||
holder.essaydetails_attention.setBackgroundResource(R.drawable.textview_red_style);
|
||||
holder.essaydetails_attention.setTextColor(0xffffffff);
|
||||
holder.essaydetails_attention.setTextColor(Color.WHITE);
|
||||
}
|
||||
if (gameEntity.getApk() != null && !gameEntity.getApk().isEmpty()) {
|
||||
for (int i = 0, size = gameEntity.getApk().size(); i < size; i++) {
|
||||
@ -1362,10 +1362,10 @@ public class NewsActivity extends BaseActivity implements OnClickListener {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
String uuid = ConcernUtils.UUID(this);
|
||||
if (isConcern == true&&concernCode ==2 && gameEntity.getId()!=null){
|
||||
String uuid = ConcernUtils.uuid(this);
|
||||
if (isConcern && concernCode == 2 && gameEntity.getId() != null) {
|
||||
//取消关注
|
||||
ConcernUtils.DeleteConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern/" + gameEntity.getId(), new ConcernUtils.DownJsonListener() {
|
||||
ConcernUtils.deleteConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern/" + gameEntity.getId(), new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("删除提交成功==游戏详情");
|
||||
@ -1377,9 +1377,9 @@ public class NewsActivity extends BaseActivity implements OnClickListener {
|
||||
}
|
||||
});
|
||||
|
||||
}else if (isConcern == false&& concernCode == 1&& gameEntity.getId()!=null){
|
||||
} else if (!isConcern && concernCode == 1 && gameEntity.getId() != null) {
|
||||
//添加关注
|
||||
ConcernUtils.PostConcernGameId("[" + gameEntity.getId() + "]", Config.HOST + "v2d0/device/" + uuid + "/concern", new ConcernUtils.DownJsonListener() {
|
||||
ConcernUtils.postConcernGameId(gameEntity.getId(), Config.HOST + "v2d0/device/" + uuid + "/concern", new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("关注提交成功==游戏详情");
|
||||
@ -1390,7 +1390,7 @@ public class NewsActivity extends BaseActivity implements OnClickListener {
|
||||
Utils.log("关注提交失败==游戏详情");
|
||||
}
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
Utils.log("无关注操作==游戏详情");
|
||||
}
|
||||
isDestroy = true;
|
||||
|
||||
@ -42,7 +42,8 @@ public class NewsSearchActivity extends BaseActivity {
|
||||
private RecyclerView mNewsRecyclerView;
|
||||
private List<NewsEntity> newsEntities;
|
||||
private NewsSearchAdapter searchAdapter;
|
||||
private TextView tvSearch, searchNonews;
|
||||
private TextView tvSearch;
|
||||
private LinearLayout reuse_none_data;
|
||||
private EditText edSearch;
|
||||
private LinearLayout llLoading;
|
||||
private LinearLayout noConnection;
|
||||
@ -85,7 +86,7 @@ public class NewsSearchActivity extends BaseActivity {
|
||||
noConnection = (LinearLayout) findViewById(R.id.reuse_no_connection);
|
||||
llLoading = (LinearLayout) findViewById(R.id.gamedetails_news_ll_loading);
|
||||
cardView = (CardView) findViewById(R.id.gamedetails_news_cardView);
|
||||
searchNonews = (TextView) findViewById(R.id.search_nonews);
|
||||
reuse_none_data = (LinearLayout) findViewById(R.id.reuse_none_data);
|
||||
|
||||
layoutManager = new MeasureHeightLayoutManager(this);
|
||||
|
||||
@ -167,10 +168,10 @@ public class NewsSearchActivity extends BaseActivity {
|
||||
cardView.setVisibility(View.VISIBLE);
|
||||
if (newsEntities.size() == 0){
|
||||
cardView.setVisibility(View.GONE);
|
||||
searchNonews.setVisibility(View.VISIBLE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
cardView.setVisibility(View.VISIBLE);
|
||||
searchNonews.setVisibility(View.GONE);
|
||||
reuse_none_data.setVisibility(View.GONE);
|
||||
}
|
||||
if (news.isEmpty() || (news.size() < 20)) {
|
||||
isRemove = true;
|
||||
@ -203,7 +204,7 @@ public class NewsSearchActivity extends BaseActivity {
|
||||
newsEntities = null;
|
||||
searchAdapter = null;
|
||||
tvSearch = null;
|
||||
searchNonews = null;
|
||||
reuse_none_data = null;
|
||||
edSearch = null;
|
||||
llLoading = null;
|
||||
noConnection = null;
|
||||
|
||||
@ -86,7 +86,7 @@ public class SearchActivity extends BaseFragmentActivity {
|
||||
setTranslucentStatus(true);
|
||||
SystemBarTintManager tintManager = new SystemBarTintManager(this);
|
||||
tintManager.setStatusBarTintEnabled(true);
|
||||
tintManager.setStatusBarTintResource(R.color.theme_colors);
|
||||
tintManager.setStatusBarTintResource(R.color.theme);
|
||||
SystemBarConfig config = tintManager.getConfig();
|
||||
contentView.setPadding(0, config.getPixelInsetTop(false), 0,
|
||||
config.getPixelInsetBottom());
|
||||
|
||||
@ -107,7 +107,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
if (mActionBar != null) {
|
||||
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
||||
RelativeLayout relativeLayout = new RelativeLayout(this);
|
||||
relativeLayout.setBackgroundResource(R.color.theme_colors);
|
||||
relativeLayout.setBackgroundResource(R.color.theme);
|
||||
LayoutParams params = new LayoutParams(
|
||||
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
||||
mActionBar.setCustomView(relativeLayout, params);// 自定义ActionBar布局
|
||||
|
||||
@ -3,6 +3,7 @@ package com.gh.gamecenter;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.telephony.TelephonyManager;
|
||||
@ -141,7 +142,7 @@ public class SuggestionActivity extends BaseActivity implements OnClickListener
|
||||
TextView cancel = (TextView) view
|
||||
.findViewById(R.id.alertdialog_cannel);
|
||||
cancel.setText("我要填写");
|
||||
cancel.setTextColor(0xffFFFFFF);
|
||||
cancel.setTextColor(Color.WHITE);
|
||||
cancel.setBackgroundResource(R.drawable.textview_blue_style);
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@ -167,7 +168,7 @@ public class SuggestionActivity extends BaseActivity implements OnClickListener
|
||||
TextView confirm = (TextView) view
|
||||
.findViewById(R.id.alertdialog_confirm);
|
||||
confirm.setText("直接提交");
|
||||
confirm.setTextColor(0xff999999);
|
||||
confirm.setTextColor(getResources().getColor(R.color.btn_gray));
|
||||
confirm.setBackgroundResource(R.drawable.textview_cancel_style);
|
||||
confirm.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@ -208,7 +209,7 @@ public class SuggestionActivity extends BaseActivity implements OnClickListener
|
||||
map.put("ghversion", PackageUtils.getVersion(this));
|
||||
map.put("channel", (String) PackageUtils.getMetaData(this, getPackageName(), "TD_CHANNEL_ID"));
|
||||
map.put("type", android.os.Build.MODEL);
|
||||
map.put("sdk", android.os.Build.VERSION.SDK_INT + "");
|
||||
map.put("sdk", String.valueOf(android.os.Build.VERSION.SDK_INT));
|
||||
map.put("version", android.os.Build.VERSION.RELEASE);
|
||||
map.put("imei", ((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId());
|
||||
JsonObjectRequest request = new JsonObjectRequest(Method.POST,
|
||||
|
||||
@ -79,10 +79,8 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
|
||||
private DismissEntity dismissEntity;
|
||||
|
||||
private int page = 1;
|
||||
private boolean isRemove;
|
||||
private boolean isNetworkError;
|
||||
private int per_page = 20;
|
||||
private String id;
|
||||
|
||||
public SubjectAdapter(Context context,
|
||||
@ -97,60 +95,57 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
subject_pb_loading = pbLoading;
|
||||
reuse_no_connection = linearLayout;
|
||||
|
||||
locationMap = new ArrayMap<String, Integer>();
|
||||
platformMap = new ArrayMap<String, LinkedBlockingQueue<String>>();
|
||||
gameMap = new ArrayMap<String, ArrayMap<String, DownloadEntry>>();
|
||||
nameMap = new ArrayMap<String, String>();
|
||||
statusMap = new ArrayMap<String, String>();
|
||||
locationMap = new ArrayMap<>();
|
||||
platformMap = new ArrayMap<>();
|
||||
gameMap = new ArrayMap<>();
|
||||
nameMap = new ArrayMap<>();
|
||||
statusMap = new ArrayMap<>();
|
||||
dismissEntity = new DismissEntity(false);
|
||||
|
||||
// 黄壮华 添加 初始化游戏状态 修改2015/8/21
|
||||
DownloadItemUtils.initializeGameMap(context, gameMap);
|
||||
|
||||
list = new ArrayList<GameEntity>();
|
||||
list = new ArrayList<>();
|
||||
isLoaded = false;
|
||||
isNetworkError = false;
|
||||
this.id = id;
|
||||
|
||||
initList(page);
|
||||
initList(1);
|
||||
}
|
||||
|
||||
public void initList(final int page) {
|
||||
isLoaded =false;
|
||||
isLoaded = false;
|
||||
JsonArrayExtendedRequest request = new JsonArrayExtendedRequest(
|
||||
TimestampUtils.addTimestamp(Config.HOST
|
||||
+ "v1d50/game/column/" + id +"?page="+ page, Constants.GAME_CD),
|
||||
new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
processingData(response);
|
||||
}
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
// 无网络连接
|
||||
if (error.getClass().equals(NoConnectionError.class)
|
||||
|| error.getClass().equals(TimeoutError.class)) {
|
||||
if (page == 1){
|
||||
if (subject_pb_loading != null && subject_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
subject_pb_loading.setVisibility(View.GONE);
|
||||
}
|
||||
Toast.makeText(context, "网络错误", Toast.LENGTH_SHORT).show();
|
||||
subject_list.setVisibility(View.GONE);
|
||||
reuse_no_connection.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
Toast.makeText(context, "网络错误", Toast.LENGTH_SHORT).show();
|
||||
isNetworkError = true;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
// 无网络连接
|
||||
if (error.getClass().equals(NoConnectionError.class)
|
||||
|| error.getClass().equals(TimeoutError.class)) {
|
||||
if (page == 1){
|
||||
if (subject_pb_loading != null && subject_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
subject_pb_loading.setVisibility(View.GONE);
|
||||
}
|
||||
Toast.makeText(context, "网络错误", Toast.LENGTH_SHORT).show();
|
||||
subject_list.setVisibility(View.GONE);
|
||||
reuse_no_connection.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
Toast.makeText(context, "网络错误", Toast.LENGTH_SHORT).show();
|
||||
isNetworkError = true;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
AppController.addToRequestQueue(request, SubjectActivity.class);
|
||||
}
|
||||
|
||||
@ -185,7 +180,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
if (subject_pb_loading != null && subject_pb_loading.getVisibility() == View.VISIBLE) {
|
||||
subject_pb_loading.setVisibility(View.GONE);
|
||||
}
|
||||
if (list.isEmpty() || gameList.size() < 20) {
|
||||
if (list.isEmpty() || (gameList != null && gameList.size() < 20)) {
|
||||
isRemove = true;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -247,7 +242,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
public void onClick(View v) {
|
||||
isNetworkError = false;
|
||||
notifyDataSetChanged();
|
||||
initList(list.size()/per_page+1);
|
||||
initList(list.size() / 21);
|
||||
}
|
||||
});
|
||||
} else if (isRemove) {
|
||||
@ -264,7 +259,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
private void initGameTestViewHolder(GameTestViewHolder holder, int position) {
|
||||
if (order) {
|
||||
holder.home2_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home2_game_order.setText((position + 1) + "");
|
||||
holder.home2_game_order.setText(String.valueOf(position + 1));
|
||||
} else {
|
||||
holder.home2_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
@ -276,7 +271,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
if (entity.getApk() == null || entity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(entity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(entity.getApk().get(0).getSize() + " | " + entity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", entity.getApk().get(0).getSize(), entity.getBrief()));
|
||||
}
|
||||
holder.gameTestType.setText(entity.getTest().getType());
|
||||
if (entity.getTest().getStart() == 0) {
|
||||
@ -337,7 +332,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
private void initGameNormalViewHolder(GameNormalViewHolder holder, int position) {
|
||||
if (order) {
|
||||
holder.home1_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home1_game_order.setText((position + 1) + "");
|
||||
holder.home1_game_order.setText(String.valueOf(position + 1));
|
||||
} else {
|
||||
holder.home1_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
@ -349,7 +344,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
if (entity.getApk() == null || entity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(entity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(entity.getApk().get(0).getSize() + " | " + entity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", entity.getApk().get(0).getSize(), entity.getBrief()));
|
||||
}
|
||||
|
||||
GameViewUtils.setLabelList(context, holder.labelList, entity.getTag());
|
||||
@ -358,7 +353,7 @@ public class SubjectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("入口", "热门卡牌");
|
||||
DataUtils.onEvent(context, "游戏详情", entity.getName(), kv);
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.download.DataWatcher;
|
||||
@ -41,7 +41,7 @@ public class DownLoadFragment extends Fragment {
|
||||
private View view;
|
||||
private RecyclerView downloadmanager_rv_show;
|
||||
private DownloadAdapter adapter;
|
||||
private TextView downloadmanager_tv_none;
|
||||
private LinearLayout reuse_none_data;
|
||||
|
||||
private ArrayMap<String, Integer> locationMap;
|
||||
private ArrayMap<String, String> statusMap;
|
||||
@ -103,8 +103,8 @@ public class DownLoadFragment extends Fragment {
|
||||
int base = (adapter.getDoneList().isEmpty() ? 0 : 1 + adapter.getDoneList().size());
|
||||
if (adapter.getDownloadingList().size() == 1) {
|
||||
adapter.notifyItemRangeInserted(base, 2);
|
||||
if (downloadmanager_tv_none.getVisibility() == View.VISIBLE) {
|
||||
downloadmanager_tv_none.setVisibility(View.GONE);
|
||||
if (reuse_none_data.getVisibility() == View.VISIBLE) {
|
||||
reuse_none_data.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
adapter.notifyItemInserted(base + adapter.getDownloadingList().size());
|
||||
@ -129,11 +129,11 @@ public class DownLoadFragment extends Fragment {
|
||||
urlMap = new ArrayMap<>();
|
||||
deleteList = new ArrayList<>();
|
||||
|
||||
downloadmanager_tv_none = (TextView) view.findViewById(R.id.downloadmanager_tv_none);
|
||||
reuse_none_data = (LinearLayout) view.findViewById(R.id.reuse_none_data);
|
||||
|
||||
downloadmanager_rv_show = (RecyclerView) view.findViewById(R.id.downloadmanager_rv_show);
|
||||
downloadmanager_rv_show.setHasFixedSize(true);
|
||||
adapter = new DownloadAdapter(getActivity(), downloadmanager_rv_show, downloadmanager_tv_none,
|
||||
adapter = new DownloadAdapter(getActivity(), downloadmanager_rv_show, reuse_none_data,
|
||||
locationMap, statusMap, deleteList);
|
||||
downloadmanager_rv_show.setAdapter(adapter);
|
||||
downloadmanager_rv_show.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
@ -174,8 +174,8 @@ public class DownLoadFragment extends Fragment {
|
||||
EventBus.getDefault().post(new EBDownloadChanged("download", View.GONE, 0));
|
||||
locationMap.clear();
|
||||
adapter.notifyDataSetChanged();
|
||||
if (downloadmanager_tv_none.getVisibility() == View.GONE) {
|
||||
downloadmanager_tv_none.setVisibility(View.VISIBLE);
|
||||
if (reuse_none_data.getVisibility() == View.GONE) {
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else if (adapter.getDoneList().isEmpty()) {
|
||||
EventBus.getDefault().post(new EBDownloadChanged("download", View.VISIBLE,
|
||||
@ -238,7 +238,7 @@ public class DownLoadFragment extends Fragment {
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
if (adapter.getDownloadingList().isEmpty() && adapter.getDoneList().isEmpty()) {
|
||||
downloadmanager_tv_none.setVisibility(View.VISIBLE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ public class DownLoadFragment extends Fragment {
|
||||
EventBus.getDefault().unregister(this);
|
||||
view = null;
|
||||
downloadmanager_rv_show = null;
|
||||
downloadmanager_tv_none = null;
|
||||
reuse_none_data = null;
|
||||
locationMap = null;
|
||||
statusMap = null;
|
||||
urlMap = null;
|
||||
|
||||
@ -45,7 +45,7 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
private Context context;
|
||||
|
||||
private RecyclerView downloadmanager_rv_show;
|
||||
private TextView downloadmanager_tv_none;
|
||||
private LinearLayout downloadmanager_tv_none;
|
||||
|
||||
private List<DownloadEntry> downloadingList;
|
||||
private List<DownloadEntry> doneList;
|
||||
@ -56,7 +56,7 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
|
||||
public DownloadAdapter(Context context,
|
||||
RecyclerView recyclerView,
|
||||
TextView textView,
|
||||
LinearLayout textView,
|
||||
ArrayMap<String, Integer> lMap,
|
||||
ArrayMap<String, String> sMap,
|
||||
ArrayList<String> dList) {
|
||||
@ -149,7 +149,7 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
0, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
lparams.weight = 4;
|
||||
viewHolder.dm_item_tv_downloads.setLayoutParams(lparams);
|
||||
viewHolder.dm_item_tv_downloads.setTextColor(0xFF1BA4FC);
|
||||
viewHolder.dm_item_tv_downloads.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
viewHolder.dm_item_tv_downloads.setText(String.format("%s(剩%s)",
|
||||
SpeedUtils.getSpeed(entry.getSpeed()),
|
||||
SpeedUtils.getRemainTime(entry.getSize(), entry.getProgress(), entry.getSpeed() * 1024)));
|
||||
@ -196,7 +196,7 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
0, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
lparams.weight = 4;
|
||||
viewHolder.dm_item_tv_downloads.setLayoutParams(lparams);
|
||||
viewHolder.dm_item_tv_downloads.setTextColor(0xFF1BA4FC);
|
||||
viewHolder.dm_item_tv_downloads.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
viewHolder.dm_item_tv_downloads.setText(String.format("%s(剩%s)",
|
||||
SpeedUtils.getSpeed(entry.getSpeed()),
|
||||
SpeedUtils.getRemainTime(entry.getSize(),
|
||||
@ -308,10 +308,10 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
}
|
||||
if ((dlNumber + wtNumber) != downloadingList.size()) {
|
||||
viewHolder.dm_item_head_tv_allstart.setText("全部开始");
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(0xff1BA4FC);
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
} else {
|
||||
viewHolder.dm_item_head_tv_allstart.setText("全部暂停");
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(0xff999999);
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(context.getResources().getColor(R.color.btn_gray));
|
||||
}
|
||||
|
||||
viewHolder.dm_item_head_tv_allstart.setOnClickListener(new View.OnClickListener() {
|
||||
@ -338,7 +338,7 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
}
|
||||
}
|
||||
viewHolder.dm_item_head_tv_allstart.setText("全部暂停");
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(0xff999999);
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(context.getResources().getColor(R.color.btn_gray));
|
||||
} else {
|
||||
for (int i = 0, size = downloadingList.size(); i < size; i++) {
|
||||
View view = downloadmanager_rv_show.getChildAt(base + i);
|
||||
@ -359,7 +359,7 @@ public class DownloadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
}
|
||||
}
|
||||
viewHolder.dm_item_head_tv_allstart.setText("全部开始");
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(0xFF1BA4FC);
|
||||
viewHolder.dm_item_head_tv_allstart.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.gh.gamecenter.download;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.util.ArrayMap;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
@ -11,7 +12,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
@ -58,7 +58,7 @@ public class UpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
private Context context;
|
||||
|
||||
private LinearLayout gameupdate_ll_loading;
|
||||
private TextView gameupdate_tv_none;
|
||||
private LinearLayout gameupdate_tv_none;
|
||||
|
||||
private ArrayMap<String, Integer> locationMap;
|
||||
private ArrayMap<String, String> packageNameMap;
|
||||
@ -73,7 +73,7 @@ public class UpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
public UpdateAdapter(Context context,
|
||||
LinearLayout loading,
|
||||
TextView none,
|
||||
LinearLayout none,
|
||||
String packageName,
|
||||
boolean isUpdate) {
|
||||
this.context = context;
|
||||
@ -468,7 +468,7 @@ public class UpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
if (successMap.get(position - 1)) {
|
||||
viewHolder.gu_item_btv_update.setText("启动");
|
||||
viewHolder.gu_item_btv_update.setTextColor(0xFFFFFFFF);
|
||||
viewHolder.gu_item_btv_update.setTextColor(Color.WHITE);
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_launch_style);
|
||||
} else {
|
||||
DownloadEntry entry = entryMap.get(position - 1);
|
||||
@ -479,17 +479,17 @@ public class UpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_plugining_style);
|
||||
} else {
|
||||
viewHolder.gu_item_btv_update.setText("更新中");
|
||||
viewHolder.gu_item_btv_update.setTextColor(0xFF1BA4FC);
|
||||
viewHolder.gu_item_btv_update.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_downloading_style);
|
||||
}
|
||||
} else {
|
||||
if (updateEntity.isPlugin()) {
|
||||
viewHolder.gu_item_btv_update.setText("插件化");
|
||||
viewHolder.gu_item_btv_update.setTextColor(0xFFFFFFFF);
|
||||
viewHolder.gu_item_btv_update.setTextColor(Color.WHITE);
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_plugin_style);
|
||||
} else {
|
||||
viewHolder.gu_item_btv_update.setText("更新");
|
||||
viewHolder.gu_item_btv_update.setTextColor(0xFFFFFFFF);
|
||||
viewHolder.gu_item_btv_update.setTextColor(Color.WHITE);
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_download_style);
|
||||
}
|
||||
}
|
||||
@ -506,7 +506,7 @@ public class UpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_plugining_style);
|
||||
} else {
|
||||
viewHolder.gu_item_btv_update.setText("更新中");
|
||||
viewHolder.gu_item_btv_update.setTextColor(0xFF1BA4FC);
|
||||
viewHolder.gu_item_btv_update.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
viewHolder.gu_item_btv_update.setBackgroundResource(R.drawable.game_item_btn_downloading_style);
|
||||
}
|
||||
|
||||
@ -554,7 +554,7 @@ public class UpdateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
size = size / 1024f;
|
||||
unit = "GB";
|
||||
}
|
||||
String str = size + "";
|
||||
String str = String.valueOf(size);
|
||||
int index = str.lastIndexOf(".");
|
||||
if (index != -1 && str.length() >= index + 3) {
|
||||
str = str.substring(0, index + 3);
|
||||
|
||||
@ -9,7 +9,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.eventbus.EBDownloadChanged;
|
||||
@ -32,7 +31,7 @@ public class UpdateFragment extends Fragment {
|
||||
private RecyclerView gameupdate_rv_show;
|
||||
private UpdateAdapter adapter;
|
||||
private LinearLayout gameupdate_ll_loading;
|
||||
private TextView gameupdate_tv_none;
|
||||
private LinearLayout reuse_none_data;
|
||||
|
||||
private String packageName;
|
||||
private boolean isUpdate;
|
||||
@ -69,13 +68,13 @@ public class UpdateFragment extends Fragment {
|
||||
|
||||
gameupdate_ll_loading = (LinearLayout) view.findViewById(R.id.gameupdate_ll_loading);
|
||||
|
||||
gameupdate_tv_none = (TextView) view.findViewById(R.id.gameupdate_tv_none);
|
||||
reuse_none_data = (LinearLayout) view.findViewById(R.id.reuse_none_data);
|
||||
|
||||
gameupdate_rv_show = (RecyclerView) view.findViewById(R.id.gameupdate_rv_show);
|
||||
gameupdate_rv_show.setHasFixedSize(true);
|
||||
gameupdate_rv_show.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
adapter = new UpdateAdapter(getActivity(), gameupdate_ll_loading,
|
||||
gameupdate_tv_none, packageName, isUpdate);
|
||||
reuse_none_data, packageName, isUpdate);
|
||||
gameupdate_rv_show.setAdapter(adapter);
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
@ -102,8 +101,8 @@ public class UpdateFragment extends Fragment {
|
||||
gameupdate_rv_show.getAdapter().notifyDataSetChanged();
|
||||
EventBus.getDefault().post(
|
||||
new EBDownloadChanged("update", View.GONE, adapter.getUpdateList().size()));
|
||||
if (gameupdate_tv_none.getVisibility() == View.GONE) {
|
||||
gameupdate_tv_none.setVisibility(View.VISIBLE);
|
||||
if (reuse_none_data.getVisibility() == View.GONE) {
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
adapter.getUpdateList().remove(location.intValue());
|
||||
@ -138,8 +137,8 @@ public class UpdateFragment extends Fragment {
|
||||
if (adapter.getUpdateList().size() == 1) {
|
||||
adapter.getUpdateList().remove(location.intValue());
|
||||
adapter.notifyItemRangeRemoved(0, 2);
|
||||
if (gameupdate_tv_none.getVisibility() == View.GONE) {
|
||||
gameupdate_tv_none.setVisibility(View.VISIBLE);
|
||||
if (reuse_none_data.getVisibility() == View.GONE) {
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
adapter.getUpdateList().remove(location.intValue());
|
||||
@ -164,7 +163,7 @@ public class UpdateFragment extends Fragment {
|
||||
view = null;
|
||||
gameupdate_rv_show = null;
|
||||
gameupdate_ll_loading = null;
|
||||
gameupdate_tv_none = null;
|
||||
reuse_none_data = null;
|
||||
packageName = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ public class Game1Fragment extends Fragment implements SwipeRefreshLayout.OnRefr
|
||||
});
|
||||
|
||||
game_swipe_refresh = (SwipeRefreshLayout) view.findViewById(R.id.game_swipe_refresh);
|
||||
game_swipe_refresh.setColorSchemeResources(R.color.theme_colors);
|
||||
game_swipe_refresh.setColorSchemeResources(R.color.theme);
|
||||
game_swipe_refresh.setOnRefreshListener(this);
|
||||
|
||||
game_pb_loading = (ProgressBarCircularIndeterminate) view.findViewById(R.id.game_pb_loading);
|
||||
|
||||
@ -325,7 +325,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
ConcernManager concernManager = new ConcernManager(context);
|
||||
List<ConcernInfo> infos = concernManager.getInstalledGame();
|
||||
final int size = infos.size();
|
||||
final List<GameEntity> list = new ArrayList<GameEntity>();
|
||||
final List<GameEntity> list = new ArrayList<>();
|
||||
count = 0;
|
||||
for (ConcernInfo info : infos) {
|
||||
JsonObjectExtendedRequest request = new JsonObjectExtendedRequest(
|
||||
@ -647,7 +647,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
final int i, boolean order, final String name) {
|
||||
if (order) {
|
||||
holder.home2_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home2_game_order.setText((i + 1) + "");
|
||||
holder.home2_game_order.setText(String.valueOf(i + 1));
|
||||
} else {
|
||||
holder.home2_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
@ -656,7 +656,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(gameEntity.getApk().get(0).getSize() + " | " + gameEntity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", gameEntity.getApk().get(0).getSize(), gameEntity.getBrief()));
|
||||
}
|
||||
holder.gameTestType.setText(gameEntity.getTest().getType());
|
||||
if (gameEntity.getTest().getStart() == 0) {
|
||||
@ -733,9 +733,10 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
offset += 1 + pluginList.size();
|
||||
}
|
||||
for (int i = 0, size = subjectList.size(); i < size; i++) {
|
||||
if (position > offset && position <= subjectList.get(i).getData().size() + offset) {
|
||||
if (position > offset
|
||||
&& position <= subjectList.get(i).getData().size() + offset) {
|
||||
int index = position -offset-1;
|
||||
if (index<0){
|
||||
if (index < 0){
|
||||
index = 0;
|
||||
}
|
||||
gameEntity = subjectList.get(i).getData().get(index);
|
||||
@ -756,20 +757,20 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
final int i, final boolean order, final String name) {
|
||||
if (order) {
|
||||
holder.home1_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home1_game_order.setText((i + 1) + "");
|
||||
holder.home1_game_order.setText(String.valueOf(i + 1));
|
||||
} else {
|
||||
holder.home1_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.getInstance(context).display(entity.getIcon(), holder.gameThumb);
|
||||
if (entity.getPluginPlatform() != null) {
|
||||
holder.gameNameAndSize.setText(entity.getName() + " - " + entity.getPluginPlatform());
|
||||
holder.gameNameAndSize.setText(String.format("%s - %s", entity.getName(), entity.getPluginPlatform()));
|
||||
} else {
|
||||
holder.gameNameAndSize.setText(entity.getName());
|
||||
}
|
||||
if (entity.getApk() == null || entity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(entity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(entity.getApk().get(0).getSize() + " | " + entity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", entity.getApk().get(0).getSize(), entity.getBrief()));
|
||||
}
|
||||
GameViewUtils.setLabelList(context, holder.labelList, entity.getTag());
|
||||
|
||||
@ -866,8 +867,7 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
public void initGameHeadViewHolder(GameHeadViewHolder holder, int position) {
|
||||
if (!pluginList.isEmpty() && position == 1) {
|
||||
// holder.headTop.setVisibility(View.VISIBLE);
|
||||
holder.title.setTextColor(Color.parseColor("#1ba4fc"));
|
||||
holder.title.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
holder.thumb.setVisibility(View.VISIBLE);
|
||||
holder.thumb.setImageResource(R.drawable.home_plug_upgrade);
|
||||
holder.title.setText("你有" + pluginSize + "个游戏可以升级插件版");
|
||||
|
||||
@ -141,7 +141,7 @@ public class Game2Fragment extends Fragment implements SwipeRefreshLayout.OnRefr
|
||||
});
|
||||
|
||||
game_swipe_refresh = (SwipeRefreshLayout) view.findViewById(R.id.game_swipe_refresh);
|
||||
game_swipe_refresh.setColorSchemeResources(R.color.theme_colors);
|
||||
game_swipe_refresh.setColorSchemeResources(R.color.theme);
|
||||
game_swipe_refresh.setOnRefreshListener(this);
|
||||
|
||||
game_pb_loading = (ProgressBarCircularIndeterminate) view.findViewById(R.id.game_pb_loading);
|
||||
|
||||
@ -399,7 +399,7 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
final int i, boolean order, final String name) {
|
||||
if (order) {
|
||||
holder.home1_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home1_game_order.setText((i + 1) + "");
|
||||
holder.home1_game_order.setText(String.valueOf(i + 1));
|
||||
} else {
|
||||
holder.home1_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
@ -408,7 +408,7 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (entity.getApk() == null || entity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(entity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(entity.getApk().get(0).getSize() + " | " + entity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", entity.getApk().get(0).getSize(), entity.getBrief()));
|
||||
}
|
||||
GameViewUtils.setLabelList(context, holder.labelList, entity.getTag());
|
||||
|
||||
@ -469,7 +469,7 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
final int i, boolean order, final String name) {
|
||||
if (order) {
|
||||
holder.home2_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home2_game_order.setText((i + 1) + "");
|
||||
holder.home2_game_order.setText(String.valueOf(i + 1));
|
||||
} else {
|
||||
holder.home2_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
@ -478,7 +478,7 @@ public class Game2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(gameEntity.getApk().get(0).getSize() + " | " + gameEntity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", gameEntity.getApk().get(0).getSize(), gameEntity.getBrief()));
|
||||
}
|
||||
holder.gameTestType.setText(gameEntity.getTest().getType());
|
||||
if (gameEntity.getTest().getStart() == 0) {
|
||||
|
||||
@ -147,7 +147,7 @@ public class Game3Fragment extends Fragment implements OnRefreshListener {
|
||||
});
|
||||
|
||||
game_swipe_refresh = (SwipeRefreshLayout) view.findViewById(R.id.game_swipe_refresh);
|
||||
game_swipe_refresh.setColorSchemeResources(R.color.theme_colors);
|
||||
game_swipe_refresh.setColorSchemeResources(R.color.theme);
|
||||
game_swipe_refresh.setOnRefreshListener(this);
|
||||
|
||||
game_pb_loading = (ProgressBarCircularIndeterminate) view.findViewById(R.id.game_pb_loading);
|
||||
|
||||
@ -178,7 +178,7 @@ public class GameFragment extends Fragment implements OnClickListener,
|
||||
int downloadSize = DownloadManager.getInstance(getActivity()).getAll().size();
|
||||
if (downloadSize != 0) {
|
||||
downloadHint.setVisibility(View.VISIBLE);
|
||||
downloadHint.setText(downloadSize + "");
|
||||
downloadHint.setText(String.valueOf(downloadSize));
|
||||
int width = DisplayUtils.dip2px(getActivity(), 12);
|
||||
RelativeLayout.LayoutParams rparams = new RelativeLayout.LayoutParams(
|
||||
width, width);
|
||||
@ -259,13 +259,7 @@ public class GameFragment extends Fragment implements OnClickListener,
|
||||
map.put("page", "主页");
|
||||
DataCollectionManager.onEvent(getActivity(), "click-item", map);
|
||||
|
||||
if (downloadHint != null
|
||||
&& downloadHint.getVisibility() == View.VISIBLE) {
|
||||
downloadHint.setVisibility(View.GONE);
|
||||
EventBus.getDefault().post(new EBTopState("隐藏", null));
|
||||
}
|
||||
startActivity(new Intent(getActivity(),
|
||||
DownloadManagerActivity.class));
|
||||
startActivity(new Intent(getActivity(), DownloadManagerActivity.class));
|
||||
} else if (id == R.id.actionbar_search_input) {
|
||||
DataUtils.onEvent(getActivity(), "主页", "搜索框");
|
||||
|
||||
@ -308,23 +302,23 @@ public class GameFragment extends Fragment implements OnClickListener,
|
||||
jingpinText.setClickable(false);
|
||||
zuixinText.setClickable(true);
|
||||
danjiText.setClickable(true);
|
||||
jingpinText.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
zuixinText.setTextColor(0xFF333333);
|
||||
danjiText.setTextColor(0xFF333333);
|
||||
jingpinText.setTextColor(getResources().getColor(R.color.theme));
|
||||
zuixinText.setTextColor(getResources().getColor(R.color.title));
|
||||
danjiText.setTextColor(getResources().getColor(R.color.title));
|
||||
} else if (position == 1) {
|
||||
jingpinText.setClickable(true);
|
||||
zuixinText.setClickable(false);
|
||||
danjiText.setClickable(true);
|
||||
jingpinText.setTextColor(0xFF333333);
|
||||
zuixinText.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
danjiText.setTextColor(0xFF333333);
|
||||
jingpinText.setTextColor(getResources().getColor(R.color.title));
|
||||
zuixinText.setTextColor(getResources().getColor(R.color.theme));
|
||||
danjiText.setTextColor(getResources().getColor(R.color.title));
|
||||
} else if (position == 2) {
|
||||
jingpinText.setClickable(true);
|
||||
zuixinText.setClickable(true);
|
||||
danjiText.setClickable(false);
|
||||
jingpinText.setTextColor(0xFF333333);
|
||||
zuixinText.setTextColor(0xFF333333);
|
||||
danjiText.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
jingpinText.setTextColor(getResources().getColor(R.color.title));
|
||||
zuixinText.setTextColor(getResources().getColor(R.color.title));
|
||||
danjiText.setTextColor(getResources().getColor(R.color.theme));
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,7 +369,7 @@ public class GameFragment extends Fragment implements OnClickListener,
|
||||
int downloadSize = DownloadManager.getInstance(getActivity()).getAll().size();
|
||||
if (type == 1 && downloadSize == 0) {
|
||||
downloadHint.setVisibility(View.VISIBLE);
|
||||
downloadHint.setText((downloadSize + type) + "");
|
||||
downloadHint.setText(String.valueOf(downloadSize + type));
|
||||
int width = DisplayUtils.dip2px(getActivity(), 12);
|
||||
RelativeLayout.LayoutParams rparams = new RelativeLayout.LayoutParams(width, width);
|
||||
rparams.topMargin = DisplayUtils.dip2px(getActivity(), 8);
|
||||
@ -398,7 +392,7 @@ public class GameFragment extends Fragment implements OnClickListener,
|
||||
}
|
||||
} else if (downloadSize != 0) {
|
||||
downloadHint.setVisibility(View.VISIBLE);
|
||||
downloadHint.setText((downloadSize + type) + "");
|
||||
downloadHint.setText(String.valueOf(downloadSize + type));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ public class GameListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", gameEntity.getName());
|
||||
kv.put("位置", 1);
|
||||
DataUtils.onEvent(context, "点击", "游戏-插件-" + subjectEntity.getName(), kv);
|
||||
@ -168,20 +168,20 @@ public class GameListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
|
||||
if (subjectEntity.getOrder()) {
|
||||
holder.home1_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home1_game_order.setText(i + "");
|
||||
holder.home1_game_order.setText(String.valueOf(i));
|
||||
} else {
|
||||
holder.home1_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
ImageUtils.getInstance(context).display(gameEntity.getIcon(), holder.gameThumb);
|
||||
if (gameEntity.getPluginPlatform() != null) {
|
||||
holder.gameNameAndSize.setText(gameEntity.getName() + " - " + gameEntity.getPluginPlatform());
|
||||
holder.gameNameAndSize.setText(String.format("%s - %s", gameEntity.getName(), gameEntity.getPluginPlatform()));
|
||||
} else {
|
||||
holder.gameNameAndSize.setText(gameEntity.getName());
|
||||
}
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(gameEntity.getApk().get(0).getSize() + " | " + gameEntity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", gameEntity.getApk().get(0).getSize(), gameEntity.getBrief()));
|
||||
}
|
||||
GameViewUtils.setLabelList(context, holder.labelList, gameEntity.getTag());
|
||||
|
||||
@ -189,7 +189,7 @@ public class GameListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", gameEntity.getName());
|
||||
kv.put("位置", i);
|
||||
DataUtils.onEvent(context, "点击", "游戏-插件-" + gameEntity, kv);
|
||||
@ -233,7 +233,7 @@ public class GameListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
|
||||
if (subjectEntity.getOrder()) {
|
||||
holder.home2_game_order.setVisibility(View.VISIBLE);
|
||||
holder.home2_game_order.setText(i + "");
|
||||
holder.home2_game_order.setText(String.valueOf(i));
|
||||
} else {
|
||||
holder.home2_game_order.setVisibility(View.GONE);
|
||||
}
|
||||
@ -242,7 +242,7 @@ public class GameListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
if (gameEntity.getApk() == null || gameEntity.getApk().isEmpty()) {
|
||||
holder.gameDes.setText(gameEntity.getBrief());
|
||||
} else {
|
||||
holder.gameDes.setText(gameEntity.getApk().get(0).getSize() + " | " + gameEntity.getBrief());
|
||||
holder.gameDes.setText(String.format("%s %s", gameEntity.getApk().get(0).getSize(), gameEntity.getBrief()));
|
||||
}
|
||||
holder.gameTestType.setText(gameEntity.getTest().getType());
|
||||
if (gameEntity.getTest().getStart() == 0) {
|
||||
@ -255,7 +255,7 @@ public class GameListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", gameEntity.getName());
|
||||
kv.put("位置", i);
|
||||
DataUtils.onEvent(context, "点击", "游戏-插件-" + subjectEntity.getName(), kv);
|
||||
|
||||
@ -166,9 +166,9 @@ public class NewGame2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
|
||||
private void initItem(final SubjectEntity subjectEntity, LinearLayout item_ll, final int position) {
|
||||
item_ll.removeAllViews();
|
||||
GameEntity entity = null;
|
||||
GameEntity entity;
|
||||
List<GameEntity> data = subjectEntity.getData();
|
||||
int index = 0;
|
||||
int index;
|
||||
for (int i = 0; i < subjectEntity.getData().size()+1; i++) {
|
||||
index = i-1;
|
||||
if (index<0){
|
||||
@ -184,7 +184,7 @@ public class NewGame2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", finalEntity1.getName());
|
||||
kv.put("位置", position + 1);
|
||||
DataUtils.onEvent(mContext, "点击", "游戏-推荐-" + subjectEntity.getName(), kv);
|
||||
@ -252,7 +252,7 @@ public class NewGame2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
ImageUtils.getInstance(mContext).display(data.get(index).getIcon(),gameIcon);
|
||||
|
||||
item_ll.addView(view);
|
||||
gameDes.setText(entity.getApk().get(0).getSize() +" "+data.get(index).getBrief());
|
||||
gameDes.setText(String.format("%s %s", entity.getApk().get(0).getSize(), data.get(index).getBrief()));
|
||||
gameName.setText(data.get(index).getName());
|
||||
LinearLayout labelListTest = (LinearLayout) view.findViewById(R.id.home2_label_list);
|
||||
LinearLayout labelList = (LinearLayout) view.findViewById(R.id.home1_label_list);
|
||||
@ -277,9 +277,9 @@ public class NewGame2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
if (subjectEntity.getOrder()) {
|
||||
home1_game_order.setVisibility(View.VISIBLE);
|
||||
if (data.get(0).getImage() != null){
|
||||
home1_game_order.setText((i-1) + "");
|
||||
home1_game_order.setText(String.valueOf(i - 1));
|
||||
}else {
|
||||
home1_game_order.setText((i) + "");
|
||||
home1_game_order.setText(String.valueOf(i));
|
||||
}
|
||||
} else {
|
||||
home1_game_order.setVisibility(View.GONE);
|
||||
@ -289,7 +289,7 @@ public class NewGame2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", finalEntity.getName());
|
||||
kv.put("位置", position);
|
||||
DataUtils.onEvent(mContext, "点击", "游戏-插件-" + subjectEntity.getName(), kv);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.gh.gamecenter.gamedetails;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.Nullable;
|
||||
@ -964,7 +965,7 @@ public class GameDetailsFragment extends Fragment {
|
||||
|
||||
RelativeLayout relativeLayout = new RelativeLayout(
|
||||
getActivity());
|
||||
relativeLayout.setBackgroundColor(0xffffffff);
|
||||
relativeLayout.setBackgroundColor(Color.WHITE);
|
||||
LayoutParams params = new LayoutParams(
|
||||
LayoutParams.MATCH_PARENT, normalHeight);
|
||||
relativeLayout.setLayoutParams(params);
|
||||
|
||||
@ -671,7 +671,7 @@ public class GameInformationFragment extends Fragment {
|
||||
viewHolder.item_et_search.setText(keyword);
|
||||
viewHolder.item_et_search.setSelection(keyword.length());
|
||||
viewHolder.item_et_search.requestFocus();
|
||||
Spanned content = Html.fromHtml("与“<font color='#1BA4FC'>"
|
||||
Spanned content = Html.fromHtml("与“<font color='#00B7FA'>"
|
||||
+ keyword + "</font>”相关的资讯共"
|
||||
+ adapter.getNewsList().size() + "条");
|
||||
viewHolder.item_tv_search_result.setText(content);
|
||||
@ -693,13 +693,13 @@ public class GameInformationFragment extends Fragment {
|
||||
viewHolder.item_rv_select.setLayoutParams(lparams);
|
||||
}
|
||||
} else if (position >= 3 && position <= newsList.size() + 2) {
|
||||
viewHolder.information_type.setText((position - 2) + "");
|
||||
viewHolder.information_type.setText(String.valueOf(position - 2));
|
||||
if (currentPosition == -1) {
|
||||
String title = adapter
|
||||
.getNewsList()
|
||||
.get(position - 3)
|
||||
.getTitle()
|
||||
.replace(keyword, "<font color='#1BA4FC'>" + keyword + "</font>");
|
||||
.replace(keyword, "<font color='#00B7FA'>" + keyword + "</font>");
|
||||
Spanned content = Html.fromHtml(title);
|
||||
viewHolder.information_title.setText(content);
|
||||
} else {
|
||||
@ -804,9 +804,8 @@ public class GameInformationFragment extends Fragment {
|
||||
view = relativeLayout;
|
||||
} else if (isNull && i == 2) {
|
||||
view = LayoutInflater.from(viewGroup.getContext()).inflate(
|
||||
R.layout.reuse_none_date, viewGroup, false);
|
||||
TextView hint = (TextView) view
|
||||
.findViewById(R.id.reuse_tv_none);
|
||||
R.layout.reuse_none_data, viewGroup, false);
|
||||
TextView hint = (TextView) view.findViewById(R.id.reuse_tv_none_data);
|
||||
hint.setText("暂无数据");
|
||||
int height = fm_gameinformation_rv_show.getHeight()
|
||||
- DisplayUtils.dip2px(getActivity(), 29);
|
||||
@ -820,9 +819,8 @@ public class GameInformationFragment extends Fragment {
|
||||
} else if (isRemove && (newsList == null || newsList.isEmpty())
|
||||
&& i == 3) {
|
||||
view = LayoutInflater.from(viewGroup.getContext()).inflate(
|
||||
R.layout.reuse_none_date, viewGroup, false);
|
||||
TextView hint = (TextView) view
|
||||
.findViewById(R.id.reuse_tv_none);
|
||||
R.layout.reuse_none_data, viewGroup, false);
|
||||
TextView hint = (TextView) view.findViewById(R.id.reuse_tv_none_data);
|
||||
int height = 0;
|
||||
if (currentPosition == -1) {
|
||||
hint.setText("搜索为空");
|
||||
|
||||
@ -683,7 +683,7 @@ public class GameStrategyFragment extends Fragment {
|
||||
viewHolder.item_et_search.setText(keyword);
|
||||
viewHolder.item_et_search.setSelection(keyword.length());
|
||||
viewHolder.item_et_search.requestFocus();
|
||||
Spanned content = Html.fromHtml("与“<font color='#1BA4FC'>"
|
||||
Spanned content = Html.fromHtml("与“<font color='#00B7FA'>"
|
||||
+ keyword + "</font>”相关的资讯共"
|
||||
+ adapter.getNewsList().size() + "条");
|
||||
viewHolder.item_tv_search_result.setText(content);
|
||||
@ -706,7 +706,7 @@ public class GameStrategyFragment extends Fragment {
|
||||
}
|
||||
} else if (position >= 3
|
||||
&& position <= adapter.getNewsList().size() + 2) {
|
||||
viewHolder.information_type.setText((position - 2) + "");
|
||||
viewHolder.information_type.setText(String.valueOf(position - 2));
|
||||
if (currentPosition == -1) {
|
||||
String title = adapter
|
||||
.getNewsList()
|
||||
@ -714,7 +714,7 @@ public class GameStrategyFragment extends Fragment {
|
||||
.getTitle()
|
||||
.replace(
|
||||
keyword,
|
||||
"<font color='#1BA4FC'>" + keyword
|
||||
"<font color='#00B7FA'>" + keyword
|
||||
+ "</font>");
|
||||
Spanned content = Html.fromHtml(title);
|
||||
viewHolder.information_title.setText(content);
|
||||
@ -823,9 +823,8 @@ public class GameStrategyFragment extends Fragment {
|
||||
view = relativeLayout;
|
||||
} else if (isNull && i == 2) {
|
||||
view = LayoutInflater.from(viewGroup.getContext()).inflate(
|
||||
R.layout.reuse_none_date, viewGroup, false);
|
||||
TextView hint = (TextView) view
|
||||
.findViewById(R.id.reuse_tv_none);
|
||||
R.layout.reuse_none_data, viewGroup, false);
|
||||
TextView hint = (TextView) view.findViewById(R.id.reuse_tv_none_data);
|
||||
hint.setText("暂无数据");
|
||||
int height = fm_gamestrategy_rv_show.getHeight()
|
||||
- DisplayUtils.dip2px(getActivity(), 29);
|
||||
@ -840,9 +839,8 @@ public class GameStrategyFragment extends Fragment {
|
||||
} else if (isRemove && (newsList == null || newsList.isEmpty())
|
||||
&& i == 3) {
|
||||
view = LayoutInflater.from(viewGroup.getContext()).inflate(
|
||||
R.layout.reuse_none_date, viewGroup, false);
|
||||
TextView hint = (TextView) view
|
||||
.findViewById(R.id.reuse_tv_none);
|
||||
R.layout.reuse_none_data, viewGroup, false);
|
||||
TextView hint = (TextView) view.findViewById(R.id.reuse_tv_none_data);
|
||||
int height = 0;
|
||||
if (currentPosition == -1) {
|
||||
hint.setText("搜索为空");
|
||||
|
||||
@ -12,7 +12,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
|
||||
import com.gh.common.constant.Config;
|
||||
@ -24,7 +23,6 @@ import com.gh.gamecenter.db.info.ConcernInfo;
|
||||
import com.gh.gamecenter.manager.ConcernManager;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -41,7 +39,7 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
private NewNews4FragmentAdapter mNews4FragmentAdapter;
|
||||
private LinearLayoutManager mLayoutManager;
|
||||
private LinearLayout noConnection;
|
||||
private TextView noConcern;
|
||||
private LinearLayout reuse_none_data;
|
||||
private SwipeRefreshLayout mSwipeRefreshLayout;
|
||||
private ProgressBarCircularIndeterminate mProgressBar;
|
||||
|
||||
@ -49,13 +47,9 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
private boolean isRemove = false;
|
||||
private boolean isNetworkError = false;
|
||||
|
||||
private NewNews4Fragment news4Fragment = this;
|
||||
|
||||
private int page = 1;
|
||||
|
||||
private String updateGameId;
|
||||
|
||||
private List<String> listGameId;
|
||||
private List<String> gameIdList;
|
||||
|
||||
private ConcernManager manager;
|
||||
|
||||
@ -64,42 +58,26 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == 0){
|
||||
String concernID = (String) msg.obj;
|
||||
StringBuffer concernKey = new StringBuffer();
|
||||
concernKey.setLength(0);
|
||||
StringBuffer gameIdPostData = new StringBuffer();
|
||||
listGameId.clear();
|
||||
try {
|
||||
JSONArray jsonArray = new JSONArray(concernID);
|
||||
for (int i= 0; i< jsonArray.length(); i++){
|
||||
String gameId = (String) jsonArray.get(i);
|
||||
listGameId.add(gameId);
|
||||
if (i< 5){
|
||||
gameIdPostData.append(gameId + "-");
|
||||
}
|
||||
for (int i = 0, size = gameIdList.size(); i < size; i++){
|
||||
if (i < 5) {
|
||||
gameIdPostData.append(gameIdList.get(i));
|
||||
gameIdPostData.append("-");
|
||||
}
|
||||
//数据进行排序后进行MD5操作
|
||||
Collections.sort(listGameId, new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String lhs, String rhs) {
|
||||
return lhs.compareTo(rhs);
|
||||
}
|
||||
});
|
||||
for (int i= 0; i< listGameId.size(); i++) {
|
||||
concernKey.append(listGameId.get(i));
|
||||
}
|
||||
String contentMD5 = MD5Utils.getContentMD5(concernKey.toString());
|
||||
|
||||
if (gameIdPostData.length()>0){
|
||||
gameIdPostData.deleteCharAt(gameIdPostData.length()-1);
|
||||
}
|
||||
mNews4FragmentAdapter = new NewNews4FragmentAdapter(getActivity(), news4Fragment, contentMD5,gameIdPostData.toString(),page);
|
||||
mRecyclerView.setAdapter(mNews4FragmentAdapter);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
for (int i = 0; i < gameIdList.size(); i++) {
|
||||
concernKey.append(gameIdList.get(i));
|
||||
}
|
||||
String contentMD5 = MD5Utils.getContentMD5(concernKey.toString());
|
||||
|
||||
if (gameIdPostData.length() > 0) {
|
||||
gameIdPostData.deleteCharAt(gameIdPostData.length() - 1);
|
||||
}
|
||||
mNews4FragmentAdapter = new NewNews4FragmentAdapter(getActivity(), NewNews4Fragment.this,
|
||||
contentMD5, gameIdPostData.toString(), page);
|
||||
mRecyclerView.setAdapter(mNews4FragmentAdapter);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -107,20 +85,20 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_news4,null);
|
||||
mView = View.inflate(getActivity(), R.layout.fragment_news4, null);
|
||||
mRecyclerView = (RecyclerView) mView.findViewById(R.id.news4_rv);
|
||||
mSwipeRefreshLayout = (SwipeRefreshLayout) mView.findViewById(R.id.news4_swipe_refresh);
|
||||
mProgressBar = (ProgressBarCircularIndeterminate) mView.findViewById(R.id.news4_pb_loading);
|
||||
noConnection = (LinearLayout) mView.findViewById(R.id.reuse_no_connection);
|
||||
noConcern = (TextView) mView.findViewById(R.id.concern_tv_none);
|
||||
reuse_none_data = (LinearLayout) mView.findViewById(R.id.reuse_none_data);
|
||||
mLayoutManager = new LinearLayoutManager(getActivity());
|
||||
mRecyclerView.setLayoutManager(mLayoutManager);
|
||||
|
||||
manager = new ConcernManager(getActivity());
|
||||
|
||||
listGameId = new ArrayList<>();
|
||||
gameIdList = new ArrayList<>();
|
||||
|
||||
LoadConcernGameId();
|
||||
loadConcernGameId();
|
||||
|
||||
mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
@ -136,13 +114,13 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
}
|
||||
});
|
||||
|
||||
mSwipeRefreshLayout.setColorSchemeResources(R.color.theme_colors);
|
||||
mSwipeRefreshLayout.setColorSchemeResources(R.color.theme);
|
||||
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
page = 1;
|
||||
isRemove = false;
|
||||
LoadConcernGameId();
|
||||
loadConcernGameId();
|
||||
}
|
||||
});
|
||||
noConnection.setOnClickListener(new View.OnClickListener() {
|
||||
@ -154,27 +132,30 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
@Override
|
||||
public void run() {
|
||||
isNetworkError = false;
|
||||
LoadConcernGameId();
|
||||
loadConcernGameId();
|
||||
}
|
||||
},1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void LoadConcernGameId() {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
private void loadConcernGameId() {
|
||||
List<ConcernInfo> concernGame = manager.getConcernGame();
|
||||
|
||||
gameIdList.clear();
|
||||
for (ConcernInfo concernInfo : concernGame) {
|
||||
jsonArray.put(concernInfo.getId());
|
||||
gameIdList.add(concernInfo.getId());
|
||||
}
|
||||
|
||||
updateGameId = jsonArray.toString();
|
||||
Message message = new Message();
|
||||
message.obj = jsonArray.toString();
|
||||
message.what = 0;
|
||||
handler.sendMessage(message);
|
||||
noConcern.setVisibility(View.GONE);
|
||||
// 对数据进行排序
|
||||
Collections.sort(gameIdList, new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String lhs, String rhs) {
|
||||
return lhs.compareTo(rhs);
|
||||
}
|
||||
});
|
||||
|
||||
handler.sendEmptyMessage(0);
|
||||
reuse_none_data.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@ -206,28 +187,28 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
@Override
|
||||
public void isNetworkError(boolean netWorkError) {
|
||||
isNetworkError = netWorkError;
|
||||
if (isNetworkError == true){
|
||||
if (isNetworkError){
|
||||
noConnection.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
noConnection.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateconcern() {
|
||||
String uuid = ConcernUtils.UUID(getActivity());
|
||||
public void updateConcern() {
|
||||
String uuid = ConcernUtils.uuid(getActivity());
|
||||
|
||||
ConcernUtils.UpdateConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern", updateGameId, new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("更新设备游戏成功");
|
||||
}
|
||||
ConcernUtils.updateConcernData(Config.HOST + "v2d0/device/" + uuid + "/concern", new JSONArray(gameIdList),
|
||||
new ConcernUtils.DownJsonListener() {
|
||||
@Override
|
||||
public void downSucced(String str) {
|
||||
Utils.log("更新设备游戏成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downFailed() {
|
||||
Utils.log("更新设备游戏失败");
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void downFailed() {
|
||||
Utils.log("更新设备游戏失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -236,7 +217,7 @@ public class NewNews4Fragment extends Fragment implements NewNews4FragmentAdapte
|
||||
if (mSwipeRefreshLayout.isRefreshing()){
|
||||
mSwipeRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
noConcern.setVisibility(View.VISIBLE);
|
||||
reuse_none_data.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@ public class NewNews4FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
keyRequestError = true;
|
||||
if (gameIdPostData.length() > 5){
|
||||
LoadJosnData(page);
|
||||
callBackListener.updateconcern();
|
||||
callBackListener.updateConcern();
|
||||
}else {
|
||||
callBackListener.concernNewsData(true);
|
||||
}
|
||||
@ -321,7 +321,7 @@ public class NewNews4FragmentAdapter extends RecyclerView.Adapter<RecyclerView.V
|
||||
void isLoadOver(boolean loadOver);
|
||||
void isRemove(boolean remove);
|
||||
void isNetworkError(boolean netWorkError);
|
||||
void updateconcern();
|
||||
void updateConcern();
|
||||
void concernNewsData(boolean noDate);//关注新闻是否为空
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ public class News1Fragment extends Fragment implements SwipeRefreshLayout.OnRefr
|
||||
isEverpause = false;
|
||||
|
||||
original_swipe_refresh = (SwipeRefreshLayout) view.findViewById(R.id.original_swipe_refresh);
|
||||
original_swipe_refresh.setColorSchemeResources(R.color.theme_colors);
|
||||
original_swipe_refresh.setColorSchemeResources(R.color.theme);
|
||||
original_swipe_refresh.setOnRefreshListener(this);
|
||||
|
||||
original_pb_loading = (ProgressBarCircularIndeterminate) view.findViewById(R.id.original_pb_loading);
|
||||
|
||||
@ -93,9 +93,9 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
game_pb_loading = pbLoading;
|
||||
reuse_no_connection = noConnection;
|
||||
|
||||
newsList = new ArrayList<NewsEntity>();
|
||||
viewsMap = new ArrayMap<String, Integer>();
|
||||
urlList = new ArrayList<String>();
|
||||
newsList = new ArrayList<>();
|
||||
viewsMap = new ArrayMap<>();
|
||||
urlList = new ArrayList<>();
|
||||
|
||||
isLoading = false;
|
||||
isRemove = false;
|
||||
@ -257,7 +257,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", newsEntity.getTitle());
|
||||
kv.put("位置", position + 1);
|
||||
DataUtils.onEvent(context, "点击", "资讯-资讯", kv);
|
||||
@ -274,7 +274,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.fm_read_ll_read.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.fm_read_ll_read.setVisibility(View.VISIBLE);
|
||||
viewHolder.fm_read_tv_read.setText(views + "");
|
||||
viewHolder.fm_read_tv_read.setText(String.valueOf(views));
|
||||
}
|
||||
setType(viewHolder.fm_read_tv_type, newsEntity.getType());
|
||||
}
|
||||
@ -294,7 +294,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", newsEntity.getTitle());
|
||||
kv.put("位置", position + 1);
|
||||
DataUtils.onEvent(context, "点击", "资讯-资讯", kv);
|
||||
@ -316,7 +316,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.fm_read2_special2_ll_read.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.fm_read2_special2_ll_read.setVisibility(View.VISIBLE);
|
||||
viewHolder.fm_read2_special2_tv_read.setText(views + "");
|
||||
viewHolder.fm_read2_special2_tv_read.setText(String.valueOf(views));
|
||||
}
|
||||
setType(viewHolder.fm_read2_special2_tv_type, newsEntity.getType());
|
||||
}
|
||||
@ -325,7 +325,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Map<String, Object> kv = new HashMap<String, Object>();
|
||||
Map<String, Object> kv = new HashMap<>();
|
||||
kv.put("名字", newsEntity.getTitle());
|
||||
kv.put("位置", position + 1);
|
||||
DataUtils.onEvent(context, "点击", "资讯-资讯", kv);
|
||||
@ -343,7 +343,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.fm_read2_special1_ll_read.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.fm_read2_special1_ll_read.setVisibility(View.VISIBLE);
|
||||
viewHolder.fm_read2_special1_tv_read.setText(views + "");
|
||||
viewHolder.fm_read2_special1_tv_read.setText(String.valueOf(views));
|
||||
}
|
||||
setType(viewHolder.fm_read2_special1_tv_type, newsEntity.getType());
|
||||
}
|
||||
@ -406,7 +406,7 @@ public class News1FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if ("success".equals(response.getString("status"))) {
|
||||
Integer views = viewsMap.get(news_id);
|
||||
if (views == null) {
|
||||
views = new Integer(0);
|
||||
views = 0;
|
||||
}
|
||||
views += 1;
|
||||
viewsMap.put(news_id, views);
|
||||
|
||||
@ -45,7 +45,7 @@ public class News2Fragment extends Fragment implements SwipeRefreshLayout.OnRefr
|
||||
isEverpause = false;
|
||||
|
||||
original_swipe_refresh = (SwipeRefreshLayout) view.findViewById(R.id.original_swipe_refresh);
|
||||
original_swipe_refresh.setColorSchemeResources(R.color.theme_colors);
|
||||
original_swipe_refresh.setColorSchemeResources(R.color.theme);
|
||||
original_swipe_refresh.setOnRefreshListener(this);
|
||||
|
||||
original_pb_loading = (ProgressBarCircularIndeterminate) view.findViewById(R.id.original_pb_loading);
|
||||
|
||||
@ -274,7 +274,7 @@ public class News2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.fm_read_ll_read.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.fm_read_ll_read.setVisibility(View.VISIBLE);
|
||||
viewHolder.fm_read_tv_read.setText(views + "");
|
||||
viewHolder.fm_read_tv_read.setText(String.valueOf(views));
|
||||
}
|
||||
setType(viewHolder.fm_read_tv_type, newsEntity.getType());
|
||||
}
|
||||
@ -315,7 +315,7 @@ public class News2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.fm_read2_special2_ll_read.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.fm_read2_special2_ll_read.setVisibility(View.VISIBLE);
|
||||
viewHolder.fm_read2_special2_tv_read.setText(views + "");
|
||||
viewHolder.fm_read2_special2_tv_read.setText(String.valueOf(views));
|
||||
}
|
||||
setType(viewHolder.fm_read2_special2_tv_type, newsEntity.getType());
|
||||
}
|
||||
@ -342,7 +342,7 @@ public class News2FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
viewHolder.fm_read2_special1_ll_read.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.fm_read2_special1_ll_read.setVisibility(View.VISIBLE);
|
||||
viewHolder.fm_read2_special1_tv_read.setText(views + "");
|
||||
viewHolder.fm_read2_special1_tv_read.setText(String.valueOf(views));
|
||||
}
|
||||
setType(viewHolder.fm_read2_special1_tv_type, newsEntity.getType());
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public class News3Fragment extends Fragment {
|
||||
|
||||
if (adapter.getPosition_today() != -1 && position <= 1) {
|
||||
news_tv_label.setText("今天");
|
||||
news_tv_label.setTextColor(0xFF1BA4FC);
|
||||
news_tv_label.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
} else if (adapter.getPosition_before() != -1 && position <= 3) {
|
||||
news_tv_label.setText("昨天/以前");
|
||||
news_tv_label.setTextColor(0xFF3A3A3A);
|
||||
|
||||
@ -266,7 +266,7 @@ public class News3FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (position_today != -1) {
|
||||
news_rl_label.setVisibility(View.VISIBLE);
|
||||
news_tv_label.setText("今天");
|
||||
news_tv_label.setTextColor(0xFF1BA4FC);
|
||||
news_tv_label.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
} else if (position_before != -1) {
|
||||
news_rl_label.setVisibility(View.VISIBLE);
|
||||
news_tv_label.setText("昨天/以前");
|
||||
@ -338,7 +338,7 @@ public class News3FragmentAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
if (position == position_today) {
|
||||
viewHolder.headType.setText("今天");
|
||||
viewHolder.headType.setTextColor(0xFF1BA4FC);
|
||||
viewHolder.headType.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
}
|
||||
|
||||
if (position == position_before) {
|
||||
|
||||
@ -10,7 +10,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
|
||||
import com.gh.base.AppController;
|
||||
@ -34,7 +33,7 @@ public class News4Fragment extends Fragment {
|
||||
private News4FragmentAdapter adapter;
|
||||
private ProgressBarCircularIndeterminate news_pb_loading;
|
||||
private LinearLayout reuse_no_connection;
|
||||
private TextView news_tv_none;
|
||||
private LinearLayout reuse_none_data;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@ -44,8 +43,8 @@ public class News4Fragment extends Fragment {
|
||||
|
||||
news_pb_loading = (ProgressBarCircularIndeterminate) view.findViewById(R.id.news_pb_loading);
|
||||
|
||||
news_tv_none = (TextView) view.findViewById(R.id.news_tv_none);
|
||||
news_tv_none.setOnClickListener(new View.OnClickListener() {
|
||||
reuse_none_data = (LinearLayout) view.findViewById(R.id.reuse_none_data);
|
||||
reuse_none_data.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(getActivity(), ConcernActivity.class));
|
||||
@ -60,7 +59,7 @@ public class News4Fragment extends Fragment {
|
||||
news_pb_loading.setVisibility(View.VISIBLE);
|
||||
reuse_no_connection.setVisibility(View.GONE);
|
||||
adapter = new News4FragmentAdapter(getActivity(), news_list,
|
||||
news_pb_loading, reuse_no_connection, news_tv_none, true);
|
||||
news_pb_loading, reuse_no_connection, reuse_none_data, true);
|
||||
news_list.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
@ -69,7 +68,7 @@ public class News4Fragment extends Fragment {
|
||||
news_list.setHasFixedSize(true);
|
||||
news_list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
adapter = new News4FragmentAdapter(getActivity(), news_list,
|
||||
news_pb_loading, reuse_no_connection, news_tv_none, false);
|
||||
news_pb_loading, reuse_no_connection, reuse_none_data, false);
|
||||
news_list.setAdapter(adapter);
|
||||
news_list.addItemDecoration(new VerticalItemDecoration(getActivity(), 1));
|
||||
|
||||
@ -115,7 +114,7 @@ public class News4Fragment extends Fragment {
|
||||
news_pb_loading.setVisibility(View.VISIBLE);
|
||||
reuse_no_connection.setVisibility(View.GONE);
|
||||
adapter = new News4FragmentAdapter(getActivity(), news_list,
|
||||
news_pb_loading, reuse_no_connection, news_tv_none, true);
|
||||
news_pb_loading, reuse_no_connection, reuse_none_data, true);
|
||||
news_list.setAdapter(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class News4FragmentAdapter extends
|
||||
private RecyclerView news_list;
|
||||
private ProgressBarCircularIndeterminate news_pb_loading;
|
||||
private LinearLayout reuse_no_connection;
|
||||
private TextView news_tv_none;
|
||||
private LinearLayout news_tv_none;
|
||||
|
||||
private List<ConcernInfo> concernList;
|
||||
private List<GameEntity> concernGameList;
|
||||
@ -88,7 +88,7 @@ public class News4FragmentAdapter extends
|
||||
RecyclerView recyclerView,
|
||||
ProgressBarCircularIndeterminate pbLoading,
|
||||
LinearLayout linearLayout,
|
||||
TextView textView,
|
||||
LinearLayout textView,
|
||||
boolean isLoad) {
|
||||
context = con;
|
||||
news_list = recyclerView;
|
||||
@ -433,7 +433,7 @@ public class News4FragmentAdapter extends
|
||||
holder.footerview_tv_loading.setBackgroundResource(R.drawable.border_blue_bg);
|
||||
int i = (int) (context.getResources().getDisplayMetrics().density * 5);
|
||||
holder.footerview_tv_loading.setPadding(i,i,i,i);
|
||||
holder.footerview_tv_loading.setTextColor(0xff1BA4FC);
|
||||
holder.footerview_tv_loading.setTextColor(context.getResources().getColor(R.color.theme));
|
||||
holder.itemView.setClickable(true);
|
||||
holder.itemView.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
||||
@ -186,7 +186,7 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
int downloadSize = DownloadManager.getInstance(getActivity()).getAll().size();
|
||||
if (downloadSize != 0) {
|
||||
downloadHint.setVisibility(View.VISIBLE);
|
||||
downloadHint.setText(downloadSize + "");
|
||||
downloadHint.setText(String.valueOf(downloadSize));
|
||||
int width = DisplayUtils.dip2px(getActivity(), 12);
|
||||
RelativeLayout.LayoutParams rparams = new RelativeLayout.LayoutParams(
|
||||
width, width);
|
||||
@ -253,7 +253,7 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
if (id == R.id.actionbar_notification) {
|
||||
DataUtils.onEvent(getActivity(), "主页", "关注图标");
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("location", "关注图标");
|
||||
map.put("createOn", System.currentTimeMillis() / 1000);
|
||||
map.put("page", "主页");
|
||||
@ -263,23 +263,17 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
} else if (id == R.id.actionbar_rl_download) {
|
||||
DataUtils.onEvent(getActivity(), "主页", "下载图标");
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("location", "下载图标");
|
||||
map.put("createOn", System.currentTimeMillis() / 1000);
|
||||
map.put("page", "主页");
|
||||
DataCollectionManager.onEvent(getActivity(), "click-item", map);
|
||||
|
||||
if (downloadHint != null
|
||||
&& downloadHint.getVisibility() == View.VISIBLE) {
|
||||
downloadHint.setVisibility(View.GONE);
|
||||
EventBus.getDefault().post(new EBTopState("隐藏", null));
|
||||
}
|
||||
startActivity(new Intent(getActivity(),
|
||||
DownloadManagerActivity.class));
|
||||
startActivity(new Intent(getActivity(), DownloadManagerActivity.class));
|
||||
} else if (id == R.id.actionbar_search_input) {
|
||||
DataUtils.onEvent(getActivity(), "主页", "搜索框");
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("location", "搜索框");
|
||||
map.put("createOn", System.currentTimeMillis() / 1000);
|
||||
map.put("page", "主页");
|
||||
@ -292,7 +286,7 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
} else if (id == R.id.actionbar_iv_search) {
|
||||
DataUtils.onEvent(getActivity(), "主页", "搜索图标");
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("location", "搜索图标");
|
||||
map.put("createOn", System.currentTimeMillis() / 1000);
|
||||
map.put("page", "主页");
|
||||
@ -335,37 +329,37 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
tvYuanchuang.setClickable(true);
|
||||
tvGonglve.setClickable(true);
|
||||
tvGuanzhu.setClickable(true);
|
||||
tvZixun.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
tvYuanchuang.setTextColor(0xFF333333);
|
||||
tvGonglve.setTextColor(0xFF333333);
|
||||
tvGuanzhu.setTextColor(0xFF333333);
|
||||
tvZixun.setTextColor(getResources().getColor(R.color.theme));
|
||||
tvYuanchuang.setTextColor(getResources().getColor(R.color.title));
|
||||
tvGonglve.setTextColor(getResources().getColor(R.color.title));
|
||||
tvGuanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
} else if (position == 1) {
|
||||
tvZixun.setClickable(true);
|
||||
tvYuanchuang.setClickable(false);
|
||||
tvGonglve.setClickable(true);
|
||||
tvGuanzhu.setClickable(true);
|
||||
tvZixun.setTextColor(0xFF333333);
|
||||
tvYuanchuang.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
tvGonglve.setTextColor(0xFF333333);
|
||||
tvGuanzhu.setTextColor(0xFF333333);
|
||||
tvZixun.setTextColor(getResources().getColor(R.color.title));
|
||||
tvYuanchuang.setTextColor(getResources().getColor(R.color.theme));
|
||||
tvGonglve.setTextColor(getResources().getColor(R.color.title));
|
||||
tvGuanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
} else if (position == 2) {
|
||||
tvZixun.setClickable(true);
|
||||
tvYuanchuang.setClickable(true);
|
||||
tvGonglve.setClickable(false);
|
||||
tvGuanzhu.setClickable(true);
|
||||
tvZixun.setTextColor(0xFF333333);
|
||||
tvYuanchuang.setTextColor(0xFF333333);
|
||||
tvGonglve.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
tvGuanzhu.setTextColor(0xFF333333);
|
||||
tvZixun.setTextColor(getResources().getColor(R.color.title));
|
||||
tvYuanchuang.setTextColor(getResources().getColor(R.color.title));
|
||||
tvGonglve.setTextColor(getResources().getColor(R.color.theme));
|
||||
tvGuanzhu.setTextColor(getResources().getColor(R.color.title));
|
||||
}else if (position == 3){
|
||||
tvZixun.setClickable(true);
|
||||
tvYuanchuang.setClickable(true);
|
||||
tvGonglve.setClickable(true);
|
||||
tvGuanzhu.setClickable(false);
|
||||
tvZixun.setTextColor(0xFF333333);
|
||||
tvYuanchuang.setTextColor(0xFF333333);
|
||||
tvGonglve.setTextColor(0xFF333333);
|
||||
tvGuanzhu.setTextColor(getResources().getColor(R.color.theme_colors));
|
||||
tvZixun.setTextColor(getResources().getColor(R.color.title));
|
||||
tvYuanchuang.setTextColor(getResources().getColor(R.color.title));
|
||||
tvGonglve.setTextColor(getResources().getColor(R.color.title));
|
||||
tvGuanzhu.setTextColor(getResources().getColor(R.color.theme));
|
||||
}
|
||||
|
||||
}
|
||||
@ -407,7 +401,7 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
int downloadSize = DownloadManager.getInstance(getActivity()).getAll().size();
|
||||
if (type == 1 && downloadSize == 0) {
|
||||
downloadHint.setVisibility(View.VISIBLE);
|
||||
downloadHint.setText((downloadSize + type) + "");
|
||||
downloadHint.setText(String.valueOf(downloadSize + type));
|
||||
int width = DisplayUtils.dip2px(getActivity(), 12);
|
||||
RelativeLayout.LayoutParams rparams = new RelativeLayout.LayoutParams(
|
||||
width, width);
|
||||
@ -432,7 +426,7 @@ public class NewsFragment extends Fragment implements View.OnClickListener, View
|
||||
}
|
||||
} else if (downloadSize != 0) {
|
||||
downloadHint.setVisibility(View.VISIBLE);
|
||||
downloadHint.setText((downloadSize + type) + "");
|
||||
downloadHint.setText(String.valueOf(downloadSize + type));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +95,9 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
|
||||
dis = outMetrics.widthPixels / 4 + DisplayUtils.dip2px(getActivity(), 20);
|
||||
|
||||
me_tv_top_install.setTextColor(0xFF1BA4FC);
|
||||
me_tv_top_install.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
me_tv_top_install.setClickable(false);
|
||||
me_tv_top_concern.setTextColor(0xFF333333);
|
||||
me_tv_top_concern.setTextColor(getActivity().getResources().getColor(R.color.title));
|
||||
me_tv_top_concern.setClickable(true);
|
||||
|
||||
me_ll_topbar = (LinearLayout) view.findViewById(R.id.me_ll_topbar);
|
||||
@ -121,9 +121,9 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
rparams4.rightMargin = width - DisplayUtils.dip2px(getActivity(), 10);
|
||||
me_tv_topbar_concern.setLayoutParams(rparams4);
|
||||
|
||||
me_tv_top_install.setTextColor(0xFF1BA4FC);
|
||||
me_tv_top_install.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
me_tv_top_install.setClickable(false);
|
||||
me_tv_top_concern.setTextColor(0xFF333333);
|
||||
me_tv_top_concern.setTextColor(getActivity().getResources().getColor(R.color.title));
|
||||
me_tv_top_concern.setClickable(true);
|
||||
|
||||
me_topbar_slide_line = view.findViewById(R.id.me_topbar_slide_line);
|
||||
@ -170,14 +170,14 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
}
|
||||
previous = 0;
|
||||
|
||||
me_tv_top_install.setTextColor(0xFF1BA4FC);
|
||||
me_tv_top_install.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
me_tv_top_install.setClickable(false);
|
||||
me_tv_top_concern.setTextColor(0xFF333333);
|
||||
me_tv_top_concern.setTextColor(getActivity().getResources().getColor(R.color.title));
|
||||
me_tv_top_concern.setClickable(true);
|
||||
|
||||
me_tv_topbar_install.setTextColor(0xFF1BA4FC);
|
||||
me_tv_topbar_install.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
me_tv_topbar_install.setClickable(false);
|
||||
me_tv_topbar_concern.setTextColor(0xFF333333);
|
||||
me_tv_topbar_concern.setTextColor(getActivity().getResources().getColor(R.color.title));
|
||||
me_tv_topbar_concern.setClickable(true);
|
||||
} else {
|
||||
if (me_ll_topbar.getVisibility() == View.VISIBLE) {
|
||||
@ -185,14 +185,14 @@ public class PersonalFragment extends Fragment implements View.OnClickListener,
|
||||
}
|
||||
previous = 1;
|
||||
|
||||
me_tv_top_install.setTextColor(0xFF333333);
|
||||
me_tv_top_install.setTextColor(getActivity().getResources().getColor(R.color.title));
|
||||
me_tv_top_install.setClickable(true);
|
||||
me_tv_top_concern.setTextColor(0xFF1BA4FC);
|
||||
me_tv_top_concern.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
me_tv_top_concern.setClickable(false);
|
||||
|
||||
me_tv_topbar_install.setTextColor(0xFF333333);
|
||||
me_tv_topbar_install.setTextColor(getActivity().getResources().getColor(R.color.title));
|
||||
me_tv_topbar_install.setClickable(true);
|
||||
me_tv_topbar_concern.setTextColor(0xFF1BA4FC);
|
||||
me_tv_topbar_concern.setTextColor(getActivity().getResources().getColor(R.color.theme));
|
||||
me_tv_topbar_concern.setClickable(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,13 +408,13 @@ public class PersonalFragmentAdapter extends
|
||||
holder.me_tv_download.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.me_tv_download.setVisibility(View.VISIBLE);
|
||||
holder.me_tv_download.setText("" + downloadSize);
|
||||
holder.me_tv_download.setText(String.valueOf(downloadSize));
|
||||
}
|
||||
if (updateSize == 0) {
|
||||
holder.me_tv_update.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.me_tv_update.setVisibility(View.VISIBLE);
|
||||
holder.me_tv_update.setText("" + updateSize);
|
||||
holder.me_tv_update.setText(String.valueOf(updateSize));
|
||||
}
|
||||
} else if (viewHolder instanceof MultiFunctionViewHolder) {
|
||||
MultiFunctionViewHolder holder = (MultiFunctionViewHolder) viewHolder;
|
||||
@ -434,15 +434,15 @@ public class PersonalFragmentAdapter extends
|
||||
holder.rootView.setClickable(false);
|
||||
if (isLoading) {
|
||||
holder.personal_ll_loading.setVisibility(View.VISIBLE);
|
||||
holder.personal_tv_none.setVisibility(View.GONE);
|
||||
holder.reuse_none_data.setVisibility(View.GONE);
|
||||
holder.personal_rl_label.setVisibility(View.GONE);
|
||||
} else if (gameDetailedList.isEmpty()) {
|
||||
holder.personal_ll_loading.setVisibility(View.GONE);
|
||||
holder.personal_tv_none.setVisibility(View.VISIBLE);
|
||||
holder.reuse_none_data.setVisibility(View.VISIBLE);
|
||||
holder.personal_rl_label.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.personal_ll_loading.setVisibility(View.GONE);
|
||||
holder.personal_tv_none.setVisibility(View.GONE);
|
||||
holder.reuse_none_data.setVisibility(View.GONE);
|
||||
holder.personal_rl_label.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
@ -714,7 +714,7 @@ public class PersonalFragmentAdapter extends
|
||||
public class MultiFunctionViewHolder extends ViewHolder {
|
||||
|
||||
private LinearLayout personal_ll_loading;
|
||||
private TextView personal_tv_none;
|
||||
private LinearLayout reuse_none_data;
|
||||
private RelativeLayout personal_rl_label;
|
||||
private ContentLoadingProgressBar personal_progressbar;
|
||||
private TextView personal_loading;
|
||||
@ -726,8 +726,8 @@ public class PersonalFragmentAdapter extends
|
||||
rootView = convertView;
|
||||
personal_ll_loading = (LinearLayout) convertView
|
||||
.findViewById(R.id.personal_ll_loading);
|
||||
personal_tv_none = (TextView) convertView
|
||||
.findViewById(R.id.personal_tv_none);
|
||||
reuse_none_data = (LinearLayout) convertView
|
||||
.findViewById(R.id.reuse_none_data);
|
||||
personal_rl_label = (RelativeLayout) convertView
|
||||
.findViewById(R.id.personal_rl_label);
|
||||
personal_progressbar = (ContentLoadingProgressBar) convertView
|
||||
@ -1130,7 +1130,7 @@ public class PersonalFragmentAdapter extends
|
||||
fragmentActivity).getPlatformColor(
|
||||
pList.get(location).getPlatform()));
|
||||
GradientDrawable gradientDrawable = new GradientDrawable();
|
||||
gradientDrawable.setColor(0xffffffff);
|
||||
gradientDrawable.setColor(Color.WHITE);
|
||||
gradientDrawable.setStroke(
|
||||
DisplayUtils.dip2px(fragmentActivity, 1), color);
|
||||
int padding = DisplayUtils.dip2px(fragmentActivity, 1);
|
||||
|
||||
@ -9,7 +9,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gh.base.AppController;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -23,8 +22,8 @@ public class SearchDetailFragment extends Fragment {
|
||||
private View view;
|
||||
private RecyclerView search_detail;
|
||||
private LinearLayout search_loading;
|
||||
private TextView search_nogame;
|
||||
private LinearLayout search_connection;
|
||||
private LinearLayout reuse_none_date;
|
||||
private LinearLayout reuse_no_connection;
|
||||
|
||||
private DismissEntity dismissEntity;
|
||||
|
||||
@ -37,8 +36,8 @@ public class SearchDetailFragment extends Fragment {
|
||||
view = View.inflate(getActivity(), R.layout.fm_search, null);
|
||||
|
||||
search_loading = (LinearLayout) view.findViewById(R.id.search_gamedetails_ll_loading);
|
||||
search_nogame = (TextView) view.findViewById(R.id.search_gamedetails_tv_nogame);
|
||||
search_connection = (LinearLayout) view.findViewById(R.id.search_gamedetails_ll_connection);
|
||||
reuse_none_date = (LinearLayout) view.findViewById(R.id.reuse_none_data);
|
||||
reuse_no_connection = (LinearLayout) view.findViewById(R.id.reuse_no_connection);
|
||||
|
||||
dismissEntity = new DismissEntity(false);
|
||||
|
||||
@ -46,7 +45,7 @@ public class SearchDetailFragment extends Fragment {
|
||||
search_detail.setHasFixedSize(true);
|
||||
search_detail.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
search_detail.setAdapter(new SearchDetailFragmentAdapter(getActivity(), search_detail,
|
||||
search_loading, search_nogame, search_connection, key, dismissEntity));
|
||||
search_loading, reuse_none_date, reuse_no_connection, key, dismissEntity));
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
@ -73,7 +72,7 @@ public class SearchDetailFragment extends Fragment {
|
||||
|
||||
public void search(String key) {
|
||||
search_detail.setAdapter(new SearchDetailFragmentAdapter(getActivity(), search_detail,
|
||||
search_loading, search_nogame, search_connection, key, dismissEntity));
|
||||
search_loading, reuse_none_date, reuse_no_connection, key, dismissEntity));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,8 +83,8 @@ public class SearchDetailFragment extends Fragment {
|
||||
view = null;
|
||||
search_detail = null;
|
||||
search_loading = null;
|
||||
search_nogame = null;
|
||||
search_connection = null;
|
||||
reuse_none_date = null;
|
||||
reuse_no_connection = null;
|
||||
dismissEntity = null;
|
||||
key = null;
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
@ -49,7 +48,7 @@ public class SearchDetailFragmentAdapter extends RecyclerView.Adapter<GameNormal
|
||||
|
||||
private RecyclerView search_detail;
|
||||
private LinearLayout search_loading;
|
||||
private TextView search_nogame;
|
||||
private LinearLayout search_nogame;
|
||||
private LinearLayout search_connection;
|
||||
|
||||
private List<GameEntity> gameList;
|
||||
@ -59,7 +58,7 @@ public class SearchDetailFragmentAdapter extends RecyclerView.Adapter<GameNormal
|
||||
public SearchDetailFragmentAdapter(Context context,
|
||||
RecyclerView search_detail,
|
||||
LinearLayout search_loading,
|
||||
TextView search_nogame,
|
||||
LinearLayout search_nogame,
|
||||
LinearLayout search_connection,
|
||||
String key,
|
||||
DismissEntity dEntity) {
|
||||
|
||||
@ -9,7 +9,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gh.base.AppController;
|
||||
import com.gh.gamecenter.R;
|
||||
@ -33,8 +32,8 @@ public class SearchGameListFragment extends Fragment {
|
||||
view = View.inflate(getActivity(), R.layout.fm_search, null);
|
||||
|
||||
LinearLayout search_loading = (LinearLayout) view.findViewById(R.id.search_gamedetails_ll_loading);
|
||||
TextView search_nogame = (TextView) view.findViewById(R.id.search_gamedetails_tv_nogame);
|
||||
LinearLayout search_connection = (LinearLayout) view.findViewById(R.id.search_gamedetails_ll_connection);
|
||||
LinearLayout search_nogame = (LinearLayout) view.findViewById(R.id.reuse_none_data);
|
||||
LinearLayout search_connection = (LinearLayout) view.findViewById(R.id.reuse_no_connection);
|
||||
|
||||
dismissEntity = new DismissEntity(false);
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
@ -39,7 +38,7 @@ public class SearchGameListFragmentAdapter extends RecyclerView.Adapter<CardList
|
||||
|
||||
private RecyclerView search_detail;
|
||||
private LinearLayout search_loading;
|
||||
private TextView search_nogame;
|
||||
private LinearLayout search_nogame;
|
||||
private LinearLayout search_connection;
|
||||
|
||||
private DismissEntity dismissEntity;
|
||||
@ -51,7 +50,7 @@ public class SearchGameListFragmentAdapter extends RecyclerView.Adapter<CardList
|
||||
public SearchGameListFragmentAdapter(Context context,
|
||||
RecyclerView search_detail,
|
||||
LinearLayout search_loading,
|
||||
TextView search_nogame,
|
||||
LinearLayout search_nogame,
|
||||
LinearLayout search_connection,
|
||||
String key,
|
||||
DismissEntity dEntity) {
|
||||
|
||||
@ -11,6 +11,7 @@ package onekeyshare.themes.classic;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.widget.ImageView;
|
||||
@ -41,7 +42,7 @@ public class FriendListItem extends LinearLayout {
|
||||
int itemPadding = (int) (ratio * DESIGN_ITEM_PADDING);
|
||||
setPadding(itemPadding, 0, itemPadding, 0);
|
||||
setMinimumHeight((int) (ratio * DESIGN_ITEM_HEIGHT));
|
||||
setBackgroundColor(0xffffffff);
|
||||
setBackgroundColor(Color.WHITE);
|
||||
|
||||
ivCheck = new ImageView(context);
|
||||
LayoutParams lp = new LayoutParams(
|
||||
|
||||
@ -10,6 +10,7 @@ package onekeyshare.themes.classic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.view.View;
|
||||
|
||||
@ -50,7 +51,7 @@ public class IndicatorView extends View {
|
||||
float left = (getWidth() - windowWidth) / 2;
|
||||
float cy = height / 2;
|
||||
|
||||
canvas.drawColor(0xffffffff);
|
||||
canvas.drawColor(Color.WHITE);
|
||||
Paint paint = new Paint();
|
||||
paint.setAntiAlias(true);
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
@ -10,6 +10,7 @@ package onekeyshare.themes.classic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.view.View;
|
||||
|
||||
@ -37,7 +38,7 @@ public class XView extends View {
|
||||
paint = new Paint();
|
||||
paint.setAntiAlias(true);
|
||||
paint.setStrokeWidth(3f * ratio);
|
||||
paint.setColor(0xffffffff);
|
||||
paint.setColor(Color.WHITE);
|
||||
float left = 8f * ratio;
|
||||
canvas.drawLine(width + left, left, getWidth() - left, width - left, paint);
|
||||
canvas.drawLine(width + left, width - left, getWidth() - left, left, paint);
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
package onekeyshare.themes.classic.land;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.TypedValue;
|
||||
@ -66,7 +67,7 @@ public class EditPageLand extends EditPage implements OnClickListener, TextWatch
|
||||
initTitle(rlTitle, ratio);
|
||||
|
||||
RelativeLayout rlBody = new RelativeLayout(activity);
|
||||
rlBody.setBackgroundColor(0xffffffff);
|
||||
rlBody.setBackgroundColor(Color.WHITE);
|
||||
lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
|
||||
llPage.addView(rlBody, lp);
|
||||
initBody(rlBody, ratio);
|
||||
@ -179,7 +180,7 @@ public class EditPageLand extends EditPage implements OnClickListener, TextWatch
|
||||
private void initBottom(LinearLayout llBottom, float ratio) {
|
||||
LinearLayout llAt = new LinearLayout(activity);
|
||||
llAt.setPadding(0, 0, 0, 5);
|
||||
llAt.setBackgroundColor(0xffffffff);
|
||||
llAt.setBackgroundColor(Color.WHITE);
|
||||
int bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio);
|
||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, bottomHeight);
|
||||
llBottom.addView(llAt, lp);
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
package onekeyshare.themes.classic.port;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
@ -64,7 +65,7 @@ public class EditPagePort extends EditPage {
|
||||
initTitle(rlTitle, ratio);
|
||||
|
||||
RelativeLayout rlBody = new RelativeLayout(activity);
|
||||
rlBody.setBackgroundColor(0xffffffff);
|
||||
rlBody.setBackgroundColor(Color.WHITE);
|
||||
lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
|
||||
llPage.addView(rlBody, lp);
|
||||
initBody(rlBody, ratio);
|
||||
@ -174,7 +175,7 @@ public class EditPagePort extends EditPage {
|
||||
private void initBottom(LinearLayout llBottom, float ratio) {
|
||||
LinearLayout llAt = new LinearLayout(activity);
|
||||
llAt.setPadding(0, 0, 0, 5);
|
||||
llAt.setBackgroundColor(0xffffffff);
|
||||
llAt.setBackgroundColor(Color.WHITE);
|
||||
int bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio);
|
||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, bottomHeight);
|
||||
llBottom.addView(llAt, lp);
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/reuse_blank_hint.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable-xhdpi/reuse_network_error.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<corners android:radius="3dip" />
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="#FFFFFF" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
|
||||
<stroke
|
||||
android:width="0.6dp"
|
||||
android:color="@color/theme_colors" />
|
||||
android:color="@color/theme" />
|
||||
|
||||
<!--<corners android:radius="2dp" />-->
|
||||
|
||||
<solid android:color="#00ffffff" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
|
||||
</shape>
|
||||
@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<corners android:radius="3dp" />
|
||||
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
|
||||
<stroke
|
||||
android:width="0.6dp"
|
||||
android:color="#05c400" />
|
||||
android:color="@color/tag_green" />
|
||||
|
||||
<!--<corners android:radius="2dp" />-->
|
||||
|
||||
<solid android:color="#00ffffff"/>
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
</shape>
|
||||
@ -1,5 +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="#ffffff" />
|
||||
<stroke android:width="1dp" android:color="@color/platform_normal"/>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<stroke android:width="1dp" android:color="@color/theme"/>
|
||||
|
||||
</shape>
|
||||
|
||||
@ -8,6 +8,6 @@
|
||||
|
||||
<!--<corners android:radius="2dp" />-->
|
||||
|
||||
<solid android:color="#00ffffff" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
|
||||
</shape>
|
||||
@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<stroke
|
||||
android:width="0.6dp"
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<stroke
|
||||
android:width="0.6dp"
|
||||
android:color="#666666" />
|
||||
android:color="@color/content" />
|
||||
|
||||
<corners android:radius="2dp" />
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@color/listview_item_down" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/listview_item_down" android:state_focused="true"/>
|
||||
<item android:drawable="@color/select" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/select" android:state_focused="true"/>
|
||||
|
||||
</selector>
|
||||
@ -3,16 +3,16 @@
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="@color/theme_colors" />
|
||||
<solid android:color="@color/theme" />
|
||||
|
||||
<corners android:radius="14.25dp" />
|
||||
<corners android:radius="999dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#88666666" />
|
||||
|
||||
<corners android:radius="14.25dp" />
|
||||
<corners android:radius="999dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<solid android:color="@color/theme_colors" />
|
||||
<solid android:color="@color/theme" />
|
||||
|
||||
<corners android:radius="999dp" />
|
||||
|
||||
|
||||