|
|
@@ -1,6 +1,7 @@
|
|
|
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;
|
|
|
@@ -147,12 +148,15 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
deleteTv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- mSubscriptionNumbers.get(position - 1).setRemoved(1);
|
|
|
- mDbManager.updateAllSubs(mSubscriptionNumbers.get(position - 1));
|
|
|
- mSubscriptionNumbers.remove(position - 1);
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().get(position - 1).setRemoved(1);
|
|
|
+ mDbManager.updateAllSubs(mAllSubscriptionAdapter.getmSubscriptionNumbers().get(position - 1));
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().remove(position - 1);
|
|
|
+
|
|
|
+
|
|
|
mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
- mAllSubscriptonKindMessages.get(rbPos).setSubscriptionNumbers(mSubscriptionNumbers);
|
|
|
- if (mSubscriptionNumbers.size() == 0) {
|
|
|
+ mAllSubscriptonKindMessages.get(rbPos).setSubscriptionNumbers( mAllSubscriptionAdapter.getmSubscriptionNumbers());
|
|
|
+
|
|
|
+ if (mAllSubscriptionAdapter.getmSubscriptionNumbers().size() == 0) {
|
|
|
mAllSubscriptonKindMessages.remove(rbPos);
|
|
|
keyStrings.remove(rbPos);
|
|
|
if (keyStrings.size() == 0) {
|
|
|
@@ -160,15 +164,15 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
initKeyStrings();
|
|
|
mTypeListView.setVisibility(View.GONE);
|
|
|
mEmptyLayout.showEmpty();
|
|
|
- mSubscriptionNumbers.clear();
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
} else {
|
|
|
rbPos = 0;
|
|
|
mTypeListView.setVisibility(View.VISIBLE);
|
|
|
mSubsTypeAdapter.notifyDataSetChanged();
|
|
|
initKeyStrings();
|
|
|
- mSubscriptionNumbers.clear();
|
|
|
- mSubscriptionNumbers.addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
|
|
|
}
|
|
|
@@ -180,6 +184,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
mDeletePopupWindow = new PopupWindow(popView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
|
|
mDeletePopupWindow.setOutsideTouchable(true);
|
|
|
mDeletePopupWindow.setFocusable(true);
|
|
|
+ mDeletePopupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
mDeletePopupWindow.showAtLocation(getActivity().getWindow().getDecorView(), Gravity.CENTER, 0, 0);
|
|
|
DisplayUtil.backgroundAlpha(getActivity(), 0.5f);
|
|
|
mDeletePopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
@@ -200,9 +205,11 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
mSubsTypeAdapter.notifyDataSetChanged();
|
|
|
rbPos = position;
|
|
|
if (mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers().size() != 0) {
|
|
|
- mSubscriptionNumbers.clear();
|
|
|
- mSubscriptionNumbers.addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
- mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
+// mSubscriptionNumbers.clear();
|
|
|
+// mSubscriptionNumbers.addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+// mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
+ mAllSubscriptionAdapter =new AllSubscriptionAdapter(getActivity(),mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+ mPullToRefreshListView.getRefreshableView().setAdapter(mAllSubscriptionAdapter);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -229,7 +236,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
initKeyStrings();
|
|
|
mTypeListView.setVisibility(View.GONE);
|
|
|
mEmptyLayout.showEmpty();
|
|
|
- mSubscriptionNumbers.clear();
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
} else {
|
|
|
rbPos = 0;
|
|
|
@@ -237,8 +244,8 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
mSubsTypeAdapter.notifyDataSetChanged();
|
|
|
initKeyStrings();
|
|
|
|
|
|
- mSubscriptionNumbers.clear();
|
|
|
- mSubscriptionNumbers.addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
|
|
|
+ mAllSubscriptionAdapter.getmSubscriptionNumbers().addAll(mAllSubscriptonKindMessages.get(rbPos).getSubscriptionNumbers());
|
|
|
mAllSubscriptionAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
closeDeletePopupWindow();
|
|
|
@@ -248,6 +255,7 @@ public class SubscriptionAllFragment extends BaseFragment {
|
|
|
mDeletePopupWindow = new PopupWindow(popView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
|
|
mDeletePopupWindow.setOutsideTouchable(true);
|
|
|
mDeletePopupWindow.setFocusable(true);
|
|
|
+ mDeletePopupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
mDeletePopupWindow.showAtLocation(getActivity().getWindow().getDecorView(), Gravity.CENTER, 0, 0);
|
|
|
DisplayUtil.backgroundAlpha(getActivity(), 0.5f);
|
|
|
mDeletePopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
|