14 changed files with 621 additions and 923 deletions
-
71app/src/main/java/awais/instagrabber/asyncs/SavedPostFetchService.java
-
199app/src/main/java/awais/instagrabber/customviews/RemixDrawerLayout.java
-
444app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java
-
9app/src/main/java/awais/instagrabber/repositories/ProfileRepository.java
-
3app/src/main/java/awais/instagrabber/utils/Constants.java
-
6app/src/main/java/awais/instagrabber/utils/SettingsHelper.java
-
2app/src/main/java/awais/instagrabber/webservices/DiscoverService.java
-
241app/src/main/java/awais/instagrabber/webservices/ProfileService.java
-
1app/src/main/java/awais/instagrabber/webservices/TagsService.java
-
28app/src/main/res/layout/fragment_saved.xml
-
49app/src/main/res/layout/layout_feed_view.xml
-
463app/src/main/res/layout/layout_profile_view.xml
-
9app/src/main/res/menu/saved_viewer_menu.xml
-
19app/src/main/res/navigation/profile_nav_graph.xml
@ -0,0 +1,71 @@ |
|||||
|
package awais.instagrabber.asyncs; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import awais.instagrabber.customviews.helpers.PostFetcher; |
||||
|
import awais.instagrabber.interfaces.FetchListener; |
||||
|
import awais.instagrabber.models.FeedModel; |
||||
|
import awais.instagrabber.models.enums.PostItemType; |
||||
|
import awais.instagrabber.webservices.ProfileService; |
||||
|
import awais.instagrabber.webservices.ProfileService.SavedPostsFetchResponse; |
||||
|
import awais.instagrabber.webservices.ServiceCallback; |
||||
|
|
||||
|
public class SavedPostFetchService implements PostFetcher.PostFetchService { |
||||
|
private final ProfileService profileService; |
||||
|
private final String profileId; |
||||
|
private final PostItemType type; |
||||
|
|
||||
|
private String nextMaxId; |
||||
|
private boolean moreAvailable; |
||||
|
|
||||
|
public SavedPostFetchService(final String profileId, final PostItemType type) { |
||||
|
this.profileId = profileId; |
||||
|
this.type = type; |
||||
|
profileService = ProfileService.getInstance(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void fetch(final FetchListener<List<FeedModel>> fetchListener) { |
||||
|
final ServiceCallback<SavedPostsFetchResponse> callback = new ServiceCallback<SavedPostsFetchResponse>() { |
||||
|
@Override |
||||
|
public void onSuccess(final SavedPostsFetchResponse result) { |
||||
|
if (result == null) return; |
||||
|
nextMaxId = result.getNextMaxId(); |
||||
|
moreAvailable = result.isMoreAvailable(); |
||||
|
if (fetchListener != null) { |
||||
|
fetchListener.onResult(result.getItems()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onFailure(final Throwable t) { |
||||
|
// Log.e(TAG, "onFailure: ", t); |
||||
|
if (fetchListener != null) { |
||||
|
fetchListener.onFailure(t); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
switch (type) { |
||||
|
case LIKED: |
||||
|
profileService.fetchLiked(nextMaxId, callback); |
||||
|
break; |
||||
|
case TAGGED: |
||||
|
profileService.fetchTagged(profileId, nextMaxId, callback); |
||||
|
break; |
||||
|
case SAVED: |
||||
|
default: |
||||
|
profileService.fetchSaved(nextMaxId, callback); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void reset() { |
||||
|
nextMaxId = null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean hasNextPage() { |
||||
|
return moreAvailable; |
||||
|
} |
||||
|
} |
@ -1,199 +0,0 @@ |
|||||
package awais.instagrabber.customviews; |
|
||||
|
|
||||
import android.app.Activity; |
|
||||
import android.content.Context; |
|
||||
import android.content.ContextWrapper; |
|
||||
import android.content.res.Configuration; |
|
||||
import android.graphics.Rect; |
|
||||
import android.os.Build; |
|
||||
import android.util.AttributeSet; |
|
||||
import android.view.Gravity; |
|
||||
import android.view.MotionEvent; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.view.Window; |
|
||||
import android.widget.FrameLayout; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
import androidx.annotation.Nullable; |
|
||||
import androidx.core.view.GravityCompat; |
|
||||
import androidx.core.view.ViewCompat; |
|
||||
import androidx.recyclerview.widget.RecyclerView; |
|
||||
import androidx.viewpager.widget.PagerAdapter; |
|
||||
import androidx.viewpager.widget.ViewPager; |
|
||||
|
|
||||
import awais.instagrabber.R; |
|
||||
|
|
||||
public final class RemixDrawerLayout extends MouseDrawer implements MouseDrawer.DrawerListener { |
|
||||
private final FrameLayout frameLayout; |
|
||||
private View drawerView; |
|
||||
private RecyclerView highlightsList, feedPosts, feedStories; |
|
||||
private float startX; |
|
||||
|
|
||||
public RemixDrawerLayout(@NonNull final Context context) { |
|
||||
this(context, null); |
|
||||
} |
|
||||
|
|
||||
public RemixDrawerLayout(@NonNull final Context context, @Nullable final AttributeSet attrs) { |
|
||||
this(context, attrs, 0); |
|
||||
} |
|
||||
|
|
||||
public RemixDrawerLayout(@NonNull final Context context, @Nullable final AttributeSet attrs, final int defStyle) { |
|
||||
super(context, attrs, defStyle); |
|
||||
|
|
||||
super.setDrawerElevation(getDrawerElevation()); |
|
||||
|
|
||||
addDrawerListener(this); |
|
||||
|
|
||||
frameLayout = new FrameLayout(context); |
|
||||
frameLayout.setPadding(0, 0, 0, 0); |
|
||||
super.addView(frameLayout); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void addView(@NonNull final View child, final ViewGroup.LayoutParams params) { |
|
||||
child.setLayoutParams(params); |
|
||||
addView(child); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void addView(@NonNull final View child) { |
|
||||
if (child.getTag() != null) super.addView(child); |
|
||||
else frameLayout.addView(child); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean onInterceptTouchEvent(@NonNull final MotionEvent ev) { |
|
||||
final float x = ev.getX(); |
|
||||
final float y = ev.getY(); |
|
||||
|
|
||||
// another one of my own weird hack thingies to make this app work |
|
||||
if (feedPosts == null) feedPosts = findViewById(R.id.feedPosts); |
|
||||
if (feedPosts != null) { |
|
||||
for (int i = 0; i < feedPosts.getChildCount(); ++i) { |
|
||||
final View viewHolder = feedPosts.getChildAt(i); |
|
||||
final View mediaList = viewHolder.findViewById(R.id.media_list); |
|
||||
if (mediaList instanceof ViewPager) { |
|
||||
final ViewPager viewPager = (ViewPager) mediaList; |
|
||||
|
|
||||
final Rect rect = new Rect(); |
|
||||
viewPager.getGlobalVisibleRect(rect); |
|
||||
|
|
||||
final boolean touchIsInMediaList = rect.contains((int) x, (int) y); |
|
||||
if (touchIsInMediaList) { |
|
||||
final PagerAdapter adapter = viewPager.getAdapter(); |
|
||||
final int count = adapter != null ? adapter.getCount() : 0; |
|
||||
if (count < 1 || viewPager.getCurrentItem() != count - 1) return false; |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// thanks to Fede @ https://stackoverflow.com/questions/6920137/android-viewpager-and-horizontalscrollview/7258579#7258579 |
|
||||
if (highlightsList == null) highlightsList = findViewById(R.id.highlightsList); |
|
||||
if (highlightsList != null) { |
|
||||
final Boolean result = handleHorizontalRecyclerView(ev, highlightsList); |
|
||||
if (result != null) { |
|
||||
return result; |
|
||||
} |
|
||||
} |
|
||||
if (feedStories == null) feedStories = findViewById(R.id.feedStories); |
|
||||
if (feedStories != null) { |
|
||||
final Boolean result = handleHorizontalRecyclerView(ev, feedStories); |
|
||||
if (result != null) { |
|
||||
return result; |
|
||||
} |
|
||||
} |
|
||||
return super.onInterceptTouchEvent(ev); |
|
||||
} |
|
||||
|
|
||||
private Boolean handleHorizontalRecyclerView(@NonNull final MotionEvent ev, final RecyclerView view) { |
|
||||
final float x = ev.getX(); |
|
||||
final float y = ev.getY(); |
|
||||
final boolean touchIsInRecycler = x >= view.getLeft() && x < view.getRight() |
|
||||
&& y >= view.getTop() && view.getBottom() > y; |
|
||||
|
|
||||
if (touchIsInRecycler) { |
|
||||
final int action = ev.getActionMasked(); |
|
||||
|
|
||||
if (action == MotionEvent.ACTION_CANCEL) return super.onInterceptTouchEvent(ev); |
|
||||
|
|
||||
if (action == MotionEvent.ACTION_DOWN) startX = x; |
|
||||
else if (action == MotionEvent.ACTION_MOVE) { |
|
||||
final int scrollRange = view.computeHorizontalScrollRange(); |
|
||||
final int scrollOffset = view.computeHorizontalScrollOffset(); |
|
||||
final boolean scrollable = scrollRange > view.getWidth(); |
|
||||
final boolean draggingFromRight = startX > x; |
|
||||
|
|
||||
if (scrollOffset < 1) { |
|
||||
if (!scrollable) return super.onInterceptTouchEvent(ev); |
|
||||
else if (!draggingFromRight) return super.onInterceptTouchEvent(ev); |
|
||||
} else if (scrollable && draggingFromRight && scrollRange - scrollOffset == view.computeHorizontalScrollExtent()) { |
|
||||
return super.onInterceptTouchEvent(ev); |
|
||||
} |
|
||||
|
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDrawerSlide(@NonNull final View view, @EdgeGravity final int gravity, final float slideOffset) { |
|
||||
drawerView = view; |
|
||||
final int absHorizGravity = getDrawerViewAbsoluteGravity(GravityCompat.START); |
|
||||
final int childAbsGravity = getDrawerViewAbsoluteGravity(drawerView); |
|
||||
|
|
||||
final Window window = getActivity(getContext()).getWindow(); |
|
||||
final boolean isRtl = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL |
|
||||
|| window.getDecorView().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL |
|
||||
|| getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL); |
|
||||
|
|
||||
final int drawerViewWidth = drawerView.getWidth(); |
|
||||
|
|
||||
// for (int i = 0; i < frameLayout.getChildCount(); i++) { |
|
||||
// final View child = frameLayout.getChildAt(i); |
|
||||
// |
|
||||
// final boolean isLeftDrawer = isRtl == (childAbsGravity != absHorizGravity); |
|
||||
// float width = isLeftDrawer ? drawerViewWidth : -drawerViewWidth; |
|
||||
// |
|
||||
// child.setX(width * slideOffset); |
|
||||
// } |
|
||||
|
|
||||
final boolean isLeftDrawer = isRtl == (childAbsGravity != absHorizGravity); |
|
||||
float width = isLeftDrawer ? drawerViewWidth : -drawerViewWidth; |
|
||||
|
|
||||
frameLayout.setX(width * (isRtl ? -slideOffset : slideOffset)); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void openDrawer(@NonNull final View drawerView, final boolean animate) { |
|
||||
super.openDrawer(drawerView, animate); |
|
||||
post(() -> onDrawerSlide(drawerView, Gravity.NO_GRAVITY, isDrawerOpen(drawerView) ? 1f : 0f)); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
protected void onConfigurationChanged(final Configuration newConfig) { |
|
||||
super.onConfigurationChanged(newConfig); |
|
||||
if (drawerView != null) onDrawerSlide(drawerView, Gravity.NO_GRAVITY, isDrawerOpen(drawerView) ? 1f : 0f); |
|
||||
} |
|
||||
|
|
||||
private static Activity getActivity(final Context context) { |
|
||||
if (context != null) { |
|
||||
if (context instanceof Activity) return (Activity) context; |
|
||||
if (context instanceof ContextWrapper) |
|
||||
return getActivity(((ContextWrapper) context).getBaseContext()); |
|
||||
} |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
final int getDrawerViewAbsoluteGravity(final int gravity) { |
|
||||
return GravityCompat.getAbsoluteGravity(gravity, ViewCompat.getLayoutDirection(this)) & GravityCompat.RELATIVE_HORIZONTAL_GRAVITY_MASK; |
|
||||
} |
|
||||
|
|
||||
final int getDrawerViewAbsoluteGravity(@NonNull final View drawerView) { |
|
||||
final int gravity = ((LayoutParams) drawerView.getLayoutParams()).gravity; |
|
||||
return getDrawerViewAbsoluteGravity(gravity); |
|
||||
} |
|
||||
} |
|
@ -1,28 +1,16 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
xmlns:tools="http://schemas.android.com/tools" |
||||
|
android:id="@+id/swipe_refresh_layout" |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||
android:orientation="vertical" |
|
||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" |
||||
tools:context=".fragments.SavedViewerFragment"> |
tools:context=".fragments.SavedViewerFragment"> |
||||
|
|
||||
<!--<include--> |
|
||||
<!-- android:id="@+id/toolbar"--> |
|
||||
<!-- layout="@layout/layout_include_toolbar" />--> |
|
||||
|
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
|
||||
android:id="@+id/swipeRefreshLayout" |
|
||||
|
<awais.instagrabber.customviews.PostsRecyclerView |
||||
|
android:id="@+id/posts" |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||
android:tag="@android:string/yes"> |
|
||||
|
|
||||
<androidx.recyclerview.widget.RecyclerView |
|
||||
android:id="@+id/mainPosts" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:clipToPadding="false" |
|
||||
android:paddingStart="8dp" |
|
||||
android:paddingEnd="8dp" |
|
||||
tools:listitem="@layout/item_post" /> |
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
|
||||
</LinearLayout> |
|
||||
|
android:clipToPadding="false" /> |
||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
@ -1,49 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|
||||
xmlns:tools="http://schemas.android.com/tools" |
|
||||
android:id="@+id/feedLayout" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_gravity="start" |
|
||||
android:animateLayoutChanges="true" |
|
||||
android:tag="@android:string/yes"> |
|
||||
|
|
||||
<com.google.android.material.appbar.AppBarLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:background="@null" |
|
||||
app:elevation="0dp"> |
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
app:layout_scrollFlags="scroll|snap|enterAlways"> |
|
||||
<androidx.recyclerview.widget.RecyclerView |
|
||||
android:id="@+id/feedStories" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:clipToPadding="false" |
|
||||
android:orientation="horizontal" |
|
||||
android:paddingStart="5dp" |
|
||||
android:paddingLeft="5dp" |
|
||||
android:paddingTop="24dp" |
|
||||
android:paddingEnd="5dp" |
|
||||
android:paddingRight="5dp" |
|
||||
android:visibility="gone" /> |
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout> |
|
||||
</com.google.android.material.appbar.AppBarLayout> |
|
||||
|
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
|
||||
android:id="@+id/feedSwipeRefreshLayout" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"> |
|
||||
|
|
||||
<androidx.recyclerview.widget.RecyclerView |
|
||||
android:id="@+id/feedPosts" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:clipToPadding="false" |
|
||||
tools:listitem="@layout/item_feed_photo" /> |
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout> |
|
@ -1,463 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|
||||
xmlns:tools="http://schemas.android.com/tools" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent"> |
|
||||
|
|
||||
<com.google.android.material.appbar.AppBarLayout |
|
||||
android:id="@+id/appBarLayout" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:background="@null"> |
|
||||
|
|
||||
<!-- for users --> |
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
app:layout_scrollFlags="scroll|enterAlways"> |
|
||||
|
|
||||
<RelativeLayout |
|
||||
android:id="@+id/infoContainer" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:animateLayoutChanges="true" |
|
||||
android:background="@null" |
|
||||
android:orientation="vertical" |
|
||||
android:paddingBottom="5dp"> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:id="@+id/profileInfoText" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/profileInfo" |
|
||||
android:orientation="horizontal" |
|
||||
android:paddingStart="10dp" |
|
||||
android:paddingLeft="10dp" |
|
||||
android:paddingEnd="10dp" |
|
||||
android:paddingRight="10dp"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:id="@+id/isVerified" |
|
||||
android:layout_width="18dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_gravity="start" |
|
||||
android:adjustViewBounds="true" |
|
||||
android:scaleType="fitCenter" |
|
||||
android:visibility="gone" |
|
||||
app:srcCompat="@drawable/verified" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/mainFullName" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_weight="1" |
|
||||
android:ellipsize="marquee" |
|
||||
android:singleLine="true" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" |
|
||||
android:textSize="16sp" |
|
||||
tools:text="Austin Huang" /> |
|
||||
</LinearLayout> |
|
||||
|
|
||||
<awais.instagrabber.customviews.RamboTextView |
|
||||
android:id="@+id/mainBiography" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/profileInfoText" |
|
||||
android:background="?android:selectableItemBackground" |
|
||||
android:paddingStart="10dp" |
|
||||
android:paddingLeft="10dp" |
|
||||
android:paddingEnd="10dp" |
|
||||
android:paddingRight="10dp" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" |
|
||||
android:textSize="16sp" |
|
||||
tools:text="THE GLORIOUS (step)OWNER OF THIS APP" /> |
|
||||
|
|
||||
<awais.instagrabber.customviews.RamboTextView |
|
||||
android:id="@+id/mainUrl" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/mainBiography" |
|
||||
android:ellipsize="marquee" |
|
||||
android:paddingStart="10dp" |
|
||||
android:paddingLeft="10dp" |
|
||||
android:paddingEnd="10dp" |
|
||||
android:paddingRight="10dp" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
tools:text="https://austinhuang.me/" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.LinearLayoutCompat |
|
||||
android:id="@+id/profileActions" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/mainUrl"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnFollow" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="1dp" |
|
||||
android:layout_marginLeft="8dp" |
|
||||
android:layout_marginEnd="1dp" |
|
||||
android:layout_marginRight="8dp" |
|
||||
android:layout_weight="1" |
|
||||
android:text="@string/follow" |
|
||||
android:textColor="@color/btn_pink_text_color" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
app:backgroundTint="@color/btn_pink_background" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnRestrict" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="1dp" |
|
||||
android:layout_marginLeft="8dp" |
|
||||
android:layout_marginEnd="1dp" |
|
||||
android:layout_marginRight="8dp" |
|
||||
android:layout_weight="1" |
|
||||
android:text="@string/restrict" |
|
||||
android:textColor="@color/btn_orange_text_color" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
app:backgroundTint="@color/btn_orange_background" /> |
|
||||
|
|
||||
<!-- only for invisible private accounts --> |
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnBlock" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="1dp" |
|
||||
android:layout_marginLeft="8dp" |
|
||||
android:layout_marginEnd="1dp" |
|
||||
android:layout_marginRight="8dp" |
|
||||
android:layout_weight="1" |
|
||||
android:text="@string/block" |
|
||||
android:textColor="@color/btn_red_text_color" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
app:backgroundTint="@color/btn_red_background" /> |
|
||||
</androidx.appcompat.widget.LinearLayoutCompat> |
|
||||
|
|
||||
<androidx.appcompat.widget.LinearLayoutCompat |
|
||||
android:id="@+id/myActions" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/profileActions"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnTagged" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginStart="1dp" |
|
||||
android:layout_marginLeft="8dp" |
|
||||
android:layout_marginEnd="1dp" |
|
||||
android:layout_marginRight="8dp" |
|
||||
android:layout_weight="1" |
|
||||
android:text="@string/tagged" |
|
||||
android:textColor="@color/btn_blue_text_color" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
app:backgroundTint="@color/btn_blue_background" /> |
|
||||
|
|
||||
<!-- also used as block --> |
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnSaved" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginStart="1dp" |
|
||||
android:layout_marginLeft="8dp" |
|
||||
android:layout_marginEnd="1dp" |
|
||||
android:layout_marginRight="8dp" |
|
||||
android:layout_weight="1" |
|
||||
android:text="@string/saved" |
|
||||
android:textColor="@color/btn_orange_text_color" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
app:backgroundTint="@color/btn_orange_background" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnLiked" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginStart="1dp" |
|
||||
android:layout_marginLeft="8dp" |
|
||||
android:layout_marginEnd="1dp" |
|
||||
android:layout_marginRight="8dp" |
|
||||
android:layout_weight="1" |
|
||||
android:text="@string/liked" |
|
||||
android:textColor="@color/btn_lightpink_text_color" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
app:backgroundTint="@color/btn_lightpink_background" /> |
|
||||
</androidx.appcompat.widget.LinearLayoutCompat> |
|
||||
|
|
||||
|
|
||||
<androidx.recyclerview.widget.RecyclerView |
|
||||
android:id="@+id/highlightsList" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/myActions" |
|
||||
android:clipToPadding="false" |
|
||||
android:orientation="horizontal" |
|
||||
android:paddingStart="5dp" |
|
||||
android:paddingLeft="5dp" |
|
||||
android:paddingEnd="5dp" |
|
||||
android:paddingRight="5dp" |
|
||||
android:visibility="gone" /> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:id="@+id/profileInfo" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:orientation="horizontal" |
|
||||
android:padding="@dimen/profile_info_container_bottom_space"> |
|
||||
|
|
||||
<awais.instagrabber.customviews.CircularImageView |
|
||||
android:id="@+id/mainProfileImage" |
|
||||
android:layout_width="@dimen/profile_picture_size" |
|
||||
android:layout_height="@dimen/profile_picture_size" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/mainPostCount" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="12dp" |
|
||||
android:layout_marginLeft="12dp" |
|
||||
android:layout_marginEnd="12dp" |
|
||||
android:layout_marginRight="12dp" |
|
||||
android:layout_weight="1" |
|
||||
android:gravity="center" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" |
|
||||
android:textSize="15sp" |
|
||||
tools:text="35\nPosts" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/mainFollowers" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_weight="1" |
|
||||
android:background="?selectableItemBackgroundBorderless" |
|
||||
android:gravity="center" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" |
|
||||
android:textSize="15sp" |
|
||||
tools:text="68\nFollowers" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/mainFollowing" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="12dp" |
|
||||
android:layout_marginLeft="12dp" |
|
||||
android:layout_marginEnd="12dp" |
|
||||
android:layout_marginRight="12dp" |
|
||||
android:layout_weight="1" |
|
||||
android:background="?selectableItemBackgroundBorderless" |
|
||||
android:gravity="center" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" |
|
||||
android:textSize="15sp" |
|
||||
tools:text="64\nFollowing" /> |
|
||||
</LinearLayout> |
|
||||
</RelativeLayout> |
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout> |
|
||||
|
|
||||
<!-- for hashtags --> |
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:id="@+id/tagInfoContainer" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:orientation="horizontal" |
|
||||
android:padding="@dimen/profile_info_container_bottom_space" |
|
||||
android:visibility="gone"> |
|
||||
|
|
||||
<awais.instagrabber.customviews.CircularImageView |
|
||||
android:id="@+id/mainHashtagImage" |
|
||||
android:layout_width="@dimen/profile_picture_size" |
|
||||
android:layout_height="@dimen/profile_picture_size" |
|
||||
android:adjustViewBounds="true" |
|
||||
android:background="?selectableItemBackgroundBorderless" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/mainTagPostCount" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="12dp" |
|
||||
android:layout_marginLeft="12dp" |
|
||||
android:layout_marginEnd="12dp" |
|
||||
android:layout_marginRight="12dp" |
|
||||
android:layout_weight="1" |
|
||||
android:gravity="center" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" |
|
||||
android:textSize="15sp" |
|
||||
tools:text="35\nPosts" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnFollowTag" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_gravity="center_vertical" |
|
||||
android:layout_weight="2" |
|
||||
android:text="@string/follow" |
|
||||
android:textColor="@color/btn_pink_text_color" |
|
||||
android:textSize="20sp" |
|
||||
app:backgroundTint="@color/btn_pink_background" /> |
|
||||
</LinearLayout> |
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout> |
|
||||
|
|
||||
<!-- for locations --> |
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"> |
|
||||
|
|
||||
<RelativeLayout |
|
||||
android:id="@+id/locInfoContainer" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:animateLayoutChanges="true" |
|
||||
android:background="@null" |
|
||||
android:orientation="vertical" |
|
||||
android:paddingBottom="5dp" |
|
||||
android:visibility="gone"> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:id="@+id/locInfo" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:orientation="horizontal" |
|
||||
android:padding="@dimen/profile_info_container_bottom_space"> |
|
||||
|
|
||||
<awais.instagrabber.customviews.CircularImageView |
|
||||
android:id="@+id/mainLocationImage" |
|
||||
android:layout_width="@dimen/profile_picture_size" |
|
||||
android:layout_height="@dimen/profile_picture_size" |
|
||||
android:adjustViewBounds="true" |
|
||||
android:background="?selectableItemBackgroundBorderless" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/mainLocPostCount" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="match_parent" |
|
||||
android:layout_marginStart="12dp" |
|
||||
android:layout_marginLeft="12dp" |
|
||||
android:layout_marginEnd="12dp" |
|
||||
android:layout_marginRight="12dp" |
|
||||
android:layout_weight="1" |
|
||||
android:gravity="center" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" |
|
||||
android:textSize="15sp" |
|
||||
tools:text="35\nPosts" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatButton |
|
||||
android:id="@+id/btnMap" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_gravity="center_vertical" |
|
||||
android:layout_weight="2" |
|
||||
android:text="@string/map" |
|
||||
android:textColor="@color/btn_green_text_color" |
|
||||
android:textSize="20sp" |
|
||||
app:backgroundTint="@color/btn_green_background" /> |
|
||||
</LinearLayout> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/locationFullName" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/locInfo" |
|
||||
android:layout_weight="1" |
|
||||
android:ellipsize="marquee" |
|
||||
android:paddingStart="10dp" |
|
||||
android:paddingLeft="10dp" |
|
||||
android:paddingEnd="10dp" |
|
||||
android:paddingRight="10dp" |
|
||||
android:singleLine="true" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" |
|
||||
android:textSize="16sp" |
|
||||
tools:text="OUR HOUSE" /> |
|
||||
|
|
||||
<awais.instagrabber.customviews.RamboTextView |
|
||||
android:id="@+id/locationBiography" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/locationFullName" |
|
||||
android:background="?android:selectableItemBackground" |
|
||||
android:paddingStart="10dp" |
|
||||
android:paddingLeft="10dp" |
|
||||
android:paddingEnd="10dp" |
|
||||
android:paddingRight="10dp" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
tools:text="IN THE MIDDLE OF OUR STREET" /> |
|
||||
|
|
||||
<awais.instagrabber.customviews.RamboTextView |
|
||||
android:id="@+id/locationUrl" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_below="@id/locationBiography" |
|
||||
android:ellipsize="marquee" |
|
||||
android:paddingStart="10dp" |
|
||||
android:paddingLeft="10dp" |
|
||||
android:paddingEnd="10dp" |
|
||||
android:paddingRight="10dp" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" |
|
||||
android:textSize="16sp" |
|
||||
android:visibility="gone" |
|
||||
tools:text="https://austinhuang.me/" /> |
|
||||
</RelativeLayout> |
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout> |
|
||||
</com.google.android.material.appbar.AppBarLayout> |
|
||||
|
|
||||
<FrameLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> |
|
||||
|
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
|
||||
android:id="@+id/swipeRefreshLayout" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content"> |
|
||||
|
|
||||
<androidx.recyclerview.widget.RecyclerView |
|
||||
android:id="@+id/mainPosts" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:clipToPadding="false" |
|
||||
tools:listitem="@layout/item_post" /> |
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:id="@+id/privatePage" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_marginTop="@dimen/private_page_margins" |
|
||||
android:gravity="center" |
|
||||
android:orientation="vertical" |
|
||||
android:paddingTop="40dp" |
|
||||
android:visibility="gone"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:id="@+id/privatePage1" |
|
||||
android:layout_width="@dimen/private_page_margins" |
|
||||
android:layout_height="@dimen/private_page_margins" |
|
||||
app:srcCompat="@drawable/lock" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/privatePage2" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:gravity="center" |
|
||||
android:text="@string/priv_acc" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" |
|
||||
android:textSize="28sp" /> |
|
||||
</LinearLayout> |
|
||||
</FrameLayout> |
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout> |
|
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"> |
||||
|
|
||||
|
<item |
||||
|
android:id="@+id/layout" |
||||
|
android:title="@string/layout" |
||||
|
app:showAsAction="never" /> |
||||
|
</menu> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue