getVisibility ( )源码实例Demo

android.widget.RelativeLayout#getVisibility ( )源码实例Demo

下面列出了android.widget.RelativeLayout#getVisibility ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: EFRConnect-android   文件: BrowserActivity.java
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);
        }
    }
 
/**
 * 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);
    }
}
 
源代码3 项目: Pix-Art-Messenger   文件: AudioPlayer.java
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;
}
 
源代码4 项目: Conversations   文件: AudioPlayer.java
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;
}