|
@@ -3,23 +3,21 @@ package com.sunwin.visitorapp.activity;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
import android.view.View;
|
|
|
-import android.widget.AdapterView;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
+import androidx.fragment.app.FragmentManager;
|
|
|
+import androidx.fragment.app.FragmentTransaction;
|
|
|
|
|
|
import com.sunwin.visitorapp.BaseActivity;
|
|
|
-import com.sunwin.visitorapp.BaseApplication;
|
|
|
import com.sunwin.visitorapp.R;
|
|
|
-import com.sunwin.visitorapp.adapter.CardAdapter;
|
|
|
import com.sunwin.visitorapp.adapter.VisitorRegAdapter;
|
|
|
import com.sunwin.visitorapp.fragment.IdcardRegFragment;
|
|
|
-import com.sunwin.visitorapp.fragment.NoCardRegFragment;
|
|
|
import com.sunwin.visitorapp.fragment.RegTypeFragment;
|
|
|
-import com.sunwin.visitorapp.service.PullDataService;
|
|
|
+import com.sunwin.visitorapp.fragment.TimeFragment;
|
|
|
import com.sunwin.visitorapp.utils.Constant;
|
|
|
-import com.sunwin.visitorapp.utils.ToastUtils;
|
|
|
import com.sunwin.visitorapp.view.MyGridView;
|
|
|
+import com.sunwin.visitorapp.view.UINav;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -27,9 +25,8 @@ import java.util.List;
|
|
|
/**
|
|
|
* 访客登记页面
|
|
|
*/
|
|
|
-public class VisitorRegActivity extends BaseActivity implements View.OnClickListener, RegTypeFragment.Listener {
|
|
|
+public class VisitorRegActivity extends BaseActivity implements RegTypeFragment.Listener {
|
|
|
|
|
|
- private TextView mTvHeadTitle;
|
|
|
// private MyGridView mGridview;
|
|
|
private MyGridView mGridviewBottom;
|
|
|
private TextView mTvDate;
|
|
@@ -73,8 +70,9 @@ public class VisitorRegActivity extends BaseActivity implements View.OnClickList
|
|
|
}
|
|
|
|
|
|
private void initView() {
|
|
|
- findViewById(R.id.head_iv_back).setOnClickListener(this);
|
|
|
- mTvHeadTitle = (TextView) findViewById(R.id.tv_head_title);
|
|
|
+ addTimeFragment();
|
|
|
+ UINav UINav = findViewById(R.id.UINav);
|
|
|
+ UINav.setData(this, "访客登记");
|
|
|
mTvDate = (TextView) findViewById(R.id.tv_date);
|
|
|
// mGridview = findViewById(R.id.gridview);
|
|
|
VisitorRegAdapter adapter = new VisitorRegAdapter(itemList, iconList);
|
|
@@ -87,20 +85,23 @@ public class VisitorRegActivity extends BaseActivity implements View.OnClickList
|
|
|
// mGridviewBottom.setOnItemClickListener(this);
|
|
|
// mGridviewBottom.setVisibility(isLoginUser ? View.VISIBLE : View.GONE);
|
|
|
// RegTypeFragment regTypeFragment = new RegTypeFragment(this);
|
|
|
- if (visitRegType==1){
|
|
|
+ if (visitRegType == 1) {
|
|
|
showFragment(new IdcardRegFragment());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
// showFragment(new NoCardRegFragment());
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- switch (view.getId()) {
|
|
|
- }
|
|
|
+ private void addTimeFragment() {
|
|
|
+ FragmentManager fragmentManager = getSupportFragmentManager();
|
|
|
+ FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
|
|
+ //添加fragment
|
|
|
+ fragmentTransaction.add(R.id.fl_time, new TimeFragment());
|
|
|
+ fragmentTransaction.commit();
|
|
|
}
|
|
|
+
|
|
|
//
|
|
|
// @Override
|
|
|
// public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|