parent
bfe8acad30
commit
282a28978a
@ -0,0 +1,52 @@
|
||||
package hunnu.sj.raise_money.donated_record;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import hunnu.sj.raise_money.R;
|
||||
import hunnu.sj.raise_money.record.Record;
|
||||
|
||||
public class DonatedRecordAdapter extends BaseAdapter {
|
||||
private ArrayList<Record> recordlist;
|
||||
private Context context;
|
||||
public DonatedRecordAdapter(Context context, ArrayList<Record> recordlist) {
|
||||
|
||||
this.context = context;
|
||||
this.recordlist = recordlist;
|
||||
}
|
||||
@Override
|
||||
public int getCount() {
|
||||
return recordlist.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return recordlist.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View view = null;
|
||||
if(convertView != null){
|
||||
view = convertView;
|
||||
}else{
|
||||
view = View.inflate(context, R.layout.donate_record_item,null);
|
||||
}
|
||||
Record record = recordlist.get(position);
|
||||
TextView record_vw = view.findViewById(R.id.record_descri);
|
||||
String descri = "用户"+record.getUsername()+"于"+record.getTime()+"捐赠了"+record.getDonatemon()+"元";
|
||||
record_vw.setText(descri);
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package hunnu.sj.raise_money.donate_record;
|
||||
package hunnu.sj.raise_money.record;
|
||||
|
||||
public class Record {
|
||||
private long id = 0;
|
@ -1,26 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/visibility_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible" >
|
||||
android:visibility="invisible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/news_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="61dp"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:textSize="20sp" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="161dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ph1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:srcCompat="@tools:sample/avatars" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ph2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:srcCompat="@tools:sample/avatars" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ph3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:srcCompat="@tools:sample/avatars" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/news_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="457dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="15dp"
|
||||
android:scrollbars="vertical"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="75dp"
|
||||
android:text="捐助信息" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="75dp"
|
||||
android:text="捐助" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
Loading…
Reference in new issue