mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-02-07 15:48:39 +01:00
added profile tablayout
This commit is contained in:
parent
34b87b1a6c
commit
181f991812
@ -12,7 +12,7 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import org.nuclearfog.twidda.adapter.HomeAdapter;
|
import org.nuclearfog.twidda.adapter.HomeTabAdapter;
|
||||||
import org.nuclearfog.twidda.database.GlobalSettings;
|
import org.nuclearfog.twidda.database.GlobalSettings;
|
||||||
import org.nuclearfog.twidda.window.AppSettings;
|
import org.nuclearfog.twidda.window.AppSettings;
|
||||||
import org.nuclearfog.twidda.window.LoginPage;
|
import org.nuclearfog.twidda.window.LoginPage;
|
||||||
@ -30,7 +30,7 @@ public class MainActivity extends AppCompatActivity implements TabLayout.OnTabSe
|
|||||||
private static final int[] icons = {R.drawable.home, R.drawable.hash, R.drawable.mention};
|
private static final int[] icons = {R.drawable.home, R.drawable.hash, R.drawable.mention};
|
||||||
|
|
||||||
private GlobalSettings settings;
|
private GlobalSettings settings;
|
||||||
private HomeAdapter adapter;
|
private HomeTabAdapter adapter;
|
||||||
private ViewPager pager;
|
private ViewPager pager;
|
||||||
private int tabIndex = 0;
|
private int tabIndex = 0;
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public class MainActivity extends AppCompatActivity implements TabLayout.OnTabSe
|
|||||||
View root = findViewById(R.id.main_layout);
|
View root = findViewById(R.id.main_layout);
|
||||||
root.setBackgroundColor(settings.getBackgroundColor());
|
root.setBackgroundColor(settings.getBackgroundColor());
|
||||||
|
|
||||||
adapter = new HomeAdapter(getSupportFragmentManager());
|
adapter = new HomeTabAdapter(getSupportFragmentManager());
|
||||||
pager.setOffscreenPageLimit(3);
|
pager.setOffscreenPageLimit(3);
|
||||||
pager.setAdapter(adapter);
|
pager.setAdapter(adapter);
|
||||||
tab.setupWithViewPager(pager);
|
tab.setupWithViewPager(pager);
|
||||||
|
@ -11,7 +11,7 @@ import static org.nuclearfog.twidda.fragment.TweetListFragment.HOME;
|
|||||||
import static org.nuclearfog.twidda.fragment.TweetListFragment.MENT;
|
import static org.nuclearfog.twidda.fragment.TweetListFragment.MENT;
|
||||||
|
|
||||||
|
|
||||||
public class HomeAdapter extends FragmentPagerAdapter {
|
public class HomeTabAdapter extends FragmentPagerAdapter {
|
||||||
|
|
||||||
private static final int COUNT = 3;
|
private static final int COUNT = 3;
|
||||||
private static final Bundle HOME_TL, MENT_TL;
|
private static final Bundle HOME_TL, MENT_TL;
|
||||||
@ -25,7 +25,7 @@ public class HomeAdapter extends FragmentPagerAdapter {
|
|||||||
MENT_TL.putInt("mode", MENT);
|
MENT_TL.putInt("mode", MENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HomeAdapter(FragmentManager fm) {
|
public HomeTabAdapter(FragmentManager fm) {
|
||||||
super(fm);
|
super(fm);
|
||||||
fragments = new Fragment[COUNT];
|
fragments = new Fragment[COUNT];
|
||||||
fragments[0] = new TweetListFragment();
|
fragments[0] = new TweetListFragment();
|
@ -3,8 +3,6 @@ package org.nuclearfog.twidda.backend;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -14,11 +12,10 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
import twitter4j.TwitterException;
|
||||||
|
|
||||||
import org.nuclearfog.tag.Tagger;
|
import org.nuclearfog.tag.Tagger;
|
||||||
import org.nuclearfog.twidda.R;
|
import org.nuclearfog.twidda.R;
|
||||||
import org.nuclearfog.twidda.adapter.TweetAdapter;
|
|
||||||
import org.nuclearfog.twidda.backend.items.Tweet;
|
|
||||||
import org.nuclearfog.twidda.backend.items.TwitterUser;
|
import org.nuclearfog.twidda.backend.items.TwitterUser;
|
||||||
import org.nuclearfog.twidda.database.DatabaseAdapter;
|
import org.nuclearfog.twidda.database.DatabaseAdapter;
|
||||||
import org.nuclearfog.twidda.database.GlobalSettings;
|
import org.nuclearfog.twidda.database.GlobalSettings;
|
||||||
@ -29,37 +26,27 @@ import org.nuclearfog.twidda.window.UserProfile;
|
|||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import twitter4j.TwitterException;
|
|
||||||
|
|
||||||
import static android.view.View.GONE;
|
import static android.view.View.GONE;
|
||||||
import static android.view.View.VISIBLE;
|
import static android.view.View.VISIBLE;
|
||||||
|
|
||||||
|
|
||||||
public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
public class ProfileLoader extends AsyncTask<Long, Void, Boolean> {
|
||||||
|
|
||||||
public enum Mode {
|
public enum Mode {
|
||||||
LDR_PROFILE,
|
LDR_PROFILE,
|
||||||
GET_TWEETS,
|
|
||||||
GET_FAVORS,
|
|
||||||
ACTION_FOLLOW,
|
ACTION_FOLLOW,
|
||||||
ACTION_BLOCK,
|
ACTION_BLOCK,
|
||||||
ACTION_MUTE
|
ACTION_MUTE
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Mode mode;
|
private final Mode mode;
|
||||||
private boolean failure = false;
|
|
||||||
|
|
||||||
private TweetAdapter homeTl, homeFav;
|
|
||||||
private WeakReference<UserProfile> ui;
|
private WeakReference<UserProfile> ui;
|
||||||
private SimpleDateFormat sdf;
|
private SimpleDateFormat sdf;
|
||||||
private TwitterEngine mTwitter;
|
private TwitterEngine mTwitter;
|
||||||
private TwitterException err;
|
private TwitterException err;
|
||||||
private TwitterUser user;
|
private TwitterUser user;
|
||||||
private List<Tweet> tweets, favors;
|
|
||||||
private NumberFormat formatter;
|
private NumberFormat formatter;
|
||||||
private long homeId;
|
private long homeId;
|
||||||
private int highlight;
|
private int highlight;
|
||||||
@ -85,45 +72,20 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
|||||||
imgEnabled = settings.getImageLoad();
|
imgEnabled = settings.getImageLoad();
|
||||||
homeId = settings.getUserId();
|
homeId = settings.getUserId();
|
||||||
highlight = settings.getHighlightColor();
|
highlight = settings.getHighlightColor();
|
||||||
|
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
tweets = new ArrayList<>();
|
|
||||||
favors = new ArrayList<>();
|
|
||||||
|
|
||||||
RecyclerView profileTweets = context.findViewById(R.id.ht_list);
|
|
||||||
RecyclerView profileFavors = context.findViewById(R.id.hf_list);
|
|
||||||
homeTl = (TweetAdapter) profileTweets.getAdapter();
|
|
||||||
homeFav = (TweetAdapter) profileFavors.getAdapter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected Boolean doInBackground(Long... args) {
|
||||||
if (ui.get() != null) {
|
|
||||||
if (mode == Mode.LDR_PROFILE) {
|
|
||||||
SwipeRefreshLayout homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
SwipeRefreshLayout favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
homeReload.setRefreshing(true);
|
|
||||||
favReload.setRefreshing(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Long... args) {
|
|
||||||
final long UID = args[0];
|
final long UID = args[0];
|
||||||
long page = 1L;
|
|
||||||
if (args.length > 2)
|
|
||||||
page = args[2];
|
|
||||||
DatabaseAdapter db = new DatabaseAdapter(ui.get());
|
DatabaseAdapter db = new DatabaseAdapter(ui.get());
|
||||||
isHome = homeId == UID;
|
isHome = homeId == UID;
|
||||||
try {
|
try {
|
||||||
if (mode == Mode.LDR_PROFILE) {
|
if (mode == Mode.LDR_PROFILE) {
|
||||||
user = db.getUser(UID);
|
user = db.getUser(UID);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
tweets = db.getUserTweets(UID);
|
|
||||||
favors = db.getUserFavs(UID);
|
|
||||||
publishProgress();
|
publishProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,47 +103,6 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case LDR_PROFILE:
|
|
||||||
if (!user.isLocked() || isFollowing || isHome) {
|
|
||||||
if (tweets.isEmpty()) {
|
|
||||||
tweets = mTwitter.getUserTweets(UID, 1, page);
|
|
||||||
db.storeUserTweets(tweets);
|
|
||||||
tweets.addAll(homeTl.getData());
|
|
||||||
publishProgress();
|
|
||||||
}
|
|
||||||
if (favors.isEmpty()) {
|
|
||||||
favors = mTwitter.getUserFavs(UID, 1, page);
|
|
||||||
db.storeUserFavs(favors, UID);
|
|
||||||
favors.addAll(homeFav.getData());
|
|
||||||
publishProgress();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GET_TWEETS:
|
|
||||||
if (!user.isLocked() || isFollowing || isHome) {
|
|
||||||
long sinceId = 1;
|
|
||||||
if (homeTl.getItemCount() > 0)
|
|
||||||
sinceId = homeTl.getItemId(0);
|
|
||||||
tweets = mTwitter.getUserTweets(UID, sinceId, page);
|
|
||||||
db.storeUserTweets(tweets);
|
|
||||||
tweets.addAll(homeTl.getData());
|
|
||||||
publishProgress();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GET_FAVORS:
|
|
||||||
if (!user.isLocked() || isFollowing || isHome) {
|
|
||||||
long sinceId = 1;
|
|
||||||
if (homeFav.getItemCount() > 0)
|
|
||||||
sinceId = homeFav.getItemId(0);
|
|
||||||
favors = mTwitter.getUserFavs(UID, sinceId, page);
|
|
||||||
db.storeUserFavs(favors, UID);
|
|
||||||
favors.addAll(homeFav.getData());
|
|
||||||
publishProgress();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACTION_FOLLOW:
|
case ACTION_FOLLOW:
|
||||||
if (user.isLocked()) {
|
if (user.isLocked()) {
|
||||||
if (isFollowing)
|
if (isFollowing)
|
||||||
@ -219,13 +140,13 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
|||||||
}
|
}
|
||||||
} catch (TwitterException err) {
|
} catch (TwitterException err) {
|
||||||
this.err = err;
|
this.err = err;
|
||||||
failure = true;
|
return false;
|
||||||
} catch (Exception err) {
|
} catch (Exception err) {
|
||||||
if (err.getMessage() != null)
|
if (err.getMessage() != null)
|
||||||
Log.e("ProfileLoader", err.getMessage());
|
Log.e("ProfileLoader", err.getMessage());
|
||||||
failure = true;
|
return false;
|
||||||
}
|
}
|
||||||
return null;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -233,19 +154,6 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
|||||||
protected void onProgressUpdate(Void... v) {
|
protected void onProgressUpdate(Void... v) {
|
||||||
if (ui.get() == null) return;
|
if (ui.get() == null) return;
|
||||||
|
|
||||||
if (!tweets.isEmpty()) {
|
|
||||||
SwipeRefreshLayout homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
homeTl.setData(tweets);
|
|
||||||
homeTl.notifyDataSetChanged();
|
|
||||||
homeReload.setRefreshing(false);
|
|
||||||
}
|
|
||||||
if (!favors.isEmpty()) {
|
|
||||||
SwipeRefreshLayout favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
homeFav.setData(favors);
|
|
||||||
homeFav.notifyDataSetChanged();
|
|
||||||
favReload.setRefreshing(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView txtUser = ui.get().findViewById(R.id.profile_username);
|
TextView txtUser = ui.get().findViewById(R.id.profile_username);
|
||||||
TextView txtScrName = ui.get().findViewById(R.id.profile_screenname);
|
TextView txtScrName = ui.get().findViewById(R.id.profile_screenname);
|
||||||
TextView txtBio = ui.get().findViewById(R.id.bio);
|
TextView txtBio = ui.get().findViewById(R.id.bio);
|
||||||
@ -341,49 +249,11 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(final Void v) {
|
protected void onPostExecute(final Boolean success) {
|
||||||
if (ui.get() == null) return;
|
if (ui.get() == null) return;
|
||||||
|
|
||||||
if (failure) {
|
if (success) {
|
||||||
SwipeRefreshLayout homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
SwipeRefreshLayout favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
if (homeReload.isRefreshing())
|
|
||||||
homeReload.setRefreshing(false);
|
|
||||||
if (favReload.isRefreshing())
|
|
||||||
favReload.setRefreshing(false);
|
|
||||||
|
|
||||||
if (err != null) {
|
|
||||||
boolean killActivity = ErrorHandler.printError(ui.get(), err);
|
|
||||||
if (killActivity)
|
|
||||||
ui.get().finish();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case LDR_PROFILE:
|
|
||||||
if (tweets.isEmpty()) {
|
|
||||||
SwipeRefreshLayout homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
homeReload.setRefreshing(false);
|
|
||||||
}
|
|
||||||
if (favors.isEmpty()) {
|
|
||||||
SwipeRefreshLayout favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
favReload.setRefreshing(false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GET_TWEETS:
|
|
||||||
if (tweets.isEmpty()) {
|
|
||||||
SwipeRefreshLayout homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
homeReload.setRefreshing(false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GET_FAVORS:
|
|
||||||
if (favors.isEmpty()) {
|
|
||||||
SwipeRefreshLayout favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
favReload.setRefreshing(false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACTION_FOLLOW:
|
case ACTION_FOLLOW:
|
||||||
if (!user.isLocked())
|
if (!user.isLocked())
|
||||||
if (isFollowing)
|
if (isFollowing)
|
||||||
@ -410,31 +280,11 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
|||||||
ui.get().setConnection(isFollowing, isMuted, isBlocked, canDm, user.followRequested());
|
ui.get().setConnection(isFollowing, isMuted, isBlocked, canDm, user.followRequested());
|
||||||
ui.get().invalidateOptionsMenu();
|
ui.get().invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
}
|
if (err != null) {
|
||||||
|
boolean killActivity = ErrorHandler.printError(ui.get(), err);
|
||||||
|
if (killActivity)
|
||||||
@Override
|
ui.get().finish();
|
||||||
protected void onCancelled() {
|
|
||||||
if (ui.get() != null) {
|
|
||||||
SwipeRefreshLayout homeReload, favReload;
|
|
||||||
switch (mode) {
|
|
||||||
case GET_TWEETS:
|
|
||||||
homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
homeReload.setRefreshing(false);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GET_FAVORS:
|
|
||||||
favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
favReload.setRefreshing(false);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LDR_PROFILE:
|
|
||||||
homeReload = ui.get().findViewById(R.id.hometweets);
|
|
||||||
favReload = ui.get().findViewById(R.id.homefavorits);
|
|
||||||
homeReload.setRefreshing(false);
|
|
||||||
favReload.setRefreshing(false);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,12 +48,23 @@ public class TweetListFragment extends Fragment implements OnRefreshListener, On
|
|||||||
private TweetAdapter adapter;
|
private TweetAdapter adapter;
|
||||||
private View root;
|
private View root;
|
||||||
|
|
||||||
private long id;
|
|
||||||
private int mode;
|
private int mode;
|
||||||
|
private String search;
|
||||||
|
private long id;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup parent, Bundle param) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup parent, Bundle param) {
|
||||||
super.onCreateView(inflater, parent, param);
|
super.onCreateView(inflater, parent, param);
|
||||||
|
|
||||||
|
Bundle b = getArguments();
|
||||||
|
if(b != null && b.containsKey("mode")) {
|
||||||
|
mode = b.getInt("mode");
|
||||||
|
id = b.getLong("id", -1);
|
||||||
|
search = b.getString("search", "");
|
||||||
|
} else {
|
||||||
|
throw new AssertionError("Bundle error!");
|
||||||
|
}
|
||||||
|
|
||||||
View v = inflater.inflate(R.layout.fragment_list, parent, false);
|
View v = inflater.inflate(R.layout.fragment_list, parent, false);
|
||||||
GlobalSettings settings = GlobalSettings.getInstance(getContext());
|
GlobalSettings settings = GlobalSettings.getInstance(getContext());
|
||||||
|
|
||||||
@ -67,7 +78,21 @@ public class TweetListFragment extends Fragment implements OnRefreshListener, On
|
|||||||
|
|
||||||
RecyclerView list = v.findViewById(R.id.fragment_list);
|
RecyclerView list = v.findViewById(R.id.fragment_list);
|
||||||
list.setLayoutManager(new LinearLayoutManager(getContext()));
|
list.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
list.setHasFixedSize(true);
|
|
||||||
|
switch(mode) {
|
||||||
|
default:
|
||||||
|
case USER_TWEET:
|
||||||
|
case USER_FAVOR:
|
||||||
|
case TWEET_ANSR:
|
||||||
|
list.setHasFixedSize(false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HOME:
|
||||||
|
case MENT:
|
||||||
|
case SEARCH:
|
||||||
|
list.setHasFixedSize(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
list.setAdapter(adapter);
|
list.setAdapter(adapter);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
@ -76,12 +101,7 @@ public class TweetListFragment extends Fragment implements OnRefreshListener, On
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View v, Bundle param) {
|
public void onViewCreated(@NonNull View v, Bundle param) {
|
||||||
super.onViewCreated(v, param);
|
super.onViewCreated(v, param);
|
||||||
Bundle b = getArguments();
|
root = v;
|
||||||
if(b != null) {
|
|
||||||
mode = b.getInt("mode", -1);
|
|
||||||
id = b.getLong("id", -1L);
|
|
||||||
}
|
|
||||||
root = v;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -150,22 +170,22 @@ public class TweetListFragment extends Fragment implements OnRefreshListener, On
|
|||||||
|
|
||||||
case USER_TWEET:
|
case USER_TWEET:
|
||||||
tweetTask = new TweetLoader(root, USR_TWEETS);
|
tweetTask = new TweetLoader(root, USR_TWEETS);
|
||||||
tweetTask.execute();
|
tweetTask.execute(id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case USER_FAVOR:
|
case USER_FAVOR:
|
||||||
tweetTask = new TweetLoader(root, USR_FAVORS);
|
tweetTask = new TweetLoader(root, USR_FAVORS);
|
||||||
tweetTask.execute();
|
tweetTask.execute(id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TWEET_ANSR:
|
case TWEET_ANSR:
|
||||||
tweetTask = new TweetLoader(root, TWEET_ANS);
|
tweetTask = new TweetLoader(root, TWEET_ANS);
|
||||||
tweetTask.execute();
|
tweetTask.execute(id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SEARCH:
|
case SEARCH:
|
||||||
tweetTask = new TweetLoader(root, TWEET_SEARCH);
|
tweetTask = new TweetLoader(root, TWEET_SEARCH);
|
||||||
tweetTask.execute();
|
tweetTask.execute(search);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -180,7 +200,7 @@ public class TweetListFragment extends Fragment implements OnRefreshListener, On
|
|||||||
Tweet tweet = adapter.getData(pos);
|
Tweet tweet = adapter.getData(pos);
|
||||||
if (tweet.getEmbeddedTweet() != null)
|
if (tweet.getEmbeddedTweet() != null)
|
||||||
tweet = tweet.getEmbeddedTweet();
|
tweet = tweet.getEmbeddedTweet();
|
||||||
Intent intent = new Intent(getContext(), TweetDetail.class);//,
|
Intent intent = new Intent(getContext(), TweetDetail.class);
|
||||||
intent.putExtra("tweetID", tweet.getId());
|
intent.putExtra("tweetID", tweet.getId());
|
||||||
intent.putExtra("username", tweet.getUser().getScreenname());
|
intent.putExtra("username", tweet.getUser().getScreenname());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
@ -93,7 +93,6 @@ public class TweetLoader extends AsyncTask<Object, Void, Boolean> {
|
|||||||
publishProgress();
|
publishProgress();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case DB_TWEETS:
|
case DB_TWEETS:
|
||||||
tweets = db.getUserTweets((long)param[0]);
|
tweets = db.getUserTweets((long)param[0]);
|
||||||
if(!tweets.isEmpty())
|
if(!tweets.isEmpty())
|
||||||
|
@ -3,36 +3,30 @@ package org.nuclearfog.twidda.window;
|
|||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.design.widget.TabLayout;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener;
|
import android.support.design.widget.TabLayout.OnTabSelectedListener;
|
||||||
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.AlertDialog.Builder;
|
import android.support.v7.app.AlertDialog.Builder;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.method.ScrollingMovementMethod;
|
import android.text.method.ScrollingMovementMethod;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.view.animation.TranslateAnimation;
|
|
||||||
import android.widget.TabHost;
|
|
||||||
import android.widget.TabHost.OnTabChangeListener;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.nuclearfog.tag.Tagger.OnTagClickListener;
|
import org.nuclearfog.tag.Tagger.OnTagClickListener;
|
||||||
import org.nuclearfog.twidda.BuildConfig;
|
import org.nuclearfog.twidda.BuildConfig;
|
||||||
import org.nuclearfog.twidda.R;
|
import org.nuclearfog.twidda.R;
|
||||||
import org.nuclearfog.twidda.adapter.OnItemClickListener;
|
import org.nuclearfog.twidda.adapter.ProfileTabAdapter;
|
||||||
import org.nuclearfog.twidda.adapter.TweetAdapter;
|
|
||||||
import org.nuclearfog.twidda.backend.ProfileLoader;
|
import org.nuclearfog.twidda.backend.ProfileLoader;
|
||||||
import org.nuclearfog.twidda.backend.items.Tweet;
|
|
||||||
import org.nuclearfog.twidda.database.GlobalSettings;
|
import org.nuclearfog.twidda.database.GlobalSettings;
|
||||||
|
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
|
|
||||||
import static android.os.AsyncTask.Status.RUNNING;
|
import static android.os.AsyncTask.Status.RUNNING;
|
||||||
|
import static org.nuclearfog.twidda.backend.ProfileLoader.Mode.LDR_PROFILE;
|
||||||
import static org.nuclearfog.twidda.window.TweetDetail.STAT_CHANGED;
|
import static org.nuclearfog.twidda.window.TweetDetail.STAT_CHANGED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,32 +34,32 @@ import static org.nuclearfog.twidda.window.TweetDetail.STAT_CHANGED;
|
|||||||
*
|
*
|
||||||
* @see ProfileLoader
|
* @see ProfileLoader
|
||||||
*/
|
*/
|
||||||
public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
public class UserProfile extends AppCompatActivity implements OnTagClickListener, OnTabSelectedListener {
|
||||||
OnTabChangeListener, OnItemClickListener, OnTagClickListener {
|
|
||||||
|
|
||||||
private static final int TWEET = 1;
|
private static final int TWEET = 1;
|
||||||
|
|
||||||
private ProfileLoader profileAsync;
|
private ProfileLoader profileAsync;
|
||||||
private GlobalSettings settings;
|
private ViewPager pager;
|
||||||
private RecyclerView homeList, favoriteList;
|
private View[] icons;
|
||||||
private TweetAdapter tweetAdapter, favAdapter;
|
|
||||||
private SwipeRefreshLayout homeReload, favoriteReload;
|
|
||||||
private View lastTab, tweetUnderline, favorUnderline;
|
|
||||||
private TextView tweetCount, favorCount;
|
|
||||||
private TabHost mTab;
|
|
||||||
private NumberFormat formatter;
|
|
||||||
private boolean home, isFollowing, isBlocked, isMuted, canDm, requested;
|
private boolean home, isFollowing, isBlocked, isMuted, canDm, requested;
|
||||||
private String username;
|
private String username;
|
||||||
private long userId;
|
private long userId;
|
||||||
private int tabIndex = 0;
|
|
||||||
|
|
||||||
|
private int tabIndex = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle b) {
|
protected void onCreate(Bundle b) {
|
||||||
super.onCreate(b);
|
super.onCreate(b);
|
||||||
setContentView(R.layout.page_profile);
|
setContentView(R.layout.page_profile);
|
||||||
|
|
||||||
|
TextView bioTxt = findViewById(R.id.bio);
|
||||||
|
TextView lnkTxt = findViewById(R.id.links);
|
||||||
|
View root = findViewById(R.id.user_view);
|
||||||
|
TabLayout tab = findViewById(R.id.profile_tab);
|
||||||
|
pager = findViewById(R.id.profile_pager);
|
||||||
Toolbar tool = findViewById(R.id.profile_toolbar);
|
Toolbar tool = findViewById(R.id.profile_toolbar);
|
||||||
|
|
||||||
setSupportActionBar(tool);
|
setSupportActionBar(tool);
|
||||||
if (getSupportActionBar() != null)
|
if (getSupportActionBar() != null)
|
||||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||||
@ -78,71 +72,40 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
|||||||
username = param.getString("username");
|
username = param.getString("username");
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView bioTxt = findViewById(R.id.bio);
|
GlobalSettings settings = GlobalSettings.getInstance(this);
|
||||||
TextView lnkTxt = findViewById(R.id.links);
|
|
||||||
View root = findViewById(R.id.user_view);
|
|
||||||
homeList = findViewById(R.id.ht_list);
|
|
||||||
homeReload = findViewById(R.id.hometweets);
|
|
||||||
favoriteList = findViewById(R.id.hf_list);
|
|
||||||
favoriteReload = findViewById(R.id.homefavorits);
|
|
||||||
mTab = findViewById(R.id.profile_tab);
|
|
||||||
|
|
||||||
settings = GlobalSettings.getInstance(this);
|
|
||||||
home = userId == settings.getUserId();
|
home = userId == settings.getUserId();
|
||||||
formatter = NumberFormat.getIntegerInstance();
|
|
||||||
|
|
||||||
homeList.setLayoutManager(new LinearLayoutManager(this));
|
|
||||||
favoriteList.setLayoutManager(new LinearLayoutManager(this));
|
|
||||||
root.setBackgroundColor(settings.getBackgroundColor());
|
root.setBackgroundColor(settings.getBackgroundColor());
|
||||||
bioTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
|
bioTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||||
lnkTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
|
lnkTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||||
bioTxt.setLinkTextColor(settings.getHighlightColor());
|
bioTxt.setLinkTextColor(settings.getHighlightColor());
|
||||||
lnkTxt.setLinkTextColor(settings.getHighlightColor());
|
lnkTxt.setLinkTextColor(settings.getHighlightColor());
|
||||||
|
|
||||||
|
icons = new View[2];
|
||||||
LayoutInflater inflater = LayoutInflater.from(this);
|
LayoutInflater inflater = LayoutInflater.from(this);
|
||||||
View tweetIndicator = inflater.inflate(R.layout.tab_tw, null);
|
icons[0] = inflater.inflate(R.layout.tab_tw, null);
|
||||||
View favorIndicator = inflater.inflate(R.layout.tab_fa, null);
|
icons[1] = inflater.inflate(R.layout.tab_fa, null);
|
||||||
tweetUnderline = tweetIndicator.findViewById(R.id.tweet_divider);
|
|
||||||
favorUnderline = favorIndicator.findViewById(R.id.favor_divider);
|
|
||||||
tweetCount = tweetIndicator.findViewById(R.id.profile_tweet_count);
|
|
||||||
favorCount = favorIndicator.findViewById(R.id.profile_favor_count);
|
|
||||||
homeReload.setProgressBackgroundColorSchemeColor(settings.getHighlightColor());
|
|
||||||
favoriteReload.setProgressBackgroundColorSchemeColor(settings.getHighlightColor());
|
|
||||||
|
|
||||||
mTab.setup();
|
ProfileTabAdapter adapter = new ProfileTabAdapter(getSupportFragmentManager(), userId);
|
||||||
TabHost.TabSpec tab1 = mTab.newTabSpec("tweets");
|
pager.setOffscreenPageLimit(2);
|
||||||
tab1.setContent(R.id.hometweets);
|
pager.setAdapter(adapter);
|
||||||
tab1.setIndicator(tweetIndicator);
|
tab.setupWithViewPager(pager);
|
||||||
mTab.addTab(tab1);
|
tab.addOnTabSelectedListener(this);
|
||||||
TabHost.TabSpec tab2 = mTab.newTabSpec("favors");
|
|
||||||
tab2.setContent(R.id.homefavorits);
|
|
||||||
tab2.setIndicator(favorIndicator);
|
|
||||||
mTab.addTab(tab2);
|
|
||||||
lastTab = mTab.getCurrentView();
|
|
||||||
setIndicator();
|
|
||||||
|
|
||||||
mTab.setOnTabChangedListener(this);
|
for(int i = 0 ; i < icons.length ; i++) {
|
||||||
homeReload.setOnRefreshListener(this);
|
TabLayout.Tab t = tab.getTabAt(i);
|
||||||
favoriteReload.setOnRefreshListener(this);
|
if(t != null)
|
||||||
|
t.setCustomView(icons[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
if (profileAsync == null) {
|
if(profileAsync == null) {
|
||||||
tweetAdapter = new TweetAdapter(this);
|
profileAsync = new ProfileLoader(this, LDR_PROFILE);
|
||||||
tweetAdapter.setColor(settings.getHighlightColor(), settings.getFontColor());
|
profileAsync.execute(userId);
|
||||||
tweetAdapter.toggleImage(settings.getImageLoad());
|
|
||||||
homeList.setAdapter(tweetAdapter);
|
|
||||||
|
|
||||||
favAdapter = new TweetAdapter(this);
|
|
||||||
favAdapter.setColor(settings.getHighlightColor(), settings.getFontColor());
|
|
||||||
favAdapter.toggleImage(settings.getImageLoad());
|
|
||||||
favoriteList.setAdapter(favAdapter);
|
|
||||||
|
|
||||||
profileAsync = new ProfileLoader(this, ProfileLoader.Mode.LDR_PROFILE);
|
|
||||||
profileAsync.execute(userId, 0L);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,9 +120,8 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int reqCode, int returnCode, Intent i) {
|
protected void onActivityResult(int reqCode, int returnCode, Intent i) {
|
||||||
if (reqCode == TWEET && returnCode == STAT_CHANGED) {
|
if (reqCode == TWEET && returnCode == STAT_CHANGED)
|
||||||
profileAsync = null;
|
profileAsync = null;
|
||||||
}
|
|
||||||
super.onActivityResult(reqCode, returnCode, i);
|
super.onActivityResult(reqCode, returnCode, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,56 +254,7 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
|||||||
if (tabIndex == 0) {
|
if (tabIndex == 0) {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
mTab.setCurrentTab(0);
|
pager.setCurrentItem(0);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRefresh() {
|
|
||||||
if (profileAsync != null && profileAsync.getStatus() == RUNNING)
|
|
||||||
profileAsync.cancel(true);
|
|
||||||
switch (tabIndex) {
|
|
||||||
default:
|
|
||||||
case 0:
|
|
||||||
profileAsync = new ProfileLoader(this, ProfileLoader.Mode.GET_TWEETS);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
profileAsync = new ProfileLoader(this, ProfileLoader.Mode.GET_FAVORS);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
profileAsync.execute(userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabChanged(String tabId) {
|
|
||||||
animate();
|
|
||||||
tabIndex = mTab.getCurrentTab();
|
|
||||||
setIndicator();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemClick(RecyclerView parent, int position) {
|
|
||||||
switch (parent.getId()) {
|
|
||||||
case R.id.ht_list:
|
|
||||||
if (!homeReload.isRefreshing()) {
|
|
||||||
Tweet tweet = tweetAdapter.getData(position);
|
|
||||||
if (tweet.getEmbeddedTweet() != null)
|
|
||||||
tweet = tweet.getEmbeddedTweet();
|
|
||||||
openTweet(tweet.getId(), tweet.getUser().getScreenname());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.hf_list:
|
|
||||||
if (!favoriteReload.isRefreshing()) {
|
|
||||||
Tweet tweet = favAdapter.getData(position);
|
|
||||||
if (tweet.getEmbeddedTweet() != null)
|
|
||||||
tweet = tweet.getEmbeddedTweet();
|
|
||||||
openTweet(tweet.getId(), tweet.getUser().getScreenname());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,8 +267,25 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
tabIndex = tab.getPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(TabLayout.Tab tab) { }
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(TabLayout.Tab tab) { }
|
||||||
|
|
||||||
|
|
||||||
public void setTweetCount(int tweets, int favors) {
|
public void setTweetCount(int tweets, int favors) {
|
||||||
|
NumberFormat formatter = NumberFormat.getIntegerInstance();
|
||||||
|
TextView tweetCount = icons[0].findViewById(R.id.profile_tweet_count);
|
||||||
tweetCount.setText(formatter.format(tweets));
|
tweetCount.setText(formatter.format(tweets));
|
||||||
|
TextView favorCount = icons[1].findViewById(R.id.profile_favor_count);
|
||||||
favorCount.setText(formatter.format(favors));
|
favorCount.setText(formatter.format(favors));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,57 +297,4 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
|||||||
this.canDm = canDm;
|
this.canDm = canDm;
|
||||||
this.requested = requested;
|
this.requested = requested;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void openTweet(long tweetId, String username) {
|
|
||||||
Intent intent = new Intent(this, TweetDetail.class);
|
|
||||||
intent.putExtra("tweetID", tweetId);
|
|
||||||
intent.putExtra("username", username);
|
|
||||||
startActivityForResult(intent, TWEET);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void setIndicator() {
|
|
||||||
switch (tabIndex) {
|
|
||||||
case 0:
|
|
||||||
tweetUnderline.setBackgroundColor(settings.getHighlightColor());
|
|
||||||
favorUnderline.setBackgroundColor(0);
|
|
||||||
favoriteList.smoothScrollToPosition(0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
favorUnderline.setBackgroundColor(settings.getHighlightColor());
|
|
||||||
tweetUnderline.setBackgroundColor(0);
|
|
||||||
homeList.smoothScrollToPosition(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void animate() {
|
|
||||||
final int ANIM_DUR = 300;
|
|
||||||
final float LEFT = -1.0f;
|
|
||||||
final float RIGHT = 1.0f;
|
|
||||||
final float NULL = 0.0f;
|
|
||||||
final int DIMENS = Animation.RELATIVE_TO_PARENT;
|
|
||||||
|
|
||||||
View currentTab = mTab.getCurrentView();
|
|
||||||
if (mTab.getCurrentTab() > tabIndex) {
|
|
||||||
Animation lOut = new TranslateAnimation(DIMENS, NULL, DIMENS, LEFT, DIMENS, NULL, DIMENS, NULL);
|
|
||||||
Animation rIn = new TranslateAnimation(DIMENS, RIGHT, DIMENS, NULL, DIMENS, NULL, DIMENS, NULL);
|
|
||||||
lOut.setDuration(ANIM_DUR);
|
|
||||||
rIn.setDuration(ANIM_DUR);
|
|
||||||
lastTab.setAnimation(lOut);
|
|
||||||
currentTab.setAnimation(rIn);
|
|
||||||
} else {
|
|
||||||
Animation lIn = new TranslateAnimation(DIMENS, LEFT, DIMENS, NULL, DIMENS, NULL, DIMENS, NULL);
|
|
||||||
Animation rOut = new TranslateAnimation(DIMENS, NULL, DIMENS, RIGHT, DIMENS, NULL, DIMENS, NULL);
|
|
||||||
lIn.setDuration(ANIM_DUR);
|
|
||||||
rOut.setDuration(ANIM_DUR);
|
|
||||||
lastTab.setAnimation(rOut);
|
|
||||||
currentTab.setAnimation(lIn);
|
|
||||||
}
|
|
||||||
lastTab = mTab.getCurrentView();
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -15,29 +15,7 @@
|
|||||||
android:id="@+id/home_tab"
|
android:id="@+id/home_tab"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:tabTextAppearance="@style/CustomTextAppearance">
|
app:tabTextAppearance="@style/CustomTextAppearance"/>
|
||||||
|
|
||||||
<android.support.design.widget.TabItem
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:icon="@drawable/home"
|
|
||||||
android:layout="@layout/tab_home" />
|
|
||||||
|
|
||||||
<android.support.design.widget.TabItem
|
|
||||||
android:id="@+id/tab_trend"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:icon="@drawable/hash"
|
|
||||||
android:layout="@layout/tab_home" />
|
|
||||||
|
|
||||||
<android.support.design.widget.TabItem
|
|
||||||
android:id="@+id/tab_mention"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:icon="@drawable/mention"
|
|
||||||
android:layout="@layout/tab_home" />
|
|
||||||
|
|
||||||
</android.support.design.widget.TabLayout>
|
|
||||||
|
|
||||||
<android.support.v4.view.ViewPager
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@+id/home_pager"
|
android:id="@+id/home_pager"
|
||||||
|
@ -260,55 +260,22 @@
|
|||||||
android:fillViewport="true"
|
android:fillViewport="true"
|
||||||
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior">
|
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior">
|
||||||
|
|
||||||
<TabHost
|
<LinearLayout
|
||||||
android:id="@+id/profile_tab"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.design.widget.TabLayout
|
||||||
|
android:id="@+id/profile_tab"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content" />
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TabWidget
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@android:id/tabs"
|
android:id="@+id/profile_pager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<FrameLayout
|
</LinearLayout>
|
||||||
android:id="@android:id/tabcontent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
|
||||||
android:id="@+id/hometweets"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/ht_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
</android.support.v4.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
|
||||||
android:id="@+id/homefavorits"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/hf_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
</android.support.v4.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</TabHost>
|
|
||||||
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user