Small improvements

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

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

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

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

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

Loading…
Cancel
Save