diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
4 files changed, 15 insertions, 14 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 129f5400e..456b907df 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -626,10 +626,10 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat private void onEditYourNameClicked(View view) { String nick; try { - if (mAccount.getDisplayName() != null) { + if (mAccount != null) { nick = mAccount.getDisplayName(); } else { - nick = mAccount.getJid().getLocal(); + nick = ""; } } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java b/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java index ce5291466..9aa308f57 100644 --- a/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java +++ b/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java @@ -51,6 +51,8 @@ public class MediaBrowserActivity extends XmppActivity implements OnMediaLoaded mMediaAdapter = new MediaAdapter(this, R.dimen.media_size); this.binding.media.setAdapter(mMediaAdapter); GridManager.setupLayoutManager(this, this.binding.media, R.dimen.browser_media_size); + this.binding.noMedia.setVisibility(View.GONE); + this.binding.progressbar.setVisibility(View.VISIBLE); } @Override @@ -74,8 +76,10 @@ public class MediaBrowserActivity extends XmppActivity implements OnMediaLoaded if (attachments.size() > 0) { mMediaAdapter.setAttachments(attachments); this.binding.noMedia.setVisibility(View.GONE); + this.binding.progressbar.setVisibility(View.GONE); } else { this.binding.noMedia.setVisibility(View.VISIBLE); + this.binding.progressbar.setVisibility(View.GONE); } }); } diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 10ca37c7c..b254549af 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -1001,8 +1001,8 @@ public abstract class XmppActivity extends ActionBarActivity { (dialog, id) -> { String selection = spinner.getSelectedItem().toString(); Account mAccount = xmppConnectionService.findAccountByJid(Jid.of(selection).asBareJid()); - String user = Jid.of(selection).getLocal(); - String domain = Jid.of(selection).getDomain(); + String user = mAccount.getDisplayName(); + String domain = mAccount.getJid().getDomain(); String inviteURL = AdHocInviteUri(mAccount); if (inviteURL == null) { inviteURL = Config.inviteUserURL + user + "/" + domain; diff --git a/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java b/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java index dbe6a4629..ec99c6aee 100644 --- a/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java +++ b/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java @@ -1,5 +1,6 @@ package de.pixart.messenger.ui.widget; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; @@ -12,6 +13,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; +import android.widget.Toast; import com.squareup.picasso.Picasso; @@ -80,14 +82,6 @@ public class RichLinkView extends RelativeLayout { textViewTitle = findViewById(R.id.rich_link_title); textViewDesp = findViewById(R.id.rich_link_desp); imageView.setAdjustViewBounds(true); - if (!meta.getImageurl().equals("") || !meta.getImageurl().isEmpty() - && !meta.getTitle().isEmpty() || !meta.getTitle().equals("") - && !meta.getUrl().isEmpty() || !meta.getUrl().equals("") - && !meta.getDescription().isEmpty() || !meta.getDescription().equals("")) { - linearLayout.setVisibility(VISIBLE); - } else { - linearLayout.setVisibility(VISIBLE); - } if (!meta.getImageurl().equals("") && !meta.getImageurl().isEmpty()) { if (!dataSaverDisabled) { Picasso.get() @@ -98,7 +92,6 @@ public class RichLinkView extends RelativeLayout { Picasso.get() .load(meta.getImageurl()) .resize(80, 80) - .onlyScaleDown() .centerInside() .placeholder(R.drawable.ic_web_grey600_48) .into(imageView); @@ -138,7 +131,11 @@ public class RichLinkView extends RelativeLayout { private void richLinkClicked() { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(main_url)); - context.startActivity(intent); + try { + context.startActivity(intent); + } catch (ActivityNotFoundException e) { + Toast.makeText(context, R.string.no_application_found_to_open_link, Toast.LENGTH_LONG).show(); + } } public void setDefaultClickListener(boolean isDefault) { |