diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java | 135 | ||||
-rw-r--r-- | src/main/res/layout/activity_trust_keys.xml | 234 | ||||
-rw-r--r-- | src/main/res/layout/keys_card.xml | 73 | ||||
-rw-r--r-- | src/main/res/values/attrs.xml | 4 | ||||
-rw-r--r-- | src/main/res/values/themes.xml | 4 |
5 files changed, 224 insertions, 226 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java index 48a9125ce..c36f0fcbc 100644 --- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java +++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java @@ -1,6 +1,7 @@ package de.pixart.messenger.ui; import android.content.Intent; +import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.util.Log; @@ -9,10 +10,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; -import android.widget.Button; import android.widget.CompoundButton; -import android.widget.LinearLayout; -import android.widget.TextView; import android.widget.Toast; import org.whispersystems.libsignal.IdentityKey; @@ -29,6 +27,8 @@ import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.crypto.axolotl.AxolotlService; import de.pixart.messenger.crypto.axolotl.FingerprintStatus; +import de.pixart.messenger.databinding.ActivityTrustKeysBinding; +import de.pixart.messenger.databinding.KeysCardBinding; import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.utils.CryptoHelper; @@ -43,21 +43,13 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat private Account mAccount; private Conversation mConversation; - private TextView keyErrorMessage; - private LinearLayout keyErrorMessageCard; - private TextView ownKeysTitle; - private LinearLayout ownKeys; - private LinearLayout ownKeysCard; - private LinearLayout foreignKeys; - private Button mSaveButton; - private Button mCancelButton; private AtomicBoolean mUseCameraHintShown = new AtomicBoolean(false); private AxolotlService.FetchStatus lastFetchReport = AxolotlService.FetchStatus.SUCCESS; private final Map<String, Boolean> ownKeysToTrust = new HashMap<>(); - private final Map<Jid, Map<String, Boolean>> foreignKeysToTrust = new HashMap<>(); + private final Map<Jid,Map<String, Boolean>> foreignKeysToTrust = new HashMap<>(); private final OnClickListener mSaveButtonListener = new OnClickListener() { @Override @@ -74,9 +66,8 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat finish(); } }; - - private XmppUri mPendingFingerprintVerificationUri = null; private Toast mUseCameraHintToast = null; + private ActivityTrustKeysBinding binding; @Override protected void refreshUiReal() { @@ -87,9 +78,9 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_trust_keys); + this.binding = DataBindingUtil.setContentView(this,R.layout.activity_trust_keys); this.contactJids = new ArrayList<>(); - for (String jid : getIntent().getStringArrayExtra("contacts")) { + for(String jid : getIntent().getStringArrayExtra("contacts")) { try { this.contactJids.add(Jid.fromString(jid)); } catch (InvalidJidException e) { @@ -97,16 +88,8 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } } - keyErrorMessageCard = findViewById(R.id.key_error_message_card); - keyErrorMessage = findViewById(R.id.key_error_message); - ownKeysTitle = findViewById(R.id.own_keys_title); - ownKeys = findViewById(R.id.own_keys_details); - ownKeysCard = findViewById(R.id.own_keys_card); - foreignKeys = findViewById(R.id.foreign_keys); - mCancelButton = findViewById(R.id.cancel_button); - mCancelButton.setOnClickListener(mCancelButtonListener); - mSaveButton = findViewById(R.id.save_button); - mSaveButton.setOnClickListener(mSaveButtonListener); + binding.cancelButton.setOnClickListener(mCancelButtonListener); + binding.saveButton.setOnClickListener(mSaveButtonListener); if (getSupportActionBar() != null) { @@ -115,7 +98,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } if (savedInstanceState != null) { - mUseCameraHintShown.set(savedInstanceState.getBoolean("camera_hint_shown", false)); + mUseCameraHintShown.set(savedInstanceState.getBoolean("camera_hint_shown",false)); } } @@ -187,13 +170,13 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat private void populateView() { setTitle(getString(R.string.trust_omemo_fingerprints)); - ownKeys.removeAllViews(); - foreignKeys.removeAllViews(); + binding.ownKeysDetails.removeAllViews(); + binding.foreignKeys.removeAllViews(); boolean hasOwnKeys = false; boolean hasForeignKeys = false; - for (final String fingerprint : ownKeysToTrust.keySet()) { + for(final String fingerprint : ownKeysToTrust.keySet()) { hasOwnKeys = true; - addFingerprintRowWithListeners(ownKeys, mAccount, fingerprint, false, + addFingerprintRowWithListeners(binding.ownKeysDetails, mAccount, fingerprint, false, FingerprintStatus.createActive(ownKeysToTrust.get(fingerprint)), false, false, new CompoundButton.OnCheckedChangeListener() { @Override @@ -208,84 +191,74 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat synchronized (this.foreignKeysToTrust) { for (Map.Entry<Jid, Map<String, Boolean>> entry : foreignKeysToTrust.entrySet()) { hasForeignKeys = true; - final LinearLayout layout = (LinearLayout) getLayoutInflater().inflate(R.layout.keys_card, foreignKeys, false); + KeysCardBinding keysCardBinding = DataBindingUtil.inflate(getLayoutInflater(),R.layout.keys_card, binding.foreignKeys,false); + //final LinearLayout layout = (LinearLayout) getLayoutInflater().inflate(R.layout.keys_card, foreignKeys, false); final Jid jid = entry.getKey(); - final TextView header = layout.findViewById(R.id.foreign_keys_title); - final LinearLayout keysContainer = layout.findViewById(R.id.foreign_keys_details); - final TextView informNoKeys = layout.findViewById(R.id.no_keys_to_accept); - header.setText(jid.toString()); - header.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - switchToContactDetails(mAccount.getRoster().getContact(jid)); - } - }); + keysCardBinding.foreignKeysTitle.setText(jid.toString()); + keysCardBinding.foreignKeysTitle.setOnClickListener(v -> switchToContactDetails(mAccount.getRoster().getContact(jid))); final Map<String, Boolean> fingerprints = entry.getValue(); for (final String fingerprint : fingerprints.keySet()) { - addFingerprintRowWithListeners(keysContainer, mAccount, fingerprint, false, + addFingerprintRowWithListeners(keysCardBinding.foreignKeysDetails, mAccount, fingerprint, false, FingerprintStatus.createActive(fingerprints.get(fingerprint)), false, false, - new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - fingerprints.put(fingerprint, isChecked); - lockOrUnlockAsNeeded(); - } + (buttonView, isChecked) -> { + fingerprints.put(fingerprint, isChecked); + lockOrUnlockAsNeeded(); } ); } if (fingerprints.size() == 0) { - informNoKeys.setVisibility(View.VISIBLE); + keysCardBinding.noKeysToAccept.setVisibility(View.VISIBLE); if (hasNoOtherTrustedKeys(jid)) { if (!mAccount.getRoster().getContact(jid).mutualPresenceSubscription()) { - informNoKeys.setText(R.string.error_no_keys_to_trust_presence); + keysCardBinding.noKeysToAccept.setText(R.string.error_no_keys_to_trust_presence); } else { - informNoKeys.setText(R.string.error_no_keys_to_trust_server_error); + keysCardBinding.noKeysToAccept.setText(R.string.error_no_keys_to_trust_server_error); } } else { - informNoKeys.setText(getString(R.string.no_keys_just_confirm, mAccount.getRoster().getContact(jid).getDisplayName())); + keysCardBinding.noKeysToAccept.setText(getString(R.string.no_keys_just_confirm, mAccount.getRoster().getContact(jid).getDisplayName())); } } else { - informNoKeys.setVisibility(View.GONE); + keysCardBinding.noKeysToAccept.setVisibility(View.GONE); } - foreignKeys.addView(layout); + binding.foreignKeys.addView(keysCardBinding.foreignKeysCard); } } - if ((hasOwnKeys || foreignActuallyHasKeys()) && mUseCameraHintShown.compareAndSet(false, true)) { + if ((hasOwnKeys || foreignActuallyHasKeys()) && mUseCameraHintShown.compareAndSet(false,true)) { showCameraToast(); } - ownKeysTitle.setText(mAccount.getJid().toBareJid().toString()); - ownKeysCard.setVisibility(hasOwnKeys ? View.VISIBLE : View.GONE); - foreignKeys.setVisibility(hasForeignKeys ? View.VISIBLE : View.GONE); - if (hasPendingKeyFetches()) { + binding.ownKeysTitle.setText(mAccount.getJid().toBareJid().toString()); + binding.ownKeysCard.setVisibility(hasOwnKeys ? View.VISIBLE : View.GONE); + binding.foreignKeys.setVisibility(hasForeignKeys ? View.VISIBLE : View.GONE); + if(hasPendingKeyFetches()) { setFetching(); lock(); } else { if (!hasForeignKeys && hasNoOtherTrustedKeys()) { - keyErrorMessageCard.setVisibility(View.VISIBLE); + binding.keyErrorMessageCard.setVisibility(View.VISIBLE); if (lastFetchReport == AxolotlService.FetchStatus.ERROR || mAccount.getAxolotlService().fetchMapHasErrors(contactJids)) { if (anyWithoutMutualPresenceSubscription(contactJids)) { - keyErrorMessage.setText(R.string.error_no_keys_to_trust_presence); + binding.keyErrorMessage.setText(R.string.error_no_keys_to_trust_presence); } else { - keyErrorMessage.setText(R.string.error_no_keys_to_trust_server_error); + binding.keyErrorMessage.setText(R.string.error_no_keys_to_trust_server_error); } } else { - keyErrorMessage.setText(R.string.error_no_keys_to_trust); + binding.keyErrorMessage.setText(R.string.error_no_keys_to_trust); } - ownKeys.removeAllViews(); - ownKeysCard.setVisibility(View.GONE); - foreignKeys.removeAllViews(); - foreignKeys.setVisibility(View.GONE); + binding.ownKeysDetails.removeAllViews(); + binding.ownKeysCard.setVisibility(View.GONE); + binding.foreignKeys.removeAllViews(); + binding.foreignKeys.setVisibility(View.GONE); } lockOrUnlockAsNeeded(); setDone(); } } - private boolean anyWithoutMutualPresenceSubscription(List<Jid> contactJids) { - for (Jid jid : contactJids) { + private boolean anyWithoutMutualPresenceSubscription(List<Jid> contactJids){ + for(Jid jid : contactJids) { if (!mAccount.getRoster().getContact(jid).mutualPresenceSubscription()) { return true; } @@ -309,9 +282,9 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat ownKeysToTrust.clear(); AxolotlService service = this.mAccount.getAxolotlService(); Set<IdentityKey> ownKeysSet = service.getKeysWithTrust(FingerprintStatus.createActiveUndecided()); - for (final IdentityKey identityKey : ownKeysSet) { + for(final IdentityKey identityKey : ownKeysSet) { final String fingerprint = CryptoHelper.bytesToHex(identityKey.getPublicKey().serialize()); - if (!ownKeysToTrust.containsKey(fingerprint)) { + if(!ownKeysToTrust.containsKey(fingerprint)) { ownKeysToTrust.put(fingerprint, false); } } @@ -380,7 +353,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } switch (report) { case ERROR: - Toast.makeText(TrustKeysActivity.this, R.string.error_fetching_omemo_key, Toast.LENGTH_SHORT).show(); + Toast.makeText(TrustKeysActivity.this,R.string.error_fetching_omemo_key,Toast.LENGTH_SHORT).show(); break; case SUCCESS_TRUSTED: Toast.makeText(TrustKeysActivity.this,R.string.blindly_trusted_omemo_keys,Toast.LENGTH_LONG).show(); @@ -416,7 +389,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } private void commitTrusts() { - for (final String fingerprint : ownKeysToTrust.keySet()) { + for(final String fingerprint :ownKeysToTrust.keySet()) { mAccount.getAxolotlService().setFingerprintTrust( fingerprint, FingerprintStatus.createActive(ownKeysToTrust.get(fingerprint))); @@ -443,13 +416,13 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } private void unlock() { - mSaveButton.setEnabled(true); - mSaveButton.setTextColor(getPrimaryTextColor()); + binding.saveButton.setEnabled(true); + binding.saveButton.setTextColor(getPrimaryTextColor()); } private void lock() { - mSaveButton.setEnabled(false); - mSaveButton.setTextColor(getSecondaryTextColor()); + binding.saveButton.setEnabled(false); + binding.saveButton.setTextColor(getSecondaryTextColor()); } private void lockOrUnlockAsNeeded() { @@ -467,10 +440,10 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat } private void setDone() { - mSaveButton.setText(getString(R.string.done)); + binding.saveButton.setText(getString(R.string.done)); } private void setFetching() { - mSaveButton.setText(getString(R.string.fetching_keys)); + binding.saveButton.setText(getString(R.string.fetching_keys)); } -} +}
\ No newline at end of file diff --git a/src/main/res/layout/activity_trust_keys.xml b/src/main/res/layout/activity_trust_keys.xml index 2ebffb5be..7ba6fd674 100644 --- a/src/main/res/layout/activity_trust_keys.xml +++ b/src/main/res/layout/activity_trust_keys.xml @@ -1,129 +1,141 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@color/grey200"> +<layout xmlns:android="http://schemas.android.com/apk/res/android"> - <ScrollView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_above="@+id/button_bar" - android:layout_alignParentTop="true"> + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/color_background_secondary"> - <LinearLayout - android:layout_width="match_parent" + <ScrollView + android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:layout_above="@+id/button_bar" + android:layout_alignParentTop="true"> <LinearLayout - android:id="@+id/key_error_message_card" - android:layout_width="fill_parent" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/activity_horizontal_margin" - android:layout_marginRight="@dimen/activity_horizontal_margin" - android:layout_marginTop="@dimen/activity_vertical_margin" - android:layout_marginBottom="@dimen/activity_vertical_margin" - android:background="@drawable/infocard_border" - android:orientation="vertical" - android:padding="@dimen/infocard_padding" - android:visibility="gone"> - - <TextView - android:id="@+id/key_error_message_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeHeadline" - android:textStyle="bold" - android:text="@string/error_trustkeys_title" /> - - <TextView - android:id="@+id/key_error_message" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" - android:padding="8dp" /> - - </LinearLayout> + android:orientation="vertical"> - <LinearLayout - android:id="@+id/own_keys_card" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/activity_horizontal_margin" - android:layout_marginRight="@dimen/activity_horizontal_margin" - android:layout_marginTop="@dimen/activity_vertical_margin" - android:layout_marginBottom="@dimen/activity_vertical_margin" - android:background="@drawable/infocard_border" - android:orientation="vertical" - android:padding="@dimen/infocard_padding" - android:visibility="gone"> - - <TextView - android:id="@+id/own_keys_title" - android:layout_width="wrap_content" + <android.support.v7.widget.CardView + android:id="@+id/key_error_message_card" + android:layout_width="fill_parent" android:layout_height="wrap_content" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeHeadline" - android:textStyle="bold" /> + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:layout_marginLeft="@dimen/activity_horizontal_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:layout_marginTop="@dimen/activity_vertical_margin" + android:visibility="gone"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="@dimen/infocard_padding"> + + <TextView + android:id="@+id/key_error_message_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/error_trustkeys_title" + android:textColor="?attr/color_text_primary" + android:textSize="?attr/TextSizeHeadline" + android:textStyle="bold"/> + + <TextView + android:id="@+id/key_error_message" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:textColor="?attr/color_text_primary" + android:textSize="?attr/TextSizeBody"/> + </LinearLayout> + + </android.support.v7.widget.CardView> + + <android.support.v7.widget.CardView + android:id="@+id/own_keys_card" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:layout_marginLeft="@dimen/activity_horizontal_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:layout_marginTop="@dimen/activity_vertical_margin" + android:visibility="gone"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="@dimen/infocard_padding"> + + <TextView + android:id="@+id/own_keys_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="?attr/color_text_primary" + android:textSize="?attr/TextSizeHeadline" + android:textStyle="bold"/> + + <LinearLayout + android:id="@+id/own_keys_details" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:divider="?android:dividerHorizontal" + android:orientation="vertical" + android:showDividers="middle"> + </LinearLayout> + </LinearLayout> + + </android.support.v7.widget.CardView> <LinearLayout - android:id="@+id/own_keys_details" + android:id="@+id/foreign_keys" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:divider="?android:dividerHorizontal" - android:showDividers="middle" - android:orientation="vertical"></LinearLayout> + android:orientation="vertical" + android:visibility="gone"> - </LinearLayout> - - <LinearLayout - android:id="@+id/foreign_keys" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:visibility="gone" - android:orientation="vertical"> + </LinearLayout> </LinearLayout> + </ScrollView> - </LinearLayout> - </ScrollView> - - <LinearLayout - android:id="@+id/button_bar" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_alignParentStart="true" - android:layout_alignParentEnd="true" - android:layout_alignParentLeft="true" - android:layout_alignParentRight="true"> - - <Button - android:id="@+id/cancel_button" - style="?android:attr/borderlessButtonStyle" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/cancel" - android:textColor="@color/black87" /> - - <View - android:layout_width="1dp" - android:layout_height="fill_parent" - android:layout_marginBottom="7dp" - android:layout_marginTop="7dp" - android:background="@color/black12" /> - - <Button - android:id="@+id/save_button" - style="?android:attr/borderlessButtonStyle" - android:layout_width="0dp" + <LinearLayout + android:id="@+id/button_bar" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_weight="1" - android:enabled="true" - android:textColor="@color/black54" - android:text="@string/done" /> - </LinearLayout> -</RelativeLayout> + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + android:layout_alignParentLeft="true" + android:layout_alignParentRight="true" + android:layout_alignParentStart="true"> + + <Button + android:id="@+id/cancel_button" + style="?android:attr/borderlessButtonStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/cancel" + android:textColor="?attr/color_text_primary"/> + + <View + android:layout_width="1dp" + android:layout_height="fill_parent" + android:layout_marginBottom="7dp" + android:layout_marginTop="7dp" + android:background="?attr/divider"/> + + <Button + android:id="@+id/save_button" + style="?android:attr/borderlessButtonStyle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:enabled="true" + android:text="@string/done" + android:textColor="?attr/color_text_secondary"/> + </LinearLayout> + </RelativeLayout> +</layout>
\ No newline at end of file diff --git a/src/main/res/layout/keys_card.xml b/src/main/res/layout/keys_card.xml index 89c47c904..b312e4227 100644 --- a/src/main/res/layout/keys_card.xml +++ b/src/main/res/layout/keys_card.xml @@ -1,38 +1,47 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout android:id="@+id/foreign_keys_card" - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/activity_vertical_margin" - android:layout_marginLeft="@dimen/activity_horizontal_margin" - android:layout_marginRight="@dimen/activity_horizontal_margin" - android:layout_marginTop="@dimen/activity_vertical_margin" - android:background="@drawable/infocard_border" - android:orientation="vertical" - android:padding="@dimen/infocard_padding"> +<layout xmlns:android="http://schemas.android.com/apk/res/android"> - <TextView - android:id="@+id/foreign_keys_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeHeadline" - android:textStyle="bold" /> + <android.support.v7.widget.CardView + android:id="@+id/foreign_keys_card" - <LinearLayout - android:id="@+id/foreign_keys_details" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:divider="?android:dividerHorizontal" - android:orientation="vertical" - android:showDividers="middle"></LinearLayout> + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:layout_marginLeft="@dimen/activity_horizontal_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:layout_marginTop="@dimen/activity_vertical_margin"> - <TextView - android:layout_marginTop="8dp" - android:id="@+id/no_keys_to_accept" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/black87" - android:text="@string/no_keys_just_confirm" - android:textSize="?attr/TextSizeBody" /> -</LinearLayout>
\ No newline at end of file + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="@dimen/infocard_padding"> + + <TextView + android:id="@+id/foreign_keys_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="?attr/color_text_primary" + android:textSize="?attr/TextSizeHeadline" + android:textStyle="bold"/> + + <LinearLayout + android:id="@+id/foreign_keys_details" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:divider="?android:dividerHorizontal" + android:orientation="vertical" + android:showDividers="middle"> + </LinearLayout> + + <TextView + android:id="@+id/no_keys_to_accept" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="@string/no_keys_just_confirm" + android:textColor="?attr/color_text_primary" + android:textSize="?attr/TextSizeBody"/> + </LinearLayout> + </android.support.v7.widget.CardView> +</layout>
\ No newline at end of file diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index 17c1c5607..208a60cfb 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -7,6 +7,10 @@ <attr name="TextSeparation" format="dimension"/> <attr name="IconSize" format="dimension" /> + <attr name="color_background_secondary" format="reference|color" /> + <attr name="color_background_primary" format="reference|color" /> + <attr name="color_warning" format="reference|color"/> + <attr name="color_text_primary" format="reference|color" /> <attr name="color_text_secondary" format="reference|color" /> diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index b2fb36418..7c433f720 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -9,8 +9,8 @@ <item name="color_text_primary">@color/black87</item> <item name="color_text_secondary">@color/black54</item> - <!--<item name="color_background_primary">@color/grey50</item>--> - <!--<item name="color_background_secondary">@color/grey200</item>--> + <item name="color_background_primary">@color/grey50</item> + <item name="color_background_secondary">@color/grey200</item> <item name="android:windowActionModeOverlay">true</item> <item name="android:actionModeBackground">@color/accent</item> |