Commit 61206aae authored by Amirhossein Naghshzan's avatar Amirhossein Naghshzan

QRCodeFragment: change QR activity to bottomSheet

Change-Id: I5662d8c2640b6477a1fa55d34229dce35fbcbd8f
parent 91e49ddc
......@@ -368,13 +368,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:resource="@xml/file_paths" />
</provider>
<activity
android:name=".client.QRCodeActivity"
android:configChanges="screenSize|screenLayout|smallestScreenSize"
android:label="@string/title_activity_qrcode"
android:icon="@mipmap/ic_launcher"
android:resizeableActivity="true"
android:theme="@style/AppTheme" />
<activity
android:name=".client.MediaViewerActivity"
android:exported="false"
......
......@@ -44,6 +44,7 @@ import android.provider.MediaStore;
import android.text.Layout;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.AlignmentSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StyleSpan;
......@@ -72,6 +73,7 @@ import cx.ring.R;
import cx.ring.application.JamiApplication;
import cx.ring.client.HomeActivity;
import cx.ring.databinding.FragAccSummaryBinding;
import cx.ring.fragments.QRCodeFragment;
import cx.ring.model.Account;
import cx.ring.mvp.BaseSupportFragment;
import cx.ring.services.AccountService;
......@@ -80,6 +82,7 @@ import cx.ring.utils.AndroidFileUtils;
import cx.ring.utils.BitmapUtils;
import cx.ring.utils.ContentUriHandler;
import cx.ring.utils.KeyboardVisibilityManager;
import cx.ring.utils.StringUtils;
import cx.ring.views.AvatarDrawable;
import ezvcard.VCard;
import ezvcard.property.FormattedName;
......@@ -189,21 +192,6 @@ public class JamiAccountSummaryFragment extends BaseSupportFragment<JamiAccountS
binding.changePasswordBtn.setOnClickListener(v -> onPasswordChangeAsked());
binding.registerNameBtn.setOnClickListener(v -> showUsernameRegistrationPopup());
binding.ringPassword.setOnEditorActionListener(this::onPasswordEditorAction);
binding.registeredNameCopy.setOnClickListener(v -> {
ClipboardManager clipboard = (ClipboardManager) v.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
if (clipboard != null) {
clipboard.setPrimaryClip(ClipData.newPlainText("Jami username", binding.registeredNameTxt.getText()));
Snackbar.make(binding.getRoot(), getString(R.string.conversation_action_copied_peer_number_clipboard, binding.registeredNameTxt.getText()), Snackbar.LENGTH_SHORT)
.setAnchorView(binding.layoutAddDevice)
.show();
}
});
binding.registeredNameShare.setOnClickListener(v -> {
Intent sendIntent = new Intent(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_TEXT, binding.registeredNameTxt.getText())
.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, null));
});
}
public void setAccount(String accountId) {
......@@ -313,6 +301,8 @@ public class JamiAccountSummaryFragment extends BaseSupportFragment<JamiAccountS
binding.groupRegisteringName.setVisibility(currentRegisteredName ? View.VISIBLE : View.GONE);
binding.groupRegisterName.setVisibility((!hasRegisteredName && !currentRegisteredName) ? View.VISIBLE : View.GONE);
binding.groupRegisteredName.setVisibility(hasRegisteredName ? View.VISIBLE : View.GONE);
binding.btnQr.setOnClickListener(v -> QRCodeFragment.newInstance(QRCodeFragment.INDEX_CODE).show(getParentFragmentManager(), QRCodeFragment.TAG));
binding.btnShare.setOnClickListener(v -> shareAccount(hasRegisteredName? username : account.getUsername()));
if (hasRegisteredName) {
binding.registeredNameTxt.setText(username);
}
......@@ -797,4 +787,14 @@ public class JamiAccountSummaryFragment extends BaseSupportFragment<JamiAccountS
public void setFragmentVisibility(boolean isVisible) {
mIsVisible = isVisible;
}
private void shareAccount(String username) {
if (!StringUtils.isEmpty(username)) {
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, getText(R.string.account_contact_me));
sharingIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.account_share_body, username, getText(R.string.app_website)));
startActivity(Intent.createChooser(sharingIntent, getText(R.string.share_via)));
}
}
}
/*
* Copyright (C) 2004-2019 Savoir-faire Linux Inc.
*
* Authors: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
* Rayan Osseiran <rayan.osseiran@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package cx.ring.client;
import android.content.Context;
import android.os.Bundle;
import com.google.android.material.tabs.TabLayout;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import cx.ring.BuildConfig;
import cx.ring.R;
import cx.ring.share.ScanFragment;
import cx.ring.share.ShareFragment;
public class QRCodeActivity extends AppCompatActivity {
public static final String ACTION_SCAN = BuildConfig.APPLICATION_ID + ".action.scan";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrcode);
ViewPager viewPager = findViewById(R.id.view_pager);
viewPager.setAdapter(new SectionsPagerAdapter(this, getSupportFragmentManager()));
TabLayout tabs = findViewById(R.id.tabs);
tabs.setupWithViewPager(viewPager);
Toolbar toolbar = findViewById(R.id.qrToolbar);
setSupportActionBar(toolbar);
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(true);
supportActionBar.setDisplayShowHomeEnabled(true);
}
toolbar.setNavigationOnClickListener(v -> finish());
}
class SectionsPagerAdapter extends FragmentPagerAdapter {
@StringRes
private final int[] TAB_TITLES = new int[]{R.string.tab_code, R.string.tab_scan};
private final Context mContext;
SectionsPagerAdapter(Context context, FragmentManager fm) {
super(fm);
mContext = context;
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new ShareFragment();
case 1:
return new ScanFragment();
default:
return null;
}
}
@Nullable
@Override
public CharSequence getPageTitle(int position) {
return mContext.getResources().getString(TAB_TITLES[position]);
}
@Override
public int getCount() {
return TAB_TITLES.length;
}
}
}
\ No newline at end of file
/*
* Copyright (C) 2004-2020 Savoir-faire Linux Inc.
*
* Authors: AmirHossein Naghshzan <amirhossein.naghshzan@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package cx.ring.fragments;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.tabs.TabLayout;
import cx.ring.R;
import cx.ring.databinding.FragQrcodeBinding;
import cx.ring.share.ScanFragment;
import cx.ring.share.ShareFragment;
import cx.ring.utils.DeviceUtils;
public class QRCodeFragment extends BottomSheetDialogFragment {
public static final String TAG = QRCodeFragment.class.getSimpleName();
public static final String ARG_START_PAGE_INDEX = "start_page";
public static final int INDEX_CODE = 0;
public static final int INDEX_SCAN = 1;
public static QRCodeFragment newInstance(int startPage) {
QRCodeFragment fragment = new QRCodeFragment();
Bundle args = new Bundle();
args.putInt(ARG_START_PAGE_INDEX, startPage);
fragment.setArguments(args);
return fragment;
}
private FragQrcodeBinding mBinding;
private int mStartPageIndex;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
Bundle args = getArguments();
mStartPageIndex = args.getInt(ARG_START_PAGE_INDEX, 0);
mBinding = FragQrcodeBinding.inflate(inflater, container, false);
mBinding.viewPager.setAdapter(new SectionsPagerAdapter(getContext(), getChildFragmentManager()));
mBinding.tabs.setupWithViewPager(mBinding.viewPager);
return mBinding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (mStartPageIndex != 0) {
mBinding.tabs.getTabAt(mStartPageIndex).select();
}
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialogINterface) {
if (DeviceUtils.isTablet(getContext())) {
dialog.getWindow().setLayout(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT);
}
}
});
return dialog;
}
class SectionsPagerAdapter extends FragmentPagerAdapter {
@StringRes
private final int[] TAB_TITLES = new int[]{R.string.tab_code, R.string.tab_scan};
private final Context mContext;
SectionsPagerAdapter(Context context, FragmentManager fm) {
super(fm);
mContext = context;
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new ShareFragment();
case 1:
return new ScanFragment();
default:
return null;
}
}
@Nullable
@Override
public CharSequence getPageTitle(int position) {
return mContext.getResources().getString(TAB_TITLES[position]);
}
@Override
public int getCount() {
return TAB_TITLES.length;
}
}
@Override
public void onResume() {
super.onResume();
addGlobalLayoutListener(getView());
}
private void addGlobalLayoutListener(final View view) {
view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
setPeekHeight(v.getMeasuredHeight());
v.removeOnLayoutChangeListener(this);
}
});
}
public void setPeekHeight(int peekHeight) {
BottomSheetBehavior behavior = getBottomSheetBehaviour();
if (behavior == null) {
return;
}
behavior.setPeekHeight(peekHeight);
}
private BottomSheetBehavior getBottomSheetBehaviour() {
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) ((View) getView().getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = layoutParams.getBehavior();
if (behavior != null && behavior instanceof BottomSheetBehavior) {
return (BottomSheetBehavior) behavior;
}
return null;
}
@Override
public int getTheme() {
return R.style.BottomSheetDialogTheme;
}
}
\ No newline at end of file
......@@ -44,6 +44,7 @@ import androidx.appcompat.widget.Toolbar;
import android.os.Handler;
import android.text.InputType;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
......@@ -64,7 +65,6 @@ import cx.ring.application.JamiApplication;
import cx.ring.client.CallActivity;
import cx.ring.client.ConversationActivity;
import cx.ring.client.HomeActivity;
import cx.ring.client.QRCodeActivity;
import cx.ring.databinding.FragSmartlistBinding;
import cx.ring.model.CallContact;
import cx.ring.model.Conversation;
......@@ -115,6 +115,8 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
binding.newconvFab.show();
setOverflowMenuVisible(menu, true);
changeSeparatorHeight(false);
binding.qrCode.setVisibility(View.GONE);
setTabletQRLayout(false);
return true;
}
......@@ -124,6 +126,8 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
binding.newconvFab.hide();
setOverflowMenuVisible(menu, false);
changeSeparatorHeight(true);
binding.qrCode.setVisibility(View.VISIBLE);
setTabletQRLayout(true);
return true;
}
});
......@@ -188,9 +192,6 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
mDialpadMenuItem.setIcon(R.drawable.baseline_keyboard_24);
}
return true;
case R.id.menu_scan_qr:
presenter.clickQRSearch();
return true;
case R.id.menu_settings:
((HomeActivity) getActivity()).goToSettings();
return true;
......@@ -242,6 +243,8 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
setHasOptionsMenu(true);
super.onViewCreated(view, savedInstanceState);
binding.qrCode.setOnClickListener(v -> presenter.clickQRSearch());
binding.confsList.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
......@@ -459,10 +462,11 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
}
@Override
public void goToQRActivity() {
Intent intent = new Intent(QRCodeActivity.ACTION_SCAN)
.setClass(requireActivity(), QRCodeActivity.class);
startActivityForResult(intent, HomeActivity.REQUEST_CODE_QR_CONVERSATION);
public void goToQRFragment() {
QRCodeFragment qrCodeFragment = QRCodeFragment.newInstance(QRCodeFragment.INDEX_SCAN);
qrCodeFragment.show(getParentFragmentManager(), QRCodeFragment.TAG);
binding.qrCode.setVisibility(View.GONE);
setTabletQRLayout(false);
}
@Override
......@@ -510,4 +514,23 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
}
}
private void setTabletQRLayout(boolean show) {
if (!DeviceUtils.isTablet(getContext()))
return;
RelativeLayout.LayoutParams params =
(RelativeLayout.LayoutParams) binding.listCoordinator.getLayoutParams();
if (show) {
params.addRule(RelativeLayout.BELOW, R.id.qr_code);
params.topMargin = 0;
} else {
params.removeRule(RelativeLayout.BELOW);
TypedValue value = new TypedValue();
if (getActivity().getTheme().resolveAttribute(android.R.attr.actionBarSize, value, true)) {
params.topMargin = TypedValue.complexToDimensionPixelSize(value.data, getResources().getDisplayMetrics());
}
}
binding.listCoordinator.setLayoutParams(params);
}
}
......@@ -32,8 +32,6 @@ import androidx.core.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
......@@ -59,6 +57,9 @@ public class ScanFragment extends BaseSupportFragment {
public static final String TAG = ScanFragment.class.getSimpleName();
private boolean mIsVisible;
private boolean mIsStarted;
private DecoratedBarcodeView barcodeView;
private TextView mErrorMessageTextView;
......@@ -84,14 +85,9 @@ public class ScanFragment extends BaseSupportFragment {
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
if (!hasCameraPermission()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(new String[]{Manifest.permission.CAMERA}, JamiApplication.PERMISSIONS_REQUEST);
} else {
displayNoPermissionsError();
}
}
mIsVisible = isVisibleToUser;
if (mIsVisible && mIsStarted) {
checkPermission();
}
}
......@@ -115,13 +111,17 @@ public class ScanFragment extends BaseSupportFragment {
}
@Override
public void onCreateOptionsMenu(Menu menu, @NonNull MenuInflater inflater) {
menu.clear();
public void onStart() {
super.onStart();
mIsStarted = true;
if (mIsVisible)
checkPermission();
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
menu.clear();
public void onStop() {
super.onStop();
mIsStarted = false;
}
private void showErrorPanel(final int textResId) {
......@@ -147,7 +147,6 @@ public class ScanFragment extends BaseSupportFragment {
showErrorPanel(R.string.error_scan_no_camera_permissions);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
......@@ -198,4 +197,15 @@ public class ScanFragment extends BaseSupportFragment {
getActivity().setResult(Activity.RESULT_OK, intent);
getActivity().finish();
}
private void checkPermission() {
if (!hasCameraPermission()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(new String[]{Manifest.permission.CAMERA}, JamiApplication.PERMISSIONS_REQUEST);
} else {
displayNoPermissionsError();
}
}
}
}
......@@ -24,9 +24,6 @@ import android.graphics.Bitmap;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
......@@ -69,27 +66,6 @@ public class ShareFragment extends BaseSupportFragment<SharePresenter> implement
});
}
@Override
public void onCreateOptionsMenu(@NonNull Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.qr_menu, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.menu_qr_share:
if (!isShareLocked) {
shareAccount();
return true;
} else {
return false;
}
default:
return super.onOptionsItemSelected(item);
}
}
private void shareAccount() {
if (!TextUtils.isEmpty(mUriToShow)) {
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
......@@ -105,7 +81,8 @@ public class ShareFragment extends BaseSupportFragment<SharePresenter> implement
if (binding == null)
return;
final QRCodeUtils.QRCodeData qrCodeData = viewModel.getAccountQRCodeData(0xFF000000, 0xFFFFFFFF);
final QRCodeUtils.QRCodeData qrCodeData = viewModel.getAccountQRCodeData(
getResources().getColor(R.color.colorPrimary), getResources().getColor(R.color.transparent));
if (qrCodeData == null) {
binding.qrImage.setVisibility(View.INVISIBLE);
binding.shareInstruction.setText(R.string.share_message_no_account);
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="@dimen/bottom_sheet_radius"
android:topRightRadius="@dimen/bottom_sheet_radius" />
<solid android:color="@color/background_bottom_sheet" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M15,21h-2v-2h2V21zM13,14h-2v5h2V14zM21,12h-2v4h2V12zM19,10h-2v2h2V10zM7,12H5v2h2V12zM5,10H3v2h2V10zM12,5h2V3h-2V5zM4.5,4.5v3h3v-3H4.5zM9,9H3V3h6V9zM4.5,16.5v3h3v-3H4.5zM9,21H3v-6h6V21zM16.5,4.5v3h3v-3H16.5zM21,9h-6V3h6V9zM19,19v-3l-4,0v2h2v3h4v-2H19zM17,12l-4,0v2h4V12zM13,10H7v2h2v2h2v-2h2V10zM14,9V7h-2V5h-2v4L14,9zM6.75,5.25h-1.5v1.5h1.5V5.25zM6.75,17.25h-1.5v1.5h1.5V17.25zM18.75,5.25h-1.5v1.5h1.5V5.25z"
android:fillColor="#000000"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/share_instruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:text="@string/share_message"
android:textColor="@color/textColorPrimary"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/share_button"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="@+id/share_button"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/qr_image"
android:layout_width="@dimen/qr_code_size"
android:layout_height="@dimen/qr_code_size"
android:layout_marginTop="8dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="8dp"
android:background="@null"
android:gravity="center"
android:padding="@dimen/padding_small"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/share_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/share_label"
android:theme="@style/ButtonColored"
app:layout_constraintEnd_toStartOf="@+id/qr_image"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/share_instruction" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -7,11 +7,36 @@
android:animateLayoutChanges="true"
tools:context=".client.HomeActivity">
<com.google.android.material.card.MaterialCardView
android:id="@+id/qr_code"
android:layout_width="300dp"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_toLeftOf="@+id/separator"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="?actionBarSize"
android:visibility="gone"
tools:visibility="visible" >