Android Open Source - karin User Statuses Activity






From Project

Back to project page karin.

License

The source code is released under:

MIT License

If you think the Android project karin 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 cc.wanko.karin.app.activities;
/*from   w ww.  j  a  v a 2 s  . co  m*/
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import cc.wanko.karin.app.R;
import cc.wanko.karin.app.client.UserStatusSource;
import cc.wanko.karin.app.fragments.StatusListFragment;
import roboguice.activity.RoboActionBarActivity;
import roboguice.inject.InjectExtra;
import roboguice.inject.InjectFragment;
import twitter4j.User;
import twitter4j.UserMentionEntity;

public class UserStatusesActivity extends RoboActionBarActivity {

    private static final String ARGS_USER_ID = "user_id";
    private static final String ARGS_SCREEN_NAME = "screen_name";

    @InjectExtra(ARGS_USER_ID)
    private long userId;
    @InjectExtra(ARGS_SCREEN_NAME)
    private String screenName;

    @InjectFragment(R.id.user_statuses)
    private StatusListFragment statusListFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_statuses);

        getSupportActionBar().setTitle("@" + screenName);

        UserStatusSource source = new UserStatusSource(this, userId);
        statusListFragment.setStatusSource(source);
        statusListFragment.retrieveStatuses();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.user_statuses, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public static Intent createIntent(Context context, User user) {
        return createIntent(context, user.getId(), user.getScreenName());
    }

    public static Intent createIntent(Context context, UserMentionEntity entity) {
        return createIntent(context, entity.getId(), entity.getScreenName());
    }

    public static Intent createIntent(Context context, long userId, String screenName) {
        Intent intent = new Intent(context, UserStatusesActivity.class);
        intent.putExtra(ARGS_USER_ID, userId);
        intent.putExtra(ARGS_SCREEN_NAME, screenName);
        return intent;
    }
}




Java Source Code List

cc.wanko.karin.app.activities.MainActivity.java
cc.wanko.karin.app.activities.OAuthActivity.java
cc.wanko.karin.app.activities.UserListActivity.java
cc.wanko.karin.app.activities.UserStatusesActivity.java
cc.wanko.karin.app.adapters.MainPagerAdapter.java
cc.wanko.karin.app.adapters.StatusListAdapter.java
cc.wanko.karin.app.adapters.UserListListAdapter.java
cc.wanko.karin.app.client.HomeTimelineSource.java
cc.wanko.karin.app.client.StatusSource.java
cc.wanko.karin.app.client.TwitterProvider.java
cc.wanko.karin.app.client.UserListSource.java
cc.wanko.karin.app.client.UserStatusSource.java
cc.wanko.karin.app.database.Database.java
cc.wanko.karin.app.fragments.StatusListFragment.java
cc.wanko.karin.app.fragments.UserListListFragment.java
cc.wanko.karin.app.textbuilder.MediaSegment.java
cc.wanko.karin.app.textbuilder.MentionSegment.java
cc.wanko.karin.app.textbuilder.Segment.java
cc.wanko.karin.app.textbuilder.StatusTextBuilder.java
cc.wanko.karin.app.textbuilder.UrlSegment.java
cc.wanko.karin.app.utils.LruImageCache.java
cc.wanko.karin.app.utils.RoboViewHolder.java