reduce the opacity on the background image - issue #563

This commit is contained in:
stom79 2018-11-13 18:43:01 +01:00
parent 351dbc4c36
commit 66a1cc421e
1 changed files with 16 additions and 4 deletions

View File

@ -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<? super Bitmap> 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);
}
}
}
});