|
@@ -2,6 +2,7 @@ package com.sunwin.visitorapp.activity;
|
|
|
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
+import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
@@ -19,6 +20,7 @@ import com.sunwin.visitorapp.fragment.HomeFr;
|
|
import com.sunwin.visitorapp.fragment.RegTypeFragment;
|
|
import com.sunwin.visitorapp.fragment.RegTypeFragment;
|
|
import com.sunwin.visitorapp.fragment.VisitSignFragment;
|
|
import com.sunwin.visitorapp.fragment.VisitSignFragment;
|
|
import com.sunwin.visitorapp.utils.Constant;
|
|
import com.sunwin.visitorapp.utils.Constant;
|
|
|
|
+import com.sunwin.visitorapp.utils.PopupWindowHelper;
|
|
import com.sunwin.visitorapp.utils.SharePrefenceUtils;
|
|
import com.sunwin.visitorapp.utils.SharePrefenceUtils;
|
|
import com.sunwin.visitorapp.utils.ToastUtils;
|
|
import com.sunwin.visitorapp.utils.ToastUtils;
|
|
import com.sunwin.visitorapp.view.UINav;
|
|
import com.sunwin.visitorapp.view.UINav;
|
|
@@ -31,12 +33,16 @@ public class HomeAc extends BaseActivity implements View.OnClickListener, RegTyp
|
|
private TextView tv_loginOut;
|
|
private TextView tv_loginOut;
|
|
private LinearLayout mViewMenu;
|
|
private LinearLayout mViewMenu;
|
|
private ImageView mImageSetting;
|
|
private ImageView mImageSetting;
|
|
|
|
+ private ImageView ImageStatus;
|
|
|
|
+ private TextView mTvNetStatus;
|
|
|
|
+ private TextView mTvCameraStatus;
|
|
|
|
+ private TextView mTvIdcardStatus;
|
|
|
|
+ private PopupWindowHelper popupWindowHelper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_home);
|
|
setContentView(R.layout.activity_home);
|
|
-
|
|
|
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
|
//添加fragment
|
|
//添加fragment
|
|
@@ -101,17 +107,21 @@ public class HomeAc extends BaseActivity implements View.OnClickListener, RegTyp
|
|
startActivity(new Intent(mContext, LoginActivity.class));
|
|
startActivity(new Intent(mContext, LoginActivity.class));
|
|
finish();
|
|
finish();
|
|
break;
|
|
break;
|
|
|
|
+ case R.id.ImageStatus:
|
|
|
|
+ popupWindowHelper.showAsDropDown(ImageStatus);
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
private void initView() {
|
|
private void initView() {
|
|
- mUINav = (UINav) findViewById(R.id.UINav);
|
|
|
|
- mLlHomeTitle = (RelativeLayout) findViewById(R.id.ll_home_title);
|
|
|
|
- mLlHomeTitle = (RelativeLayout) findViewById(R.id.ll_home_title);
|
|
|
|
|
|
+ mUINav = findViewById(R.id.UINav);
|
|
|
|
+ mLlHomeTitle = findViewById(R.id.ll_home_title);
|
|
|
|
+ mLlHomeTitle = findViewById(R.id.ll_home_title);
|
|
tv_loginOut = findViewById(R.id.tv_loginOut);
|
|
tv_loginOut = findViewById(R.id.tv_loginOut);
|
|
mTextTitle = findViewById(R.id.TextTitle);
|
|
mTextTitle = findViewById(R.id.TextTitle);
|
|
mViewMenu = findViewById(R.id.ViewMenu);
|
|
mViewMenu = findViewById(R.id.ViewMenu);
|
|
mImageSetting = findViewById(R.id.ImageSetting);
|
|
mImageSetting = findViewById(R.id.ImageSetting);
|
|
|
|
+ ImageStatus = findViewById(R.id.ImageStatus);
|
|
|
|
|
|
findViewById(R.id.MenuItemRecord).setOnClickListener(this);
|
|
findViewById(R.id.MenuItemRecord).setOnClickListener(this);
|
|
findViewById(R.id.MenuItemSign).setOnClickListener(this);
|
|
findViewById(R.id.MenuItemSign).setOnClickListener(this);
|
|
@@ -120,12 +130,22 @@ public class HomeAc extends BaseActivity implements View.OnClickListener, RegTyp
|
|
findViewById(R.id.MenuItemCheck).setOnClickListener(this);
|
|
findViewById(R.id.MenuItemCheck).setOnClickListener(this);
|
|
findViewById(R.id.ImageSetting).setOnClickListener(this);
|
|
findViewById(R.id.ImageSetting).setOnClickListener(this);
|
|
tv_loginOut.setOnClickListener(this);
|
|
tv_loginOut.setOnClickListener(this);
|
|
|
|
+ ImageStatus.setOnClickListener(this);
|
|
showHome(true);
|
|
showHome(true);
|
|
|
|
|
|
mViewMenu.setVisibility(isLogin ? View.VISIBLE : View.INVISIBLE);
|
|
mViewMenu.setVisibility(isLogin ? View.VISIBLE : View.INVISIBLE);
|
|
mImageSetting.setVisibility(isLogin ? View.VISIBLE : View.INVISIBLE);
|
|
mImageSetting.setVisibility(isLogin ? View.VISIBLE : View.INVISIBLE);
|
|
|
|
|
|
|
|
+ initPopWindow();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void initPopWindow() {
|
|
|
|
+ View popView = LayoutInflater.from(this).inflate(R.layout.view_popwindow, null);
|
|
|
|
|
|
|
|
+ mTvNetStatus = popView.findViewById(R.id.tv_net_status);
|
|
|
|
+ mTvCameraStatus = popView.findViewById(R.id.tv_camera_status);
|
|
|
|
+ mTvIdcardStatus = popView.findViewById(R.id.tv_idcard_status);
|
|
|
|
+ popupWindowHelper = new PopupWindowHelper(popView);
|
|
}
|
|
}
|
|
|
|
|
|
private void showHome(boolean showHome) {
|
|
private void showHome(boolean showHome) {
|