package com.basic.security.fragment; import android.view.View; import com.basic.security.R; import com.basic.security.base.BaseFragment; import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.EFragment; import org.androidannotations.annotations.ViewById; import java.util.ArrayList; import java.util.List; import java.util.Set; @EFragment(R.layout.fragment_background_and_border) public class BackgroundAndBorderFragment extends BaseFragment { @ViewById public View topBlurView, topBlurView1, topBlurView2, bottomBlurView, bottomBlurView2, topBackground, topBackground1, topBackground2, bottomBackground, bottomBackground2, fullscreenBlurView, fullscreenBackground, topBackground3, bottomBackground3, topBlurView3, bottomBlurView3, topBlurView4, topBackground4, bottomBlurView4, bottomBackground4; List views = new ArrayList<>(); public void show() { Set visibleViews = mainActivity().backgroundAndBorderViews.get(mainActivity().currentFragment); for (View view : views) { if (visibleViews != null && visibleViews.contains(view)) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.INVISIBLE); } } } @AfterViews public void afterViews() { views.add(topBlurView); views.add(topBlurView1); views.add(topBlurView2); views.add(topBlurView3); views.add(bottomBlurView); views.add(bottomBlurView2); views.add(bottomBlurView3); views.add(topBackground); views.add(topBackground1); views.add(topBackground2); views.add(topBackground3); views.add(bottomBackground); views.add(bottomBackground2); views.add(bottomBackground3); views.add(fullscreenBlurView); views.add(fullscreenBackground); views.add(topBlurView4); views.add(topBackground4); views.add(bottomBlurView4); views.add(bottomBackground4); } }