Browse Source

修改订阅号样式

Bitliker 9 years ago
parent
commit
084e909695

+ 1 - 1
WeiChat/src/main/AndroidManifest.xml

@@ -456,7 +456,7 @@
             android:label="拜访报告" />
         <activity
             android:name=".ui.erp.activity.oa.LocationMapActivity"
-            android:label="定位信息" />
+            android:label="选择地址" />
         <activity
             android:name=".ui.erp.activity.oa.AlarmaActivity"
             android:label="签到提醒" />

+ 7 - 12
WeiChat/src/main/java/com/xzjmyk/pm/activity/db/dao/SubscriptionDao.java

@@ -128,26 +128,21 @@ public class SubscriptionDao {
         return k;
     }
 
-    public long UpdateStatus(String id, boolean status) {
-        long k = 0;
-        Log.i("gongpengming", "id=" + id + "###status=" + status);
-        SQLiteDatabase db = sqliteHelper.getWritableDatabase();
-        ContentValues values = new ContentValues();
+    public void UpdateStatus(String id, boolean status) {
+        long k;
         if (status)
-            values.put("status_", -1+"");
+            k = -1;
         else
-            values.put("status_", 0+"");
-        String where = "id_=?";
-        String[] whereArgs = {id};
+            k = 0;
+        String sql = "update SubscriptionMessage set status_=" + k + " where id_=" + id;
+        SQLiteDatabase db = sqliteHelper.getWritableDatabase();
         try {
-            k = db.update(titleName, values, where, whereArgs);
+            db.execSQL(sql);
         } catch (SQLException e) {
             Log.i("gong", "出错了" + e == null ? "" : e.getMessage());
         } finally {
             db.close();
         }
-        Log.i("gongpengming", "k=" + k);
-        return k;
     }
 
     public ArrayList<SubscriptionMessage> findAll() {

+ 0 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessActivity.java

@@ -23,7 +23,6 @@ import com.lidroid.xutils.view.annotation.ViewInject;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.erp.adapter.HListViewAdapter;
-import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
 import com.xzjmyk.pm.activity.ui.erp.view.ListViewInScroller;
 import com.xzjmyk.pm.activity.util.DisplayUtil;
 import com.xzjmyk.pm.activity.view.FunnelView;

+ 31 - 6
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/LocationMapActivity.java

@@ -1,8 +1,10 @@
 package com.xzjmyk.pm.activity.ui.erp.activity.oa;
 
+import android.content.Intent;
 import android.os.Bundle;
-import android.util.Log;
 import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
@@ -41,16 +43,18 @@ public class LocationMapActivity extends BaseActivity implements OnGetPoiSearchR
     double longitude;
     private MapView mapView;
     private PullToRefreshListView listView;
-    private List<PoiInfo> listData;
+    private List<PoiInfo> listData;  //周围地址主体;列表
     private PoiNearbySearchOption option = null;
     private PoiSearch mPoiSearch;
     private LocationMapAdapter adapter;
     private int selectItem = 0;
+    private PoiInfo myPoInfo;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_map_location);
+
         init();
         initView();
         listenerNearInfo(0, 0);
@@ -62,6 +66,7 @@ public class LocationMapActivity extends BaseActivity implements OnGetPoiSearchR
         initMapViewSet();
         adapter = new LocationMapAdapter();
         listView.setAdapter(adapter);
+        //选择
         listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
@@ -70,12 +75,18 @@ public class LocationMapActivity extends BaseActivity implements OnGetPoiSearchR
                 initMapViewSet(listData.get(i - 1).location);
             }
         });
+
+
     }
 
     private void init() {
         BdLocationHelper locationHelper = MyApplication.getInstance().getBdLocationHelper();
         latitude = locationHelper.getLatitude();
         longitude = locationHelper.getLongitude();
+        myPoInfo = new PoiInfo();
+        myPoInfo.location = new LatLng(latitude, longitude);
+        myPoInfo.address = locationHelper.getAddress();
+        myPoInfo.name = "我的位置";
     }
 
     //监听周围信息的获取 radius=0 为默认显示周围1000米
@@ -133,14 +144,11 @@ public class LocationMapActivity extends BaseActivity implements OnGetPoiSearchR
 
     @Override
     public void onGetPoiResult(PoiResult poiResult) {
-
         if (poiResult != null) {
             listData = poiResult.getAllPoi();
             if (listData != null && listData.size() > 0) {
+                listData.add(myPoInfo);
                 adapter.notifyDataSetChanged();
-            } else {
-                //当前没有获取到数据
-                Log.i("gongpengming", "数据为空");
             }
 
         }
@@ -215,5 +223,22 @@ public class LocationMapActivity extends BaseActivity implements OnGetPoiSearchR
         }
     }
 
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.menu_visit_save, menu);
+        return super.onCreateOptionsMenu(menu);
+    }
 
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case R.id.save:
+                Intent intent = new Intent();
+                intent.putExtra(VisitActivity.REQUESTNAME, listData.get(selectItem).name);
+                setResult(VisitActivity.REQUESTCODE, intent);
+                break;
+        }
+
+        return super.onOptionsItemSelected(item);
+    }
 }

+ 25 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/VisitActivity.java

@@ -5,25 +5,35 @@ import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.widget.TextView;
 
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 
 //拜访页面
 public class VisitActivity extends BaseActivity {
+    private int resultCode = 0x01;
+    public static final int REQUESTCODE = 0x02;
+    public static final String REQUESTNAME = "VisitActivity_REQUESTNAME";
+
+    @ViewInject(R.id.location_tv)
+    private TextView location_tv;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_visit);
+        ViewUtils.inject(this);
         initView();
     }
 
     private void initView() {
-        findViewById(R.id.location_tv).setOnClickListener(new View.OnClickListener() {
+        findViewById(R.id.location_rl).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-               startActivityForResult(new Intent(VisitActivity.this, LocationMapActivity.class),1);
+                startActivityForResult(new Intent(VisitActivity.this, LocationMapActivity.class), resultCode);
             }
         });
     }
@@ -44,4 +54,17 @@ public class VisitActivity extends BaseActivity {
         }
         return super.onOptionsItemSelected(item);
     }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (this.resultCode == resultCode) {
+            if (data != null) {
+                String str = data.getStringExtra(REQUESTNAME);
+                if (str != null && str.length() > 0) {
+                    location_tv.setText(str);
+                }
+            }
+
+        }
+    }
 }

+ 3 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/SubscriptionActivity.java

@@ -79,7 +79,7 @@ public class SubscriptionActivity extends BaseActivity {
             } else if (msg.what == RESULT_OK) {
                 if (adapter == null) {
                     adapter = new SubscriptionAdapter();
-                    listView.setAdapter(adapter);
+                    listView.getRefreshableView().setAdapter(adapter);
                 } else {
                     notifyAdapter();
                 }
@@ -109,7 +109,6 @@ public class SubscriptionActivity extends BaseActivity {
         listView.setMode(PullToRefreshBase.Mode.BOTH);
         View aa = LayoutInflater.from(this).inflate(R.layout.subscrip_emptyview, null);
         getSupportActionBar().setCustomView(aa);
-
         listView.setEmptyView(aa);
         listView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
             @Override
@@ -257,11 +256,11 @@ public class SubscriptionActivity extends BaseActivity {
     }
 
     private void clearDataToDB(long newlong, long date) {
-        long k = SubscriptionDao.getInstance().deleteMessage(newlong, date, emCode);
+        SubscriptionDao.getInstance().deleteMessage(newlong, date, emCode);
     }
 
     private void saveDataToDB(ArrayList<SubscriptionMessage> subscriptionMessages) {
-        long k = SubscriptionDao.getInstance().addMessage(subscriptionMessages, emCode);
+        SubscriptionDao.getInstance().addMessage(subscriptionMessages, emCode);
     }
 
 

+ 6 - 15
WeiChat/src/main/res/layout/activity_subscription.xml

@@ -1,17 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:ptr="http://schemas.android.com/apk/res-auto"
+<com.handmark.pulltorefresh.library.PullToRefreshListView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/listview"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-
-    <com.handmark.pulltorefresh.library.PullToRefreshListView
-        android:id="@+id/listview"
-        android:layout_width="match_parent"
-        android:background="@drawable/bg_main"
-        android:layout_height="match_parent"
-        android:layout_above="@+id/bottom_view"
-        android:divider="#00000000"
-        android:padding="10dp"
-        android:scrollbars="none" />
-</FrameLayout>
+    android:layout_height="match_parent"
+    android:background="@color/item_line"
+    android:dividerHeight="18dp"
+    android:scrollbars="none" />

+ 23 - 22
WeiChat/src/main/res/layout/activity_visit.xml

@@ -3,6 +3,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/item_line"
     tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.VisitActivity">
 
     <LinearLayout
@@ -10,7 +11,9 @@
         android:layout_height="match_parent"
         android:orientation="vertical">
 
-        <RelativeLayout style="@style/IMTbleLine_UP">
+        <RelativeLayout
+            android:id="@+id/time_rl"
+            style="@style/IMTbleLine_UP">
 
             <TextView
                 style="@style/add_signin_tv_main"
@@ -19,24 +22,18 @@
                 android:text="拜访日期" />
 
             <TextView
+                android:id="@+id/time_tv"
                 style="@style/add_signin_tv_hine"
                 android:layout_alignParentRight="true"
                 android:drawableRight="@drawable/oa_next"
                 android:text="默认系统时间" />
         </RelativeLayout>
 
-        <View
-            android:layout_width="1px"
-            android:layout_height="match_parent"
-            android:background="@color/item_line" />
-
-        <View
-            android:layout_width="1px"
-            android:layout_height="match_parent"
-            android:layout_marginTop="10dp"
-            android:background="@color/item_line" />
 
-        <RelativeLayout style="@style/IMTbleLine_UP">
+        <RelativeLayout
+            android:id="@+id/location_rl"
+            style="@style/IMTbleLine_UP"
+            android:layout_marginTop="10dp">
 
             <TextView
                 style="@style/add_signin_tv_main"
@@ -57,10 +54,11 @@
             android:layout_height="wrap_content"
             android:gravity="right"
             android:text="定位不准?点我重置"
-            android:textColor="@color/blue" />
+            android:textColor="@color/dodgerblue" />
 
 
         <RelativeLayout
+            android:id="@+id/client_rl"
             style="@style/IMTbleLine_UP"
             android:layout_marginTop="10dp">
 
@@ -68,16 +66,18 @@
                 style="@style/add_signin_tv_main"
                 android:drawableLeft="@drawable/oa_client"
                 android:gravity="center"
-                android:text="地址" />
+                android:text="客户" />
 
             <TextView
+                android:id="@+id/client_tv"
                 style="@style/add_signin_tv_hine"
                 android:layout_alignParentRight="true"
                 android:drawableRight="@drawable/oa_next"
-                android:text="广东深圳市南山XXXX" />
+                android:text="北京XXX" />
         </RelativeLayout>
 
         <RelativeLayout
+            android:id="@+id/contact_rl"
             style="@style/IMTbleLine_UP"
             android:layout_marginTop="1dp">
 
@@ -85,13 +85,13 @@
                 style="@style/add_signin_tv_main"
                 android:drawableLeft="@drawable/oa_client"
                 android:gravity="center"
-                android:text="地址" />
-
+                android:text="联系人" />
             <TextView
+                android:id="@+id/contact_tv"
                 style="@style/add_signin_tv_hine"
                 android:layout_alignParentRight="true"
                 android:drawableRight="@drawable/oa_next"
-                android:text="广东深圳市南山XXXX" />
+                android:text="梁某某" />
         </RelativeLayout>
 
         <LinearLayout
@@ -112,10 +112,11 @@
                     android:gravity="center"
                     android:text="业务员" />
 
-                <EditText
+                <TextView
                     style="@style/add_signin_tv_hine"
                     android:layout_alignParentRight="true"
                     android:text="广东深圳市南山XXXX"
+                    android:drawableRight="@drawable/oa_next"
                     android:textColorLink="@null" />
             </RelativeLayout>
 
@@ -130,7 +131,7 @@
                     android:gravity="center"
                     android:text="业务员" />
 
-                <EditText
+                <TextView
                     style="@style/add_signin_tv_hine"
                     android:layout_alignParentRight="true"
                     android:text="广东深圳市南山XXXX"
@@ -148,7 +149,7 @@
                     android:gravity="center"
                     android:text="业务员" />
 
-                <EditText
+                <TextView
                     style="@style/add_signin_tv_hine"
                     android:layout_alignParentRight="true"
                     android:text="广东深圳市南山XXXX"
@@ -166,7 +167,7 @@
                     android:gravity="center"
                     android:text="业务员" />
 
-                <EditText
+                <TextView
                     style="@style/add_signin_tv_hine"
                     android:layout_alignParentRight="true"
                     android:text="广东深圳市南山XXXX"

+ 3 - 4
WeiChat/src/main/res/layout/bigimage_subscription.xml

@@ -7,7 +7,7 @@
     <RelativeLayout
         android:id="@+id/small_ll"
         android:layout_width="match_parent"
-        android:layout_height="100dp"
+        android:layout_height="80dp"
         android:orientation="horizontal"
         android:visibility="gone">
 
@@ -61,8 +61,7 @@
         android:id="@+id/big_rl"
         android:layout_width="match_parent"
         android:layout_height="130dp"
-
-        >
+        android:visibility="gone">
 
         <ImageView
             android:id="@+id/big_img"
@@ -87,8 +86,8 @@
             android:layout_alignParentBottom="true"
             android:layout_marginBottom="5dp"
             android:layout_marginLeft="10dp"
-            android:ellipsize="end"
             android:background="@color/subscrip_text"
+            android:ellipsize="end"
             android:textColor="@color/white"
             android:textSize="@dimen/text_min" />
 

+ 3 - 1
WeiChat/src/main/res/layout/subscription.xml

@@ -3,12 +3,14 @@
     xmlns:card_view="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:layout_marginLeft="10dp"
+    android:layout_marginRight="10dp"
+    android:background="@color/white"
     card_view:contentPadding="5dp">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="@color/white"
         android:orientation="vertical">
 
         <TextView

+ 1 - 0
WeiChat/src/main/res/values/gpm_values.xml

@@ -64,6 +64,7 @@
     <style name="add_signin_tv_main" parent="@style/add_signin_tv">
         <item name="android:textSize">@dimen/text_main</item>
         <item name="android:textColor">@color/text_main</item>
+        <item name="android:drawablePadding">8dp</item>
     </style>
 
     <style name="add_signin_tv_hine" parent="@style/add_signin_tv">