Example usage for android.view View GONE

List of usage examples for android.view View GONE

Introduction

In this page you can find the example usage for android.view View GONE.

Prototype

int GONE

To view the source code for android.view View GONE.

Click Source Link

Document

This view is invisible, and it doesn't take any space for layout purposes.

Usage

From source file:fr.bde_eseo.eseomega.community.CommunityFragment.java

@Override
public View onCreateView(LayoutInflater rootInfl, ViewGroup container, Bundle savedInstanceState) {

    // UI//  w ww.  ja va  2  s  .  c  o m
    View rootView = rootInfl.inflate(R.layout.fragment_club_list, container, false);
    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.clubs_refresh);
    swipeRefreshLayout.setColorSchemeColors(R.color.md_blue_800);
    progCircle = (ProgressBar) rootView.findViewById(R.id.progressClubs);
    progCircle.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.md_grey_500),
            PorterDuff.Mode.SRC_IN);
    tv1 = (TextView) rootView.findViewById(R.id.tvListNothing);
    tv2 = (TextView) rootView.findViewById(R.id.tvListNothing2);
    img = (ImageView) rootView.findViewById(R.id.imgNoClub);
    progCircle.setVisibility(View.GONE);
    tv1.setVisibility(View.GONE);
    tv2.setVisibility(View.GONE);
    img.setVisibility(View.GONE);
    disabler = new RecyclerViewDisabler();

    // I/O cache data
    cachePath = getActivity().getCacheDir() + "/";
    cacheFileEseo = new File(cachePath + "community.json");

    // Model / objects
    mAdapter = new MyCommunityAdapter();
    recList = (RecyclerView) rootView.findViewById(R.id.recyList);
    recList.setAdapter(mAdapter);
    recList.setHasFixedSize(true);
    LinearLayoutManager llm = new LinearLayoutManager(getActivity());
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    recList.setLayoutManager(llm);
    mAdapter.notifyDataSetChanged();

    // Start download of data
    AsyncJSON asyncJSON = new AsyncJSON(true); // circle needed for first call
    asyncJSON.execute(Constants.URL_JSON_CLUBS);

    // Swipe-to-refresh implementations
    timestamp = 0;
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            //Toast.makeText(getActivity(), "Refreshing ...", Toast.LENGTH_SHORT).show();
            long t = System.currentTimeMillis() / 1000;
            if (t - timestamp > LATENCY_REFRESH) { // timestamp in seconds)
                timestamp = t;
                AsyncJSON asyncJSON = new AsyncJSON(false); // no circle here (already in SwipeLayout)
                asyncJSON.execute(Constants.URL_JSON_CLUBS);
            } else {
                swipeRefreshLayout.setRefreshing(false);
            }
        }
    });

    recList.addOnItemTouchListener(
            new RecyclerItemClickListener(getActivity(), new RecyclerItemClickListener.OnItemClickListener() {
                @Override
                public void onItemClick(View view, int position) {
                    // Start activity
                    Intent myIntent = new Intent(getActivity(), ClubViewActivity.class);
                    myIntent.putExtra(Constants.KEY_CLUB_VIEW, position);
                    startActivity(myIntent);
                }
            }));

    return rootView;
}

From source file:at.alladin.rmbt.android.views.ResultDetailsView.java

/**
 * //from www . j  a v  a  2  s .com
 * @param inflater
 * @return
 */
public View createView(final LayoutInflater inflater) {
    final View view = inflater.inflate(R.layout.test_result_detail, this);

    listView = (ListView) view.findViewById(R.id.valueList);
    listView.setVisibility(View.GONE);

    emptyView = (TextView) view.findViewById(R.id.infoText);
    emptyView.setVisibility(View.GONE);

    progessBar = (ProgressBar) view.findViewById(R.id.progressBar);

    return view;
}

From source file:com.tapchatapp.android.app.ui.TapchatServiceStatusBar.java

@Subscribe
public void onServiceStateChanged(ServiceStateChangedEvent event) {
    mService = event.getService();//  w w w. j  a va 2s  . com

    int connectionState = mService.getConnectionState();
    switch (connectionState) {
    case TapchatService.STATE_DISCONNECTED:
        showStatusText(R.string.tapchat_disconnected);
        break;
    case TapchatService.STATE_CONNECTING:
        showStatusText(R.string.tapchat_connecting);
        break;
    case TapchatService.STATE_CONNECTED:
        showStatusText(R.string.tapchat_connected);
        break;
    case TapchatService.STATE_LOADING:
        showStatusText(R.string.tapchat_syncing);
        break;
    case TapchatService.STATE_LOADED:
        if (mService.isServerOutdated()) {
            showStatusText(R.string.server_outdated);
        } else {
            hideHeader();
        }
        break;
    }

    final boolean isDisconnected = (connectionState == TapchatService.STATE_DISCONNECTED);
    final boolean isLoaded = (connectionState == TapchatService.STATE_LOADED);
    View headerView = findHeaderView();
    if (headerView != null) {
        headerView.findViewById(R.id.reconnect_button).setVisibility(isDisconnected ? View.VISIBLE : View.GONE);
        headerView.findViewById(R.id.connecting_progress)
                .setVisibility(isLoaded || isDisconnected ? View.GONE : View.VISIBLE);
    }
}

From source file:com.fabernovel.alertevoirie.IncidentsActivityMap.java

/** Called when the activity is first created. */
@Override/*from w  w  w.  j  a v a2s  .  c om*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.layout_report_map);
    getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_autour_de_vous);

    map = (MapView) findViewById(R.id.MapView_mymap);
    tabs = (RadioGroup) findViewById(R.id.RadioGroup_tabs_map);

    findViewById(R.id.ToggleButton_Map).setVisibility(View.GONE);

    for (int i = 0; i < 3; i++) {
        int quantity = 0;
        String stitle = null;
        switch (i) {
        case 0:
            stitle = getResources().getQuantityString(R.plurals.home_label_current, quantity, quantity);
            break;
        case 1:
            stitle = getResources().getQuantityString(R.plurals.home_label_update, quantity, quantity);
            break;
        case 2:
            stitle = getResources().getQuantityString(R.plurals.home_label_solved, quantity, quantity);
            break;

        default:
            break;
        }
        title[i] = stitle;
        ((TextView) tabs.getChildAt(i)).setText(title[i]);
        ((TextView) tabs.getChildAt(i)).setEnabled(false);

    }

    // get view references
    tabs.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            Log.d(Constants.PROJECT_TAG, "checked : " + checkedId);
            checked = checkedId;
            setMapForTab(gettabIndex(checkedId));
        }
    });

    tabs.check(getId());

    /*
     * if (checked == R.id.Tab_Map_ongoing) {
     * setMapForTab(checked);
     * }
     */

}

From source file:com.oasis.sdk.activity.OasisSdkPayEpinActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(BaseUtils.getResourceValue("layout", "oasisgames_sdk_pay_epin"));

    initHead(true, null, true,//from   ww w . ja v a2  s.  c o  m
            getString(BaseUtils.getResourceValue("string", "oasisgames_sdk_pcenter_notice_12")));

    et_code = (EditText) findViewById(BaseUtils.getResourceValue("id", "oasisgames_sdk_epin_edittext"));
    et_code.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void afterTextChanged(Editable s) {
            if (s.length() > 0)
                ll_clean.setVisibility(View.VISIBLE);
            else
                ll_clean.setVisibility(View.GONE);
        }
    });
    ll_clean = (LinearLayout) findViewById(BaseUtils.getResourceValue("id", "oasisgames_sdk_epin_clean"));
    ll_clean.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            onClickToClean(v);
        }
    });

    ll_images = (LinearLayout) findViewById(BaseUtils.getResourceValue("id", "oasisgames_sdk_epin_img"));
    mHandler = new MyHandler(this);
    mHandler.sendEmptyMessageDelayed(100, 2000);

}

From source file:com.mercandalli.android.apps.files.admin.ServerDataFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_admin_data, container, false);
    circularProgressBar = (ProgressBar) rootView.findViewById(R.id.circularProgressBar);
    circle = rootView.findViewById(R.id.circle);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.my_recycler_view);
    recyclerView.setHasFixedSize(true);//from ww  w.  j  av  a  2  s .co m
    mLayoutManager = new LinearLayoutManager(getActivity());
    recyclerView.setLayoutManager(mLayoutManager);

    rootView.findViewById(R.id.circle).setVisibility(View.GONE);

    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
            android.R.color.holo_green_light, android.R.color.holo_orange_light,
            android.R.color.holo_red_light);

    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh() {
            refreshList();
        }
    });

    refreshList();

    return rootView;
}

From source file:co.dilaver.quoter.fragments.QODFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_qod, container, false);

    sharedPrefStorage = new SharedPrefStorage(getActivity());

    MainActivity activity = (MainActivity) getActivity();
    activity.setActionBarItemsClickListener(this);

    font = Typeface.createFromAsset(getActivity().getAssets(), sharedPrefStorage.getQodFont());

    qodText = (TextView) view.findViewById(R.id.tvQodText);
    qodAuthor = (TextView) view.findViewById(R.id.tvQodAuthor);
    noData = (TextView) view.findViewById(R.id.tvNoData);
    rootLayout = (CoordinatorLayout) view.findViewById(R.id.clQodRoot);
    loadingQod = (ProgressBar) view.findViewById(R.id.pbQod);
    noData.setOnClickListener(new View.OnClickListener() {
        @Override/*w w w .  ja v  a 2  s. c om*/
        public void onClick(View v) {
            noData.setVisibility(View.GONE);
            loadingQod.setVisibility(View.VISIBLE);
            getQod();
        }
    });

    AutofitHelper.create(qodText);

    qodText.setTypeface(font);
    qodAuthor.setTypeface(font);
    qodText.setTextColor(sharedPrefStorage.getQodColor());
    qodAuthor.setTextColor(sharedPrefStorage.getQodColor());

    if (sharedPrefStorage.getQodText().equals("empty") || sharedPrefStorage.getQodAuthor().equals("empty")) {
        loadingQod.setVisibility(View.VISIBLE);
        getQod();
    } else {
        qodString = sharedPrefStorage.getQodText();
        authorString = sharedPrefStorage.getQodAuthor();

        qodText.setText(getString(R.string.str_WithinQuotation, qodString));
        qodAuthor.setText(authorString);
        getQod();
    }

    return view;
}

From source file:fr.shywim.antoinedaniel.utils.Utils.java

/**
 * First part of the click animation./*from  w  w  w  . j a  v a 2  s  .c om*/
 *
 * @param context Any context.
 * @param v View who will have the effect.
 * @param isRoot Whether the passed view is the ViewGroup parent.
 */
public static void clickAnimDown(Context context, View v, boolean isRoot) {
    RelativeLayout root;
    if (isRoot)
        root = (RelativeLayout) v;
    else
        root = (RelativeLayout) v.getParent();
    final View rectView = new View(context);
    rectView.setId(R.id.rect_view_id);
    rectView.setVisibility(View.GONE);
    rectView.setBackgroundResource(R.drawable.square);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(v.getMeasuredWidth(),
            v.getMeasuredHeight());
    params.addRule(RelativeLayout.ALIGN_TOP, v.getId());
    rectView.setLayoutParams(params);
    AlphaAnimation rectAnim = new AlphaAnimation(0f, 0.4f);
    rectAnim.setFillAfter(true);
    rectAnim.setInterpolator(new AccelerateInterpolator());
    rectAnim.setDuration(150);
    rectAnim.setAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
            rectView.setVisibility(View.VISIBLE);
        }

        @Override
        public void onAnimationEnd(Animation animation) {

        }

        @Override
        public void onAnimationRepeat(Animation animation) {

        }
    });
    root.addView(rectView);
    rectView.startAnimation(rectAnim);
}

From source file:com.layer.atlas.cells.GeoCell.java

@Override
public View onBind(final ViewGroup cellContainer) {

    ViewGroup cellRoot = (ViewGroup) Tools.findChildById(cellContainer, R.id.atlas_view_messages_cell_geo);
    if (cellRoot == null) {
        cellRoot = (ViewGroup) LayoutInflater.from(cellContainer.getContext())
                .inflate(R.layout.atlas_view_messages_cell_geo, cellContainer, false);
        if (debug)
            Log.w(TAG, "geo.onBind() inflated geo cell");
    }//from w  ww. j a va 2 s .c o m

    ImageView geoImageMy = (ImageView) cellRoot.findViewById(R.id.atlas_view_messages_cell_geo_image_my);
    ImageView geoImageTheir = (ImageView) cellRoot.findViewById(R.id.atlas_view_messages_cell_geo_image_their);
    View containerMy = cellRoot.findViewById(R.id.atlas_view_messages_cell_geo_container_my);
    View containerTheir = cellRoot.findViewById(R.id.atlas_view_messages_cell_geo_container_their);

    boolean myMessage = messagesList.getLayerClient().getAuthenticatedUserId()
            .equals(messagePart.getMessage().getSender().getUserId());
    if (myMessage) {
        containerMy.setVisibility(View.VISIBLE);
        containerTheir.setVisibility(View.GONE);
    } else {
        containerMy.setVisibility(View.GONE);
        containerTheir.setVisibility(View.VISIBLE);
    }
    ImageView geoImage = myMessage ? geoImageMy : geoImageTheir;
    ShapedFrameLayout cellCustom = (ShapedFrameLayout) (myMessage ? containerMy : containerTheir);

    Object imageId = messagePart.getId();
    Bitmap bmp = (Bitmap) Atlas.imageLoader.getImageFromCache(imageId);
    if (bmp != null) {
        if (debug)
            Log.d(TAG, "geo.onBind() bitmap: " + bmp.getWidth() + "x" + bmp.getHeight());
        geoImage.setImageBitmap(bmp);
    } else {
        if (debug)
            Log.d(TAG, "geo.onBind() spec: " + spec);
        geoImage.setImageDrawable(Tools.EMPTY_DRAWABLE);
        // schedule image
        File tileFile = getTileFile(cellContainer.getContext());
        if (tileFile.exists()) {
            if (debug)
                Log.d(TAG, "geo.onBind() decodeImage: " + tileFile);
            // request decoding
            spec = Atlas.imageLoader.requestImage(imageId, new Atlas.FileStreamProvider(tileFile),
                    (int) Tools.getPxFromDp(150, cellContainer.getContext()),
                    (int) Tools.getPxFromDp(150, cellContainer.getContext()), false, this);
        } else {
            int width = 300;
            int height = 300;
            int zoom = 16;
            final String url = new StringBuilder().append("https://maps.googleapis.com/maps/api/staticmap?")
                    .append("format=png32&").append("center=").append(lat).append(",").append(lon).append("&")
                    .append("zoom=").append(zoom).append("&").append("size=").append(width).append("x")
                    .append(height).append("&").append("maptype=roadmap&").append("markers=color:red%7C")
                    .append(lat).append(",").append(lon).toString();

            Atlas.downloadQueue.schedule(url, tileFile, this);

            if (debug)
                Log.d(TAG, "geo.onBind() show stub and download image: " + tileFile);
        }
    }

    // clustering
    cellCustom.setCornerRadiusDp(16, 16, 16, 16);
    if (AtlasMessagesList.CLUSTERED_BUBBLES) {
        if (myMessage) {
            if (this.clusterHeadItemId == this.clusterItemId && !this.clusterTail) {
                cellCustom.setCornerRadiusDp(16, 16, 2, 16);
            } else if (this.clusterTail && this.clusterHeadItemId != this.clusterItemId) {
                cellCustom.setCornerRadiusDp(16, 2, 16, 16);
            } else if (this.clusterHeadItemId != this.clusterItemId && !this.clusterTail) {
                cellCustom.setCornerRadiusDp(16, 2, 2, 16);
            }
        } else {
            if (this.clusterHeadItemId == this.clusterItemId && !this.clusterTail) {
                cellCustom.setCornerRadiusDp(16, 16, 16, 2);
            } else if (this.clusterTail && this.clusterHeadItemId != this.clusterItemId) {
                cellCustom.setCornerRadiusDp(2, 16, 16, 16);
            } else if (this.clusterHeadItemId != this.clusterItemId && !this.clusterTail) {
                cellCustom.setCornerRadiusDp(2, 16, 16, 2);
            }
        }
    }

    return cellRoot;
}

From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_trainer.SignTrainerActiveFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    Log.d(TAG, "onActivityCreated " + hashCode());
    super.onActivityCreated(savedInstanceState);
    if (null != savedInstanceState) {
        final Sign parcelledSign = savedInstanceState.getParcelable(KEY_CURRENT_SIGN);
        if (null != parcelledSign)
            this.currentSign = parcelledSign;
        final Boolean answerVisible = savedInstanceState.getBoolean(KEY_ANSWER_VISIBLE);
        Validate.notNull(answerVisible, "AnswerVisible should always be non-null in savedInstance bundle.");
        if (answerVisible && (null != this.currentSign)) {
            setVisibility(this.questionViews, View.GONE);
            setVisibility(this.answerViews, View.VISIBLE);
            try {
                setupVideoView(this.currentSign, SOUND.ON, CONTROLS.SHOW);
            } catch (VideoSetupException ex) {
                handleVideoCouldNotBeLoaded(ex);
            }//w w w. j a  va 2s  .  c o  m
            setAnswerTextViews();
        } else {
            setVisibility(this.questionViews, View.VISIBLE);
            if (null != this.currentSign)
                this.signQuestionTextDetail.setText(this.currentSign.getNameLocaleDe());
            setVisibility(this.answerViews, View.GONE);
        }
    } else {
        this.loadRandomSignTask = new LoadRandomSignTask(getActivity());
        this.loadRandomSignTask.execute(this.currentSign);
    }
}