Skip to content

Commit

Permalink
hzuapps#4 hzuapps#36 第四次作业
Browse files Browse the repository at this point in the history
  • Loading branch information
hizzj committed May 16, 2017
1 parent 5d35dba commit b3de302
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ protected void onCreate(Bundle savedInstanceState) {
btn_s.setVisibility(View.GONE);
if("user".equals(i))
{
btn_s.setVisibility(View.GONE); //如果是学生用户就只显示作业内容
btn_s.setVisibility(View.GONE); //如果是学生用户就只显示作业内容,不显示按钮.
}
else
{
btn_s.setVisibility(View.VISIBLE);//如果是教师用户除了显示作业内容之外,还显示提交按钮,教师用户编辑作业内容之后点此按钮提交
btn_s.setVisibility(View.VISIBLE);//如果是教师用户除了显示作业内容之外,还显示提交按钮,教师用户编辑作业内容之后点此按钮提交.
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected void onCreate(Bundle savedInstanceState) {
String psword=intent.getStringExtra("password");
if("zzj".equals(uname)&&"12345".equals(psword)) /*教师用户*/
{
WorkAdapter adapter=new WorkAdapter(Net1414080903110_WorkListActivity.this,R.layout.work_item,work_infoList);
WorkAdapter adapter=new WorkAdapter(Net1414080903110_WorkListActivity.this,R.layout.net1414080903110_work_item,work_infoList);
ListView listView=(ListView)findViewById(R.id.list_view);
listView.setAdapter(adapter);
/*给ListView的各Item项设置长按监听事件(这里主要是用来删除作业的,后期会把功能加进去)*/
Expand All @@ -45,11 +45,11 @@ public boolean onItemLongClick(AdapterView<?>parent, View view, int position, lo
return true;
}
});
button.setVisibility(View.VISIBLE);/*让布置作业按钮显示*/
button.setVisibility(View.VISIBLE);/*教师用户,让布置作业按钮显示.*/
i="admin";
}
else{
button.setVisibility(View.GONE);/*如果是学生用户 让布置作业按钮隐藏*/
button.setVisibility(View.GONE);/*如果是学生用户 让布置作业按钮隐藏.*/
i="user";
}
WorkAdapter adapter=new WorkAdapter(Net1414080903110_WorkListActivity.this,R.layout.work_item,work_infoList);//实例化WorkAdapter适配器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!--app登录界面-->
<!--通过login_button_bg.xml给按钮设置背景-->
<Button
android:id="@+id/login"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="edu.hzuapps.androidlabs.homeworks.net1414080903110.Net1414080903110_SubmitActivity">

<!--作业提交界面-->
<!--作业提交界面-->
<EditText
android:id="@+id/work_info"
android:layout_width="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="edu.hzuapps.androidlabs.homeworks.net1414080903110.Net1414080903110_WorkListActivity">

<!--作业列表界面-->
<!--作业列表界面-->
<Button
android:id="@+id/btn1"
android:layout_width="100dp"
Expand Down
19 changes: 19 additions & 0 deletions AndroidLabs/app/src/main/res/layout/net1414080903110_work_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<!--作业列表TextView样式!-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="8"
android:id="@+id/work_name"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp"
android:lineSpacingExtra="10dp"
android:textSize="18sp"
android:textColor="#0000CC"
/>
</LinearLayout>

0 comments on commit b3de302

Please sign in to comment.