Example usage for android.view View VISIBLE

List of usage examples for android.view View VISIBLE

Introduction

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

Prototype

int VISIBLE

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

Click Source Link

Document

This view is visible.

Usage

From source file:com.vrem.wifianalyzer.wifi.accesspoint.AccessPointDetailTest.java

@Test
public void testMakeViewFullWithConfiguredImageVisible() throws Exception {
    // setup/*from ww  w  . ja v a  2  s.  co m*/
    WiFiDetail wiFiDetail = withWiFiDetail(SSID, new WiFiAdditional(StringUtils.EMPTY, true));
    // execute
    View actual = fixture.makeView(null, null, wiFiDetail, false);
    // validate
    assertEquals(View.VISIBLE, actual.findViewById(R.id.configuredImage).getVisibility());
}

From source file:com.code.android.vibevault.FeaturedShowsScreen.java

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.featured_shows_screen);

    getMoreShowsButton = new Button(this);
    getMoreShowsButton.setText("More Featured Shows");
    getMoreShowsButton.setTextColor(Color.rgb(18, 125, 212));
    getMoreShowsButton.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
    getMoreShowsButton.setPadding(0, 6, 0, 6);

    getMoreShowsButton.setOnClickListener(new OnClickListener() {
        @Override//from   w ww  .j a  v a2  s.c om
        public void onClick(View v) {
            if (VibeVault.moreFeaturedShows.size() != 0) {
                fetchSelectedShows(VibeVault.moreFeaturedShows.get(0));
            } else {
                Toast.makeText(getBaseContext(), "More featured shows weekly...", Toast.LENGTH_SHORT).show();
            }
        }
    });

    this.featuredShowsList = (ListView) this.findViewById(R.id.SelectedShowsListView);
    featuredShowsList.addFooterView(getMoreShowsButton);
    if (VibeVault.featuredShows.size() == 0) {
        getMoreShowsButton.setVisibility(View.GONE);
    } else {
        getMoreShowsButton.setVisibility(View.VISIBLE);
    }
    featuredShowsList.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> a, View v, int position, long id) {
            ArchiveShowObj show = (ArchiveShowObj) featuredShowsList.getItemAtPosition(position);
            Intent i = new Intent(FeaturedShowsScreen.this, ShowDetailsScreen.class);
            i.putExtra("Show", show);
            startActivity(i);
        }
    });
    featuredShowsList.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {
        @Override
        public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
            menu.add(Menu.NONE, VibeVault.EMAIL_LINK, Menu.NONE, "Email Link to Show");
            menu.add(Menu.NONE, VibeVault.ADD_TO_FAVORITE_LIST, Menu.NONE, "Bookmark Show");
        }
    });

    Object retained = getLastNonConfigurationInstance();
    if (retained instanceof GetSelectedShowsListTask) {

        workerTask = (GetSelectedShowsListTask) retained;
        workerTask.setActivity(this);
    } else {
        workerTask = new GetSelectedShowsListTask(this);
        if (VibeVault.featuredShows.size() == 0) {
            this.fetchSelectedShows("http://andrewpearson.org/vibevault/shows/vvshows1");
        }
        this.refreshSelectedShowsList();
    }
}

From source file:com.lepin.activity.MyLoveCarActivity.java

public void initView() {
    mlTitleEdit.setVisibility(View.VISIBLE);
    mlTitleEdit.setText(this.getString(R.string.my_car_edit));
    this.mlTitleEdit.setOnClickListener(this);
    this.mlTitleBack.setOnClickListener(this);
    this.mlLayout.setEnabled(false);
    this.mlLayout.setOnClickListener(this);
    this.mlPeoNum.setOnClickListener(this);
    this.mlDrivYear.setOnClickListener(this);
    this.mlSave.setOnClickListener(this);
    this.mlSafeLayout.setOnClickListener(this);

    mlTitleText.setText(this.getString(R.string.my_car_title));
    if (isEidting) {
        setEnable(isEidting);//from   w  ww .  ja v a  2s.  c  o m
        setVisible(isEidting);
        isEidting = true;
        isPublishAddCar = true;
    }

}

From source file:com.binroot.fatpita.BitmapManager.java

public void fetchBitmapOnThread(final String urlString, final ImageView imageView,
        final ProgressBar indeterminateProgressBar, final Activity act, final boolean saveToHistory) {
    SoftReference<Bitmap> ref = mCache.get(urlString);
    if (ref != null && ref.get() != null) {
        imageView.setImageBitmap(ref.get());
        return;/* ww w.  ja  v  a2  s . co  m*/
    }

    final Runnable progressBarShow = new Runnable() {
        public void run() {
            if (indeterminateProgressBar != null) {
                imageView.setVisibility(View.GONE);
                indeterminateProgressBar.setVisibility(View.VISIBLE);
            }
        }
    };
    final Runnable progressBarHide = new Runnable() {
        public void run() {
            if (indeterminateProgressBar != null) {
                indeterminateProgressBar.setVisibility(View.GONE);
                imageView.setVisibility(View.VISIBLE);
            }
        }
    };

    final Handler handler = new Handler() {
        @Override
        public void handleMessage(Message message) {
            if (indeterminateProgressBar != null && act != null)
                act.runOnUiThread(progressBarHide);
            imageView.setImageBitmap((Bitmap) message.obj);
        }
    };

    Thread thread = new Thread() {
        @Override
        public void run() {
            if (indeterminateProgressBar != null && act != null)
                act.runOnUiThread(progressBarShow);
            Bitmap bitmap = fetchBitmap(urlString, saveToHistory);
            Message message = handler.obtainMessage(1, bitmap);
            handler.sendMessage(message);
        }
    };
    thread.start();
}

From source file:net.olejon.mdapp.NotificationsFromSlvAdapter.java

@Override
public void onBindViewHolder(NotificationViewHolder viewHolder, int i) {
    try {/*www.j av  a  2s.com*/
        final JSONObject notificationsJsonObject = mNotifications.getJSONObject(i);

        viewHolder.title.setText(notificationsJsonObject.getString("title"));
        viewHolder.date.setText(notificationsJsonObject.getString("date"));
        viewHolder.type.setText(notificationsJsonObject.getString("type"));
        viewHolder.message.setText(notificationsJsonObject.getString("message"));

        final String title = notificationsJsonObject.getString("title");
        final String uri = notificationsJsonObject.getString("uri");

        if (uri.equals("")) {
            viewHolder.uriSeparator.setVisibility(View.GONE);
            viewHolder.uri.setVisibility(View.GONE);
        } else {
            viewHolder.uriSeparator.setVisibility(View.VISIBLE);
            viewHolder.uri.setVisibility(View.VISIBLE);

            viewHolder.title.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (uri.matches("^https?://.*?\\.pdf$")) {
                        mTools.downloadFile(title, uri);
                    } else {
                        Intent intent = new Intent(mContext, MainWebViewActivity.class);
                        intent.putExtra("title", title);
                        intent.putExtra("uri", uri);
                        mContext.startActivity(intent);
                    }
                }
            });

            viewHolder.uri.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (uri.matches("^https?://.*?\\.pdf$")) {
                        mTools.downloadFile(title, uri);
                    } else {
                        Intent intent = new Intent(mContext, MainWebViewActivity.class);
                        intent.putExtra("title", title);
                        intent.putExtra("uri", uri);
                        mContext.startActivity(intent);
                    }
                }
            });
        }

        animateView(viewHolder.card, i);
    } catch (Exception e) {
        Log.e("NotificationsFromSlv", Log.getStackTraceString(e));
    }
}

From source file:com.perm.DoomPlay.AbstractVkItems.java

void setLoading() {
    if (isLoading) {
        isLoading = false;/*  ww  w  .j a va2s. c  o m*/
        linearLoading.setVisibility(View.GONE);
    } else {
        linearLoading.setVisibility(View.VISIBLE);
        isLoading = true;
    }
}

From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_browser.video.SignVideoFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    Log.d(TAG, "onActivityCreated");
    super.onActivityCreated(savedInstanceState);
    final Sign sign = getArguments().getParcelable(SIGN_TO_SHOW);
    Validate.notNull(sign, "No sign to show provided via fragment arguments.");
    this.signVideoName.setText(sign.getNameLocaleDe());
    this.signVideoMnemonic.setText(sign.getMnemonic());
    try {//from  w ww.ja v a 2 s .  c  o  m
        setupVideoView(sign, SOUND.ON, CONTROLS.SHOW);
    } catch (VideoSetupException ex) {
        this.signVideoName.setText(getString(R.string.videoError));
        this.signVideoMnemonic.setVisibility(View.GONE);
        this.clickVideoToShowControls.setVisibility(View.GONE);
        this.signVideoExceptionMessage.setText(ex.getMessage());
        this.signVideoExceptionMessage.setVisibility(View.VISIBLE);
        this.progressBar.setVisibility(View.GONE);
    }
}

From source file:fr.bde_eseo.eseomega.ingenews.IngeListActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ingenews_list);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    // UI//from www  .ja v a  2  s .  c om
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.inge_refresh);
    swipeRefreshLayout.setColorSchemeColors(R.color.md_blue_800);
    progCircle = (ProgressBar) findViewById(R.id.progressInge);
    tv1 = (TextView) findViewById(R.id.tvListNothing);
    tv2 = (TextView) findViewById(R.id.tvListNothing2);
    img = (ImageView) findViewById(R.id.imgNoInge);
    progCircle.setVisibility(View.GONE);
    progCircle.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.md_grey_500),
            PorterDuff.Mode.SRC_IN);
    tv1.setVisibility(View.GONE);
    tv2.setVisibility(View.GONE);
    img.setVisibility(View.GONE);
    disabler = new RecyclerViewDisabler();

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

    // Model / objects
    ingenewsItems = new ArrayList<>();
    mAdapter = new MyIngeNewsAdapter(this, ingenewsItems);
    recList = (RecyclerView) findViewById(R.id.recyList);
    recList.setAdapter(mAdapter);
    recList.setHasFixedSize(false);
    recList.setVisibility(View.VISIBLE);

    /*
    LinearLayoutManager llm = new LinearLayoutManager(this);
    llm.setOrientation(LinearLayoutManager.VERTICAL);*/

    GridLayoutManager glm = new GridLayoutManager(this, 2);
    glm.setOrientation(LinearLayoutManager.VERTICAL);
    glm.setReverseLayout(false);
    recList.setLayoutManager(glm);

    //recList.setLayoutManager(llm);
    mAdapter.notifyDataSetChanged();

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

    // 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_INGENEWS);
            } else {
                swipeRefreshLayout.setRefreshing(false);
            }
        }
    });
}

From source file:com.piggate.samples.PiggateLoginService.Activity_Logged.java

synchronized void showNotification(final String message) {
    if (notification) {
        return;//from   ww w .  j  a v a2  s  .c o m
    }
    notification = true;
    textNotification.setText(message);
    viewContainer.setVisibility(View.VISIBLE);
    viewContainer.setAlpha(1);
    viewContainer.animate().alpha(0.4f).setDuration(5000).withEndAction(new Runnable() {

        @Override
        public void run() {
            notification = false;
            viewContainer.setVisibility(View.GONE);
        }
    });
}

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

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

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

        public void onAnimationStart(Animation animation) {
            mRlNoInternetNotification.setVisibility(View.VISIBLE);
        }/*from   w  w  w.  j  av a  2  s .  com*/

        public void onAnimationRepeat(Animation animation) {
        }

        public void onAnimationEnd(Animation animation) {
        }
    });

    mSlideOutTop = SpikaApp.getSlideOutTop();
    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);
}