change avatar size in details screens depedning on screen width
This commit is contained in:
parent
a934054038
commit
a623e6f70a
|
@ -610,16 +610,20 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
||||||
this.binding.editMucNameButton.setVisibility((self.getAffiliation().ranks(MucOptions.Affiliation.OWNER) || mucOptions.canChangeSubject()) ? View.VISIBLE : View.GONE);
|
this.binding.editMucNameButton.setVisibility((self.getAffiliation().ranks(MucOptions.Affiliation.OWNER) || mucOptions.canChangeSubject()) ? View.VISIBLE : View.GONE);
|
||||||
this.binding.detailsAccount.setText(getString(R.string.using_account, account));
|
this.binding.detailsAccount.setText(getString(R.string.using_account, account));
|
||||||
this.binding.jid.setText(mConversation.getJid().asBareJid().toEscapedString());
|
this.binding.jid.setText(mConversation.getJid().asBareJid().toEscapedString());
|
||||||
this.binding.yourPhoto.setImageBitmap(avatarService().get(mConversation, getPixel(72)));
|
this.binding.yourPhoto.setImageBitmap(avatarService().get(mConversation,(int) getResources().getDimension(R.dimen.avatar_on_details_screen_size)));
|
||||||
String roomName = mucOptions.getName();
|
String roomName = mucOptions.getName();
|
||||||
String subject = mucOptions.getSubject();
|
String subject = mucOptions.getSubject();
|
||||||
|
final boolean hasTitle;
|
||||||
if (printableValue(roomName)) {
|
if (printableValue(roomName)) {
|
||||||
this.binding.mucTitle.setText(roomName);
|
this.binding.mucTitle.setText(roomName);
|
||||||
this.binding.mucTitle.setVisibility(View.VISIBLE);
|
this.binding.mucTitle.setVisibility(View.VISIBLE);
|
||||||
|
hasTitle = true;
|
||||||
} else if (!printableValue(subject)) {
|
} else if (!printableValue(subject)) {
|
||||||
this.binding.mucTitle.setText(EmojiWrapper.transform(mConversation.getName()));
|
this.binding.mucTitle.setText(EmojiWrapper.transform(mConversation.getName()));
|
||||||
|
hasTitle = true;
|
||||||
this.binding.mucTitle.setVisibility(View.VISIBLE);
|
this.binding.mucTitle.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
hasTitle = false;
|
||||||
this.binding.mucTitle.setVisibility(View.GONE);
|
this.binding.mucTitle.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (printableValue(subject)) {
|
if (printableValue(subject)) {
|
||||||
|
@ -627,7 +631,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
||||||
StylingHelper.format(spannable, this.binding.mucSubject.getCurrentTextColor());
|
StylingHelper.format(spannable, this.binding.mucSubject.getCurrentTextColor());
|
||||||
MyLinkify.addLinks(spannable, false);
|
MyLinkify.addLinks(spannable, false);
|
||||||
this.binding.mucSubject.setText(EmojiWrapper.transform(spannable));
|
this.binding.mucSubject.setText(EmojiWrapper.transform(spannable));
|
||||||
this.binding.mucSubject.setTextAppearance(this,subject.length() > 120 ? R.style.TextAppearance_Conversations_Body1_Linkified : R.style.TextAppearance_Conversations_Subhead);
|
this.binding.mucSubject.setTextAppearance(this,subject.length() > (hasTitle ? 128 : 196) ? R.style.TextAppearance_Conversations_Body1_Linkified : R.style.TextAppearance_Conversations_Subhead);
|
||||||
this.binding.mucSubject.setAutoLinkMask(0);
|
this.binding.mucSubject.setAutoLinkMask(0);
|
||||||
this.binding.mucSubject.setVisibility(View.VISIBLE);
|
this.binding.mucSubject.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -816,6 +820,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
|
if (mConversation == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final MucOptions mucOptions = mConversation.getMucOptions();
|
final MucOptions mucOptions = mConversation.getMucOptions();
|
||||||
if (this.binding.mucEditor.getVisibility() == View.VISIBLE) {
|
if (this.binding.mucEditor.getVisibility() == View.VISIBLE) {
|
||||||
boolean subjectChanged = changed(binding.mucEditSubject.getEditableText().toString(), mucOptions.getSubject());
|
boolean subjectChanged = changed(binding.mucEditSubject.getEditableText().toString(), mucOptions.getSubject());
|
||||||
|
|
|
@ -374,7 +374,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
||||||
account = contact.getAccount().getJid().asBareJid().toString();
|
account = contact.getAccount().getJid().asBareJid().toString();
|
||||||
}
|
}
|
||||||
binding.detailsAccount.setText(getString(R.string.using_account, account));
|
binding.detailsAccount.setText(getString(R.string.using_account, account));
|
||||||
binding.detailsContactBadge.setImageBitmap(avatarService().get(contact, getPixel(72)));
|
binding.detailsContactBadge.setImageBitmap(avatarService().get(contact, (int) getResources().getDimension(R.dimen.avatar_on_details_screen_size)));
|
||||||
binding.detailsContactBadge.setOnClickListener(this.onBadgeClick);
|
binding.detailsContactBadge.setOnClickListener(this.onBadgeClick);
|
||||||
|
|
||||||
binding.detailsContactKeys.removeAllViews();
|
binding.detailsContactKeys.removeAllViews();
|
||||||
|
|
|
@ -952,7 +952,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
|
||||||
|
|
||||||
if (!mInitMode) {
|
if (!mInitMode) {
|
||||||
this.mAvatar.setVisibility(View.VISIBLE);
|
this.mAvatar.setVisibility(View.VISIBLE);
|
||||||
this.mAvatar.setImageBitmap(avatarService().get(this.mAccount, getPixel(72)));
|
this.mAvatar.setImageBitmap(avatarService().get(this.mAccount, (int) getResources().getDimension(R.dimen.avatar_on_details_screen_size)));
|
||||||
} else {
|
} else {
|
||||||
this.mAvatar.setVisibility(View.GONE);
|
this.mAvatar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,10 +170,10 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC
|
||||||
|
|
||||||
Bitmap bm = null;
|
Bitmap bm = null;
|
||||||
if (uri == null) {
|
if (uri == null) {
|
||||||
bm = avatarService().get(account, getPixel(192));
|
bm = avatarService().get(account, (int) getResources().getDimension(R.dimen.publish_avatar_size));
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
bm = xmppConnectionService.getFileBackend().cropCenterSquare(uri, getPixel(192));
|
bm = xmppConnectionService.getFileBackend().cropCenterSquare(uri, (int) getResources().getDimension(R.dimen.publish_avatar_size));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(Config.LOGTAG, "unable to load bitmap into image view", e);
|
Log.d(Config.LOGTAG, "unable to load bitmap into image view", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
|
|
||||||
<QuickContactBadge
|
<QuickContactBadge
|
||||||
android:id="@+id/details_contact_badge"
|
android:id="@+id/details_contact_badge"
|
||||||
android:layout_width="72dp"
|
android:layout_width="@dimen/avatar_on_details_screen_size"
|
||||||
android:layout_height="72dp"
|
android:layout_height="@dimen/avatar_on_details_screen_size"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:scaleType="centerCrop"/>
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avater"
|
android:id="@+id/avater"
|
||||||
android:layout_width="72dp"
|
android:layout_width="@dimen/avatar_on_details_screen_size"
|
||||||
android:layout_height="72dp"
|
android:layout_height="@dimen/avatar_on_details_screen_size"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginRight="@dimen/avatar_item_distance"
|
android:layout_marginRight="@dimen/avatar_item_distance"
|
||||||
android:contentDescription="@string/account_image_description"
|
android:contentDescription="@string/account_image_description"
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/your_photo"
|
android:id="@+id/your_photo"
|
||||||
android:layout_width="72dp"
|
android:layout_width="@dimen/avatar_on_details_screen_size"
|
||||||
android:layout_height="72dp"
|
android:layout_height="@dimen/avatar_on_details_screen_size"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
app:riv_corner_radius="2dp"
|
app:riv_corner_radius="2dp"
|
||||||
android:layout_marginEnd="@dimen/avatar_item_distance"/>
|
android:layout_marginEnd="@dimen/avatar_item_distance"/>
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<dimen name="elv_undo_bottom_offset">63dp</dimen> <!-- 48dp + 15dp -->
|
|
||||||
</resources>
|
|
|
@ -4,4 +4,5 @@
|
||||||
<dimen name="fineprint_size">12sp</dimen>
|
<dimen name="fineprint_size">12sp</dimen>
|
||||||
<dimen name="swipe_handle_size">48dp</dimen>
|
<dimen name="swipe_handle_size">48dp</dimen>
|
||||||
<dimen name="audio_player_width">288dp</dimen>
|
<dimen name="audio_player_width">288dp</dimen>
|
||||||
|
<dimen name="avatar_on_details_screen_size">72dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="activity_horizontal_margin">32dp</dimen>
|
<dimen name="activity_horizontal_margin">32dp</dimen>
|
||||||
<dimen name="swipe_handle_size">72dp</dimen>
|
<dimen name="avatar_on_details_screen_size">96dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
<dimen name="publish_avatar_top_margin">8dp</dimen>
|
<dimen name="publish_avatar_top_margin">8dp</dimen>
|
||||||
<dimen name="publish_avatar_size">96dp</dimen>
|
<dimen name="publish_avatar_size">96dp</dimen>
|
||||||
|
<dimen name="avatar_on_details_screen_size">56dp</dimen>
|
||||||
|
|
||||||
<dimen name="input_label_vertical_spacing">4dp</dimen>
|
<dimen name="input_label_vertical_spacing">4dp</dimen>
|
||||||
<dimen name="input_label_horizontal_spacing">4dp</dimen>
|
<dimen name="input_label_horizontal_spacing">4dp</dimen>
|
||||||
|
|
Loading…
Reference in a new issue