Android Open Source - Dense-sms-sender-for-android Post Message Array Adaptor






From Project

Back to project page Dense-sms-sender-for-android.

License

The source code is released under:

Apache License

If you think the Android project Dense-sms-sender-for-android 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 mrhs.ce.DenseSms;
/*from  w  w w  .  j av  a 2  s  . co m*/
import mrhs.ce.DenseSms.R;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class PostMessageArrayAdaptor extends ArrayAdapter<String> {
  
  PostMessageActivity context;
  public PostMessageArrayAdaptor(PostMessageActivity ctx){
    super(ctx,R.layout.message_report_item,ctx.phoneList);
    context=ctx;
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    
    if(convertView==null){
      LayoutInflater inflater = (LayoutInflater) context
          .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      convertView = inflater.inflate(R.layout.message_report_item, parent, false);
    }
    
    TextView numberLabel,nameLabel,sentLabel,deliveredLabel;
    
    numberLabel=(TextView)convertView.findViewById(R.id.numberLabel1);
    nameLabel=(TextView)convertView.findViewById(R.id.NameLabel1);
    sentLabel=(TextView)convertView.findViewById(R.id.sentLabel1);
    deliveredLabel=(TextView)convertView.findViewById(R.id.deliveredLabel1);
    log("All views are found");
    
    
    numberLabel.setText(Integer.toString(position+1));
    if(context.nameList.get(position)==null)
      nameLabel.setText(context.phoneList.get(position));
    else
      nameLabel.setText(context.nameList.get(position));
    
    if(context.sentList.get(position)==1){
      sentLabel.setText("????? ??");
    }else if(context.sentList.get(position)==-1)
      sentLabel.setText("????? ???");
    else if(context.sentList.get(position)==0)
      sentLabel.setText("??? ????");
    
    if(context.deliveredList.get(position)==1){
      deliveredLabel.setText("Delivered");
    }else if(context.deliveredList.get(position)==-1)
      deliveredLabel.setText("Failed");
    else if(context.deliveredList.get(position)==0)
      deliveredLabel.setText("??? ????");
    
    log("All values are set");  
    
    return convertView;
  }
  
  private void log(String text){
      Log.d("PostMessage Array Adaptor", text);
    }
}




Java Source Code List

mrhs.ce.DenseSms.ContactPickerMulti.java
mrhs.ce.DenseSms.ContactsArrayAdaptor.java
mrhs.ce.DenseSms.DatabaseHandler.java
mrhs.ce.DenseSms.GroupEditorActivity.java
mrhs.ce.DenseSms.GroupEditorArrayAdaptor.java
mrhs.ce.DenseSms.MainActivity.java
mrhs.ce.DenseSms.MyEditText.java
mrhs.ce.DenseSms.PostMessageActivity.java
mrhs.ce.DenseSms.PostMessageArrayAdaptor.java
mrhs.ce.DenseSms.SdCardHandler.java