Skip to content

Commit

Permalink
提交报修基本界面ok
Browse files Browse the repository at this point in the history
  • Loading branch information
zyhSDU committed Sep 2, 2018
1 parent 8c547a4 commit dd93830
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 8 deletions.
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
<activity android:name="com.example.administrator.smartschool.ui.ac.abac.LoginAbAc" />
<activity android:name="com.example.administrator.smartschool.ui.ac.abac.RegisterAbAc" />
<activity android:name="com.example.administrator.smartschool.ui.ac.abac.StartAbAc" >

</activity>
<activity android:name=".ui.ac.abac.WeatherAbAc" />
<activity android:name=".ui.ac.abac.BusAbAc" />
<activity android:name=".ui.ac.abac.ReportAbAc" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.ac.abac.WeatherAbAc" />
<activity android:name=".ui.ac.abac.BusAbAc" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class BusAbAc : BaseAbAc() {
}
}


private fun busList() {
startThread {
CallUtil(busListHandler).busList()
Expand All @@ -98,7 +97,11 @@ class BusAbAc : BaseAbAc() {

when (busBean.code) {
0 -> {
RecyclerViewHelper.initVerticalLinearRecyclerView(rv_bus, this@BusAbAc, BusRVAdapter(this@BusAbAc, busBean.`object`!!))
RecyclerViewHelper.initVerticalLinearRecyclerView(
rv_bus,
this@BusAbAc,
BusRVAdapter(this@BusAbAc, busBean.`object`!!)
)
}
}
}
Expand All @@ -119,7 +122,11 @@ class BusAbAc : BaseAbAc() {

when (busBean.code) {
0 -> {
RecyclerViewHelper.initVerticalLinearRecyclerView(rv_bus, this@BusAbAc, BusRVAdapter(this@BusAbAc, busBean.`object`!!))
RecyclerViewHelper.initVerticalLinearRecyclerView(
rv_bus,
this@BusAbAc,
BusRVAdapter(this@BusAbAc, busBean.`object`!!)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.administrator.smartschool.ui.ac.abac

import android.view.View
import com.example.administrator.smartschool.R
import com.example.administrator.smartschool.util.ViewHelper
import kotlinx.android.synthetic.main.ac_report.*

/**
* Created by Administrator on 2018/7/18 0018.
*/

class ReportAbAc : BaseAbAc() {
override val layoutResId: Int
get() = R.layout.ac_report

override fun initOnCreate() {

}

override fun initOnClick(view: View, id: Int) {
when (id) {
R.id.btn_report -> {
val string = et_report.text.toString()
}
R.id.btn_back2report -> {
ViewHelper.run {
setViewVisibility(false, btn_back2report)
setViewVisibility(true, et_report, btn_report, btn_show_report_list)
}
}
R.id.btn_show_report_list -> {
ViewHelper.run {
setViewVisibility(false, et_report, btn_report, btn_show_report_list)
setViewVisibility(true, btn_back2report)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
}

private fun setBottomNavigationView() {
ViewPager_main.adapter = object : BaseFragmentPagerAdapter(supportFragmentManager){
ViewPager_main.adapter = object : BaseFragmentPagerAdapter(supportFragmentManager) {
init {
fragmentList= arrayListOf(BottomFragment1(), BottomFragment2(), BottomFragment3())
fragmentList = arrayListOf(
BottomFragment1(),
BottomFragment2(),
BottomFragment3()
)
}
}
bottomNavigationView_main.setOnNavigationItemSelectedListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.example.administrator.smartschool.R
import com.example.administrator.smartschool.adapter.RVAdapter3
import com.example.administrator.smartschool.bean.IconBean
import com.example.administrator.smartschool.ui.ac.abac.BusAbAc
import com.example.administrator.smartschool.ui.ac.abac.ReportAbAc
import com.example.administrator.smartschool.ui.ac.abac.WeatherAbAc
import com.example.administrator.smartschool.util.RecyclerViewHelper

Expand All @@ -24,10 +25,18 @@ class BottomFragment1 : BaseFragment() {
val iconBean2 = IconBean(string = "校车查询", onClick = {
startActivity(BusAbAc::class.java)
})
val iconBean3 = IconBean(string = "提交报修", onClick = {
startActivity(ReportAbAc::class.java)
})

val itemList = arrayListOf(iconBean1,iconBean2,iconBean2,iconBean2,iconBean2,iconBean2)
val itemList = arrayListOf(iconBean1, iconBean2, iconBean3, iconBean2, iconBean2, iconBean2)

val recyclerView1 = rootView.findViewById<RecyclerView>(R.id.rv1_fg1_main)
RecyclerViewHelper.initGridRecyclerView(recyclerView1, activity, 3, RVAdapter3(activity, itemList))

//debug
recyclerView1.getChildAt(3).performClick()

//debug
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ object ViewHelper {
layoutParams.height = height
layoutParams.width = width
}
fun setViewVisibility(boolean: Boolean, vararg views: View) {
views.map {
it.visibility = if (boolean) View.VISIBLE else View.GONE
}
}
}
44 changes: 44 additions & 0 deletions app/src/main/res/layout/ac_report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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"
android:orientation="vertical"
android:padding="16dp">

<EditText
android:id="@+id/et_report"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="start"
android:hint="请输入您的反馈..."
android:maxLines="8"
android:minLines="8" />

<Button
android:id="@+id/btn_report"
style="@style/a_text_black_18sp_center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="提交" />

<Button
android:id="@+id/btn_back2report"
style="@style/a_text_black_18sp_center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="返回填写报修信息"
android:visibility="gone" />

<Button
android:id="@+id/btn_show_report_list"
style="@style/a_text_black_18sp_center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="查看反馈结果" />

<android.support.v7.widget.RecyclerView
android:id="@+id/rv_report"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

0 comments on commit dd93830

Please sign in to comment.