change RemoteRegisterActivity into a dialog
This commit is contained in:
@@ -861,6 +861,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".remote.ui.RemoteRegisterActivity"
|
android:name=".remote.ui.RemoteRegisterActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
|
android:theme="@style/Theme.Keychain.Transparent"
|
||||||
android:label="@string/app_name" />
|
android:label="@string/app_name" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".remote.ui.RemoteSelectPubKeyActivity"
|
android:name=".remote.ui.RemoteSelectPubKeyActivity"
|
||||||
|
|||||||
@@ -18,76 +18,173 @@
|
|||||||
package org.sufficientlysecure.keychain.remote.ui;
|
package org.sufficientlysecure.keychain.remote.ui;
|
||||||
|
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.view.ContextThemeWrapper;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.remote.ui.RemoteRegisterPresenter.RemoteRegisterView;
|
import org.sufficientlysecure.keychain.remote.ui.RemoteRegisterPresenter.RemoteRegisterView;
|
||||||
import org.sufficientlysecure.keychain.ui.base.BaseActivity;
|
import org.sufficientlysecure.keychain.ui.dialog.CustomAlertDialogBuilder;
|
||||||
|
import org.sufficientlysecure.keychain.ui.util.ThemeChanger;
|
||||||
|
|
||||||
|
|
||||||
public class RemoteRegisterActivity extends BaseActivity implements RemoteRegisterView {
|
public class RemoteRegisterActivity extends FragmentActivity {
|
||||||
|
|
||||||
public static final String EXTRA_PACKAGE_NAME = "package_name";
|
public static final String EXTRA_PACKAGE_NAME = "package_name";
|
||||||
public static final String EXTRA_PACKAGE_SIGNATURE = "package_signature";
|
public static final String EXTRA_PACKAGE_SIGNATURE = "package_signature";
|
||||||
|
|
||||||
public static final String EXTRA_DATA = "data";
|
public static final String EXTRA_DATA = "data";
|
||||||
|
|
||||||
private AppSettingsHeaderFragment mAppSettingsHeaderFragment;
|
|
||||||
private RemoteRegisterPresenter presenter;
|
private RemoteRegisterPresenter presenter;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
this.presenter = new RemoteRegisterPresenter(getBaseContext());
|
this.presenter = new RemoteRegisterPresenter(getBaseContext());
|
||||||
|
|
||||||
|
if (savedInstanceState == null) {
|
||||||
|
RemoteRegisterDialogFragment frag = new RemoteRegisterDialogFragment();
|
||||||
|
frag.show(getSupportFragmentManager(), "requestKeyDialog");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
Intent resultData = intent.getParcelableExtra(EXTRA_DATA);
|
Intent resultData = intent.getParcelableExtra(EXTRA_DATA);
|
||||||
String packageName = intent.getStringExtra(EXTRA_PACKAGE_NAME);
|
String packageName = intent.getStringExtra(EXTRA_PACKAGE_NAME);
|
||||||
byte[] packageSignature = intent.getByteArrayExtra(EXTRA_PACKAGE_SIGNATURE);
|
byte[] packageSignature = intent.getByteArrayExtra(EXTRA_PACKAGE_SIGNATURE);
|
||||||
|
|
||||||
presenter.setupFromIntent(resultData, packageName, packageSignature);
|
presenter.setupFromIntentData(resultData, packageName, packageSignature);
|
||||||
presenter.setView(this);
|
}
|
||||||
|
|
||||||
mAppSettingsHeaderFragment = (AppSettingsHeaderFragment) getSupportFragmentManager().findFragmentById(
|
public static class RemoteRegisterDialogFragment extends DialogFragment {
|
||||||
R.id.api_app_settings_fragment);
|
private RemoteRegisterPresenter presenter;
|
||||||
// TODO unclean, fix later
|
private RemoteRegisterView mvpView;
|
||||||
mAppSettingsHeaderFragment.setAppSettings(presenter.appSettings);
|
|
||||||
|
|
||||||
setFullScreenDialogTwoButtons(
|
private Button buttonAllow;
|
||||||
R.string.api_register_allow, R.drawable.ic_check_white_24dp,
|
private Button buttonCancel;
|
||||||
new View.OnClickListener() {
|
|
||||||
@Override
|
@NonNull
|
||||||
public void onClick(View v) {
|
@Override
|
||||||
presenter.onClickAllow();
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
}
|
final Activity activity = getActivity();
|
||||||
}, R.string.api_register_disallow, R.drawable.ic_close_white_24dp,
|
|
||||||
new View.OnClickListener() {
|
ContextThemeWrapper theme = ThemeChanger.getDialogThemeWrapper(activity);
|
||||||
@Override
|
CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(theme);
|
||||||
public void onClick(View v) {
|
|
||||||
presenter.onClickCancel();
|
@SuppressLint("InflateParams")
|
||||||
|
View view = LayoutInflater.from(theme).inflate(R.layout.api_remote_register_app, null, false);
|
||||||
|
alert.setView(view);
|
||||||
|
|
||||||
|
buttonAllow = (Button) view.findViewById(R.id.button_allow);
|
||||||
|
buttonCancel = (Button) view.findViewById(R.id.button_cancel);
|
||||||
|
|
||||||
|
setupListenersForPresenter();
|
||||||
|
mvpView = createMvpView(view);
|
||||||
|
|
||||||
|
return alert.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
|
presenter = ((RemoteRegisterActivity) getActivity()).presenter;
|
||||||
|
presenter.setView(mvpView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel(DialogInterface dialog) {
|
||||||
|
super.onCancel(dialog);
|
||||||
|
|
||||||
|
if (presenter != null) {
|
||||||
|
presenter.onCancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
|
||||||
|
if (presenter != null) {
|
||||||
|
presenter.setView(null);
|
||||||
|
presenter = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private RemoteRegisterView createMvpView(View view) {
|
||||||
|
final TextView titleText = (TextView) view.findViewById(R.id.api_register_text);
|
||||||
|
final ImageView iconClientApp = (ImageView) view.findViewById(R.id.icon_client_app);
|
||||||
|
|
||||||
|
return new RemoteRegisterView() {
|
||||||
|
@Override
|
||||||
|
public void finishWithResult(Intent resultIntent) {
|
||||||
|
FragmentActivity activity = getActivity();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activity.setResult(RESULT_OK, resultIntent);
|
||||||
|
activity.finish();
|
||||||
}
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void finishWithResult(Intent resultIntent) {
|
public void finishAsCancelled() {
|
||||||
setResult(RESULT_OK, resultIntent);
|
FragmentActivity activity = getActivity();
|
||||||
finish();
|
if (activity == null) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
activity.setResult(RESULT_CANCELED);
|
||||||
public void finishAsCancelled() {
|
activity.finish();
|
||||||
setResult(RESULT_CANCELED);
|
}
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initLayout() {
|
public void setTitleText(String text) {
|
||||||
setContentView(R.layout.api_remote_register_app);
|
titleText.setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleClientIcon(Drawable drawable) {
|
||||||
|
iconClientApp.setImageDrawable(drawable);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListenersForPresenter() {
|
||||||
|
buttonAllow.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
presenter.onClickAllow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buttonCancel.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
presenter.onClickCancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,13 @@ package org.sufficientlysecure.keychain.remote.ui;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
|
import org.sufficientlysecure.keychain.provider.ApiDataAccessObject;
|
||||||
import org.sufficientlysecure.keychain.remote.AppSettings;
|
import org.sufficientlysecure.keychain.remote.AppSettings;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
@@ -12,24 +17,46 @@ import org.sufficientlysecure.keychain.util.Log;
|
|||||||
|
|
||||||
class RemoteRegisterPresenter {
|
class RemoteRegisterPresenter {
|
||||||
private final ApiDataAccessObject apiDao;
|
private final ApiDataAccessObject apiDao;
|
||||||
|
private final PackageManager packageManager;
|
||||||
|
private final Context context;
|
||||||
|
|
||||||
|
|
||||||
private RemoteRegisterView view;
|
private RemoteRegisterView view;
|
||||||
private Intent resultData;
|
private Intent resultData;
|
||||||
AppSettings appSettings;
|
private AppSettings appSettings;
|
||||||
|
|
||||||
|
|
||||||
RemoteRegisterPresenter(Context context) {
|
RemoteRegisterPresenter(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
|
||||||
apiDao = new ApiDataAccessObject(context);
|
apiDao = new ApiDataAccessObject(context);
|
||||||
|
packageManager = context.getPackageManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setView(RemoteRegisterView view) {
|
public void setView(RemoteRegisterView view) {
|
||||||
this.view = view;
|
this.view = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupFromIntent(Intent resultData, String packageName, byte[] packageSignature) {
|
void setupFromIntentData(Intent resultData, String packageName, byte[] packageSignature) {
|
||||||
this.appSettings = new AppSettings(packageName, packageSignature);
|
this.appSettings = new AppSettings(packageName, packageSignature);
|
||||||
this.resultData = resultData;
|
this.resultData = resultData;
|
||||||
|
|
||||||
Log.d(Constants.TAG, "ACTION_REGISTER packageName: " + packageName);
|
try {
|
||||||
|
setPackageInfo(packageName);
|
||||||
|
} catch (NameNotFoundException e) {
|
||||||
|
Log.e(Constants.TAG, "Unable to find info of calling app!");
|
||||||
|
view.finishAsCancelled();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setPackageInfo(String packageName) throws NameNotFoundException {
|
||||||
|
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, 0);
|
||||||
|
Drawable appIcon = packageManager.getApplicationIcon(applicationInfo);
|
||||||
|
CharSequence appName = packageManager.getApplicationLabel(applicationInfo);
|
||||||
|
|
||||||
|
view.setTitleClientIcon(appIcon);
|
||||||
|
view.setTitleText(context.getString(R.string.api_register_text, appName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void onClickAllow() {
|
void onClickAllow() {
|
||||||
@@ -41,9 +68,16 @@ class RemoteRegisterPresenter {
|
|||||||
view.finishAsCancelled();
|
view.finishAsCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onCancel() {
|
||||||
|
view.finishAsCancelled();
|
||||||
|
}
|
||||||
|
|
||||||
interface RemoteRegisterView {
|
interface RemoteRegisterView {
|
||||||
void finishWithResult(Intent resultData);
|
void finishWithResult(Intent resultData);
|
||||||
void finishAsCancelled();
|
void finishAsCancelled();
|
||||||
|
|
||||||
|
void setTitleText(String text);
|
||||||
|
void setTitleClientIcon(Drawable drawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,114 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:layout_marginTop="24dp"
|
||||||
|
>
|
||||||
|
|
||||||
<include
|
<LinearLayout
|
||||||
android:id="@+id/toolbar_include"
|
|
||||||
layout="@layout/toolbar_standalone" />
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_below="@id/toolbar_include"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
tools:targetApi="lollipop">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/ic_launcher"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="24dp"
|
||||||
|
android:layout_marginRight="24dp"
|
||||||
|
android:src="@drawable/link_24dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/icon_client_app"
|
||||||
|
tools:src="@drawable/apps_k9"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
android:overScrollMode="ifContentScrolls"
|
||||||
android:orientation="vertical">
|
tools:ignore="UselessParent">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/api_register_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingBottom="3dip"
|
|
||||||
android:text="@string/api_register_text"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
|
||||||
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/api_app_settings_fragment"
|
|
||||||
android:name="org.sufficientlysecure.keychain.remote.ui.AppSettingsHeaderFragment"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:layout="@layout/api_app_settings_fragment" />
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:paddingRight="24dp"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
>
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
</ScrollView>
|
android:layout_width="wrap_content"
|
||||||
</RelativeLayout>
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
|
android:text="@string/api_register_title"
|
||||||
|
android:id="@+id/dialog_title"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/api_register_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
tools:text="@string/api_register_text"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="end"
|
||||||
|
android:padding="8dp"
|
||||||
|
style="?buttonBarStyle">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/button_cancel"
|
||||||
|
android:id="@+id/button_cancel"
|
||||||
|
style="?buttonBarButtonStyle"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/button_allow"
|
||||||
|
android:id="@+id/button_allow"
|
||||||
|
style="?buttonBarButtonStyle" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -11,7 +11,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:id="@+id/iconLayout"
|
|
||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
@@ -43,82 +42,98 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:orientation="vertical"
|
android:layout_weight="1"
|
||||||
android:paddingLeft="24dp"
|
android:orientation="vertical">
|
||||||
android:paddingRight="24dp"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
<ScrollView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:overScrollMode="ifContentScrolls"
|
||||||
android:text="@string/request_permission_title"
|
tools:ignore="UselessParent">
|
||||||
android:id="@+id/dialog_title"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/select_identity_key_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
||||||
tools:text="@string/request_permission_msg"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:background="?selectableItemBackground"
|
|
||||||
android:id="@+id/key_info_layout"
|
|
||||||
>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:src="@drawable/ic_vpn_key_grey_24dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:paddingRight="24dp"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/requested_key_label"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:text="@string/request_permission_title"
|
||||||
|
android:id="@+id/dialog_title"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/select_key_item_name"
|
android:id="@+id/select_identity_key_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="Alice Skywalker"
|
android:layout_marginTop="20dp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:gravity="center_vertical"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
tools:text="@string/request_permission_msg"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:id="@+id/key_info_layout"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:src="@drawable/ic_vpn_key_grey_24dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/requested_key_label"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/select_key_item_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="Alice Skywalker"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="@string/requested_key_unavailable_warning"
|
||||||
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
android:textColor="@color/android_red_dark"
|
||||||
|
android:id="@+id/requested_key_unavailable_warning"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"
|
||||||
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
</ScrollView>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:text="@string/requested_key_unavailable_warning"
|
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
|
||||||
android:textColor="@color/android_red_dark"
|
|
||||||
android:id="@+id/requested_key_unavailable_warning"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -655,7 +655,8 @@
|
|||||||
<string name="api_settings_accounts_empty">"No accounts attached to this app."</string>
|
<string name="api_settings_accounts_empty">"No accounts attached to this app."</string>
|
||||||
<string name="api_create_account_text">"No key is configured for this account. Please select one of your existing keys or create a new one.\nApps can only decrypt/sign with the keys selected here!"</string>
|
<string name="api_create_account_text">"No key is configured for this account. Please select one of your existing keys or create a new one.\nApps can only decrypt/sign with the keys selected here!"</string>
|
||||||
<string name="api_update_account_text">"The key saved for this account has been deleted. Please select a different one!\nApps can only decrypt/sign with the keys selected here!"</string>
|
<string name="api_update_account_text">"The key saved for this account has been deleted. Please select a different one!\nApps can only decrypt/sign with the keys selected here!"</string>
|
||||||
<string name="api_register_text">"The displayed app wants to encrypt/decrypt messages and sign them in your name.\nAllow access?\n\nWARNING: If you do not know why this screen appeared, disallow access! You can revoke access later using the 'Apps' screen."</string>
|
<string name="api_register_title">"Allow access to OpenKeychain?"</string>
|
||||||
|
<string name="api_register_text">"%s requests to use OpenKeychain as a crypto provider. You will still be asked for permission before the app can use any of your keys for decryption.\n\nYou can revoke access later in the 'Apps' screen."</string>
|
||||||
<string name="api_register_allow">"Allow access"</string>
|
<string name="api_register_allow">"Allow access"</string>
|
||||||
<string name="api_register_disallow">"Disallow access"</string>
|
<string name="api_register_disallow">"Disallow access"</string>
|
||||||
<string name="api_register_error_select_key">"Please select a key!"</string>
|
<string name="api_register_error_select_key">"Please select a key!"</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user