Android Open Source - android-mimic-ui U I Progress Item






From Project

Back to project page android-mimic-ui.

License

The source code is released under:

Apache License

If you think the Android project android-mimic-ui listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mimic.ui.tableview.support;
/*w ww. ja  v  a 2  s.c  om*/
import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.mimic.ui.R;
import com.mimic.ui.tableview.UITableViewItem;

public class UIProgressItem extends UITableViewItem {
  
  private ProgressBar mProgressBar = null;
  private TextView mMessage = null;

  public UIProgressItem(Context context, String message) {
    super(context, message);
    setStyle(STYLE_NONE);
    setupProgressViews();
    setMessage(message);
  }
    
  void setupProgressViews() {
    LinearLayout progressItemContentView = (LinearLayout) getInflater().inflate(
        R.layout.uiprogresstem, null);
    mProgressBar = (ProgressBar) progressItemContentView.findViewById(R.id.progress);
    mMessage = (TextView) progressItemContentView.findViewById(R.id.message);
    getItemView().setPadding(0, 0, 0, 0);
    getItemView().setMinimumHeight(0);
    getContentView().removeAllViews();
    getContentView().setPadding(0, 0, 0, 0);
    getContentView().addView(progressItemContentView);
  }

  public ProgressBar getProgressView() {
    return mProgressBar;
  }
    
  public TextView getMessageView() {
    return mMessage;
  }  
  
  public void setMessage(String message) {
    if (message != null) {
      mMessage.setText(message);
      mMessage.setVisibility(View.VISIBLE);
    } else {
      mMessage.setVisibility(View.GONE);
    }
  }
  
  public void hide() {
    getItemView().setVisibility(View.GONE);
  }
  
  public void show() {
    getItemView().setVisibility(View.VISIBLE);
  }

  @Override
  public boolean isClickable() {
    return false;
  }

  @Override
  public void setClickable(boolean clickable) {
    // do nothing
  }
}




Java Source Code List

com.mimic.ui.tableview.IListItem.java
com.mimic.ui.tableview.UITableViewActivity.java
com.mimic.ui.tableview.UITableViewItem.java
com.mimic.ui.tableview.UITableViewSection.java
com.mimic.ui.tableview.UITableView.java
com.mimic.ui.tableview.support.UIButtonItem.java
com.mimic.ui.tableview.support.UIMultiChoiceListSection.java
com.mimic.ui.tableview.support.UIProgressItem.java
com.mimic.ui.tableview.support.UISingleChoiceListSection.java
com.mimic.ui.tableview.support.UISliderItem.java
com.mimic.ui.tableview.support.UISwitchItem.java
com.mimic.ui.tableview.support.UITextInputItem.java
com.mimic.ui.tableview.support.UIVolumeControlItem.java