作者 liyan

修改BaseFragment2

... ... @@ -109,16 +109,16 @@ abstract class BaseActivity : AppCompatActivity() {
open fun reLoad() {}
override fun onBackPressed() {
val time = System.currentTimeMillis()
if (time - mExitTime > 2000) {
// toast(getString(R.string.exit_app))
mExitTime = time
} else {
AppManager.instance.exitApp(this)
}
}
// override fun onBackPressed() {
// val time = System.currentTimeMillis()
//
// if (time - mExitTime > 2000) {
//// toast(getString(R.string.exit_app))
// mExitTime = time
// } else {
// AppManager.instance.exitApp(this)
// }
// }
fun setUpReveal(savedInstanceState: Bundle?) {
setReveal(savedInstanceState)
... ...
... ... @@ -57,7 +57,6 @@ abstract class BaseFragment : Fragment() {
open fun reLoad() = initData()
abstract fun getLayoutId(): Int
private fun initStatusColor(color: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
... ...
... ... @@ -14,8 +14,4 @@ class BankFragment :BaseLifeCycleFragment<BankViewModel,FragmentBankBinding>(Fra
override fun initDataObserver() {
}
override fun getLayoutId(): Int {
return R.layout.fragment_bank
}
}
\ No newline at end of file
... ...
... ... @@ -41,9 +41,6 @@ class HomeFragment : BaseLifeCycleFragment<MineViewModel,FragmentHomeBinding>(Fr
}
override fun getLayoutId(): Int {
return R.layout.fragment_home
}
}
//class HomeFragment : Fragment() {
// override fun onCreateView(
... ...
... ... @@ -15,8 +15,5 @@ class MineFragment :BaseLifeCycleFragment<MineViewModel,FragmentMineBinding>(Fra
override fun initDataObserver() {
}
override fun getLayoutId(): Int {
return R.layout.fragment_mine
}
}
\ No newline at end of file
... ...
... ... @@ -4,10 +4,48 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_gravity="center_horizontal"
android:gravity="center"
android:text="home"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="?actionBarSize"
android:background="@color/white"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<ImageView
android:layout_width="87dp"
android:layout_height="26dp"
android:layout_gravity="center_vertical"
android:background="@color/color_96"
android:contentDescription="@string/logo" />
<RelativeLayout
android:id="@+id/search"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="8dp"
android:background="@drawable/search_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="搜索"
android:textColor="@color/white"
android:textSize="14sp" />
<ImageView
android:layout_width="40dp"
android:layout_height="28dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="2dp"
android:background="@drawable/solid_ff_14"
android:contentDescription="@string/logo"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:src="@mipmap/search" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
... ...