changed profile page to constraintlayout, added blurry toolbar to profile editor, bug fix, removed unused resources

This commit is contained in:
nuclearfog 2021-01-23 00:11:53 +01:00
parent b78a22a11e
commit 5cb127ec05
No known key found for this signature in database
GPG Key ID: D5490E4A81F97B14
6 changed files with 252 additions and 195 deletions

View File

@ -28,6 +28,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import org.nuclearfog.twidda.R;
@ -41,7 +42,8 @@ import org.nuclearfog.twidda.backend.utils.DialogBuilder.OnDialogClick;
import org.nuclearfog.twidda.backend.utils.ErrorHandler;
import org.nuclearfog.twidda.database.GlobalSettings;
import jp.wasabeef.picasso.transformations.BlurTransformation;
import java.io.File;
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
@ -53,6 +55,7 @@ import static android.view.Window.FEATURE_NO_TITLE;
import static android.widget.Toast.LENGTH_SHORT;
import static org.nuclearfog.twidda.activity.UserProfile.RETURN_PROFILE_CHANGED;
import static org.nuclearfog.twidda.activity.UserProfile.RETURN_PROFILE_DATA;
import static org.nuclearfog.twidda.activity.UserProfile.TOOLBAR_TRANSPARENCY;
import static org.nuclearfog.twidda.backend.utils.DialogBuilder.DialogType.PROFILE_EDIT_LEAVE;
import static org.nuclearfog.twidda.database.GlobalSettings.BANNER_IMG_MID_RES;
import static org.nuclearfog.twidda.database.GlobalSettings.PROFILE_IMG_HIGH_RES;
@ -60,7 +63,7 @@ import static org.nuclearfog.twidda.database.GlobalSettings.PROFILE_IMG_HIGH_RES
/**
* Activity for Twitter profile editor
*/
public class ProfileEditor extends AppCompatActivity implements OnClickListener, OnDismissListener, OnDialogClick {
public class ProfileEditor extends AppCompatActivity implements OnClickListener, OnDismissListener, OnDialogClick, Callback {
/**
* key to preload user data
@ -132,6 +135,8 @@ public class ProfileEditor extends AppCompatActivity implements OnClickListener,
setSupportActionBar(toolbar);
settings = GlobalSettings.getInstance(this);
toolbar.setBackgroundColor(settings.getBackgroundColor() & TOOLBAR_TRANSPARENCY);
profile_banner.setDrawingCacheEnabled(true);
AppStyles.setTheme(settings, root);
closeDialog = DialogBuilder.create(this, PROFILE_EDIT_LEAVE, this);
@ -218,20 +223,18 @@ public class ProfileEditor extends AppCompatActivity implements OnClickListener,
Cursor c = getContentResolver().query(intent.getData(), MEDIA_MODE, null, null, null);
if (c != null) {
if (c.moveToFirst()) {
int index = c.getColumnIndex(MEDIA_MODE[0]);
String mediaPath = c.getString(index);
Bitmap image = BitmapFactory.decodeFile(mediaPath);
String mediaPath = c.getString(0);
if (reqCode == REQ_PROFILE_IMG) {
// Add image as profile image
Bitmap image = BitmapFactory.decodeFile(mediaPath);
profile_image.setImageBitmap(image);
profileLink = mediaPath;
} else {
// Add image as banner image
int bannerHeight = profile_banner.getMeasuredWidth() / 3;
if (bannerHeight > 0)
profile_banner.setMaxHeight(bannerHeight);
profile_banner.setImageBitmap(image);
File img = new File(mediaPath);
Point displaySize = new Point();
getWindowManager().getDefaultDisplay().getSize(displaySize);
Picasso.get().load(img).resize(displaySize.x, displaySize.x / 3).centerCrop(Gravity.TOP).into(profile_banner, this);
addBannerBtn.setVisibility(INVISIBLE);
changeBannerBtn.setVisibility(VISIBLE);
bannerLink = mediaPath;
@ -277,6 +280,18 @@ public class ProfileEditor extends AppCompatActivity implements OnClickListener,
}
}
@Override
public void onSuccess() {
AppStyles.setToolbarBackground(ProfileEditor.this, profile_banner, toolbar_background);
}
@Override
public void onError(Exception e) {
}
/**
* enable or disable loading dialog
*
@ -322,12 +337,7 @@ public class ProfileEditor extends AppCompatActivity implements OnClickListener,
}
if (user.hasBannerImage()) {
String bnLink = user.getBannerLink() + BANNER_IMG_MID_RES;
Point displaySize = new Point();
getWindowManager().getDefaultDisplay().getSize(displaySize);
int toolbarHeight = (int) getResources().getDimension(R.dimen.profile_toolbar_height);
Picasso.get().load(bnLink).into(profile_banner);
Picasso.get().load(bnLink).resize(displaySize.x, toolbarHeight).centerCrop(Gravity.TOP)
.transform(new BlurTransformation(this, 10)).into(toolbar_background);
Picasso.get().load(bnLink).into(profile_banner, this);
addBannerBtn.setVisibility(INVISIBLE);
changeBannerBtn.setVisibility(VISIBLE);
} else {

View File

@ -4,11 +4,9 @@ import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spanned;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -27,6 +25,7 @@ import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener;
import com.google.android.material.tabs.TabLayout.Tab;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import org.nuclearfog.tag.Tagger;
@ -47,7 +46,6 @@ import org.nuclearfog.twidda.database.GlobalSettings;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import jp.wasabeef.picasso.transformations.BlurTransformation;
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation;
import static android.content.Intent.ACTION_VIEW;
@ -123,18 +121,21 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
/**
* background color mask for TextView backgrounds
*/
private static final int TRANSPARENCY = 0xafffffff;
private static final int TEXT_TRANSPARENCY = 0xafffffff;
/**
* background color mask for toolbar background
*/
public static final int TOOLBAR_TRANSPARENCY = 0x5fffffff;
private Point displaySize;
private FragmentAdapter adapter;
private GlobalSettings settings;
private UserAction profileAsync;
private TextView[] tabTweetCount;
private TextView txtUser, txtScrName;
private TextView txtLocation, txtCreated, lnkTxt, bioTxt, follow_back;
private Button following, follower;
private TextView txtLocation, txtCreated, lnkTxt, bioTxt, follow_back, txtUser, txtScrName;
private ImageView profileImage, bannerImage, toolbarBackground;
private Button following, follower;
private View profile_head;
private ViewPager pager;
private TabLayout tabLayout;
@ -152,7 +153,6 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
setContentView(R.layout.page_profile);
Toolbar tool = findViewById(R.id.profile_toolbar);
View root = findViewById(R.id.user_view);
View profile_layer = findViewById(R.id.profile_layer);
tabLayout = findViewById(R.id.profile_tab);
bioTxt = findViewById(R.id.bio);
following = findViewById(R.id.following);
@ -169,14 +169,6 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
follow_back = findViewById(R.id.follow_back);
pager = findViewById(R.id.profile_pager);
displaySize = new Point();
getWindowManager().getDefaultDisplay().getSize(displaySize);
int layoutHeight = displaySize.x / 3;
int buttonHeight = (int) getResources().getDimension(R.dimen.profile_button_height);
int layerPadding = (int) getResources().getDimension(R.dimen.profile_layer_padding);
profile_layer.getLayoutParams().height = layoutHeight + buttonHeight + layerPadding;
profile_layer.requestLayout();
settings = GlobalSettings.getInstance(this);
following.setCompoundDrawablesWithIntrinsicBounds(R.drawable.following, 0, 0, 0);
follower.setCompoundDrawablesWithIntrinsicBounds(R.drawable.follower, 0, 0, 0);
@ -184,9 +176,10 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
txtLocation.setCompoundDrawablesWithIntrinsicBounds(R.drawable.userlocation, 0, 0, 0);
lnkTxt.setCompoundDrawablesWithIntrinsicBounds(R.drawable.link, 0, 0, 0);
follow_back.setCompoundDrawablesWithIntrinsicBounds(R.drawable.followback, 0, 0, 0);
txtUser.setBackgroundColor(settings.getBackgroundColor() & TRANSPARENCY);
txtScrName.setBackgroundColor(settings.getBackgroundColor() & TRANSPARENCY);
follow_back.setBackgroundColor(settings.getBackgroundColor() & TRANSPARENCY);
tool.setBackgroundColor(settings.getBackgroundColor() & TOOLBAR_TRANSPARENCY);
txtUser.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
txtScrName.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
follow_back.setBackgroundColor(settings.getBackgroundColor() & TEXT_TRANSPARENCY);
bioTxt.setMovementMethod(LinkAndScrollMovement.getInstance());
bioTxt.setLinkTextColor(settings.getHighlightColor());
AppStyles.setTheme(settings, root);
@ -602,11 +595,18 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
}
if (settings.getImageLoad()) {
if (user.hasBannerImage()) {
Callback callback = new Callback() {
@Override
public void onSuccess() {
AppStyles.setToolbarBackground(UserProfile.this, bannerImage, toolbarBackground);
}
@Override
public void onError(Exception e) {
}
};
String bannerLink = user.getBannerLink() + settings.getBannerSuffix();
Picasso.get().load(bannerLink).error(R.drawable.no_banner).into(bannerImage);
int toolbarHeight = (int) getResources().getDimension(R.dimen.profile_toolbar_height);
Picasso.get().load(bannerLink).resize(displaySize.x, toolbarHeight).centerCrop(Gravity.TOP)
.transform(new BlurTransformation(this, 10)).error(R.drawable.no_banner).into(toolbarBackground);
Picasso.get().load(bannerLink).error(R.drawable.no_banner).into(bannerImage, callback);
} else {
bannerImage.setImageResource(0);
}

View File

@ -1,9 +1,13 @@
package org.nuclearfog.twidda.backend.utils;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.view.Menu;
@ -27,6 +31,10 @@ import com.kyleduo.switchbutton.SwitchButton;
import org.nuclearfog.twidda.R;
import org.nuclearfog.twidda.database.GlobalSettings;
import jp.wasabeef.picasso.transformations.BlurTransformation;
import jp.wasabeef.picasso.transformations.CropTransformation;
import static android.graphics.Bitmap.Config.ARGB_8888;
import static android.graphics.PorterDuff.Mode.SRC_ATOP;
/**
@ -269,6 +277,21 @@ public final class AppStyles {
return tabs;
}
public static void setToolbarBackground(Activity activity, ImageView background, ImageView toolbarBackground) {
Point displaySize = new Point();
activity.getWindowManager().getDefaultDisplay().getSize(displaySize);
float toolbarRatio = displaySize.x / activity.getResources().getDimension(R.dimen.profile_toolbar_height);
Bitmap image = ((BitmapDrawable) background.getDrawable()).getBitmap();
BlurTransformation blur = new BlurTransformation(background.getContext(), 20);
CropTransformation crop = new CropTransformation(image.getWidth(), (int) (image.getWidth() / toolbarRatio),
CropTransformation.GravityHorizontal.CENTER, CropTransformation.GravityVertical.TOP);
Bitmap result = blur.transform(crop.transform(image.copy(ARGB_8888, true)));
toolbarBackground.setImageBitmap(result);
}
/**
* color drawable
*

View File

@ -6,7 +6,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -53,8 +55,8 @@
android:id="@+id/editprofile_toolbar_background"
android:layout_width="match_parent"
android:layout_height="@dimen/editprofile_toolbar_height"
app:layout_constraintBottom_toBottomOf="@+id/editprofile_toolbar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/edit_banner"
tools:ignore="ContentDescription" />
@ -71,9 +73,9 @@
android:id="@+id/edit_pb"
android:layout_width="@dimen/editprofile_image"
android:layout_height="@dimen/editprofile_image"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="30dp"
android:layout_marginStart="@dimen/editprofile_profile_image_left_margin"
android:layout_marginLeft="@dimen/editprofile_profile_image_left_margin"
android:layout_marginTop="@dimen/editprofile_profile_image_top_margin"
android:contentDescription="@string/image_preview"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="@+id/edit_banner"

View File

@ -17,184 +17,204 @@
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/profile_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="invisible">
<FrameLayout
android:id="@+id/profile_layer"
<ImageView
android:id="@+id/profile_banner"
android:layout_width="match_parent"
android:layout_height="180dp">
android:layout_height="0dp"
android:adjustViewBounds="true"
android:contentDescription="@string/profile_banner"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="3.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/profile_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/profile_banner"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/profile_toolbar_background"
android:layout_width="match_parent"
android:layout_height="@dimen/profile_toolbar_height"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/profile_toolbar_background"
android:layout_width="match_parent"
android:layout_height="@dimen/profile_toolbar_height"
android:gravity="top"
tools:ignore="ContentDescription" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/profile_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/profile_toolbar_height"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/profile_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/profile_toolbar_height"
android:gravity="top" />
<ImageView
android:id="@+id/profile_img"
android:layout_width="@dimen/profile_image"
android:layout_height="@dimen/profile_image"
android:layout_marginStart="@dimen/profile_image_padding_left"
android:layout_marginLeft="@dimen/profile_image_padding_left"
android:layout_marginTop="@dimen/profile_image_padding_top"
android:contentDescription="@string/profile_image"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/profile_toolbar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingLeft="@dimen/profile_layout_padding"
android:paddingRight="@dimen/profile_layout_padding">
<TextView
android:id="@+id/profile_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_username_margin"
android:layout_marginLeft="@dimen/profile_username_margin"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:drawablePadding="@dimen/profile_padding_drawable"
android:padding="@dimen/profile_tv_padding"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_big"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/profile_img"
app:layout_constraintTop_toTopOf="@+id/profile_img" />
<ImageView
android:id="@+id/profile_img"
android:layout_width="@dimen/profile_image"
android:layout_height="@dimen/profile_image"
android:contentDescription="@string/profile_image" />
<TextView
android:id="@+id/profile_screenname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_username_margin"
android:layout_marginLeft="@dimen/profile_username_margin"
android:drawablePadding="@dimen/profile_padding_drawable"
android:padding="@dimen/profile_tv_padding"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_big"
app:layout_constraintStart_toEndOf="@+id/profile_img"
app:layout_constraintTop_toBottomOf="@+id/profile_username" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_layout_margin"
android:layout_marginLeft="@dimen/profile_layout_margin"
android:orientation="vertical">
<TextView
android:id="@+id/profile_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/profile_padding_drawable"
android:padding="@dimen/profile_tv_padding"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_big" />
<TextView
android:id="@+id/follow_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_tv_margin"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:drawablePadding="@dimen/profile_padding_drawable"
android:padding="@dimen/profile_tv_padding"
android:singleLine="true"
android:text="@string/follows_you"
android:textSize="@dimen/profile_textsize_big"
android:visibility="invisible"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/profile_screenname"
app:layout_constraintTop_toBottomOf="@+id/profile_username" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/following"
style="@style/FeedbackButton"
android:layout_width="0dp"
android:layout_height="@dimen/profile_button_height"
android:layout_marginStart="@dimen/profile_button_margin"
android:layout_marginLeft="@dimen/profile_button_margin"
android:layout_marginTop="@dimen/profile_button_margin"
android:layout_marginEnd="@dimen/profile_button_margin"
android:layout_marginRight="@dimen/profile_button_margin"
android:paddingLeft="@dimen/profile_button_padding"
android:paddingRight="@dimen/profile_button_padding"
app:layout_constraintBottom_toBottomOf="@+id/profile_img"
app:layout_constraintEnd_toStartOf="@+id/follower"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/profile_img"
app:layout_constraintTop_toBottomOf="@+id/profile_banner" />
<TextView
android:id="@+id/profile_screenname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/profile_padding_drawable"
android:padding="@dimen/profile_tv_padding"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_big" />
<TextView
android:id="@+id/follow_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/profile_padding_drawable"
android:padding="@dimen/profile_tv_padding"
android:singleLine="true"
android:text="@string/follows_you"
android:textSize="@dimen/profile_textsize_big"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/profile_layout_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<Button
android:id="@+id/following"
style="@style/FeedbackButton"
android:layout_width="0dp"
android:layout_height="@dimen/profile_button_height"
android:layout_marginLeft="@dimen/profile_button_margin"
android:layout_marginRight="@dimen/profile_button_margin"
android:layout_weight="1"
android:paddingLeft="@dimen/profile_button_padding"
android:paddingRight="@dimen/profile_button_padding" />
<Button
android:id="@+id/follower"
style="@style/FeedbackButton"
android:layout_width="0dp"
android:layout_height="@dimen/profile_button_height"
android:layout_marginLeft="@dimen/profile_button_margin"
android:layout_marginRight="@dimen/profile_button_margin"
android:layout_weight="1"
android:paddingLeft="@dimen/profile_button_padding"
android:paddingRight="@dimen/profile_button_padding" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
<Button
android:id="@+id/follower"
style="@style/FeedbackButton"
android:layout_width="0dp"
android:layout_height="@dimen/profile_button_height"
android:layout_marginStart="@dimen/profile_button_margin"
android:layout_marginLeft="@dimen/profile_button_margin"
android:layout_marginTop="@dimen/profile_button_margin"
android:layout_marginEnd="@dimen/profile_button_margin"
android:layout_marginRight="@dimen/profile_button_margin"
android:paddingLeft="@dimen/profile_button_padding"
android:paddingRight="@dimen/profile_button_padding"
app:layout_constraintBottom_toBottomOf="@+id/profile_img"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/following"
app:layout_constraintTop_toBottomOf="@+id/profile_banner" />
<TextView
android:id="@+id/bio"
android:layout_width="match_parent"
android:layout_width="403dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_tv_margin"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:layout_marginRight="@dimen/profile_tv_margin"
android:layout_marginTop="@dimen/profile_tv_margin"
android:fadeScrollbars="false"
android:linksClickable="true"
android:maxLines="@integer/profile_text_bio_lines"
android:scrollbars="vertical" />
android:scrollbars="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/profile_img" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/location"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:layout_marginRight="@dimen/profile_tv_margin"
android:layout_weight="1"
android:drawablePadding="@dimen/profile_padding_drawable"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_small" />
<TextView
android:id="@+id/links"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:layout_marginRight="@dimen/profile_tv_margin"
android:layout_weight="1"
android:drawablePadding="@dimen/profile_padding_drawable"
android:linksClickable="true"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_small" />
</LinearLayout>
<TextView
android:id="@+id/profile_date"
android:layout_width="match_parent"
android:id="@+id/location"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_tv_margin"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:layout_marginTop="@dimen/profile_tv_margin"
android:layout_marginEnd="@dimen/profile_tv_margin"
android:layout_marginRight="@dimen/profile_tv_margin"
android:drawablePadding="@dimen/profile_padding_drawable"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_small" />
android:textSize="@dimen/profile_textsize_small"
app:layout_constraintEnd_toStartOf="@+id/links"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bio" />
</LinearLayout>
<TextView
android:id="@+id/links"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_tv_margin"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:layout_marginTop="@dimen/profile_tv_margin"
android:layout_marginEnd="@dimen/profile_tv_margin"
android:layout_marginRight="@dimen/profile_tv_margin"
android:drawablePadding="@dimen/profile_padding_drawable"
android:linksClickable="true"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/location"
app:layout_constraintTop_toBottomOf="@+id/bio" />
<TextView
android:id="@+id/profile_date"
android:layout_width="403dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/profile_tv_margin"
android:layout_marginLeft="@dimen/profile_tv_margin"
android:layout_marginTop="@dimen/profile_tv_margin"
android:layout_marginEnd="@dimen/profile_tv_margin"
android:layout_marginRight="@dimen/profile_tv_margin"
android:drawablePadding="@dimen/profile_padding_drawable"
android:singleLine="true"
android:textSize="@dimen/profile_textsize_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/location" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>

View File

@ -44,17 +44,17 @@
<!--dimens of page_profile.xml-->
<dimen name="profile_toolbar_height">@dimen/toolbar_height</dimen>
<dimen name="profile_image">80dp</dimen>
<dimen name="profile_image_padding_left">10dp</dimen>
<dimen name="profile_image_padding_top">30dp</dimen>
<dimen name="profile_tv_margin">5dp</dimen>
<dimen name="profile_tv_padding">2dp</dimen>
<dimen name="profile_layout_margin">5dp</dimen>
<dimen name="profile_layout_padding">10dp</dimen>
<dimen name="profile_username_margin">24dp</dimen>
<dimen name="profile_padding_drawable">5dp</dimen>
<dimen name="profile_button_height">20sp</dimen>
<dimen name="profile_button_margin">5dp</dimen>
<dimen name="profile_button_padding">5dp</dimen>
<dimen name="profile_textsize_big">14sp</dimen>
<dimen name="profile_textsize_small">12sp</dimen>
<dimen name="profile_layer_padding">5dp</dimen>
<integer name="profile_text_bio_lines">3</integer>
<!--dimens of page_editprofile.xml-->
@ -66,6 +66,8 @@
<dimen name="editprofile_bio_min_height">150dp</dimen>
<dimen name="editprofile_toolbar_height">@dimen/toolbar_height</dimen>
<dimen name="editprofile_add_btn_size">40dp</dimen>
<dimen name="editprofile_profile_image_left_margin">10dp</dimen>
<dimen name="editprofile_profile_image_top_margin">30dp</dimen>
<dimen name="editprofile_image_layer_height">180dp</dimen>
<integer name="editprofile_username_max_length">50</integer>