Created
October 29, 2013 23:52
-
-
Save snadjafi/7224798 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static KuaCustomDialogFragment newInstance(String messageBody, String title, String negativeButtonText, String positiveButtonText, boolean isCancelable) | |
| { | |
| KuaCustomDialogFragment mCustomDialog = new KuaCustomDialogFragment(); | |
| Bundle args = new Bundle(); | |
| args.putString("body", messageBody); | |
| args.putBoolean("cancelable",isCancelable); | |
| if (title!= null) | |
| args.putString("title", title); | |
| if (negativeButtonText == null && positiveButtonText != null) | |
| args.putString("neutral", positiveButtonText); | |
| if (negativeButtonText != null && positiveButtonText != null) | |
| { | |
| args.putString("negative", negativeButtonText); | |
| args.putString("positive", positiveButtonText); | |
| } | |
| mCustomDialog.setArguments(args); | |
| return mCustomDialog; | |
| } | |
| @Override | |
| public void onAttach(Activity activity) | |
| { | |
| super.onAttach(activity); | |
| if(getParentFragment() instanceof ReceiptListFragmentInterface) | |
| receiptListCoordinator = (ReceiptListFragmentInterface) getParentFragment(); | |
| else if (activity instanceof ReceiptListFragmentInterface) | |
| receiptListCoordinator = (ReceiptListFragmentInterface) activity; | |
| else | |
| throw new ClassCastException("Parent container must implement ReceiptListFragmentInterface"); | |
| receiptArrayList = new ArrayList<Receipt>(); | |
| receiptItemAdapter = new ReceiptItemAdapter(getActivity(), R.layout.row_receipt, R.layout.row_settings_header, receiptArrayList); | |
| if (KuapayLibrary.receiptsProvider.isReceiptListDirty()) | |
| KuapayLibrary.receiptsProvider.fetchReceiptList(fetchReceiptResponseHandler); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment