浏览代码

教师功能仅差所授课程的考勤数据

bfzgs 2 年之前
父节点
当前提交
2e6c357704
共有 17 个文件被更改,包括 1211 次插入62 次删除
  1. 7 0
      app/src/main/AndroidManifest.xml
  2. 5 5
      app/src/main/java/org/brynhild/graduation/activity/admin/ActivityDetailInfoActivity.kt
  3. 1 3
      app/src/main/java/org/brynhild/graduation/activity/common/TimetableActivity.kt
  4. 126 0
      app/src/main/java/org/brynhild/graduation/activity/teacher/ClassDetailInfoActivityUsingByTeacher.kt
  5. 64 2
      app/src/main/java/org/brynhild/graduation/activity/teacher/ui/clazz/ClazzFragment.kt
  6. 216 1
      app/src/main/java/org/brynhild/graduation/activity/teacher/ui/timetable/TimetableFragment.kt
  7. 282 2
      app/src/main/java/org/brynhild/graduation/activity/teacher/ui/user/UserFragment.kt
  8. 0 2
      app/src/main/java/org/brynhild/graduation/activity/user/ui/timetable/TimetableFragment.kt
  9. 0 6
      app/src/main/java/org/brynhild/graduation/activity/user/ui/user/UserFragment.kt
  10. 5 0
      app/src/main/java/org/brynhild/graduation/common/transfer/vo/timetable/QueryTeachingClassRequest.kt
  11. 50 0
      app/src/main/java/org/brynhild/graduation/network/adapter/ClassEntityAdapterUsingByTeacher.kt
  12. 50 0
      app/src/main/java/org/brynhild/graduation/network/adapter/UserAdapterUsingByTeacher.kt
  13. 33 0
      app/src/main/java/org/brynhild/graduation/service/http/TeacherService.kt
  14. 114 0
      app/src/main/res/layout/activity_class_detail_info_using_by_teacher.xml
  15. 20 14
      app/src/main/res/layout/fragment_clazz.xml
  16. 54 14
      app/src/main/res/layout/fragment_timetable_teacher.xml
  17. 184 13
      app/src/main/res/layout/fragment_user_teacher.xml

+ 7 - 0
app/src/main/AndroidManifest.xml

@@ -50,6 +50,13 @@
                 android:name="android.app.lib_name"
                 android:value="" />
         </activity>
+        <activity
+            android:name=".activity.teacher.ClassDetailInfoActivityUsingByTeacher"
+            android:exported="true" >
+            <meta-data
+                android:name="android.app.lib_name"
+                android:value="" />
+        </activity>
         <activity
             android:name=".activity.common.TimetableActivity"
             android:exported="true" >

+ 5 - 5
app/src/main/java/org/brynhild/graduation/activity/admin/TimeTableDetailInfoActivity.kt → app/src/main/java/org/brynhild/graduation/activity/admin/ActivityDetailInfoActivity.kt

@@ -42,7 +42,7 @@ import retrofit2.Response
 import java.io.File
 import java.io.IOException
 
-class TimeTableDetailInfoActivity : BaseActivity() {
+class ActivityDetailInfoActivity : BaseActivity() {
     private lateinit var binding: ActivityAcademyDetailInfoBinding
     private lateinit var course: Course
     private val updateAccountAvatar = 2
@@ -98,10 +98,10 @@ class TimeTableDetailInfoActivity : BaseActivity() {
                                 majorArrayList.add(major)
                             }
                         }
-                        val adapter = MajorAdapter(this@TimeTableDetailInfoActivity, majorArrayList)
+                        val adapter = MajorAdapter(this@ActivityDetailInfoActivity, majorArrayList)
 
                         binding.recyclerView.adapter = MultipleSelectHandler.createHandler(
-                            this@TimeTableDetailInfoActivity,
+                            this@ActivityDetailInfoActivity,
                             adapter,
                             object :
                                 RecyclerViewCallback {
@@ -120,7 +120,7 @@ class TimeTableDetailInfoActivity : BaseActivity() {
                                         }
                                         builder.append(majorArrayList[index].name)
                                     }
-                                    ConfirmPopupWindow.ConfirmPopupWindowBuilder.init(this@TimeTableDetailInfoActivity)
+                                    ConfirmPopupWindow.ConfirmPopupWindowBuilder.init(this@ActivityDetailInfoActivity)
                                         .setContent("以下专业将被删除:${builder}")
                                         .setCancelText("取消删除")
                                         .setEnsureText("确定删除")
@@ -217,7 +217,7 @@ class TimeTableDetailInfoActivity : BaseActivity() {
     override fun onOptionsItemSelected(item: MenuItem): Boolean {
         when (item.itemId) {
             R.id.admin_academy_delete -> {
-                ConfirmPopupWindow.ConfirmPopupWindowBuilder.init(this@TimeTableDetailInfoActivity)
+                ConfirmPopupWindow.ConfirmPopupWindowBuilder.init(this@ActivityDetailInfoActivity)
                     .setContent("确定删除学院:${course.name}吗")
                     .setCancelText("取消删除")
                     .setEnsureText("确定删除")

+ 1 - 3
app/src/main/java/org/brynhild/graduation/activity/common/TimetableActivity.kt

@@ -53,7 +53,7 @@ class TimetableActivity : BaseActivity() {
                     null
                 )
                 service.queryTimeTable(LoginConfiguration.userInfo!!.token, data)
-                    .enqueue(object : Callback<org.brynhild.graduation.common.transfer.Result> {
+                    .enqueue(object : Callback<Result> {
                         override fun onResponse(call: Call<Result>, response: Response<Result>) {
                             ResponseHandler.handle(response, {
                                 val gson = Gson()
@@ -102,8 +102,6 @@ class TimetableActivity : BaseActivity() {
         binding.idMore.setOnClickListener {
             showPopMenu()
         }
-
-//        subjects.addAll()
         binding.idLayout.setOnClickListener {
             when (it.id) {
                 R.id.id_layout -> {

+ 126 - 0
app/src/main/java/org/brynhild/graduation/activity/teacher/ClassDetailInfoActivityUsingByTeacher.kt

@@ -0,0 +1,126 @@
+package org.brynhild.graduation.activity.teacher
+
+import android.app.AlertDialog
+import android.content.Intent
+import android.os.Bundle
+import android.os.Handler
+import android.util.Log
+import android.view.LayoutInflater
+import android.view.Menu
+import android.view.MenuItem
+import androidx.recyclerview.widget.GridLayoutManager
+import com.example.devicemanager.view.ConfirmPopupWindow
+import com.google.gson.Gson
+import org.brynhild.graduation.R
+import org.brynhild.graduation.activity.common.BaseActivity
+import org.brynhild.graduation.activity.common.StatisticActivity
+import org.brynhild.graduation.activity.common.TimetableActivity
+import org.brynhild.graduation.common.callback.RecyclerViewCallback
+import org.brynhild.graduation.common.config.LoginConfiguration
+import org.brynhild.graduation.common.constant.StatisticConstant
+import org.brynhild.graduation.common.transfer.Result
+import org.brynhild.graduation.common.transfer.handler.ResponseHandler
+import org.brynhild.graduation.common.transfer.utils.ServiceCreator
+import org.brynhild.graduation.common.transfer.vo.device.AdminClearFingerPrintDataAtDevice
+import org.brynhild.graduation.common.transfer.vo.device.AdminGetClassFingerPrintDataIdList
+import org.brynhild.graduation.common.transfer.vo.device.AdminPushFingerPrintDataToDevice
+import org.brynhild.graduation.common.transfer.vo.device.EnrollFingerPrint
+import org.brynhild.graduation.common.transfer.vo.user.*
+import org.brynhild.graduation.common.utils.JsonUtils
+import org.brynhild.graduation.common.utils.MultipleSelectHandler
+import org.brynhild.graduation.databinding.*
+import org.brynhild.graduation.network.adapter.UserAdapter
+import org.brynhild.graduation.network.adapter.UserAdapterUsingByTeacher
+import org.brynhild.graduation.network.entiity.ClassEntity
+import org.brynhild.graduation.network.entiity.User
+import org.brynhild.graduation.service.http.AdminService
+import org.brynhild.graduation.service.http.TeacherService
+import retrofit2.Call
+import retrofit2.Callback
+import retrofit2.Response
+
+
+class ClassDetailInfoActivityUsingByTeacher : BaseActivity() {
+    private lateinit var binding: ActivityClassDetailInfoUsingByTeacherBinding
+    private lateinit var classEntity: ClassEntity
+    private val refreshStudentList = 0
+    private var continueEnroll = true
+    private var enrollDeviceMac = ""
+    private lateinit var userList: ArrayList<User>
+
+    val handler: Handler = Handler {
+        when (it.what) {
+            refreshStudentList -> {
+                loadStudentList()
+            }
+        }
+        false
+    }
+
+    private fun loadStudentList() {
+        val service = ServiceCreator.create(TeacherService::class.java)
+        val data = QueryUserRequest(null, null, null, null, null, null, null, classEntity.id)
+        Log.d("Admin", "查询班级列表:${data}")
+        service.queryUser(LoginConfiguration.userInfo!!.token, data)
+            .enqueue(object : Callback<Result> {
+                override fun onResponse(call: Call<Result>, response: Response<Result>) {
+                    ResponseHandler.handle(response, { result ->
+                        Log.d(
+                            "AddDeviceActivity",
+                            "flag is ${result.flag},message is ${result.message},data is ${result.data}"
+                        )
+                        val userArrayList = ArrayList<User>()
+                        val gson = Gson()
+                        for (item in result.data as ArrayList<*>) {
+                            val json = gson.toJson(item)
+                            val user = JsonUtils.fromJson<User>(json)
+                            if (user != null) {
+                                userArrayList.add(user)
+                            }
+                        }
+                        userList = userArrayList
+                        val adapter = UserAdapterUsingByTeacher(this@ClassDetailInfoActivityUsingByTeacher, userArrayList)
+
+                        binding.recyclerView.adapter = adapter
+                    }, {
+                        ResponseHandler.showMessage(it)
+                    })
+                }
+
+                override fun onFailure(call: Call<Result>, t: Throwable) {
+                    t.printStackTrace()
+                }
+            })
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+
+        binding = ActivityClassDetailInfoUsingByTeacherBinding.inflate(LayoutInflater.from(this))
+        setContentView(binding.root)
+        setSupportActionBar(binding.toolBar)
+        val layoutManager = GridLayoutManager(this, 2)
+        binding.recyclerView.layoutManager = layoutManager
+
+        val gson = Gson()
+        classEntity = gson.fromJson(intent.getStringExtra("class"), ClassEntity::class.java)
+
+        setTableData(classEntity)
+
+        bindClick()
+
+        loadStudentList()
+    }
+
+    private fun bindClick() {
+        binding.backButton.setOnClickListener {
+            finish()
+        }
+    }
+
+    private fun setTableData(entity: ClassEntity) {
+        binding.no.text = entity.no
+        binding.name.text = entity.name
+        binding.title.text = entity.name
+    }
+}

+ 64 - 2
app/src/main/java/org/brynhild/graduation/activity/teacher/ui/clazz/ClazzFragment.kt

@@ -4,13 +4,31 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
-import android.widget.TextView
+import android.widget.Toast
 import androidx.fragment.app.Fragment
+import androidx.recyclerview.widget.GridLayoutManager
+import com.google.gson.Gson
+import org.brynhild.graduation.common.callback.DefaultCallback
+import org.brynhild.graduation.common.config.LoginConfiguration
+import org.brynhild.graduation.common.transfer.handler.ResponseHandler
+import org.brynhild.graduation.common.transfer.utils.ServiceCreator
+import org.brynhild.graduation.common.transfer.vo.timetable.QueryTeachingClassRequest
+import org.brynhild.graduation.common.utils.JsonUtils
 import org.brynhild.graduation.databinding.FragmentClazzBinding
+import org.brynhild.graduation.network.adapter.ClassEntityAdapter
+import org.brynhild.graduation.network.adapter.ClassEntityAdapterUsingByTeacher
+import org.brynhild.graduation.network.adapter.CourseAdapter
+import org.brynhild.graduation.network.entiity.ClassEntity
+import org.brynhild.graduation.network.entiity.Course
+import org.brynhild.graduation.service.http.TeacherService
+import retrofit2.Call
+import retrofit2.Callback
+import retrofit2.Response
 
 class ClazzFragment : Fragment() {
 
     private var _binding: FragmentClazzBinding? = null
+    private val singleColumnLayout = GridLayoutManager(this@ClazzFragment.context, 1)
 
     // This property is only valid between onCreateView and
     // onDestroyView.
@@ -25,7 +43,19 @@ class ClazzFragment : Fragment() {
         _binding = FragmentClazzBinding.inflate(inflater, container, false)
         val root: View = binding.root
 
-        val textView: TextView = binding.textNotifications
+        binding.recyclerView.layoutManager = singleColumnLayout
+
+        binding.swipeRefresh.setOnRefreshListener {
+            loadTeachingClassList{
+                Toast.makeText(this@ClazzFragment.context,"数据更新完成",Toast.LENGTH_SHORT).show()
+            }
+            binding.swipeRefresh.isRefreshing = false
+        }
+
+        loadTeachingClassList{
+
+        }
+
         return root
     }
 
@@ -33,4 +63,36 @@ class ClazzFragment : Fragment() {
         super.onDestroyView()
         _binding = null
     }
+
+    private fun loadTeachingClassList(callback: DefaultCallback) {
+        val service = ServiceCreator.create(TeacherService::class.java)
+        val data = QueryTeachingClassRequest(LoginConfiguration.userInfo!!.user.id)
+        service.queryTeachingClass(LoginConfiguration.userInfo!!.token, data)
+            .enqueue(object : Callback<org.brynhild.graduation.common.transfer.Result> {
+                override fun onResponse(call: Call<org.brynhild.graduation.common.transfer.Result>, response: Response<org.brynhild.graduation.common.transfer.Result>) {
+                    ResponseHandler.handle(response, {
+                        val gson = Gson()
+                        val clientArrayList = ArrayList<ClassEntity>()
+                        for (item in it.data as ArrayList<*>) {
+                            val json = gson.toJson(item)
+                            val user = JsonUtils.fromJson<ClassEntity>(json)
+                            if (user != null) {
+                                clientArrayList.add(user)
+                            }
+                        }
+                        this@ClazzFragment.context?.let {
+                            val adapter = ClassEntityAdapterUsingByTeacher(it, clientArrayList)
+                            binding.recyclerView.adapter = adapter
+                        }
+                        callback.execute()
+                    }, {
+                        ResponseHandler.showMessage(it)
+                    })
+                }
+
+                override fun onFailure(call: Call<org.brynhild.graduation.common.transfer.Result>, t: Throwable) {
+                    t.printStackTrace()
+                }
+            })
+    }
 }

+ 216 - 1
app/src/main/java/org/brynhild/graduation/activity/teacher/ui/timetable/TimetableFragment.kt

@@ -1,16 +1,40 @@
 package org.brynhild.graduation.activity.teacher.ui.timetable
 
+import android.graphics.Color
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import android.widget.PopupMenu
 import android.widget.TextView
+import android.widget.Toast
+import androidx.appcompat.app.AlertDialog
 import androidx.fragment.app.Fragment
+import com.google.gson.Gson
+import com.zhuangfei.timetable.listener.ISchedule
+import com.zhuangfei.timetable.listener.IWeekView
+import com.zhuangfei.timetable.listener.OnSlideBuildAdapter
+import com.zhuangfei.timetable.model.Schedule
+import org.brynhild.graduation.R
+import org.brynhild.graduation.common.config.LoginConfiguration
+import org.brynhild.graduation.common.config.MyApplication
+import org.brynhild.graduation.common.transfer.Result
+import org.brynhild.graduation.common.transfer.handler.ResponseHandler
+import org.brynhild.graduation.common.transfer.utils.ServiceCreator
+import org.brynhild.graduation.common.transfer.vo.timetable.QueryTimeTableRequest
+import org.brynhild.graduation.common.utils.JsonUtils
 import org.brynhild.graduation.databinding.FragmentTimetableTeacherBinding
+import org.brynhild.graduation.network.entiity.TimeTableInfo
+import org.brynhild.graduation.service.http.StudentService
+import org.brynhild.graduation.service.http.TeacherService
+import retrofit2.Call
+import retrofit2.Callback
+import retrofit2.Response
 
 class TimetableFragment : Fragment() {
 
     private var _binding: FragmentTimetableTeacherBinding? = null
+    private val subjects = ArrayList<TimeTableInfo>()
 
     // This property is only valid between onCreateView and
     // onDestroyView.
@@ -25,12 +49,203 @@ class TimetableFragment : Fragment() {
         _binding = FragmentTimetableTeacherBinding.inflate(inflater, container, false)
         val root: View = binding.root
 
-        val textView: TextView = binding.textDashboard
+        binding.idMore.setOnClickListener {
+            showPopMenu()
+        }
+
+        binding.idLayout.setOnClickListener {
+            when (it.id) {
+                R.id.id_layout -> {
+                    if (binding.idWeekview.isShowing) {
+                        binding.idWeekview.isShow(false)
+                        binding.idTitle.setTextColor(resources.getColor(com.zhuangfei.android_timetableview.sample.R.color.app_course_textcolor_blue))
+                        val cur = binding.idTimetableView.curWeek()
+                        binding.idTimetableView.onDateBuildListener()
+                            .onUpdateDate(cur, cur)
+                        binding.idTimetableView.changeWeekOnly(cur)
+                    } else {
+                        binding.idWeekview.isShow(true)
+                        binding.idTitle.setTextColor(resources.getColor(com.zhuangfei.android_timetableview.sample.R.color.app_red))
+                    }
+                }
+            }
+        }
+
+
+        LoginConfiguration.loadTimeTableConfig{
+            initTimetableView()
+            loadTimeTableData()
+        }
+
         return root
     }
 
+    private fun loadTimeTableData() {
+        val service = ServiceCreator.create(TeacherService::class.java)
+        val data = QueryTimeTableRequest(
+            null,
+            null,
+            null,
+            LoginConfiguration.userInfo!!.user.id,
+            null,
+            null,
+            null,
+            null,
+            null,
+            null
+        )
+        service.queryTimeTable(LoginConfiguration.userInfo!!.token, data)
+            .enqueue(object : Callback<Result> {
+                override fun onResponse(call: Call<Result>, response: Response<Result>) {
+                    ResponseHandler.handle(response, {
+                        val gson = Gson()
+                        for (item in it.data as ArrayList<*>) {
+                            val json = gson.toJson(item)
+                            val timetable = JsonUtils.fromJson<TimeTableInfo>(json)
+                            if (timetable != null) {
+                                subjects.add(timetable)
+                            }
+                        }
+                        initTimetableView()
+                    }, {
+                        ResponseHandler.showMessage(it)
+                    })
+                }
+
+                override fun onFailure(call: Call<Result>, t: Throwable) {
+                    t.printStackTrace()
+                }
+            })
+
+    }
+
     override fun onDestroyView() {
         super.onDestroyView()
         _binding = null
     }
+
+    override fun onStart() {
+        super.onStart()
+        binding.idTimetableView.onDateBuildListener()
+            .onHighLight()
+    }
+
+    private fun display(list: List<Schedule>) {
+        val builder = StringBuilder()
+        for (item in list) {
+            builder.append(item.name).append("、")
+        }
+        Toast.makeText(MyApplication.context, builder.toString(), Toast.LENGTH_SHORT).show()
+    }
+
+    private fun showPopMenu() {
+        val menu = PopupMenu(this@TimetableFragment.context, binding.idMore)
+        menu.menuInflater.inflate(R.menu.timetable_menu, menu.menu)
+        menu.setOnMenuItemClickListener {
+            when (it.itemId) {
+                R.id.showAllCourse -> {
+                    binding.idTimetableView.isShowNotCurWeek(true).updateView()
+                }
+                R.id.showCurrentCourse -> {
+                    binding.idTimetableView.isShowNotCurWeek(false).updateView()
+                }
+                R.id.showTime -> {
+                    val time = mutableListOf(
+                        "08:00",
+                        "08:55",
+                        "10:10",
+                        "11:05",
+                        "14:00",
+                        "14:55",
+                        "16:10",
+                        "17:05",
+                        "19:00",
+                        "19:55",
+                        "20:50"
+                    ).toTypedArray()
+                    val listener =
+                        binding.idTimetableView.onSlideBuildListener() as OnSlideBuildAdapter
+                    listener.times = time
+                    listener.setTimeTextColor(Color.BLACK)
+                    binding.idTimetableView.updateSlideView()
+                }
+                R.id.hiddenTime -> {
+                    binding.idTimetableView.callback(OnSlideBuildAdapter())
+                    binding.idTimetableView.updateSlideView()
+                }
+            }
+            true
+        }
+        menu.show()
+    }
+
+    private fun initTimetableView() {
+        with(binding.idWeekview) {
+            source(subjects)
+            callback { week ->
+                val cur = binding.idTimetableView.curWeek()
+                binding.idTimetableView.onDateBuildListener()
+                    .onUpdateDate(cur, week)
+                binding.idTimetableView.changeWeekOnly(week)
+            }
+            callback(IWeekView.OnWeekLeftClickedListener {
+                val itemCount = binding.idWeekview.itemCount()
+                val items = mutableListOf<String>()
+                for (i in 1..itemCount) {
+                    items.add("第${i}周")
+                }
+                var target = -1
+
+                if(this@TimetableFragment.context!=null){
+                    val builder = AlertDialog.Builder(this@with.context)
+                    with(builder) {
+                        binding.idTitle.text = "设置当前周"
+                        setSingleChoiceItems(
+                            items.toTypedArray(), binding.idTimetableView.curWeek() - 1
+                        ) { _, p1 -> target = p1 }
+                        setPositiveButton(
+                            "设置为当前周"
+                        ) { _, _ ->
+                            if (target != -1) {
+                                binding.idWeekview.curWeek(target + 1).updateView()
+                                binding.idTimetableView.changeWeekForce(target + 1)
+                            }
+                        }
+                        setNegativeButton("取消", null)
+                        create()
+                    }.show()
+                }
+
+            })
+            isShow(false)
+        }.showView()
+
+
+        with(binding.idTimetableView) {
+            source(subjects)
+            curWeek(LoginConfiguration.timetableConfig!!.week)
+            curTerm("一个学期罢了")
+            maxSlideItem(11)
+            monthWidthDp(50)
+            callback(ISchedule.OnItemClickListener { v, scheduleList ->
+                display(scheduleList)
+            })
+            callback(ISchedule.OnItemLongClickListener { v, day, start ->
+                Toast.makeText(MyApplication.context, "长按:周${day},第${start}节", Toast.LENGTH_SHORT)
+                    .show()
+            })
+            callback(ISchedule.OnWeekChangedListener {
+                binding.idTitle.text = "第${it}周"
+            })
+            callback(ISchedule.OnFlaglayoutClickListener { day, start ->
+                binding.idTimetableView.hideFlaglayout()
+            })
+        }.showView()
+
+//        val time= mutableListOf("08:00","08:55","10:10","11:05","14:00","14:55","16:10","17:05","19:00","19:55","20:50").toTypedArray()
+        val listener = binding.idTimetableView.onSlideBuildListener() as OnSlideBuildAdapter
+        listener.times = LoginConfiguration.timetableConfig!!.times.toTypedArray()
+        listener.setTimeTextColor(Color.BLACK)
+        binding.idTimetableView.updateSlideView()
+    }
 }

+ 282 - 2
app/src/main/java/org/brynhild/graduation/activity/teacher/ui/user/UserFragment.kt

@@ -1,20 +1,95 @@
 package org.brynhild.graduation.activity.teacher.ui.user
 
+import android.annotation.SuppressLint
+import android.app.Activity
+import android.content.Intent
 import android.os.Bundle
+import android.os.Handler
+import android.os.Message
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import android.widget.Toast
+import androidx.appcompat.app.AlertDialog
 import androidx.fragment.app.Fragment
+import com.bumptech.glide.Glide
+import com.google.gson.Gson
+import org.brynhild.graduation.R
+import org.brynhild.graduation.activity.common.LoginActivity
+import org.brynhild.graduation.common.config.LoginConfiguration
+import org.brynhild.graduation.common.config.MyApplication
+import org.brynhild.graduation.common.constant.BroadcastConstant
+import org.brynhild.graduation.common.transfer.Result
+import org.brynhild.graduation.common.transfer.dto.FileInfo
+import org.brynhild.graduation.common.transfer.handler.ResponseHandler
+import org.brynhild.graduation.common.transfer.utils.ServiceCreator
+import org.brynhild.graduation.common.transfer.vo.user.ModifyAccountInfo
+import org.brynhild.graduation.common.utils.FileUploadUtil
+import org.brynhild.graduation.common.utils.JsonUtils
+import org.brynhild.graduation.common.utils.Uri2PathUtil
 import org.brynhild.graduation.databinding.FragmentUserTeacherBinding
+import org.brynhild.graduation.databinding.ModifyAccountBasicInfoDialogBinding
+import org.brynhild.graduation.databinding.ModifyAccountPasswordInfoDialogBinding
+import org.brynhild.graduation.service.http.AccountService
+import retrofit2.Call
+import retrofit2.Callback
+import retrofit2.Response
+import java.io.File
+import java.io.IOException
 
 class UserFragment : Fragment() {
 
     private var _binding: FragmentUserTeacherBinding? = null
+    private val refreshBasicInfo = 1
+    private val updateAccountAvatar = 2
+    private lateinit var modifyAccountBasicInfoDialogBinding: ModifyAccountBasicInfoDialogBinding
+    private lateinit var modifyAccountPasswordInfoDialogBinding: ModifyAccountPasswordInfoDialogBinding
 
-    // This property is only valid between onCreateView and
-    // onDestroyView.
     private val binding get() = _binding!!
 
+    val handler: Handler = Handler {
+        when (it.what) {
+            refreshBasicInfo -> {
+                if (LoginConfiguration.userInfo != null) {
+                    binding.email.text = LoginConfiguration.userInfo!!.user.email
+                    binding.tel.text = LoginConfiguration.userInfo!!.user.tel
+                }
+
+            }
+            updateAccountAvatar -> {
+                val path = it.obj as String
+                Glide.with(this).load(path).into(binding.iconImage)
+                val service = ServiceCreator.create(AccountService::class.java)
+                val data = ModifyAccountInfo(null, null, path, null)
+                service.modifyAccountInfo(LoginConfiguration.userInfo!!.token, data)
+                    .enqueue(object : Callback<Result> {
+                        override fun onResponse(call: Call<Result>, response: Response<Result>) {
+                            ResponseHandler.handle(response, { ret ->
+                                Toast.makeText(
+                                    MyApplication.context,
+                                    ret.message,
+                                    Toast.LENGTH_SHORT
+                                ).show()
+                                LoginConfiguration.userInfo!!.user.avatar = path
+                            }, { ret ->
+                                Toast.makeText(
+                                    MyApplication.context,
+                                    ret.message,
+                                    Toast.LENGTH_SHORT
+                                ).show()
+                            })
+                        }
+
+                        override fun onFailure(call: Call<Result>, t: Throwable) {
+                            Toast.makeText(MyApplication.context, "请求失败", Toast.LENGTH_SHORT).show()
+                        }
+                    })
+            }
+        }
+        false
+    }
+
+
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,
@@ -24,6 +99,20 @@ class UserFragment : Fragment() {
         _binding = FragmentUserTeacherBinding.inflate(inflater, container, false)
         val root: View = binding.root
 
+        val user = LoginConfiguration.userInfo!!.user
+        binding.username.text = user.username
+        binding.email.text = user.email
+        binding.lastLogin.text = user.lastLogin
+        binding.name.text = user.name
+        binding.sex.text = user.sex
+        binding.tel.text = user.tel
+
+        Glide.with(this)
+            .load(user.avatar ?: R.drawable.nav_icon_default)
+            .into(binding.iconImage)
+
+        bindListener()
+
         return root
     }
 
@@ -31,4 +120,195 @@ class UserFragment : Fragment() {
         super.onDestroyView()
         _binding = null
     }
+
+
+    @SuppressLint("UseRequireInsteadOfGet")
+    private fun bindListener() {
+        binding.modifyBtn.setOnClickListener {
+            modifyAccountBasicInfoDialogBinding =
+                ModifyAccountBasicInfoDialogBinding.inflate(LayoutInflater.from(this@UserFragment.context))
+            val user = LoginConfiguration.userInfo!!.user
+            modifyAccountBasicInfoDialogBinding.email.setText(user.email)
+            modifyAccountBasicInfoDialogBinding.tel.setText(user.tel)
+            if(this@UserFragment.context!=null){
+                AlertDialog.Builder(this@UserFragment.context!!)
+                    .setTitle("修改联系方式")
+                    .setView(modifyAccountBasicInfoDialogBinding.root)
+                    .setPositiveButton("提交修改") { _, _ ->
+                        val service = ServiceCreator.create(AccountService::class.java)
+                        val data = ModifyAccountInfo(
+                            null, modifyAccountBasicInfoDialogBinding.email.text.toString(),
+                            null, modifyAccountBasicInfoDialogBinding.tel.text.toString()
+                        )
+
+                        service.modifyAccountInfo(LoginConfiguration.userInfo!!.token, data)
+                            .enqueue(object : Callback<Result> {
+                                override fun onResponse(
+                                    call: Call<Result>,
+                                    response: Response<Result>
+                                ) {
+                                    ResponseHandler.handle(response, {
+                                        Toast.makeText(
+                                            MyApplication.context,
+                                            it.message,
+                                            Toast.LENGTH_SHORT
+                                        ).show()
+                                        val oldEmail = LoginConfiguration.userInfo!!.user.email
+                                        LoginConfiguration.userInfo!!.user.tel =
+                                            modifyAccountBasicInfoDialogBinding.tel.text.toString()
+                                        LoginConfiguration.userInfo!!.user.email =
+                                            modifyAccountBasicInfoDialogBinding.email.text.toString()
+                                        handler.sendEmptyMessage(refreshBasicInfo)
+                                        if (oldEmail != LoginConfiguration.userInfo!!.user.email) {
+                                            LoginConfiguration.login_password = ""
+                                            LoginConfiguration.userInfo = null
+                                            LoginConfiguration.saveLoginInfo()
+                                            val intent = Intent(BroadcastConstant.OFFLINE)
+                                            MyApplication.context.sendBroadcast(intent)
+                                        }
+                                    }, {
+                                        Toast.makeText(
+                                            MyApplication.context,
+                                            it.message,
+                                            Toast.LENGTH_SHORT
+                                        ).show()
+                                    })
+                                }
+
+                                override fun onFailure(call: Call<Result>, t: Throwable) {
+                                    Toast.makeText(MyApplication.context, "请求失败", Toast.LENGTH_SHORT)
+                                        .show()
+                                }
+                            })
+                    }
+                    .setNegativeButton("取消修改") { _, _ ->
+
+                    }
+                    .show()
+            }
+
+        }
+
+
+
+        binding.modifyPassword.setOnClickListener {
+            modifyAccountPasswordInfoDialogBinding =
+                ModifyAccountPasswordInfoDialogBinding.inflate(LayoutInflater.from(this@UserFragment.context))
+            if(this@UserFragment.context!=null){
+                AlertDialog.Builder(this@UserFragment.context!!)
+                    .setTitle("修改密码")
+                    .setView(modifyAccountPasswordInfoDialogBinding.root)
+                    .setPositiveButton("提交修改") { _, _ ->
+                        val password =
+                            modifyAccountPasswordInfoDialogBinding.newPassword.text.toString()
+                        val passwordConfirm =
+                            modifyAccountPasswordInfoDialogBinding.newPasswordConfirm.text.toString()
+                        if (password != passwordConfirm) {
+                            Toast.makeText(MyApplication.context, "两次密码不匹配", Toast.LENGTH_SHORT).show()
+                            return@setPositiveButton
+                        }
+                        val service = ServiceCreator.create(AccountService::class.java)
+                        val data = ModifyAccountInfo(
+                            password, null,
+                            null, null
+                        )
+                        service.modifyAccountInfo(LoginConfiguration.userInfo!!.token, data)
+                            .enqueue(object : Callback<Result> {
+                                override fun onResponse(
+                                    call: Call<Result>,
+                                    response: Response<Result>
+                                ) {
+                                    ResponseHandler.handle(response, {
+                                        Toast.makeText(
+                                            MyApplication.context,
+                                            it.message,
+                                            Toast.LENGTH_SHORT
+                                        ).show()
+                                        LoginConfiguration.login_password = ""
+                                        LoginConfiguration.userInfo = null
+                                        LoginConfiguration.saveLoginInfo()
+
+                                        val intent = Intent(BroadcastConstant.OFFLINE)
+                                        MyApplication.context.sendBroadcast(intent)
+                                    }, {
+
+                                    })
+                                }
+
+                                override fun onFailure(call: Call<Result>, t: Throwable) {
+                                    Toast.makeText(MyApplication.context, "请求失败", Toast.LENGTH_SHORT)
+                                        .show()
+                                }
+                            })
+                    }
+                    .setNegativeButton("取消修改") { _, _ ->
+
+                    }
+                    .show()
+            }
+        }
+
+        binding.iconImage.setOnClickListener {
+            val intent = Intent(Intent.ACTION_OPEN_DOCUMENT)
+            intent.addCategory(Intent.CATEGORY_OPENABLE)
+            intent.type = "image/*"
+            startActivityForResult(intent, updateAccountAvatar)
+        }
+
+        binding.logout.setOnClickListener {
+            LoginConfiguration.login_password = ""
+            LoginConfiguration.saveLoginInfo()
+            val i = Intent(MyApplication.context, LoginActivity::class.java)
+            startActivity(i)
+            activity?.finish()
+        }
+    }
+
+
+    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+        super.onActivityResult(requestCode, resultCode, data)
+        when (requestCode) {
+            updateAccountAvatar -> {
+                if (resultCode == Activity.RESULT_OK && data != null) {
+                    val uri = data.data
+                    if (Uri2PathUtil.getRealPathFromUri(this@UserFragment.context, uri) != null) {
+                        //从uri得到绝对路径,并获取到file文件
+                        val file = File(Uri2PathUtil.getRealPathFromUri(this@UserFragment.context, uri))
+                        FileUploadUtil.uploadFile(file, object : okhttp3.Callback {
+                            override fun onFailure(call: okhttp3.Call, e: IOException) {
+                                println("failed")
+                            }
+
+                            override fun onResponse(
+                                call: okhttp3.Call,
+                                response: okhttp3.Response
+                            ) {
+                                if (response.isSuccessful) {
+                                    val body = response.body()?.string()
+                                    val gson = Gson()
+                                    val result = gson.fromJson(body, Result::class.java)
+                                    println(result)
+                                    var json = gson.toJson(result.data)
+                                    val fileInfoList = JsonUtils.fromJson2List<FileInfo>(json)
+                                    if (fileInfoList?.size == 1) {
+                                        val message = Message()
+                                        message.what = updateAccountAvatar
+                                        json = gson.toJson(fileInfoList[0])
+                                        val info = JsonUtils.fromJson<FileInfo>(json)
+                                        println(info)
+                                        if (info != null) {
+                                            message.obj = info.path
+                                            handler.sendMessage(message)
+                                        }
+                                    }
+                                }
+                            }
+                        })
+                    } else {
+                        Toast.makeText(MyApplication.context, "获取文件失败", Toast.LENGTH_SHORT).show()
+                    }
+                }
+            }
+        }
+    }
 }

+ 0 - 2
app/src/main/java/org/brynhild/graduation/activity/user/ui/timetable/TimetableFragment.kt

@@ -77,8 +77,6 @@ class TimetableFragment : Fragment() {
             loadTimeTableData()
         }
 
-
-
         return root
     }
 

+ 0 - 6
app/src/main/java/org/brynhild/graduation/activity/user/ui/user/UserFragment.kt

@@ -112,8 +112,6 @@ class UserFragment : Fragment() {
         Glide.with(this)
             .load(user.avatar ?: R.drawable.nav_icon_default)
             .into(binding.iconImage)
-
-        bindObserver()
         bindListener()
 
         return root
@@ -124,10 +122,6 @@ class UserFragment : Fragment() {
         _binding = null
     }
 
-    private fun bindObserver() {
-
-    }
-
     @SuppressLint("UseRequireInsteadOfGet")
     private fun bindListener() {
         binding.modifyBtn.setOnClickListener {

+ 5 - 0
app/src/main/java/org/brynhild/graduation/common/transfer/vo/timetable/QueryTeachingClassRequest.kt

@@ -0,0 +1,5 @@
+package org.brynhild.graduation.common.transfer.vo.timetable
+
+data class QueryTeachingClassRequest(
+	val teacherId:Long,
+)

+ 50 - 0
app/src/main/java/org/brynhild/graduation/network/adapter/ClassEntityAdapterUsingByTeacher.kt

@@ -0,0 +1,50 @@
+package org.brynhild.graduation.network.adapter
+
+import android.content.Context
+import android.content.Intent
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import com.google.gson.Gson
+import org.brynhild.graduation.R
+import org.brynhild.graduation.activity.admin.ClassDetailInfoActivity
+import org.brynhild.graduation.activity.teacher.ClassDetailInfoActivityUsingByTeacher
+import org.brynhild.graduation.common.config.MyApplication
+import org.brynhild.graduation.network.entiity.ClassEntity
+
+class ClassEntityAdapterUsingByTeacher(
+    private val context: Context,
+    private val classEntityList: List<ClassEntity>
+) :
+    RecyclerView.Adapter<ClassEntityAdapterUsingByTeacher.ViewHolder>() {
+
+    inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
+        val name: TextView = view.findViewById(R.id.name)
+        val no: TextView = view.findViewById(R.id.no)
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
+        val view = LayoutInflater.from(context).inflate(R.layout.class_item, parent, false)
+        val holder = ViewHolder(view)
+        holder.itemView.setOnClickListener {
+            val position = holder.adapterPosition
+            val classEntity = classEntityList[position]
+            val intent = Intent(MyApplication.context, ClassDetailInfoActivityUsingByTeacher::class.java)
+            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+            val gson = Gson()
+            intent.putExtra("class", gson.toJson(classEntity))
+            MyApplication.context.startActivity(intent)
+        }
+        return holder
+    }
+
+    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
+        val user = classEntityList[position]
+        holder.name.text = user.name
+        holder.no.text = user.no
+    }
+
+    override fun getItemCount() = classEntityList.size
+}

+ 50 - 0
app/src/main/java/org/brynhild/graduation/network/adapter/UserAdapterUsingByTeacher.kt

@@ -0,0 +1,50 @@
+package org.brynhild.graduation.network.adapter
+
+import android.content.Context
+import android.content.Intent
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import com.bumptech.glide.Glide
+import com.google.gson.Gson
+import org.brynhild.graduation.R
+import org.brynhild.graduation.activity.admin.UserDetailInfoActivity
+import org.brynhild.graduation.common.config.MyApplication
+import org.brynhild.graduation.network.entiity.User
+
+class UserAdapterUsingByTeacher(private val context: Context, private val userList: List<User>) :
+    RecyclerView.Adapter<UserAdapterUsingByTeacher.ViewHolder>() {
+
+    inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
+        val avatar: ImageView = view.findViewById(R.id.avatar)
+        val name: TextView = view.findViewById(R.id.name)
+        val no: TextView = view.findViewById(R.id.no)
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
+        val view = LayoutInflater.from(context).inflate(R.layout.user_item, parent, false)
+        val holder = ViewHolder(view)
+//        holder.itemView.setOnClickListener {
+//            val position = holder.adapterPosition
+//            val user = userList[position]
+//            val intent = Intent(MyApplication.context, UserDetailInfoActivity::class.java)
+//            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+//            val gson = Gson()
+//            intent.putExtra("user", gson.toJson(user))
+//            MyApplication.context.startActivity(intent)
+//        }
+        return holder
+    }
+
+    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
+        val user = userList[position]
+        holder.name.text = user.name
+        holder.no.text = user.no
+        Glide.with(context).load(user.avatar ?: R.drawable.nav_user).into(holder.avatar)
+    }
+
+    override fun getItemCount() = userList.size
+}

+ 33 - 0
app/src/main/java/org/brynhild/graduation/service/http/TeacherService.kt

@@ -0,0 +1,33 @@
+package org.brynhild.graduation.service.http
+
+import org.brynhild.graduation.common.constant.AccountConstant
+import org.brynhild.graduation.common.transfer.Result
+import org.brynhild.graduation.common.transfer.vo.device.QuerySignInRecordRequest
+import org.brynhild.graduation.common.transfer.vo.timetable.QueryTeachingClassRequest
+import org.brynhild.graduation.common.transfer.vo.timetable.QueryTimeTableRequest
+import org.brynhild.graduation.common.transfer.vo.user.QueryUserRequest
+import retrofit2.Call
+import retrofit2.http.Body
+import retrofit2.http.Header
+import retrofit2.http.POST
+
+interface TeacherService {
+
+    @POST("timetable/teacher/timetable")
+    fun queryTimeTable(
+        @Header(AccountConstant.ACCOUNT_HEADER) token: String,
+        @Body info: QueryTimeTableRequest
+    ): Call<Result>
+
+    @POST("timetable/teacher/clazz")
+    fun queryTeachingClass(
+        @Header(AccountConstant.ACCOUNT_HEADER) token: String,
+        @Body info: QueryTeachingClassRequest
+    ): Call<Result>
+
+    @POST("user/teacher/user")
+    fun queryUser(
+        @Header(AccountConstant.ACCOUNT_HEADER) token: String,
+        @Body info: QueryUserRequest
+    ): Call<Result>
+}

+ 114 - 0
app/src/main/res/layout/activity_class_detail_info_using_by_teacher.xml

@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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:orientation="vertical"
+    tools:context=".activity.admin.AcademyDetailInfoActivity">
+
+    <com.google.android.material.appbar.AppBarLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <com.google.android.material.appbar.CollapsingToolbarLayout
+            android:id="@+id/collapsingToolbar"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fitsSystemWindows="true"
+            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
+            app:contentScrim="@color/majorBlue"
+            app:layout_scrollFlags="scroll|exitUntilCollapsed"
+            app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
+
+            <androidx.appcompat.widget.Toolbar
+                android:id="@+id/toolBar"
+                android:layout_width="match_parent"
+                android:layout_height="?attr/actionBarSize"
+                app:layout_collapseMode="pin">
+
+                <ImageView
+                    android:id="@+id/backButton"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical"
+                    android:src="@drawable/node_modules_reactnavigationstack_dist_views_assets_backicon" />
+            </androidx.appcompat.widget.Toolbar>
+
+            <TextView
+                android:id="@+id/title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerInParent="true"
+                android:layout_gravity="center"
+                android:text="标题栏"
+                android:textColor="@android:color/white"
+                android:textSize="20sp" />
+        </com.google.android.material.appbar.CollapsingToolbarLayout>
+
+
+    </com.google.android.material.appbar.AppBarLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginHorizontal="10dp"
+        android:layout_marginTop="40dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="班级编号"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/no"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="班级名称"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/name"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="学生列表"
+        android:textAlignment="center" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/recyclerView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+
+</LinearLayout>

+ 20 - 14
app/src/main/res/layout/fragment_clazz.xml

@@ -1,22 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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:orientation="vertical"
     tools:context=".activity.teacher.ui.clazz.ClazzFragment">
 
-    <TextView
-        android:id="@+id/text_notifications"
+    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+        android:id="@+id/swipeRefresh"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:textAlignment="center"
-        android:textSize="20sp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-</androidx.constraintlayout.widget.ConstraintLayout>
+        android:layout_height="match_parent"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/recyclerView"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+        </LinearLayout>
+
+    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+</LinearLayout>

+ 54 - 14
app/src/main/res/layout/fragment_timetable_teacher.xml

@@ -1,22 +1,62 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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:orientation="vertical"
     android:layout_height="match_parent"
     tools:context=".activity.teacher.ui.timetable.TimetableFragment">
 
-    <TextView
-        android:id="@+id/text_dashboard"
+    <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:textAlignment="center"
-        android:textSize="20sp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-</androidx.constraintlayout.widget.ConstraintLayout>
+        android:layout_height="50dp"
+        android:background="@color/app_white_slight"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:id="@+id/id_layout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/id_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="课程表"
+                android:textColor="@color/app_course_textcolor_blue"
+                android:textSize="16sp" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="选择周次"
+                android:textColor="@color/app_gray"
+                android:textSize="10sp" />
+        </LinearLayout>
+
+        <Button
+            android:id="@+id/id_more"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:text="功能" />
+
+    </RelativeLayout>
+
+    <com.zhuangfei.timetable.view.WeekView
+        android:id="@+id/id_weekview"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <com.zhuangfei.timetable.TimetableView
+        android:id="@+id/id_timetableView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/app_white">
+
+    </com.zhuangfei.timetable.TimetableView>
+</LinearLayout>

+ 184 - 13
app/src/main/res/layout/fragment_user_teacher.xml

@@ -1,22 +1,193 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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:orientation="vertical"
     tools:context=".activity.teacher.ui.user.UserFragment">
 
-    <TextView
-        android:id="@+id/text_home"
+    <de.hdodenhof.circleimageview.CircleImageView
+        android:id="@+id/iconImage"
+        android:layout_width="150dp"
+        android:layout_height="150dp"
+        android:layout_centerInParent="true"
+        android:layout_gravity="center"
+        android:layout_marginTop="40dp"
+        android:src="@drawable/nav_icon_default" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginHorizontal="10dp"
+        android:layout_marginTop="40dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="用户名"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/username"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="姓名"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/name"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="邮件地址"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/email"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="联系电话"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/tel"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="最近登录"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/lastLogin"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:textAlignment="center"
-        android:textSize="20sp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-</androidx.constraintlayout.widget.ConstraintLayout>
+        android:layout_margin="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:text="性别"
+            android:textAlignment="center"
+            android:textSize="20sp" />
+
+        <TextView
+            android:id="@+id/sex"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="3"
+            android:background="@drawable/border"
+            android:textSize="20sp" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="40dp"
+        android:gravity="center"
+        android:orientation="horizontal">
+
+        <Button
+            android:id="@+id/modifyBtn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="20dp"
+            android:text="修改资料" />
+
+        <Button
+            android:id="@+id/modifyPassword"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="20dp"
+
+            android:text="修改密码" />
+
+        <Button
+            android:id="@+id/logout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="退出登录" />
+    </LinearLayout>
+</LinearLayout>