diff options
author | tom79 <tschneider.ac@gmail.com> | 2019-05-12 18:06:33 +0200 |
---|---|---|
committer | tom79 <tschneider.ac@gmail.com> | 2019-05-12 18:06:33 +0200 |
commit | 0e830b99f4f2add1dda6ef132e0a3c76330af3a4 (patch) | |
tree | b5d9796bf949b9357b07e52d641ed9ff41066a93 /app | |
parent | 6f499b884218945dcc7e2b7e29b7ca18d14699ac (diff) |
Add a bot icon
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java | 17 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_bot.xml | 37 | ||||
-rw-r--r-- | app/src/main/res/layout/drawer_status.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/layout/drawer_status_compact.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/layout/drawer_status_console.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/layout/drawer_status_focused.xml | 10 |
6 files changed, 93 insertions, 1 deletions
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 aaaa578e6..facaec09a 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 @@ -366,7 +366,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct LinearLayout status_peertube_container; TextView status_peertube_reply, status_peertube_delete, show_more_content; - ImageView cached_status; + ImageView cached_status, status_account_bot; //Poll LinearLayout poll_container, single_choice, multiple_choice, rated; @@ -474,6 +474,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct submit_vote = itemView.findViewById(R.id.submit_vote); refresh_poll = itemView.findViewById(R.id.refresh_poll); cached_status = itemView.findViewById(R.id.cached_status); + status_account_bot = itemView.findViewById(R.id.status_account_bot); } } @@ -539,6 +540,20 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct } status.setItemViewType(viewHolder.getItemViewType()); + if( status.getReblog() == null){ + if( status.getAccount().isBot()){ + holder.status_account_bot.setVisibility(View.VISIBLE); + }else { + holder.status_account_bot.setVisibility(View.GONE); + } + }else{ + if( status.getReblog().getAccount().isBot()){ + holder.status_account_bot.setVisibility(View.VISIBLE); + }else { + holder.status_account_bot.setVisibility(View.GONE); + } + } + boolean displayBookmarkButton = sharedpreferences.getBoolean(Helper.SET_SHOW_BOOKMARK, false); boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false); boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false); diff --git a/app/src/main/res/drawable/ic_bot.xml b/app/src/main/res/drawable/ic_bot.xml new file mode 100644 index 000000000..16419d19d --- /dev/null +++ b/app/src/main/res/drawable/ic_bot.xml @@ -0,0 +1,37 @@ +<vector android:height="24dp" android:viewportHeight="48" + android:viewportWidth="48" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#00000000" + android:pathData="M26,27H12A11,11 0,0 1,12 5H26A11,11 0,0 1,37 16" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#00000000" + android:pathData="M26,23H12A7,7 0,0 1,12 9H26a7,7 0,0 1,7 7" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#2b90d9" android:pathData="M25.9091,15.2265a1.2954,1.6193 0,1 0,2.5909 0a1.2954,1.6193 0,1 0,-2.5909 0z"/> + <path android:fillColor="#2b90d9" android:pathData="M9.5,15.2265a1.2954,1.6193 0,1 0,2.5909 0a1.2954,1.6193 0,1 0,-2.5909 0z"/> + <path android:fillColor="#00000000" + android:pathData="M14.6818,16.1789a5.4972,5.4972 0,0 0,8.6364 0" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#00000000" + android:pathData="M38,26.8792m-1.1776,8.9216a8.999,8.999 52.5191,1 1,2.3552 -17.8432a8.999,8.999 52.5191,1 1,-2.3552 17.8432" + android:strokeColor="#2b90d9" android:strokeWidth="2"/> + <path android:fillColor="#00000000" + android:pathData="M33.3333,34.6667L30,40.6667" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#00000000" android:pathData="M19,1L19,5" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#00000000" + android:pathData="M6,40H27.302a3.6336,3.6336 0,0 1,3.6931 3.3118A3.5002,3.5002 0,0 1,27.5 47H6a5,5 0,0 1,-5 -5V32a5,5 0,0 1,5 -5H16" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#00000000" android:pathData="M8,31h8v4h-8z" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> + <path android:fillColor="#00000000" android:pathData="M24,40L24,47" + android:strokeColor="#2b90d9" android:strokeLineCap="round" + android:strokeLineJoin="round" android:strokeWidth="2"/> +</vector> diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index 312f11ad6..0a78a86e4 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -39,6 +39,16 @@ android:layout_width="match_parent" > <ImageView + android:visibility="gone" + android:layout_width="15dp" + android:layout_height="15dp" + android:layout_marginTop="5dp" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:src="@drawable/ic_bot" + android:id="@+id/status_account_bot" + android:layout_alignParentStart="true" /> + <ImageView android:layout_width="50dp" android:layout_height="50dp" android:layout_marginTop="5dp" diff --git a/app/src/main/res/layout/drawer_status_compact.xml b/app/src/main/res/layout/drawer_status_compact.xml index 17f437532..cc3feaed5 100644 --- a/app/src/main/res/layout/drawer_status_compact.xml +++ b/app/src/main/res/layout/drawer_status_compact.xml @@ -43,6 +43,16 @@ android:layout_width="match_parent" > <ImageView + android:visibility="gone" + android:layout_width="15dp" + android:layout_height="15dp" + android:layout_marginTop="5dp" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:src="@drawable/ic_bot" + android:id="@+id/status_account_bot" + android:layout_alignParentStart="true" /> + <ImageView android:layout_width="40dp" android:layout_height="40dp" android:layout_marginTop="5dp" diff --git a/app/src/main/res/layout/drawer_status_console.xml b/app/src/main/res/layout/drawer_status_console.xml index 8d022615e..8ad9746c5 100644 --- a/app/src/main/res/layout/drawer_status_console.xml +++ b/app/src/main/res/layout/drawer_status_console.xml @@ -46,6 +46,16 @@ android:layout_width="match_parent" > <ImageView + android:visibility="gone" + android:layout_width="15dp" + android:layout_height="15dp" + android:layout_marginTop="5dp" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:src="@drawable/ic_bot" + android:id="@+id/status_account_bot" + android:layout_alignParentStart="true" /> + <ImageView android:layout_width="50dp" android:layout_height="50dp" android:layout_marginTop="5dp" diff --git a/app/src/main/res/layout/drawer_status_focused.xml b/app/src/main/res/layout/drawer_status_focused.xml index 5aa04b96a..c60af63cc 100644 --- a/app/src/main/res/layout/drawer_status_focused.xml +++ b/app/src/main/res/layout/drawer_status_focused.xml @@ -44,6 +44,16 @@ android:layout_width="match_parent" > <ImageView + android:visibility="gone" + android:layout_width="15dp" + android:layout_height="15dp" + android:layout_marginTop="5dp" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:src="@drawable/ic_bot" + android:id="@+id/status_account_bot" + android:layout_alignParentStart="true" /> + <ImageView android:layout_width="50dp" android:layout_height="50dp" android:layout_marginTop="5dp" |