Example usage for android.widget FrameLayout setVisibility

List of usage examples for android.widget FrameLayout setVisibility

Introduction

In this page you can find the example usage for android.widget FrameLayout setVisibility.

Prototype

@RemotableViewMethod
public void setVisibility(@Visibility int visibility) 

Source Link

Document

Set the visibility state of this view.

Usage

From source file:com.xiaoya.framepager.SuperAwesomeCardFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    System.out.println(position + "======>>>>>");
    View v = inflater.inflate(R.layout.fragment_setting, container, false);

    FrameLayout fram_gallery = (FrameLayout) v.findViewById(R.id.frame_gallery);
    fram_gallery.setVisibility(View.GONE);
    ListView lv_news = (ListView) v.findViewById(R.id.lv_news);

    System.out.println("position  ====>>>>>>" + position);
    if (position == 0) {
        fram_gallery.setVisibility(View.VISIBLE);
        images_ga = (AdImageGallery) v.findViewById(R.id.image_wall_gallery);
        images_ga.setImageActivity(this);
        Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.gallary_moren);
        imagesCache.put("background_non_load", image); // 
        linear_point = (LinearLayout) v.findViewById(R.id.gallery_point_linear);

        urls = new ArrayList<String>(); // List
        urls.add("http://f11.topit.me/l/201009/16/12845672546160.jpg");
        urls.add("http://f12.topit.me/l166/101665601956b260eb.jpg");
        urls.add("http://i6.topit.me/6/15/50/1147943393d6950156l.jpg");
        urls.add("http://f6.topit.me/6/08/22/113361531058822086l.jpg");
        urls.add("http://i9.topit.me/9/23/10/1147966176c1910239l.jpg");

        List<String> imageList = new ArrayList<String>();
        imageList.add("");
        imageList.add("");
        imageList.add("");
        imageList.add("");
        imageList.add("");

        ImageAdapter imageAdapter = new ImageAdapter(getActivity(), urls, imageList);
        images_ga.setAdapter(imageAdapter);
        images_ga.setOnItemClickListener(new OnItemClickListener() {
            @Override/*from   w  w  w.j  a v  a  2s  .c  o  m*/
            public void onItemClick(AdapterView<?> arg0, View arg1, int positioin, long arg3) {
                // TODO Auto-generated method stub
                Toast.makeText(getActivity(), ":" + positioin + ":....",
                        Toast.LENGTH_SHORT).show();
            }
        });

        //         for (int i = 0; i < urls.size(); i++) {
        //            TextView textView=new TextView(getActivity());
        //            textView.setText(imageList.get(i%urls.size()));
        //            linear_point.addView(textView);
        //         }
        for (int i = 0; i < urls.size(); i++) {
            ImageView pointView = new ImageView(getActivity());
            if (i == 0) {
                pointView.setBackgroundResource(R.drawable.feature_point_cur);
            } else
                pointView.setBackgroundResource(R.drawable.feature_point);

            linear_point.addView(pointView);

        }

    }
    lv_news.setAdapter(new MyAdapter_news(getActivity(), list));
    return v;
}

From source file:de.gebatzens.ggvertretungsplan.fragment.RemoteDataFragment.java

@Override
public void onViewCreated(View v, Bundle b) {
    super.onViewCreated(v, b);

    if (GGApp.GG_APP.getDataForFragment(type) == null) {
        getContentView().addView(createLoadingView());
    }/*  w ww.java 2s.c o  m*/

    FrameLayout contentFrame = (FrameLayout) getActivity().findViewById(R.id.content_fragment);
    contentFrame.setVisibility(View.VISIBLE);
    LinearLayout fragmentLayout = (LinearLayout) getActivity().findViewById(R.id.fragment_layout);
    Animation fadeIn = AnimationUtils.loadAnimation(getActivity().getApplicationContext(), R.anim.fade_in);
    fragmentLayout.startAnimation(fadeIn);

}

From source file:de.gebatzens.sia.fragment.RemoteDataFragment.java

@Override
public void onViewCreated(View v, Bundle b) {
    super.onViewCreated(v, b);

    if (getFragment().getData() == null && getContentView() != null) {
        Log.d("ggvp", "Creating loading view because there is no data available");
        getContentView().addView(createLoadingView());
    }/*from   w ww  .  j  a v  a2s  .  c  o  m*/

    FrameLayout contentFrame = (FrameLayout) getActivity().findViewById(R.id.content_fragment);
    contentFrame.setVisibility(View.VISIBLE);
    /*ViewGroup fragmentLayout = (ViewGroup) getActivity().findViewById(R.id.fragment_layout);
    Animation fadeIn = AnimationUtils.loadAnimation(getActivity().getApplicationContext(), R.anim.fade_in);
    fragmentLayout.startAnimation(fadeIn);*/

    final SwipeRefreshLayout swipeContainer = (SwipeRefreshLayout) v.findViewById(R.id.refresh);
    if (swipeContainer != null) {
        swipeContainer.setProgressBackgroundColorSchemeColor(
                ContextCompat.getColor(getContext(), R.color.SwipeRefreshLayout_background));

        // Setup refresh listener which triggers new data loading
        swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                SIAApp.SIA_APP.refreshAsync(new Runnable() {
                    @Override
                    public void run() {
                        swipeContainer.post(new Runnable() {
                            @Override
                            public void run() {
                                swipeContainer.setRefreshing(false);
                            }
                        });

                    }
                }, true, getFragment());
            }
        });
        // Configure the refreshing colors
        swipeContainer.setColorSchemeResources(R.color.SwipeRefreshProgressGreen,
                R.color.SwipeRefreshProgressRed, R.color.SwipeRefreshProgressBlue,
                R.color.SwipeRefreshProgressOrange);
    }

}

From source file:com.commonslab.commonslab.Fragments.UploadToCommonsFragment.java

private void uploadMedia() {
    String title = uploadTitleTextView.getText().toString();
    String description = uploadDescriptionTextView.getText().toString();
    String comment = uploadCommentTextView.getText().toString();
    String license = extractLicenseString();
    StorageUtil storage = new StorageUtil(getActivity());
    String username = storage.loadUserCredentials();//get username from cache

    if (username == null) {
        showToastMessage(getString(R.string.user_session_deleted));
    } else if (title == null || title.equals("")) {
        showToastMessage(getString(R.string.set_the_media_title));
        //Other fields are optional
    } else {//from   ww w.  j  a v  a 2  s  . co m
        commons = new Commons(getActivity().getApplicationContext(), CookieStatus.ENABLED);
        File file;

        if (loadAbsolutePath)
            file = new File(UriToAbsolutePath.getPath(getActivity(), Uri.parse(contributionPath)));
        else
            file = new File(contributionPath);

        Log.d("UPLOADING_FILE path", file.getAbsolutePath());
        Log.d("UPLOADING_FILE name", file.getName());
        Log.d("UPLOADING_FILE size", String.valueOf(file.length()));

        //show a loading screen
        FrameLayout loadingScreen = (FrameLayout) getActivity().findViewById(R.id.progressBarHolder);
        loadingScreen.setVisibility(View.VISIBLE);

        User user = new User();
        user.setUsername(username);// all the upload needs the username
        commons.uploadContribution(file, user, title, comment, description, contributionType, license,
                R.drawable.upload_icon, new UploadCallback() {
                    @Override
                    public void onMediaUploadedSuccessfully() {
                        showToastMessage(getString(R.string.thank_tou_for_sharing));
                        ((MainActivity) getActivity()).triggerContributionLoadRequest();
                        exitFragment();
                    }

                    @Override
                    public void onFailure(String errorMessage) {
                        showToastMessage(errorMessage);
                        exitFragment();
                    }
                });
    }
}

From source file:org.wikimedia.commons.wikimedia.Fragments.UploadToCommonsFragment.java

private void uploadMedia() {
    String title = uploadTitleTextView.getText().toString();
    String description = uploadDescriptionTextView.getText().toString();
    String comment = uploadCommentTextView.getText().toString();
    String license = extractLicenseString();
    StorageUtil storage = new StorageUtil(getActivity());
    String username = storage.loadUserCredentials();//get username from cache

    if (username == null) {
        showToastMessage("User session deleted \nPlease re-login to upload media");
    } else if (title == null || title.equals("")) {
        showToastMessage("Set the media title");
        //Other fields are optional
    } else {/*from   w ww . j  a v  a2s .  c  o m*/
        commons = new Commons(getActivity().getApplicationContext(), CookieStatus.ENABLED);
        File file;

        if (loadAbsolutePath)
            file = new File(UriToAbsolutePath.getPath(getActivity(), Uri.parse(contributionPath)));
        else
            file = new File(contributionPath);

        Log.d("UPLOADING_FILE path", file.getAbsolutePath());
        Log.d("UPLOADING_FILE name", file.getName());
        Log.d("UPLOADING_FILE size", String.valueOf(file.length()));

        //show a loading screen
        FrameLayout loadingScreen = (FrameLayout) getActivity().findViewById(R.id.progressBarHolder);
        loadingScreen.setVisibility(View.VISIBLE);

        User user = new User();
        user.setUsername(username);// all the upload needs the username
        commons.uploadContribution(file, user, title, comment, description, contributionType, license,
                R.drawable.upload_icon, new UploadCallback() {
                    @Override
                    public void onMediaUploadedSuccessfully() {
                        showToastMessage("Thank you for sharing in Commons");
                        ((MainActivity) getActivity()).triggerContributionLoadRequest();
                        exitFragment();
                    }

                    @Override
                    public void onFailure(String errorMessage) {
                        showToastMessage(errorMessage);
                        exitFragment();
                    }
                });
    }
}

From source file:com.marcosedo.lagramola.MainActivity.java

private void getVisibilityOnTabs() {
    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);
    tabLayout.setVisibility(View.VISIBLE);
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
    viewPager.setVisibility(View.VISIBLE);
    FrameLayout outTabContent = (FrameLayout) findViewById(R.id.outTabContent);
    outTabContent.setVisibility(View.GONE);
}

From source file:com.google.android.apps.gutenberg.ScannerActivity.java

private void showCheckinAnimation(Checkin checkin) {
    if (mLastAnimator != null) {
        mLastAnimator.cancel();//from ww  w  .ja v a 2s  .c  om
    }
    final FrameLayout cover = (FrameLayout) findViewById(R.id.item_cover);
    cover.setVisibility(View.VISIBLE);
    final FrameLayout layer = (FrameLayout) findViewById(R.id.animation_layer);
    final CheckinHolder holder = new CheckinHolder(getLayoutInflater(), layer);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.WRAP_CONTENT);
    lp.gravity = Gravity.CENTER_VERTICAL;
    holder.setWillAnimate(true);
    holder.bind(checkin, mImageLoader);
    holder.itemView.setBackgroundColor(Color.rgb(0xf0, 0xf0, 0xf0));
    float elevation = getResources().getDimension(R.dimen.popup_elevation);
    ViewCompat.setTranslationZ(holder.itemView, elevation);
    holder.setLines(false, false);
    layer.addView(holder.itemView, lp);
    // Interpolator for animators
    FastOutSlowInInterpolator interpolator = new FastOutSlowInInterpolator();
    // Pop-up
    Animator popUpAnim = AnimatorInflater.loadAnimator(this, R.animator.pop_up);
    popUpAnim.setTarget(holder.itemView);
    popUpAnim.setInterpolator(interpolator);
    popUpAnim.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            holder.animateCheckin();
        }
    });
    // Wait
    ObjectAnimator waitAnim = new ObjectAnimator();
    waitAnim.setTarget(holder.itemView);
    waitAnim.setPropertyName("translationY");
    waitAnim.setFloatValues(0.f, 0.f);
    waitAnim.setDuration(2000);
    // Slide-down
    ObjectAnimator slideDownAnim = new ObjectAnimator();
    slideDownAnim.setTarget(holder.itemView);
    slideDownAnim.setPropertyName("translationY");
    slideDownAnim.setFloatValues(0.f, calcSlideDistance());
    slideDownAnim.setInterpolator(interpolator);
    // Landing anim
    ObjectAnimator landingAnim = new ObjectAnimator();
    landingAnim.setTarget(holder.itemView);
    landingAnim.setPropertyName("translationZ");
    landingAnim.setFloatValues(elevation, 0.f);
    landingAnim.setInterpolator(interpolator);
    landingAnim.setDuration(500);
    // Play the animators
    AnimatorSet set = new AnimatorSet();
    set.setInterpolator(interpolator);
    set.playSequentially(popUpAnim, waitAnim, slideDownAnim, landingAnim);
    set.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            clean();
        }

        @Override
        public void onAnimationCancel(Animator animation) {
            clean();
        }

        private void clean() {
            mLastAnimator = null;
            layer.removeAllViews();
            cover.setVisibility(View.INVISIBLE);
        }
    });
    mLastAnimator = set;
    set.start();
}

From source file:com.launcher.silverfish.launcher.appdrawer.TabbedAppDrawerFragment.java

private void hideUninstallIndicator() {
    FrameLayout uninstall_indicator;
    uninstall_indicator = (FrameLayout) rootView.findViewById(R.id.uninstall_indicator);
    uninstall_indicator.setVisibility(View.INVISIBLE);
}

From source file:org.anothermonitor.ActivityPreferences.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_preferences);
    mPrefs = getSharedPreferences(getString(R.string.app_name) + "Prefs", MODE_PRIVATE);
    res = getResources();// w  w  w.ja va  2s . c  o  m
    navigationBarHeight = res
            .getDimensionPixelSize(res.getIdentifier("navigation_bar_height", "dimen", "android"));

    mLTabs = (LinearLayout) findViewById(R.id.LTabs);

    if (Build.VERSION.SDK_INT >= 19) {
        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

        sSW = res.getConfiguration().smallestScreenWidthDp;

        int statusBarHeight = res
                .getDimensionPixelSize(res.getIdentifier("status_bar_height", "dimen", "android"));

        if (!ViewConfiguration.get(this).hasPermanentMenuKey()
                && (res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || sSW > 560)) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
            FrameLayout nb = (FrameLayout) findViewById(R.id.LNavigationBar);
            nb.setVisibility(View.VISIBLE);
            ((FrameLayout.LayoutParams) nb.getLayoutParams()).height = navigationBarHeight;
        }

        int paddingTop = mLTabs.getPaddingTop();
        int paddingBottom = mLTabs.getPaddingBottom();
        int paddingLeft = mLTabs.getPaddingLeft();
        int paddingRight = mLTabs.getPaddingRight();
        mLTabs.setPadding(paddingLeft, paddingTop + statusBarHeight, paddingRight, paddingBottom);
    }

    findViewById(R.id.TVTabMain).setActivated(true);
    findViewById(R.id.TVTabMain).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mVP.setCurrentItem(0);
        }
    });
    findViewById(R.id.TVTabShowRecord).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mVP.setCurrentItem(1);
        }
    });

    mVP = (ViewPager) findViewById(R.id.VP);
    mVP.setAdapter(new MyPreferencesAdapter());
    //      mVP.setOffscreenPageLimit(2);
    mVP.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
        @Override
        public void onPageSelected(int position) {
            int currentItem = 0;
            if (position == 1)
                currentItem = 2;
            mLTabs.getChildAt(currentItem).setActivated(true);
            mLTabs.getChildAt(previousSelected).setActivated(false);
            previousSelected = currentItem;
        }

        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }
    });
    mVP.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            mVP.getViewTreeObserver().removeGlobalOnLayoutListener(this);
            if (currentItem != -1)
                mVP.setCurrentItem(currentItem, false);
        }
    });

    if (savedInstanceState != null && !savedInstanceState.isEmpty()) {
        mB = savedInstanceState;
        currentItem = savedInstanceState.getInt(C.currentItem);

        currentItem = savedInstanceState.getInt(C.currentItem);
        currentItem = savedInstanceState.getInt(C.currentItem);
        currentItem = savedInstanceState.getInt(C.currentItem);
    }
}

From source file:fm.krui.kruifm.KRUIScheduleActivity.java

/**
 * Shows or hides the loading indicator which covers the entire activity.
 * @param isLoading true to show, false to hide.
 *///w  w w  .j  a  v a 2 s  .com
private void showLoadingScreen(boolean isLoading) {
    FrameLayout loadingScreen = (FrameLayout) findViewById(R.id.schedule_loading_framelayout);
    if (isLoading) {
        loadingScreen.setVisibility(View.VISIBLE);
    } else {
        loadingScreen.setVisibility(View.GONE);
    }

}