Przeglądaj źródła

主页布局,轮播图更新

Axion 8 lat temu
rodzic
commit
442f820543
27 zmienionych plików z 1256 dodań i 43 usunięć
  1. 10 1
      app/build.gradle
  2. 2 1
      app/src/main/AndroidManifest.xml
  3. 0 16
      app/src/main/java/com/wiipu/peopleheart/home/HomeContract.java
  4. 75 2
      app/src/main/java/com/wiipu/peopleheart/home/HomeFragment.java
  5. 0 18
      app/src/main/java/com/wiipu/peopleheart/home/HomePresenter.java
  6. 17 0
      app/src/main/java/com/wiipu/peopleheart/home/contract/HomeContract.java
  7. 51 0
      app/src/main/java/com/wiipu/peopleheart/home/presenter/HomePresenter.java
  8. 82 0
      app/src/main/java/com/wiipu/peopleheart/home/response/topNewsResponse.java
  9. 22 0
      app/src/main/java/com/wiipu/peopleheart/home/services/HomeServices.java
  10. 235 0
      app/src/main/java/com/wiipu/peopleheart/widget/ClearEditText.java
  11. 34 0
      app/src/main/java/com/wiipu/peopleheart/widget/convenientBanner/GlideHolderView.java
  12. 10 0
      app/src/main/java/com/wiipu/peopleheart/widget/convenientBanner/onItemClick.java
  13. BIN
      app/src/main/res/drawable-v24/ic_default_adimage.jpg
  14. BIN
      app/src/main/res/drawable-v24/ic_page_indicator.png
  15. BIN
      app/src/main/res/drawable-v24/ic_page_indicator_focused.png
  16. BIN
      app/src/main/res/drawable/icon_clear.png
  17. 14 0
      app/src/main/res/drawable/rectangle.xml
  18. 27 0
      app/src/main/res/layout/clear_edittext.xml
  19. 125 3
      app/src/main/res/layout/fragment_home.xml
  20. 18 0
      app/src/main/res/layout/glideimage.xml
  21. 421 0
      app/src/main/res/layout/griditem_layout.xml
  22. 23 0
      app/src/main/res/layout/gridview_item.xml
  23. 11 0
      app/src/main/res/layout/item_convenient_image.xml
  24. 54 0
      app/src/main/res/values/clear_edit_text_attrs.xml
  25. 23 0
      app/src/main/res/values/strings.xml
  26. 1 1
      commonlib/src/main/java/com/wiipu/commonlib/net/HttpClient.java
  27. 1 1
      commonlib/src/main/java/com/wiipu/commonlib/utils/VerifyUtils.java

+ 10 - 1
app/build.gradle

@@ -68,7 +68,7 @@ android {
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
     implementation 'com.android.support:appcompat-v7:27.1.1'
-    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
+    //implementation 'com.android.support.constraint:constraint-Griditem_layout:1.1.2'
     implementation 'com.android.support:support-v4:27.1.1'
     testImplementation 'junit:junit:4.12'
     androidTestImplementation 'com.android.support.test:runner:1.0.2'
@@ -98,5 +98,14 @@ dependencies {
     annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
     //circleImageView
     implementation 'de.hdodenhof:circleimageview:2.1.0'
+    //轮播图
+    implementation 'com.bigkoo:convenientbanner:2.0.5'
+
+    implementation 'com.android.support:gridlayout-v7:27.1.1'
+
+    //Glide
+    implementation 'com.github.bumptech.glide:glide:4.0.0'
+    implementation'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
+
 
 }

+ 2 - 1
app/src/main/AndroidManifest.xml

@@ -27,7 +27,8 @@
         android:supportsRtl="true"
         tools:replace="icon,label,theme"
         android:theme="@style/AppTheme">
-        <activity android:name=".MainActivity">
+        <activity android:name=".MainActivity"
+                  android:windowSoftInputMode="stateUnchanged">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 0 - 16
app/src/main/java/com/wiipu/peopleheart/home/HomeContract.java

@@ -1,16 +0,0 @@
-package com.wiipu.peopleheart.home;
-
-import com.wiipu.commonlib.base.BaseView;
-
-/**
- * Created by elaine on 2018/4/28.
- */
-
-public interface HomeContract {
-    interface View extends BaseView {
-        void showBargeView(String nums);
-    }
-    interface Presenter{
-        void getUnReadMessageNum(String id, String status);
-    }
-}

+ 75 - 2
app/src/main/java/com/wiipu/peopleheart/home/HomeFragment.java

@@ -1,17 +1,42 @@
 package com.wiipu.peopleheart.home;
 
+import android.util.Log;
 import android.view.View;
 
+import com.bigkoo.convenientbanner.ConvenientBanner;
+import com.bigkoo.convenientbanner.holder.CBViewHolderCreator;
+import com.bigkoo.convenientbanner.holder.Holder;
+import com.bigkoo.convenientbanner.listener.OnItemClickListener;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
 import com.wiipu.commonlib.base.BaseMvpFragment;
 import com.wiipu.peopleheart.R;
+import com.wiipu.peopleheart.home.contract.HomeContract;
+import com.wiipu.peopleheart.home.presenter.HomePresenter;
+import com.wiipu.peopleheart.home.response.topNewsResponse;
+import com.wiipu.peopleheart.widget.convenientBanner.GlideHolderView;
 
+import java.util.ArrayList;
+import java.util.List;
 
-public class HomeFragment extends BaseMvpFragment {
+import butterknife.BindView;
 
 
+
+public class HomeFragment extends BaseMvpFragment implements HomeContract.View,OnItemClickListener{
+
+    @BindView(R.id.cb_images)
+    ConvenientBanner mConvenientBanner;
+
+
+    private HomePresenter mHomePresenter;
+    private List<String> convenientUrl;
+
+    private ImageLoader mImageLoader;
+
     @Override
     protected void attach() {
-
+        mHomePresenter = new HomePresenter(this);
     }
 
     @Override
@@ -36,6 +61,47 @@ public class HomeFragment extends BaseMvpFragment {
 
     @Override
     protected void initData() {
+        mHomePresenter.getTopConvenientNews();
+        convenientUrl = new ArrayList<>();
+        mImageLoader = ImageLoader.getInstance();
+        mImageLoader.init(ImageLoaderConfiguration.createDefault(getActivity()));
+
+
+    }
+
+    @Override
+    public void showTopConvenientNews(topNewsResponse topNewsResponse) {
+        int total = Integer.parseInt(topNewsResponse.getTotal());
+        for (int i = 0; i < total; i++) {
+            convenientUrl.add(topNewsResponse.getResData().get(i).getUrl());
+        }
+
+        mConvenientBanner.setPages(new CBViewHolderCreator<GlideHolderView>() {
+            @Override
+            public GlideHolderView createHolder() {
+                return new GlideHolderView();
+            }
+        }, convenientUrl)//设置指示器是否可见
+                .setPointViewVisible(true)
+                //设置自动切换(同时设置了切换时间间隔)
+                .startTurning(2000)
+                //设置两个点图片作为翻页指示器,不设置则没有指示器,可以根据自己需求自行配合自己的指示器,不需要圆点指示器可用不设
+                .setPageIndicator(new int[]{R.drawable.ic_page_indicator, R.drawable.ic_page_indicator_focused})
+                //设置指示器的方向(左、中、右)
+                .setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.CENTER_HORIZONTAL)
+                //设置点击监听事件
+                .setOnItemClickListener(this)
+                //设置手动影响(设置了该项无法手动切换)
+                .setManualPageable(true);
+    }
+
+    @Override
+    public void showEmpty() {
+
+    }
+
+    @Override
+    public void showError(String message) {
 
     }
 
@@ -43,4 +109,11 @@ public class HomeFragment extends BaseMvpFragment {
     public void onClick(View v) {
 
     }
+
+    @Override
+    public void onItemClick(int position) {
+
+    }
+
+
 }

+ 0 - 18
app/src/main/java/com/wiipu/peopleheart/home/HomePresenter.java

@@ -1,18 +0,0 @@
-package com.wiipu.peopleheart.home;
-
-import com.wiipu.commonlib.base.BasePresenter;
-
-/**
- * Created by elaine on 2018/4/28.
- */
-
-public class HomePresenter extends BasePresenter<HomeContract.View> implements HomeContract.Presenter{
-    public HomePresenter(HomeContract.View view) {
-        super(view);
-    }
-
-    @Override
-    public void getUnReadMessageNum(String id, String status) {
-
-    }
-}

+ 17 - 0
app/src/main/java/com/wiipu/peopleheart/home/contract/HomeContract.java

@@ -0,0 +1,17 @@
+package com.wiipu.peopleheart.home.contract;
+
+import com.wiipu.commonlib.base.BaseView;
+import com.wiipu.peopleheart.home.response.topNewsResponse;
+
+/**
+ * Created by elaine on 2018/4/28.
+ */
+
+public interface HomeContract {
+    interface View extends BaseView {
+        void showTopConvenientNews(topNewsResponse topNewsResponse);
+    }
+    interface Presenter{
+        void getTopConvenientNews();
+    }
+}

+ 51 - 0
app/src/main/java/com/wiipu/peopleheart/home/presenter/HomePresenter.java

@@ -0,0 +1,51 @@
+package com.wiipu.peopleheart.home.presenter;
+
+import com.wiipu.commonlib.base.BasePresenter;
+import com.wiipu.commonlib.base.BaseResponse;
+import com.wiipu.commonlib.net.HttpClient;
+import com.wiipu.commonlib.net.HttpObserver;
+import com.wiipu.commonlib.net.RxTransformer;
+import com.wiipu.commonlib.utils.LogUtils;
+import com.wiipu.commonlib.utils.VerifyUtils;
+import com.wiipu.peopleheart.application.Constants;
+import com.wiipu.peopleheart.home.contract.HomeContract;
+import com.wiipu.peopleheart.home.response.topNewsResponse;
+import com.wiipu.peopleheart.home.services.HomeServices;
+
+import rx.Subscription;
+
+/**
+ * Created by elaine on 2018/4/28.
+ */
+
+public class HomePresenter extends BasePresenter<HomeContract.View> implements HomeContract.Presenter{
+    public HomePresenter(HomeContract.View view) {
+        super(view);
+    }
+
+
+    @Override
+    public void getTopConvenientNews() {
+        final String method = "showImg_top";
+        long timestamp = System.currentTimeMillis();
+        String sign = VerifyUtils.getSign(method, timestamp);
+        Subscription subscription = HttpClient.getInstance()
+                .create(HomeServices.class)
+                .getTopConvenientNews(method, timestamp, Constants.SRC, sign)
+                .compose(RxTransformer.<BaseResponse<topNewsResponse>>apply())
+                .subscribe(new HttpObserver<topNewsResponse>() {
+                    @Override
+                    public void success(topNewsResponse result) {
+                        mView.showTopConvenientNews(result);
+
+                    }
+
+                    @Override
+                    public void fail(String msg) {
+                        mView.showError(msg);
+                        LogUtils.e(msg);
+                    }
+                });
+        mSubscriptions.add(subscription);
+    }
+}

+ 82 - 0
app/src/main/java/com/wiipu/peopleheart/home/response/topNewsResponse.java

@@ -0,0 +1,82 @@
+package com.wiipu.peopleheart.home.response;
+
+import java.util.List;
+
+/**
+ * Description:
+ */
+public class topNewsResponse {
+
+/**
+ "total": 3,
+ "resData": [
+ {
+ "id": "47",
+ "url": "http://rongzhi110.xazhima.com/userfiles/upload/20180903/201809031132326547.jpg",
+ "title": "西安电子科技大学"
+ },
+ {
+ "id": "46",
+ "url": "http://rongzhi110.xazhima.com/userfiles/upload/20180823/201808231047577348.png",
+ "title": "酒厂欠债994万以900吨白酒相"
+ },
+ {
+ "id": "45",
+ "url": "http://rongzhi110.xazhima.com/userfiles/upload/20180823/201808231046524639.jpg",
+ "title": "西安图书馆太火爆需排队抽号 学习"
+ }
+ ]
+
+ */
+
+private String total;
+private List<dataBean> resData;
+
+
+    public String getTotal() {
+        return total;
+    }
+
+    public void setTotal(String total) {
+        this.total = total;
+    }
+
+    public List<dataBean> getResData() {
+        return resData;
+    }
+
+    public void setResData(List<dataBean> resData) {
+        this.resData = resData;
+    }
+
+   public static class dataBean {
+        private String id;
+        private String url;
+        private String title;
+
+        public String getId() {
+            return id;
+        }
+
+        public void setId(String id) {
+            this.id = id;
+        }
+
+        public String getUrl() {
+            return url;
+        }
+
+        public void setUrl(String url) {
+            this.url = url;
+        }
+
+        public String getTitle() {
+            return title;
+        }
+
+        public void setTitle(String title) {
+            this.title = title;
+        }
+    }
+
+}

+ 22 - 0
app/src/main/java/com/wiipu/peopleheart/home/services/HomeServices.java

@@ -0,0 +1,22 @@
+package com.wiipu.peopleheart.home.services;
+
+import com.wiipu.commonlib.base.BaseResponse;
+import com.wiipu.peopleheart.home.response.topNewsResponse;
+
+import retrofit2.http.Field;
+import retrofit2.http.FormUrlEncoded;
+import retrofit2.http.POST;
+import rx.Observable;
+
+/**
+ * Description:
+ */
+public interface HomeServices {
+
+    @POST("api.php")
+    @FormUrlEncoded
+    Observable<BaseResponse<topNewsResponse>> getTopConvenientNews(@Field("method") String method,
+                                                                  @Field("timestamp") long timestamp,
+                                                                  @Field("source") int source,
+                                                                  @Field("sign") String sign);
+}

+ 235 - 0
app/src/main/java/com/wiipu/peopleheart/widget/ClearEditText.java

@@ -0,0 +1,235 @@
+package com.wiipu.peopleheart.widget;
+
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.TypedArray;
+import android.support.v4.content.ContextCompat;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+
+import com.wiipu.peopleheart.R;
+
+
+/**
+ * 自带右边清除按钮的输入框
+ */
+public class ClearEditText extends RelativeLayout {
+
+
+    private Context mContext;
+
+    private EditText mInput;
+    private ImageView mClearBtn;
+    private OnFocusChangeListener mOnFocusChangeListener = null;
+
+    public ClearEditText(Context context) {
+        super(context);
+        init(context, null);
+    }
+
+    public ClearEditText(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public ClearEditText(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        init(context, attrs);
+    }
+
+    private void init(Context context, AttributeSet attrs) {
+        mContext = context;
+        LayoutInflater inflater = (LayoutInflater) mContext
+                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        inflater.inflate(R.layout.clear_edittext, this, true);
+        mInput = (EditText) findViewById(R.id.input_edit_text);
+        mClearBtn = (ImageView) findViewById(R.id.clear);
+        mClearBtn.setVisibility(View.INVISIBLE);
+
+
+        CharSequence hint = null;
+        CharSequence text = null;
+        int inputType = EditorInfo.TYPE_NULL;
+        ColorStateList textColor = null;
+        ColorStateList textColorHint = null;
+        int textSize = -1;
+
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ClearEditText);
+        int n = a.getIndexCount();
+        for (int i = 0; i < n; i++) {
+            int attr = a.getIndex(i);
+
+            switch (attr) {
+                case R.styleable.ClearEditText_hint:
+                    hint = a.getText(attr);
+                    break;
+                case R.styleable.ClearEditText_ems:
+                    mInput.setEms(a.getInt(attr, -1));
+                    break;
+                case R.styleable.ClearEditText_inputType:
+                    inputType = a.getInt(attr, EditorInfo.TYPE_NULL);
+                    break;
+                case R.styleable.ClearEditText_maxEms:
+                    mInput.setMaxEms(a.getInt(attr, -1));
+                    break;
+                case R.styleable.ClearEditText_minEms:
+                    mInput.setMinEms(a.getInt(attr, -1));
+                    break;
+                case R.styleable.ClearEditText_text:
+                    text = a.getText(attr);
+                    break;
+                case R.styleable.ClearEditText_clearEditTextTextColor:
+                    textColor = a.getColorStateList(attr);
+                    break;
+                case R.styleable.ClearEditText_textColorHint:
+                    textColorHint = a.getColorStateList(attr);
+                    break;
+                case R.styleable.ClearEditText_textSize:
+                    textSize = a.getDimensionPixelSize(attr, textSize);
+                    break;
+                case R.styleable.ClearEditText_textStyle:
+                    break;
+
+            }
+        }
+        a.recycle();
+
+        if (hint != null) {
+            mInput.setHint(hint);
+        }
+
+        mInput.setText(text);
+
+        if (inputType != EditorInfo.TYPE_NULL) {
+            mInput.setInputType(inputType);
+        }
+        if (textColor != null) {
+            mInput.setTextColor(textColor);
+        }
+        if (textColorHint != null) {
+            mInput.setHintTextColor(textColorHint);
+        }
+        if (textSize != -1) {
+            mInput.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
+        }
+
+        mClearBtn.setOnClickListener(new OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                mInput.setText("");
+            }
+        });
+
+        mInput.setOnFocusChangeListener(new OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                if (!mInput.isEnabled()) {
+                    mClearBtn.setVisibility(View.INVISIBLE);
+                    return;
+                }
+
+                if (hasFocus && !TextUtils.isEmpty(mInput.getText())) {
+                    mClearBtn.setVisibility(View.VISIBLE);
+                } else {
+                    mClearBtn.setVisibility(View.INVISIBLE);
+                }
+
+                if (mOnFocusChangeListener != null) {
+                    mOnFocusChangeListener.onFocusChange(v, hasFocus);
+                }
+            }
+        });
+
+        mInput.addTextChangedListener(new TextWatcher() {
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+            }
+
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count,
+                                          int after) {
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (!mInput.isEnabled()) {
+                    mClearBtn.setVisibility(View.INVISIBLE);
+                    return;
+                }
+                if (s.length() > 0 && mInput.isFocused()) {
+                    mClearBtn.setVisibility(View.VISIBLE);
+                } else {
+                    mClearBtn.setVisibility(View.INVISIBLE);
+                }
+            }
+        });
+
+    }
+
+    @Override
+    public void setOnFocusChangeListener(OnFocusChangeListener extFocusListener) {
+        throw new RuntimeException("Don't call setOnFocusChangeListener on ClearEditText. "
+                + "You probably want setExtFocusListener instead");
+    }
+
+    /**
+     * 设置焦点的监听函数,由于{@link View#setOnFocusChangeListener(OnFocusChangeListener)}已经被使用了,
+     * 所以添加一个扩展的焦点监听函数
+     */
+    public void setExtFocusListener(OnFocusChangeListener extFocusListener) {
+        mOnFocusChangeListener = extFocusListener;
+    }
+
+    public String getText() {
+        return mInput.getText().toString();
+    }
+
+    public void setText(CharSequence text) {
+        mInput.setText(text);
+    }
+
+    public void setHint(CharSequence hint) {
+        mInput.setHint(hint);
+    }
+
+    public CharSequence getHint() {
+        return mInput.getHint();
+    }
+
+    public void addTextChangedListener(TextWatcher watcher) {
+        mInput.addTextChangedListener(watcher);
+    }
+
+    public EditText getEditText() {
+        return mInput;
+    }
+
+    public void setEditable(boolean enabled) {
+        mInput.setEnabled(enabled);
+        if (!enabled) {
+            mClearBtn.setVisibility(View.INVISIBLE);
+        }
+    }
+
+    public void setClearImg(int id) {
+
+        mClearBtn.setImageDrawable(ContextCompat.getDrawable(getContext(), id));
+
+    }
+
+    public void setFilters(InputFilter[] filters) {
+        mInput.setFilters(filters);
+    }
+
+}

+ 34 - 0
app/src/main/java/com/wiipu/peopleheart/widget/convenientBanner/GlideHolderView.java

@@ -0,0 +1,34 @@
+package com.wiipu.peopleheart.widget.convenientBanner;
+
+import android.content.Context;
+import android.view.View;
+import android.widget.ImageView;
+
+
+import com.bigkoo.convenientbanner.holder.Holder;
+import com.bumptech.glide.Glide;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.wiipu.peopleheart.R;
+
+/**
+ * Description:
+ */
+public class GlideHolderView implements Holder<String> {
+
+    private ImageView imageView;
+    @Override
+    public View createView(Context context) {
+        //你可以通过layout文件来创建,不一定是Image,任何控件都可以进行翻页
+        imageView = new ImageView(context);
+        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
+        return imageView;
+    }
+
+    @Override
+    public void UpdateUI(Context context, int position, String data) {
+        imageView.setImageResource(R.drawable.ic_default_adimage);
+
+       // ImageLoader.getInstance().displayImage(data,imageView);
+        Glide.with(context).load(data).into(imageView);
+    }
+}

+ 10 - 0
app/src/main/java/com/wiipu/peopleheart/widget/convenientBanner/onItemClick.java

@@ -0,0 +1,10 @@
+package com.wiipu.peopleheart.widget.convenientBanner;
+
+import android.view.View;
+
+/**
+ * Description:
+ */
+public interface onItemClick {
+    void onItemClick(View view);
+}

BIN
app/src/main/res/drawable-v24/ic_default_adimage.jpg


BIN
app/src/main/res/drawable-v24/ic_page_indicator.png


BIN
app/src/main/res/drawable-v24/ic_page_indicator_focused.png


BIN
app/src/main/res/drawable/icon_clear.png


+ 14 - 0
app/src/main/res/drawable/rectangle.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle"
+    >
+    <size
+        android:height="@dimen/margin10dp"
+        android:width="2dp"
+        />
+
+    <solid
+        android:color="@color/colorPrimaryDark"
+        />
+
+</shape>

+ 27 - 0
app/src/main/res/layout/clear_edittext.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical">
+
+    <EditText
+        android:id="@+id/input_edit_text"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:layout_toLeftOf="@+id/clear"
+        android:background="@null"
+        android:singleLine="true"/>
+
+    <ImageView
+        android:id="@+id/clear"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
+        android:layout_marginRight="10dp"
+        android:padding="12dp"
+        android:src="@drawable/icon_clear"
+        android:visibility="visible"/>
+
+</RelativeLayout>

+ 125 - 3
app/src/main/res/layout/fragment_home.xml

@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              xmlns:app="http://schemas.android.com/apk/res-auto"
+              android:orientation="vertical"
+
     >
 
     <RelativeLayout
@@ -20,6 +22,126 @@
 
     </RelativeLayout>
 
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <com.bigkoo.convenientbanner.ConvenientBanner
+                android:id="@+id/cb_images"
+                android:layout_width="match_parent"
+                android:layout_height="180dp"
+                app:canLoop="true"
+                />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginLeft="@dimen/margin20dp"
+                    android:gravity="center"
+                    android:text="@string/tv_query_case"
+                    android:textSize="@dimen/textsize_12"
+                    android:drawableLeft="@drawable/rectangle"
+                    android:layout_marginTop="@dimen/margin20dp"
+
+                    />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:layout_marginTop="@dimen/margin10dp"
+
+                >
+
+                <com.wiipu.peopleheart.widget.ClearEditText
+                    android:id="@+id/et_query_num"
+                    android:layout_width="119dp"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="@dimen/margin20dp"
+                    app:hint="索引号"
+                    android:paddingLeft="@dimen/margin5dp"
+                    app:textColorHint="@color/grey"
+                    android:background="@color/grey_bg"
+                    app:textSize="@dimen/textsize_12"
+                    />
+
+                <com.wiipu.peopleheart.widget.ClearEditText
+                    android:id="@+id/et_pass"
+                    android:layout_width="120dp"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="@dimen/margin20dp"
+                    android:gravity="center"
+                    android:paddingLeft="@dimen/margin5dp"
+                    app:hint="密码"
+                    app:inputType="textPassword"
+                    app:textColorHint="@color/grey"
+                    android:background="@color/grey_bg"
+                    app:textSize="@dimen/textsize_12"
+                    />
+
+                <Button
+                    android:id="@+id/bt_query"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:background="@color/colorPrimary"
+                    android:layout_marginStart="@dimen/margin10dp"
+                    android:gravity="center"
+                    android:text="@string/bt_query"
+                    android:textColor="@color/white"
+
+                    />
+
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/margin10dp"
+                android:background="@color/grey_bg"
+                android:layout_marginTop="@dimen/margin20dp"
+                />
+
+            <ImageView
+                android:id="@+id/iv_home_yijiantiwen"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/margin60dp"
+                android:src="@drawable/home_btn_yijiantiwen"
+                android:layout_marginStart="@dimen/margin20dp"
+                android:layout_marginEnd="@dimen/margin20dp"
+                />
+
+            <include layout="@layout/griditem_layout"/>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/margin10dp"
+                android:background="@color/grey_bg"
+                android:layout_marginTop="@dimen/margin10dp"
+                />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="@dimen/margin20dp"
+                android:gravity="center"
+                android:text="@string/tv_tushuominsheng"
+                android:textSize="@dimen/textsize_12"
+                android:layout_marginTop="@dimen/margin10dp"
+                android:drawableLeft="@drawable/rectangle"
+                />
+
+            <android.support.v7.widget.RecyclerView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:id="@+id/rv_tushuominzhu"
+                />
+        </LinearLayout>
+
+    </ScrollView>
+
 
 
 </LinearLayout>

+ 18 - 0
app/src/main/res/layout/glideimage.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="vertical"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:gravity="center_vertical">
+
+    <!-- fitcenter为默认模式-->
+    <ImageView
+               android:layout_width="match_parent"
+               android:id="@+id/glideId"
+
+               android:scaleType="fitCenter"
+               android:layout_height="match_parent"/>
+
+</LinearLayout>

+ 421 - 0
app/src/main/res/layout/griditem_layout.xml

@@ -0,0 +1,421 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.GridLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              xmlns:app="http://schemas.android.com/apk/res-auto"
+    app:rowCount="4"
+    app:columnCount="4"
+    android:layout_marginTop="@dimen/margin10dp"
+
+    >
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_minshengqiuzhu"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_minshnegqiuzhu"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_mingshengqiuzhu"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_tousujubao"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_tousujubao"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_tousujubao"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_zhengcezixun"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_zhengcezixun"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_zhengcezixun"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_jianyanxiance"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_jianyanxiance"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_jianyanxiance"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_tongzhigonggao"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_tongzhigonggao"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_tongzhigonggao"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_minshengxinwen"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_minshengxinwen"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_minshengxinwen"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_minshengshipin"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_minshengshipin"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_minshengshiping"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_hangfengrexian"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_fengxingrexian"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_hangfengrexian"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_bumenliebiao"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_bumenliebiao"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_bumenliebiao"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_huiminzhengce"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_huiminzhengce"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_huiminzhengce"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_youxiubanjian"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_youxiubanjian"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_youxiubanjian"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_shimindianzan"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_shimindianzan"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_shimindianzan"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_manyidu"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_manyipingjia"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_manyidu"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_huifulv"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_huifulv"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_huifulv"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_dajiaping"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_dajiaping"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_dajiaping"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        app:layout_rowWeight="1"
+        app:layout_columnWeight="1"
+        android:id="@+id/ll_mianduimianyuyue"
+        android:orientation="vertical"
+        android:gravity="center"
+        android:clickable="true"
+        android:focusable="true"
+        android:layout_margin="@dimen/margin10dp"
+        >
+        <ImageView
+            android:layout_width="@dimen/margin45dp"
+            android:layout_height="@dimen/margin45dp"
+            android:src="@drawable/icon_mianduimain"
+            />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/tv_mianduimianyuyue"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_12"
+            />
+
+    </LinearLayout>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</android.support.v7.widget.GridLayout>

+ 23 - 0
app/src/main/res/layout/gridview_item.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:gravity="center"
+    >
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:id="@+id/iv_tushuominzhu"
+        />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textSize="@dimen/textsize_12"
+        android:id="@+id/tv_tushuominzhu"
+        />
+
+</LinearLayout>

+ 11 - 0
app/src/main/res/layout/item_convenient_image.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <ImageView
+        android:id="@+id/ivPost"
+        android:scaleType="fitXY"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+</LinearLayout>

+ 54 - 0
app/src/main/res/values/clear_edit_text_attrs.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <declare-styleable name="ClearEditText">
+        <attr name="textSize" format="dimension" />
+        <attr name="textStyle">
+            <flag name="normal" value="0x00000000" />
+            <flag name="bold" value="0x00000001" />
+            <flag name="italic" value="0x00000002" />
+        </attr>
+        <attr name="clearEditTextTextColor" format="reference|color" />
+        <attr name="textColorHint" format="reference|color" />
+        <attr name="text" format="string" localization="suggested" />
+        <attr name="hint" format="string" />
+        <attr name="ems" format="integer" min="0" />
+        <attr name="maxEms" format="integer" min="0" />
+        <attr name="minEms" format="integer" min="0" />
+        <attr name="inputType">
+            <flag name="none" value="0x00000000" />
+            <flag name="text" value="0x00000001" />
+            <flag name="textCapCharacters" value="0x00001001" />
+            <flag name="textCapWords" value="0x00002001" />
+            <flag name="textCapSentences" value="0x00004001" />
+            <flag name="textAutoCorrect" value="0x00008001" />
+            <flag name="textAutoComplete" value="0x00010001" />
+            <flag name="textMultiLine" value="0x00020001" />
+            <flag name="textImeMultiLine" value="0x00040001" />
+            <flag name="textNoSuggestions" value="0x00080001" />
+            <flag name="textUri" value="0x00000011" />
+            <flag name="textEmailAddress" value="0x00000021" />
+            <flag name="textEmailSubject" value="0x00000031" />
+            <flag name="textShortMessage" value="0x00000041" />
+            <flag name="textLongMessage" value="0x00000051" />
+            <flag name="textPersonName" value="0x00000061" />
+            <flag name="textPostalAddress" value="0x00000071" />
+            <flag name="textPassword" value="0x00000081" />
+            <flag name="textVisiblePassword" value="0x00000091" />
+            <flag name="textWebEditText" value="0x000000a1" />
+            <flag name="textFilter" value="0x000000b1" />
+            <flag name="textPhonetic" value="0x000000c1" />
+            <flag name="textWebEmailAddress" value="0x000000d1" />
+            <flag name="textWebPassword" value="0x000000e1" />
+            <flag name="number" value="0x00000002" />
+            <flag name="numberSigned" value="0x00001002" />
+            <flag name="numberDecimal" value="0x00002002" />
+            <flag name="numberPassword" value="0x00000012" />
+            <flag name="phone" value="0x00000003" />
+            <flag name="datetime" value="0x00000004" />
+            <flag name="date" value="0x00000014" />
+            <flag name="time" value="0x00000024" />
+            <flag name="money" value="0x00000005" />
+            <flag name="nosub" value="0x00000006" />
+        </attr>
+    </declare-styleable>
+</resources>

+ 23 - 0
app/src/main/res/values/strings.xml

@@ -12,5 +12,28 @@
     <!-- TODO: Remove or change this placeholder text -->
     <string name="hello_blank_fragment">Hello blank fragment</string>
 
+    <!-- 首页-->
+    <string name="tv_query_case">办件查询</string>
+    <string name="et_query_num">索引号</string>
+    <string name="et_pass">密码</string>
+    <string name="bt_query">查询</string>
+    <string name="tv_mingshengqiuzhu">民生求助</string>
+    <string name="tv_tousujubao">投诉举报</string>
+    <string name="tv_zhengcezixun">政策咨询</string>
+    <string name="tv_jianyanxiance">建言献策</string>
+    <string name="tv_tongzhigonggao">通知公告</string>
+    <string name="tv_minshengxinwen">民生新闻</string>
+    <string name="tv_minshengshiping">民生视频</string>
+    <string name="tv_hangfengrexian">行风热线</string>
+    <string name="tv_bumenliebiao">部门列表</string>
+    <string name="tv_huiminzhengce">惠民政策</string>
+    <string name="tv_youxiubanjian">优秀办件</string>
+    <string name="tv_shimindianzan">市民点赞</string>
+    <string name="tv_manyidu">满意度</string>
+    <string name="tv_huifulv">回复率</string>
+    <string name="tv_dajiaping">大家评</string>
+    <string name="tv_mianduimianyuyue">面对面预约</string>
+    <string name="tv_tushuominsheng">图说民生</string>
+
 
 </resources>

+ 1 - 1
commonlib/src/main/java/com/wiipu/commonlib/net/HttpClient.java

@@ -18,7 +18,7 @@ public class HttpClient {
     /*
      * 测试环境
      */
-    public static final String BASE_URL = "http://boiler.xazhima.com/api/v1.0/";
+    public static final String BASE_URL = "http://rongzhi110.xazhima.com/api/minxin/v1.0/";
 
     /*
      * 线上环境

+ 1 - 1
commonlib/src/main/java/com/wiipu/commonlib/utils/VerifyUtils.java

@@ -8,7 +8,7 @@ import java.security.MessageDigest;
 
 public class VerifyUtils {
     private static final int SOURCE = 2;
-    private static final String SECRECT = "boiler_android";
+    private static final String SECRECT = "rongcheng110_android";
 
     //获取签名
     public static String getSign(String method, long timeStamp){