|
@@ -2,13 +2,17 @@ package com.pan_american.android.ui.workspace
|
|
|
|
|
|
import android.content.Intent
|
|
import android.content.Intent
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
|
|
+import android.view.Gravity
|
|
import android.view.LayoutInflater
|
|
import android.view.LayoutInflater
|
|
import android.view.View
|
|
import android.view.View
|
|
import android.view.View.OnClickListener
|
|
import android.view.View.OnClickListener
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
|
|
+import android.widget.PopupWindow
|
|
|
|
+import android.widget.TextView
|
|
import com.pan_american.android.OASystem
|
|
import com.pan_american.android.OASystem
|
|
import com.pan_american.android.R
|
|
import com.pan_american.android.R
|
|
import com.pan_american.android.base.BaseFragment
|
|
import com.pan_american.android.base.BaseFragment
|
|
|
|
+import com.pan_american.android.base.CustomAlertDialog
|
|
import com.pan_american.android.databinding.FragmentWorkspaceBinding
|
|
import com.pan_american.android.databinding.FragmentWorkspaceBinding
|
|
import com.pan_american.android.ui.customer_resource.company_customer.MarketCustomerActivity
|
|
import com.pan_american.android.ui.customer_resource.company_customer.MarketCustomerActivity
|
|
import com.pan_american.android.ui.customer_resource.market_sales_revenue.MarketSalesRevenueActivity
|
|
import com.pan_american.android.ui.customer_resource.market_sales_revenue.MarketSalesRevenueActivity
|
|
@@ -28,6 +32,7 @@ import com.pan_american.android.ui.group_management.group_info.GroupInfoActivity
|
|
import com.pan_american.android.ui.group_op.ground_convey_payment_insert.GroundConveyPaymentInsertActivity
|
|
import com.pan_american.android.ui.group_op.ground_convey_payment_insert.GroundConveyPaymentInsertActivity
|
|
import com.pan_american.android.ui.group_visa.insurance_payment_insert.InsurancePaymentInsertActivity
|
|
import com.pan_american.android.ui.group_visa.insurance_payment_insert.InsurancePaymentInsertActivity
|
|
import com.pan_american.android.ui.group_visa.visa_payment_insert.VisaPaymentInsertActivity
|
|
import com.pan_american.android.ui.group_visa.visa_payment_insert.VisaPaymentInsertActivity
|
|
|
|
+import com.pan_american.android.ui.login.LoginActivity
|
|
import com.pan_american.android.ui.resource_management.airplane_three_code.AirplaneThreeCodeActivity
|
|
import com.pan_american.android.ui.resource_management.airplane_three_code.AirplaneThreeCodeActivity
|
|
import com.pan_american.android.ui.resource_management.car_resource.CarResourceActivity
|
|
import com.pan_american.android.ui.resource_management.car_resource.CarResourceActivity
|
|
import com.pan_american.android.ui.resource_management.guide_resource.GuideResourceActivity
|
|
import com.pan_american.android.ui.resource_management.guide_resource.GuideResourceActivity
|
|
@@ -407,6 +412,41 @@ class WorkspaceFragment : BaseFragment<FragmentWorkspaceBinding>(), OnClickListe
|
|
override fun initEvents() {
|
|
override fun initEvents() {
|
|
super.initEvents()
|
|
super.initEvents()
|
|
|
|
|
|
|
|
+ binding.userIcon.setOnClickListener {
|
|
|
|
+
|
|
|
|
+ val userMenuPopView = View.inflate(OASystem.context, R.layout.popup_user_menu, null)
|
|
|
|
+ popupWindow = PopupWindow(userMenuPopView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
|
|
|
+
|
|
|
|
+ showPopupWindow {
|
|
|
|
+
|
|
|
|
+ val logoutView = userMenuPopView.findViewById<TextView>(R.id.logout)
|
|
|
|
+
|
|
|
|
+ logoutView.setOnClickListener {
|
|
|
|
+
|
|
|
|
+ CustomAlertDialog.Builder(OASystem.context).apply {
|
|
|
|
+ setTitle(resources.getString(R.string.alert))
|
|
|
|
+ setMessage(resources.getString(R.string.logout_confirm_hint))
|
|
|
|
+ setNegativeButtonAndListener(resources.getString(R.string.cancel)) { dialog, _ ->
|
|
|
|
+ dialog.dismiss()
|
|
|
|
+ }
|
|
|
|
+ setPositiveButtonAndListener(resources.getString(R.string.confirm)) { dialog, _ ->
|
|
|
|
+
|
|
|
|
+ dialog.dismiss()
|
|
|
|
+
|
|
|
|
+ val intent = Intent(OASystem.context, LoginActivity::class.java)
|
|
|
|
+
|
|
|
|
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
|
|
+
|
|
|
|
+ startActivity(intent)
|
|
|
|
+ }
|
|
|
|
+ }.show()
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ popupWindow.showAtLocation(binding.root, Gravity.BOTTOM, 0, 0)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//全展示,汇率换算
|
|
//全展示,汇率换算
|
|
binding.exchangeTool.setOnClickListener {
|
|
binding.exchangeTool.setOnClickListener {
|
|
val intent = Intent(OASystem.context, ExchangeToolActivity::class.java)
|
|
val intent = Intent(OASystem.context, ExchangeToolActivity::class.java)
|