renamed class, restructured fragment adapter, added toolbar titles

This commit is contained in:
nuclearfog 2022-07-17 23:48:10 +02:00
parent 0dca64953e
commit 7e026f4f10
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
15 changed files with 105 additions and 108 deletions

View File

@ -62,7 +62,7 @@
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
<activity <activity
android:name=".ui.activities.UserProfile" android:name=".ui.activities.ProfileActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />

View File

@ -53,8 +53,6 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
private ListFragment[] fragments; private ListFragment[] fragments;
/** /**
* Initialize Fragment Adapter
*
* @param fManager Activity Fragment Manager * @param fManager Activity Fragment Manager
*/ */
public FragmentAdapter(FragmentManager fManager) { public FragmentAdapter(FragmentManager fManager) {
@ -96,16 +94,16 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* setup adapter for the home activity * setup adapter for the home activity
*/ */
public void setupForHomePage() { public void setupForHomePage() {
Bundle home_tl = new Bundle(); Bundle paramHomeTl = new Bundle();
Bundle ment_tl = new Bundle(); Bundle paramMention = new Bundle();
home_tl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_HOME); paramHomeTl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_HOME);
ment_tl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_MENT); paramMention.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_MENT);
fragments = new ListFragment[3]; fragments = new ListFragment[3];
fragments[0] = new TweetFragment(); fragments[0] = new TweetFragment();
fragments[1] = new TrendFragment(); fragments[1] = new TrendFragment();
fragments[2] = new TweetFragment(); fragments[2] = new TweetFragment();
fragments[0].setArguments(home_tl); fragments[0].setArguments(paramHomeTl);
fragments[2].setArguments(ment_tl); fragments[2].setArguments(paramMention);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -115,20 +113,17 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param userId ID of the user * @param userId ID of the user
*/ */
public void setupProfilePage(long userId) { 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 = new ListFragment[2];
fragments[0] = new TweetFragment(); 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(); fragments[1] = new TweetFragment();
Bundle usr_favor = new Bundle(); fragments[0].setArguments(paramTweet);
usr_favor.putLong(KEY_FRAG_TWEET_ID, userId); fragments[1].setArguments(paramFavorite);
usr_favor.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_FAVORS);
fragments[1].setArguments(usr_favor);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -138,17 +133,17 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param search Search string * @param search Search string
*/ */
public void setupSearchPage(String search) { public void setupSearchPage(String search) {
Bundle tweetSearch = new Bundle(); Bundle paramTweetSearch = new Bundle();
Bundle userSearch = new Bundle(); Bundle paramUserSearch = new Bundle();
tweetSearch.putString(KEY_FRAG_TWEET_SEARCH, search); paramTweetSearch.putString(KEY_FRAG_TWEET_SEARCH, search);
userSearch.putString(KEY_FRAG_USER_SEARCH, search); paramUserSearch.putString(KEY_FRAG_USER_SEARCH, search);
tweetSearch.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_SEARCH); paramTweetSearch.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_SEARCH);
userSearch.putInt(KEY_FRAG_USER_MODE, USER_FRAG_SEARCH); paramUserSearch.putInt(KEY_FRAG_USER_MODE, USER_FRAG_SEARCH);
fragments = new ListFragment[2]; fragments = new ListFragment[2];
fragments[0] = new TweetFragment(); fragments[0] = new TweetFragment();
fragments[1] = new UserFragment(); fragments[1] = new UserFragment();
fragments[0].setArguments(tweetSearch); fragments[0].setArguments(paramTweetSearch);
fragments[1].setArguments(userSearch); fragments[1].setArguments(paramUserSearch);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -159,22 +154,22 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param username screen name of the owner * @param username screen name of the owner
*/ */
public void setupListPage(long userId, String username) { public void setupListPage(long userId, String username) {
Bundle userListParam = new Bundle(); Bundle paramUserlistOwnership = new Bundle();
Bundle subscriberParam = new Bundle(); Bundle paramUserlistSubscription = new Bundle();
if (userId > 0) { if (userId > 0) {
userListParam.putLong(KEY_FRAG_LIST_OWNER_ID, userId); paramUserlistOwnership.putLong(KEY_FRAG_LIST_OWNER_ID, userId);
subscriberParam.putLong(KEY_FRAG_LIST_OWNER_ID, userId); paramUserlistSubscription.putLong(KEY_FRAG_LIST_OWNER_ID, userId);
} else { } else {
userListParam.putString(KEY_FRAG_LIST_OWNER_NAME, username); paramUserlistOwnership.putString(KEY_FRAG_LIST_OWNER_NAME, username);
subscriberParam.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); paramUserlistOwnership.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_OWNS);
subscriberParam.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_SUBSCR_TO); paramUserlistSubscription.putInt(KEY_FRAG_LIST_LIST_TYPE, LIST_USER_SUBSCR_TO);
fragments = new ListFragment[2]; fragments = new ListFragment[2];
fragments[0] = new UserListFragment(); fragments[0] = new UserListFragment();
fragments[1] = new UserListFragment(); fragments[1] = new UserListFragment();
fragments[0].setArguments(userListParam); fragments[0].setArguments(paramUserlistOwnership);
fragments[1].setArguments(subscriberParam); fragments[1].setArguments(paramUserlistSubscription);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -185,23 +180,23 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param ownerOfList true if current user owns this list * @param ownerOfList true if current user owns this list
*/ */
public void setupListContentPage(long listId, boolean ownerOfList) { public void setupListContentPage(long listId, boolean ownerOfList) {
Bundle tweetParam = new Bundle(); Bundle paramUserlistTl = new Bundle();
Bundle userParam = new Bundle(); Bundle paramUserlistMember = new Bundle();
Bundle subscrParam = new Bundle(); Bundle paramUserlistSubscriber = new Bundle();
tweetParam.putLong(KEY_FRAG_TWEET_ID, listId); paramUserlistTl.putLong(KEY_FRAG_TWEET_ID, listId);
tweetParam.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_LIST); paramUserlistTl.putInt(KEY_FRAG_TWEET_MODE, TWEET_FRAG_LIST);
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_MEMBERS); paramUserlistMember.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_MEMBERS);
userParam.putBoolean(KEY_FRAG_DEL_USER, ownerOfList); paramUserlistMember.putBoolean(KEY_FRAG_DEL_USER, ownerOfList);
userParam.putLong(KEY_FRAG_USER_ID_ALL, listId); paramUserlistMember.putLong(KEY_FRAG_USER_ID_ALL, listId);
subscrParam.putLong(KEY_FRAG_USER_ID_ALL, listId); paramUserlistSubscriber.putLong(KEY_FRAG_USER_ID_ALL, listId);
subscrParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_SUBSCRIBER); paramUserlistSubscriber.putInt(KEY_FRAG_USER_MODE, USER_FRAG_LIST_SUBSCRIBER);
fragments = new ListFragment[3]; fragments = new ListFragment[3];
fragments[0] = new TweetFragment(); fragments[0] = new TweetFragment();
fragments[1] = new UserFragment(); fragments[1] = new UserFragment();
fragments[2] = new UserFragment(); fragments[2] = new UserFragment();
fragments[0].setArguments(tweetParam); fragments[0].setArguments(paramUserlistTl);
fragments[1].setArguments(userParam); fragments[1].setArguments(paramUserlistMember);
fragments[2].setArguments(subscrParam); fragments[2].setArguments(paramUserlistSubscriber);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -209,16 +204,15 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* setup adapter for a page of muted / blocked users * setup adapter for a page of muted / blocked users
*/ */
public void setupMuteBlockPage() { public void setupMuteBlockPage() {
Bundle paramMute = new Bundle(); Bundle paramMuteList = new Bundle();
Bundle paramBlock = new Bundle(); Bundle paramBlockList = new Bundle();
paramMute.putInt(KEY_FRAG_USER_MODE, USER_FRAG_MUTED_USERS); paramMuteList.putInt(KEY_FRAG_USER_MODE, USER_FRAG_MUTED_USERS);
paramBlock.putInt(KEY_FRAG_USER_MODE, USER_FRAG_BLOCKED_USERS); paramBlockList.putInt(KEY_FRAG_USER_MODE, USER_FRAG_BLOCKED_USERS);
fragments = new ListFragment[2]; fragments = new ListFragment[2];
fragments[0] = new UserFragment(); fragments[0] = new UserFragment();
fragments[1] = new UserFragment(); fragments[1] = new UserFragment();
fragments[0].setArguments(paramMute); fragments[0].setArguments(paramMuteList);
fragments[1].setArguments(paramBlock); fragments[1].setArguments(paramBlockList);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -230,7 +224,6 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
Bundle paramFollower = new Bundle(); Bundle paramFollower = new Bundle();
paramFollowing.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOW_INCOMING); paramFollowing.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOW_INCOMING);
paramFollower.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOW_OUTGOING); paramFollower.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOW_OUTGOING);
fragments = new ListFragment[2]; fragments = new ListFragment[2];
fragments[0] = new UserFragment(); fragments[0] = new UserFragment();
fragments[1] = new UserFragment(); fragments[1] = new UserFragment();
@ -245,12 +238,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param userId ID of the user * @param userId ID of the user
*/ */
public void setupFollowingPage(long userId) { public void setupFollowingPage(long userId) {
Bundle userParam = new Bundle(); Bundle paramFollowing = new Bundle();
userParam.putLong(KEY_FRAG_USER_ID_ALL, userId); paramFollowing.putLong(KEY_FRAG_USER_ID_ALL, userId);
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWING); paramFollowing.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWING);
fragments = new ListFragment[1]; fragments = new ListFragment[1];
fragments[0] = new UserFragment(); fragments[0] = new UserFragment();
fragments[0].setArguments(userParam); fragments[0].setArguments(paramFollowing);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -260,12 +253,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param userId ID of the user * @param userId ID of the user
*/ */
public void setupFollowerPage(long userId) { public void setupFollowerPage(long userId) {
Bundle userParam = new Bundle(); Bundle paramFollower = new Bundle();
userParam.putLong(KEY_FRAG_USER_ID_ALL, userId); paramFollower.putLong(KEY_FRAG_USER_ID_ALL, userId);
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWER); paramFollower.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FOLLOWER);
fragments = new ListFragment[1]; fragments = new ListFragment[1];
fragments[0] = new UserFragment(); fragments[0] = new UserFragment();
fragments[0].setArguments(userParam); fragments[0].setArguments(paramFollower);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -275,12 +268,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param tweetId ID of the tweet * @param tweetId ID of the tweet
*/ */
public void setupRetweeterPage(long tweetId) { public void setupRetweeterPage(long tweetId) {
Bundle userParam = new Bundle(); Bundle paramRetweeter = new Bundle();
userParam.putLong(KEY_FRAG_USER_ID_ALL, tweetId); paramRetweeter.putLong(KEY_FRAG_USER_ID_ALL, tweetId);
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_RETWEET); paramRetweeter.putInt(KEY_FRAG_USER_MODE, USER_FRAG_RETWEET);
fragments = new ListFragment[1]; fragments = new ListFragment[1];
fragments[0] = new UserFragment(); fragments[0] = new UserFragment();
fragments[0].setArguments(userParam); fragments[0].setArguments(paramRetweeter);
notifyDataSetChanged(); notifyDataSetChanged();
} }
@ -290,12 +283,12 @@ public class FragmentAdapter extends FragmentStatePagerAdapter {
* @param tweetId ID of the tweet * @param tweetId ID of the tweet
*/ */
public void setFavoriterPage(long tweetId) { public void setFavoriterPage(long tweetId) {
Bundle userParam = new Bundle(); Bundle paramFavoriter = new Bundle();
userParam.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FAVORIT); paramFavoriter.putInt(KEY_FRAG_USER_MODE, USER_FRAG_FAVORIT);
userParam.putLong(KEY_FRAG_USER_ID_ALL, tweetId); paramFavoriter.putLong(KEY_FRAG_USER_ID_ALL, tweetId);
fragments = new ListFragment[1]; fragments = new ListFragment[1];
fragments[0] = new UserFragment(); fragments[0] = new UserFragment();
fragments[0].setArguments(userParam); fragments[0].setArguments(paramFavoriter);
notifyDataSetChanged(); notifyDataSetChanged();
} }

View File

@ -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_ID;
import static org.nuclearfog.twidda.ui.activities.TweetActivity.KEY_TWEET_NAME; 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.TweetEditor.KEY_TWEETPOPUP_TEXT;
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.UserProfile.KEY_PROFILE_DISABLE_RELOAD; 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.UserlistActivity.KEY_LIST_ID;
import static org.nuclearfog.twidda.ui.activities.UserlistsActivity.KEY_USERLIST_OWNER_NAME; 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.SearchActivity;
import org.nuclearfog.twidda.ui.activities.TweetActivity; import org.nuclearfog.twidda.ui.activities.TweetActivity;
import org.nuclearfog.twidda.ui.activities.TweetEditor; 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.UserlistActivity;
import org.nuclearfog.twidda.ui.activities.UserlistsActivity; 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); User user = mTwitter.showUser(path);
data.putSerializable(KEY_PROFILE_DATA, user); data.putSerializable(KEY_PROFILE_DATA, user);
data.putBoolean(KEY_PROFILE_DISABLE_RELOAD, true); data.putBoolean(KEY_PROFILE_DISABLE_RELOAD, true);
dataHolder = new DataHolder(data, UserProfile.class); dataHolder = new DataHolder(data, ProfileActivity.class);
} else { } else {
String username = '@' + path.substring(0, path.indexOf('/')); String username = '@' + path.substring(0, path.indexOf('/'));
// show tweet // show tweet

View File

@ -9,7 +9,7 @@ import org.nuclearfog.twidda.database.AppDatabase;
import org.nuclearfog.twidda.database.FilterDatabase; import org.nuclearfog.twidda.database.FilterDatabase;
import org.nuclearfog.twidda.model.Relation; import org.nuclearfog.twidda.model.Relation;
import org.nuclearfog.twidda.model.User; 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; 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 * This background task loads profile information about a twitter user and take actions
* *
* @author nuclearfog * @author nuclearfog
* @see UserProfile * @see ProfileActivity
*/ */
public class UserAction extends AsyncTask<Void, User, Relation> { 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 ErrorHandler.TwitterError twException;
private WeakReference<UserProfile> weakRef; private WeakReference<ProfileActivity> weakRef;
private Twitter twitter; private Twitter twitter;
private FilterDatabase filterDatabase; private FilterDatabase filterDatabase;
private AppDatabase appDB; private AppDatabase appDB;
@ -74,7 +74,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
* @param activity Callback to return the result * @param activity Callback to return the result
* @param userId ID of the twitter user * @param userId ID of the twitter user
*/ */
public UserAction(UserProfile activity, int action, long userId) { public UserAction(ProfileActivity activity, int action, long userId) {
super(); super();
this.weakRef = new WeakReference<>(activity); this.weakRef = new WeakReference<>(activity);
twitter = Twitter.get(activity); twitter = Twitter.get(activity);
@ -166,7 +166,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
@Override @Override
protected void onProgressUpdate(User[] users) { protected void onProgressUpdate(User[] users) {
UserProfile activity = weakRef.get(); ProfileActivity activity = weakRef.get();
if (activity != null) { if (activity != null) {
activity.setUser(users[0]); activity.setUser(users[0]);
} }
@ -175,7 +175,7 @@ public class UserAction extends AsyncTask<Void, User, Relation> {
@Override @Override
protected void onPostExecute(Relation relation) { protected void onPostExecute(Relation relation) {
UserProfile activity = weakRef.get(); ProfileActivity activity = weakRef.get();
if (activity != null) { if (activity != null) {
if (relation != null) { if (relation != null) {
activity.onAction(relation); activity.onAction(relation);

View File

@ -1,7 +1,7 @@
package org.nuclearfog.twidda.ui.activities; package org.nuclearfog.twidda.ui.activities;
import static org.nuclearfog.twidda.ui.activities.SearchActivity.KEY_SEARCH_QUERY; 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.app.Dialog;
import android.content.Context; import android.content.Context;
@ -226,7 +226,7 @@ public class MainActivity extends AppCompatActivity implements OnTabSelectedList
public boolean onOptionsItemSelected(@NonNull MenuItem item) { public boolean onOptionsItemSelected(@NonNull MenuItem item) {
// open home profile // open home profile
if (item.getItemId() == R.id.action_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()); user.putExtra(KEY_PROFILE_ID, settings.getCurrentUserId());
startActivity(user); startActivity(user);
} }

View File

@ -76,7 +76,7 @@ import jp.wasabeef.picasso.transformations.RoundedCornersTransformation;
* *
* @author nuclearfog * @author nuclearfog
*/ */
public class UserProfile extends AppCompatActivity implements OnClickListener, OnTagClickListener, public class ProfileActivity extends AppCompatActivity implements OnClickListener, OnTagClickListener,
OnTabSelectedListener, OnConfirmListener, Callback { OnTabSelectedListener, OnConfirmListener, Callback {
/** /**
@ -584,7 +584,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
public void onSuccess() { public void onSuccess() {
// setup toolbar background // setup toolbar background
if (settings.toolbarOverlapEnabled()) { if (settings.toolbarOverlapEnabled()) {
AppStyles.setToolbarBackground(UserProfile.this, bannerImage, toolbarBackground); AppStyles.setToolbarBackground(ProfileActivity.this, bannerImage, toolbarBackground);
} }
} }

View File

@ -5,7 +5,7 @@ import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE; import static android.view.View.VISIBLE;
import static org.nuclearfog.twidda.database.GlobalSettings.BANNER_IMG_MID_RES; 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.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.Context;
import android.content.Intent; import android.content.Intent;

View File

@ -422,8 +422,8 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
} }
// open profile of the tweet author // open profile of the tweet author
else if (v.getId() == R.id.tweet_profile) { else if (v.getId() == R.id.tweet_profile) {
Intent profile = new Intent(getApplicationContext(), UserProfile.class); Intent profile = new Intent(getApplicationContext(), ProfileActivity.class);
profile.putExtra(UserProfile.KEY_PROFILE_DATA, clickedTweet.getAuthor()); profile.putExtra(ProfileActivity.KEY_PROFILE_DATA, clickedTweet.getAuthor());
startActivity(profile); startActivity(profile);
} }
// open replied tweet // open replied tweet
@ -475,8 +475,8 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
} }
// go to user retweeting this tweet // go to user retweeting this tweet
else if (v.getId() == R.id.tweet_retweeter_reference) { else if (v.getId() == R.id.tweet_retweeter_reference) {
Intent profile = new Intent(getApplicationContext(), UserProfile.class); Intent profile = new Intent(getApplicationContext(), ProfileActivity.class);
profile.putExtra(UserProfile.KEY_PROFILE_DATA, tweet.getAuthor()); profile.putExtra(ProfileActivity.KEY_PROFILE_DATA, tweet.getAuthor());
startActivity(profile); startActivity(profile);
} }
} }

View File

@ -158,7 +158,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
tablayout.setupWithViewPager(pager); tablayout.setupWithViewPager(pager);
tablayout.addOnTabSelectedListener(this); tablayout.addOnTabSelectedListener(this);
AppStyles.setTabIcons(tablayout, settings, R.array.user_exclude_icons); AppStyles.setTabIcons(tablayout, settings, R.array.user_exclude_icons);
toolbar.setTitle(""); toolbar.setTitle(R.string.menu_toolbar_excluded_users);
break; break;
case USERLIST_REQUESTS: case USERLIST_REQUESTS:
@ -167,7 +167,7 @@ public class UsersActivity extends AppCompatActivity implements OnTabSelectedLis
tablayout.setupWithViewPager(pager); tablayout.setupWithViewPager(pager);
tablayout.addOnTabSelectedListener(this); tablayout.addOnTabSelectedListener(this);
AppStyles.setTabIcons(tablayout, settings, R.array.user_requests_icon); AppStyles.setTabIcons(tablayout, settings, R.array.user_requests_icon);
toolbar.setTitle(""); toolbar.setTitle(R.string.menu_toolbar_request);
break; break;
} }
setSupportActionBar(toolbar); setSupportActionBar(toolbar);

View File

@ -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_ID;
import static org.nuclearfog.twidda.ui.activities.TweetActivity.KEY_TWEET_NAME; 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.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.ActivityNotFoundException;
import android.content.Intent; 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.MessageEditor;
import org.nuclearfog.twidda.ui.activities.SearchActivity; import org.nuclearfog.twidda.ui.activities.SearchActivity;
import org.nuclearfog.twidda.ui.activities.TweetActivity; 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;
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener; import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener;
@ -146,7 +146,7 @@ public class MessageFragment extends ListFragment implements OnMessageClickListe
break; break;
case PROFILE: case PROFILE:
Intent profile = new Intent(requireContext(), UserProfile.class); Intent profile = new Intent(requireContext(), ProfileActivity.class);
profile.putExtra(KEY_PROFILE_DATA, message.getSender()); profile.putExtra(KEY_PROFILE_DATA, message.getSender());
startActivity(profile); startActivity(profile);
break; break;

View File

@ -2,7 +2,7 @@ package org.nuclearfog.twidda.ui.fragments;
import static android.os.AsyncTask.Status.RUNNING; import static android.os.AsyncTask.Status.RUNNING;
import static org.nuclearfog.twidda.backend.async.UserLoader.NO_CURSOR; 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.content.Intent;
import android.os.Bundle; 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.lists.Users;
import org.nuclearfog.twidda.backend.utils.ErrorHandler; import org.nuclearfog.twidda.backend.utils.ErrorHandler;
import org.nuclearfog.twidda.model.User; 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;
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener; import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener;
@ -201,8 +201,8 @@ public class UserFragment extends ListFragment implements UserClickListener, OnC
@Override @Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQ_USER_UPDATE && resultCode == UserProfile.RETURN_USER_UPDATED && data != null) { if (requestCode == REQ_USER_UPDATE && resultCode == ProfileActivity.RETURN_USER_UPDATED && data != null) {
Object result = data.getSerializableExtra(UserProfile.KEY_USER_UPDATE); Object result = data.getSerializableExtra(ProfileActivity.KEY_USER_UPDATE);
if (result instanceof User) { if (result instanceof User) {
User update = (User) result; User update = (User) result;
adapter.updateUser(update); adapter.updateUser(update);
@ -222,7 +222,7 @@ public class UserFragment extends ListFragment implements UserClickListener, OnC
@Override @Override
public void onUserClick(User user) { public void onUserClick(User user) {
if (!isRefreshing()) { if (!isRefreshing()) {
Intent intent = new Intent(requireContext(), UserProfile.class); Intent intent = new Intent(requireContext(), ProfileActivity.class);
intent.putExtra(KEY_PROFILE_DATA, user); intent.putExtra(KEY_PROFILE_DATA, user);
startActivityForResult(intent, REQ_USER_UPDATE); startActivityForResult(intent, REQ_USER_UPDATE);
} }

View File

@ -2,7 +2,7 @@ package org.nuclearfog.twidda.ui.fragments;
import static android.os.AsyncTask.Status.RUNNING; import static android.os.AsyncTask.Status.RUNNING;
import static org.nuclearfog.twidda.backend.async.ListLoader.NO_CURSOR; 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 static org.nuclearfog.twidda.ui.activities.UserlistActivity.KEY_LIST_DATA;
import android.content.Intent; 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.backend.utils.ErrorHandler;
import org.nuclearfog.twidda.model.User; import org.nuclearfog.twidda.model.User;
import org.nuclearfog.twidda.model.UserList; 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; import org.nuclearfog.twidda.ui.activities.UserlistActivity;
/** /**
@ -153,7 +153,7 @@ public class UserListFragment extends ListFragment implements ListClickListener
@Override @Override
public void onProfileClick(User user) { 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); profile.putExtra(KEY_PROFILE_DATA, user);
startActivity(profile); startActivity(profile);
} }

View File

@ -6,7 +6,7 @@
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.activities.UserProfile"> tools:context=".ui.activities.ProfileActivity">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -242,4 +242,6 @@
<string name="directmessage_media_button">Medienanhang</string> <string name="directmessage_media_button">Medienanhang</string>
<string name="error_invalid_media">Ungültige Mediendatei!</string> <string name="error_invalid_media">Ungültige Mediendatei!</string>
<string name="menu_follow_requests">Anfragen</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> </resources>

View File

@ -139,6 +139,8 @@
<string name="menu_tweet_copy_text">Text</string> <string name="menu_tweet_copy_text">Text</string>
<string name="menu_media_link">Media link</string> <string name="menu_media_link">Media link</string>
<string name="menu_tweet_copy_link">Tweet 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--> <!--dialog strings-->
<string name="dialog_link_image_preview">Link preview image</string> <string name="dialog_link_image_preview">Link preview image</string>