|
|
@@ -1,6 +1,10 @@
|
|
|
package com.sheep.jiuyan.samllsheep.page;
|
|
|
|
|
|
+import android.database.DataSetObserver;
|
|
|
import android.text.TextUtils;
|
|
|
+import android.view.View;
|
|
|
+import android.view.ViewGroup;
|
|
|
+import android.widget.ExpandableListAdapter;
|
|
|
import android.widget.ListView;
|
|
|
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
@@ -34,29 +38,30 @@ public class MoneyHistroyActivity extends BaseActivity {
|
|
|
public void initView() {
|
|
|
mLv = (ListView) findViewById(R.id.lv);
|
|
|
TitleBarUtils.getInstance()
|
|
|
- .setTitle(this,"资金记录")
|
|
|
+ .setTitle(this, "资金记录")
|
|
|
.setTitleFinish(this);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void initListener() {
|
|
|
}
|
|
|
- private void showView(List<MoneyHistroy> orders){
|
|
|
- mAdapter=new CommonAdapter<MoneyHistroy>(MoneyHistroyActivity.this,R.layout.money_history_item, orders) {
|
|
|
+
|
|
|
+ private void showView(List<MoneyHistroy> orders) {
|
|
|
+ mAdapter = new CommonAdapter<MoneyHistroy>(MoneyHistroyActivity.this, R.layout.money_history_item, orders) {
|
|
|
@Override
|
|
|
protected void convert(ViewHolder viewHolder, MoneyHistroy item, int position) {
|
|
|
|
|
|
- viewHolder.setText(R.id.tv_time, item.getCreateTime().replace(" ","\n"));
|
|
|
+ viewHolder.setText(R.id.tv_time, item.getCreateTime().replace(" ", "\n"));
|
|
|
viewHolder.setText(R.id.tv_blacne, item.getBalance());
|
|
|
viewHolder.setText(R.id.tv_des, item.getDesc());
|
|
|
- if(!TextUtils.isEmpty(item.getMoney())){
|
|
|
+ if (!TextUtils.isEmpty(item.getMoney())) {
|
|
|
|
|
|
- String str=item.getMoney();
|
|
|
- if(str.startsWith("-")){
|
|
|
- viewHolder.setTextColor(R.id.tv_money,getResources().getColor(R.color.green));
|
|
|
+ String str = item.getMoney();
|
|
|
+ if (str.startsWith("-")) {
|
|
|
+ viewHolder.setTextColor(R.id.tv_money, getResources().getColor(R.color.green));
|
|
|
viewHolder.setText(R.id.tv_money, str.substring(1));
|
|
|
- }else{
|
|
|
- viewHolder.setTextColor(R.id.tv_money,getResources().getColor(R.color.sheep_red));
|
|
|
+ } else {
|
|
|
+ viewHolder.setTextColor(R.id.tv_money, getResources().getColor(R.color.sheep_red));
|
|
|
viewHolder.setText(R.id.tv_money, str);
|
|
|
}
|
|
|
}
|
|
|
@@ -64,22 +69,116 @@ public class MoneyHistroyActivity extends BaseActivity {
|
|
|
}
|
|
|
};
|
|
|
mLv.setAdapter(mAdapter);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void getTask(){
|
|
|
+ private void getTask() {
|
|
|
final HashMap<String, String> map = new HashMap<>();
|
|
|
map.put("wx_open_id", SpUtils.getOpenId(this));
|
|
|
NetManager.get(Url.MONEYRECORD, map, getApplicationContext(), new SheepCallback<List<MoneyHistroy>>(this) {
|
|
|
@Override
|
|
|
public void success(List<MoneyHistroy> orders) {
|
|
|
- showView(orders);
|
|
|
+ showView(orders);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public void initData() {
|
|
|
getTask();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ class MoneyAdapter implements ExpandableListAdapter {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void registerDataSetObserver(DataSetObserver observer) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void unregisterDataSetObserver(DataSetObserver observer) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getGroupCount() {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getChildrenCount(int groupPosition) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object getGroup(int groupPosition) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object getChild(int groupPosition, int childPosition) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public long getGroupId(int groupPosition) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public long getChildId(int groupPosition, int childPosition) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean hasStableIds() {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean isChildSelectable(int groupPosition, int childPosition) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean areAllItemsEnabled() {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean isEmpty() {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onGroupExpanded(int groupPosition) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onGroupCollapsed(int groupPosition) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public long getCombinedChildId(long groupId, long childId) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public long getCombinedGroupId(long groupId) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|