();
47 | JsonArray array = new JsonParser().parse(json).getAsJsonArray();
48 | for(final JsonElement elem : array){
49 | list.add(gson.fromJson(elem, cls));
50 | }
51 | return list ;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/raider_header_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
20 |
21 |
28 |
29 |
34 |
35 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/vp_home_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
16 |
24 |
25 |
26 |
27 |
28 |
29 |
35 |
36 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/PullToRefresh/src/main/java/com/handmark/pulltorefresh/library/internal/EmptyViewMethodAccessor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2011, 2012 Chris Banes.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *******************************************************************************/
16 | package com.handmark.pulltorefresh.library.internal;
17 |
18 | import android.view.View;
19 |
20 | /**
21 | * Interface that allows PullToRefreshBase to hijack the call to
22 | * AdapterView.setEmptyView()
23 | *
24 | * @author chris
25 | */
26 | public interface EmptyViewMethodAccessor {
27 |
28 | /**
29 | * Calls upto AdapterView.setEmptyView()
30 | *
31 | * @param emptyView - to set as Empty View
32 | */
33 | public void setEmptyViewInternal(View emptyView);
34 |
35 | /**
36 | * Should call PullToRefreshBase.setEmptyView() which will then
37 | * automatically call through to setEmptyViewInternal()
38 | *
39 | * @param emptyView - to set as Empty View
40 | */
41 | public void setEmptyView(View emptyView);
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/raider_header_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
17 |
18 |
26 |
27 |
33 |
34 |
35 |
36 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/sharesdk/demo/wxapi/WXEntryActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 官网地站:http://www.mob.com
3 | * 技术支持QQ: 4006852216
4 | * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
5 | *
6 | * Copyright (c) 2013年 mob.com. All rights reserved.
7 | */
8 |
9 | package cn.sharesdk.demo.wxapi;
10 |
11 | import android.content.Intent;
12 | import android.widget.Toast;
13 | import cn.sharesdk.wechat.utils.WXAppExtendObject;
14 | import cn.sharesdk.wechat.utils.WXMediaMessage;
15 | import cn.sharesdk.wechat.utils.WechatHandlerActivity;
16 |
17 | /** 微信客户端回调activity示例 */
18 | public class WXEntryActivity extends WechatHandlerActivity {
19 |
20 | /**
21 | * 处理微信发出的向第三方应用请求app message
22 | *
23 | * 在微信客户端中的聊天页面有“添加工具”,可以将本应用的图标添加到其中
24 | * 此后点击图标,下面的代码会被执行。Demo仅仅只是打开自己而已,但你可
25 | * 做点其他的事情,包括根本不打开任何页面
26 | */
27 | public void onGetMessageFromWXReq(WXMediaMessage msg) {
28 | if (msg != null) {
29 | Intent iLaunchMyself = getPackageManager().getLaunchIntentForPackage(getPackageName());
30 | startActivity(iLaunchMyself);
31 | }
32 | }
33 |
34 | /**
35 | * 处理微信向第三方应用发起的消息
36 | *
37 | * 此处用来接收从微信发送过来的消息,比方说本demo在wechatpage里面分享
38 | * 应用时可以不分享应用文件,而分享一段应用的自定义信息。接受方的微信
39 | * 客户端会通过这个方法,将这个信息发送回接收方手机上的本demo中,当作
40 | * 回调。
41 | *
42 | * 本Demo只是将信息展示出来,但你可做点其他的事情,而不仅仅只是Toast
43 | */
44 | public void onShowMessageFromWXReq(WXMediaMessage msg) {
45 | if (msg != null && msg.mediaObject != null
46 | && (msg.mediaObject instanceof WXAppExtendObject)) {
47 | WXAppExtendObject obj = (WXAppExtendObject) msg.mediaObject;
48 | Toast.makeText(this, obj.extInfo, Toast.LENGTH_SHORT).show();
49 | }
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dllo/giftssayingapp/hotspot/main/ItemActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dllo.giftssayingapp.hotspot.main;
2 |
3 | import android.content.Intent;
4 | import android.util.Log;
5 | import android.view.KeyEvent;
6 | import android.webkit.WebSettings;
7 | import android.webkit.WebView;
8 | import android.webkit.WebViewClient;
9 |
10 | import com.example.dllo.giftssayingapp.R;
11 | import com.example.dllo.giftssayingapp.base.BaseActivity;
12 |
13 | public class ItemActivity extends BaseActivity {
14 |
15 |
16 | private WebView webView;
17 |
18 | @Override
19 | protected int setLayout() {
20 | return R.layout.activity_recommenditem;
21 | }
22 |
23 | @Override
24 | protected void initView() {
25 | webView = bindView(R.id.recommend_item);
26 | }
27 |
28 | @Override
29 | protected void initData() {
30 | Intent intent = getIntent();
31 | String url = intent.getStringExtra("purchase_url");
32 | webView.loadUrl(url);
33 |
34 | String purchase_url = intent.getStringExtra("url");
35 | webView.loadUrl(purchase_url);
36 |
37 | WebSettings webSettings = webView.getSettings();
38 | webSettings.setJavaScriptEnabled(true);
39 | webView.setWebViewClient(new WebViewClient());
40 |
41 | }
42 |
43 | //按返回键时, 不退出程序而是返回上一浏览页面
44 | @Override
45 | public boolean onKeyDown(int keyCode, KeyEvent event) {
46 | if (keyCode == KeyEvent.KEYCODE_BACK && webView.canGoBack()){
47 | webView.goBack();
48 | Log.d("ItemActivity", "000000000000");
49 | return true;
50 | }
51 | return super.onKeyDown(keyCode, event);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dllo/giftssayingapp/base/BaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.dllo.giftssayingapp.base;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v4.app.Fragment;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | /**
12 | * Created by dllo on 16/9/19.
13 | */
14 | public abstract class BaseFragment extends Fragment {
15 | protected Context context;
16 |
17 | @Override
18 | public void onAttach(Context context) {
19 | super.onAttach(context);
20 | this.context = context;
21 | }
22 |
23 | @Nullable
24 | @Override
25 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
26 | return inflater.inflate(setLayout(),container,false);
27 | }
28 | protected abstract int setLayout();
29 |
30 |
31 | @Override
32 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
33 | super.onViewCreated(view, savedInstanceState);
34 | initView();
35 | }
36 | protected abstract void initView();
37 |
38 | @Override
39 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
40 | super.onActivityCreated(savedInstanceState);
41 | initData();
42 | }
43 | protected abstract void initData();
44 |
45 | protected T bindView(int id){
46 | return (T) getView().findViewById(id);
47 | }
48 | // protected T bindView(int id, View view){
49 | // return (T) view.findViewById(id);
50 | // }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/sharesdk/onekeyshare/themes/classic/PicViewerPage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 官网地站:http://www.mob.com
3 | * 技术支持QQ: 4006852216
4 | * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
5 | *
6 | * Copyright (c) 2013年 mob.com. All rights reserved.
7 | */
8 |
9 | package cn.sharesdk.onekeyshare.themes.classic;
10 |
11 | import android.graphics.Bitmap;
12 | import android.graphics.drawable.ColorDrawable;
13 | import android.view.ViewTreeObserver.OnGlobalLayoutListener;
14 | import android.widget.ImageView.ScaleType;
15 | import cn.sharesdk.onekeyshare.OnekeySharePage;
16 | import cn.sharesdk.onekeyshare.OnekeyShareThemeImpl;
17 |
18 | import com.mob.tools.gui.ScaledImageView;
19 |
20 | /** 图片浏览的视图类 */
21 | public class PicViewerPage extends OnekeySharePage implements OnGlobalLayoutListener {
22 | private Bitmap pic;
23 | /** 图片浏览的缩放控件 */
24 | private ScaledImageView sivViewer;
25 |
26 | public PicViewerPage(OnekeyShareThemeImpl impl) {
27 | super(impl);
28 | }
29 |
30 | /** 设置图片用于浏览 */
31 | public void setImageBitmap(Bitmap pic) {
32 | this.pic = pic;
33 | }
34 |
35 | public void onCreate() {
36 | activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
37 |
38 | sivViewer = new ScaledImageView(activity);
39 | sivViewer.setScaleType(ScaleType.MATRIX);
40 | activity.setContentView(sivViewer);
41 | if (pic != null) {
42 | sivViewer.getViewTreeObserver().addOnGlobalLayoutListener(this);
43 | }
44 | }
45 |
46 | public void onGlobalLayout() {
47 | sivViewer.getViewTreeObserver().removeGlobalOnLayoutListener(this);
48 | sivViewer.post(new Runnable() {
49 | public void run() {
50 | sivViewer.setBitmap(pic);
51 | }
52 | });
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/import-summary.txt:
--------------------------------------------------------------------------------
1 | ECLIPSE ANDROID PROJECT IMPORT SUMMARY
2 | ======================================
3 |
4 | Ignored Files:
5 | --------------
6 | The following files were *not* copied into the new Gradle project; you
7 | should evaluate whether these are still needed in your project and if
8 | so manually move them:
9 |
10 | * .DS_Store
11 | * LICENSE
12 | * pom.xml
13 |
14 | Moved Files:
15 | ------------
16 | Android Gradle projects use a different directory structure than ADT
17 | Eclipse projects. Here's how the projects were restructured:
18 |
19 | * AndroidManifest.xml => PullToRefreshListView/src/main/AndroidManifest.xml
20 | * res/ => PullToRefreshListView/src/main/res/
21 | * src/ => PullToRefreshListView/src/main/java/
22 | * src/.DS_Store => PullToRefreshListView/src/main/resources/.DS_Store
23 | * src/com/.DS_Store => PullToRefreshListView/src/main/resources/com/.DS_Store
24 | * src/com/handmark/.DS_Store => PullToRefreshListView/src/main/resources/com/handmark/.DS_Store
25 | * src/com/handmark/pulltorefresh/.DS_Store => PullToRefreshListView/src/main/resources/com/handmark/pulltorefresh/.DS_Store
26 | * src/com/handmark/pulltorefresh/library/.DS_Store => PullToRefreshListView/src/main/resources/com/handmark/pulltorefresh/library/.DS_Store
27 |
28 | Next Steps:
29 | -----------
30 | You can now build the project. The Gradle project needs network
31 | connectivity to download dependencies.
32 |
33 | Bugs:
34 | -----
35 | If for some reason your project does not build, and you determine that
36 | it is due to a bug or limitation of the Eclipse to Gradle importer,
37 | please file a bug at http://b.android.com with category
38 | Component-Tools.
39 |
40 | (This import summary is for your information only, and can be deleted
41 | after import once you are satisfied with the results.)
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dllo/giftssayingapp/bean/HomeQueryBean.java:
--------------------------------------------------------------------------------
1 | package com.example.dllo.giftssayingapp.bean;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * Created by dllo on 16/9/30.
7 | */
8 | public class HomeQueryBean {
9 |
10 | /**
11 | * code : 200
12 | * data : {"hot_words":["钢笔","情侣","手机壳","手表","双肩包","宿舍","杯子","钱包","项链","手链","水杯","耳机"],"placeholder":"十一出游必备清单"}
13 | * message : OK
14 | */
15 |
16 | private int code;
17 | /**
18 | * hot_words : ["钢笔","情侣","手机壳","手表","双肩包","宿舍","杯子","钱包","项链","手链","水杯","耳机"]
19 | * placeholder : 十一出游必备清单
20 | */
21 |
22 | private DataBean data;
23 | private String message;
24 |
25 | public int getCode() {
26 | return code;
27 | }
28 |
29 | public void setCode(int code) {
30 | this.code = code;
31 | }
32 |
33 | public DataBean getData() {
34 | return data;
35 | }
36 |
37 | public void setData(DataBean data) {
38 | this.data = data;
39 | }
40 |
41 | public String getMessage() {
42 | return message;
43 | }
44 |
45 | public void setMessage(String message) {
46 | this.message = message;
47 | }
48 |
49 | public static class DataBean {
50 | private String placeholder;
51 | private List hot_words;
52 |
53 | public String getPlaceholder() {
54 | return placeholder;
55 | }
56 |
57 | public void setPlaceholder(String placeholder) {
58 | this.placeholder = placeholder;
59 | }
60 |
61 | public List getHot_words() {
62 | return hot_words;
63 | }
64 |
65 | public void setHot_words(List hot_words) {
66 | this.hot_words = hot_words;
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/sharesdk/onekeyshare/themes/classic/ClassicTheme.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 官网地站:http://www.mob.com
3 | * 技术支持QQ: 4006852216
4 | * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
5 | *
6 | * Copyright (c) 2013年 mob.com. All rights reserved.
7 | */
8 |
9 | package cn.sharesdk.onekeyshare.themes.classic;
10 |
11 | import android.content.Context;
12 | import android.content.res.Configuration;
13 | import cn.sharesdk.framework.Platform;
14 | import cn.sharesdk.framework.Platform.ShareParams;
15 | import cn.sharesdk.onekeyshare.OnekeyShareThemeImpl;
16 | import cn.sharesdk.onekeyshare.themes.classic.land.EditPageLand;
17 | import cn.sharesdk.onekeyshare.themes.classic.land.PlatformPageLand;
18 | import cn.sharesdk.onekeyshare.themes.classic.port.EditPagePort;
19 | import cn.sharesdk.onekeyshare.themes.classic.port.PlatformPagePort;
20 |
21 | /** 九宫格经典主题样式的实现类*/
22 | public class ClassicTheme extends OnekeyShareThemeImpl {
23 |
24 | /** 展示平台列表*/
25 | protected void showPlatformPage(Context context) {
26 | PlatformPage page;
27 | int orientation = context.getResources().getConfiguration().orientation;
28 | if (orientation == Configuration.ORIENTATION_PORTRAIT) {
29 | page = new PlatformPagePort(this);
30 | } else {
31 | page = new PlatformPageLand(this);
32 | }
33 | page.show(context, null);
34 | }
35 |
36 | /** 展示编辑界面*/
37 | protected void showEditPage(Context context, Platform platform, ShareParams sp) {
38 | EditPage page;
39 | int orientation = context.getResources().getConfiguration().orientation;
40 | if (orientation == Configuration.ORIENTATION_PORTRAIT) {
41 | page = new EditPagePort(this);
42 | } else {
43 | page = new EditPageLand(this);
44 | }
45 | page.setPlatform(platform);
46 | page.setShareParams(sp);
47 | page.show(context, null);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/PullToRefresh/src/main/java/com/handmark/pulltorefresh/library/ILoadingLayout.java:
--------------------------------------------------------------------------------
1 | package com.handmark.pulltorefresh.library;
2 |
3 | import android.graphics.Typeface;
4 | import android.graphics.drawable.Drawable;
5 |
6 | public interface ILoadingLayout {
7 |
8 | /**
9 | * Set the Last Updated Text. This displayed under the main label when
10 | * Pulling
11 | *
12 | * @param label - Label to set
13 | */
14 | public void setLastUpdatedLabel(CharSequence label);
15 |
16 | /**
17 | * Set the drawable used in the loading layout. This is the same as calling
18 | * setLoadingDrawable(drawable, Mode.BOTH)
19 | *
20 | * @param drawable - Drawable to display
21 | */
22 | public void setLoadingDrawable(Drawable drawable);
23 |
24 | /**
25 | * Set Text to show when the Widget is being Pulled
26 | * setPullLabel(releaseLabel, Mode.BOTH)
27 | *
28 | * @param pullLabel - CharSequence to display
29 | */
30 | public void setPullLabel(CharSequence pullLabel);
31 |
32 | /**
33 | * Set Text to show when the Widget is refreshing
34 | * setRefreshingLabel(releaseLabel, Mode.BOTH)
35 | *
36 | * @param refreshingLabel - CharSequence to display
37 | */
38 | public void setRefreshingLabel(CharSequence refreshingLabel);
39 |
40 | /**
41 | * Set Text to show when the Widget is being pulled, and will refresh when
42 | * released. This is the same as calling
43 | * setReleaseLabel(releaseLabel, Mode.BOTH)
44 | *
45 | * @param releaseLabel - CharSequence to display
46 | */
47 | public void setReleaseLabel(CharSequence releaseLabel);
48 |
49 | /**
50 | * Set's the Sets the typeface and style in which the text should be
51 | * displayed. Please see
52 | * {@link android.widget.TextView#setTypeface(Typeface)
53 | * TextView#setTypeface(Typeface)}.
54 | */
55 | public void setTextTypeface(Typeface tf);
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home_image_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
24 |
25 |
31 |
32 |
39 |
40 |
41 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home_image_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
13 |
19 |
20 |
23 |
24 |
30 |
31 |
38 |
39 |
40 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home_image_four.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
13 |
19 |
20 |
23 |
24 |
30 |
31 |
38 |
39 |
40 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home_image_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
13 |
19 |
20 |
23 |
24 |
30 |
31 |
38 |
39 |
40 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_home_image_five.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
17 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
43 |
44 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home_image_three.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
24 |
25 |
31 |
32 |
39 |
40 |
41 |
42 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/sharesdk/onekeyshare/themes/classic/IndicatorView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 官网地站:http://www.mob.com
3 | * 技术支持QQ: 4006852216
4 | * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
5 | *
6 | * Copyright (c) 2013年 mob.com. All rights reserved.
7 | */
8 |
9 | package cn.sharesdk.onekeyshare.themes.classic;
10 |
11 | import android.content.Context;
12 | import android.graphics.Canvas;
13 | import android.graphics.Paint;
14 | import android.view.View;
15 |
16 | /** 九宫格滑动时,下面显示的圆圈 */
17 | public class IndicatorView extends View {
18 | private static final int DESIGN_INDICATOR_RADIUS = 6;
19 | private static final int DESIGN_INDICATOR_DISTANCE = 14;
20 | private static final int DESIGN_BOTTOM_HEIGHT = 52;
21 | /** 九格宫有多少页数 */
22 | private int count;
23 | /** 当前显示的是九格宫中的第几页 */
24 | private int current;
25 |
26 | public IndicatorView(Context context) {
27 | super(context);
28 | }
29 |
30 | public void setScreenCount(int count) {
31 | this.count = count;
32 | }
33 |
34 | public void onScreenChange(int currentScreen, int lastScreen) {
35 | if (currentScreen != current) {
36 | current = currentScreen;
37 | postInvalidate();
38 | }
39 | }
40 |
41 | protected void onDraw(Canvas canvas) {
42 | if (count <= 1) {
43 | this.setVisibility(View.GONE);
44 | return;
45 | }
46 | float height = getHeight();
47 | float radius = height * DESIGN_INDICATOR_RADIUS / DESIGN_BOTTOM_HEIGHT;
48 | float distance = height * DESIGN_INDICATOR_DISTANCE / DESIGN_BOTTOM_HEIGHT;
49 | float windowWidth = radius * 2 * count + distance * (count - 1);
50 | float left = (getWidth() - windowWidth) / 2;
51 | float cy = height / 2;
52 |
53 | canvas.drawColor(0xffffffff);
54 | Paint paint = new Paint();
55 | paint.setAntiAlias(true);
56 | for (int i = 0; i < count; i++) {
57 | if (i == current) {
58 | paint.setColor(0xff5d71a0);
59 | } else {
60 | paint.setColor(0xffafb1b7);
61 | }
62 | float cx = left + (radius * 2 + distance) * i;
63 | canvas.drawCircle(cx, cy, radius, paint);
64 | }
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dllo/giftssayingapp/home/selection/HomeImageAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dllo.giftssayingapp.home.selection;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.PagerAdapter;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.ViewParent;
9 | import android.widget.ImageView;
10 |
11 | import com.example.dllo.giftssayingapp.R;
12 | import com.example.dllo.giftssayingapp.bean.HomeImageBean;
13 | import com.squareup.picasso.Picasso;
14 |
15 |
16 | /**
17 | * Created by dllo on 16/9/21.
18 | */
19 | public class HomeImageAdapter extends PagerAdapter {
20 | private HomeImageBean bean;
21 |
22 | public void setBean(HomeImageBean bean) {
23 | this.bean = bean;
24 | notifyDataSetChanged();
25 | }
26 |
27 | private Context context;
28 |
29 | public HomeImageAdapter(Context context) {
30 | this.context = context;
31 | }
32 |
33 |
34 |
35 | @Override
36 | public int getCount() {
37 | return bean == null ? 0 : Integer.MAX_VALUE;
38 | }
39 |
40 | @Override
41 | public boolean isViewFromObject(View view, Object object) {
42 | return view == object;
43 | }
44 |
45 | @Override
46 | public void destroyItem(ViewGroup container, int position, Object object) {
47 |
48 | }
49 |
50 | @Override
51 | public Object instantiateItem(ViewGroup container, int position) {
52 | View view = LayoutInflater.from(context).inflate(R.layout.item_home_image,null);
53 | ImageView image = (ImageView) view.findViewById(R.id.iv_home_image);
54 | Picasso.with(context).load(bean.getData().getBanners().get
55 | (position% bean.getData().getBanners().size()).getImage_url()).into(image);
56 | //如果View已经在之前添加到了一个父组件,则必须先remove,否则会抛出IllegalStateException。
57 | ViewParent vp = view.getParent();
58 | if (vp != null) {
59 | ViewGroup parent = (ViewGroup) vp;
60 | parent.removeAllViews();
61 | }
62 | container.addView(view);
63 | return view;
64 |
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dllo/giftssayingapp/home/selection/HomeItemActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dllo.giftssayingapp.home.selection;
2 |
3 | import android.content.Intent;
4 | import android.view.KeyEvent;
5 | import android.webkit.WebSettings;
6 | import android.webkit.WebView;
7 | import android.webkit.WebViewClient;
8 |
9 | import com.example.dllo.giftssayingapp.R;
10 | import com.example.dllo.giftssayingapp.base.BaseActivity;
11 |
12 | /**
13 | * Created by dllo on 16/9/30.
14 | */
15 | public class HomeItemActivity extends BaseActivity {
16 |
17 | private WebView itemWeb;
18 |
19 | @Override
20 | protected int setLayout() {
21 | return R.layout.activity_home_item;
22 | }
23 |
24 | @Override
25 | protected void initView() {
26 | itemWeb = bindView(R.id.web_home_item);
27 | }
28 |
29 | @Override
30 | protected void initData() {
31 | Intent intent = getIntent();
32 | String url = intent.getStringExtra("url");
33 | itemWeb.loadUrl(url);
34 |
35 | String url_kind = intent.getStringExtra("url_kind");
36 | itemWeb.loadUrl(url_kind);
37 |
38 | String url_image = intent.getStringExtra("ImageUrl");
39 | itemWeb.loadUrl(url_image);
40 |
41 | WebSettings webSettings = itemWeb.getSettings();
42 | webSettings.setJavaScriptEnabled(true);
43 | itemWeb.setWebViewClient(new WebViewClient());
44 |
45 | //设置WebView的一些缩放功能点
46 | itemWeb.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
47 | itemWeb.setHorizontalScrollBarEnabled(false);
48 | itemWeb.getSettings().setSupportZoom(true);
49 | //设置WebView可触摸放大缩小
50 | itemWeb.getSettings().setBuiltInZoomControls(true);
51 | itemWeb.setInitialScale(200);
52 | itemWeb.setHorizontalScrollbarOverlay(true);
53 |
54 | }
55 |
56 | @Override
57 | public boolean onKeyDown(int keyCode, KeyEvent event) {
58 | if (keyCode == KeyEvent.KEYCODE_BACK && itemWeb.canGoBack()) {
59 | itemWeb.goBack();
60 | return true;
61 | }
62 | return super.onKeyDown(keyCode, event);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/sharesdk/onekeyshare/OnekeySharePage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 官网地站:http://www.mob.com
3 | * 技术支持QQ: 4006852216
4 | * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
5 | *
6 | * Copyright (c) 2013年 mob.com. All rights reserved.
7 | */
8 |
9 | package cn.sharesdk.onekeyshare;
10 |
11 | import java.util.ArrayList;
12 | import java.util.HashMap;
13 |
14 | import cn.sharesdk.framework.Platform;
15 | import cn.sharesdk.framework.Platform.ShareParams;
16 | import cn.sharesdk.framework.PlatformActionListener;
17 |
18 | import com.mob.tools.FakeActivity;
19 |
20 | /** 快捷分享的基类 */
21 | public class OnekeySharePage extends FakeActivity {
22 | private OnekeyShareThemeImpl impl;
23 |
24 | public OnekeySharePage(OnekeyShareThemeImpl impl) {
25 | this.impl = impl;
26 | }
27 |
28 | /** 分享界面是否弹窗模式 */
29 | protected final boolean isDialogMode() {
30 | return impl.dialogMode;
31 | }
32 |
33 | protected final HashMap getShareParamsMap() {
34 | return impl.shareParamsMap;
35 | }
36 |
37 | /** 静默分享开关(没有界面,直接分享 )*/
38 | protected final boolean isSilent() {
39 | return impl.silent;
40 | }
41 |
42 | protected final ArrayList getCustomerLogos() {
43 | return impl.customerLogos;
44 | }
45 |
46 | protected final HashMap getHiddenPlatforms() {
47 | return impl.hiddenPlatforms;
48 | }
49 |
50 | protected final PlatformActionListener getCallback() {
51 | return impl.callback;
52 | }
53 |
54 | protected final ShareContentCustomizeCallback getCustomizeCallback() {
55 | return impl.customizeCallback;
56 | }
57 |
58 | protected final boolean isDisableSSO() {
59 | return impl.disableSSO;
60 | }
61 |
62 | protected final void shareSilently(Platform platform) {
63 | impl.shareSilently(platform);
64 | }
65 |
66 | protected final ShareParams formateShareData(Platform platform) {
67 | if (impl.formateShareData(platform)) {
68 | return impl.shareDataToShareParams(platform);
69 | }
70 | return null;
71 | }
72 |
73 | protected final boolean isUseClientToShare(Platform platform) {
74 | return impl.isUseClientToShare(platform);
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/PullToRefresh/src/main/java/com/handmark/pulltorefresh/library/LoadingLayoutProxy.java:
--------------------------------------------------------------------------------
1 | package com.handmark.pulltorefresh.library;
2 |
3 | import java.util.HashSet;
4 |
5 | import android.graphics.Typeface;
6 | import android.graphics.drawable.Drawable;
7 |
8 | import com.handmark.pulltorefresh.library.internal.LoadingLayout;
9 |
10 | public class LoadingLayoutProxy implements ILoadingLayout {
11 |
12 | private final HashSet mLoadingLayouts;
13 |
14 | LoadingLayoutProxy() {
15 | mLoadingLayouts = new HashSet();
16 | }
17 |
18 | /**
19 | * This allows you to add extra LoadingLayout instances to this proxy. This
20 | * is only necessary if you keep your own instances, and want to have them
21 | * included in any
22 | * {@link PullToRefreshBase#createLoadingLayoutProxy(boolean, boolean)
23 | * createLoadingLayoutProxy(...)} calls.
24 | *
25 | * @param layout - LoadingLayout to have included.
26 | */
27 | public void addLayout(LoadingLayout layout) {
28 | if (null != layout) {
29 | mLoadingLayouts.add(layout);
30 | }
31 | }
32 |
33 | @Override
34 | public void setLastUpdatedLabel(CharSequence label) {
35 | for (LoadingLayout layout : mLoadingLayouts) {
36 | layout.setLastUpdatedLabel(label);
37 | }
38 | }
39 |
40 | @Override
41 | public void setLoadingDrawable(Drawable drawable) {
42 | for (LoadingLayout layout : mLoadingLayouts) {
43 | layout.setLoadingDrawable(drawable);
44 | }
45 | }
46 |
47 | @Override
48 | public void setRefreshingLabel(CharSequence refreshingLabel) {
49 | for (LoadingLayout layout : mLoadingLayouts) {
50 | layout.setRefreshingLabel(refreshingLabel);
51 | }
52 | }
53 |
54 | @Override
55 | public void setPullLabel(CharSequence label) {
56 | for (LoadingLayout layout : mLoadingLayouts) {
57 | layout.setPullLabel(label);
58 | }
59 | }
60 |
61 | @Override
62 | public void setReleaseLabel(CharSequence label) {
63 | for (LoadingLayout layout : mLoadingLayouts) {
64 | layout.setReleaseLabel(label);
65 | }
66 | }
67 |
68 | public void setTextTypeface(Typeface tf) {
69 | for (LoadingLayout layout : mLoadingLayouts) {
70 | layout.setTextTypeface(tf);
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_home_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
21 |
22 |
29 |
30 |
35 |
36 |
42 |
43 |
44 |
45 |
50 |
51 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ssdk_instapaper_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 | %s
12 |
46 |
47 |
48 |
49 |
58 |
67 |
68 |
69 | ]]>
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_home_kind.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
21 |
22 |
29 |
30 |
35 |
36 |
42 |
43 |
44 |
49 |
50 |
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dllo/giftssayingapp/base/URLValues.java:
--------------------------------------------------------------------------------
1 | package com.example.dllo.giftssayingapp.base;
2 |
3 | /**
4 | * Created by dllo on 16/5/23.
5 | */
6 | public final class URLValues {
7 | //Editext 中文字url
8 | public static final String EDIT_NAME = "http://api.liwushuo.com/v2/search/hot_words_v2";
9 | //hometab标题url
10 | public static final String HOME_TITLE = "http://api.liwushuo.com/v2/channels/preset?gender=2&generation=1";
11 | //home轮播图url
12 | public static final String HOME_CAROUSEL = "http://api.liwushuo.com/v2/banners";
13 | //home第五张轮播图url
14 | public static final String HOME_CAROUSEL_FIVE = "http://api.liwushuo.com/v2/collections/356/posts?gender=1&generation=2&limit=20&offset=0";
15 | //home小方框url
16 | public static final String HOME_BOX = "http://api.liwushuo.com/v2/secondary_banners?gender=2&generation=1";
17 | //home的listview url
18 | public static final String HOME_CELL = "http://api.liwushuo.com/v2/channels/103/items_v2?ad=2&gender=2&generation=1&limit=20&offset=0";
19 |
20 | //home搜索edittext点击进入后的按钮
21 | public static final String HOME_QUERY = "http://api.liwushuo.com/v2/search/hot_words";
22 |
23 | //榜单
24 | //每日推荐
25 | public static final String HOTSPOT_RECOMMEND = "http://api.liwushuo.com/v2/ranks_v2/ranks/1?limit=20&offset=0";
26 | //top100
27 | public static final String HOTSPOT_TOP = "http://api.liwushuo.com/v2/ranks_v2/ranks/2?limit=20&offset=0";
28 | //独立原创榜
29 | public static final String HOTSPOT_ORIDINALITY = "http://api.liwushuo.com/v2/ranks_v2/ranks/3?limit=20&offset=0";
30 | //新星榜
31 | public static final String HOTSPOT_NEWSTAR = "http://api.liwushuo.com/v2/ranks_v2/ranks/4?limit=20&offset=0";
32 |
33 | //分类页
34 |
35 | // 2.攻略-栏目
36 | public static final String STRATEGY_PART = "http://api.liwushuo.com/v2/columns?limit=20&offset=0";
37 | // 攻略-品类
38 | public static final String STRATEGY_COLUMN = "http://api.liwushuo.com/v2/channel_groups/all";
39 |
40 | //3.单品
41 | public static final String STRATEGY_SKU = "http://api.liwushuo.com/v2/item_categories/tree";
42 |
43 | //4.查看更多
44 | public static final String STRATEGY_CHECK = "http://api.liwushuo.com/v2/collections?limit=20&offset=0";
45 |
46 | //5.礼物
47 | public static final String STRATEGY_GIFT = "http://api.liwushuo.com/v2/item_categories/tree";
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/PullToRefresh/src/main/java/com/handmark/pulltorefresh/library/internal/ViewCompat.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2011, 2012 Chris Banes.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *******************************************************************************/
16 | package com.handmark.pulltorefresh.library.internal;
17 |
18 | import android.annotation.TargetApi;
19 | import android.graphics.drawable.Drawable;
20 | import android.os.Build.VERSION;
21 | import android.os.Build.VERSION_CODES;
22 | import android.view.View;
23 |
24 | @SuppressWarnings("deprecation")
25 | public class ViewCompat {
26 |
27 | public static void postOnAnimation(View view, Runnable runnable) {
28 | if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
29 | SDK16.postOnAnimation(view, runnable);
30 | } else {
31 | view.postDelayed(runnable, 16);
32 | }
33 | }
34 |
35 | public static void setBackground(View view, Drawable background) {
36 | if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
37 | SDK16.setBackground(view, background);
38 | } else {
39 | view.setBackgroundDrawable(background);
40 | }
41 | }
42 |
43 | public static void setLayerType(View view, int layerType) {
44 | if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) {
45 | SDK11.setLayerType(view, layerType);
46 | }
47 | }
48 |
49 | @TargetApi(11)
50 | static class SDK11 {
51 |
52 | public static void setLayerType(View view, int layerType) {
53 | view.setLayerType(layerType, null);
54 | }
55 | }
56 |
57 | @TargetApi(16)
58 | static class SDK16 {
59 |
60 | public static void postOnAnimation(View view, Runnable runnable) {
61 | view.postOnAnimation(runnable);
62 | }
63 |
64 | public static void setBackground(View view, Drawable background) {
65 | view.setBackground(background);
66 | }
67 |
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_start_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
23 |
24 |
25 |
34 |
35 |
44 |
45 |
54 |
55 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/java/cn/sharesdk/onekeyshare/themes/classic/land/PlatformPageAdapterLand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * 官网地站:http://www.mob.com
3 | * 技术支持QQ: 4006852216
4 | * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
5 | *
6 | * Copyright (c) 2013年 mob.com. All rights reserved.
7 | */
8 |
9 | package cn.sharesdk.onekeyshare.themes.classic.land;
10 |
11 | import java.util.ArrayList;
12 |
13 | import android.content.Context;
14 | import cn.sharesdk.onekeyshare.themes.classic.PlatformPage;
15 | import cn.sharesdk.onekeyshare.themes.classic.PlatformPageAdapter;
16 |
17 | import com.mob.tools.utils.R;
18 |
19 | /** 横屏的九宫格页面适配器 */
20 | public class PlatformPageAdapterLand extends PlatformPageAdapter {
21 | private static final int DESIGN_SCREEN_WIDTH_L = 1280;
22 | private static final int DESIGN_CELL_WIDTH_L = 160;
23 | private static final int DESIGN_SEP_LINE_WIDTH = 1;
24 | private static final int DESIGN_LOGO_HEIGHT = 76;
25 | private static final int DESIGN_PADDING_TOP = 20;
26 |
27 | public PlatformPageAdapterLand(PlatformPage page, ArrayList