18 | * CrateTime:2016-12-15 11:11 19 | *
20 | * Description:分享适配器
21 | */
22 | public abstract class ShareAdapter extends BaseAdapter
6 | * CrateTime:2016-12-15 11:06
7 | *
8 | * Description:分享渠道
9 | */
10 | public class ShareChannel {
11 |
12 | private int icon;
13 | private String name;
14 |
15 | public ShareChannel(int icon, String name) {
16 | this.icon = icon;
17 | this.name = name;
18 | }
19 |
20 | public int getIcon() {
21 | return icon;
22 | }
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stx/xhb/dmgameapp/utils/JsonResponse.java:
--------------------------------------------------------------------------------
1 | package com.stx.xhb.dmgameapp.utils;
2 |
3 | import com.stx.xhb.dmgameapp.config.Constants;
4 |
5 | import org.json.JSONArray;
6 | import org.json.JSONObject;
7 |
8 | /**
9 | * @author Mr.xiao
10 | */
11 | public class JsonResponse extends JsonParser {
12 |
13 | private int code=0;
14 | private String msg="";
15 | private JSONArray rankkeyList = new JSONArray();
16 | private int totalrow = 0;
17 | private JSONObject object = new JSONObject();
18 |
19 | public JsonResponse(JSONObject jsonObject) {
20 | super(jsonObject);
21 | msg = getString("msg");
22 | code = getInt("code");
23 | rankkeyList = getJSONArray("rankkey");
24 | totalrow = getInt("totalrow");
25 | object = getJSONObject("html");
26 | }
27 |
28 | public JSONArray getDataList() {
29 | return rankkeyList;
30 | }
31 |
32 | public JSONObject getObject() {
33 | return object;
34 | }
35 |
36 | public int getTotalCount() {
37 | return totalrow;
38 | }
39 |
40 | public String getMsg() {
41 | return msg;
42 | }
43 |
44 | public boolean isSuccess() {
45 | return code== Constants.SERVER_SUCCESS;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stx/xhb/dmgameapp/utils/RequestBodyHelper.java:
--------------------------------------------------------------------------------
1 | package com.stx.xhb.dmgameapp.utils;
2 |
3 | import android.support.annotation.Nullable;
4 | import android.util.Log;
5 |
6 | import com.stx.core.utils.GsonUtil;
7 | import com.stx.xhb.dmgameapp.data.body.NewsAboutContent;
8 |
9 | import okhttp3.RequestBody;
10 |
11 | /**
12 | * Author: Mr.xiao on 2018/9/6
13 | *
14 | * @mail:xhb_199409@163.com
15 | * @github:https://github.com/xiaohaibin
16 | * @describe: RequestBody 工具类
17 | */
18 | public class RequestBodyHelper {
19 |
20 | public static RequestBody creatRequestBody(@Nullable Object src) {
21 | return RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), GsonUtil.newGson().toJson(src));
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stx/xhb/dmgameapp/utils/ToastUtil.java:
--------------------------------------------------------------------------------
1 | package com.stx.xhb.dmgameapp.utils;
2 |
3 | import android.widget.Toast;
4 |
5 | import com.stx.xhb.dmgameapp.DmgApplication;
6 |
7 | /**
8 | * @author Mr.xiao
9 | */
10 | public class ToastUtil {
11 |
12 | /**
13 | * @param charSequence 显示文字
14 | */
15 | public static void show(CharSequence charSequence) {
16 | show(charSequence, Toast.LENGTH_SHORT);
17 | }
18 |
19 | /**
20 | * @param charSequence 显示文字
21 | * @param duration 显示时长 Toast.LENGTH_LONG/LENGTH_SHORT
22 | */
23 | public static void show(CharSequence charSequence, int duration) {
24 | DmgApplication.ToastManager.instance.show(charSequence, duration);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stx/xhb/dmgameapp/web/MyWebViewClient.java:
--------------------------------------------------------------------------------
1 | package com.stx.xhb.dmgameapp.web;
2 |
3 | import android.graphics.Bitmap;
4 | import android.webkit.WebResourceRequest;
5 | import android.webkit.WebView;
6 | import android.webkit.WebViewClient;
7 |
8 |
9 | /**
10 | *
11 | * author : zhaolin
12 | * time : 2017/07/18
13 | * desc :
14 | *
15 | */
16 | public class MyWebViewClient extends WebViewClient {
17 |
18 |
19 | @Override
20 | public void onPageFinished(WebView view, String url) {
21 | view.getSettings().setJavaScriptEnabled(true);
22 | super.onPageFinished(view, url);
23 | // html加载完成之后,添加监听图片的点击js函数
24 | // WebHtmlUtil.clickImage(view);
25 |
26 | }
27 |
28 | @Override
29 | public void onPageStarted(WebView view, String url, Bitmap favicon) {
30 | view.getSettings().setJavaScriptEnabled(true);
31 | super.onPageStarted(view, url, favicon);
32 | }
33 |
34 | @Override
35 | public boolean shouldOverrideUrlLoading(WebView view, String url) {
36 | try {
37 | // WebViewFragment.openUrl(view.getContext(), "", UrlUtil.splicing(view.getContext(),url), Constants.SHARE_NEWS_CONTENT);
38 | } catch (Exception e) {
39 | e.printStackTrace();
40 | }
41 | return true;
42 | }
43 |
44 | @Override
45 | public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
46 | return super.shouldOverrideUrlLoading(view, request);
47 | }
48 |
49 | @Override
50 | public void onReceivedLoginRequest(WebView view, String realm, String account, String args) {
51 | super.onReceivedLoginRequest(view, realm, account, args);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stx/xhb/dmgameapp/wxapi/WXEntryActivity.java:
--------------------------------------------------------------------------------
1 | package com.stx.xhb.dmgameapp.wxapi;
2 |
3 |
4 | import com.umeng.weixin.callback.WXCallbackActivity;
5 |
6 |
7 | public class WXEntryActivity extends WXCallbackActivity {
8 |
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/umeng_socialize_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |