question

rthor avatar image
rthor asked Mark Mullan Deactivated edited

Disappearing Soft Navigation

When launching the intent for ACTION_CUSTOMER_ADD_TIP and then exiting out of it, the bottom soft navigation (back, home, tasks) does not reappear, as well as not being able to get the swipe down menu to show. However, it works when launching other intents such as ACTION_SECURE_PAY. Is this intentional or a bug? If it's intentional, how to I re-enable to bottom soft navigation and the swipe down menu?

Below is an example activity to illustrate the issue
public class MainActivity extends Activity {
    private static final int COLLECT_TIP_REQUEST = 1;
    private static final int COLLECT_PAYMENT_REQUEST = 2;
    private static final String TEST_ORDER_ID = "A1C0YDR316FQC";
    private static final long TEST_TIP_AMOUNT = 101L;
    private static final long TEST_PAYMENT_AMOUNT = 222L;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        findViewById(R.id.btnTip).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final Intent intent = new Intent(ACTION_CUSTOMER_ADD_TIP);
                intent.putExtra(com.clover.sdk.v1.Intents.EXTRA_ORDER_ID, TEST_ORDER_ID);
                intent.putExtra(com.clover.sdk.v1.Intents.EXTRA_AMOUNT, 222L);
                startActivityForResult(intent, COLLECT_TIP_REQUEST);
            }
        });


        findViewById(R.id.btnPay).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final Intent intent = new Intent(ACTION_SECURE_PAY);
                intent.putExtra(com.clover.sdk.v1.Intents.EXTRA_ORDER_ID, TEST_ORDER_ID);
                intent.putExtra(com.clover.sdk.v1.Intents.EXTRA_AMOUNT, TEST_PAYMENT_AMOUNT);
                intent.putExtra(com.clover.sdk.v1.Intents.EXTRA_TIP_AMOUNT, TEST_TIP_AMOUNT);
                startActivityForResult(intent, COLLECT_PAYMENT_REQUEST);
            }
        });
    }
}
And layout file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.mypackage.disappearingnavbar.MainActivity">
    <Button
        android:id="@+id/btnTip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Launch Tip"/>

    <Button
        android:id="@+id/btnPay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintLeft_toRightOf="@id/btnTip"
        android:text="Launch Payment"/>

</android.support.constraint.ConstraintLayout>
Thanks in advance
PaymentsClover Android SDK
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chanel avatar image chanel commented ·

Hi @rThor, which Clover device are you seeing this issue on?

0 Likes 0 ·
rthor avatar image rthor chanel commented ·

at least the Flex and Mobile. Haven't tried others yet.

0 Likes 0 ·

1 Answer

Mark Mullan avatar image
Mark Mullan Deactivated answered Mark Mullan Deactivated edited
Hi @rThor

This is functioning as designed for internal purposes. The intent launches our Secure Payments application in CustomerMode (intended), and captures a tipAmount which is returned onActivityResult https://github.com/clover/clover-android-sdk/blob/....

We then use that information to populate the EXTRA_TAX_AMOUNT for ACTION_SECURE_PAY, and immediately start the latter to begin our payment flow. For this reason, there's no reason for us to disable CustomerMode when ACTION_CUSTOMER_ADD_TIP finishes, because we immediately launch a different activity which is also in CustomerMode.

To be on the safe side, you can startActivityForResult() on both of these intents, and onActivityResult(), leave CustomerMode and regain the navigation bars yourself via our CustomerMode API, which we expose in the clover-android-sdk.

CustomerMode.disable(this, false);

2nd argument is a boolean of whether or not to require employee passcode entry upon CustomerMode being disabled.

Thanks,
Mark
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community