mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-29 10:29:32 +01:00
renamed class, restructured fragment adapter, added toolbar titles
This commit is contained in:
parent
0dca64953e
commit
7e026f4f10
@ -62,7 +62,7 @@
|
||||
android:theme="@style/AppTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.activities.UserProfile"
|
||||
android:name=".ui.activities.ProfileActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme" />
|
||||
|
||||
|
@ -53,8 +53,6 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
private ListFragment[] fragments;
|
||||
|
||||
/**
|
||||
* Initialize Fragment Adapter
|
||||
*
|
||||
* @param fManager Activity Fragment Manager
|
||||
*/
|
||||
public FragmentAdapter(FragmentManager fManager) {
|
||||
@ -96,16 +94,16 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* setup adapter for the home activity
|
||||
*/
|
||||
public void setupForHomePage() {
|
||||
Bundle home_tl = new Bundle();
|
||||
Bundle ment_tl = new Bundle();
|
||||
home_tl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_HOME);
|
||||
ment_tl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_MENT);
|
||||
Bundle paramHomeTl = new Bundle();
|
||||
Bundle paramMention = new Bundle();
|
||||
paramHomeTl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_HOME);
|
||||
paramMention.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_MENT);
|
||||
fragments = new ListFragment[3];
|
||||
fragments[0] = new TweetFragment();
|
||||
fragments[1] = new TrendFragment();
|
||||
fragments[2] = new TweetFragment();
|
||||
fragments[0].setArguments(home_tl);
|
||||
fragments[2].setArguments(ment_tl);
|
||||
fragments[0].setArguments(paramHomeTl);
|
||||
fragments[2].setArguments(paramMention);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -115,20 +113,17 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param userId ID of the user
|
||||
*/
|
||||
public void setupProfilePage(long userId) {
|
||||
Bundle paramTweet = new Bundle();
|
||||
Bundle paramFavorite = new Bundle();
|
||||
paramTweet.putLong(KEY_FRAG_TWEET_ID, userId);
|
||||
paramFavorite.putLong(KEY_FRAG_TWEET_ID, userId);
|
||||
paramTweet.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_TWEETS);
|
||||
paramFavorite.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_FAVORS);
|
||||
fragments = new ListFragment[2];
|
||||
|
||||
fragments[0] = new TweetFragment();
|
||||
Bundle usr_tweet = new Bundle();
|
||||
usr_tweet.putLong(KEY_FRAG_TWEET_ID, userId);
|
||||
usr_tweet.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_TWEETS);
|
||||
fragments[0].setArguments(usr_tweet);
|
||||
|
||||
fragments[1] = new TweetFragment();
|
||||
Bundle usr_favor = new Bundle();
|
||||
usr_favor.putLong(KEY_FRAG_TWEET_ID, userId);
|
||||
usr_favor.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_FAVORS);
|
||||
fragments[1].setArguments(usr_favor);
|
||||
|
||||
fragments[0].setArguments(paramTweet);
|
||||
fragments[1].setArguments(paramFavorite);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -138,17 +133,17 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param search Search string
|
||||
*/
|
||||
public void setupSearchPage(String search) {
|
||||
Bundle tweetSearch = new Bundle();
|
||||
Bundle userSearch = new Bundle();
|
||||
tweetSearch.putString(KEY_FRAG_TWEET_SEARCH, search);
|
||||
userSearch.putString(KEY_FRAG_USER_SEARCH, search);
|
||||
tweetSearch.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_SEARCH);
|
||||
userSearch.putInt(KEY_FRAG_USER_MODE, USER_FRAG_SEARCH);
|
||||
Bundle paramTweetSearch = new Bundle();
|
||||
Bundle paramUserSearch = new Bundle();
|
||||
paramTweetSearch.putString(KEY_FRAG_TWEET_SEARCH, search);
|
||||
paramUserSearch.putString(KEY_FRAG_USER_SEARCH, search);
|
||||
paramTweetSearch.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_SEARCH);
|
||||
paramUserSearch.putInt(KEY_FRAG_USER_MODE, USER_FRAG_SEARCH);
|
||||
fragments = new ListFragment[2];
|
||||
fragments[0] = new TweetFragment();
|
||||
fragments[1] = new UserFragment();
|
||||
fragments[0].setArguments(tweetSearch);
|
||||
fragments[1].setArguments(userSearch);
|
||||
fragments[0].setArguments(paramTweetSearch);
|
||||
fragments[1].setArguments(paramUserSearch);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -159,22 +154,22 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param username screen name of the owner
|
||||
*/
|
||||
public void setupListPage(long userId, String username) {
|
||||
Bundle userListParam = new Bundle();
|
||||
Bundle subscriberParam = new Bundle();
|
||||
Bundle paramUserlistOwnership = new Bundle();
|
||||
Bundle paramUserlistSubscription = new Bundle();
|
||||
if (userId > 0) {
|
||||
userListParam.putLong(KEY_FRAG_LIST_OWNER_ID, userId);
|
||||
subscriberParam.putLong(KEY_FRAG_LIST_OWNER_ID, userId);
|
||||
paramUserlistOwnership.putLong(KEY_FRAG_LIST_OWNER_ID, userId);
|
||||
paramUserlistSubscription.putLong(KEY_FRAG_LIST_OWNER_ID, userId);
|
||||
} else {
|
||||
userListParam.putString(KEY_FRAG_LIST_OWNER_NAME, username);
|
||||
subscriberParam.putString(KEY_FRAG_LIST_OWNER_NAME, username);
|
||||
paramUserlistOwnership.putString(KEY_FRAG_LIST_OWNER_NAME, username);
|
||||
paramUserlistSubscription.putString(KEY_FRAG_LIST_OWNER_NAME, username);
|
||||
}
|
||||
userListParam.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_OWNS);
|
||||
subscriberParam.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_SUBSCR_TO);
|
||||
paramUserlistOwnership.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_OWNS);
|
||||
paramUserlistSubscription.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_SUBSCR_TO);
|
||||
fragments = new ListFragment[2];
|
||||
fragments[0] = new UserListFragment();
|
||||
fragments[1] = new UserListFragment();
|
||||
fragments[0].setArguments(userListParam);
|
||||
fragments[1].setArguments(subscriberParam);
|
||||
fragments[0].setArguments(paramUserlistOwnership);
|
||||
fragments[1].setArguments(paramUserlistSubscription);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -185,23 +180,23 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param ownerOfList true if current user owns this list
|
||||
*/
|
||||
public void setupListContentPage(long listId, boolean ownerOfList) {
|
||||
Bundle tweetParam = new Bundle();
|
||||
Bundle userParam = new Bundle();
|
||||
Bundle subscrParam = new Bundle();
|
||||
tweetParam.putLong(KEY_FRAG_TWEET_ID, listId);
|
||||
tweetParam.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_LIST);
|
||||
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_MEMBERS);
|
||||
userParam.putBoolean(KEY_FRAG_DEL_USER, ownerOfList);
|
||||
userParam.putLong(KEY_FRAG_USER_ID_ALL, listId);
|
||||
subscrParam.putLong(KEY_FRAG_USER_ID_ALL, listId);
|
||||
subscrParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_SUBSCRIBER);
|
||||
Bundle paramUserlistTl = new Bundle();
|
||||
Bundle paramUserlistMember = new Bundle();
|
||||
Bundle paramUserlistSubscriber = new Bundle();
|
||||
paramUserlistTl.putLong(KEY_FRAG_TWEET_ID, listId);
|
||||
paramUserlistTl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_LIST);
|
||||
paramUserlistMember.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_MEMBERS);
|
||||
paramUserlistMember.putBoolean(KEY_FRAG_DEL_USER, ownerOfList);
|
||||
paramUserlistMember.putLong(KEY_FRAG_USER_ID_ALL, listId);
|
||||
paramUserlistSubscriber.putLong(KEY_FRAG_USER_ID_ALL, listId);
|
||||
paramUserlistSubscriber.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_SUBSCRIBER);
|
||||
fragments = new ListFragment[3];
|
||||
fragments[0] = new TweetFragment();
|
||||
fragments[1] = new UserFragment();
|
||||
fragments[2] = new UserFragment();
|
||||
fragments[0].setArguments(tweetParam);
|
||||
fragments[1].setArguments(userParam);
|
||||
fragments[2].setArguments(subscrParam);
|
||||
fragments[0].setArguments(paramUserlistTl);
|
||||
fragments[1].setArguments(paramUserlistMember);
|
||||
fragments[2].setArguments(paramUserlistSubscriber);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -209,16 +204,15 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* setup adapter for a page of muted / blocked users
|
||||
*/
|
||||
public void setupMuteBlockPage() {
|
||||
Bundle paramMute = new Bundle();
|
||||
Bundle paramBlock = new Bundle();
|
||||
paramMute.putInt(KEY_FRAG_USER_MODE, USER_FRAG_MUTED_USERS);
|
||||
paramBlock.putInt(KEY_FRAG_USER_MODE, USER_FRAG_BLOCKED_USERS);
|
||||
|
||||
Bundle paramMuteList = new Bundle();
|
||||
Bundle paramBlockList = new Bundle();
|
||||
paramMuteList.putInt(KEY_FRAG_USER_MODE, USER_FRAG_MUTED_USERS);
|
||||
paramBlockList.putInt(KEY_FRAG_USER_MODE, USER_FRAG_BLOCKED_USERS);
|
||||
fragments = new ListFragment[2];
|
||||
fragments[0] = new UserFragment();
|
||||
fragments[1] = new UserFragment();
|
||||
fragments[0].setArguments(paramMute);
|
||||
fragments[1].setArguments(paramBlock);
|
||||
fragments[0].setArguments(paramMuteList);
|
||||
fragments[1].setArguments(paramBlockList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -230,7 +224,6 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
Bundle paramFollower = new Bundle();
|
||||
paramFollowing.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOW_INCOMING);
|
||||
paramFollower.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOW_OUTGOING);
|
||||
|
||||
fragments = new ListFragment[2];
|
||||
fragments[0] = new UserFragment();
|
||||
fragments[1] = new UserFragment();
|
||||
@ -245,12 +238,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param userId ID of the user
|
||||
*/
|
||||
public void setupFollowingPage(long userId) {
|
||||
Bundle userParam = new Bundle();
|
||||
userParam.putLong(KEY_FRAG_USER_ID_ALL, userId);
|
||||
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWING);
|
||||
Bundle paramFollowing = new Bundle();
|
||||
paramFollowing.putLong(KEY_FRAG_USER_ID_ALL, userId);
|
||||
paramFollowing.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWING);
|
||||
fragments = new ListFragment[1];
|
||||
fragments[0] = new UserFragment();
|
||||
fragments[0].setArguments(userParam);
|
||||
fragments[0].setArguments(paramFollowing);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -260,12 +253,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param userId ID of the user
|
||||
*/
|
||||
public void setupFollowerPage(long userId) {
|
||||
Bundle userParam = new Bundle();
|
||||
userParam.putLong(KEY_FRAG_USER_ID_ALL, userId);
|
||||
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWER);
|
||||
Bundle paramFollower = new Bundle();
|
||||
paramFollower.putLong(KEY_FRAG_USER_ID_ALL, userId);
|
||||
paramFollower.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWER);
|
||||
fragments = new ListFragment[1];
|
||||
fragments[0] = new UserFragment();
|
||||
fragments[0].setArguments(userParam);
|
||||
fragments[0].setArguments(paramFollower);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -275,12 +268,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param tweetId ID of the tweet
|
||||
*/
|
||||
public void setupRetweeterPage(long tweetId) {
|
||||
Bundle userParam = new Bundle();
|
||||
userParam.putLong(KEY_FRAG_USER_ID_ALL, tweetId);
|
||||
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_RETWEET);
|
||||
Bundle paramRetweeter = new Bundle();
|
||||
paramRetweeter.putLong(KEY_FRAG_USER_ID_ALL, tweetId);
|
||||
paramRetweeter.putInt(KEY_FRAG_USER_MODE, USER_FRAG_RETWEET);
|
||||
fragments = new ListFragment[1];
|
||||
fragments[0] = new UserFragment();
|
||||
fragments[0].setArguments(userParam);
|
||||
fragments[0].setArguments(paramRetweeter);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@ -290,12 +283,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
|
||||
* @param tweetId ID of the tweet
|
||||
*/
|
||||
public void setFavoriterPage(long tweetId) {
|
||||
Bundle userParam = new Bundle();
|
||||
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FAVORIT);
|
||||
userParam.putLong(KEY_FRAG_USER_ID_ALL, tweetId);
|
||||
Bundle paramFavoriter = new Bundle();
|
||||
paramFavoriter.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FAVORIT);
|
||||
paramFavoriter.putLong(KEY_FRAG_USER_ID_ALL, tweetId);
|
||||
fragments = new ListFragment[1];
|
||||
fragments[0] = new UserFragment();
|
||||
fragments[0].setArguments(userParam);
|
||||
fragments[0].setArguments(paramFavoriter);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,8 @@ import static org.nuclearfog.twidda.ui.activities.SearchActivity.KEY_SEARCH_QUER
|
||||
import static org.nuclearfog.twidda.ui.activities.TweetActivity.KEY_TWEET_ID;
|
||||
import static org.nuclearfog.twidda.ui.activities.TweetActivity.KEY_TWEET_NAME;
|
||||
import static org.nuclearfog.twidda.ui.activities.TweetEditor.KEY_TWEETPOPUP_TEXT;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.KEY_PROFILE_DATA;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.KEY_PROFILE_DISABLE_RELOAD;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.KEY_PROFILE_DATA;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.KEY_PROFILE_DISABLE_RELOAD;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserlistActivity.KEY_LIST_ID;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserlistsActivity.KEY_USERLIST_OWNER_NAME;
|
||||
|
||||
@ -24,7 +24,7 @@ import org.nuclearfog.twidda.ui.activities.MessageActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.SearchActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.TweetActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.TweetEditor;
|
||||
import org.nuclearfog.twidda.ui.activities.UserProfile;
|
||||
import org.nuclearfog.twidda.ui.activities.ProfileActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.UserlistActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.UserlistsActivity;
|
||||
|
||||
@ -134,7 +134,7 @@ public class LinkLoader extends AsyncTask<Uri, Void, LinkLoader.DataHolder> {
|
||||
User user = mTwitter.showUser(path);
|
||||
data.putSerializable(KEY_PROFILE_DATA, user);
|
||||
data.putBoolean(KEY_PROFILE_DISABLE_RELOAD, true);
|
||||
dataHolder = new DataHolder(data, UserProfile.class);
|
||||
dataHolder = new DataHolder(data, ProfileActivity.class);
|
||||
} else {
|
||||
String username = '@' + path.substring(0, path.indexOf('/'));
|
||||
// show tweet
|
||||
|
@ -9,7 +9,7 @@ import org.nuclearfog.twidda.database.AppDatabase;
|
||||
import org.nuclearfog.twidda.database.FilterDatabase;
|
||||
import org.nuclearfog.twidda.model.Relation;
|
||||
import org.nuclearfog.twidda.model.User;
|
||||
import org.nuclearfog.twidda.ui.activities.UserProfile;
|
||||
import org.nuclearfog.twidda.ui.activities.ProfileActivity;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
@ -17,7 +17,7 @@ import java.lang.ref.WeakReference;
|
||||
* This background task loads profile information about a twitter user and take actions
|
||||
*
|
||||
* @author nuclearfog
|
||||
* @see UserProfile
|
||||
* @see ProfileActivity
|
||||
*/
|
||||
public class UserAction extends AsyncTask<Void, User, Relation> {
|
||||
|
||||
@ -63,7 +63,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
|
||||
|
||||
|
||||
private ErrorHandler.TwitterError twException;
|
||||
private WeakReference<UserProfile> weakRef;
|
||||
private WeakReference<ProfileActivity> weakRef;
|
||||
private Twitter twitter;
|
||||
private FilterDatabase filterDatabase;
|
||||
private AppDatabase appDB;
|
||||
@ -74,7 +74,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
|
||||
* @param activity Callback to return the result
|
||||
* @param userId ID of the twitter user
|
||||
*/
|
||||
public UserAction(UserProfile activity, int action, long userId) {
|
||||
public UserAction(ProfileActivity activity, int action, long userId) {
|
||||
super();
|
||||
this.weakRef = new WeakReference<>(activity);
|
||||
twitter = Twitter.get(activity);
|
||||
@ -166,7 +166,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
|
||||
|
||||
@Override
|
||||
protected void onProgressUpdate(User[] users) {
|
||||
UserProfile activity = weakRef.get();
|
||||
ProfileActivity activity = weakRef.get();
|
||||
if (activity != null) {
|
||||
activity.setUser(users[0]);
|
||||
}
|
||||
@ -175,7 +175,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Relation relation) {
|
||||
UserProfile activity = weakRef.get();
|
||||
ProfileActivity activity = weakRef.get();
|
||||
if (activity != null) {
|
||||
if (relation != null) {
|
||||
activity.onAction(relation);
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.nuclearfog.twidda.ui.activities;
|
||||
|
||||
import static org.nuclearfog.twidda.ui.activities.SearchActivity.KEY_SEARCH_QUERY;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.KEY_PROFILE_ID;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.KEY_PROFILE_ID;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
@ -226,7 +226,7 @@ public class MainActivity extends AppCompatActivity implements OnTabSelectedList
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
// open home profile
|
||||
if (item.getItemId() == R.id.action_profile) {
|
||||
Intent user = new Intent(this, UserProfile.class);
|
||||
Intent user = new Intent(this, ProfileActivity.class);
|
||||
user.putExtra(KEY_PROFILE_ID, settings.getCurrentUserId());
|
||||
startActivity(user);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ import jp.wasabeef.picasso.transformations.RoundedCornersTransformation;
|
||||
*
|
||||
* @author nuclearfog
|
||||
*/
|
||||
public class UserProfile extends AppCompatActivity implements OnClickListener, OnTagClickListener,
|
||||
public class ProfileActivity extends AppCompatActivity implements OnClickListener, OnTagClickListener,
|
||||
OnTabSelectedListener, OnConfirmListener, Callback {
|
||||
|
||||
/**
|
||||
@ -584,7 +584,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
|
||||
public void onSuccess() {
|
||||
// setup toolbar background
|
||||
if (settings.toolbarOverlapEnabled()) {
|
||||
AppStyles.setToolbarBackground(UserProfile.this, bannerImage, toolbarBackground);
|
||||
AppStyles.setToolbarBackground(ProfileActivity.this, bannerImage, toolbarBackground);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static org.nuclearfog.twidda.database.GlobalSettings.BANNER_IMG_MID_RES;
|
||||
import static org.nuclearfog.twidda.database.GlobalSettings.PROFILE_IMG_HIGH_RES;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.TOOLBAR_TRANSPARENCY;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.TOOLBAR_TRANSPARENCY;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -422,8 +422,8 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
|
||||
}
|
||||
// open profile of the tweet author
|
||||
else if (v.getId() == R.id.tweet_profile) {
|
||||
Intent profile = new Intent(getApplicationContext(), UserProfile.class);
|
||||
profile.putExtra(UserProfile.KEY_PROFILE_DATA, clickedTweet.getAuthor());
|
||||
Intent profile = new Intent(getApplicationContext(), ProfileActivity.class);
|
||||
profile.putExtra(ProfileActivity.KEY_PROFILE_DATA, clickedTweet.getAuthor());
|
||||
startActivity(profile);
|
||||
}
|
||||
// open replied tweet
|
||||
@ -475,8 +475,8 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
|
||||
}
|
||||
// go to user retweeting this tweet
|
||||
else if (v.getId() == R.id.tweet_retweeter_reference) {
|
||||
Intent profile = new Intent(getApplicationContext(), UserProfile.class);
|
||||
profile.putExtra(UserProfile.KEY_PROFILE_DATA, tweet.getAuthor());
|
||||
Intent profile = new Intent(getApplicationContext(), ProfileActivity.class);
|
||||
profile.putExtra(ProfileActivity.KEY_PROFILE_DATA, tweet.getAuthor());
|
||||
startActivity(profile);
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
|
||||
tablayout.setupWithViewPager(pager);
|
||||
tablayout.addOnTabSelectedListener(this);
|
||||
AppStyles.setTabIcons(tablayout, settings, R.array.user_exclude_icons);
|
||||
toolbar.setTitle("");
|
||||
toolbar.setTitle(R.string.menu_toolbar_excluded_users);
|
||||
break;
|
||||
|
||||
case USERLIST_REQUESTS:
|
||||
@ -167,7 +167,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
|
||||
tablayout.setupWithViewPager(pager);
|
||||
tablayout.addOnTabSelectedListener(this);
|
||||
AppStyles.setTabIcons(tablayout, settings, R.array.user_requests_icon);
|
||||
toolbar.setTitle("");
|
||||
toolbar.setTitle(R.string.menu_toolbar_request);
|
||||
break;
|
||||
}
|
||||
setSupportActionBar(toolbar);
|
||||
|
@ -7,7 +7,7 @@ import static org.nuclearfog.twidda.ui.activities.SearchActivity.KEY_SEARCH_QUER
|
||||
import static org.nuclearfog.twidda.ui.activities.TweetActivity.KEY_TWEET_ID;
|
||||
import static org.nuclearfog.twidda.ui.activities.TweetActivity.KEY_TWEET_NAME;
|
||||
import static org.nuclearfog.twidda.ui.activities.TweetActivity.LINK_PATTERN;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.KEY_PROFILE_DATA;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.KEY_PROFILE_DATA;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
@ -30,7 +30,7 @@ import org.nuclearfog.twidda.ui.activities.ImageViewer;
|
||||
import org.nuclearfog.twidda.ui.activities.MessageEditor;
|
||||
import org.nuclearfog.twidda.ui.activities.SearchActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.TweetActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.UserProfile;
|
||||
import org.nuclearfog.twidda.ui.activities.ProfileActivity;
|
||||
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog;
|
||||
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener;
|
||||
|
||||
@ -146,7 +146,7 @@ public class MessageFragment extends ListFragment implements OnMessageClickListe
|
||||
break;
|
||||
|
||||
case PROFILE:
|
||||
Intent profile = new Intent(requireContext(), UserProfile.class);
|
||||
Intent profile = new Intent(requireContext(), ProfileActivity.class);
|
||||
profile.putExtra(KEY_PROFILE_DATA, message.getSender());
|
||||
startActivity(profile);
|
||||
break;
|
||||
|
@ -2,7 +2,7 @@ package org.nuclearfog.twidda.ui.fragments;
|
||||
|
||||
import static android.os.AsyncTask.Status.RUNNING;
|
||||
import static org.nuclearfog.twidda.backend.async.UserLoader.NO_CURSOR;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.KEY_PROFILE_DATA;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.KEY_PROFILE_DATA;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@ -22,7 +22,7 @@ import org.nuclearfog.twidda.backend.async.UserLoader;
|
||||
import org.nuclearfog.twidda.backend.lists.Users;
|
||||
import org.nuclearfog.twidda.backend.utils.ErrorHandler;
|
||||
import org.nuclearfog.twidda.model.User;
|
||||
import org.nuclearfog.twidda.ui.activities.UserProfile;
|
||||
import org.nuclearfog.twidda.ui.activities.ProfileActivity;
|
||||
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog;
|
||||
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener;
|
||||
|
||||
@ -201,8 +201,8 @@ public class UserFragment extends ListFragment implements UserClickListener, OnC
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == REQ_USER_UPDATE && resultCode == UserProfile.RETURN_USER_UPDATED && data != null) {
|
||||
Object result = data.getSerializableExtra(UserProfile.KEY_USER_UPDATE);
|
||||
if (requestCode == REQ_USER_UPDATE && resultCode == ProfileActivity.RETURN_USER_UPDATED && data != null) {
|
||||
Object result = data.getSerializableExtra(ProfileActivity.KEY_USER_UPDATE);
|
||||
if (result instanceof User) {
|
||||
User update = (User) result;
|
||||
adapter.updateUser(update);
|
||||
@ -222,7 +222,7 @@ public class UserFragment extends ListFragment implements UserClickListener, OnC
|
||||
@Override
|
||||
public void onUserClick(User user) {
|
||||
if (!isRefreshing()) {
|
||||
Intent intent = new Intent(requireContext(), UserProfile.class);
|
||||
Intent intent = new Intent(requireContext(), ProfileActivity.class);
|
||||
intent.putExtra(KEY_PROFILE_DATA, user);
|
||||
startActivityForResult(intent, REQ_USER_UPDATE);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package org.nuclearfog.twidda.ui.fragments;
|
||||
|
||||
import static android.os.AsyncTask.Status.RUNNING;
|
||||
import static org.nuclearfog.twidda.backend.async.ListLoader.NO_CURSOR;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserProfile.KEY_PROFILE_DATA;
|
||||
import static org.nuclearfog.twidda.ui.activities.ProfileActivity.KEY_PROFILE_DATA;
|
||||
import static org.nuclearfog.twidda.ui.activities.UserlistActivity.KEY_LIST_DATA;
|
||||
|
||||
import android.content.Intent;
|
||||
@ -19,7 +19,7 @@ import org.nuclearfog.twidda.backend.lists.UserLists;
|
||||
import org.nuclearfog.twidda.backend.utils.ErrorHandler;
|
||||
import org.nuclearfog.twidda.model.User;
|
||||
import org.nuclearfog.twidda.model.UserList;
|
||||
import org.nuclearfog.twidda.ui.activities.UserProfile;
|
||||
import org.nuclearfog.twidda.ui.activities.ProfileActivity;
|
||||
import org.nuclearfog.twidda.ui.activities.UserlistActivity;
|
||||
|
||||
/**
|
||||
@ -153,7 +153,7 @@ public class UserListFragment extends ListFragment implements ListClickListener
|
||||
|
||||
@Override
|
||||
public void onProfileClick(User user) {
|
||||
Intent profile = new Intent(requireContext(), UserProfile.class);
|
||||
Intent profile = new Intent(requireContext(), ProfileActivity.class);
|
||||
profile.putExtra(KEY_PROFILE_DATA, user);
|
||||
startActivity(profile);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.activities.UserProfile">
|
||||
tools:context=".ui.activities.ProfileActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -242,4 +242,6 @@
|
||||
<string name="directmessage_media_button">Medienanhang</string>
|
||||
<string name="error_invalid_media">Ungültige Mediendatei!</string>
|
||||
<string name="menu_follow_requests">Anfragen</string>
|
||||
<string name="menu_toolbar_excluded_users">Blocklisten</string>
|
||||
<string name="menu_toolbar_request">Follow Anfragen</string>
|
||||
</resources>
|
@ -139,6 +139,8 @@
|
||||
<string name="menu_tweet_copy_text">Text</string>
|
||||
<string name="menu_media_link">Media link</string>
|
||||
<string name="menu_tweet_copy_link">Tweet link</string>
|
||||
<string name="menu_toolbar_request">Follow requests</string>
|
||||
<string name="menu_toolbar_excluded_users">Blocklists</string>
|
||||
|
||||
<!--dialog strings-->
|
||||
<string name="dialog_link_image_preview">Link preview image</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user