Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* The MIT License (MIT)
* Copyright (c) 2018 Hyperwallet Systems Inc.
* Copyright (c) 2019 Hyperwallet Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
Expand All @@ -14,7 +14,7 @@
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.hyperwallet.android.ui.view.widget;
package com.hyperwallet.android.ui.common.view;

import android.os.SystemClock;
import android.view.View;
Expand Down Expand Up @@ -44,3 +44,4 @@ public void onClick(View v) {
*/
public abstract void onOneClick(View v);
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
*/
public class Event<T> {

private final T content;
private final T mContent;
private boolean mIsContentConsumed;

public Event(@NonNull final T t) {
content = t;
mContent = t;
}

/**
Expand All @@ -38,7 +38,7 @@ public Event(@NonNull final T t) {
@NonNull
public T getContent() {
mIsContentConsumed = true;
return content;
return mContent;
}

/**
Expand All @@ -58,7 +58,7 @@ public boolean isContentConsumed() {
public T getContentIfNotConsumed() {
if (!mIsContentConsumed) {
mIsContentConsumed = true;
return content;
return mContent;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* The MIT License (MIT)
* Copyright (c) 2019 Hyperwallet Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.hyperwallet.android.ui.common.viewmodel;

/**
* Detail interface for having a list UI with detail information through navigation
*/
public interface ListDetailNavigator<Event> {

/**
* Navigate action
*
* @param e Navigation event
*/
void navigate(Event e);
}
8 changes: 8 additions & 0 deletions common/src/main/res/drawable/view_item_ripple.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorSecondaryLight">

<item
android:id="@android:id/mask"
android:drawable="@android:color/black"/>
</ripple>
5 changes: 5 additions & 0 deletions common/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
</style>

<style name="TextAppearance.Hyperwallet.Subtitle1"
parent="@style/TextAppearance.MaterialComponents.Subtitle1">
<item name="android:textStyle">bold</item>
</style>
</resources>


2 changes: 1 addition & 1 deletion receipt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ sonarqube {
property "sonar.libraries", libraries
property "sonar.projectName", "android-ui-sdk-receipt"
}
}
}
3 changes: 3 additions & 0 deletions receipt/config/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
<issue id="RtlEnabled">
<ignore regexp="(AndroidManifest).xml"/>
</issue>
<issue id="Overdraw">
<ignore regexp="(item_receipt).xml"/>
</issue>
</lint>
3 changes: 2 additions & 1 deletion receipt/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyperwallet.android.ui.receipt.test">

<application android:name="com.hyperwallet.android.HyperwalletInstrumentedTestApplication">
<application
android:name="com.hyperwallet.android.ui.receipt.HyperwalletInstrumentedTestApplication">

</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.hyperwallet.android.ui.receipt;


import android.app.Application;

import com.squareup.leakcanary.InstrumentationLeakDetector;
import com.squareup.leakcanary.LeakCanary;

public class HyperwalletInstrumentedTestApplication extends Application {

@Override
public void onCreate() {

super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
installLeakCanary();
}


protected void installLeakCanary() {

InstrumentationLeakDetector.instrumentationRefWatcher(this)
.buildAndInstall();

}

}
Loading