From 66a1cc421e9c04964fda500aa1df26699b20634a Mon Sep 17 00:00:00 2001 From: stom79 Date: Tue, 13 Nov 2018 18:43:01 +0100 Subject: [PATCH] reduce the opacity on the background image - issue #563 --- .../activities/ShowAccountActivity.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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 c0312d7d2..a29c109b3 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 @@ -53,16 +53,19 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; + import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.transition.Transition; + import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; + import fr.gouv.etalab.mastodon.R; import fr.gouv.etalab.mastodon.asynctasks.PostActionAsyncTask; import fr.gouv.etalab.mastodon.asynctasks.RetrieveAccountAsyncTask; @@ -74,6 +77,7 @@ import fr.gouv.etalab.mastodon.client.APIResponse; import fr.gouv.etalab.mastodon.client.Entities.Account; import fr.gouv.etalab.mastodon.client.Entities.Attachment; import fr.gouv.etalab.mastodon.client.Entities.Error; +import fr.gouv.etalab.mastodon.client.Entities.Relationship; import fr.gouv.etalab.mastodon.client.Entities.RemoteInstance; import fr.gouv.etalab.mastodon.client.Entities.Status; import fr.gouv.etalab.mastodon.client.HttpsConnection; @@ -89,7 +93,6 @@ import fr.gouv.etalab.mastodon.interfaces.OnRetrieveEmojiAccountInterface; import fr.gouv.etalab.mastodon.interfaces.OnRetrieveFeedsAccountInterface; import fr.gouv.etalab.mastodon.interfaces.OnRetrieveFeedsInterface; import fr.gouv.etalab.mastodon.interfaces.OnRetrieveRelationshipInterface; -import fr.gouv.etalab.mastodon.client.Entities.Relationship; import fr.gouv.etalab.mastodon.sqlite.AccountDAO; import fr.gouv.etalab.mastodon.sqlite.InstancesDAO; import fr.gouv.etalab.mastodon.sqlite.Sqlite; @@ -490,11 +493,20 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt public void onResourceReady(Bitmap resource, Transition transition) { ImageView banner_pp = findViewById(R.id.banner_pp); banner_pp.setImageBitmap(resource); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { - banner_pp.setImageAlpha(60); + if( theme == THEME_LIGHT){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + banner_pp.setImageAlpha(80); + }else { + banner_pp.setAlpha(80); + } }else { - banner_pp.setAlpha(60); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + banner_pp.setImageAlpha(60); + }else { + banner_pp.setAlpha(60); + } } + } });