Junqin Wang 8 years ago
parent
commit
23646b600a

+ 2 - 1
app/res/layout/main.xml

@@ -18,7 +18,8 @@
             android:layout_height="?attr/actionBarSize"
             android:background="?attr/colorPrimary"
             app:titleTextAppearance="@style/Toolbar.TitleText"
-            android:visibility="visible"/>
+            android:visibility="visible"
+            style="@style/fullToolbarStyle"/>
     </android.support.design.widget.AppBarLayout>
 
     <com.sheishuo.app.common.ui.viewpager.PagerSlidingTabStrip

+ 21 - 0
app/res/layout/trade_list_fragment.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <LinearLayout
+        android:id="@+id/trade_list_notifications_layout"
+        android:layout_width="368dp"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        tools:layout_editor_absoluteY="0dp"
+        tools:layout_editor_absoluteX="8dp" />
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/trade_list_recyclerview"
+        android:layout_width="368dp"
+        android:layout_height="551dp"
+        tools:layout_editor_absoluteY="8dp"
+        tools:layout_editor_absoluteX="8dp" />
+
+</RelativeLayout>

+ 6 - 0
app/res/layout/trade_list_item.xml

@@ -0,0 +1,6 @@
+<?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">
+
+</LinearLayout>

File diff suppressed because it is too large
+ 12 - 0
app/src/com/sheishuo/app/common/beans/TradeBean.java


+ 2 - 3
app/src/com/sheishuo/app/common/util/net/INet.java

@@ -1,7 +1,5 @@
 package com.sheishuo.app.common.util.net;
 
-import java.util.List;
-
 import okhttp3.FormBody;
 import okhttp3.MediaType;
 import okhttp3.RequestBody;
@@ -17,5 +15,6 @@ public interface INet {
     void post(String url, RequestBody body,ResponseCallback callback);
     void loginQuery(String mobile,String pwd,ResponseCallback callback);
     void getGiftList(ResponseCallback callback);
-    void uploadImgs(String filePath,ResponseCallback callback);
+    void uploadCircleImgs(String filePath, ResponseCallback callback);
+
 }

+ 1 - 1
app/src/com/sheishuo/app/common/util/net/NetImpl.java

@@ -164,7 +164,7 @@ public class  NetImpl implements INet {
     }
 
     @Override
-    public void uploadImgs(String filePath, final ResponseCallback callback) {
+    public void uploadCircleImgs(String filePath, final ResponseCallback callback) {
         File file = new File(filePath);
         MultipartBody.Builder builder = new MultipartBody.Builder();
         builder.setType(MultipartBody.FORM);

+ 1 - 0
app/src/com/sheishuo/app/common/util/net/NetInfo.java

@@ -15,4 +15,5 @@ public class NetInfo {
     public final static String GIFT_LIST = INDEX + "?m=who&c=index&a=gift_list";
     public final static String GET_CODE = INDEX + "?m=who&c=index&a=send_code";
     public final static String UPLOAD_IMG = INDEX + "?m=who&c=social&a=upload";
+    public final static String TRADE_LIST = INDEX + "?m=who&c=trade&a=lists";
 }

+ 3 - 0
app/src/com/sheishuo/app/common/views/BaseToolbar.java

@@ -158,6 +158,7 @@ public class BaseToolbar extends Toolbar {
 
 
 
+
         /**
          * 为Toolbar添加一个图标按钮
          *
@@ -186,6 +187,8 @@ public class BaseToolbar extends Toolbar {
                 return this;
         }
 
+
+
         public BaseToolbar build(){
                 return toolbar;
         }

+ 1 - 0
app/src/com/sheishuo/app/core_module/circle/activity/NewTweetingActivity.java

@@ -175,6 +175,7 @@ public class NewTweetingActivity extends SheishuoUI {
                         .centerCrop()
                         .bitmapTransform(new ColorFilterTransformation(context, 0x7900CCCC))
                         .into(imageView);
+                imgsLayout.addView(imageView);
                 selectedPhotoPathList.add(filePath);
                 presenter.uploadPhoto(filePath);
             } else {

+ 1 - 1
app/src/com/sheishuo/app/core_module/circle/model/NewTweetModel.java

@@ -48,7 +48,7 @@ public class NewTweetModel {
                 @Override
                 public void run() {
                     final int index = finalI;
-                    net.uploadImgs(filesPath.get(finalI), new ResponseCallback() {
+                    net.uploadCircleImgs(filesPath.get(finalI), new ResponseCallback() {
                         @Override
                         public void onSuccess(Object object) {
                             //Log.e("object", (String) object);

+ 59 - 0
app/src/com/sheishuo/app/core_module/trade/model/TradeModel.java

@@ -0,0 +1,59 @@
+package com.sheishuo.app.core_module.trade.model;
+
+import com.sheishuo.app.cache.AccountCache;
+import com.sheishuo.app.common.util.net.INet;
+import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.util.net.NetInfo;
+import com.sheishuo.app.common.util.net.ResponseCallback;
+import com.sheishuo.app.core_module.trade.presenter.TradePresenter;
+
+import okhttp3.FormBody;
+
+/**
+ * Created by KN on 2017/7/31.
+ */
+
+public class TradeModel {
+    public final static int TYPE_ALL = 0
+            ,TYPE_SUPPLY = 1
+            ,TYPE_DEMAND = 2
+            ,TYPE_RECENT = 3
+            ,TYPE_RELEASE = 4
+            ,TYPE_CONCERN = 5;
+
+
+    TradePresenter presenter;
+    INet net;
+
+    public TradeModel(TradePresenter presenter){
+        this.presenter = presenter;
+        net = new NetImpl();
+    }
+
+    public void getTradeList(int type,int page){
+        final FormBody body = new FormBody.Builder()
+                .add("id", AccountCache.getAccount().getId())
+                .add("province", AccountCache.getAccount().getProvince())
+                .add("page", String.valueOf(page))
+                .add("sort", String.valueOf(type))
+                .build();
+
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                net.post(NetInfo.TRADE_LIST, body, new ResponseCallback() {
+                    @Override
+                    public void onSuccess(Object object) {
+
+                    }
+
+                    @Override
+                    public void onFailed() {
+
+                    }
+                });
+            }
+        }).start();
+
+    }
+}

+ 9 - 0
app/src/com/sheishuo/app/core_module/trade/presenter/TradePresenter.java

@@ -0,0 +1,9 @@
+package com.sheishuo.app.core_module.trade.presenter;
+
+/**
+ * Created by KN on 2017/7/31.
+ */
+
+public class TradePresenter {
+
+}

+ 4 - 25
app/src/com/sheishuo/app/main/fragment/SessionListFragment.java

@@ -2,6 +2,7 @@ package com.sheishuo.app.main.fragment;
 
 import android.content.Intent;
 import android.os.Bundle;
+import android.support.annotation.Nullable;
 import android.support.v7.widget.Toolbar;
 import android.util.Log;
 import android.view.Menu;
@@ -71,6 +72,7 @@ public class SessionListFragment extends MainTabFragment {
         this.setContainerId(MainTab.RECENT_CONTACTS.fragmentId);
     }
 
+
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
@@ -102,8 +104,6 @@ public class SessionListFragment extends MainTabFragment {
         parent = (MainActivity) getActivity();
         toolbar = (BaseToolbar) parent.getToolBar();
 
-        //fragment需调用此函数来申明有菜单项
-        setHasOptionsMenu(true);
 
         notifyBar = getView().findViewById(R.id.status_notify_bar);
         notifyBarText = (TextView) getView().findViewById(R.id.status_desc_label);
@@ -123,9 +123,9 @@ public class SessionListFragment extends MainTabFragment {
     //初始化toolbar
     public void initToolbar(){
         Log.e(TAG,"init toolbar");
-        toolbar.init();
-        toolbar.setTitle("朋友");
         if (toolbar != null){
+            toolbar.init();
+            toolbar.setTitle("朋友");
             toolbar = new BaseToolbar.Builder()
                     .create(getActivity(),toolbar)
                     .addIcoButton(R.drawable.friends_contacts)
@@ -146,28 +146,7 @@ public class SessionListFragment extends MainTabFragment {
         if (isVisibleToUser && toolbar != null) initToolbar();
     }
 
-    @Override
-    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
-        Log.e(TAG,"Create Menu");
-        inflater.inflate(R.menu.main_friends_menu,menu);
-        super.onCreateOptionsMenu(menu,inflater);
-
-    }
-
 
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()){
-            case R.id.main_friends_menu_contacts:
-                Log.e(TAG,"打开联系人列表");
-                return true;
-            case R.id.main_friends_menu_add:
-                Log.e(TAG,"添加朋友");
-                return true;
-            default:
-                return super.onOptionsItemSelected(item);
-        }
-    }
 
     /**
      * 用户状态变化

+ 14 - 0
app/src/com/sheishuo/app/main/fragment/TradeListFragment.java

@@ -0,0 +1,14 @@
+package com.sheishuo.app.main.fragment;
+
+/**
+ * Created by KN on 2017/7/31.
+ */
+
+public class TradeListFragment extends MainTabFragment {
+
+
+    @Override
+    protected void onInit() {
+
+    }
+}

BIN
server_doc/交易贴-发布.xlsx


Some files were not shown because too many files changed in this diff