Java Code Examples for android.widget.RelativeLayout#getVisibility()

The following examples show how to use android.widget.RelativeLayout#getVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BrowserActivity.java    From EFRConnect-android with Apache License 2.0 6 votes vote down vote up
private void adjustLayout() { //TODO Fix animation (Almost ok)

        RelativeLayout logbody = findViewById(R.id.log_body);

        if (logbody.getVisibility() == View.GONE) {
            logbody.setVisibility(View.VISIBLE);
            Log.i("adjustLayout", "Creating View");
            running = true;
            startlog();
        } else {
            Log.i("adjustLayout", "Hiding View");

            running = false;
            logbody.setVisibility(View.GONE);
        }
    }
 
Example 2
Source File: DeviceServicesActivity.java    From EFRConnect-android with Apache License 2.0 6 votes vote down vote up
/**
 * FUTURE IMPLEMENTATION OF LOG VIEW
 **************************************************/
//Not used
private void adjustLayout() { //TODO Fix animation (Almost ok)
    float scale = getResources().getDisplayMetrics().density;
    RelativeLayout logbody = findViewById(R.id.log_body_connected);
    ViewGroup.MarginLayoutParams svw = (ViewGroup.MarginLayoutParams) scrollViewWrapper.getLayoutParams();
    if (logbody.getVisibility() == View.GONE) {
        Log.i("adjustLayout", "Creating View");
        running = true;
        svw.setMargins(0, 0, 0, (int) ((scale * 300) + 0.5f));
        scrollViewWrapper.setLayoutParams(svw);
        logbody.setVisibility(View.VISIBLE);
        startlog();
    } else {
        Log.i("adjustLayout", "Hiding View");
        running = false;
        svw.setMargins(0, 0, 0, 0);
        scrollViewWrapper.setLayoutParams(svw);
        logbody.setVisibility(View.GONE);
    }
}
 
Example 3
Source File: AudioPlayer.java    From Pix-Art-Messenger with GNU General Public License v3.0 5 votes vote down vote up
private boolean refreshAudioPlayer(RelativeLayout audioPlayer, int current, int duration) {
    if (audioPlayer == null || audioPlayer.getVisibility() != View.VISIBLE) {
        return false;
    }
    final ViewHolder viewHolder = ViewHolder.get(audioPlayer);
    if (duration <= 0) {
        viewHolder.progress.setProgress(100);
    } else {
        viewHolder.progress.setProgress(current * 100 / duration);
    }
    viewHolder.runtime.setText(String.format("%s / %s", formatTime(current), formatTime(duration)));
    return true;
}
 
Example 4
Source File: AudioPlayer.java    From Conversations with GNU General Public License v3.0 5 votes vote down vote up
private boolean refreshAudioPlayer(RelativeLayout audioPlayer, int current, int duration) {
    if (audioPlayer == null || audioPlayer.getVisibility() != View.VISIBLE) {
        return false;
    }
    final ViewHolder viewHolder = ViewHolder.get(audioPlayer);
    if (duration <= 0) {
        viewHolder.progress.setProgress(100);
    } else {
        viewHolder.progress.setProgress(current * 100 / duration);
    }
    viewHolder.runtime.setText(String.format("%s / %s", formatTime(current), formatTime(duration)));
    return true;
}