Merge branch 'target-sdk-26' into 'master'

Target API version 26, upgrade support library

See merge request !626
This commit is contained in:
akwizgran
2017-11-29 17:38:12 +00:00
68 changed files with 252 additions and 261 deletions

View File

@@ -10,9 +10,6 @@ before_script:
- export GRADLE_USER_HOME=$PWD/.gradle
# Accept the license for the Android build tools
- echo y | /opt/android-sdk/tools/bin/sdkmanager "build-tools;26.0.2"
# Install the Android support repository
# TODO: Remove this when we upgrade the support library
- echo y | /opt/android-sdk/tools/bin/sdkmanager 'extras;android;m2repository'
# Download OpenJDK 6 so we can compile against its standard library
- JDK_FILE=openjdk-6-jre-headless_6b38-1.13.10-1~deb7u1_amd64.deb
- if [ ! -d openjdk ]

View File

@@ -6,12 +6,12 @@ apply plugin: 'witness'
apply plugin: 'de.undercouch.download'
android {
compileSdkVersion 26
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 26
versionCode 1611
versionName "0.16.11"
consumerProguardFiles 'proguard-rules.txt'
@@ -90,6 +90,6 @@ def verifyBinary(name, chksum) {
project.afterEvaluate {
torBinaries.every { key, value ->
preBuild.dependsOn.add(verifyBinary(key, value))
preBuild.dependsOn.add(verifyBinary(key, value))
}
}

View File

@@ -6,7 +6,7 @@ dependencies {
implementation project(path: ':bramble-core', configuration: 'default')
implementation project(path: ':bramble-android', configuration: 'default')
def supportVersion = '23.2.1'
def supportVersion = '27.0.1'
implementation "com.android.support:support-v4:$supportVersion"
implementation("com.android.support:appcompat-v7:$supportVersion") {
exclude module: 'support-v4'
@@ -32,7 +32,7 @@ dependencies {
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.jpardogo.materialtabstrip:library:1.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'uk.co.samuelwall:material-tap-target-prompt:1.9.2'
implementation 'uk.co.samuelwall:material-tap-target-prompt:2.1.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
@@ -53,6 +53,9 @@ dependencies {
dependencyVerification {
verify = [
'android.arch.core:common:1.0.0:common-1.0.0.jar:5192934cd73df32e2c15722ed7fc488dde90baaec9ae030010dd1a80fb4e74e1',
'android.arch.lifecycle:common:1.0.0:common-1.0.0.jar:86bf301a20ad0cd0a391e22a52e6fbf90575c096ff83233fa9fd0d52b3219121',
'android.arch.lifecycle:runtime:1.0.0:runtime-1.0.0.aar:e4e34e5d02bd102e8d39ddbc29f9ead8a15a61e367993d02238196ac48509ad8',
'backport-util-concurrent:backport-util-concurrent:3.1:backport-util-concurrent-3.1.jar:f5759b7fcdfc83a525a036deedcbd32e5b536b625ebc282426f16ca137eb5902',
'cglib:cglib:3.2.0:cglib-3.2.0.jar:adb13bab79712ad6bdf1bd59f2a3918018a8016e722e8a357065afb9e6690861',
'ch.acra:acra:4.8.5:acra-4.8.5.aar:afd5b28934d5166b55f261c85685ad59e8a4ebe9ca1960906afaa8c76d8dc9eb',
@@ -60,16 +63,22 @@ dependencyVerification {
'com.almworks.sqlite4java:sqlite4java:0.282:sqlite4java-0.282.jar:9e1d8dd83ca6003f841e3af878ce2dc7c22497493a7bb6d1b62ec1b0d0a83c05',
'com.android.support.constraint:constraint-layout-solver:1.0.2:constraint-layout-solver-1.0.2.jar:8c62525a9bc5cff5633a96cb9b32fffeccaf41b8841aa87fc22607070dea9b8d',
'com.android.support.constraint:constraint-layout:1.0.2:constraint-layout-1.0.2.aar:b0c688cc2b7172608f8153a689d746da40f71e52d7e2fe2bfd9df2f92db77085',
'com.android.support:animated-vector-drawable:23.2.1:animated-vector-drawable-23.2.1.aar:06d1963b85aa917099d7757e6a7b3e4dc06889413dc747f625ae8683606db3a1',
'com.android.support:appcompat-v7:23.2.1:appcompat-v7-23.2.1.aar:00f9d93acacd6731f309724054bf51492814b4b2869f16d7d5c0038dcb8c9a0d',
'com.android.support:cardview-v7:23.2.1:cardview-v7-23.2.1.aar:4595f1c4a28cfa083b6c0920ad4d49e1c2ca4b8302a955e548f68eb63b74931b',
'com.android.support:design:23.2.1:design-23.2.1.aar:003e0c0bea0a6891f8b2bc43f20ae7af2a49a17363e5bb10df5ee0bae12fa686',
'com.android.support:preference-v14:23.2.1:preference-v14-23.2.1.aar:44881bb46094e86d0bc2426f205419674a5b4eb514b44b5a4659b5de29f71eb7',
'com.android.support:preference-v7:23.2.1:preference-v7-23.2.1.aar:775101bd07bd052e455761c5c5d9523d7ad59f2f320e3e8cbde241fd6b1d6025',
'com.android.support:recyclerview-v7:23.2.1:recyclerview-v7-23.2.1.aar:44040a888e23e0c93162a3377cfe06751080e3c22d369ab0d4301ef60d63b0fe',
'com.android.support:support-annotations:23.4.0:support-annotations-23.4.0.jar:e91a88dd0c5e99069b7f09d4a46b5e06f1e9c4c72fc0a8e987e25d86af480f01',
'com.android.support:support-v4:23.2.1:support-v4-23.2.1.aar:81ce890f26d35c75ad17d0f998a7e3230330c3b41e0b629566bc744bee89e448',
'com.android.support:support-vector-drawable:23.2.1:support-vector-drawable-23.2.1.aar:799bafe4c3de812386f0b291f744d5d6876452722dd40189b9ab87dbbf594ea1',
'com.android.support:animated-vector-drawable:27.0.1:animated-vector-drawable-27.0.1.aar:365050110411c86c7eec86101b49ab53557ffe6667f60b19055f1d35c38a577b',
'com.android.support:appcompat-v7:27.0.1:appcompat-v7-27.0.1.aar:1402c29a49db30346c21a7d40634461765b3ab826f5dd95bc4dcc76787b21851',
'com.android.support:cardview-v7:27.0.1:cardview-v7-27.0.1.aar:43fccd44086c51eaa9d78be2fcf0dfea1556c8876a6fd325ea8d24e860054202',
'com.android.support:design:27.0.1:design-27.0.1.aar:0e7c694bd5385e82d193e33b7289f769ce6ff05e277443daf5bffc3d852ef448',
'com.android.support:preference-v14:27.0.1:preference-v14-27.0.1.aar:beed3ee97ae0d2541bd0adac6c84bb7d7b7580399f24e8efb9bc624161b164df',
'com.android.support:preference-v7:27.0.1:preference-v7-27.0.1.aar:d87ba6ae7c834fd68ef09cbc0f064975627ba14189dbef639c34080691366da9',
'com.android.support:recyclerview-v7:27.0.1:recyclerview-v7-27.0.1.aar:99ae2863287df800f239617d09cafc58b95f7a5365db32e3761394fa01ab12c9',
'com.android.support:support-annotations:27.0.1:support-annotations-27.0.1.jar:240912b779fe7413bdd97c94ac2a92d1fb29bd53c4d50c6982e5942b01278ac0',
'com.android.support:support-compat:27.0.1:support-compat-27.0.1.aar:70dfd92561421e5ae113dfc4045fc94c90caca9912839b3d08c793aa391aedcc',
'com.android.support:support-core-ui:27.0.1:support-core-ui-27.0.1.aar:91614f829f8a6f1fc2d28efc58ea2735212225ab02cdf768b3dd9af72371d5f0',
'com.android.support:support-core-utils:27.0.1:support-core-utils-27.0.1.aar:b33c5a5d67b8bfa6c8829875661779279157bf23e6042179820eaf1745034a72',
'com.android.support:support-fragment:27.0.1:support-fragment-27.0.1.aar:05a859783ae4a285c6d5c9865e1242b86f5bfb69a30455ca6c8495f24c09d9ed',
'com.android.support:support-media-compat:27.0.1:support-media-compat-27.0.1.aar:bc1c0252c1d071a1676fd280a792cf0717833fb3afd0ef73070ddc51ef921ad7',
'com.android.support:support-v4:27.0.1:support-v4-27.0.1.aar:afd802f1926475f40c5b6b42855c9a626a854298908dafdb455deb6dab2640f2',
'com.android.support:support-vector-drawable:27.0.1:support-vector-drawable-27.0.1.aar:67154ea191f735496502214bc6da6195738829a8e9d59e8042a1e030a2c7f19c',
'com.android.support:transition:27.0.1:transition-27.0.1.aar:8a46d152391bd1598d1778ae889b3aeaff77a17d0caaa29446df6e26a28c4e4b',
'com.github.bumptech.glide:glide:3.8.0:glide-3.8.0.jar:750d9e7b940dc0ee48f8680623b55d46e14e8727acc922d7b156e57e7c549655',
'com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1:accessibility-test-framework-2.1.jar:7b0aa6ed7553597ce0610684a9f7eca8021eee218f2e2f427c04a7fbf5f920bd',
'com.google.code.findbugs:jsr305:3.0.2:jsr305-3.0.2.jar:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7',
@@ -147,9 +156,10 @@ dependencyVerification {
'org.robolectric:sandbox:3.5.1:sandbox-3.5.1.jar:beff8c3c1e840e0f7f78aadef170f347bae349f098babfc176765f499a4bcbb5',
'org.robolectric:shadowapi:3.5.1:shadowapi-3.5.1.jar:6d574f9ae0922791eb8f06979f0010997d4b862c7aec96d485ae797ddfc13278',
'org.robolectric:shadows-framework:3.5.1:shadows-framework-3.5.1.jar:597b54cc1a494799d783921c6ac04352f33e94fca8e00f299d4ca192db79e3fc',
'org.robolectric:shadows-support-v4:3.0:shadows-support-v4-3.0.jar:66bcc3257b037d72998e860d67b1bc58215b7eeac8ad860fcc3e613332d88619',
'org.robolectric:utils:3.5.1:utils-3.5.1.jar:d7d77326867e6d903156ebb18c244819b26aebe3aa82a1c57081081a0b6c4f63',
'org.slf4j:slf4j-api:1.7.16:slf4j-api-1.7.16.jar:e56288031f5e60652c06e7bb6e9fa410a61231ab54890f7b708fc6adc4107c5b',
'uk.co.samuelwall:material-tap-target-prompt:1.9.2:material-tap-target-prompt-1.9.2.aar:5d4951124366bc5c52e57beaa294db7611f0aa2a8d80e0163e1383e1966ba5b2',
'uk.co.samuelwall:material-tap-target-prompt:2.1.0:material-tap-target-prompt-2.1.0.aar:6df17e7c371f9264bfe440506f91205dd47566869c1528891943a04a26c96a94',
'xmlpull:xmlpull:1.1.3.1:xmlpull-1.1.3.1.jar:34e08ee62116071cbb69c0ed70d15a7a5b208d62798c59f2120bb8929324cb63',
'xpp3:xpp3_min:1.1.4c:xpp3_min-1.1.4c.jar:bfc90e9e32d0eab1f397fb974b5f150a815188382ac41f372a7149d5bc178008',
]
@@ -169,12 +179,12 @@ def getGitHash = { ->
}
android {
compileSdkVersion 26
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 26
versionCode 1611
versionName "0.16.11"
applicationId "org.briarproject.briar.beta"

View File

@@ -38,7 +38,7 @@ public class StartupFailureActivity extends BaseActivity {
}
// show proper error message
TextView view = (TextView) findViewById(R.id.errorView);
TextView view = findViewById(R.id.errorView);
if (result.equals(StartResult.DB_ERROR)) {
view.setText(getText(R.string.startup_failed_db_error));
} else if (result.equals(StartResult.SERVICE_ERROR)) {

View File

@@ -100,7 +100,7 @@ public abstract class BriarActivity extends BaseActivity {
@Nullable
protected Toolbar setUpCustomToolbar(boolean ownLayout) {
// Custom Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar ab = getSupportActionBar();
if (ab != null) {

View File

@@ -58,7 +58,7 @@ abstract class BasePostFragment extends BaseFragment {
View view = inflater.inflate(R.layout.fragment_blog_post, container,
false);
progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
progressBar = view.findViewById(R.id.progressBar);
progressBar.setVisibility(VISIBLE);
ui = new BlogPostViewHolder(view, true, new OnBlogPostClickListener() {
@Override

View File

@@ -92,7 +92,7 @@ public class BlogFragment extends BaseFragment
View v = inflater.inflate(R.layout.fragment_blog, container, false);
adapter = new BlogPostAdapter(getActivity(), this);
list = (BriarRecyclerView) v.findViewById(R.id.postList);
list = v.findViewById(R.id.postList);
list.setLayoutManager(new LinearLayoutManager(getActivity()));
list.setAdapter(adapter);
list.showProgressBar();

View File

@@ -59,13 +59,12 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
this.listener = listener;
ctx = v.getContext();
layout = (ViewGroup) v.findViewById(R.id.postLayout);
reblogger = (AuthorView) v.findViewById(R.id.rebloggerView);
author = (AuthorView) v.findViewById(R.id.authorView);
reblogButton = (ImageView) v.findViewById(R.id.commentView);
body = (TextView) v.findViewById(R.id.bodyView);
commentContainer =
(ViewGroup) v.findViewById(R.id.commentContainer);
layout = v.findViewById(R.id.postLayout);
reblogger = v.findViewById(R.id.rebloggerView);
author = v.findViewById(R.id.authorView);
reblogButton = v.findViewById(R.id.commentView);
body = v.findViewById(R.id.bodyView);
commentContainer = v.findViewById(R.id.commentContainer);
}
void setVisibility(int visibility) {
@@ -135,7 +134,7 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
ActivityOptionsCompat options =
makeSceneTransitionAnimation((Activity) ctx, layout,
getTransitionName(item.getId()));
ActivityCompat.startActivity((Activity) ctx, i,
ActivityCompat.startActivity(ctx, i,
options.toBundle());
} else {
// work-around for android bug #224270
@@ -173,8 +172,8 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
.inflate(R.layout.list_item_blog_comment,
commentContainer, false);
AuthorView author = (AuthorView) v.findViewById(R.id.authorView);
TextView body = (TextView) v.findViewById(R.id.bodyView);
AuthorView author = v.findViewById(R.id.authorView);
TextView body = v.findViewById(R.id.bodyView);
author.setAuthor(c.getAuthor());
author.setAuthorStatus(c.getAuthorStatus());

View File

@@ -77,7 +77,7 @@ public class FeedFragment extends BaseFragment implements
adapter = new BlogPostAdapter(getActivity(), this);
layoutManager = new LinearLayoutManager(getActivity());
list = (BriarRecyclerView) v.findViewById(R.id.postList);
list = v.findViewById(R.id.postList);
list.setLayoutManager(layoutManager);
list.setAdapter(adapter);
list.setEmptyText(R.string.blogs_feed_empty_state);

View File

@@ -154,8 +154,8 @@ public class ReblogFragment extends BaseFragment implements TextInputListener {
private final TextInputView input;
private ViewHolder(View v) {
scrollView = (ScrollView) v.findViewById(R.id.scrollView);
progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
scrollView = v.findViewById(R.id.scrollView);
progressBar = v.findViewById(R.id.progressBar);
post = new BlogPostViewHolder(v.findViewById(R.id.postLayout),
true, new OnBlogPostClickListener() {
@Override
@@ -168,7 +168,7 @@ public class ReblogFragment extends BaseFragment implements TextInputListener {
// probably don't want to allow author clicks here
}
});
input = (TextInputView) v.findViewById(R.id.inputText);
input = v.findViewById(R.id.inputText);
}
}
}

View File

@@ -104,13 +104,13 @@ class RssFeedAdapter extends BriarAdapter<Feed, RssFeedAdapter.FeedViewHolder> {
super(v);
layout = v;
title = (TextView) v.findViewById(R.id.titleView);
delete = (ImageButton) v.findViewById(R.id.deleteButton);
imported = (TextView) v.findViewById(R.id.importedView);
updated = (TextView) v.findViewById(R.id.updatedView);
author = (TextView) v.findViewById(R.id.authorView);
authorLabel = (TextView) v.findViewById(R.id.author);
description = (TextView) v.findViewById(R.id.descriptionView);
title = v.findViewById(R.id.titleView);
delete = v.findViewById(R.id.deleteButton);
imported = v.findViewById(R.id.importedView);
updated = v.findViewById(R.id.updatedView);
author = v.findViewById(R.id.authorView);
authorLabel = v.findViewById(R.id.author);
description = v.findViewById(R.id.descriptionView);
}
}

View File

@@ -54,7 +54,7 @@ public class RssFeedImportActivity extends BriarActivity {
setContentView(R.layout.activity_rss_feed_import);
urlInput = (EditText) findViewById(R.id.urlInput);
urlInput = findViewById(R.id.urlInput);
urlInput.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
@@ -72,10 +72,10 @@ public class RssFeedImportActivity extends BriarActivity {
}
});
importButton = (Button) findViewById(R.id.importButton);
importButton = findViewById(R.id.importButton);
importButton.setOnClickListener(v -> publish());
progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar = findViewById(R.id.progressBar);
}
@Override

View File

@@ -49,7 +49,7 @@ public class RssFeedManageActivity extends BriarActivity
adapter = new RssFeedAdapter(this, this);
list = (BriarRecyclerView) findViewById(R.id.feedList);
list = findViewById(R.id.feedList);
list.setLayoutManager(new LinearLayoutManager(this));
list.setAdapter(adapter);
}

View File

@@ -69,7 +69,7 @@ public class WriteBlogPostActivity extends BriarActivity
setContentView(R.layout.activity_write_blog_post);
input = (TextInputView) findViewById(R.id.bodyInput);
input = findViewById(R.id.bodyInput);
input.setSendButtonEnabled(false);
input.addTextChangedListener(new TextWatcher() {
@Override
@@ -89,7 +89,7 @@ public class WriteBlogPostActivity extends BriarActivity
});
input.setListener(this);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar = findViewById(R.id.progressBar);
}
@Override

View File

@@ -31,10 +31,10 @@ public class ContactItemViewHolder<I extends ContactItem>
super(v);
layout = (ViewGroup) v;
avatar = (ImageView) v.findViewById(R.id.avatarView);
name = (TextView) v.findViewById(R.id.nameView);
avatar = v.findViewById(R.id.avatarView);
name = v.findViewById(R.id.nameView);
// this can be null as not all layouts that use this ViewHolder have it
bulb = (ImageView) v.findViewById(R.id.bulbView);
bulb = v.findViewById(R.id.bulbView);
}
protected void bind(I item, @Nullable OnContactClickListener<I> listener) {

View File

@@ -143,7 +143,7 @@ public class ContactListFragment extends BaseFragment implements EventListener {
}
};
adapter = new ContactListAdapter(getContext(), onContactClickListener);
list = (BriarRecyclerView) contentView.findViewById(R.id.list);
list = contentView.findViewById(R.id.list);
list.setLayoutManager(new LinearLayoutManager(getContext()));
list.setAdapter(adapter);
list.setEmptyText(getString(R.string.no_contacts));

View File

@@ -24,8 +24,8 @@ class ContactListItemViewHolder extends ContactItemViewHolder<ContactListItem> {
ContactListItemViewHolder(View v) {
super(v);
unread = (TextView) v.findViewById(R.id.unreadCountView);
date = (TextView) v.findViewById(R.id.dateView);
unread = v.findViewById(R.id.unreadCountView);
date = v.findViewById(R.id.dateView);
}
@Override

View File

@@ -14,7 +14,6 @@ import android.util.SparseArray;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@@ -100,7 +99,7 @@ import javax.inject.Inject;
import de.hdodenhof.circleimageview.CircleImageView;
import im.delight.android.identicons.IdenticonDrawable;
import uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt;
import uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt.OnHidePromptListener;
import uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt.PromptStateChangeListener;
import static android.support.v4.view.ViewCompat.setTransitionName;
import static android.support.v7.util.SortedList.INVALID_POSITION;
@@ -112,6 +111,8 @@ import static org.briarproject.briar.android.settings.SettingsFragment.SETTINGS_
import static org.briarproject.briar.android.util.UiUtils.getAvatarTransitionName;
import static org.briarproject.briar.android.util.UiUtils.getBulbTransitionName;
import static org.briarproject.briar.api.messaging.MessagingConstants.MAX_PRIVATE_MESSAGE_BODY_LENGTH;
import static uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt.STATE_DISMISSED;
import static uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt.STATE_FINISHED;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
@@ -199,23 +200,21 @@ public class ConversationActivity extends BriarActivity
// Custom Toolbar
toolbar = setUpCustomToolbar(true);
if (toolbar != null) {
toolbarAvatar =
(CircleImageView) toolbar.findViewById(R.id.contactAvatar);
toolbarStatus =
(ImageView) toolbar.findViewById(R.id.contactStatus);
toolbarTitle = (TextView) toolbar.findViewById(R.id.contactName);
toolbarAvatar = toolbar.findViewById(R.id.contactAvatar);
toolbarStatus = toolbar.findViewById(R.id.contactStatus);
toolbarTitle = toolbar.findViewById(R.id.contactName);
}
setTransitionName(toolbarAvatar, getAvatarTransitionName(contactId));
setTransitionName(toolbarStatus, getBulbTransitionName(contactId));
adapter = new ConversationAdapter(this, this);
list = (BriarRecyclerView) findViewById(R.id.conversationView);
list = findViewById(R.id.conversationView);
list.setLayoutManager(new LinearLayoutManager(this));
list.setAdapter(adapter);
list.setEmptyText(getString(R.string.no_private_messages));
textInputView = (TextInputView) findViewById(R.id.text_input_container);
textInputView = findViewById(R.id.text_input_container);
textInputView.setListener(this);
}
@@ -393,7 +392,7 @@ public class ConversationActivity extends BriarActivity
/**
* Creates ConversationItems from headers loaded from the database.
*
* <p>
* Attention: Call this only after contactName has been initialized.
*/
@SuppressWarnings("ConstantConditions")
@@ -562,6 +561,7 @@ public class ConversationActivity extends BriarActivity
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
@@ -580,6 +580,7 @@ public class ConversationActivity extends BriarActivity
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
@@ -598,6 +599,7 @@ public class ConversationActivity extends BriarActivity
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
@@ -616,6 +618,7 @@ public class ConversationActivity extends BriarActivity
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
@@ -778,25 +781,25 @@ public class ConversationActivity extends BriarActivity
return;
}
OnHidePromptListener listener = new OnHidePromptListener() {
@Override
public void onHidePrompt(MotionEvent motionEvent,
boolean focalClicked) {
introductionOnboardingSeen();
}
PromptStateChangeListener listener = new PromptStateChangeListener() {
@Override
public void onPromptStateChanged(
MaterialTapTargetPrompt prompt, int state) {
if (state == STATE_DISMISSED ||
state == STATE_FINISHED) {
introductionOnboardingSeen();
}
}
};
new MaterialTapTargetPrompt.Builder(ConversationActivity.this,
R.style.OnboardingDialogTheme).setTarget(target)
.setPrimaryText(R.string.introduction_onboarding_title)
.setSecondaryText(R.string.introduction_onboarding_text)
.setIcon(R.drawable.ic_more_vert_accent)
.setPromptStateChangeListener(listener)
.show();
@Override
public void onHidePromptComplete() {
}
};
new MaterialTapTargetPrompt.Builder(ConversationActivity.this)
.setTarget(target)
.setPrimaryText(R.string.introduction_onboarding_title)
.setSecondaryText(R.string.introduction_onboarding_text)
.setBackgroundColourFromRes(R.color.briar_primary)
.setIcon(R.drawable.ic_more_vert_accent)
.setOnHidePromptListener(listener)
.show();
});
}

View File

@@ -22,9 +22,9 @@ class ConversationItemViewHolder extends ViewHolder {
ConversationItemViewHolder(View v) {
super(v);
layout = (ViewGroup) v.findViewById(R.id.layout);
text = (TextView) v.findViewById(R.id.text);
time = (TextView) v.findViewById(R.id.time);
layout = v.findViewById(R.id.layout);
text = v.findViewById(R.id.text);
time = v.findViewById(R.id.time);
}
@CallSuper

View File

@@ -19,7 +19,7 @@ class ConversationNoticeInViewHolder extends ConversationItemViewHolder {
ConversationNoticeInViewHolder(View v) {
super(v);
msgText = (TextView) v.findViewById(R.id.msgText);
msgText = v.findViewById(R.id.msgText);
}
@Override

View File

@@ -19,7 +19,7 @@ class ConversationNoticeOutViewHolder extends ConversationOutItemViewHolder {
ConversationNoticeOutViewHolder(View v) {
super(v);
msgText = (TextView) v.findViewById(R.id.msgText);
msgText = v.findViewById(R.id.msgText);
}
@Override

View File

@@ -16,7 +16,7 @@ abstract class ConversationOutItemViewHolder
ConversationOutItemViewHolder(View v) {
super(v);
status = (ImageView) v.findViewById(R.id.status);
status = v.findViewById(R.id.status);
}
@Override

View File

@@ -20,8 +20,8 @@ class ConversationRequestViewHolder extends ConversationNoticeInViewHolder {
ConversationRequestViewHolder(View v) {
super(v);
acceptButton = (Button) v.findViewById(R.id.acceptButton);
declineButton = (Button) v.findViewById(R.id.declineButton);
acceptButton = v.findViewById(R.id.acceptButton);
declineButton = v.findViewById(R.id.declineButton);
}
void bind(ConversationItem conversationItem,

View File

@@ -67,7 +67,7 @@ public abstract class BaseContactSelectorFragment<I extends SelectableContactIte
View contentView = inflater.inflate(R.layout.list, container, false);
list = (BriarRecyclerView) contentView.findViewById(R.id.list);
list = contentView.findViewById(R.id.list);
list.setLayoutManager(new LinearLayoutManager(getActivity()));
list.setEmptyText(getString(R.string.no_contacts_selector));
adapter = getAdapter(getContext(), this);

View File

@@ -24,8 +24,8 @@ public class BaseSelectableContactHolder<I extends SelectableContactItem>
public BaseSelectableContactHolder(View v) {
super(v);
checkBox = (CheckBox) v.findViewById(R.id.checkBox);
info = (TextView) v.findViewById(R.id.infoView);
checkBox = v.findViewById(R.id.checkBox);
info = v.findViewById(R.id.infoView);
}
@Override

View File

@@ -54,9 +54,8 @@ public class CreateForumActivity extends BriarActivity {
setContentView(R.layout.activity_create_forum);
nameEntryLayout =
(TextInputLayout) findViewById(R.id.createForumNameLayout);
nameEntry = (EditText) findViewById(R.id.createForumNameEntry);
nameEntryLayout = findViewById(R.id.createForumNameLayout);
nameEntry = findViewById(R.id.createForumNameEntry);
nameEntry.addTextChangedListener(new TextWatcher() {
@Override
@@ -79,10 +78,10 @@ public class CreateForumActivity extends BriarActivity {
return true;
});
createForumButton = (Button) findViewById(R.id.createForumButton);
createForumButton = findViewById(R.id.createForumButton);
createForumButton.setOnClickListener(v -> createForum());
progress = (ProgressBar) findViewById(R.id.createForumProgressBar);
progress = findViewById(R.id.createForumProgressBar);
}
@Override

View File

@@ -133,10 +133,10 @@ class ForumListAdapter
super(v);
layout = (ViewGroup) v;
avatar = (TextAvatarView) v.findViewById(R.id.avatarView);
name = (TextView) v.findViewById(R.id.forumNameView);
postCount = (TextView) v.findViewById(R.id.postCountView);
date = (TextView) v.findViewById(R.id.dateView);
avatar = v.findViewById(R.id.avatarView);
name = v.findViewById(R.id.forumNameView);
postCount = v.findViewById(R.id.postCountView);
date = v.findViewById(R.id.dateView);
}
}
}

View File

@@ -92,7 +92,7 @@ public class ForumListFragment extends BaseEventFragment implements
adapter = new ForumListAdapter(getActivity());
list = (BriarRecyclerView) contentView.findViewById(R.id.forumList);
list = contentView.findViewById(R.id.forumList);
list.setLayoutManager(new LinearLayoutManager(getActivity()));
list.setAdapter(adapter);
list.setEmptyText(getString(R.string.no_forums));

View File

@@ -78,7 +78,7 @@ public class ContactChooserFragment extends BaseFragment {
};
adapter = new ContactListAdapter(getActivity(), onContactClickListener);
list = (BriarRecyclerView) contentView.findViewById(R.id.list);
list = contentView.findViewById(R.id.list);
list.setLayoutManager(new LinearLayoutManager(getActivity()));
list.setAdapter(adapter);
list.setEmptyText(getString(R.string.no_contacts));

View File

@@ -211,13 +211,12 @@ public class IntroductionMessageFragment extends BaseFragment
private final TextInputView message;
private ViewHolder(View v) {
progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
avatar1 = (CircleImageView) v.findViewById(R.id.avatarContact1);
avatar2 = (CircleImageView) v.findViewById(R.id.avatarContact2);
contactName1 = (TextView) v.findViewById(R.id.nameContact1);
contactName2 = (TextView) v.findViewById(R.id.nameContact2);
message = (TextInputView) v
.findViewById(R.id.introductionMessageView);
progressBar = v.findViewById(R.id.progressBar);
avatar1 = v.findViewById(R.id.avatarContact1);
avatar2 = v.findViewById(R.id.avatarContact2);
contactName1 = v.findViewById(R.id.nameContact1);
contactName2 = v.findViewById(R.id.nameContact2);
message = v.findViewById(R.id.introductionMessageView);
}
}
}

View File

@@ -63,7 +63,7 @@ public class IntroFragment extends BaseFragment {
View v = inflater.inflate(R.layout.fragment_keyagreement_id, container,
false);
scrollView = (ScrollView) v.findViewById(R.id.scrollView);
scrollView = v.findViewById(R.id.scrollView);
View button = v.findViewById(R.id.continueButton);
button.setOnClickListener(view -> screenSeenListener.showNextScreen());
return v;

View File

@@ -75,7 +75,7 @@ public class KeyAgreementActivity extends BriarActivity implements
super.onCreate(state);
setContentView(R.layout.activity_fragment_container_toolbar);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

View File

@@ -124,14 +124,12 @@ public class ShowQrCodeFragment extends BaseEventFragment
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
cameraView = (CameraView) view.findViewById(R.id.camera_view);
cameraView = view.findViewById(R.id.camera_view);
statusView = view.findViewById(R.id.status_container);
status = (TextView) view.findViewById(R.id.connect_status);
qrCode = (ImageView) view.findViewById(R.id.qr_code);
mainProgressTitle =
(TextView) view.findViewById(R.id.title_progress_bar);
mainProgressContainer =
(ViewGroup) view.findViewById(R.id.container_progress);
status = view.findViewById(R.id.connect_status);
qrCode = view.findViewById(R.id.qr_code);
mainProgressTitle = view.findViewById(R.id.title_progress_bar);
mainProgressContainer = view.findViewById(R.id.container_progress);
}
@Override

View File

@@ -35,11 +35,9 @@ public class AuthorNameFragment extends SetupFragment {
getActivity().setTitle(getString(R.string.setup_title));
View v = inflater.inflate(R.layout.fragment_setup_author_name,
container, false);
authorNameWrapper =
(TextInputLayout) v.findViewById(R.id.nickname_entry_wrapper);
authorNameInput =
(TextInputEditText) v.findViewById(R.id.nickname_entry);
nextButton = (Button) v.findViewById(R.id.next);
authorNameWrapper = v.findViewById(R.id.nickname_entry_wrapper);
authorNameInput = v.findViewById(R.id.nickname_entry);
nextButton = v.findViewById(R.id.next);
authorNameInput.addTextChangedListener(this);
nextButton.setOnClickListener(this);

View File

@@ -49,20 +49,16 @@ public class ChangePasswordActivity extends BaseActivity
setContentView(R.layout.activity_change_password);
currentPasswordEntryWrapper =
(TextInputLayout) findViewById(
R.id.current_password_entry_wrapper);
newPasswordEntryWrapper =
(TextInputLayout) findViewById(R.id.new_password_entry_wrapper);
findViewById(R.id.current_password_entry_wrapper);
newPasswordEntryWrapper = findViewById(R.id.new_password_entry_wrapper);
newPasswordConfirmationWrapper =
(TextInputLayout) findViewById(
R.id.new_password_confirm_wrapper);
currentPassword = (EditText) findViewById(R.id.current_password_entry);
newPassword = (EditText) findViewById(R.id.new_password_entry);
newPasswordConfirmation =
(EditText) findViewById(R.id.new_password_confirm);
strengthMeter = (StrengthMeter) findViewById(R.id.strength_meter);
changePasswordButton = (Button) findViewById(R.id.change_password);
progress = (ProgressBar) findViewById(R.id.progress_wheel);
findViewById(R.id.new_password_confirm_wrapper);
currentPassword = findViewById(R.id.current_password_entry);
newPassword = findViewById(R.id.new_password_entry);
newPasswordConfirmation = findViewById(R.id.new_password_confirm);
strengthMeter = findViewById(R.id.strength_meter);
changePasswordButton = findViewById(R.id.change_password);
progress = findViewById(R.id.progress_wheel);
TextWatcher tw = new TextWatcher() {

View File

@@ -38,8 +38,8 @@ public class DozeFragment extends SetupFragment {
getActivity().setTitle(getString(R.string.setup_doze_title));
View v = inflater.inflate(R.layout.fragment_setup_doze, container,
false);
dozeButton = (Button) v.findViewById(R.id.dozeButton);
progressBar = (ProgressBar) v.findViewById(R.id.progress);
dozeButton = v.findViewById(R.id.dozeButton);
progressBar = v.findViewById(R.id.progress);
dozeButton.setOnClickListener(view -> askForDozeWhitelisting());

View File

@@ -53,10 +53,10 @@ public class PasswordActivity extends BaseActivity {
}
setContentView(R.layout.activity_password);
signInButton = (Button) findViewById(R.id.btn_sign_in);
progress = (ProgressBar) findViewById(R.id.progress_wheel);
input = (TextInputLayout) findViewById(R.id.password_layout);
password = (EditText) findViewById(R.id.edit_password);
signInButton = findViewById(R.id.btn_sign_in);
progress = findViewById(R.id.progress_wheel);
input = findViewById(R.id.password_layout);
password = findViewById(R.id.edit_password);
password.setOnEditorActionListener((v, actionId, event) -> {
validatePassword();
return true;

View File

@@ -40,16 +40,14 @@ public class PasswordFragment extends SetupFragment {
View v = inflater.inflate(R.layout.fragment_setup_password, container,
false);
strengthMeter = (StrengthMeter) v.findViewById(R.id.strength_meter);
passwordEntryWrapper =
(TextInputLayout) v.findViewById(R.id.password_entry_wrapper);
passwordEntry = (TextInputEditText) v.findViewById(R.id.password_entry);
strengthMeter = v.findViewById(R.id.strength_meter);
passwordEntryWrapper = v.findViewById(R.id.password_entry_wrapper);
passwordEntry = v.findViewById(R.id.password_entry);
passwordConfirmationWrapper =
(TextInputLayout) v.findViewById(R.id.password_confirm_wrapper);
passwordConfirmation =
(TextInputEditText) v.findViewById(R.id.password_confirm);
nextButton = (Button) v.findViewById(R.id.next);
progressBar = (ProgressBar) v.findViewById(R.id.progress);
v.findViewById(R.id.password_confirm_wrapper);
passwordConfirmation = v.findViewById(R.id.password_confirm);
nextButton = v.findViewById(R.id.next);
progressBar = v.findViewById(R.id.progress);
passwordEntry.addTextChangedListener(this);
passwordConfirmation.addTextChangedListener(this);

View File

@@ -109,10 +109,10 @@ public class NavDrawerActivity extends BriarActivity implements
exitIfStartupFailed(getIntent());
setContentView(R.layout.activity_nav_drawer);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
navigation = (NavigationView) findViewById(R.id.navigation);
GridView transportsView = (GridView) findViewById(R.id.transportsView);
Toolbar toolbar = findViewById(R.id.toolbar);
drawerLayout = findViewById(R.id.drawer_layout);
navigation = findViewById(R.id.navigation);
GridView transportsView = findViewById(R.id.transportsView);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@@ -294,12 +294,12 @@ public class NavDrawerActivity extends BriarActivity implements
if (daysUntilExpiry < 0) signOut();
// show expiry warning text
ViewGroup expiryWarning = (ViewGroup) findViewById(R.id.expiryWarning);
ViewGroup expiryWarning = findViewById(R.id.expiryWarning);
TextView expiryWarningText =
(TextView) expiryWarning.findViewById(R.id.expiryWarningText);
expiryWarning.findViewById(R.id.expiryWarningText);
// make close button functional
ImageView expiryWarningClose =
(ImageView) expiryWarning.findViewById(R.id.expiryWarningClose);
expiryWarning.findViewById(R.id.expiryWarningClose);
// show a different snackbar in green if this is an update
if (expiry == UPDATE) {
@@ -386,12 +386,12 @@ public class NavDrawerActivity extends BriarActivity implements
android.R.color.tertiary_text_light);
}
ImageView icon = (ImageView) view.findViewById(R.id.imageView);
ImageView icon = view.findViewById(R.id.imageView);
icon.setImageDrawable(ContextCompat
.getDrawable(NavDrawerActivity.this, t.iconId));
icon.setColorFilter(c);
TextView text = (TextView) view.findViewById(R.id.textView);
TextView text = view.findViewById(R.id.textView);
text.setText(getString(t.textId));
return view;

View File

@@ -43,7 +43,7 @@ public class CreateGroupFragment extends BaseFragment {
View v = inflater.inflate(R.layout.fragment_create_group, container,
false);
nameEntry = (EditText) v.findViewById(R.id.name);
nameEntry = v.findViewById(R.id.name);
nameEntry.addTextChangedListener(new TextWatcher() {
@Override
@@ -66,12 +66,12 @@ public class CreateGroupFragment extends BaseFragment {
return true;
});
nameLayout = (TextInputLayout) v.findViewById(R.id.nameLayout);
nameLayout = v.findViewById(R.id.nameLayout);
createGroupButton = (Button) v.findViewById(R.id.button);
createGroupButton = v.findViewById(R.id.button);
createGroupButton.setOnClickListener(v1 -> createGroup());
progress = (ProgressBar) v.findViewById(R.id.progressBar);
progress = v.findViewById(R.id.progressBar);
return v;
}

View File

@@ -68,7 +68,7 @@ public class GroupListFragment extends BaseFragment implements
View v = inflater.inflate(R.layout.list, container, false);
adapter = new GroupListAdapter(getContext(), this);
list = (BriarRecyclerView) v.findViewById(R.id.list);
list = v.findViewById(R.id.list);
list.setEmptyText(R.string.groups_list_empty);
list.setLayoutManager(new LinearLayoutManager(getContext()));
list.setAdapter(adapter);

View File

@@ -41,13 +41,13 @@ class GroupViewHolder extends RecyclerView.ViewHolder {
super(v);
layout = (ViewGroup) v;
avatar = (TextAvatarView) v.findViewById(R.id.avatarView);
name = (TextView) v.findViewById(R.id.nameView);
creator = (TextView) v.findViewById(R.id.creatorView);
postCount = (TextView) v.findViewById(R.id.messageCountView);
date = (TextView) v.findViewById(R.id.dateView);
status = (TextView) v.findViewById(R.id.statusView);
remove = (Button) v.findViewById(R.id.removeButton);
avatar = v.findViewById(R.id.avatarView);
name = v.findViewById(R.id.nameView);
creator = v.findViewById(R.id.creatorView);
postCount = v.findViewById(R.id.messageCountView);
date = v.findViewById(R.id.dateView);
status = v.findViewById(R.id.statusView);
remove = v.findViewById(R.id.removeButton);
}
void bindView(Context ctx, GroupItem group,

View File

@@ -48,13 +48,13 @@ public class GroupMemberListActivity extends BriarActivity {
if (b == null) throw new IllegalStateException("No GroupId in intent.");
groupId = new GroupId(b);
list = (BriarRecyclerView) findViewById(R.id.list);
list = findViewById(R.id.list);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
list.setLayoutManager(linearLayoutManager);
adapter = new MemberListAdapter(this);
list.setAdapter(adapter);
TextView info = (TextView) findViewById(R.id.info);
TextView info = findViewById(R.id.info);
info.setText(R.string.sharing_status_groups);
}

View File

@@ -22,9 +22,9 @@ class MemberListItemHolder extends RecyclerView.ViewHolder {
MemberListItemHolder(View v) {
super(v);
author = (AuthorView) v.findViewById(R.id.authorView);
bulb = (ImageView) v.findViewById(R.id.bulbView);
creator = (TextView) v.findViewById(R.id.creatorView);
author = v.findViewById(R.id.authorView);
bulb = v.findViewById(R.id.bulbView);
creator = v.findViewById(R.id.creatorView);
}
protected void bind(MemberListItem item) {

View File

@@ -52,7 +52,7 @@ public class RevealContactsActivity extends ContactSelectorActivity
if (b == null) throw new IllegalStateException("No GroupId");
groupId = new GroupId(b);
button = (Button) findViewById(R.id.revealButton);
button = findViewById(R.id.revealButton);
button.setOnClickListener(this);
button.setEnabled(false);

View File

@@ -25,7 +25,7 @@ class RevealableContactViewHolder
RevealableContactViewHolder(View v) {
super(v);
icon = (ImageView) v.findViewById(R.id.visibilityView);
icon = v.findViewById(R.id.visibilityView);
}
@Override

View File

@@ -90,15 +90,15 @@ public class DevReportActivity extends BaseCrashReportDialog
getDelegate().setContentView(R.layout.activity_dev_report);
Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
Toolbar tb = findViewById(R.id.toolbar);
getDelegate().setSupportActionBar(tb);
View requestReport = findViewById(R.id.request_report);
userCommentView = (EditText) findViewById(R.id.user_comment);
userEmailView = (EditText) findViewById(R.id.user_email);
includeDebugReport = (CheckBox) findViewById(R.id.include_debug_report);
chevron = (Button) findViewById(R.id.chevron);
report = (LinearLayout) findViewById(R.id.report_content);
userCommentView = findViewById(R.id.user_comment);
userEmailView = findViewById(R.id.user_email);
includeDebugReport = findViewById(R.id.include_debug_report);
chevron = findViewById(R.id.chevron);
report = findViewById(R.id.report_content);
progress = findViewById(R.id.progress_wheel);
//noinspection ConstantConditions
@@ -262,7 +262,7 @@ public class DevReportActivity extends BaseCrashReportDialog
boolean excluded = excludedFields.contains(field);
View v = inflater.inflate(R.layout.list_item_crash,
report, false);
CheckBox cb = (CheckBox) v
CheckBox cb = v
.findViewById(R.id.include_in_report);
cb.setTag(field);
cb.setChecked(required || !excluded);

View File

@@ -40,7 +40,7 @@ public abstract class BaseMessageFragment extends BaseFragment
// inflate view
View v = inflater.inflate(R.layout.fragment_message, container,
false);
message = (LargeTextInputView) v.findViewById(R.id.messageView);
message = v.findViewById(R.id.messageView);
message.setButtonText(getString(getButtonText()));
message.setHint(getHintText());
message.setListener(this);

View File

@@ -44,7 +44,7 @@ public abstract class InvitationActivity<I extends InvitationItem>
setContentView(R.layout.list);
adapter = getAdapter(this, this);
list = (BriarRecyclerView) findViewById(R.id.list);
list = findViewById(R.id.list);
if (list != null) {
list.setLayoutManager(new LinearLayoutManager(this));
list.setAdapter(adapter);

View File

@@ -29,12 +29,12 @@ public class InvitationViewHolder<I extends InvitationItem>
public InvitationViewHolder(View v) {
super(v);
avatar = (TextAvatarView) v.findViewById(R.id.avatarView);
name = (TextView) v.findViewById(R.id.forumNameView);
sharedBy = (TextView) v.findViewById(R.id.sharedByView);
subscribed = (TextView) v.findViewById(R.id.forumSubscribedView);
accept = (Button) v.findViewById(R.id.acceptButton);
decline = (Button) v.findViewById(R.id.declineButton);
avatar = v.findViewById(R.id.avatarView);
name = v.findViewById(R.id.forumNameView);
sharedBy = v.findViewById(R.id.sharedByView);
subscribed = v.findViewById(R.id.forumSubscribedView);
accept = v.findViewById(R.id.acceptButton);
decline = v.findViewById(R.id.declineButton);
}
@CallSuper

View File

@@ -54,13 +54,13 @@ abstract class SharingStatusActivity extends BriarActivity {
if (b == null) throw new IllegalStateException("No GroupId");
groupId = new GroupId(b);
list = (BriarRecyclerView) findViewById(R.id.list);
list = findViewById(R.id.list);
adapter = new SharingStatusAdapter(this);
list.setLayoutManager(new LinearLayoutManager(this));
list.setAdapter(adapter);
list.setEmptyText(getString(R.string.nobody));
TextView info = (TextView) findViewById(R.id.info);
TextView info = findViewById(R.id.info);
info.setText(getInfoText());
}

View File

@@ -34,9 +34,9 @@ public abstract class BaseThreadItemViewHolder<I extends ThreadItem>
public BaseThreadItemViewHolder(View v) {
super(v);
layout = (ViewGroup) v.findViewById(R.id.layout);
textView = (TextView) v.findViewById(R.id.text);
author = (AuthorView) v.findViewById(R.id.author);
layout = v.findViewById(R.id.layout);
textView = v.findViewById(R.id.text);
author = v.findViewById(R.id.author);
}
@CallSuper

View File

@@ -85,9 +85,9 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI
groupId = new GroupId(b);
getController().setGroupId(groupId);
textInput = (TextInputView) findViewById(R.id.text_input_container);
textInput = findViewById(R.id.text_input_container);
textInput.setListener(this);
list = (BriarRecyclerView) findViewById(R.id.list);
list = findViewById(R.id.list);
layoutManager = new LinearLayoutManager(this);
list.setLayoutManager(layoutManager);
adapter = createAdapter(layoutManager);
@@ -114,8 +114,8 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI
}
}
});
upButton = (UnreadMessageButton) findViewById(R.id.upButton);
downButton = (UnreadMessageButton) findViewById(R.id.downButton);
upButton = findViewById(R.id.upButton);
downButton = findViewById(R.id.downButton);
upButton.setOnClickListener(v -> {
int position = adapter.getVisibleUnreadPosTop();
if (position != NO_POSITION) {

View File

@@ -28,7 +28,7 @@ public class ThreadPostViewHolder<I extends ThreadItem>
public ThreadPostViewHolder(View v) {
super(v);
lvlText = (TextView) v.findViewById(R.id.nested_line_text);
lvlText = v.findViewById(R.id.nested_line_text);
lvls = new View[nestedLineIds.length];
for (int i = 0; i < lvls.length; i++) {
lvls[i] = v.findViewById(nestedLineIds[i]);

View File

@@ -3,8 +3,8 @@ package org.briarproject.briar.android.util;
import android.content.Context;
import android.os.Build;
import android.support.annotation.ColorRes;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.NotificationCompat;
import static android.support.v4.app.NotificationCompat.VISIBILITY_PRIVATE;
import static android.support.v4.app.NotificationCompat.VISIBILITY_SECRET;

View File

@@ -53,12 +53,12 @@ public class AuthorView extends RelativeLayout {
.getSystemService(LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.author_view, this, true);
avatar = (CircleImageView) findViewById(R.id.avatar);
avatarIcon = (ImageView) findViewById(R.id.avatarIcon);
authorName = (TextView) findViewById(R.id.authorName);
avatar = findViewById(R.id.avatar);
avatarIcon = findViewById(R.id.avatarIcon);
authorName = findViewById(R.id.authorName);
authorNameTypeface = authorName.getTypeface();
date = (TextView) findViewById(R.id.dateView);
trustIndicator = (TrustIndicatorView) findViewById(R.id.trustIndicator);
date = findViewById(R.id.dateView);
trustIndicator = findViewById(R.id.trustIndicator);
TypedArray attributes =
context.obtainStyledAttributes(attrs, R.styleable.AuthorView);

View File

@@ -67,9 +67,9 @@ public class BriarRecyclerView extends FrameLayout {
View v = LayoutInflater.from(getContext()).inflate(
R.layout.briar_recycler_view, this, true);
recyclerView = (RecyclerView) v.findViewById(R.id.recyclerView);
emptyView = (TextView) v.findViewById(R.id.emptyView);
progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
recyclerView = v.findViewById(R.id.recyclerView);
emptyView = v.findViewById(R.id.emptyView);
progressBar = v.findViewById(R.id.progressBar);
showProgressBar();

View File

@@ -58,8 +58,7 @@ public class LargeTextInputView extends TextInputView {
if (buttonText != null) setButtonText(buttonText);
if (maxLines > 0) ui.editText.setMaxLines(maxLines);
if (fillHeight) {
LinearLayout layout =
(LinearLayout) findViewById(R.id.input_layout);
LinearLayout layout = findViewById(R.id.input_layout);
LayoutParams params = (LayoutParams) layout.getLayoutParams();
params.height = 0;
params.weight = 1;

View File

@@ -33,11 +33,10 @@ public class TextAvatarView extends FrameLayout {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater
.inflate(R.layout.text_avatar_view, this, true);
character = (AppCompatTextView) findViewById(R.id.textAvatarView);
background = (CircleImageView) findViewById(R.id.avatarBackground);
badge = (TextView) findViewById(R.id.unreadCountView);
inflater.inflate(R.layout.text_avatar_view, this, true);
character = findViewById(R.id.textAvatarView);
background = findViewById(R.id.avatarBackground);
badge = findViewById(R.id.unreadCountView);
badge.setVisibility(INVISIBLE);
}

View File

@@ -193,9 +193,9 @@ public class TextInputView extends KeyboardAwareLinearLayout
final EmojiDrawer emojiDrawer;
private ViewHolder() {
emojiToggle = (EmojiToggle) findViewById(R.id.emoji_toggle);
editText = (EmojiEditText) findViewById(R.id.input_text);
emojiDrawer = (EmojiDrawer) findViewById(R.id.emoji_drawer);
emojiToggle = findViewById(R.id.emoji_toggle);
editText = findViewById(R.id.input_text);
emojiDrawer = findViewById(R.id.emoji_drawer);
sendButton = findViewById(R.id.btn_send);
}
}

View File

@@ -39,8 +39,8 @@ public class UnreadMessageButton extends FrameLayout {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.unread_message_button, this, true);
fab = (FloatingActionButton) findViewById(R.id.fab);
unread = (TextView) findViewById(R.id.unreadCountView);
fab = findViewById(R.id.fab);
unread = findViewById(R.id.unreadCountView);
TypedArray attributes = context.obtainStyledAttributes(attrs,
R.styleable.UnreadMessageButton);

View File

@@ -48,7 +48,7 @@ public class LinkDialogFragment extends DialogFragment {
View v = inflater.inflate(R.layout.fragment_link_dialog, container,
false);
TextView urlView = (TextView) v.findViewById(R.id.urlView);
TextView urlView = v.findViewById(R.id.urlView);
urlView.setText(url);
// prepare normal intent or intent chooser
@@ -60,13 +60,13 @@ public class LinkDialogFragment extends DialogFragment {
Intent intent = choice ? Intent.createChooser(i,
getString(R.string.link_warning_open_link)) : i;
Button openButton = (Button) v.findViewById(R.id.openButton);
Button openButton = v.findViewById(R.id.openButton);
openButton.setOnClickListener(v1 -> {
startActivity(intent);
getDialog().dismiss();
});
Button cancelButton = (Button) v.findViewById(R.id.cancelButton);
Button cancelButton = v.findViewById(R.id.cancelButton);
cancelButton.setOnClickListener(v1 -> getDialog().cancel());
return v;

View File

@@ -72,11 +72,10 @@ public class EmojiDrawer extends LinearLayout {
}
private void initializeResources(View v) {
this.pager = (ViewPager) v.findViewById(R.id.emoji_pager);
this.strip = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);
this.pager = v.findViewById(R.id.emoji_pager);
this.strip = v.findViewById(R.id.tabs);
RepeatableImageKey backspace =
(RepeatableImageKey) v.findViewById(R.id.backspace);
RepeatableImageKey backspace = v.findViewById(R.id.backspace);
backspace.setOnKeyEventListener(() -> {
if (listener != null) listener.onKeyEvent(DELETE_KEY_EVENT);
});

View File

@@ -35,7 +35,7 @@ public class EmojiPageView extends FrameLayout {
super(context, attrs, defStyleAttr);
View view = LayoutInflater.from(getContext())
.inflate(R.layout.emoji_grid_layout, this, true);
grid = (GridView) view.findViewById(R.id.emoji);
grid = view.findViewById(R.id.emoji);
grid.setColumnWidth(getResources()
.getDimensionPixelSize(R.dimen.emoji_drawer_size) + 2 *
getResources().getDimensionPixelSize(

View File

@@ -55,17 +55,17 @@ public class ChangePasswordActivityTest {
MockitoAnnotations.initMocks(this);
changePasswordActivity =
Robolectric.setupActivity(TestChangePasswordActivity.class);
passwordConfirmationWrapper = (TextInputLayout) changePasswordActivity
passwordConfirmationWrapper = changePasswordActivity
.findViewById(R.id.new_password_confirm_wrapper);
currentPassword = (EditText) changePasswordActivity
currentPassword = changePasswordActivity
.findViewById(R.id.current_password_entry);
newPassword = (EditText) changePasswordActivity
newPassword = changePasswordActivity
.findViewById(R.id.new_password_entry);
newPasswordConfirmation = (EditText) changePasswordActivity
newPasswordConfirmation = changePasswordActivity
.findViewById(R.id.new_password_confirm);
strengthMeter = (StrengthMeter) changePasswordActivity
strengthMeter = changePasswordActivity
.findViewById(R.id.strength_meter);
changePasswordButton = (Button) changePasswordActivity
changePasswordButton = changePasswordActivity
.findViewById(R.id.change_password);
}

View File

@@ -48,12 +48,12 @@ public class PasswordFragmentTest {
startFragment(passwordFragment, SetupActivity.class);
View v = passwordFragment.getView();
passwordEntry = (EditText) v.findViewById(R.id.password_entry);
passwordConfirmation = (EditText) v.findViewById(R.id.password_confirm);
passwordEntry = v.findViewById(R.id.password_entry);
passwordConfirmation = v.findViewById(R.id.password_confirm);
passwordConfirmationWrapper =
(TextInputLayout) v.findViewById(R.id.password_confirm_wrapper);
strengthMeter = (StrengthMeter) v.findViewById(R.id.strength_meter);
createAccountButton = (Button) v.findViewById(R.id.next);
v.findViewById(R.id.password_confirm_wrapper);
strengthMeter = v.findViewById(R.id.strength_meter);
createAccountButton = v.findViewById(R.id.next);
}
@Test

View File

@@ -45,10 +45,9 @@ public class SetupActivityTest {
public void setUp() {
MockitoAnnotations.initMocks(this);
setupActivity = Robolectric.setupActivity(SetupActivity.class);
nicknameEntryWrapper = (TextInputLayout) setupActivity
.findViewById(R.id.nickname_entry_wrapper);
nicknameEntry =
(EditText) setupActivity.findViewById(R.id.nickname_entry);
nicknameEntryWrapper =
setupActivity.findViewById(R.id.nickname_entry_wrapper);
nicknameEntry = setupActivity.findViewById(R.id.nickname_entry);
}
@Test

View File

@@ -4,9 +4,7 @@ allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url 'https://maven.google.com'
}
google()
}
}
@@ -14,14 +12,14 @@ buildscript {
repositories {
jcenter()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
google()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'net.ltgt.gradle:gradle-apt-plugin:0.9'
classpath 'de.undercouch:gradle-download-task:3.2.0'
classpath files('libs/gradle-witness.jar')