|
|
@@ -1,13 +1,17 @@
|
|
|
package com.xzjmyk.pm.activity.ui.erp.fragment;
|
|
|
|
|
|
import android.content.Intent;
|
|
|
+import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
import android.util.Log;
|
|
|
+import android.view.Gravity;
|
|
|
import android.view.View;
|
|
|
import android.widget.AdapterView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.PopupWindow;
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
@@ -136,7 +140,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- /*mPullToRefreshListView.getRefreshableView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
|
|
+ mPullToRefreshListView.getRefreshableView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
|
|
@Override
|
|
|
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
|
|
|
View popView = View.inflate(getActivity(), R.layout.pop_subs_delete, null);
|
|
|
@@ -167,11 +171,11 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
mTypeListView.setVisibility(View.VISIBLE);
|
|
|
mSubsTypeAdapter.notifyDataSetChanged();
|
|
|
initKeyStrings();
|
|
|
-// mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
-// mAllSubscriptionAdapter.getmSubscriptionNumbers().addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
-// mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
- mAllSubscriptionAdapter = new AllSubscriptionAdapter(getActivity(), mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
- mPullToRefreshListView.getRefreshableView().setAdapter(mAllSubscriptionAdapter);
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+ mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
+// mAllSubscriptionAdapter = new AllSubscriptionAdapter(getActivity(), mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+// mPullToRefreshListView.getRefreshableView().setAdapter(mAllSubscriptionAdapter);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -194,7 +198,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
mTypeListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
@Override
|
|
|
@@ -208,7 +212,6 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-/*
|
|
|
mTypeListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
|
|
@Override
|
|
|
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
|
|
|
@@ -262,7 +265,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
- });*/
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void initKeyStrings() {
|
|
|
@@ -313,6 +316,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
* 获取本地数据库全部订阅
|
|
|
*/
|
|
|
public void getDbSubsData() {
|
|
|
+ mAllSubscriptonKindMessages.clear();
|
|
|
String cacheKeys = SharedUtil.getString(currentMaster + currentUser + "subs");
|
|
|
if (cacheKeys != null) {
|
|
|
String[] cacheKeysArray = cacheKeys.split(",");
|
|
|
@@ -321,7 +325,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
keyStrings.add(cacheKeysArray[i]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ rbPos = 0;
|
|
|
List<SubscriptionNumber> dbSubscriptionNumbers
|
|
|
= mDbManager.queryFromAllSubs(new String[]{currentMaster,currentUser}, "subs_master=? and subs_username=? ");
|
|
|
if (dbSubscriptionNumbers == null || dbSubscriptionNumbers.size() == 0) {
|
|
|
@@ -352,8 +356,8 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
tempSubscriptonKindMessage.setSubscriptionNumbers(tempSubscriptionNumbers);
|
|
|
mAllSubscriptonKindMessages.add(tempSubscriptonKindMessage);
|
|
|
}
|
|
|
- mSubscriptionNumbers.clear();
|
|
|
- mSubscriptionNumbers.addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
Log.d("allsubscription:", mSubscriptionNumbers.toString());
|
|
|
mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
}
|