Collapsing Toolbar
This commit is contained in:
@@ -32,6 +32,9 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.provider.ContactsContract;
|
import android.provider.ContactsContract;
|
||||||
|
import android.support.design.widget.AppBarLayout;
|
||||||
|
import android.support.design.widget.CollapsingToolbarLayout;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.LoaderManager;
|
import android.support.v4.app.LoaderManager;
|
||||||
@@ -51,7 +54,6 @@ import android.widget.RelativeLayout;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.getbase.floatingactionbutton.FloatingActionButton;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
@@ -107,10 +109,10 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
private ArrayList<ParcelableKeyRing> mKeyList;
|
private ArrayList<ParcelableKeyRing> mKeyList;
|
||||||
private CryptoOperationHelper<ImportKeyringParcel, ImportKeyResult> mOperationHelper;
|
private CryptoOperationHelper<ImportKeyringParcel, ImportKeyResult> mOperationHelper;
|
||||||
|
|
||||||
private TextView mName;
|
|
||||||
private TextView mStatusText;
|
private TextView mStatusText;
|
||||||
private ImageView mStatusImage;
|
private ImageView mStatusImage;
|
||||||
private RelativeLayout mBigToolbar;
|
private AppBarLayout mAppBarLayout;
|
||||||
|
private CollapsingToolbarLayout mCollapsingToolbarLayout;
|
||||||
|
|
||||||
private ImageButton mActionEncryptFile;
|
private ImageButton mActionEncryptFile;
|
||||||
private ImageButton mActionEncryptText;
|
private ImageButton mActionEncryptText;
|
||||||
@@ -156,10 +158,10 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
|
|
||||||
setTitle(null);
|
setTitle(null);
|
||||||
|
|
||||||
mName = (TextView) findViewById(R.id.view_key_name);
|
|
||||||
mStatusText = (TextView) findViewById(R.id.view_key_status);
|
mStatusText = (TextView) findViewById(R.id.view_key_status);
|
||||||
mStatusImage = (ImageView) findViewById(R.id.view_key_status_image);
|
mStatusImage = (ImageView) findViewById(R.id.view_key_status_image);
|
||||||
mBigToolbar = (RelativeLayout) findViewById(R.id.toolbar_big);
|
mAppBarLayout = (AppBarLayout) findViewById(R.id.app_bar_layout);
|
||||||
|
mCollapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
|
||||||
|
|
||||||
mActionEncryptFile = (ImageButton) findViewById(R.id.view_key_action_encrypt_files);
|
mActionEncryptFile = (ImageButton) findViewById(R.id.view_key_action_encrypt_files);
|
||||||
mActionEncryptText = (ImageButton) findViewById(R.id.view_key_action_encrypt_text);
|
mActionEncryptText = (ImageButton) findViewById(R.id.view_key_action_encrypt_text);
|
||||||
@@ -736,9 +738,9 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
// get name, email, and comment from USER_ID
|
// get name, email, and comment from USER_ID
|
||||||
KeyRing.UserId mainUserId = KeyRing.splitUserId(data.getString(INDEX_USER_ID));
|
KeyRing.UserId mainUserId = KeyRing.splitUserId(data.getString(INDEX_USER_ID));
|
||||||
if (mainUserId.name != null) {
|
if (mainUserId.name != null) {
|
||||||
mName.setText(mainUserId.name);
|
mCollapsingToolbarLayout.setTitle(mainUserId.name);
|
||||||
} else {
|
} else {
|
||||||
mName.setText(R.string.user_id_no_name);
|
mCollapsingToolbarLayout.setTitle(getString(R.string.user_id_no_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
mMasterKeyId = data.getLong(INDEX_MASTER_KEY_ID);
|
mMasterKeyId = data.getLong(INDEX_MASTER_KEY_ID);
|
||||||
@@ -789,9 +791,9 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
State.REVOKED, R.color.icons, true);
|
State.REVOKED, R.color.icons, true);
|
||||||
color = getResources().getColor(R.color.key_flag_red);
|
color = getResources().getColor(R.color.key_flag_red);
|
||||||
|
|
||||||
mActionEncryptFile.setVisibility(View.GONE);
|
mActionEncryptFile.setVisibility(View.INVISIBLE);
|
||||||
mActionEncryptText.setVisibility(View.GONE);
|
mActionEncryptText.setVisibility(View.INVISIBLE);
|
||||||
mActionNfc.setVisibility(View.GONE);
|
mActionNfc.setVisibility(View.INVISIBLE);
|
||||||
mFab.setVisibility(View.GONE);
|
mFab.setVisibility(View.GONE);
|
||||||
mQrCodeLayout.setVisibility(View.GONE);
|
mQrCodeLayout.setVisibility(View.GONE);
|
||||||
} else if (mIsExpired) {
|
} else if (mIsExpired) {
|
||||||
@@ -805,9 +807,9 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
State.EXPIRED, R.color.icons, true);
|
State.EXPIRED, R.color.icons, true);
|
||||||
color = getResources().getColor(R.color.key_flag_red);
|
color = getResources().getColor(R.color.key_flag_red);
|
||||||
|
|
||||||
mActionEncryptFile.setVisibility(View.GONE);
|
mActionEncryptFile.setVisibility(View.INVISIBLE);
|
||||||
mActionEncryptText.setVisibility(View.GONE);
|
mActionEncryptText.setVisibility(View.INVISIBLE);
|
||||||
mActionNfc.setVisibility(View.GONE);
|
mActionNfc.setVisibility(View.INVISIBLE);
|
||||||
mFab.setVisibility(View.GONE);
|
mFab.setVisibility(View.GONE);
|
||||||
mQrCodeLayout.setVisibility(View.GONE);
|
mQrCodeLayout.setVisibility(View.GONE);
|
||||||
} else if (mIsSecret) {
|
} else if (mIsSecret) {
|
||||||
@@ -822,15 +824,15 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
mQrCodeLayout.setVisibility(View.VISIBLE);
|
mQrCodeLayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
// and place leftOf qr code
|
// and place leftOf qr code
|
||||||
RelativeLayout.LayoutParams nameParams = (RelativeLayout.LayoutParams)
|
// RelativeLayout.LayoutParams nameParams = (RelativeLayout.LayoutParams)
|
||||||
mName.getLayoutParams();
|
// mName.getLayoutParams();
|
||||||
// remove right margin
|
// // remove right margin
|
||||||
nameParams.setMargins(FormattingUtils.dpToPx(this, 48), 0, 0, 0);
|
// nameParams.setMargins(FormattingUtils.dpToPx(this, 48), 0, 0, 0);
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||||
nameParams.setMarginEnd(0);
|
// nameParams.setMarginEnd(0);
|
||||||
}
|
// }
|
||||||
nameParams.addRule(RelativeLayout.LEFT_OF, R.id.view_key_qr_code_layout);
|
// nameParams.addRule(RelativeLayout.LEFT_OF, R.id.view_key_qr_code_layout);
|
||||||
mName.setLayoutParams(nameParams);
|
// mName.setLayoutParams(nameParams);
|
||||||
|
|
||||||
RelativeLayout.LayoutParams statusParams = (RelativeLayout.LayoutParams)
|
RelativeLayout.LayoutParams statusParams = (RelativeLayout.LayoutParams)
|
||||||
mStatusText.getLayoutParams();
|
mStatusText.getLayoutParams();
|
||||||
@@ -852,7 +854,7 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
}
|
}
|
||||||
mFab.setVisibility(View.VISIBLE);
|
mFab.setVisibility(View.VISIBLE);
|
||||||
// noinspection deprecation (no getDrawable with theme at current minApi level 15!)
|
// noinspection deprecation (no getDrawable with theme at current minApi level 15!)
|
||||||
mFab.setIconDrawable(getResources().getDrawable(R.drawable.ic_repeat_white_24dp));
|
mFab.setImageDrawable(getResources().getDrawable(R.drawable.ic_repeat_white_24dp));
|
||||||
} else {
|
} else {
|
||||||
mActionEncryptFile.setVisibility(View.VISIBLE);
|
mActionEncryptFile.setVisibility(View.VISIBLE);
|
||||||
mActionEncryptText.setVisibility(View.VISIBLE);
|
mActionEncryptText.setVisibility(View.VISIBLE);
|
||||||
@@ -880,22 +882,17 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mPreviousColor == 0 || mPreviousColor == color) {
|
if (mPreviousColor == 0 || mPreviousColor == color) {
|
||||||
mStatusBar.setBackgroundColor(getStatusBarBackgroundColor(color));
|
mAppBarLayout.setBackgroundColor(color);
|
||||||
mBigToolbar.setBackgroundColor(color);
|
mCollapsingToolbarLayout.setContentScrimColor(color);
|
||||||
|
mCollapsingToolbarLayout.setStatusBarScrimColor(getStatusBarBackgroundColor(color));
|
||||||
mPreviousColor = color;
|
mPreviousColor = color;
|
||||||
} else {
|
} else {
|
||||||
ObjectAnimator colorFade1 =
|
ObjectAnimator colorFade =
|
||||||
ObjectAnimator.ofObject(mStatusBar, "backgroundColor",
|
ObjectAnimator.ofObject(mAppBarLayout, "backgroundColor",
|
||||||
new ArgbEvaluator(), mPreviousColor,
|
|
||||||
getStatusBarBackgroundColor(color));
|
|
||||||
ObjectAnimator colorFade2 =
|
|
||||||
ObjectAnimator.ofObject(mBigToolbar, "backgroundColor",
|
|
||||||
new ArgbEvaluator(), mPreviousColor, color);
|
new ArgbEvaluator(), mPreviousColor, color);
|
||||||
|
|
||||||
colorFade1.setDuration(1200);
|
colorFade.setDuration(1200);
|
||||||
colorFade2.setDuration(1200);
|
colorFade.start();
|
||||||
colorFade1.start();
|
|
||||||
colorFade2.start();
|
|
||||||
mPreviousColor = color;
|
mPreviousColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,183 +1,178 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/main_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
<RelativeLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/toolbar_big"
|
android:id="@+id/app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/huge_toolbar"
|
android:layout_height="wrap_content"
|
||||||
android:elevation="4dp"
|
android:background="@color/primary"
|
||||||
android:background="?attr/colorPrimary"
|
android:fitsSystemWindows="true"
|
||||||
android:orientation="horizontal">
|
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||||
|
|
||||||
<ImageView
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
android:id="@+id/view_key_photo"
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@+id/status_bar"
|
android:fitsSystemWindows="true"
|
||||||
android:layout_alignParentLeft="true"
|
app:contentScrim="@color/primary"
|
||||||
android:layout_alignParentStart="true"
|
app:expandedTitleMarginBottom="102dp"
|
||||||
android:src="@drawable/ic_launcher"
|
app:expandedTitleMarginEnd="128dp"
|
||||||
android:baselineAlignBottom="false"
|
app:expandedTitleMarginStart="47dp"
|
||||||
android:cropToPadding="false"
|
app:expandedTitleTextAppearance="@style/TextAppearance.AppCompat.Headline"
|
||||||
android:focusable="false"
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
android:adjustViewBounds="false"
|
|
||||||
android:layout_alignParentTop="false"
|
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:id="@+id/status_bar"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="238dp"
|
||||||
android:layout_height="@dimen/statusbar_height"
|
android:fitsSystemWindows="true"
|
||||||
android:background="?attr/colorPrimary" />
|
app:layout_collapseMode="parallax">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<ImageView
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/view_key_photo"
|
||||||
android:background="@color/transparent"
|
android:layout_width="match_parent"
|
||||||
android:layout_below="@+id/status_bar"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_alignParentStart="true"
|
||||||
android:minHeight="?attr/actionBarSize"
|
android:layout_alignParentTop="false"
|
||||||
android:overScrollMode="always"
|
android:adjustViewBounds="false"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
android:baselineAlignBottom="false"
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
android:cropToPadding="false"
|
||||||
tools:ignore="UnusedAttribute"
|
android:fitsSystemWindows="true"
|
||||||
android:transitionGroup="false"
|
android:focusable="false"
|
||||||
android:touchscreenBlocksFocus="false" />
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/view_key_name"
|
android:id="@+id/view_key_status"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="48dp"
|
android:layout_above="@+id/toolbar2"
|
||||||
android:layout_marginStart="48dp"
|
android:layout_marginEnd="48dp"
|
||||||
android:layout_marginRight="48dp"
|
android:layout_marginLeft="48dp"
|
||||||
android:layout_marginEnd="48dp"
|
android:layout_marginRight="48dp"
|
||||||
android:text=""
|
android:layout_marginStart="48dp"
|
||||||
tools:text="Alice Skywalker"
|
android:text=""
|
||||||
android:textColor="@color/icons"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textColor="?attr/colorTabText"
|
||||||
android:layout_above="@+id/view_key_status" />
|
tools:text="My Key" />
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/view_key_status"
|
android:id="@+id/toolbar2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="48dp"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginStart="48dp"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginRight="48dp"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_marginEnd="48dp"
|
android:layout_alignParentRight="true"
|
||||||
android:text=""
|
android:layout_alignParentStart="true"
|
||||||
tools:text="My Key"
|
android:layout_marginLeft="32dp"
|
||||||
android:textColor="?attr/colorTabText"
|
android:minHeight="?attr/actionBarSize"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:orientation="horizontal">
|
||||||
android:layout_above="@+id/toolbar2" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<ImageButton
|
||||||
android:id="@+id/toolbar2"
|
android:id="@+id/view_key_action_encrypt_files"
|
||||||
android:orientation="horizontal"
|
style="?android:attr/borderlessButtonStyle"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_width="64dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="64dp"
|
||||||
android:minHeight="?attr/actionBarSize"
|
android:src="@drawable/ic_action_encrypt_file_24dp"
|
||||||
android:layout_height="wrap_content"
|
android:visibility="invisible"
|
||||||
android:layout_alignParentLeft="true"
|
tools:visibility="visible" />
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_marginLeft="32dp"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true">
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/view_key_action_encrypt_files"
|
android:id="@+id/view_key_action_encrypt_text"
|
||||||
android:layout_width="64dp"
|
style="?android:attr/borderlessButtonStyle"
|
||||||
android:layout_height="64dp"
|
android:layout_width="64dp"
|
||||||
android:visibility="invisible"
|
android:layout_height="64dp"
|
||||||
tools:visibility="visible"
|
android:src="@drawable/ic_action_encrypt_text_24dp"
|
||||||
style="?android:attr/borderlessButtonStyle"
|
android:visibility="invisible"
|
||||||
android:src="@drawable/ic_action_encrypt_file_24dp" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/view_key_action_encrypt_text"
|
android:id="@+id/view_key_action_nfc"
|
||||||
android:layout_width="64dp"
|
style="?android:attr/borderlessButtonStyle"
|
||||||
android:layout_height="64dp"
|
android:layout_width="64dp"
|
||||||
android:visibility="invisible"
|
android:layout_height="64dp"
|
||||||
tools:visibility="visible"
|
android:src="@drawable/ic_nfc_white_24dp"
|
||||||
style="?android:attr/borderlessButtonStyle"
|
android:visibility="invisible"
|
||||||
android:src="@drawable/ic_action_encrypt_text_24dp" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageButton
|
</LinearLayout>
|
||||||
android:id="@+id/view_key_action_nfc"
|
|
||||||
android:layout_width="64dp"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:visibility="invisible"
|
|
||||||
tools:visibility="visible"
|
|
||||||
style="?android:attr/borderlessButtonStyle"
|
|
||||||
android:src="@drawable/ic_nfc_white_24dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/view_key_status_image"
|
||||||
|
android:layout_width="96dp"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_above="@id/toolbar2"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:src="@drawable/status_signature_unverified_cutout_96dp"
|
||||||
|
android:visibility="invisible"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<android.support.v7.widget.CardView
|
||||||
android:id="@+id/view_key_status_image"
|
android:id="@+id/view_key_qr_code_layout"
|
||||||
android:layout_width="96dp"
|
android:layout_width="wrap_content"
|
||||||
android:visibility="invisible"
|
android:layout_height="wrap_content"
|
||||||
tools:visibility="visible"
|
android:layout_above="@id/toolbar2"
|
||||||
android:src="@drawable/status_signature_unverified_cutout_96dp"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_height="96dp"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_above="@id/toolbar2"
|
android:layout_marginRight="20dp"
|
||||||
android:layout_alignParentRight="true"
|
android:clickable="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:layout_marginRight="16dp" />
|
android:transitionName="qr_code"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_collapseMode="parallax"
|
||||||
|
card_view:cardBackgroundColor="@android:color/white"
|
||||||
|
card_view:cardCornerRadius="4dp"
|
||||||
|
card_view:cardElevation="2dp"
|
||||||
|
card_view:cardUseCompatPadding="true"
|
||||||
|
tools:visibility="invisible">
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<ImageView
|
||||||
android:id="@+id/view_key_qr_code_layout"
|
android:id="@+id/view_key_qr_code"
|
||||||
android:transitionName="qr_code"
|
android:layout_width="96dp"
|
||||||
android:visibility="visible"
|
android:layout_height="96dp" />
|
||||||
android:layout_above="@id/toolbar2"
|
</android.support.v7.widget.CardView>
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginRight="20dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:clickable="true"
|
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
tools:visibility="invisible"
|
|
||||||
card_view:cardBackgroundColor="@android:color/white"
|
|
||||||
card_view:cardElevation="2dp"
|
|
||||||
card_view:cardUseCompatPadding="true"
|
|
||||||
card_view:cardCornerRadius="4dp">
|
|
||||||
|
|
||||||
<ImageView
|
</RelativeLayout>
|
||||||
android:id="@+id/view_key_qr_code"
|
|
||||||
android:layout_width="96dp"
|
|
||||||
android:layout_height="96dp"
|
|
||||||
/>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||||
|
android:touchscreenBlocksFocus="false"
|
||||||
|
android:transitionGroup="false"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||||
|
tools:ignore="UnusedAttribute" />
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
|
||||||
<LinearLayout
|
</android.support.design.widget.AppBarLayout>
|
||||||
android:id="@+id/body"
|
|
||||||
android:layout_below="@id/toolbar_big"
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:orientation="vertical"
|
android:id="@+id/scroll"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="fill_vertical"
|
||||||
<View
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dip"
|
|
||||||
android:background="?android:attr/listDivider"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/view_key_status_divider" />
|
|
||||||
|
|
||||||
|
<!-- it is not scrolling far enough down thus adding padding -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/content_frame"
|
android:id="@+id/content_frame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="160dp">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/view_key_fragment"
|
android:id="@+id/view_key_fragment"
|
||||||
@@ -186,21 +181,16 @@
|
|||||||
android:orientation="vertical" />
|
android:orientation="vertical" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
android:layout_alignBottom="@id/toolbar_big"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginRight="20dp"
|
|
||||||
android:layout_marginBottom="-40dp"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="invisible"
|
android:layout_margin="24dp"
|
||||||
tools:visibility="visible"
|
android:src="@drawable/ic_qrcode_white_24dp"
|
||||||
android:elevation="4dp"
|
app:layout_anchor="@id/app_bar_layout"
|
||||||
fab:fab_icon="@drawable/ic_qrcode_white_24dp"
|
app:layout_anchorGravity="bottom|right|end" />
|
||||||
fab:fab_colorNormal="?attr/colorFab"
|
|
||||||
fab:fab_colorPressed="?attr/colorFabPressed" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -1,95 +1,89 @@
|
|||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:paddingTop="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/card_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:layout_gravity="center"
|
||||||
android:paddingTop="16dp"
|
card_view:cardBackgroundColor="?attr/colorCardViewBackground"
|
||||||
android:paddingBottom="16dp"
|
card_view:cardCornerRadius="4dp"
|
||||||
android:paddingLeft="16dp"
|
card_view:cardElevation="2dp"
|
||||||
android:paddingRight="16dp">
|
card_view:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<LinearLayout
|
||||||
android:id="@+id/card_view"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
card_view:cardBackgroundColor="?attr/colorCardViewBackground"
|
android:orientation="vertical">
|
||||||
card_view:cardElevation="2dp"
|
|
||||||
card_view:cardUseCompatPadding="true"
|
|
||||||
card_view:cardCornerRadius="4dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
|
style="@style/CardViewHeader"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/section_user_ids" />
|
||||||
|
|
||||||
|
<org.sufficientlysecure.keychain.ui.widget.FixedListView
|
||||||
|
android:id="@+id/view_key_user_ids"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:layout_marginBottom="4dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
<TextView
|
<android.support.v7.widget.CardView
|
||||||
style="@style/CardViewHeader"
|
android:id="@+id/linked_system_contact_card"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/section_user_ids"/>
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
card_view:cardBackgroundColor="?attr/colorCardViewBackground"
|
||||||
|
card_view:cardCornerRadius="4dp"
|
||||||
|
card_view:cardElevation="2dp"
|
||||||
|
card_view:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<org.sufficientlysecure.keychain.ui.widget.FixedListView
|
<LinearLayout
|
||||||
android:id="@+id/view_key_user_ids"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="4dp"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:id="@+id/linked_system_contact_card"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:orientation="vertical">
|
||||||
card_view:cardBackgroundColor="?attr/colorCardViewBackground"
|
|
||||||
card_view:cardElevation="2dp"
|
<TextView
|
||||||
card_view:cardUseCompatPadding="true"
|
style="@style/CardViewHeader"
|
||||||
card_view:cardCornerRadius="4dp">
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/section_linked_system_contact" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id='@+id/system_contact_layout'
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:background="?android:selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/system_contact_picture"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/ic_person_grey_48dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/CardViewHeader"
|
android:id="@+id/system_contact_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/section_linked_system_contact"/>
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/view_key_fragment_no_system_contact"
|
||||||
<LinearLayout
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
android:id='@+id/system_contact_layout'
|
|
||||||
android:clickable="true"
|
|
||||||
android:background="?android:selectableItemBackground"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/system_contact_picture"
|
|
||||||
android:layout_margin="6dp"
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/ic_person_grey_48dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/system_contact_name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:text="@string/view_key_fragment_no_system_contact"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</android.support.v7.widget.CardView>
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
Reference in New Issue
Block a user