parent
595ec128cd
commit
9c229db0b8
|
@ -49,11 +49,10 @@ public class FollowStatus extends AsyncTask <Long, Void, Void> {
|
|||
try {
|
||||
if(mode == 1L) { //FOLLOWING
|
||||
userlist = twitter.getFollowersList(userID,cursor);
|
||||
usrAdp = new UserAdapter(context,new UserDatabase(context,userlist));
|
||||
} else { //Follower
|
||||
userlist = twitter.getFriendsList(userID,cursor);
|
||||
usrAdp = new UserAdapter(context,new UserDatabase(context,userlist));
|
||||
}
|
||||
usrAdp = new UserAdapter(context,new UserDatabase(context,userlist));
|
||||
} catch(Exception err) {
|
||||
err.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -71,8 +71,8 @@ public class MainPage extends AsyncTask<Integer, Void, Boolean>
|
|||
timelineAdapter = new TimelineAdapter(context,mTweets);
|
||||
}
|
||||
else if(mode == 1) {
|
||||
int location = settings.getInt("woeid",23424829);
|
||||
TrendDatabase trend = new TrendDatabase(twitter.getPlaceTrends(location),context); //Germany by default
|
||||
int location = settings.getInt("woeid",23424829); // Germany WOEID
|
||||
TrendDatabase trend = new TrendDatabase(twitter.getPlaceTrends(location),context);
|
||||
trendsAdapter = new TrendAdapter(context,trend);
|
||||
}
|
||||
else if(mode == 2) {
|
||||
|
|
|
@ -195,7 +195,7 @@ public class ProfileAction extends AsyncTask<Long,Void,Long>
|
|||
{
|
||||
Toast.makeText(context,"Fehler beim Laden des Profils",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
if(!isHome) { //Set Icons if it isn't the home profile
|
||||
if(!isHome) {
|
||||
if(isFollowing) {
|
||||
tool.getMenu().getItem(1).setIcon(R.drawable.follow_enabled);
|
||||
} else {
|
||||
|
|
|
@ -42,8 +42,6 @@ public class RegisterAccount extends AsyncTask<String, Void, String>
|
|||
mTwitter.initialize(pin);
|
||||
return "success";
|
||||
}
|
||||
} catch ( TwitterException e ) {
|
||||
return e.getMessage();
|
||||
} catch ( Exception e ) {
|
||||
return e.getMessage();
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
|||
|
||||
private SwipeRefreshLayout homeReload, favoriteReload;
|
||||
private ListView homeTweets, homeFavorits;
|
||||
private TextView txtFollowing, txtFollower;
|
||||
private Toolbar tool;
|
||||
private long userId;
|
||||
private boolean home;
|
||||
|
@ -43,12 +42,11 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
|||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
userId = getIntent().getExtras().getLong("userID");
|
||||
SharedPreferences settings = getApplicationContext().getSharedPreferences("settings", 0);
|
||||
long homeId = settings.getLong("userID", -1);
|
||||
home = userId == homeId;
|
||||
home = userId == settings.getLong("userID", -1);
|
||||
homeTweets = (ListView)findViewById(R.id.ht_list);
|
||||
homeFavorits = (ListView)findViewById(R.id.hf_list);
|
||||
txtFollowing = (TextView)findViewById(R.id.following);
|
||||
txtFollower = (TextView)findViewById(R.id.follower);
|
||||
TextView txtFollowing = (TextView)findViewById(R.id.following);
|
||||
TextView txtFollower = (TextView)findViewById(R.id.follower);
|
||||
homeReload = (SwipeRefreshLayout) findViewById(R.id.hometweets);
|
||||
favoriteReload = (SwipeRefreshLayout) findViewById(R.id.homefavorits);
|
||||
TabHost mTab = (TabHost)findViewById(R.id.profile_tab);
|
||||
|
@ -187,6 +185,9 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
|||
currentTab = tabId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab Content
|
||||
*/
|
||||
private void getContent() {
|
||||
TweetDatabase mTweet = new TweetDatabase(UserProfile.this, TweetDatabase.USER_TL, userId);
|
||||
TweetDatabase fTweet = new TweetDatabase(UserProfile.this, TweetDatabase.FAV_TL, userId);
|
||||
|
@ -202,10 +203,16 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Profile Information
|
||||
*/
|
||||
private void initElements() {
|
||||
new ProfileAction(this, tool).execute(userId, ProfileAction.GET_INFORMATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mode 0L = Following , 1L Follower
|
||||
*/
|
||||
private void getFollows(long mode) {
|
||||
Intent intent = new Intent(getApplicationContext(), Follower.class);
|
||||
Bundle bundle = new Bundle();
|
||||
|
|
Loading…
Reference in New Issue