Fix displayed amounts. Send Firebase token with install_new.

This commit is contained in:
Akinwale Ariwodola 2020-05-19 19:38:30 +01:00
parent 3e032a0f9d
commit 39b91a8886
4 changed files with 56 additions and 3 deletions

View file

@ -121,7 +121,7 @@ public class Claim {
return new BigDecimal(String.valueOf(amount / usdRate)); return new BigDecimal(String.valueOf(amount / usdRate));
} }
return new BigDecimal(String.valueOf(amount)).divide(new BigDecimal(100000000)); // deweys return new BigDecimal(String.valueOf(amount)); // deweys
} }
return new BigDecimal(0); return new BigDecimal(0);
@ -363,7 +363,8 @@ public class Claim {
Fee fee = null; Fee fee = null;
if (feeAmount > 0) { if (feeAmount > 0) {
fee = new Fee(); fee = new Fee();
fee.setAmount(String.valueOf(feeAmount)); fee.setAmount(String.valueOf(new BigDecimal(String.valueOf(feeAmount)).divide(new BigDecimal(100000000))));
fee.setCurrency("LBC");
} }
((StreamMetadata) metadata).setFee(fee); ((StreamMetadata) metadata).setFee(fee);

View file

@ -0,0 +1,31 @@
package io.lbry.browser.ui.publish;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import io.lbry.browser.R;
import io.lbry.browser.ui.BaseFragment;
public class PublishFormFragment extends BaseFragment {
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_publishes, container, false);
return root;
}
@Override
public boolean shouldHideGlobalPlayer() {
return true;
}
@Override
public boolean shouldSuspendGlobalPlayer() {
return true;
}
}

View file

@ -212,7 +212,12 @@ public final class Lbryio {
} }
Map<String, String> options = new HashMap<>(); Map<String, String> options = new HashMap<>();
//options.put("firebase_token", null); if (context instanceof MainActivity) {
String firebaseToken = ((MainActivity) context).getFirebaseMessagingToken();
if (!Helper.isNullOrEmpty(firebaseToken)) {
options.put("firebase_token", firebaseToken);
}
}
options.put("app_version", appVersion); options.put("app_version", appVersion);
options.put("app_id", Lbry.INSTALLATION_ID); options.put("app_id", Lbry.INSTALLATION_ID);
options.put("node_id", ""); options.put("node_id", "");

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/publish_form_display_area"
android:elevation="4dp"
android:orientation="vertical"
android:layout_weight="10"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>