Skip to content

Commit

Permalink
Several UI fixes, b 239
Browse files Browse the repository at this point in the history
  • Loading branch information
MIPPL committed Oct 25, 2019
1 parent 05afdf8 commit fe73873
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 12 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId = 'com.wagerrwallet'
minSdkVersion 23
targetSdkVersion 28
versionCode 237
versionName "237"
versionCode 239
versionName "239"
multiDexEnabled true

// Similar to other properties in the defaultConfig block,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,13 @@ public void onClick(View v) {
boolean cryptoPreferred = BRSharedPrefs.isCryptoPreferred(this);

if (cryptoPreferred) {
swap();
setPriceTags(cryptoPreferred, false);
//swap(); // buggy when restoring activity
}

// Check if the "Twilight" screen altering app is currently running
if (checkIfScreenAlteringAppIsRunning("com.urbandroid.lux")) {

BRDialog.showSimpleDialog(this, getString(R.string.Dialog_screenAlteringTitle), getString(R.string.Dialog_screenAlteringMessage));


}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
Expand Down Expand Up @@ -239,14 +240,23 @@ public void checkLatestVersion(final Activity app) {

JSONObject jsonObject = new JSONObject(jsonString);
String sTag = jsonObject.getString("tag_name");
int tag = Integer.parseInt((sTag!=null)?sTag:"");
final int tag = Integer.parseInt((sTag!=null)?sTag:"");

PackageInfo pInfo = app.getPackageManager().getPackageInfo(app.getPackageName(), 0);
String version = pInfo.versionName;
int versionCode = pInfo.versionCode;
Log.d("MyApp", "Version Name : "+version + "\n Version Code : "+versionCode);
if (versionCode < tag) {
BRDialog.showSimpleDialog(app, "New version available", "A new version of Wagerr Bet app is available");
//BRDialog.showSimpleDialog(app, "New version available", "A new version of Wagerr Bet app is available");
BRDialog.showCustomDialog(app, "New version available", "A new version of Wagerr Bet app is available", app.getString(R.string.Button_ok), null, new BRDialogView.BROnClickListener() {
@Override
public void onClick(BRDialogView brDialogView) {
brDialogView.dismiss();
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("https://github.com/wagerr/WagerrWalletAndroid/releases/tag/%d", tag)));
app.startActivity(browserIntent);
app.overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300);
}
}, null, null, 0);
}
} catch(PackageManager.NameNotFoundException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
Expand Down Expand Up @@ -70,6 +72,7 @@ public class FragmentEventDetails extends DialogFragment implements View.OnClick

private BRText mTxEventHeader;
private BRText mTxEventDate;
private BRText mTxEventId;
private BRText mTxHomeTeam;
private BRText mTxAwayTeam;
//private BRText mTxHomeResult;
Expand Down Expand Up @@ -171,6 +174,16 @@ public void onClick(View v) {
mMainLayout = rootView.findViewById(R.id.dynamic_container);
mTxEventHeader = rootView.findViewById(R.id.tx_eventheader);
mTxEventDate= rootView.findViewById(R.id.tx_eventdate);
mTxEventId= rootView.findViewById(R.id.tx_eventid);
final long evID = mTransaction.getEventID();
mTxEventId.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("https://explorer.wagerr.com/#/bet/event/%d", evID)));
startActivity(browserIntent);
getActivity().overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300);
}
});
mTxHomeTeam = rootView.findViewById(R.id.tx_home);
mTxAwayTeam= rootView.findViewById(R.id.tx_away);
//mTxHomeResult = rootView.findViewById(R.id.tx_home_result);
Expand Down Expand Up @@ -636,6 +649,7 @@ public void updateUi() {

mTxEventHeader.setText(item.getTxEventHeader());
mTxEventDate.setText( item.getTxEventDate() );
mTxEventId.setText( String.format("Event #%d",item.getEventID()) );

// timestamp is 0 if it's not confirmed in a block yet so make it now
mTxDate.setText(BRDateUtil.getEventDate(mTransaction.getTimestamp() == 0 ? System.currentTimeMillis() : (mTransaction.getTimestamp() * 1000)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -254,7 +255,7 @@ else if (confirms == 3)
if (item.getBetEntity()==null) {
if (item.isCoinbase() && item.getBlockHeight() != Integer.MAX_VALUE) { // then payout reward
boolean immature = (nCurrentHeight - item.getBlockHeight()) <= PAYOUT_MATURITY;
String strMatureInfo = String.format("%d/%d", (nCurrentHeight - item.getBlockHeight()), PAYOUT_MATURITY);
String strMatureInfo = String.format("<b>%d/%d</b>", (nCurrentHeight - item.getBlockHeight()), PAYOUT_MATURITY);
int amountColor = (!immature) ? R.color.transaction_amount_payout_color : R.color.transaction_amount_inmature_color;
convertView.transactionAmount.setTextColor(mContext.getResources().getColor(amountColor, null));
BetResultTxDataStore brds = BetResultTxDataStore.getInstance(mContext);
Expand All @@ -273,7 +274,7 @@ else if (confirms == 3)
txDate = "PAYOUT";
}
isNormalTx = false;
if (immature) txDate += " " + strMatureInfo;
if (immature) txDate += " " + strMatureInfo;
}
else {
if (level > 4) {
Expand All @@ -296,7 +297,7 @@ else if (confirms == 3)
}

convertView.transactionDetail.setText(txDescription);
convertView.transactionDate.setText(shortDate + " " + txDate);
convertView.transactionDate.setText(Html.fromHtml(shortDate + " " + txDate));
}

private void showTransactionProgress(TxHolder holder, int progress) {
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/layout/event_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@
android:textSize="18sp"
app:customTFont="CircularPro-Book.otf" />

<com.wagerrwallet.presenter.customviews.BRText
android:id="@+id/tx_eventid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tx_eventheader"
android:layout_marginRight="22dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:text="Event #77777"
android:textColor="@color/blue"
android:textSize="18sp"
app:customTFont="CircularPro-Book.otf" />

<com.wagerrwallet.presenter.customviews.BRText
android:id="@+id/tx_home_label"
android:layout_width="165dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
<!-- No Passcode set warning title -->
<string name="Prompts.NoPasscode.title">Turn device passcode on</string>
<!-- Instruction how to enable device encryption -->
<string name="Prompts.NoScreenLock.body.android">A device screen lock is needed to safeguard your wallet. Go to \"Settings\" &gt; \"Security\" &gt; \"Screen lock\" and enable to continue.</string>
<string name="Prompts.NoScreenLock.body.android">A device screen lock is mandatory to use the Wagerr wallet. Please enable the screen lock in your device settings and reinstall the application to enable wallet encryption</string>
<!-- Warn user key store data has been invalidate because the user changed their security settings. The user must wipe their app data. -->
<!-- Warn user key store data has been invalidate because the user changed their security settings. The user must uninstall. -->
<string name="Alert.keystore.invalidated.uninstall.android">We can\'t proceed because your screen lock settings have been changed (e.g. password was disabled, fingerprints were changed). For security purposes, Android has permanently locked your key store. Therefore, your Wagerr app data must be wiped by uninstalling. Don’t worry, your funds are still secure! Reinstall the app and recover your wallet using your paper key.</string>
Expand Down

0 comments on commit fe73873

Please sign in to comment.