@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (swipeRefreshLayout != null) swipeRefreshLayout.post( new Runnable() { @Override public void run() { onRefresh(); } }); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); FermatWorker worker = new FermatWorker() { @Override protected Object doInBackground() throws Exception { if (manager == null) throw new NullPointerException("AssetUserWalletModuleManager is null"); assetUserWalletList = manager.getAssetUserWalletBalances("walletPublicKeyTest"); if (assetUserWalletList != null && !assetUserWalletList.isEmpty()) { bookAssets = new ArrayList<>(); for (AssetUserWalletList assetUserWallet : assetUserWalletList) { DigitalAsset asset = new DigitalAsset( assetUserWallet.getDigitalAsset().getName(), String.valueOf( String.format( "BookBalance: %d - AvailableBalance: %d", assetUserWallet.getQuantityBookBalance(), assetUserWallet.getQuantityAvailableBalance()))); asset.setAssetPublicKey(assetUserWallet.getDigitalAsset().getPublicKey()); asset.setWalletPublicKey("public_key"); bookAssets.add(asset); } } return true; } }; worker.setContext(getActivity()); worker.setCallBack( new FermatWorkerCallBack() { @Override public void onPostExecute(Object... result) { if (getActivity() != null) { if (bookAssets != null && !bookAssets.isEmpty()) { if (adapter != null) adapter.changeDataSet(bookAssets); } } } @Override public void onErrorOccurred(Exception ex) { if (getActivity() != null) Toast.makeText(getActivity(), ex.getMessage(), Toast.LENGTH_LONG).show(); CommonLogger.exception(this.getClass().getName(), ex.getMessage(), ex); ex.printStackTrace(); } }); worker.execute(); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); lv = (ExpandableListView) view.findViewById(R.id.expListView); lv.setAdapter(new ExpandableListAdapter(contacts, transactions)); lv.setGroupIndicator(null); lv.setOnItemClickListener(null); /* lv.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent intent; intent = new Intent(getActivity(), SentDetailActivity.class); startActivity(intent); return true; } });*/ lv.setOnGroupClickListener( new ExpandableListView.OnGroupClickListener() { @Override public boolean onGroupClick( ExpandableListView parent, View v, int groupPosition, long id) { /* Intent intent; intent = new Intent(getActivity(), ReceiveFromNewContactActivity.class); startActivity(intent);*/ // Intent intent; // // appRuntimeMiddleware.getActivity(Activities.CWP_WALLET_RUNTIME_ADULTS_ALL_CONTACTS_NEW_RECEIVE); // intent = new Intent(getActivity(), // com.bitdubai.android_core.app.FragmentActivity.class); // startActivity(intent); return groupPosition == 0; } }); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); }