1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-22 21:16:57 +00:00

layout finalization

This commit is contained in:
Austin Huang 2020-08-11 14:14:30 -04:00
parent 55d2fbd6fa
commit 7ddf356de9
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
5 changed files with 14 additions and 12 deletions

View File

@ -280,7 +280,7 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
isLoggedIn = !Utils.isEmpty(cookie);
if (!isLoggedIn) {
main.mainBinding.drawerLayout.removeView(main.mainBinding.feedView.feedLayout);
main.mainBinding.drawerLayout.removeView(main.mainBinding.discoverSwipeRefreshLayout);
main.mainBinding.drawerLayout.removeView(main.mainBinding.discoverLayout);
iconFeed.setAlpha(0.4f);
iconDiscover.setAlpha(0.4f);
} else {

View File

@ -81,7 +81,7 @@ public final class Main extends BaseLanguageActivity {
(!mainHelper.isLoggedIn && Utils.settingsHelper.getBoolean(Constants.STORIESIG)), true, result -> {
if (result != null && result.length > 0)
startActivity(new Intent(Main.this, StoryViewer.class)
.putExtra(Constants.EXTRAS_USERNAME, userQuery)
.putExtra(Constants.EXTRAS_USERNAME, userQuery.replace("@", ""))
.putExtra(Constants.EXTRAS_HIGHLIGHT, highlightModel.getTitle())
.putExtra(Constants.EXTRAS_STORIES, result)
);
@ -199,7 +199,7 @@ public final class Main extends BaseLanguageActivity {
((hashtagModel != null) ? Constants.EXTRAS_HASHTAG : (locationModel != null ? Constants.EXTRAS_LOCATION : Constants.EXTRAS_PROFILE)),
((hashtagModel != null) ? hashtagModel : (locationModel != null ? locationModel : profileModel)));
}
else intent = new Intent(this, StoryViewer.class).putExtra(Constants.EXTRAS_USERNAME, userQuery)
else intent = new Intent(this, StoryViewer.class).putExtra(Constants.EXTRAS_USERNAME, userQuery.replace("@", ""))
.putExtra(Constants.EXTRAS_STORIES, storyModels)
.putExtra(Constants.EXTRAS_HASHTAG, (hashtagModel != null));
startActivity(intent);

View File

@ -7,8 +7,10 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.LayoutInflater;
@ -198,7 +200,13 @@ public final class FeedAdapter extends RecyclerView.Adapter<FeedItemViewHolder>
final ProfileModel profileModel = feedModel.getProfileModel();
if (profileModel != null) {
glideRequestManager.load(profileModel.getSdProfilePic()).into(viewHolder.profilePic);
viewHolder.username.setText("@"+profileModel.getUsername());
final int titleLen = profileModel.getUsername().length() + 1;
final SpannableString spannableString = new SpannableString("@"+profileModel.getUsername());
spannableString.setSpan(new CommentMentionClickSpan(), 0, titleLen, 0);
viewHolder.username.setText(spannableString);
viewHolder.username.setMovementMethod(new LinkMovementMethod());
viewHolder.username.setMentionClickListener((view, text, isHashtag) ->
mentionClickListener.onClick(null, profileModel.getUsername(), false));
}
viewHolder.viewPost.setOnClickListener(clickListener);
@ -416,8 +424,6 @@ public final class FeedAdapter extends RecyclerView.Adapter<FeedItemViewHolder>
@NonNull
@Override
public Object instantiateItem(@NonNull final ViewGroup container, final int position) {
if (BuildConfig.DEBUG) container.setBackgroundColor(0xFF_0a_c0_09); // todo remove
final Context context = container.getContext();
final ViewerPostModel sliderItem = sliderItems[position];

View File

@ -16,8 +16,8 @@ import awais.instagrabber.customviews.RamboTextView;
public final class FeedItemViewHolder extends RecyclerView.ViewHolder {
public final ImageView profilePic, btnMute, btnDownload;
public final TextView username, commentsCount, videoViews, mediaCounter, tvPostDate, location;
public final RamboTextView viewerCaption;
public final TextView commentsCount, videoViews, mediaCounter, tvPostDate, location;
public final RamboTextView username, viewerCaption;
public final View btnComments, videoViewsParent, viewPost;
public final ViewPager mediaList;
public final PhotoView imageView;

View File

@ -434,10 +434,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
tools:listitem="@layout/item_post" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>