From e0d4157e98d4a4b383b703ca1264b931a290e71b Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期一, 27 三月 2017 14:37:32 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/VisitorRegisterFragment.java | 16 ++++++++++++++-- VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/adapter/OneBottomRecylerViewAdapter.java | 4 +++- VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/activity/MainActivity.java | 7 ++----- VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/OneFragment.java | 6 ++++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/adapter/OneBottomRecylerViewAdapter.java b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/adapter/OneBottomRecylerViewAdapter.java index 63ffcbb..d8b8d0e 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/adapter/OneBottomRecylerViewAdapter.java +++ b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/adapter/OneBottomRecylerViewAdapter.java @@ -9,6 +9,7 @@ import com.bsk.zhangbo.demoforbsk.R; import com.bsk.zhangbo.demoforbsk.ui.activity.MainActivity; +import com.bsk.zhangbo.demoforbsk.ui.fragment.VisitorRegisterFragment; import com.bsk.zhangbo.demoforbsk.util.WindowsUtil; import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter; import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; @@ -132,7 +133,7 @@ Object data = this.getItem(posistion); if (data instanceof FacePhotoItem) { - FacePhotoItem item = (FacePhotoItem) data; + final FacePhotoItem item = (FacePhotoItem) data; nameTv.setText(item.getName()); @@ -146,6 +147,7 @@ @Override public void onClick(View view) { MainActivity.selectPage(2); + VisitorRegisterFragment.getInstance().visitorCheckIn(item); } }); } diff --git a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/activity/MainActivity.java b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/activity/MainActivity.java index fdd8a63..71f3e1b 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/activity/MainActivity.java +++ b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/activity/MainActivity.java @@ -3,8 +3,6 @@ import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import android.os.Bundle; -import android.view.View; -import android.widget.Toast; import com.bsk.zhangbo.demoforbsk.R; import com.bsk.zhangbo.demoforbsk.adapter.MyFragmentPagerAdapter; @@ -16,7 +14,6 @@ import com.bsk.zhangbo.demoforbsk.ui.fragment.TelPhoneFragment; import com.bsk.zhangbo.demoforbsk.ui.fragment.VisitorManagerFragment; import com.bsk.zhangbo.demoforbsk.ui.fragment.VisitorRegisterFragment; -import com.bsk.zhangbo.demoforbsk.ui.fragment.TwoFragment; import com.bsk.zhangbo.demoforbsk.util.TabNameUtil; import java.util.Arrays; @@ -48,9 +45,9 @@ List<String> tabNamesList = Arrays.asList(TabNameUtil.tabNames); int[] tabIcons = TabNameUtil.tabIcons; MyFragmentPagerAdapter myFragmentPagerAdapter = new MyFragmentPagerAdapter(getSupportFragmentManager(),MainActivity.this); - myFragmentPagerAdapter.addFragment(OneFragment.newInstance(), tabNamesList.get(0),tabIcons[0]); + myFragmentPagerAdapter.addFragment(OneFragment.getInstance(), tabNamesList.get(0),tabIcons[0]); myFragmentPagerAdapter.addFragment(RegisterFragment.newInstance(), tabNamesList.get(1),tabIcons[1]); - myFragmentPagerAdapter.addFragment(VisitorRegisterFragment.newInstance(), tabNamesList.get(2),tabIcons[2]); + myFragmentPagerAdapter.addFragment(VisitorRegisterFragment.getInstance(), tabNamesList.get(2),tabIcons[2]); myFragmentPagerAdapter.addFragment(TelPhoneFragment.newInstance(), tabNamesList.get(3),tabIcons[3]); myFragmentPagerAdapter.addFragment(VisitorManagerFragment.newInstance(), tabNamesList.get(4),tabIcons[4]); myFragmentPagerAdapter.addFragment(AttendanceManagerFragment.newInstance(), tabNamesList.get(5),tabIcons[5]); diff --git a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/OneFragment.java b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/OneFragment.java index 76c6cc8..e5ebce5 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/OneFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/OneFragment.java @@ -66,8 +66,10 @@ } - public static OneFragment newInstance() { - return new OneFragment(); + private static OneFragment instance = new OneFragment(); + + public static OneFragment getInstance() { + return instance; } @Override diff --git a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/VisitorRegisterFragment.java b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/VisitorRegisterFragment.java index c497c40..3836277 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/VisitorRegisterFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/VisitorRegisterFragment.java @@ -16,6 +16,8 @@ import java.util.ArrayList; import java.util.List; +import cn.com.basic.face.discern.query.item.FacePhotoItem; + /** * Created by Administrator on 2017/2/20 0020. */ @@ -29,8 +31,10 @@ private EasyRecyclerView mRecyclerView; private List mList; - public static VisitorRegisterFragment newInstance() { - return new VisitorRegisterFragment(); + private static VisitorRegisterFragment instance = new VisitorRegisterFragment(); + + public static VisitorRegisterFragment getInstance() { + return instance; } @Override protected void initListeners() { @@ -110,4 +114,12 @@ mVisitorTo.setTitle("dasfasdfasdf"); return mViewRight; } + + public void visitorCheckIn(FacePhotoItem item) { + mVisitorFrom.setTitle(item.getName()); + + + } + + } -- Gitblit v1.8.0