Commit c32817cf authored by Hussein's avatar Hussein

P4A-5 Rewrite manual key import wizard to be keysync wizard

parent f4055b34
......@@ -47,7 +47,7 @@ import com.fsck.k9.pEp.infrastructure.Poller;
import com.fsck.k9.pEp.infrastructure.components.ApplicationComponent;
import com.fsck.k9.pEp.infrastructure.components.DaggerApplicationComponent;
import com.fsck.k9.pEp.infrastructure.modules.ApplicationModule;
import com.fsck.k9.pEp.ui.keysync.PEpAddDevice;
import com.fsck.k9.pEp.manualsync.ImportWizardFrompEp;
import com.fsck.k9.power.DeviceIdleManager;
import com.fsck.k9.preferences.Storage;
import com.fsck.k9.preferences.StorageEditor;
......@@ -784,8 +784,11 @@ public class K9 extends MultiDexApplication {
}
public PEpProvider getpEpSyncProvider() {
if (pEpSyncEnabled) return pEpSyncProvider;
else return pEpProvider;
if (pEpSyncEnabled) {
return pEpSyncProvider;
} else {
return pEpProvider;
}
}
private void initSync() {
......@@ -806,19 +809,17 @@ public class K9 extends MultiDexApplication {
}
});
// if (Preferences.getPreferences(this).getAccounts().size() > 0) {
if (!pEpSyncProvider.isSyncRunning()) {
if (!pEpSyncProvider.isSyncRunning()) {
pEpSyncProvider.startSync();
}
// }
}
private void goToAddDevice(Identity myself, Identity partner, SyncHandshakeSignal signal, String explanation) {
private void goToAddDevice(Identity myself, Identity partner, SyncHandshakeSignal signal, boolean formingGroup) {
Timber.i("PEPJNI", "showHandshake: " + signal.name() + " " + myself.toString() + "\n::\n" + partner.toString());
language = Locale.getDefault().getLanguage();
String trust = pEpSyncProvider.trustwords(myself, partner, language, true);
Context context = K9.this.getApplicationContext();
Intent syncTrustowordsActivity = PEpAddDevice.getActionRequestHandshake(context, trust, myself, partner, explanation, false);
Intent syncTrustowordsActivity = ImportWizardFrompEp.createActionStartKeySyncIntent(context, myself, partner, signal, formingGroup);
syncTrustowordsActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(syncTrustowordsActivity);
}
......@@ -1073,6 +1074,10 @@ public class K9 extends MultiDexApplication {
return language;
}
public static String getK9CurrentLanguage() {
return language.isEmpty() ? Locale.getDefault().getLanguage() : language;
}
public static void setK9Language(String nlanguage) {
language = nlanguage;
}
......@@ -1827,6 +1832,7 @@ public class K9 extends MultiDexApplication {
} else {
shutdownSync();
}
forceSaveAppSettings();
}
public boolean needsFastPoll() {
......@@ -1845,42 +1851,41 @@ public class K9 extends MultiDexApplication {
@Override
public void notifyHandshake(Identity myself, Identity partner, SyncHandshakeSignal signal) {
System.out.println("pEpSync" + "notifyHandshakeCallFromC: " + notifyHandshakeCallback + " :: " + signal.name());
new Handler(Looper.getMainLooper()).post(()
-> Toast.makeText(K9.this, signal.name(), Toast.LENGTH_SHORT).show());
Log.e("pEpEngine", String.format("pEp notifyHandshake: %s", signal.name()));
// Before starting a new "event" we dismiss the current one.
Intent broadcastIntent = new Intent("KEYSYNC_DISMISS");
K9.this.sendOrderedBroadcast(broadcastIntent, null);
// Intent broadcastIntent = new Intent("KEYSYNC_DISMISS");
// K9.this.sendOrderedBroadcast(broadcastIntent, null);
switch (signal) {
case SyncNotifyUndefined:
break;
case SyncNotifyInitAddOurDevice:
case SyncNotifyInitAddOtherDevice:
ImportWizardFrompEp.actionStartKeySync(getApplicationContext(), myself, partner, signal, false);
break;
case SyncNotifyInitFormGroup:
ImportWizardFrompEp.actionStartKeySync(getApplicationContext(), myself, partner, signal, true);
needsFastPoll = true;
goToAddDevice(myself, partner, signal, getString(R.string.pep_add_device_ask_trustwords));
break;
case SyncNotifyTimeout:
//Close handshake
new Handler(Looper.getMainLooper()).post(()
-> Toast.makeText(K9.this, R.string.pep_keysync_timeout, Toast.LENGTH_SHORT).show());
ImportWizardFrompEp.notifyNewSignal(getApplicationContext(), signal);
needsFastPoll = false;
break;
case SyncNotifyAcceptedDeviceAdded:
case SyncNotifyAcceptedGroupCreated:
needsFastPoll = false;
new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(K9.this, R.string.pep_device_group, Toast.LENGTH_LONG).show());
break;
case SyncNotifySole:
needsFastPoll = false;
grouped = false;
ImportWizardFrompEp.notifyNewSignal(getApplicationContext(), signal);
break;
case SyncNotifyInGroup:
needsFastPoll = false;
grouped = true;
pEpSyncEnabled = true;
ImportWizardFrompEp.notifyNewSignal(getApplicationContext(), signal);
break;
}
......@@ -1915,5 +1920,12 @@ public class K9 extends MultiDexApplication {
pEpSyncEnabled = false;
}
private void forceSaveAppSettings() {
StorageEditor editor = Preferences.getPreferences(this).getStorage().edit();
save(editor);
editor.commit();
}
}
......@@ -105,10 +105,6 @@ import com.fsck.k9.pEp.PEpProviderImpl;
import com.fsck.k9.pEp.PEpUtils;
import com.fsck.k9.pEp.infrastructure.exceptions.AppCannotDecryptException;
import com.fsck.k9.pEp.infrastructure.exceptions.AppDidntEncryptMessageException;
import com.fsck.k9.pEp.manualsync.ImportKeyController;
import com.fsck.k9.pEp.manualsync.ImportKeyController.KeyImportMessagingActions;
import com.fsck.k9.pEp.manualsync.ImportKeyControllerFactory;
import com.fsck.k9.pEp.manualsync.ImportWizardPresenter;
import com.fsck.k9.provider.EmailProvider;
import com.fsck.k9.provider.EmailProvider.StatsColumns;
import com.fsck.k9.search.ConditionsTreeNode;
......
......@@ -188,11 +188,11 @@ public interface PEpProvider extends AutoCloseable {
//com.fsck.k9.mail.Message getMimeMessage(Message message);
void acceptHandshake(Identity identity);
void acceptSync();
void rejectHandshake(Identity identity);
void rejectSync();
void cancelHandshake(Identity identity);
void cancelSync();
void loadMessageRatingAfterResetTrust(MimeMessage message, boolean isIncoming, Identity id, ResultCallback<Rating> loadedCallback);
......
......@@ -929,17 +929,17 @@ public class PEpProviderImpl implements PEpProvider {
//FIXME: Implement sync use lists.
@Override
public synchronized void acceptHandshake(Identity identity) {
public synchronized void acceptSync() {
engine.deliverHandshakeResult(SyncHandshakeResult.SyncHandshakeAccepted, new Vector<>());
}
@Override
public synchronized void rejectHandshake(Identity identity) {
public synchronized void rejectSync() {
engine.deliverHandshakeResult(SyncHandshakeResult.SyncHandshakeRejected, new Vector<>());
}
@Override
public synchronized void cancelHandshake(Identity identity) {
public synchronized void cancelSync() {
engine.deliverHandshakeResult(SyncHandshakeResult.SyncHandshakeCancel, new Vector<>());
}
......
......@@ -58,7 +58,7 @@ public class PEpUtils {
private static final String TRUSTWORDS_SEPARATOR = " ";
private static final int CHUNK_SIZE = 4;
private static final CharSequence[] pEpLanguages = {"ca", "de", "es", "fr", "tr", "en"};
private static final CharSequence[] pEpLanguages = {"ca", "de", "es", "fr", "tr", "en", "nl"};
public static CharSequence[] getPEpLocales() {
return pEpLanguages;
......
......@@ -10,8 +10,6 @@ import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.pEp.PEpProvider;
import com.fsck.k9.pEp.manualsync.ImportKeyController;
import com.fsck.k9.pEp.manualsync.ImportKeyControllerFactory;
import com.fsck.k9.pEp.ui.SimpleMessageLoaderHelper;
import com.fsck.k9.pEp.ui.fragments.PEpSettingsCheck;
import com.fsck.k9.pEp.ui.fragments.PEpSettingsChecker;
......@@ -22,8 +20,6 @@ import dagger.Module;
import dagger.Provides;
import security.pEp.permissions.PermissionChecker;
import security.pEp.ui.permissions.PEpPermissionChecker;
import security.pEp.ui.resources.PEpResourcesProvider;
import security.pEp.ui.resources.ResourcesProvider;
@Module
public class PEpModule {
......@@ -69,11 +65,6 @@ public class PEpModule {
return MessagingController.getInstance(context);
}
@Provides
public ImportKeyController provideImportkeyController(@Named("Background") PEpProvider pEp) {
return ImportKeyControllerFactory.getInstance().getImportKeyController(context, pEp);
}
@Provides
public Preferences providePreferences() {
return Preferences.getPreferences(context);
......
package com.fsck.k9.pEp.manualsync;
import android.content.Context;
import com.fsck.k9.K9;
import com.fsck.k9.pEp.PEpProvider;
public class ImportKeyControllerFactory {
private static ImportKeyControllerFactory INSTANCE = null;
private ImportKeyController importKeyController = null;
private ImportKeyControllerFactory() {
}
public static ImportKeyControllerFactory getInstance() {
if (INSTANCE == null) {
synchronized (ImportKeyControllerFactory.class) {
INSTANCE = new ImportKeyControllerFactory();
}
}
return INSTANCE;
}
public ImportKeyController getImportKeyController(Context context, PEpProvider pEp) {
if (importKeyController == null) {
synchronized (ImportKeyControllerFactory.class) {
importKeyController = new ImportKeyController(((K9) context.getApplicationContext()), pEp);
}
}
return importKeyController;
}
}
package com.fsck.k9.pEp.manualsync;
interface ImportWizardFromPGPView {
void showDescription(String description);
void renderpEpCreateDeviceGroupRequest();
void setImportTitle(String type);
void renderpEpInitialScreen();
void renderPGPInitialScreen();
void renderWaitingForHandshake();
void renderWaitingForPGPHandshake();
void renderpEpSecondlScreen();
void notifyAcceptedHandshakeAndWaitingForPrivateKey();
void notifyKeySent();
void finishImportSuccefully();
void renderpEpAddToExistingDeviceGroupRequest();
void close();
void cancel();
void setDialogEnabled();
void showHandshake(String trustwords);
void showWaitingForSync();
void showGroupCreated();
void notifyAcceptedHandshakeAndWaitingForPGPPrivateKey();
void showJoinedGroup();
void starSendKeyImportRequest();
void showSomethingWentWrong();
void finishSendingKeyImport();
void disableSync();
void showSendError();
void showLongTrustwordsIndicator();
void notifySendingOwnKey();
void hideLongTrustwordsIndicator();
void renderPgpSendHandshakeFirstStep();
void prepareGroupCreationLoading();
void renderPgpSendHandshakeSecondStep();
void prepareGroupJoiningLoading();
}
......@@ -223,18 +223,18 @@ public class AddDevicePresenter implements Presenter {
@Override
void acceptHandshake(Identity partner) {
Log.e("pEpEngine", String.format("acceptHandshake: myself(%s), partner(%s)", pEpProvider.myself(partner), partner) );
pEpProvider.acceptHandshake(pEpProvider.myself(partner));
Log.e("pEpEngine", String.format("acceptSync: myself(%s), partner(%s)", pEpProvider.myself(partner), partner) );
pEpProvider.acceptSync();
}
@Override
void rejectHandshake(Identity partner) {
pEpProvider.rejectHandshake(partner);
pEpProvider.rejectSync();
}
@Override
void cancelHandshake(Identity partner) {
pEpProvider.cancelHandshake(partner);
pEpProvider.cancelSync();
}
}
}
......@@ -448,7 +448,7 @@ public class PEpAddDevice extends WizardActivity implements AddDeviceView {
@OnClick(R.id.add_device_background)
public void onClickOutside() {
//presenter.cancelHandshake();
//presenter.cancelSync();
}
@OnClick(R.id.show_long_trustwords)
......
package security.pEp.sync
import foundation.pEp.jniadapter.SyncHandshakeSignal
//TODO: Rewrite the wizard.
abstract class SyncAction
class Cancel: SyncAction()
class Next: SyncAction()
class Reject: SyncAction()
class confirm: SyncAction()
class leave: SyncAction()
class retry: SyncAction()
enum class DeviceGroupStatus {
SOLE, GROUPED, ADDING
}
interface KeySyncWizardView {
fun showHandshake()
}
interface KeySyncWizard {
//fun getText(): String
fun getCurrentState(): SyncState
fun notify(signal: SyncHandshakeSignal) {
when (signal) {
SyncHandshakeSignal.SyncNotifySole -> TODO()
SyncHandshakeSignal.SyncNotifyUndefined -> TODO()
SyncHandshakeSignal.SyncNotifyInitAddOurDevice -> TODO()
SyncHandshakeSignal.SyncNotifyInitAddOtherDevice -> TODO()
SyncHandshakeSignal.SyncNotifyInitFormGroup -> TODO()
SyncHandshakeSignal.SyncNotifyTimeout -> TODO()
SyncHandshakeSignal.SyncNotifyAcceptedDeviceAdded -> TODO()
SyncHandshakeSignal.SyncNotifyAcceptedGroupCreated -> TODO()
SyncHandshakeSignal.SyncNotifyAcceptedDeviceAccepted -> TODO()
SyncHandshakeSignal.SyncNotifyInGroup -> TODO()
}
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class KeySyncAppWizard(var state: SyncState = SyncState.INITIAL) : KeySyncWizard {
init {
state.next()
}
override fun getCurrentState(): SyncState {
return state
}
}
enum class SyncState {
INITIAL {
override fun next() = HANDSHAKING
},
HANDSHAKING {
override fun next() = WAITING
},
WAITING {
override fun next() = DONE
},
DONE {
override fun next() = INITIAL
},
ERROR {
override fun next(): SyncState {
throw IllegalStateException("In case of error is needed to explicitly cancel().")
}
};
abstract fun next(): SyncState
fun finish(): SyncState = INITIAL
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_sync_grouped_add_device" android:duration="200" />
<item android:drawable="@drawable/ic_sync_grouped_device_added" android:duration="200" />
</animation-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_sync_create_devicegroup" android:duration="200" />
<item android:drawable="@drawable/ic_sync_add_devicegroup_created" android:duration="200" />
</animation-list>
\ No newline at end of file
<vector android:autoMirrored="true" android:height="56.8dp"
android:viewportHeight="56.8" android:viewportWidth="98.4"
android:width="98.4dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M57.1,51.0561h-39.4c-0.5,0 -0.9,-0.4 -0.9,-0.9v-48.1c0,-0.5 0.4,-0.9 0.9,-0.9h62.8c0.5,0 0.9,0.4 0.9,0.9v3.3"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M0.2,55.6561L98.2,55.6561"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M62.153,8.272h26.5c0.6,0 1,0.4 1,1v40.4c0,0.6 -0.4,1 -1,1L62.153,50.672c-0.6,0 -1,-0.4 -1,-1L61.153,9.272C61.153,8.772 61.553,8.272 62.153,8.272z"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M75.447,47.432m-0.6,0a0.6,0.6 0,1 1,1.2 0a0.6,0.6 0,1 1,-1.2 0"
android:strokeColor="#43A047" android:strokeWidth="2"/>
</vector>
<vector android:autoMirrored="true" android:height="56.8dp"
android:viewportHeight="56.8" android:viewportWidth="155.1"
android:width="155.1dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M19.053,1.2h60.5c1.1,0 1.9,0.9 1.9,1.9L81.453,49c0,1.1 -0.9,1.9 -1.9,1.9L19.053,50.9c-1.1,0 -1.9,-0.9 -1.9,-1.9L17.153,3.2C17.053,2.1 17.953,1.2 19.053,1.2z"
android:strokeColor="#43A047" android:strokeWidth="1.9379"/>
<path android:fillColor="#00000000"
android:pathData="M0.3,55.589L98.1,55.589"
android:strokeColor="#43A047" android:strokeWidth="1.9379"/>
<path android:fillColor="#00000000"
android:pathData="M124.253,3.846h26.8c1.6,0 2.9,1.3 2.9,2.9v42.6c0,1.6 -1.3,2.9 -2.9,2.9L124.253,52.246c-1.6,0 -2.9,-1.3 -2.9,-2.9L121.353,6.746C121.353,5.146 122.653,3.846 124.253,3.846z"
android:strokeColor="#43A047" android:strokeWidth="1.9379"/>
<path android:fillColor="#00000000"
android:pathData="M137.768,48.324m-0.9,0a0.9,0.9 0,1 1,1.8 0a0.9,0.9 0,1 1,-1.8 0"
android:strokeColor="#43A047" android:strokeWidth="1.9379"/>
</vector>
<vector android:autoMirrored="true" android:height="56.8dp"
android:viewportHeight="56.8" android:viewportWidth="136"
android:width="136dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M115.101,19.735h19.2c0.3,0 0.5,0.2 0.5,0.5v33.8c0,0.3 -0.2,0.5 -0.5,0.5L115.101,54.535c-0.3,0 -0.5,-0.2 -0.5,-0.5L114.601,20.235C114.601,19.935 114.801,19.735 115.101,19.735z"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
<path android:fillColor="#00000000"
android:pathData="M115.101,19.735h19.2c0.3,0 0.5,0.2 0.5,0.5v33.8c0,0.3 -0.2,0.5 -0.5,0.5L115.101,54.535c-0.3,0 -0.5,-0.2 -0.5,-0.5L114.601,20.235C114.601,19.935 114.801,19.735 115.101,19.735z"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
<path android:fillColor="#00000000"
android:pathData="M124.717,51.442m-0.6,0a0.6,0.6 0,1 1,1.2 0a0.6,0.6 0,1 1,-1.2 0"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
<path android:fillColor="#00000000"
android:pathData="M56.9,50.856h-39.2c-0.5,0 -0.9,-0.4 -0.9,-0.9v-47.8c0,-0.5 0.4,-0.9 0.9,-0.9h62.5c0.5,0 0.9,0.4 0.9,0.9v3.3"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
<path android:fillColor="#00000000"
android:pathData="M0.2,55.456L97.7,55.456"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
<path android:fillColor="#00000000"
android:pathData="M61.853,8.372h26.3c0.5,0 1,0.4 1,1v40.2c0,0.5 -0.4,1 -1,1L61.853,50.572c-0.5,0 -1,-0.4 -1,-1L60.853,9.372C60.853,8.772 61.253,8.372 61.853,8.372z"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
<path android:fillColor="#00000000"
android:pathData="M75.047,47.232m-0.6,0a0.6,0.6 0,1 1,1.2 0a0.6,0.6 0,1 1,-1.2 0"
android:strokeColor="#43A047" android:strokeWidth="1.9899"/>
</vector>
<vector android:autoMirrored="true" android:height="56.8dp"
android:viewportHeight="56.8" android:viewportWidth="98.4"
android:width="98.4dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M57.2,51.056h-39.4c-0.5,0 -0.9,-0.4 -0.9,-0.9v-48.1c0,-0.5 0.4,-0.9 0.9,-0.9h62.8c0.5,0 0.9,0.4 0.9,0.9v3.3"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M76.701,15.735L96.001,15.735c0.3,0 0.5,0.2 0.5,0.5v34c0,0.3 -0.2,0.5 -0.5,0.5L76.701,50.735c-0.3,0 -0.5,-0.2 -0.5,-0.5v-34C76.201,16.035 76.401,15.735 76.701,15.735z"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M76.701,15.735L96.001,15.735c0.3,0 0.5,0.2 0.5,0.5v34c0,0.3 -0.2,0.5 -0.5,0.5L76.701,50.735c-0.3,0 -0.5,-0.2 -0.5,-0.5v-34C76.201,16.035 76.401,15.735 76.701,15.735z"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M86.317,47.642m-0.6,0a0.6,0.6 0,1 1,1.2 0a0.6,0.6 0,1 1,-1.2 0"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M61.576,50.926c-0.3,0 -0.6,-0.3 -0.6,-0.6L60.976,8.926c0,-0.3 0.3,-0.6 0.6,-0.6h27.5c0.3,0 0.6,0.3 0.6,0.6"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M71.876,50.926L61.576,50.926c-0.3,0 -0.6,-0.3 -0.6,-0.6L60.976,8.926c0,-0.3 0.3,-0.6 0.6,-0.6h27.5c0.3,0 0.6,0.3 0.6,0.6v2.9"
android:strokeColor="#43A047" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M0.2,55.656L98.2,55.656"
android:strokeColor="#43A047" android:strokeWidth="2"/>
</vector>
......@@ -4,41 +4,27 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_width="@dimen/key_import_floating_width"
tools:layout_height="@dimen/key_import_floating_height"
tools:layout_gravity="center"
android:background="@color/white"
android:clipChildren="false"
android:clipToPadding="false"
tools:context="com.fsck.k9.pEp.manualsync.ImportWizardFrompEp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="16dp">
tools:layout_editor_absoluteY="16dp"
android:paddingStart="@dimen/key_import_floating_horizontal_margin"
android:paddingLeft="@dimen/key_import_floating_horizontal_margin"
android:paddingEnd="@dimen/key_import_floating_horizontal_margin"
android:paddingRight="@dimen/key_import_floating_horizontal_margin"
android:paddingTop="@dimen/key_import_floating_vertical_margin"
android:paddingBottom="@dimen/key_import_floating_vertical_margin"
android:id="@+id/main_container">
<include
android:id="@+id/include"
layout="@layout/handshake_toolbar_layout" />
<Button
android:id="@+id/startKeyImportButton"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:text="Start"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/cancelKeyImportButton" />
<Button
android:id="@+id/cancelKeyImportButton"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:text="Cancel"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/startKeyImportButton" />
<TextView
android:id="@+id/description"
......@@ -50,47 +36,111 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include"
tools:text="@string/pgp_key_import_instructions" />
tools:text="A second device was detected. We can form a device group to sync all your privacy on both devices. Shall we start synchronizing\?" />
<ProgressBar
android:id="@+id/loading"
style="?android:attr/progressBarStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginBottom="8dp"
android:visibility="invisible"
app:layout_constraintBottom_toTopOf="@+id/tvCurrentAction"
android:layout_width="144dp"
android:layout_height="96dp"
android:indeterminateDrawable="@drawable/add_second_device"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible" />
app:layout_constraintTop_toBottomOf="@+id/description" />
<TextView
android:id="@+id/tvCurrentAction"
<ImageView
android:id="@+id/currentState"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_sync_create_devicegroup"
android:visibility="visible"
tools:visibility="gone"
app:srcCompat="@drawable/ic_sync_create_devicegroup"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description" />
<LinearLayout
android:id="@+id/trustwordsContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="vertical"
tools:visibility="visible"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/startKeyImportButton"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
tools:text="TextView"
tools:visibility="visible" />
app:layout_constraintTop_toBottomOf="@+id/description"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_sync_create_devicegroup">
<TextView
android:id="@+id/tvProtocol"
<TextView
android:id="@+id/trustwords"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:breakStrategy="simple"
android:ellipsize="none"
android:padding="8dp"
android:textSize="14sp"
android:textStyle="bold"
tools:text="IMPORTUNER METAPHOR ARNO DIABETES SEMIYEARLY SIDEREAL CORONATE CURSEDNESS PULMONARY DUVET" />
<ImageView
android:id="@+id/show_long_trustwords"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selectable_message_background"
android:src="@drawable/ic_show_long_trustwords" />
</LinearLayout>
<Button
android:id="@+id/afirmativeActionButton"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/univers_lts_sd"
android:gravity="center"
android:text="@string/pep"
android:textAlignment="center"
android:textColor="@color/pep_green"
android:textSize="48sp"
app:layout_constraintBottom_toTopOf="@+id/loading"
android:text="@string/keysync_wizard_action_next"
tools:text="next"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintTop_toTopOf="@+id/dissmissActionButton" />
<Button
android:id="@+id/negativeActionButton"
style="?attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/key_import_reject"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/afirmativeActionButton"
app:layout_constraintStart_toEndOf="@+id/dissmissActionButton"
app:layout_constraintTop_toTopOf="@+id/dissmissActionButton"
app:layout_constraintVertical_bias="1.0"
android:textColor="@color/red"
tools:text="Reject"
android:visibility="gone"/>
<Button
android:id="@+id/dissmissActionButton"