Merge pull request #1076 from AlphaWallet/Allow-Change-Wallet-Override

Add single wallet mode
pull/1088/head
James Brown 5 years ago committed by GitHub
commit 60f3c1a9e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/src/awallet/java/com/alphawallet/app/entity/VisibilityFilter.java
  2. 14
      app/src/main/java/com/alphawallet/app/ui/NewSettingsFragment.java
  3. 52
      app/src/main/res/layout/fragment_settings.xml

@ -83,4 +83,10 @@ public class VisibilityFilter
{
return true;
}
//Allow multiple wallets (true) or single wallet mode (false)
public static boolean canChangeWallets()
{
return true;
}
}

@ -19,6 +19,7 @@ import android.view.ViewGroup;
import android.widget.*;
import com.alphawallet.app.entity.MediaLinks;
import com.alphawallet.app.entity.VisibilityFilter;
import com.alphawallet.app.repository.EthereumNetworkRepository;
import com.alphawallet.app.util.LocaleUtils;
@ -101,9 +102,16 @@ public class NewSettingsFragment extends Fragment
});
final LinearLayout layoutManageWallets = view.findViewById(R.id.layout_manage_wallets);
layoutManageWallets.setOnClickListener(v -> {
viewModel.showManageWallets(getContext(), false);
});
if (VisibilityFilter.canChangeWallets())
{
layoutManageWallets.setOnClickListener(v -> {
viewModel.showManageWallets(getContext(), false);
});
}
else
{
layoutManageWallets.setVisibility(View.GONE);
}
layoutBackupKey = view.findViewById(R.id.layout_backup_wallet);
layoutBackupKey.setOnClickListener(v -> {

@ -77,41 +77,45 @@
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:background="@color/greye5"/>
<LinearLayout
android:id="@+id/layout_manage_wallets"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_height="71dp"
android:orientation="vertical"
android:background="@drawable/selector_settings_item">
<RelativeLayout
android:layout_width="40dp"
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:background="@color/greye5"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="10dp">
android:layout_marginStart="20dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_width="40dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:src="@drawable/ic_change_wallet" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="@font/font_light"
android:text="@string/toolbar_title_wallets"
android:textColor="@color/black"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="@font/font_light"
android:text="@string/toolbar_title_wallets"
android:textColor="@color/black"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout

Loading…
Cancel
Save