mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Use kobakei's speed dial library.
This commit is contained in:
@@ -2,6 +2,70 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
|
||||
// prototype
|
||||
repositories {
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':briar-core', configuration: 'default')
|
||||
implementation project(path: ':bramble-core', configuration: 'default')
|
||||
implementation project(':bramble-android')
|
||||
|
||||
def supportVersion = '28.0.0'
|
||||
implementation "com.android.support:support-v4:$supportVersion"
|
||||
implementation("com.android.support:appcompat-v7:$supportVersion") {
|
||||
exclude module: 'support-v4'
|
||||
}
|
||||
implementation("com.android.support:preference-v14:$supportVersion") {
|
||||
exclude module: 'support-v4'
|
||||
}
|
||||
implementation("com.android.support:design:$supportVersion") {
|
||||
exclude module: 'support-v4'
|
||||
exclude module: 'recyclerview-v7'
|
||||
}
|
||||
implementation "com.android.support:cardview-v7:$supportVersion"
|
||||
implementation "com.android.support:support-annotations:$supportVersion"
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
|
||||
implementation('ch.acra:acra:4.9.1') {
|
||||
exclude module: 'support-v4'
|
||||
exclude module: 'support-annotations'
|
||||
}
|
||||
implementation 'info.guardianproject.panic:panic:0.5'
|
||||
implementation 'info.guardianproject.trustedintents:trustedintents:0.2'
|
||||
implementation 'de.hdodenhof:circleimageview:2.2.0'
|
||||
implementation 'com.google.zxing:core:3.3.0'
|
||||
implementation 'uk.co.samuelwall:material-tap-target-prompt:2.8.0'
|
||||
implementation 'com.vanniktech:emoji-google:0.5.1'
|
||||
|
||||
annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
|
||||
|
||||
compileOnly 'javax.annotation:jsr250-api:1.0'
|
||||
|
||||
testImplementation project(path: ':bramble-api', configuration: 'testOutput')
|
||||
testImplementation project(path: ':bramble-core', configuration: 'testOutput')
|
||||
testImplementation 'org.robolectric:robolectric:3.8'
|
||||
testImplementation 'org.robolectric:shadows-support-v4:3.3.2'
|
||||
testImplementation 'org.mockito:mockito-core:2.13.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
testImplementation "org.jmock:jmock:2.8.2"
|
||||
testImplementation "org.jmock:jmock-junit4:2.8.2"
|
||||
testImplementation "org.jmock:jmock-legacy:2.8.2"
|
||||
testImplementation "org.hamcrest:hamcrest-library:1.3"
|
||||
testImplementation "org.hamcrest:hamcrest-core:1.3"
|
||||
|
||||
def espressoVersion = '3.0.2'
|
||||
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion"
|
||||
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espressoVersion"
|
||||
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espressoVersion"
|
||||
androidTestImplementation "tools.fastlane:screengrab:1.1.0"
|
||||
androidTestImplementation "com.android.support.test.uiautomator:uiautomator-v18:2.1.3"
|
||||
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.0.2"
|
||||
androidTestCompileOnly 'javax.annotation:jsr250-api:1.0'
|
||||
androidTestImplementation 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
def getStdout = { command, defaultValue ->
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
try {
|
||||
@@ -127,7 +191,7 @@ dependencies {
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.1.4' // later versions already use androidx
|
||||
|
||||
// prototype
|
||||
implementation "com.leinardi.android:speed-dial:2.0.0"
|
||||
implementation "com.github.kobakei:MaterialFabSpeedDial:1.2.0"
|
||||
|
||||
annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
|
||||
annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.briarproject.briar.android.contact;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.app.ActivityOptionsCompat;
|
||||
@@ -14,9 +15,7 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.leinardi.android.speeddial.SpeedDialActionItem;
|
||||
import com.leinardi.android.speeddial.SpeedDialView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.briarproject.bramble.api.contact.Contact;
|
||||
import org.briarproject.bramble.api.contact.ContactId;
|
||||
@@ -57,6 +56,9 @@ import java.util.logging.Logger;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.github.kobakei.materialfabspeeddial.FabSpeedDial;
|
||||
import io.github.kobakei.materialfabspeeddial.FabSpeedDial.OnMenuItemClickListener;
|
||||
|
||||
import static android.os.Build.VERSION.SDK_INT;
|
||||
import static android.support.design.widget.Snackbar.LENGTH_INDEFINITE;
|
||||
import static android.support.v4.app.ActivityOptionsCompat.makeSceneTransitionAnimation;
|
||||
@@ -70,7 +72,7 @@ import static org.briarproject.briar.android.conversation.ConversationActivity.C
|
||||
@MethodsNotNullByDefault
|
||||
@ParametersNotNullByDefault
|
||||
public class ContactListFragment extends BaseFragment implements EventListener,
|
||||
SpeedDialView.OnActionSelectedListener {
|
||||
OnMenuItemClickListener {
|
||||
|
||||
public static final String TAG = ContactListFragment.class.getName();
|
||||
private static final Logger LOG = Logger.getLogger(TAG);
|
||||
@@ -121,11 +123,12 @@ public class ContactListFragment extends BaseFragment implements EventListener,
|
||||
|
||||
getActivity().setTitle(R.string.contact_list_button);
|
||||
|
||||
View contentView = inflater.inflate(R.layout.fragment_contact_list, container, false);
|
||||
View contentView =
|
||||
inflater.inflate(R.layout.fragment_contact_list, container,
|
||||
false);
|
||||
|
||||
SpeedDialView speedDialView = contentView.findViewById(R.id.speedDial);
|
||||
speedDialView.inflate(R.menu.contact_list_actions);
|
||||
speedDialView.setOnActionSelectedListener(this);
|
||||
FabSpeedDial speedDialView = contentView.findViewById(R.id.speedDial);
|
||||
speedDialView.addOnMenuItemClickListener(this);
|
||||
|
||||
OnContactClickListener<ContactListItem> onContactClickListener =
|
||||
(view, item) -> {
|
||||
@@ -196,23 +199,24 @@ public class ContactListFragment extends BaseFragment implements EventListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActionSelected(SpeedDialActionItem item) {
|
||||
switch (item.getId()) {
|
||||
public void onMenuItemClick(FloatingActionButton fab, TextView v,
|
||||
int itemId) {
|
||||
switch (itemId) {
|
||||
case R.id.action_add_contact:
|
||||
Intent intent =
|
||||
new Intent(getContext(), ContactExchangeActivity.class);
|
||||
startActivity(intent);
|
||||
return false;
|
||||
return;
|
||||
case R.id.action_open_link:
|
||||
startActivity(new Intent(getContext(),
|
||||
ContactInviteInputActivity.class));
|
||||
return false;
|
||||
return;
|
||||
case R.id.action_send_link:
|
||||
startActivity(new Intent(getContext(),
|
||||
ContactInviteOutputActivity.class));
|
||||
return false;
|
||||
return;
|
||||
default:
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,18 +11,14 @@
|
||||
android:layout_height="match_parent"
|
||||
app:scrollToEnd="false"/>
|
||||
|
||||
<com.leinardi.android.speeddial.SpeedDialOverlayLayout
|
||||
android:id="@+id/overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<com.leinardi.android.speeddial.SpeedDialView
|
||||
<io.github.kobakei.materialfabspeeddial.FabSpeedDial
|
||||
android:id="@+id/speedDial"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
app:sdMainFabClosedSrc="@drawable/ic_person_add"
|
||||
app:sdMainFabOpenedSrc="@drawable/ic_close"
|
||||
app:sdOverlayLayout="@id/overlay"/>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:fab_fabDrawable="@drawable/ic_action_add"
|
||||
app:fab_fabRippleColor="@android:color/transparent"
|
||||
app:fab_menu="@menu/contact_list_actions"
|
||||
app:fab_miniFabTextBackground="@color/briar_blue"
|
||||
app:fab_miniFabTextColor="@android:color/white"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
@@ -6,30 +6,21 @@
|
||||
<item
|
||||
android:id="@+id/action_add_contact"
|
||||
android:icon="@drawable/ic_add_nearby"
|
||||
android:orderInCategory="3"
|
||||
android:title="@string/add_contact_nearby_title"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<!--
|
||||
<item
|
||||
android:id="@+id/action_open_link"
|
||||
android:icon="@drawable/ic_link"
|
||||
android:title="@string/open_link_title"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_send_link"
|
||||
android:icon="@drawable/ic_link"
|
||||
android:title="@string/send_link_title"
|
||||
app:showAsAction="never"/>
|
||||
-->
|
||||
<item
|
||||
android:id="@+id/action_open_link"
|
||||
android:icon="@drawable/ic_link_down"
|
||||
android:orderInCategory="2"
|
||||
android:title="@string/open_code_title"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_send_link"
|
||||
android:icon="@drawable/ic_link_up"
|
||||
android:orderInCategory="1"
|
||||
android:title="@string/send_code_title"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ dependencyVerification {
|
||||
'com.github.bumptech.glide:gifdecoder:4.8.0:gifdecoder-4.8.0.aar:b00c5454a023a9488ea49603930d9c25e09192e5ceaadf64977aa52946b3c1b4',
|
||||
'com.github.bumptech.glide:glide:4.8.0:glide-4.8.0.aar:5ddf08b12cc43332e812988f16c2c39e7fce49d1c4d94b7948dcde7f00bf49d6',
|
||||
'com.github.chrisbanes:PhotoView:2.1.4:PhotoView-2.1.4.aar:04cb397fcb3df0757c8aed6927ebdd247930b5c78ee9acc59cd07dccdaaf3460',
|
||||
'com.github.kobakei:MaterialFabSpeedDial:1.2.0:MaterialFabSpeedDial-1.2.0.aar:fda1784d6f213e22079d5c1e9ea53e3e6eb4f908297ccfe6dea588c57aafc800',
|
||||
'com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.0:accessibility-test-framework-2.0.jar:cdf16ef8f5b8023d003ce3cc1b0d51bda737762e2dab2fedf43d1c4292353f7f',
|
||||
'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:1.3.9:jsr305-1.3.9.jar:905721a0eea90a81534abb7ee6ef4ea2e5e645fa1def0a5cd88402df1b46c9ed',
|
||||
@@ -116,7 +117,6 @@ dependencyVerification {
|
||||
'com.ibm.icu:icu4j:53.1:icu4j-53.1.jar:e37a4467bac5cdeb02c5c4b8e5063d2f4e67b69e3c7df6d6b610f13185572bab',
|
||||
'com.jraska:falcon:1.0.4:falcon-1.0.4.aar:6114a48d8b3814f75fc69b5e84dc087c1254883874eae8a36bd778979800630a',
|
||||
'com.squareup:javapoet:1.11.1:javapoet-1.11.1.jar:9cbf2107be499ec6e95afd36b58e3ca122a24166cdd375732e51267d64058e90',
|
||||
'com.leinardi.android:speed-dial:2.0.0:speed-dial-2.0.0.aar:c219aac9e4e803c85a5ebf47f160b31736bc7b17ca56c024ce6803f11fc18741',
|
||||
'com.squareup:javawriter:2.1.1:javawriter-2.1.1.jar:f699823d0081f69cbb676c1845ea222e0ada79bc88a53e5d22d8bd02d328f57e',
|
||||
'com.squareup:javawriter:2.5.0:javawriter-2.5.0.jar:fcfb09fb0ea0aa97d3cfe7ea792398081348e468f126b3603cb3803f240197f0',
|
||||
'com.sun.activation:javax.activation:1.2.0:javax.activation-1.2.0.jar:993302b16cd7056f21e779cc577d175a810bb4900ef73cd8fbf2b50f928ba9ce',
|
||||
@@ -204,6 +204,7 @@ dependencyVerification {
|
||||
'org.robolectric:shadows-framework:4.0.1:shadows-framework-4.0.1.jar:b468a4d0b225e846f3d52c71fe9c3e2dda0b00ced9317a1ea205bb6d78ba1591',
|
||||
'org.robolectric:shadows-support-v4:3.3.2:shadows-support-v4-3.3.2.jar:6f689264738266e70fe08db7c04b7b5a75155994f4e3f7f311960d90486bf005',
|
||||
'org.robolectric:utils:4.0.1:utils-4.0.1.jar:ee923ed66847271009ebeb246286b7206b160c2b6d1347fe820c00be06c280cb',
|
||||
'tools.fastlane:screengrab:1.1.0:screengrab-1.1.0.aar:03ce3868ee8a0082d14e7a1de0999f91531c0cc794392688beb08ee9bc4495fd',
|
||||
'tools.fastlane:screengrab:1.2.0:screengrab-1.2.0.aar:af4ee23bb06f94404d3ab18e2ea69db8265539fc8da29f9ee45b7e472684ba83',
|
||||
'uk.co.samuelwall:material-tap-target-prompt:2.12.4:material-tap-target-prompt-2.12.4.aar:6c0990ab3aa22de9f7d09dcb0a944e671128c31634ac8429012faa5c508202fb',
|
||||
]
|
||||
|
||||
@@ -27,6 +27,7 @@ dependencyVerification {
|
||||
'javax.annotation:jsr250-api:1.0:jsr250-api-1.0.jar:a1a922d0d9b6d183ed3800dfac01d1e1eb159f0e8c6f94736931c1def54a941f',
|
||||
'javax.inject:javax.inject:1:javax.inject-1.jar:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
|
||||
'javax.servlet:javax.servlet-api:3.1.0:javax.servlet-api-3.1.0.jar:af456b2dd41c4e82cf54f3e743bc678973d9fe35bd4d3071fa05c7e5333b8482',
|
||||
'khttp:khttp:0.1.0:khttp-0.1.0.jar:48ab3bd22e461f2c2e74e3446d8f9568e24aab157f61fdc85ded6c0bfbe9a926',
|
||||
'net.bytebuddy:byte-buddy-agent:1.8.22:byte-buddy-agent-1.8.22.jar:ebc20e83fbb13e7911e4c704c9548a4166d7e83922f80de700ae5c5c983943d5',
|
||||
'net.bytebuddy:byte-buddy:1.8.22:byte-buddy-1.8.22.jar:d330d2ef290a2852bbaf06eab03bc93d24501599c8a836da9d946f82c48e276c',
|
||||
'org.apiguardian:apiguardian-api:1.0.0:apiguardian-api-1.0.0.jar:1f58b77470d8d147a0538d515347dd322f49a83b9e884b8970051160464b65b3',
|
||||
@@ -63,6 +64,7 @@ dependencyVerification {
|
||||
'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71:kotlin-stdlib-jdk8-1.2.71.jar:ac3c8abf47790b64b4f7e2509a53f0c145e061ac1612a597520535d199946ea9',
|
||||
'org.jetbrains.kotlin:kotlin-stdlib:1.2.71:kotlin-stdlib-1.2.71.jar:4c895c270b87f5fec2a2796e1d89c15407ee821de961527c28588bb46afbc68b',
|
||||
'org.jetbrains:annotations:13.0:annotations-13.0.jar:ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478',
|
||||
'org.json:json:20150729:json-20150729.jar:38c21b9c3d6d24919cd15d027d20afab0a019ac9205f7ed9083b32bdd42a2353',
|
||||
'org.junit.jupiter:junit-jupiter-api:5.3.1:junit-jupiter-api-5.3.1.jar:7923e21f030a9964d70a0e48007ca873280c66ddf0f0620b2d969852c23d5653',
|
||||
'org.junit.jupiter:junit-jupiter-engine:5.3.1:junit-jupiter-engine-5.3.1.jar:04f4354548a30827e126bdf6fcbe3640789ad8335a6f3f0762bf7f9f74e51fbf',
|
||||
'org.junit.jupiter:junit-jupiter-params:5.3.1:junit-jupiter-params-5.3.1.jar:72fe344712d4cd88dd0cb4bfa304322d512d2cb27173ed64cb5036a573d29f4c',
|
||||
|
||||
Reference in New Issue
Block a user