Small improvements

pull/182/head
M66B 4 years ago
parent 583ef6fe89
commit 28880d2a57

@ -5734,14 +5734,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
resid = getResources().getIdentifier(
"flag_" + data.second.country.toLowerCase(Locale.ROOT),
"drawable", getContext().getPackageName());
if (resid == 0)
ivFlag.setImageDrawable(null);
else
ivFlag.setImageResource(resid);
ivFlag.setContentDescription(data.second.country);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
ivFlag.setTooltipText(data.second.country);
tvHost.setText(data.first);
tvOwner.setText(TextUtils.isEmpty(data.second.name) ? "?" : data.second.name);

@ -85,7 +85,7 @@ public class IPInfo {
organization.name = jinfo.optString("org");
organization.country = jinfo.optString("country");
} catch (JSONException ex) {
Log.w(ex);
throw new IOException(ex);
} finally {
connection.disconnect();
}

@ -45,7 +45,7 @@ public class ViewImageHint extends AppCompatImageView implements View.OnLongClic
String title = getContentDescription().toString();
if (!TextUtils.isEmpty(title)) {
int[] pos = new int[2];
getLocationInWindow(pos);
getLocationOnScreen(pos);
Toast toast = ToastEx.makeText(getContext(), title, Toast.LENGTH_LONG);
toast.setGravity(Gravity.TOP | Gravity.START, pos[0], pos[1]);

@ -149,7 +149,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOwnerRemark" />
<ImageView
<eu.faircode.email.ViewImageHint
android:id="@+id/ivFlag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

Loading…
Cancel
Save