diff options
8 files changed, 122 insertions, 44 deletions
@@ -39,6 +39,7 @@ Lead developer: [@tom79](https://mastodon.social/@tom79) +<br> Developer: [@kasun](https://mastodon.social/@kasun) ## Backers diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java index 1b5bc28ef..c4cce8565 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/ShowAccountActivity.java @@ -237,8 +237,12 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt final ImageButton account_menu = findViewById(R.id.account_menu); ImageButton action_more = findViewById(R.id.action_more); - if( theme == THEME_LIGHT) + ImageButton action_back = findViewById(R.id.action_back); + if(theme == THEME_LIGHT){ changeDrawableColor(getApplicationContext(),action_more,R.color.dark_icon); + changeDrawableColor(getApplicationContext(),account_menu,R.color.dark_icon); + changeDrawableColor(getApplicationContext(),action_back,R.color.dark_icon); + } account_menu.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -251,6 +255,12 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt showMenu(account_menu); } }); + action_back.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); + } + }); if( account != null){ ManageAccount(); } diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/AccountsFollowRequestAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/AccountsFollowRequestAdapter.java index ffdee6dcd..464122a57 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/AccountsFollowRequestAdapter.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/AccountsFollowRequestAdapter.java @@ -64,7 +64,7 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement this.context = context; accountsFollowRequestAdapter = this; } - + @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { @@ -78,7 +78,8 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement final Account account = accounts.get(position); holder.btn_authorize.getBackground().setColorFilter(ContextCompat.getColor(context, R.color.green_1), PorterDuff.Mode.MULTIPLY); holder.btn_reject.getBackground().setColorFilter(ContextCompat.getColor(context, R.color.red_1), PorterDuff.Mode.MULTIPLY); - holder.account_un.setText(String.format("@%s", account.getUsername())); + holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(),true)); + holder.account_un.setText(account.getAcct()); //Profile picture Glide.with(holder.account_pp.getContext()) .load(account.getAvatar()) @@ -89,6 +90,12 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement openAccountDetails(account); } }); + holder.account_dn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + openAccountDetails(account); + } + }); holder.account_un.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -157,11 +164,13 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement ImageView account_pp; Button btn_authorize; Button btn_reject; + TextView account_dn; TextView account_un; public ViewHolder(View itemView) { super(itemView); account_pp = itemView.findViewById(R.id.account_pp); + account_dn = itemView.findViewById(R.id.account_dn); account_un = itemView.findViewById(R.id.account_un); btn_authorize = itemView.findViewById(R.id.btn_authorize); btn_reject = itemView.findViewById(R.id.btn_reject); diff --git a/app/src/main/res/drawable-anydpi/ic_back.xml b/app/src/main/res/drawable-anydpi/ic_back.xml new file mode 100644 index 000000000..26abc5351 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_back.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/> +</vector> diff --git a/app/src/main/res/layout-sw600dp/activity_show_account.xml b/app/src/main/res/layout-sw600dp/activity_show_account.xml index f0936bd77..00bc3a1ae 100644 --- a/app/src/main/res/layout-sw600dp/activity_show_account.xml +++ b/app/src/main/res/layout-sw600dp/activity_show_account.xml @@ -92,6 +92,20 @@ android:layout_height="40dp" /> <ImageButton + android:id="@+id/action_back" + android:background="?attr/selectableItemBackgroundBorderless" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:src="@drawable/ic_back" + android:layout_marginRight="10dp" + android:layout_marginEnd="10dp" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginTop="5dp" + android:contentDescription="@string/go_back" /> + + <ImageButton android:id="@+id/account_menu" android:background="?attr/selectableItemBackgroundBorderless" android:layout_alignParentTop="true" diff --git a/app/src/main/res/layout/activity_show_account.xml b/app/src/main/res/layout/activity_show_account.xml index 6177ced9b..a298c7053 100644 --- a/app/src/main/res/layout/activity_show_account.xml +++ b/app/src/main/res/layout/activity_show_account.xml @@ -91,6 +91,20 @@ android:layout_height="wrap_content" /> <ImageButton + android:id="@+id/action_back" + android:background="?attr/selectableItemBackgroundBorderless" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" + android:src="@drawable/ic_back" + android:layout_marginRight="10dp" + android:layout_marginEnd="10dp" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginTop="5dp" + android:contentDescription="@string/go_back" /> + + <ImageButton android:id="@+id/account_menu" android:background="?attr/selectableItemBackgroundBorderless" android:layout_alignParentTop="true" @@ -436,7 +450,7 @@ android:text="@string/disclaimer_full" android:layout_width="match_parent" android:layout_height="wrap_content" /> - </android.support.v7.widget.Toolbar> + </android.support.v7.widget.Toolbar> <android.support.design.widget.TabLayout android:id="@+id/account_tabLayout" android:layout_width="match_parent" diff --git a/app/src/main/res/layout/drawer_account_follow_request.xml b/app/src/main/res/layout/drawer_account_follow_request.xml index 8790f1b3a..93e2d94c6 100644 --- a/app/src/main/res/layout/drawer_account_follow_request.xml +++ b/app/src/main/res/layout/drawer_account_follow_request.xml @@ -1,5 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- +<?xml version="1.0" encoding="utf-8"?><!-- Copyright 2017 Thomas Schneider This file is a part of Mastalab @@ -15,54 +14,75 @@ You should have received a copy of the GNU General Public License along with Mastalab; if not, see <http://www.gnu.org/licenses>. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/account_container" android:layout_width="match_parent" android:layout_height="wrap_content" - android:id="@+id/account_container" android:layout_marginTop="5dp" - android:layout_marginBottom="5dp" - android:orientation="horizontal"> + android:layout_marginBottom="5dp"> + <ImageView - android:layout_gravity="center" android:id="@+id/account_pp" android:layout_width="60dp" android:layout_height="60dp" - android:contentDescription="@string/profile_picture"/> + android:layout_gravity="center" + android:contentDescription="@string/profile_picture" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + <TextView - android:id="@+id/account_un" - android:padding="5dp" + android:id="@+id/account_dn" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" android:maxLines="1" - android:gravity="center" android:textSize="16sp" - android:layout_gravity="center" - android:layout_width="0dp" - android:layout_weight="1" - android:layout_height="wrap_content" /> - <LinearLayout + app:layout_constraintBottom_toTopOf="@id/account_un" + app:layout_constraintLeft_toRightOf="@id/account_pp" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/account_un" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" + android:maxLines="1" + android:textSize="15sp" + app:layout_constraintBottom_toTopOf="@id/btn_top_barrier" + app:layout_constraintLeft_toRightOf="@id/account_pp" + app:layout_constraintTop_toBottomOf="@id/account_dn" /> + + <android.support.constraint.Barrier + android:id="@+id/btn_top_barrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="top" + app:constraint_referenced_ids="btn_authorize,btn_reject" /> + + <Button + android:id="@+id/btn_authorize" + style="@style/Base.Widget.AppCompat.Button.Small" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" + android:text="@string/authorize" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintRight_toLeftOf="@id/btn_reject" /> + + <Button + android:id="@+id/btn_reject" + style="@style/Base.Widget.AppCompat.Button.Small" android:layout_width="wrap_content" - android:gravity="end" android:layout_height="wrap_content" - android:orientation="vertical"> - <Button - android:id="@+id/btn_authorize" - android:text="@string/authorize" - android:layout_marginStart="5dp" - android:layout_marginLeft="5dp" - android:layout_gravity="end" - android:gravity="center" - style="@style/Base.Widget.AppCompat.Button.Small" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - <Button - android:id="@+id/btn_reject" - android:layout_marginStart="5dp" - android:layout_marginLeft="5dp" - android:text="@string/reject" - android:layout_gravity="end" - android:gravity="center" - style="@style/Base.Widget.AppCompat.Button.Small" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </LinearLayout> + android:layout_gravity="end" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" + android:text="@string/reject" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintRight_toRightOf="parent" /> -</LinearLayout>
\ No newline at end of file +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2c7513655..1d198ccad 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -718,6 +718,7 @@ <string name="no_scheduled_boosts_indications"><![CDATA[Open the menu of a toot and then choose <b>Schedule boost</b>.]]></string> <string name="art_menu">Art timeline</string> <string name="open_menu">Open menu</string> + <string name="go_back">Go back</string> <string name="app_logo">Logo of the application</string> <string name="profile_picture">Profile picture</string> <string name="profile_banner">Profile banner</string> |