Android Open Source - ChitChat Compose Text Activity






From Project

Back to project page ChitChat.

License

The source code is released under:

MIT License

If you think the Android project ChitChat 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.shivamb7.chitchat;
/*from  w  w  w  .  j av  a  2 s  .  c o m*/
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.shivamb7.chitchat.workers.Constants;

public class ComposeTextActivity extends Activity {

  static String msg;
  Uri mMediaUri;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_compose_text);
    Button b = (Button)findViewById(R.id.button1);
    final EditText et1 = (EditText)findViewById(R.id.editText1);
    b.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        msg = et1.getText().toString();
        if(msg.isEmpty())
        {
          Toast.makeText(ComposeTextActivity.this, R.string.empty_text_message, Toast.LENGTH_SHORT).show();
        }
        else if(msg.length()>140)
        {
          Toast.makeText(ComposeTextActivity.this, R.string.long_text_error, Toast.LENGTH_SHORT).show();
        }
        else
        {
        Intent i = new Intent(ComposeTextActivity.this,RecipientsActivity.class);
        i.putExtra(com.shivamb7.chitchat.workers.Constants.FILE_TYPE, Constants.TEXT_TYPE);
        mMediaUri = Uri.parse("http://www.google.com");
        i.setData(mMediaUri);
        startActivity(i);
        }
      }
    });
}
}




Java Source Code List

com.pkmmte.circularimageview.CircularImageView.java
com.shivamb7.chitchat.AddFriendsActivity.java
com.shivamb7.chitchat.ChatsActivity.java
com.shivamb7.chitchat.ComposeTextActivity.java
com.shivamb7.chitchat.ImageMessageActivity.java
com.shivamb7.chitchat.MainActivity.java
com.shivamb7.chitchat.ProfileActivity.java
com.shivamb7.chitchat.RecipientsActivity.java
com.shivamb7.chitchat.RegisterActivity2.java
com.shivamb7.chitchat.RegisterActivity.java
com.shivamb7.chitchat.adapters.ChatsAdapter.java
com.shivamb7.chitchat.adapters.FriendGridAdapter.java
com.shivamb7.chitchat.adapters.LevelAdapter.java
com.shivamb7.chitchat.fragments.ChatsFragment.java
com.shivamb7.chitchat.fragments.ContactsFragment.java
com.shivamb7.chitchat.fragments.ProfileFragment.java
com.shivamb7.chitchat.workers.ChitChatApplication.java
com.shivamb7.chitchat.workers.CircularImageView.java
com.shivamb7.chitchat.workers.Constants.java
com.shivamb7.chitchat.workers.Fab.java
com.shivamb7.chitchat.workers.FileHelper.java
com.shivamb7.chitchat.workers.ImageResizer.java
com.shivamb7.chitchat.workers.Level.java
com.shivamb7.chitchat.workers.RippleView.java
com.shivamb7.chitchat.workers.TypefaceSpan.java