Android Open Source - TATupload Tab Content






From Project

Back to project page TATupload.

License

The source code is released under:

GNU General Public License

If you think the Android project TATupload 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 uk.org.sucu.tatupload;
// www .ja  va 2  s  .c om
import uk.org.sucu.tatupload.MessageArrayAdapter.ViewHolder;
import uk.org.sucu.tatupload.R;
import uk.org.sucu.tatupload.activity.SmsReviewActivity;
import uk.org.sucu.tatupload.message.SmsList;
import uk.org.sucu.tatupload.message.Text;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.actionbarsherlock.app.SherlockFragment;

public class TabContent extends SherlockFragment {

  public final static String TEXT_MESSAGE = "uk.org.sucu.tatupload.TEXT_MESSAGE";
  
  int queue;
  SmsList smsList;
  
  static TabContent newInstance(int queue){
    TabContent tc = new TabContent();
    
    Bundle args  = new Bundle();
    args.putInt("queue", queue);
    tc.setArguments(args);
    
    tc.setQueue(queue);
    
    return tc;
  }
  
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    queue = getArguments() != null ? getArguments().getInt("queue") : -1;
    setQueue(queue);
  }
  
  
  public void onSaveInstanceState(Bundle outState){
    super.onSaveInstanceState(outState);
    outState.putInt("queue", queue);
  }
  
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
    View queue = inflater.inflate(R.layout.message_queue, container, false);
    ListView lv = (ListView) queue.findViewById(R.id.messageListView);

    MessageArrayAdapter adapter = smsList.getMessageArrayAdapter(this.getActivity());
    lv.setAdapter(adapter);
    lv.setOnItemClickListener(new OnItemClickListener(){

      @Override
      public void onItemClick(AdapterView<?> arg0, View v, int position, long id) {

        // Get the sms message contained in the clicked object
        ViewHolder holder = (ViewHolder) v.getTag();
        Text sms = holder.getText();
        //send it in an intent to an SmsReviewActivity
        Intent intent = new Intent(v.getContext(), SmsReviewActivity.class);
        intent.putExtra(TEXT_MESSAGE, sms);
        startActivity(intent);
      }

    });

    return queue;
  }
  
  private void setQueue(int queue){
    this.queue = queue;
    
    if(queue == R.string.unprocessed){
      smsList = SmsList.getPendingList();
    } else if(queue == R.string.uploaded){
      smsList = SmsList.getUploadedList();
    } else {
      smsList = new SmsList();
    }
  }
  
}




Java Source Code List

org.apache.pig.impl.util.ObjectSerializer.java
uk.org.sucu.tatupload.BrowserAccessor.java
uk.org.sucu.tatupload.MessageArrayAdapter.java
uk.org.sucu.tatupload.NetCaller.java
uk.org.sucu.tatupload.Notifications.java
uk.org.sucu.tatupload.ParameterArrayAdapter.java
uk.org.sucu.tatupload.ResolveInfoArrayAdapter.java
uk.org.sucu.tatupload.Settings.java
uk.org.sucu.tatupload.TabContent.java
uk.org.sucu.tatupload.TabManager.java
uk.org.sucu.tatupload.TatUploadApplication.java
uk.org.sucu.tatupload.activity.MainActivity.java
uk.org.sucu.tatupload.activity.OptionActivity.java
uk.org.sucu.tatupload.activity.ParameterViewActivity.java
uk.org.sucu.tatupload.activity.SmsReviewActivity.java
uk.org.sucu.tatupload.activity.TutorialActivity.java
uk.org.sucu.tatupload.message.SmsList.java
uk.org.sucu.tatupload.message.SmsReceiver.java
uk.org.sucu.tatupload.message.Text.java
uk.org.sucu.tatupload.parse.Parameters.java
uk.org.sucu.tatupload.parse.Parser.java
uk.org.sucu.tatupload.parse.Property.java