raised api level and made necessary code changes

This commit is contained in:
Ernir Erlingsson
2016-08-10 00:25:35 +02:00
parent d34afa5f30
commit 48e1a65a24
16 changed files with 49 additions and 323 deletions

View File

@@ -1,11 +1,6 @@
package org.briarproject.android.introduction;
import android.content.Context;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.os.Build;
import android.view.View;
import org.briarproject.android.contact.ContactListAdapter;
@@ -47,6 +42,7 @@ public class ContactChooserAdapter extends ContactListAdapter {
* Set the identity from whose perspective the contact shall be chosen.
* Contacts that belong to a different author will be shown grayed out,
* but are still clickable.
*
* @param authorId The ID of the local Author
*/
public void setLocalAuthor(AuthorId authorId) {
@@ -55,21 +51,12 @@ public class ContactChooserAdapter extends ContactListAdapter {
}
private void grayOutItem(final ContactHolder ui) {
if (Build.VERSION.SDK_INT >= 11) {
float alpha = 0.25f;
ui.bulb.setAlpha(alpha);
ui.avatar.setAlpha(alpha);
ui.name.setAlpha(alpha);
ui.date.setAlpha(alpha);
ui.identity.setAlpha(alpha);
} else {
ColorFilter colorFilter = new PorterDuffColorFilter(Color.GRAY,
PorterDuff.Mode.MULTIPLY);
ui.bulb.setColorFilter(colorFilter);
ui.avatar.setColorFilter(colorFilter);
ui.name.setEnabled(false);
ui.date.setEnabled(false);
}
float alpha = 0.25f;
ui.bulb.setAlpha(alpha);
ui.avatar.setAlpha(alpha);
ui.name.setAlpha(alpha);
ui.date.setAlpha(alpha);
ui.identity.setAlpha(alpha);
}
}