diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java index 05f4b8f27..973e08d61 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java @@ -14,6 +14,7 @@ package fr.gouv.etalab.mastodon.drawers; * You should have received a copy of the GNU General Public License along with Mastalab; if not, * see . */ +import android.graphics.Paint; import android.support.v7.app.AlertDialog; import android.content.ClipData; import android.content.ClipboardManager; @@ -198,7 +199,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf holder.status_prev4_container = (RelativeLayout) convertView.findViewById(R.id.status_prev4_container); holder.status_reply = (ImageView) convertView.findViewById(R.id.status_reply); holder.status_privacy = (ImageView) convertView.findViewById(R.id.status_privacy); - holder.status_translate = (Button) convertView.findViewById(R.id.status_translate); + holder.status_translate = (TextView) convertView.findViewById(R.id.status_translate); holder.status_content_translated_container = (LinearLayout) convertView.findViewById(R.id.status_content_translated_container); holder.main_container = (LinearLayout) convertView.findViewById(R.id.main_container); holder.status_spoiler_container = (LinearLayout) convertView.findViewById(R.id.status_spoiler_container); @@ -303,6 +304,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf statusListAdapter.notifyDataSetChanged(); } }); + holder.status_translate.setPaintFlags(holder.status_translate.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); if( currentLocale != null && status.getLanguage() != null && !status.getLanguage().trim().equals(currentLocale) && !status.getLanguage().trim().equals("null")){ if (translator != Helper.TRANS_NONE) holder.status_translate.setVisibility(View.VISIBLE); @@ -995,6 +997,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf statuses.get(position).setContent_translated(aJsonString); statusListAdapter.notifyDataSetChanged(); } catch (JSONException | UnsupportedEncodingException | IllegalArgumentException e) { + e.printStackTrace(); Toast.makeText(context, R.string.toast_error_translate, Toast.LENGTH_LONG).show(); } } @@ -1038,7 +1041,8 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf But, pre-planning might save some time later... */ aJsonString = aJsonString.replaceAll("__ (u|t)(\\d+)__", "__$1$2__").replaceAll("__(u|t)(\\d+) __", "__$1$2__"); - + aJsonString = aJsonString.replaceAll("%(?![0-9a-fA-F]{2})", "%25"); + aJsonString = aJsonString.replaceAll("\\+", "%2B"); aJsonString = URLDecoder.decode(aJsonString, "UTF-8"); return aJsonString; } @@ -1077,7 +1081,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf RelativeLayout status_prev4_container; ImageView status_reply; ImageView status_privacy; - Button status_translate; + TextView status_translate; LinearLayout status_container2; LinearLayout status_container3; LinearLayout main_container; diff --git a/app/src/main/res/drawable-hdpi/ic_fav_header.png b/app/src/main/res/drawable-hdpi/ic_fav_header.png new file mode 100644 index 000000000..0e8c7e9a1 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_fav_header.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_fiber_new.png b/app/src/main/res/drawable-hdpi/ic_fiber_new.png new file mode 100644 index 000000000..ec7fdc454 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_fiber_new.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_follow_header.png b/app/src/main/res/drawable-hdpi/ic_follow_header.png new file mode 100644 index 000000000..46cfb9fe8 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_follow_header.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_retweet_header.png b/app/src/main/res/drawable-hdpi/ic_retweet_header.png new file mode 100644 index 000000000..8aa0ff8dd Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_retweet_header.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_fav_header.png b/app/src/main/res/drawable-ldpi/ic_fav_header.png new file mode 100644 index 000000000..b69764624 Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_fav_header.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_fiber_new.png b/app/src/main/res/drawable-ldpi/ic_fiber_new.png new file mode 100644 index 000000000..45be937c6 Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_fiber_new.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_follow_header.png b/app/src/main/res/drawable-ldpi/ic_follow_header.png new file mode 100644 index 000000000..805a8d518 Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_follow_header.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_fav_header.png b/app/src/main/res/drawable-mdpi/ic_fav_header.png new file mode 100644 index 000000000..8b4b7ec79 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_fav_header.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_fiber_new.png b/app/src/main/res/drawable-mdpi/ic_fiber_new.png new file mode 100644 index 000000000..589f71501 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_fiber_new.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_follow_header.png b/app/src/main/res/drawable-mdpi/ic_follow_header.png new file mode 100644 index 000000000..3f6c75c56 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_follow_header.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_fav_header.png b/app/src/main/res/drawable-xhdpi/ic_fav_header.png new file mode 100644 index 000000000..71d0bfab0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_fav_header.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_fiber_new.png b/app/src/main/res/drawable-xhdpi/ic_fiber_new.png new file mode 100644 index 000000000..08208c303 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_fiber_new.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_follow_header.png b/app/src/main/res/drawable-xhdpi/ic_follow_header.png new file mode 100644 index 000000000..77c482e5b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_follow_header.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_fav_header.png b/app/src/main/res/drawable-xxhdpi/ic_fav_header.png new file mode 100644 index 000000000..70f761c8d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_fav_header.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_fiber_new.png b/app/src/main/res/drawable-xxhdpi/ic_fiber_new.png new file mode 100644 index 000000000..160387cdd Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_fiber_new.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_follow_header.png b/app/src/main/res/drawable-xxhdpi/ic_follow_header.png new file mode 100644 index 000000000..e1f60cc22 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_follow_header.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_fav_header.png b/app/src/main/res/drawable-xxxhdpi/ic_fav_header.png new file mode 100644 index 000000000..154f6c446 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_fav_header.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_fiber_new.png b/app/src/main/res/drawable-xxxhdpi/ic_fiber_new.png new file mode 100644 index 000000000..30dacde3c Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_fiber_new.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_follow_header.png b/app/src/main/res/drawable-xxxhdpi/ic_follow_header.png new file mode 100644 index 000000000..ffa613901 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_follow_header.png differ diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index 78200f4f6..537ebdb07 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -71,22 +71,6 @@ style="?attr/shapeBorder" android:visibility="gone" tools:ignore="ContentDescription" /> -