mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
avatars improvements
This commit is contained in:
parent
3c8fb5bc60
commit
3ebc1ae3e0
@ -357,7 +357,7 @@ public class IssueDetailActivity extends AppCompatActivity {
|
||||
tinyDb.putString("issueState", singleIssue.getState());
|
||||
tinyDb.putString("issueTitle", singleIssue.getTitle());
|
||||
|
||||
Picasso.get().load(singleIssue.getUser().getAvatar_url()).transform(new RoundedTransformation(100, 0)).resize(200, 200).centerCrop().into(assigneeAvatar);
|
||||
Picasso.get().load(singleIssue.getUser().getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(assigneeAvatar);
|
||||
issueTitle.setText(getString(R.string.issueTitleWithId, singleIssue.getNumber(), singleIssue.getTitle()));
|
||||
String cleanIssueDescription = singleIssue.getBody().trim();
|
||||
Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(cleanIssueDescription));
|
||||
@ -374,7 +374,7 @@ public class IssueDetailActivity extends AppCompatActivity {
|
||||
|
||||
ImageView assigneesView = new ImageView(getApplicationContext());
|
||||
|
||||
Picasso.get().load(singleIssue.getAssignees().get(i).getAvatar_url()).transform(new RoundedTransformation(100, 0)).resize(80, 80).centerCrop().into(assigneesView);
|
||||
Picasso.get().load(singleIssue.getAssignees().get(i).getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(100, 100).centerCrop().into(assigneesView);
|
||||
|
||||
assigneesLayout.addView(assigneesView);
|
||||
assigneesView.setLayoutParams(params1);
|
||||
|
@ -148,7 +148,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||
|
||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
||||
if (!userAvatarNav.equals("")) {
|
||||
Picasso.get().load(userAvatarNav).networkPolicy(NetworkPolicy.OFFLINE).transform(new RoundedTransformation(100, 0)).resize(180, 180).centerCrop().into(userAvatar);
|
||||
Picasso.get().load(userAvatarNav).networkPolicy(NetworkPolicy.OFFLINE).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(userAvatar);
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -354,7 +354,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||
|
||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
||||
if (!Objects.requireNonNull(userDetails).getAvatar().equals("")) {
|
||||
Picasso.get().load(userDetails.getAvatar()).transform(new RoundedTransformation(100, 0)).resize(180, 180).centerCrop().into(userAvatar);
|
||||
Picasso.get().load(userDetails.getAvatar()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(userAvatar);
|
||||
} else {
|
||||
userAvatar.setImageResource(R.mipmap.ic_launcher_round);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import com.vdurmont.emoji.EmojiParser;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.ReplyToIssueActivity;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.helpers.UserMentions;
|
||||
import org.mian.gitnex.models.IssueComments;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
@ -178,9 +179,9 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
||||
}
|
||||
|
||||
if (currentItem.getUser().getAvatar_url() != null) {
|
||||
Picasso.get().load(currentItem.getUser().getAvatar_url()).transform(new RoundedTransformation(100, 0)).resize(200, 200).centerCrop().into(holder.issueCommenterAvatar);
|
||||
Picasso.get().load(currentItem.getUser().getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.issueCommenterAvatar);
|
||||
} else {
|
||||
Picasso.get().load(currentItem.getUser().getAvatar_url()).transform(new RoundedTransformation(100, 0)).resize(200, 200).centerCrop().into(holder.issueCommenterAvatar);
|
||||
Picasso.get().load(currentItem.getUser().getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.issueCommenterAvatar);
|
||||
}
|
||||
|
||||
String cleanIssueComments = currentItem.getBody().trim();
|
||||
@ -243,7 +244,7 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
|
||||
.build();
|
||||
|
||||
Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(cleanIssueComments));
|
||||
markwon.setParsedMarkdown(holder.issueComment, bodyWithMD);
|
||||
markwon.setParsedMarkdown(holder.issueComment, UserMentions.UserMentionsFunc(mCtx, bodyWithMD, cleanIssueComments));
|
||||
|
||||
String edited;
|
||||
|
||||
|
@ -165,17 +165,17 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
|
||||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(currentItem.getName());
|
||||
String charac = String.valueOf(currentItem.getName().charAt(0));
|
||||
String firstCharacter = String.valueOf(currentItem.getName().charAt(0));
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
.useFont(Typeface.DEFAULT)
|
||||
.fontSize(16)
|
||||
.fontSize(18)
|
||||
.toUpperCase()
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRound(charac, color);
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
|
||||
holder.imageMy.setImageDrawable(drawable);
|
||||
holder.mTextView1My.setText(currentItem.getName());
|
||||
|
@ -79,7 +79,7 @@ public class OrganizationsListAdapter extends RecyclerView.Adapter<Organizations
|
||||
UserOrganizations currentItem = orgList.get(position);
|
||||
holder.mTextView2.setVisibility(View.GONE);
|
||||
|
||||
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(100, 0)).resize(200, 200).centerCrop().into(holder.image);
|
||||
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.image);
|
||||
holder.mTextView1.setText(currentItem.getUsername());
|
||||
if (!currentItem.getDescription().equals("")) {
|
||||
holder.mTextView2.setVisibility(View.VISIBLE);
|
||||
|
@ -65,7 +65,7 @@ public class ProfileFollowersAdapter extends RecyclerView.Adapter<ProfileFollowe
|
||||
holder.userName.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
Picasso.get().load(currentItem.getAvatar()).transform(new RoundedTransformation(100, 0)).resize(140, 140).centerCrop().into(holder.userAvatar);
|
||||
Picasso.get().load(currentItem.getAvatar()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.userAvatar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -65,7 +65,7 @@ public class ProfileFollowingAdapter extends RecyclerView.Adapter<ProfileFollowi
|
||||
holder.userName.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
Picasso.get().load(currentItem.getAvatar()).transform(new RoundedTransformation(100, 0)).resize(140, 140).centerCrop().into(holder.userAvatar);
|
||||
Picasso.get().load(currentItem.getAvatar()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.userAvatar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -167,17 +167,17 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
|
||||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(currentItem.getName());
|
||||
String charac = String.valueOf(currentItem.getName().charAt(0));
|
||||
String firstCharacter = String.valueOf(currentItem.getName().charAt(0));
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
.useFont(Typeface.DEFAULT)
|
||||
.fontSize(16)
|
||||
.fontSize(18)
|
||||
.toUpperCase()
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRound(charac, color);
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
|
||||
holder.image.setImageDrawable(drawable);
|
||||
holder.mTextView1.setText(currentItem.getName());
|
||||
|
@ -166,17 +166,17 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
|
||||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(currentItem.getName());
|
||||
String charac = String.valueOf(currentItem.getName().charAt(0));
|
||||
String firstCharacter = String.valueOf(currentItem.getName().charAt(0));
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
.useFont(Typeface.DEFAULT)
|
||||
.fontSize(16)
|
||||
.fontSize(18)
|
||||
.toUpperCase()
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRound(charac, color);
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
|
||||
holder.image.setImageDrawable(drawable);
|
||||
holder.mTextView1.setText(currentItem.getName());
|
||||
|
@ -166,17 +166,17 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
|
||||
ColorGenerator generator = ColorGenerator.MATERIAL;
|
||||
int color = generator.getColor(currentItem.getName());
|
||||
String charac = String.valueOf(currentItem.getName().charAt(0));
|
||||
String firstCharacter = String.valueOf(currentItem.getName().charAt(0));
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
.useFont(Typeface.DEFAULT)
|
||||
.fontSize(16)
|
||||
.fontSize(18)
|
||||
.toUpperCase()
|
||||
.width(28)
|
||||
.height(28)
|
||||
.endConfig()
|
||||
.buildRound(charac, color);
|
||||
.buildRoundRect(firstCharacter, color, 4);
|
||||
|
||||
holder.image.setImageDrawable(drawable);
|
||||
holder.mTextView1.setText(currentItem.getName());
|
||||
|
@ -104,7 +104,7 @@ public class OrganizationInfoFragment extends Fragment {
|
||||
if (response.code() == 200) {
|
||||
|
||||
assert orgInfo != null;
|
||||
Picasso.get().load(orgInfo.getAvatar_url()).transform(new RoundedTransformation(100, 0)).resize(200, 200).centerCrop().into(orgAvatar);
|
||||
Picasso.get().load(orgInfo.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(180, 180).centerCrop().into(orgAvatar);
|
||||
orgDescInfo.setText(orgInfo.getDescription());
|
||||
orgWebsiteInfo.setText(orgInfo.getWebsite());
|
||||
orgLocationInfo.setText(orgInfo.getLocation());
|
||||
|
@ -48,7 +48,7 @@ public class ProfileFragment extends Fragment {
|
||||
TextView userEmail = v.findViewById(R.id.userEmail);
|
||||
|
||||
userFullName.setText(tinyDb.getString("userFullname"));
|
||||
Picasso.get().load(tinyDb.getString("userAvatar")).transform(new RoundedTransformation(100, 0)).resize(180, 180).centerCrop().into(userAvatar);
|
||||
Picasso.get().load(tinyDb.getString("userAvatar")).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(userAvatar);
|
||||
userLogin.setText(getString(R.string.usernameWithAt, tinyDb.getString("userLogin")));
|
||||
userEmail.setText(tinyDb.getString("userEmail"));
|
||||
|
||||
|
@ -51,6 +51,7 @@
|
||||
android:id="@+id/assigneeAvatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
@ -182,7 +183,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/divider" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -23,6 +23,8 @@
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:contentDescription="@string/logo"
|
||||
android:src="@mipmap/app_logo_round" />
|
||||
|
||||
|
@ -34,6 +34,8 @@
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/repoContentAvatar"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
@ -52,8 +53,9 @@
|
||||
android:layout_weight=".05"
|
||||
android:id="@+id/imageRepoTypeMy"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/privateAvatar"
|
||||
android:src="@drawable/ic_lock_bold" />
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
android:src="@drawable/ic_android"
|
||||
android:maxHeight="24dp"
|
||||
android:maxWidth="24dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:contentDescription="@string/app_name"/>
|
||||
|
@ -22,6 +22,8 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:src="@drawable/ic_android"
|
||||
android:contentDescription="@string/orgContentAvatar"/>
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:contentDescription="@string/repoContentAvatar"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
<LinearLayout
|
||||
@ -52,8 +53,9 @@
|
||||
android:layout_weight=".05"
|
||||
android:id="@+id/imageRepoType"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/privateAvatar"
|
||||
android:src="@drawable/ic_lock_24dp" />
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/repoContentAvatar"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
@ -52,8 +53,9 @@
|
||||
android:layout_weight=".05"
|
||||
android:id="@+id/imageRepoType"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/privateAvatar"
|
||||
android:src="@drawable/ic_lock_24dp" />
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/repoContentAvatar"
|
||||
android:src="@drawable/ic_android" />
|
||||
|
||||
@ -52,8 +53,9 @@
|
||||
android:layout_weight=".05"
|
||||
android:id="@+id/imageRepoType"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="5dp"
|
||||
android:contentDescription="@string/privateAvatar"
|
||||
android:src="@drawable/ic_lock_24dp" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user