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:com.vrem.wifianalyzer.wifi.channelgraph.ChannelGraphNavigationTest.java

@Test
public void testUpdateWithGHZ2() throws Exception {
    // setup// ww w  .jav a 2  s.co m
    when(settings.getCountryCode()).thenReturn(Locale.US.getCountry());
    when(settings.getWiFiBand()).thenReturn(WiFiBand.GHZ2);
    // execute
    fixture.update(WiFiData.EMPTY);
    // validate
    verify(layout).setVisibility(View.GONE);
    verify(settings).getCountryCode();
    verify(settings).getWiFiBand();
}

From source file:com.huishen_app.zc.ui.fragment.UserCenterFragment.java

protected void initView() {
    if (father.readString("city") != null && !father.readString("city").equals("")) {
        city.setText(father.readString("city").toString());
    }/*  w w  w.ja v a2 s  .  c  o m*/
    title.setText("");
    // 
    int width = father.getWidth() > 100 ? father.getWidth() : 200;
    LinearLayout.LayoutParams imglayout = new LinearLayout.LayoutParams(width, father.getHeight() / 3);
    // 
    uc_lay.setLayoutParams(imglayout);

    his.setOnClickListener(this);
    sta.setOnClickListener(this);

    user_center_yuyue.setOnClickListener(this);
    user_center_mokao.setOnClickListener(this);
    prize.setOnClickListener(this);
    uc_lay.setOnClickListener(this);
    try {
        JSONObject json = new JSONObject(father.readString("login_result"));
        Log.i(TAG, json.toString());
        username.setText(json.optString("stuname", ""));
        userlicense.setText("" + json.optString("DrivingLicenceType", ""));
        userschool.setText("" + json.optString("school", ""));
        //      
        if (father.readString("yuyuenum").equals("0")) {
            tip1.setVisibility(View.GONE);
        }
        if (father.readString("testnum").equals("0")) {
            tip2.setVisibility(View.GONE);
        }
        tip1.setText(father.readString("yuyuenum"));
        tip2.setText(father.readString("testnum"));
        getUserPhoto(this.father.readString("path"));
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.jamsuni.jamsunicodescan.MainActivity.java

/**
 * Called when a view has been clicked.//from   w  w w. ja v a 2  s  .  com
 *
 * @param v The view that was clicked.
 */
@Override
public void onClick(View v) {
    if (v.getId() == R.id.btnScan) {
        //testTTS("13   ? ?    ??  ?  ? ? ??  ?  ? ?\n");

        Button btContent = (Button) findViewById(R.id.btnContentView);
        btContent.setText("");
        btContent.setVisibility(View.GONE);
        contentString = "";

        barcodeValue.setText("");
        barcodeValue.setVisibility(View.VISIBLE);

        LinearLayout llBookInfo = (LinearLayout) findViewById(R.id.llBookInfo);
        llBookInfo.setVisibility(View.GONE);
        LinearLayout llProductInfo = (LinearLayout) findViewById(R.id.llProductInfo);
        llProductInfo.setVisibility(View.GONE);

        startScan();
        /*
        // launch barcode activity.
        Intent intent = new Intent(this, BarcodeCaptureActivity.class);
        intent.putExtra(BarcodeCaptureActivity.AutoFocus, autoFocus.isChecked());
        intent.putExtra(BarcodeCaptureActivity.UseFlash, useFlash.isChecked());
                
        startActivityForResult(intent, RC_BARCODE_CAPTURE);
        */

    }
    if (v.getId() == R.id.btnHistory) {
        Intent intent = new Intent(this, HistoryActivity.class);
        startActivityForResult(intent, HISTORY_CONTENT_VIEW);
    }
    if (v.getId() == R.id.btnContentView) {
        goURL();
    }

}

From source file:com.cloverstudio.spika.extendables.SpikaActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    moveTaskToBack(false);//  ww  w  .ja  v a  2 s  .  c o m

    mSlideFromTop = SpikaApp.getSlideFromTop();
    mSlideOutTop = SpikaApp.getSlideOutTop();
    mSlideFromTop.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
            mRlNoInternetNotification.setVisibility(View.VISIBLE);
        }

        public void onAnimationRepeat(Animation animation) {
        }

        public void onAnimationEnd(Animation animation) {
        }
    });
    mSlideOutTop.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
        }

        public void onAnimationRepeat(Animation animation) {
        }

        public void onAnimationEnd(Animation animation) {
            mRlNoInternetNotification.setVisibility(View.GONE);
        }
    });

    // Logout finish activity
    this.registerReceiver(logoutRec, intentFilter);
}

From source file:kookmin.cs.sympathymusiz.VideoListDemoActivity.java

/**
 * Sets up the layout programatically for the three different states. Portrait, landscape or
 * fullscreen+landscape. This has to be done programmatically because we handle the orientation
 * changes ourselves in order to get fluent fullscreen transitions, so the xml layout resources
 * do not get reloaded.//from   w  w  w  .ja v  a2 s.c o  m
 */
private void layout() {
    boolean isPortrait = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;

    //ArrayList<ArrayList<String>> list = (ArrayList<ArrayList<String>>) getIntent("exIntent"");
    listFragment.getView().setVisibility(isFullscreen ? View.GONE : View.VISIBLE);
    listFragment.setLabelVisibility(isPortrait);
    closeButton.setVisibility(isPortrait ? View.VISIBLE : View.GONE);
    if (isFullscreen) {
        videoBox.setTranslationY(0); // Reset any translation that was applied in portrait.
        setLayoutSize(videoFragment.getView(), MATCH_PARENT, MATCH_PARENT);
        setLayoutSizeAndGravity(videoBox, MATCH_PARENT, MATCH_PARENT, Gravity.TOP | Gravity.LEFT);
    } else if (isPortrait) {
        setLayoutSize(listFragment.getView(), MATCH_PARENT, MATCH_PARENT);
        setLayoutSize(videoFragment.getView(), MATCH_PARENT, WRAP_CONTENT);
        setLayoutSizeAndGravity(videoBox, MATCH_PARENT, WRAP_CONTENT, Gravity.BOTTOM);
    } else {
        videoBox.setTranslationY(0); // Reset any translation that was applied in portrait.
        int screenWidth = dpToPx(getResources().getConfiguration().screenWidthDp);
        setLayoutSize(listFragment.getView(), screenWidth / 4, MATCH_PARENT);
        int videoWidth = screenWidth - screenWidth / 4 - dpToPx(LANDSCAPE_VIDEO_PADDING_DP);
        setLayoutSize(videoFragment.getView(), videoWidth, WRAP_CONTENT);
        setLayoutSizeAndGravity(videoBox, videoWidth, WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_VERTICAL);
    }
}

From source file:com.vk.sdk.VKCaptchaDialog.java

private void loadImage() {
    VKHttpOperation imageOperation = new VKHttpOperation(new HttpGet(mCaptchaError.captchaImg));
    imageOperation.setHttpOperationListener(new VKHTTPOperationCompleteListener() {
        @Override// ww  w  .  j a v a2s.  co m
        public void onComplete(VKHttpOperation operation, byte[] response) {
            Bitmap captchaImage = BitmapFactory.decodeByteArray(response, 0, response.length);
            captchaImage = Bitmap.createScaledBitmap(captchaImage, (int) (captchaImage.getWidth() * mDensity),
                    (int) (captchaImage.getHeight() * mDensity), true);
            mCaptchaImage.setImageBitmap(captchaImage);
            mCaptchaImage.setVisibility(View.VISIBLE);
            mProgressBar.setVisibility(View.GONE);
        }

        @Override
        public void onError(VKHttpOperation operation, VKError error) {
            loadImage();
        }
    });
    VKHttpClient.enqueueOperation(imageOperation);
}

From source file:net.dewep.intranetepitech.ui.landing.LandingActivity.java

private void setConnectionError(boolean isStrict) {
    if (isStrict) {
        this.setMessageState(Q.getString(R.string.landing_connection_impossible));
        mLandingConnectionError.setVisibility(View.VISIBLE);
        mLandingConnectionProgressbar.setVisibility(View.GONE);
        mPager.setCurrentItem(1, true);/*from  w  w  w  . ja  v  a  2 s . c o m*/
    } else {
        this.setMessageConnectError(null);
        this.setMessageState(Q.getString(R.string.landing_identity_required));
        mLandingConnectionError.setVisibility(View.GONE);
        mLandingConnectionProgressbar.setVisibility(View.GONE);
        mPager.setCurrentItem(0, true);
    }
}

From source file:com.aikidonord.fragments.FragmentProchainsStages.java

/**
 * Das subtilit pour faire de l'async dans des fragments
 *///from w ww.j  a v  a 2s  .c o  m
public void lancementAsync(String type, String data, boolean MAJ) {

    // dans le cas d'un rechargement par un autre fragment
    // on remet le loading...
    if (MAJ) {
        if (this.rlLoading != null) {
            this.rlLoading.setVisibility(View.VISIBLE);
            this.viewPager.setVisibility(View.GONE);
        }
    }

    QueryForProchainStageTask asyncTask = new QueryForProchainStageTask(this);
    this.asyncTaskWeakRef = new WeakReference<QueryForProchainStageTask>(asyncTask);
    asyncTask.execute(this, type, data);

}

From source file:com.tdispatch.passenger.fragment.SearchAddressFragment.java

@Override
protected void onPostCreateView() {

    ImageView iv = (ImageView) mFragmentView.findViewById(R.id.icon);
    EditText et = (EditText) mFragmentView.findViewById(R.id.address);

    int imgId = R.drawable.ic_launcher;
    int hintId = R.string.address_search_generic_hint;
    switch (mType) {
    case SearchActivity.TYPE_PICKUP:
        imgId = R.drawable.map_marker_pickup;
        hintId = R.string.address_search_pickup_hint;
        break;//  w w  w  .j a  va2 s .  c  o  m
    case SearchActivity.TYPE_DROPOFF:
        imgId = R.drawable.map_marker_dropoff;
        hintId = R.string.address_search_dropoff_hint;
        break;
    }
    iv.setImageResource(imgId);

    et.setText((mAddress != null) ? mAddress.getAddress() : "");
    et.setHint(hintId);

    et.setOnEditorActionListener(mOnEditorActionListener);
    et.addTextChangedListener(mTextWatcher);

    WebnetTools.setVisibility(mFragmentView, R.id.button_voice_search,
            mVoiceSearchAvailable ? View.VISIBLE : View.GONE);

    int[] ids = { R.id.button_voice_search, R.id.button_clear };
    for (int id : ids) {
        View v = mFragmentView.findViewById(id);
        if (v != null) {
            v.setOnClickListener(mOnClickListener);
        }
    }

    WebnetTools.setVisibility(mFragmentView, R.id.button_clear, View.GONE);

    ListView lv = (ListView) mFragmentView.findViewById(R.id.list);
    mAdapter = new ListAdapter(mParentActivity, 0, mItems);
    lv.setAdapter(mAdapter);
}

From source file:com.android.browser.GearsBaseDialog.java

/**
 * Button setup./*from   ww w  .ja  v a 2  s.c o  m*/
 * Set the button's text and its listener. If the text resource's id
 * is 0, makes the button invisible.
 */
void setupButton(int buttonRscID, int rscString, View.OnClickListener listener, boolean isLink,
        boolean requestFocus) {
    View view = findViewById(buttonRscID);
    if (view == null) {
        return;
    }

    Button button = (Button) view;

    if (rscString == 0) {
        button.setVisibility(View.GONE);
    } else {
        CharSequence text = getString(rscString);
        button.setText(text);
        button.setOnClickListener(listener);
        if (isLink) {
            displayAsLink(button);
        }
        if (requestFocus) {
            button.requestFocus();
        }
    }
}